Skip to content

fix(hr): align workspace analyzer flavors and Roslyn with the SDK compiler (spec 053) - #23863

Merged
dr1rrb merged 11 commits into
masterfrom
dev/dr/hr-workspace-analyzer-flavor-skew
Aug 3, 2026
Merged

dr1rrb merged 11 commits into
masterfrom
dev/dr/hr-workspace-analyzer-flavor-skew

Conversation

@dr1rrb

@dr1rrb dr1rrb commented Jul 23, 2026 •

Copy link
Copy Markdown
Member

GitHub Issue: closes #23860

PR Type:

🐞 Bugfix

What changed? 🚀

Implements specs/053-hotreload-workspace-analyzer-flavor-skew/spec.md (carried by this PR):

  • Analyzer flavor pin (R1) — the hot-reload workspace now passes CompilerApiVersion=roslyn{X.Y} of its embedded Microsoft.CodeAnalysis as a global property (computed at runtime — EmbeddedRoslyn.CompilerApiVersion), so the standard analyzer multi-targeting (analyzers/dotnet/roslyn{X.Y} folders) selects flavors the workspace can actually load. Without it, an SDK newer than the embedded Roslyn (SDK 10 → roslyn5.6) selects flavors that fail to type-load and AnalyzerFileReference.GetGenerators() silently returns zero generators — every workspace compile of the affected projects then misses its generated code (measured: 229 phantom errors on a single CommunityToolkit.Mvvm 8.4.2 library, CS0759/CS0103/CS1061 walls).
  • Embedded Roslyn bumps (R2) — net9 flavor 4.13.0 → 4.14.0 (latest 4.x, SDK 9 compiler line), net10 flavor 4.14.0 → 5.6.0 (latest 5.x, SDK 10 line; brings C# 14 parsing and native roslyn5.x flavor loading). Companion compile-time pins in the net10 groups: Microsoft.Build* 18.0.2 (ExcludeAssets="runtime"), Microsoft.Extensions.Logging* 10.0.1.
  • EnC shim retarget — Roslyn removed ExternalAccess.Watch from Microsoft.CodeAnalysis.Features between 5.0 and 5.3; the reflection shim now targets the shape-identical ExternalAccess.UnitTesting.Api.UnitTestingHotReloadService (identical from 4.14 to 5.6 — capabilities move to StartSessionAsync, and commitUpdates: true reproduces Watch's implicit commit-on-ready, confirmed against the Roslyn sources). The obsoleted Workspace.WorkspaceFailed event is replaced by RegisterWorkspaceFailedHandler on the net10 flavor.
  • Analyzer load-failure logging (R3) — at workspace initialization, one warning per (project, unloadable analyzer), naming the impacted project and stating hot reload will NOT work for it. The load failure was previously 100% silent (no exception, no diagnostic).

Validation

  • Uno.HotReload.Tests: 103/103 pass on the net10/Roslyn 5.6 flavor — including 4 new tests (pin format + package-line guard; per-project load-failure warnings incl. shared-reference attribution; loadable-analyzer negative case).
  • Real EnC delta emitted through the retargeted shim against both 4.14.0 and 5.6.0 (session start → source edit → IL/metadata/PDB deltas + updated types, on-disk baseline).
  • MSBuildWorkspace repro of the original failure (SDK 10.0.302): with the pin and the 5.6.0 embed, the CommunityToolkit generators load and produce their documents, 0 errors / 0 CS8784-CS8785 on the previously-failing project graph (the same graph failed with ~2,400 phantom errors before).
  • Uno.HotReload, Uno.UI.RemoteControl.Server.Processors and Uno.UI.RemoteControl.Host build clean on both flavors.

PR Checklist ✅

Copilot AI review requested due to automatic review settings July 23, 2026 16:53
@github-actions

github-actions Bot commented Jul 23, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @dr1rrb's task in 3m 26s —— View job


Review: spec 053 — Hot-Reload Workspace Analyzer Flavor Skew

Verdict: fix-first — 5 findings (0 blocking, 2 medium, 3 low). The spec is well-reasoned and the root-cause diagnosis is solid; the issues are in implementation guidance that, if followed verbatim, would produce subtle bugs.

  • Gather context
  • Read spec file
  • Review spec content
  • Post inline findings (5 inline comments)
  • Post summary

Summary

The technical approach is sound: R1 (pin CompilerApiVersion as a global MSBuild property from the embedded Roslyn's assembly version) is the correct minimal fix, and the empirical validation (229 → 0 errors) gives high confidence. R2 and R3 are complementary and well-scoped.

Cross-cutting concerns not mapped to a specific line:

  • R2 net9 bump is not the current baseline: the .csproj already has 4.13.0 on net9 / 4.14.0 on net10. The spec says bump net9 to 4.14.0 — correct — but doesn't say "also check whether 4.14 is still the latest 4.x stable at implementation time" the way it does for net10 and 5.x. Add that symmetry to avoid a stale pin.

  • Hardcoded TFM strings in Condition: the existing .csproj uses '$(TargetFramework)'=='net9.0' / 'net10.0' in ItemGroup conditions rather than the $(NetPrevious) / $(NetCurrent) properties mandated by build-system.md. This is pre-existing, but the spec could note that R2 should either fix the conditions while it's there or explicitly leave the existing pattern for consistency. As-is, an implementer might introduce new conditions with the same hardcoded strings, deepening a tech-debt violation.

  • R3 placement decision left open: the spec lists two candidate insertion points — "after OpenProjectAsync completes, e.g. at the end of CreateWorkspaceAsync or in the LoadSolutionFromDisk continuation". Pick one. Leaving it open risks the implementation landing in the wrong place (the continuation fires later, reducing the "startup signal" property the spec emphasizes).

Overall: the spec is implementation-ready after addressing the inline findings. The deduplication gap (line 144) and the optional regression test (line 174) are the most important to resolve before implementation begins.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new specification (spec 053) describing how to fix Hot Reload workspace analyzer flavor skew by pinning CompilerApiVersion to the embedded Roslyn version, aligning embedded Roslyn versions per host flavor, and logging per-project analyzer load failures.

Changes:

  • Introduces spec 053 outlining the root cause, requirements (R1–R3), and a proposed test plan for the Hot Reload workspace analyzer-loading issue.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copilot AI review requested due to automatic review settings July 23, 2026 21:48

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 8 out of 8 changed files in this pull request and generated no new comments.

@dr1rrb
dr1rrb marked this pull request as ready for review July 23, 2026 21:55
dr1rrb added 3 commits July 23, 2026 15:02
…with the SDK compiler

The dev-server workspace embeds Microsoft.CodeAnalysis 4.13/4.14 while the
.NET 10 SDK's csc is Roslyn 5.x: the standard analyzer multi-targeting selects
analyzers/dotnet/roslyn5.0 flavors (e.g. CommunityToolkit.Mvvm 8.4.2) that fail
to type-load in the workspace, and AnalyzerFileReference.GetGenerators()
silently returns zero generators - every compile of the affected projects is
missing their generated members (verified: 229 phantom errors on one library,
0 after the fix). Spec covers: CompilerApiVersion pinned to the embedded Roslyn
(computed at runtime), per-host-flavor bumps (net9 latest 4.x, net10 latest
5.x), and per-project analyzer load-failure logging.
…piler

The hot-reload workspace compiles with the dev-server's embedded
Microsoft.CodeAnalysis, but analyzer flavor selection
(analyzers/dotnet/roslyn{X.Y}) follows the SDK's csc: an SDK newer than the
embedded Roslyn (SDK 10 = roslyn5.6) selects flavors that fail to type-load,
and AnalyzerFileReference.GetGenerators() silently returns zero generators -
every compile of the affected projects then misses its generated code
(observed with CommunityToolkit.Mvvm 8.4.2: roslyn5.0 flavor selected, 229
phantom errors on a single library).

- Pin the CompilerApiVersion global property to the embedded Roslyn, computed
  at runtime (EmbeddedRoslyn.CompilerApiVersion): a global property is
  immutable for the evaluation, so the SDK's unconditional assignment is
  ignored and the selected flavors are loadable.
- Bump the embedded Roslyn per host flavor: net9 4.13.0 -> 4.14.0 (latest
  4.x, SDK 9 compiler line), net10 4.14.0 -> 5.6.0 (latest 5.x, SDK 10 line;
  brings C# 14 parsing and native roslyn5.x flavor loading). Companion
  compile-time pins in the net10 groups: Microsoft.Build* 18.0.2,
  Microsoft.Extensions.Logging* 10.0.1.
- Retarget the WatchHotReloadService reflection shim to
  ExternalAccess.UnitTesting.Api.UnitTestingHotReloadService: Roslyn removed
  ExternalAccess.Watch from Microsoft.CodeAnalysis.Features between 5.0 and
  5.3; the UnitTesting twin is shape-identical from 4.14 to 5.6 (capabilities
  at StartSessionAsync, commitUpdates: true == Watch's commit-on-ready).
  Validated by emitting a real EnC delta against both 4.14.0 and 5.6.0. The
  obsoleted Workspace.WorkspaceFailed event is replaced by
  RegisterWorkspaceFailedHandler on the net10 flavor.
- Warn once per (project, unloadable analyzer) at workspace initialization,
  naming the impacted project and stating hot reload will NOT work for it:
  the load failure is otherwise completely silent and only surfaces as a
  missing-generated-code error wall long after startup.
- EmbeddedRoslyn.Version: read the assembly identity once and replace the
  null-forgiving operator with an explicit, diagnosable throw.
- Spec updated to describe the implementation as landed (R1/R3 actual code
  and algorithm, robust sweep command, PR links for the related specs, test
  plan status incl. the red/green evidence for the pin).
Copilot AI review requested due to automatic review settings July 23, 2026 22:11
@dr1rrb
dr1rrb force-pushed the dev/dr/hr-workspace-analyzer-flavor-skew branch from c7a1e27 to 2bdabab Compare July 23, 2026 22:11
@github-actions

github-actions Bot commented Jul 23, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @dr1rrb's task in 5m 49s —— View job


Review: spec 053 — Hot-Reload Workspace Analyzer Flavor Skew (Implementation)

Verdict: ship — 0 findings. The implementation is correct, well-tested, and addresses every line of the spec. All concerns raised by the previous spec review have been resolved.

  • Gather context
  • Review EmbeddedRoslyn.cs — version pinning, caching, R3 load-failure logging
  • Review WatchHotReloadService.cs — EnC shim retarget to UnitTestingHotReloadService
  • Review CompilationWorkspaceProvider.cs — CompilerApiVersion pin + RegisterWorkspaceFailedHandler + WarnOnAnalyzerLoadFailures call
  • Review Given_EmbeddedRoslyn.cs — test coverage
  • Review project files — Roslyn + MSBuild version bumps

Summary

R1 — CompilerApiVersion pin: EmbeddedRoslyn.Version reads typeof(Compilation).Assembly.GetName().Version once (static init, cached), throws InvalidOperationException with a message instead of a bare NRE if the assembly carries no version. CompilerApiVersion derives from it and is forwarded as a global MSBuild property in CreateWorkspaceAsync, making the SDK's own CompilerApiVersion assignment inert for the evaluation. The placement is correct (in the initial globalProperties dict, before MSBuildWorkspace.Create), and the global-property semantics are verified empirically.

R2 — Roslyn bumps: net9 → 4.14.0, net10 → 5.6.0 across both csproj files. Microsoft.Build* companions bumped to 18.0.2 (ExcludeAssets="runtime") for net10. The WorkspaceFailed obsolescence is handled cleanly with #if NET10_0_OR_GREATER / RegisterWorkspaceFailedHandler. The WatchHotReloadService retarget to UnitTestingHotReloadService is correct: capabilities move from the constructor to StartSessionAsync, and commitUpdates: true faithfully reproduces the Watch implicit-commit behavior.

R3 — Load-failure logging: WarnOnAnalyzerLoadFailures is correctly structured — one pass over distinct AnalyzerFileReferences (Roslyn's path+loader equality, so shared references are forced once), a named handler subscribed before GetGenerators and unsubscribed in finally (no accumulation across workspace reloads), Dictionary.TryAdd keeps only the first failure, then a second pass emits one reporter.Warn per (project, failed reference) naming the project, analyzer, flavor segment, and embedded Roslyn version. Placement in CreateWorkspaceAsync is after the retry/restore loop and ReportUnresolvedHeadFlavors, before return workspace — correct.

Tests: Given_EmbeddedRoslyn covers the pin format, the package-line guard (informational-version schema change detection), the two-project shared-corrupt-reference scenario (2 warnings, one per project), and the loadable-reference negative case (0 warnings). The InternalsVisibleTo in AssemblyInfo.cs is the correct hook.

Cross-cutting checks (clean):

  • No async void, no .Result/.GetAwaiter().GetResult(), CancellationToken propagated throughout CreateWorkspaceAsync.
  • No event Action, no new #pragma warning disable introduced, no generated files edited.
  • The #pragma warning disable CA2263 on EndSession.CreateDelegate and the hardcoded net9.0/net10.0 TFM strings in the ItemGroup conditions are pre-existing (not touched by this diff).
  • Conventional Commits prefix (fix(hr):) matches the bugfix nature.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.

@dr1rrb
dr1rrb enabled auto-merge July 23, 2026 22:21
@unodevops

Copy link
Copy Markdown
Contributor

@unodevops

Copy link
Copy Markdown
Contributor

⚠️⚠️ The build 223946 has failed on Uno.UI - CI.

@autocarl autocarl left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Static review plus hosted-check inspection. The implementation itself looks coherent, but the PR currently breaks the repository's unit-test restore through a Roslyn package conflict, so I cannot approve this head.

Comment thread src/Uno.HotReload/Uno.HotReload.csproj Resolved
Copilot AI review requested due to automatic review settings July 27, 2026 19:13
Comment thread src/Uno.DevServer.Roslyn.props Resolved

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 16 out of 16 changed files in this pull request and generated no new comments.

Comments suppressed due to low confidence (2)

src/Uno.HotReload/Utils/RoslynExtensions.AnalyzerReferences.cs:39

  • WithCollectibleAnalyzerReferences() creates a new AnalyzerFileReference per project even when multiple projects reference the same analyzer path. This contradicts the method comment about sharing/caching, and can cause redundant generator materialization (and redundant shadow-copy loads) for shared analyzers. Cache AnalyzerFileReference instances by FullPath within the snapshot transform so projects that reference the same analyzer reuse the same AnalyzerFileReference instance.
	internal static Solution WithCollectibleAnalyzerReferences(this Solution solution)
	{
		// One loader (and one set of per-directory contexts) per solution snapshot lineage: every
		// project sharing an analyzer path shares its loaded assembly, mirroring Roslyn's caching.
		var loader = new CollectibleAnalyzerAssemblyLoader();

		foreach (var projectId in solution.ProjectIds)
		{
			var references = solution.GetProject(projectId)!.AnalyzerReferences;
			if (references.OfType<AnalyzerFileReference>().Any())
			{
				solution = solution.WithProjectAnalyzerReferences(
					projectId,
					references.Select(r => r is AnalyzerFileReference file ? new AnalyzerFileReference(file.FullPath, loader) : r));
			}

src/SourceGenerators/Uno.UI.SourceGenerators.Tests/Uno.UI.SourceGenerators.Tests.csproj:39

  • This change disables the MetadataUpdate hot-reload tests (Compile Remove + commented-out Uno.HotReload ProjectReference), which reduces CI coverage for a hot-reload-sensitive area. If the Roslyn 4.14 snapshot pin requires this temporarily, please gate the disabled suite behind an explicit condition (so it can still run on a Roslyn 5.x build configuration), or move these tests into a separate test project that can take the Roslyn 5.x dependency without snapshot drift.
		<!-- Disabled until the net10 Roslyn 5.x migration (follow-up PR): these consume Uno.HotReload
		     (5.x), incompatible with the temporary 4.14.0 pin. -->
		<Compile Remove="MetadataUpdateTests\Given_HotReloadService.cs" />
		<Compile Remove="MetadataUpdates\HotReloadWorkspaceProvider.cs" />

@unodevops

Copy link
Copy Markdown
Contributor

@unodevops

Copy link
Copy Markdown
Contributor

@unodevops

Copy link
Copy Markdown
Contributor

⚠️⚠️ The build 225103 has failed on Uno.UI - CI.

…elta-added FieldRVA rows (spec 053 R6)

With R5 in place, hot reload still died after a handful of updates on the 5.x embed:
MetadataUpdater.ApplyUpdate threw "The assembly update failed" on the 4th update of a
session whatever was edited, and the poisoned session then failed every later update (the
runtime-test CI job ground through per-scenario timeouts to its 60-minute kill).

Root cause — a CoreCLR EnC metadata defect, diagnosed by replaying captured deltas
standalone and tracing a Checked CoreCLR build (10.0.10), proven both ways:

- CMiniMdRW::GenericFindWithHash (md/enc/metamodelrw.cpp) builds a lazy per-table lookup
  hash once a table exceeds INDEX_ROW_COUNT_THRESHOLD (25) rows and then searches ONLY the
  hash — no linear fallback — while the EnC delta-apply path (ApplyDelta/ApplyTableDelta)
  appends rows without maintaining or invalidating that hash. Any row a delta adds after
  the hash was built is invisible to lookups.
- The lookup that dies is GetFieldRVA during EditAndContinueModule::ApplyEditAndContinue:
  Roslyn 5.x emits one FieldRVA row per generation for method bodies containing array
  initializers / u8 literals (a fresh <PrivateImplementationDetails> per generation) — a
  NEW emission enabled by the equally-new AddFieldRva capability. The test app baseline
  has 22 FieldRVA rows: generation 3 crosses the threshold and builds the hash,
  generation 4's row is appended invisible, GetFieldRVA returns CLDB_E_RECORD_NOTFOUND
  and the apply fails. "Dies at the 4th update" is threshold(25) - baseline(22) + 1.
- Roslyn 4.x never emitted FieldRVA delta rows (the capability did not exist), which is
  why this years-old defect never fired before the 5.x embed.
- Checked-build trace: FindFieldRVAHelper HASH tk=04000d84 -> rid=0 with 26 rows in the
  table; invalidating the lookup hash in ApplyTableDelta makes the identical four deltas
  apply 4/4 — that one-liner is the candidate fix attached to the dotnet/runtime
  escalation (standalone repro bundle: baseline + deltas + 30-line ApplyUpdate replay).

The shim's capability adjustment now WITHDRAWS AddFieldRva alongside the R5 grant:
without it, Roslyn falls back to the historical element-wise array-initializer EnC
codegen — no FieldRVA rows in any delta, identical semantics (verified through 8+
generations in an emit+apply harness). To be reverted when the runtime fix ships.

Also repairs Given_HotReloadResilience.When_HotReload_Succeeds_Then_ReloadCompleted_ReportsSuccess:
it edited "Hello" and asserted a TextBlock "tb1" — neither ever existed in
HR_Frame_Pages_Page1.xaml, so the server-side replace was a no-op and the assertion could
never succeed (the test landed after the last fully-green master run). It now follows the
established Frame + ValidateTextOnChildTextBlock pattern (a reloadable-type update
replaces the page instance, so elements must be re-resolved from the live tree).

Red/green (local Skia desktop runtime tests, full Given_HotReloadWorkspace class): red
before — first ApplyUpdate rejection within seconds, 59+ cascade failures, no scenario
family survives; green after — 0 rejections, 0 rude edits, 261 metadata updates applied
end-to-end across every scenario family (pages, user controls, resource dictionaries,
data templates, file add/remove), single remaining failure was the born-broken test above,
repaired and re-validated. Uno.HotReload.Tests: 118/118 with the new grant+withdrawal
capability tests.
Copilot AI review requested due to automatic review settings July 31, 2026 14:05
@github-actions

github-actions Bot commented Jul 31, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @dr1rrb's task in 5m 8s —— View job


Review: spec 053 — Hot-Reload Workspace Analyzer Flavor Skew (R6 + round 4 sync)

Verdict: ship — 2 low-severity findings, 0 blocking. R6 (AddFieldRva withdrawal) is correct and well-tested; all prior blocking and medium findings have been resolved.

  • Gather context (diff, changed files)
  • Review R6 changes (AddFieldRva withdrawal, new test)
  • Review remaining open findings from prior rounds
  • Post inline findings (2 comments)
  • Post summary

What R6 adds

AddFieldRva withdrawal from AddImplicitCapabilities: correct fix for a CoreCLR EnC bug where delta-added FieldRVA rows become invisible once the metadata table's lookup hash is built (25-row threshold, no linear fallback, no hash maintenance on the apply path). The .Remove("AddFieldRva") call on ImmutableArray<string> is semantically correct: removes the first occurrence, no-ops if absent (harmless). Two new tests cover both the presence case (line 43) and the full CoreCLR capability-set assertion (line 22, updated to exclude AddFieldRva from the expected set).

Inline findings (2)

Severity File Finding
Low src/Uno.DevServer.Roslyn.props:9,15 New file uses hardcoded net9.0/net10.0 in Condition; build-system.md requires $(NetPrevious)/$(NetCurrent) — both defined in root Directory.Build.props and available here
Low src/Uno.HotReload/Microsoft/WatchHotReloadService.cs:79 [{task}] in the interpolated exception message calls Task.ToString() (inherited from Object, returns the class name only); CodeQL flagged this in the latest code-quality pass — task.GetType().FullName + task.Status is more diagnostic

Cross-cutting (no inline)

  • Pre-existing: disabled MetadataUpdate tests — Given_HotReloadService and HotReloadWorkspaceProvider remain Compile Removed in Uno.UI.SourceGenerators.Tests; the comment refers to a "follow-up PR" without a tracking issue number. Filing a GitHub issue and referencing it in the csproj comment would prevent the disabled coverage from becoming permanent.
  • R6 code comments are exemplary: the 18-line inline explanation of why AddFieldRva is withdrawn (CoreCLR hash-table/EnC root cause, diagnosed with ApplyUpdate replay + Checked CoreCLR) is exactly the non-obvious-why comment this repo's style requires.
  • Remaining Path.Combine / Distinct() / O(n) scan declines from prior rounds: the author's rationale (non-rooted by construction; instance-based dedup required by the failures dict keying; lazy ALC load means compiler context is not stable at construction) is sound for each — correct declines.

Comment thread src/Uno.DevServer.Roslyn.props Resolved
Comment thread src/Uno.DevServer.Roslyn.props Resolved

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 17 out of 17 changed files in this pull request and generated no new comments.

Suppressed comments (2)

src/Uno.HotReload/Roslyn/CollectibleAnalyzerAssemblyLoader.cs:150

  • LoadUnmanagedDll currently only probes for a Windows-style "*.dll" native dependency (Path.Combine(_directory, unmanagedDllName + ".dll")). On non-Windows targets (Linux/macOS), native analyzer dependencies are typically ".so"/".dylib" or may already include an extension, so this loader will never resolve them.
		protected override IntPtr LoadUnmanagedDll(string unmanagedDllName)
		{
			// Deliberate scope boundary: native DLLs are loaded from their original location, NOT
			// shadow-copied (so a rebuild while loaded can fail to replace them on Windows).
			// Native analyzer dependencies are rare and Roslyn's own loaders share the limitation.
			var candidate = Path.Combine(_directory, unmanagedDllName + ".dll");
			return File.Exists(candidate) ? LoadUnmanagedDllFromPath(candidate) : IntPtr.Zero;

src/SourceGenerators/Uno.UI.SourceGenerators.Tests/Uno.UI.SourceGenerators.Tests.csproj:39

  • This change disables MetadataUpdate hot-reload tests (Compile Remove + commenting out the Uno.HotReload ProjectReference). That reduces CI coverage for the source-generator/metadata-update integration, and there is no in-repo tracking issue/link to ensure these tests get re-enabled promptly once the Roslyn 5.x migration and snapshot regen lands.
		<!-- Disabled until the net10 Roslyn 5.x migration (follow-up PR): these consume Uno.HotReload
		     (5.x), incompatible with the temporary 4.14.0 pin. -->
		<Compile Remove="MetadataUpdateTests\Given_HotReloadService.cs" />
		<Compile Remove="MetadataUpdates\HotReloadWorkspaceProvider.cs" />

@unodevops

Copy link
Copy Markdown
Contributor

@unodevops

Copy link
Copy Markdown
Contributor

@autocarl autocarl left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Follow-up panel review of the changes since the previously approved ea42f022c507a04f3ecaced236ba84617ce9cc38, frozen at afaeda0ce2422d3b14d3bdf511c140fc70def339.

The R5 capability restoration matches both the removed Roslyn Watch host and current dotnet-watch. The R6 AddFieldRva withdrawal is also well-founded: I followed the lookup through CoreCLR 10.0.10 and current runtime sources and confirmed the 25-row threshold, FindFieldRVAHelper -> GenericFindWithHash, and the lack of a linear fallback once the hash exists. The local Uno.HotReload.Tests suite passes 118/118 on the exact head.

The new R4 loader still diverges from Roslyn on two important loader contracts, however. Most importantly, compiler-context unification only considers assemblies already materialized in the host. I reproduced the resulting split identity with a standalone probe: a compiler-context dependency that was resolvable but not loaded was loaded privately into UnoHotReloadAnalyzers(...); the later host resolution produced a different assembly (host_loaded_before_request=False, same_instance=False, exit 42). That can make analyzer/host exchange types incompatible and recreates the silent generator-loss class this PR is intended to fix.

The shadow-copy race is independently actionable: Roslyn explicitly serializes concurrent callers on a per-path Task and makes losers await the winning copy. Here, existence means only that the destination has been created, not that the copy has completed.

Requesting changes for those correctness issues. The version-blind registered-dependency index is also called out inline because it can cross-contaminate multi-project solutions.

@dr1rrb
dr1rrb merged commit 2b2d335 into master Aug 3, 2026
72 checks passed
@dr1rrb
dr1rrb deleted the dev/dr/hr-workspace-analyzer-flavor-skew branch August 3, 2026 15:19

@autocarl autocarl left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Post-merge verification — exact merged head afaeda0c

This is a new review record published on 2026-08-03 after re-reading the final merged object and the three “Done” replies posted immediately before merge.

The PR merged at 15:19:06Z, but the merged head is still afaeda0ce2422d3b14d3bdf511c140fc70def339, created on July 31 and already covered by the prior review. No code commit follows that review. The claimed fixes are therefore not present in the merged source:

  • compiler-context resolution still enumerates _compilerContext.Assemblies instead of invoking _compilerContext.LoadFromAssemblyName(assemblyName);
  • shadow copying still writes directly to the final DLL/PDB paths and treats File.Exists as copy completion rather than publishing a completed staging file atomically;
  • registered dependencies still use ConcurrentDictionary<string, string> plus TryAdd, so the first same-name candidate wins and later versions are discarded.

The 118/118 local suite result remains valid for the covered scenarios, but those tests do not exercise the three contracts above. The merged code therefore still contains the two high-severity loader correctness issues and the version-selection issue identified in the prior review.

Verdict: changes are still required in the merged code. Because the PR is already merged, this formal review is submitted as COMMENTED; the existing inline threads are refreshed separately with exact merged-line evidence.

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

Labels

area/code-generation Categorizes an issue or PR as relevant to code generation kind/documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

🦨 [HR] Workspace selects analyzer flavors for the SDK compiler, not its embedded Roslyn — generators silently missing

5 participants