Repository navigation
Switch to AnyCPU for libraries, migrate to slnx - #187
Chris Anderson (codemonkeychris) merged 6 commits into
Conversation
Replace the Platform-based architecture selection (x64/ARM64) with RuntimeIdentifier-based selection. All projects now default to AnyCPU; the correct native Windows App SDK DLLs are resolved via RuntimeIdentifier (win-x64/win-arm64) set automatically in Directory.Build.targets based on machine architecture. Changes: - Directory.Build.props: Remove Platform override that forced AnyCPU to x64/ARM64 - Directory.Build.targets: Add RuntimeIdentifier default for Windows TFM projects (net8.0+) when Platform is AnyCPU - All ~100 .csproj files: Remove <Platforms>x64;ARM64</Platforms> - Reactor.Cli: Update MirrorBinForSelfhost to resolve arch from RuntimeIdentifier (keeps bin/x64 and bin/arm64 layout) - Solution file: Update Any CPU/x86 project mappings to use Any CPU (instead of remapping to x64) - release.yml: Remove -p:Platform=x64 from build/pack (keep --runtime for publish) - coverage.yml: Replace hardcoded bin/x64 path with dynamic file lookup - Update AGENTS.md, CONTRIBUTING.md, README.md, PR template, devtools skill doc The release workflow still produces RID-specific CLI binaries (win-x64 + win-arm64) for the skill kit. The NuGet package is now architecture-neutral. Fixes #185 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Revise the AnyCPU approach based on feedback: - Libraries (Reactor, Reactor.Interop.WinForms) explicitly set Platform=AnyCPU and Platforms=AnyCPU — they produce architecture- neutral IL. - Application/test projects keep the existing x64/ARM64 platform selection via Directory.Build.props (defaults to machine arch). - WindowsAppSDKSelfContained apps need a concrete architecture for native asset resolution; this is supplied by Platform (x64/ARM64). Also migrates from Reactor.sln to Reactor.slnx: - Cleaner XML format, no per-project platform mapping boilerplate - Solution platforms reduced to x64 and ARM64 (removed Any CPU/x86) - Library projects have no platform mappings (always AnyCPU) Remove Directory.Build.targets RuntimeIdentifier logic — no longer needed since apps use Platform directly for native assets. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Each project declares its own platform requirements: - Application/test/sample projects: <Platforms>x64;ARM64</Platforms> (need concrete arch for WindowsAppSDKSelfContained native assets) - Library projects (Reactor, Reactor.Interop.WinForms): no Platforms (MSBuild defaults to AnyCPU; IL is always architecture-neutral) - Analyzers/generators (netstandard2.0): inherently AnyCPU Directory.Build.props no longer contains Platform fallback logic. When building a single app project directly, pass -p:Platform=x64 (or ARM64). Solution builds get Platform from the .slnx config. CI workflows now pass explicit -p:Platform=x64 for standalone project builds. Fix SelfTests: pure MSTest runner, no Windows App SDK dependency — set WindowsAppSDKSelfContained=false and remove Platforms. Fix .sln → .slnx migration: update FindHostExe() repo-root lookups in SelfTestBatch, TestSession, WinFormsTestSession, and CompileCommand to search for Reactor.slnx instead of Reactor.sln. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
@microsoft-github-policy-service agree company="microsoft" |
StressPerf.Wpf and CmdPerf.Wpf target net10.0-windows (no WinAppSDK), so they don't need WindowsAppSDKSelfContained and can be AnyCPU. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
PerfBench.Shared, StressPerf.Shared, StressPerf.Wpf, CmdPerf.Wpf, Chat.UI, and Reactor.SelfTests no longer declare x64/ARM64 Platforms, so their slnx entries must not map to those configurations. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Chris Anderson (codemonkeychris)
left a comment
There was a problem hiding this comment.
Please check the nuget packaging - i think i ended up with x64/arm64 branches in there for the deployment of mur.exe (CLI devtool)... just check that the package generated correctly. Morten Nielsen (@dotMorten) has been dogfooding the nuget package from the builds, so I don't want to break him.
|
Verified locally — packaging is unchanged. NuGet package (framework): No x64/ARM64 branches — CLI skill kit (mur.exe): release.yml still publishes with
|
# Conflicts: # Reactor.sln
Chris Anderson (codemonkeychris)
left a comment
There was a problem hiding this comment.
lgtm
1aa6e02
into
microsoft:main
…Core; explicit using in RangeSourceStateTests Copilot round-7 review (1211fb3): - ReactorApp.cs (3478564671): OpenWindowCore created the ReactorWindow, then invoked configure?.Invoke(window.Host) OUTSIDE any cleanup scope — a throwing configure (or a throwing RegisterWindow) leaked the window (never disposed, never returned). The #187 trace-removal rewrite of this method surfaced it (the original logged + rethrew without disposing either). Wrap configure + register + mount in one try; on any failure dispose the window, and unregister only if RegisterWindow completed (the 'registered' flag) — mirrors the OpenTrayIcon cleanup pattern just below. Happy path and the existing mount-failure path are behaviorally unchanged; only the previously-leaking error paths now clean up. - RangeSourceStateTests.cs: add an explicit using System.Collections.Generic;. Redundant under this project's ImplicitUsings=enable (csproj L8) — the file has compiled since it was added (commit a0b3392) and a forced non-incremental rebuild + full dotnet test are green — so this is explicit-import hygiene to settle a recurring reviewer flag, NOT a compile fix. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…omics (#660) Remove per-frame delegate/closure allocations and full-barrier atomics from the render-loop hosts (ReactorHost + ReactorHostControl), which run at render/data-tick frequency on the data-grid stress workload: #178 QueryCache.DispatcherPost: pass action.Invoke, drop the () => action() trampoline #179 cache _rerenderAction instead of () => RequestRender() every render #180 cache _renderLoopHandler (DispatcherQueueHandler) for TryEnqueue #181 cache _requestRenderAction (RequestRender method group) for BeginRender + Reconcile #182 HotReloadService.ConsumeUpdatePending: Volatile.Read fast-path, atomic only when pending #183 AnimationAmbient.HasAny sentinel gates the per-setState AsyncLocal walk #185 _lastRenderMs: Volatile.Write (single writer) instead of Interlocked.Exchange #186 report gate: integer ElapsedMilliseconds compare instead of Elapsed.TotalSeconds #187 remove unconditional [embed:trace] Console.Error writes at window open Behavior preserved: identical render cadence, delegate semantics, and re-render coalescing; HasAny is a one-way sentinel so any app that opens an Animations.Animate transaction keeps the full AsyncLocal path. New AnimationAmbient.HasAny tests. Deferred (flagged to coordinator): theme resolution cache (#85/#86) — #85's per-element theme-name cache needs generation invalidation on localized RequestedTheme application which lives in Reconciler.cs (sibling-owned), so it's a cross-boundary change; and theme resolution can't be measured headlessly. #184 charting dirty-gate (chart-specific, secondary). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…rame atomics, cache theme-brush resolution (#660) (#751) * perf(render-loop): cache per-frame host delegates + drop per-frame atomics (#660) Remove per-frame delegate/closure allocations and full-barrier atomics from the render-loop hosts (ReactorHost + ReactorHostControl), which run at render/data-tick frequency on the data-grid stress workload: #178 QueryCache.DispatcherPost: pass action.Invoke, drop the () => action() trampoline #179 cache _rerenderAction instead of () => RequestRender() every render #180 cache _renderLoopHandler (DispatcherQueueHandler) for TryEnqueue #181 cache _requestRenderAction (RequestRender method group) for BeginRender + Reconcile #182 HotReloadService.ConsumeUpdatePending: Volatile.Read fast-path, atomic only when pending #183 AnimationAmbient.HasAny sentinel gates the per-setState AsyncLocal walk #185 _lastRenderMs: Volatile.Write (single writer) instead of Interlocked.Exchange #186 report gate: integer ElapsedMilliseconds compare instead of Elapsed.TotalSeconds #187 remove unconditional [embed:trace] Console.Error writes at window open Behavior preserved: identical render cadence, delegate semantics, and re-render coalescing; HasAny is a one-way sentinel so any app that opens an Animations.Animate transaction keeps the full AsyncLocal path. New AnimationAmbient.HasAny tests. Deferred (flagged to coordinator): theme resolution cache (#85/#86) — #85's per-element theme-name cache needs generation invalidation on localized RequestedTheme application which lives in Reconciler.cs (sibling-owned), so it's a cross-boundary change; and theme resolution can't be measured headlessly. #184 charting dirty-gate (chart-specific, secondary). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * perf(theme): cache (key,theme) -> Brush resolution, cleared on theme change (#660 #86) ThemeRef.Resolve recursed Application.Resources.MergedDictionaries (XamlControlsResources and its nested dictionaries) on every resolve — per cell x per color token x per render on the data-grid workload. Cache the deterministic (resourceKey, themeName) -> Brush result in a process-wide ConcurrentDictionary and clear it from the hosts' theme-change handlers (ActualThemeChanged + UISettings.ColorValuesChanged). Transient-null Application.Resources (early startup) is not cached, so no poisoned null entry. Cached value mirrors the uncached return exactly (including null for unknown keys); ThemeDictionary brushes are shared instances, so returning the cached reference is identical behavior. Self-contained in Theme.cs (no BrushHelper/ThemeBinding/Reconciler coupling). The per-element theme-NAME cache (#85) is intentionally NOT here — it needs a generation bump where a localized RequestedTheme is applied (Reconciler.cs, sibling-owned), which is a cross-ownership change flagged to the coordinator. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * fix(theme): complete #86 brush-cache invalidation per #751 review Two correctness hardenings on the (key,theme)->Brush cache: 1. Wire ReactorHostControl to UISettings.ColorValuesChanged (high-contrast / accent / palette) -> InvalidateResolutionCache, mirroring ReactorHost. Before, the embedded host only invalidated on ActualThemeChanged (Light/Dark), so an app using ReactorHostControl without a ReactorApp would keep stale brushes on a same-theme accent/high-contrast change. Subscribe on theme-listener attach, unsubscribe in Dispose. 2. Cache ONLY successful (non-null) resolutions. A cached null for an unknown key would go stale if a ResourceDictionary defining that key is merged in after the first resolve (a dictionary add raises no theme-change event). Unknown keys are rare; re-walking them is the same cost as pre-cache and always correct. Invalidation now covers: Light<->Dark (ActualThemeChanged, both hosts — AND the cache key includes the theme name so a toggle auto-misses) + accent/palette/ high-contrast (ColorValuesChanged, both hosts). Existing theme selftests pass with the cache active, incl. StructuralSkip_ThemeRangeParity (ThemeRange_ForegroundReresolvedOnToggle: resolve brush -> toggle theme -> assert re-resolved) and Issue522_CacheClear_StyleClearedDespiteCacheClear. Full headless suite 9915/0; build 0/0. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * test(theme): regression coverage for #86 brush-cache invalidation (H1/H2) Selftest fixtures pinning the two converged review findings (the code fixes landed in 3fd38c4): - Theme_BrushCacheNullMissNotCached (H2): resolve an unknown key → null (NOT cached) → merge a ResourceDictionary defining it → resolves to the brush. Guards against the cached-null poisoning a later-merged key (XamlIslandBootstrap / docking-embed late XamlControlsResources binding). - Theme_BrushCacheInvalidationReResolves (H1 mechanism): resolve key→brushA (cached) → swap to brushB for the same (key,theme) → still brushA (stale) → ThemeRef.InvalidateResolutionCache() (what the hosts call on ColorValuesChanged/ActualThemeChanged) → re-resolves to brushB. Both green. Validates the invalidation path the ReactorHostControl ColorValuesChanged wiring (3fd38c4) depends on. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Summary
Switch to per-project platform declarations: library and WPF projects default to AnyCPU,
WinUI application projects explicitly declare
x64;ARM64. Migrate from.slnto.slnx.Remove shared Platform fallback logic from
Directory.Build.props.Linked issue
Fixes #185
Key changes
Build system
<Platforms>tag, MSBuild defaults to AnyCPU<Platforms>tag — WPF has no native Windows App SDK dependencyWindowsAppSDKSelfContained=false— pure MSTest runner, no WinUI dependency<Platforms>x64;ARM64</Platforms>for WindowsAppSDKSelfContained native assetsSolution migration
CI workflows
-p:Platform=x64for standalone project builds-p:Platform=x64; replace hardcodedbin/x64path with dynamic file lookup-p:Platform=x64from solution build/pack (slnx provides it); keep--runtimefor publishCode fixes
FindHostExe()repo-root lookups in SelfTestBatch, TestSession, WinFormsTestSession, and CompileCommand to search forReactor.slnxinstead ofReactor.slnDocs
Design
Each project declares its own platform requirements — no shared magic:
Solution builds get Platform from the
.slnxconfiguration. Standalone project builds(e.g.
dotnet test tests/Reactor.Tests) require explicit-p:Platform=x64.Packaging verification
NuGet package — architecture-neutral, same structure as before:
CLI skill kit — RID-specific layout unchanged:
Test plan
dotnet build Reactor.slnx— 0 errorsdotnet test tests/Reactor.Tests -p:Platform=x64— 6819 passed, 46 skippeddotnet test tests/Reactor.SelfTests -p:Platform=x64— 670 passeddotnet build Reactor.slnx -c Release— succeedsdotnet pack src/Reactor/Reactor.csproj— correct nupkg structuredotnet publish --runtime win-x64/win-arm64— both produce valid mur.exebin/x64/mur.exemirror layout still worksRisk / breaking changes
dotnet build/test <project>without-p:Platformfor app projects will now need to either build via the solution or pass-p:Platform=x64explicitly..slnfile is removed; VS / Rider users need to openReactor.slnxinstead.