Skip to content

Guard native flyout placement writes with an internal analyzer - #1835

Open
PaperHammer (PaperHammer) wants to merge 1 commit into
microsoft:mainfrom
PaperHammer:fix/issue964-flyout-placement-analyzer
Open

PaperHammer (PaperHammer) wants to merge 1 commit into
microsoft:mainfrom
PaperHammer:fix/issue964-flyout-placement-analyzer

Conversation

@PaperHammer

Copy link
Copy Markdown
Contributor

Summary

Replace the negative syntactic source scan with the repo-only REACTOR_FLYOUT_001 analyzer. Detected native placement writes outside the exact FlyoutPlacement.Apply method now produce an Error diagnostic during editing and compilation.

  • Resolve native Placement, PlacementProperty and DependencyObject writer symbols instead of guessing from type names. This handles inheritance, using aliases and target-typed initializers while allowing immutable Element descriptions and unrelated same-named properties.
  • Follow finite scalar local DP aliases through declarations, copies, overwrites, ordinary branches and loops.
  • Retain the existing decision tests, six-method positive routing inventory and per-branch live fixtures. Add two assertions that explicit-to-Auto updates actually clear the local DP value.
  • Keep the rule in the existing non-shipping internal analyzer assembly, add diagnostic and packaging regression coverage, and update the architecture template and generated guide.

Linked issue / spec

Fixes #964.

Follows #967, which consolidated the placement helpers. The existing FlyoutPlacement.Apply runtime behavior is unchanged.

Test plan

  • dotnet restore Reactor.slnx, then dotnet build Reactor.slnx --no-restore -c Release: passed with 0 errors and 369 warnings.
  • Release/x64 unit build: passed.
  • All 85 FlyoutPlacement-related tests and both analyzer packaging tests passed in the full Release/x64 run, verified from the TRX report.
  • Unpackaged Debug/x64 native fixtures: 20 passed, 0 failed, 0 skipped across the FlyoutPlacement, CmdBarFlyout and fresh CommandBarFlyout update groups.
  • Mutation-checked local alias detection: disabling scalar-local alias reads caused all 13 corresponding cases to fail; restoring the implementation passed the focused suite.
  • Regenerated the analyzer-architecture guide from its template and passed git diff --check.
  • Full Reactor.Tests suite green: the Release/x64 run has 16,978 passed, 19 skipped and 2 failed.

The two failures are the existing CS1503 string-to-Element suggestion cases in
SymbolSuggesterTests and DidYouMeanAnalyzerParityTests. Both also failed
after rebuilding and running the unmodified 53b094b8 baseline.

Risk / breaking changes

No public API or application runtime behavior changes. The analyzer remains
internal to the Reactor build and is not distributed to consumers.

Local alias inference deliberately skips executable bodies containing exception
regions, switch/patterns, deconstruction or ref/out operations. Tuple and heap
storage, captured locals, parameters and helper-return origins are not tracked.
Direct native property and direct DP-symbol checks remain active in those bodies.

The analyzer detects bypass writes, not deleted calls. The method-level positive
inventory and per-branch live fixtures therefore remain independent safeguards.

Focused unpackaged native fixtures were rerun. Full selftests, packaged tests,
E2E and NativeAOT runtime validation were not rerun for this change.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Enforce the FlyoutBase.Placement choke point with an internal analyzer instead of a syntactic test scan

1 participant