Skip to content

test: failed stand-in compiles name the shared-emit canary verdict (#5212 / #890) - #6200

Merged
rbuergi merged 1 commit into
mainfrom
test/stand-in-compile-probes-emit-state
Oct 6, 2026
Merged

rbuergi merged 1 commit into
mainfrom
test/stand-in-compile-probes-emit-state

Conversation

@rbuergi

@rbuergi rbuergi commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

Why

#5212 (originally #890): on Linux x64 CI the shared Roslyn of a test process sometimes goes bad part-way through a run. After that, Emit throws the NRE in MetadataWriter.PopulateNestedClassTableRows, references passed to the compile become invisible (CS0246/CS0234), or a "successful" compile emits a DLL that is missing its own type. The latest occurrences were in the stand-in compiles of Memex.Portal.Shared.Test: see this comment on #5212. Each red looked like a defect in whichever test compiled next.

Production already has a canary for this, EmitPipeline.ProbeSharedEmitState. The test helpers never ran it.

What

  • New test/Memex.Portal.Shared.Test/StandInCompile.cs. StandInCompile.Emit(CSharpCompilation) is the one emit for in-memory stand-ins. When the emit fails, whether through error diagnostics or a throw, it runs EmitPipeline.ProbeSharedEmitState(compilation). It then throws StandInCompileFailedException, whose message is the compile errors (or the Emit fault, kept as the inner exception) plus a line EmitPipeline.ProbeSharedEmitState (#5212 / #890): canary=…. The same text also goes to the test output.
  • This is diagnostic only. The test still fails. There is no retry and no fallback compiler.
  • Six stand-in Emit helpers now call the shared helper instead of their own Emit + Assert.True(result.Success…): ModuleLinkVersionTest, LinkVerdictPerPlatformTest, ModuleUpdatesGoLiveTest, ModulePlatformSurfaceJsonTest, ModulePlatformLinkTest and ModulePlatformMemberLinkTest. ReleaseLinkGateTest already reaches it through ModulePlatformSurfaceJsonTest.Emit. ModulesUpdateIndependentlyOfThePlatformTest, named in the comment, is not on main (it came from PR feat(modules): module endpoints and view packs go live; modules update independently of the platform (slice 6) #6128). When it lands, its Emit should call StandInCompile.Emit too.
  • src/MeshWeaver.Compiler/MeshWeaver.Compiler.csproj: added InternalsVisibleTo Memex.Portal.Shared.Test, because the probe is internal.
  • Doc: NodeTypeCompilation.md → Reading it in CI has a new paragraph, "Test stand-in compiles carry the canary too".

Verification

  • dotnet build -c Release -warnaserror on MeshWeaver.Compiler, Memex.Portal.Shared.Test and MeshWeaver.Documentation, one project per invocation: each reported 0 Warning(s), 0 Error(s).
  • New test StandInCompileFailureNamesTheEmitCanaryTest.AFailedStandInCompile_CarriesTheCanaryVerdict_AndStillFails. It compiles a stand-in with a type error and asserts that the failure carries both CS0029 and EmitPipeline.ProbeSharedEmitState (#5212 / #890): canary=OK. That is the real reading in a healthy process, so it proves the probe ran and did not just print a constant.
  • Negative control: I replaced the probe call with a constant string and rebuilt. The test failed with Assert.Contains() Failure: Sub-string not found … Not found: "EmitPipeline.ProbeSharedEmitState (#5212 / #890): ". I then restored the call, rebuilt, and it passed.
  • I ran the new test plus ModuleLinkVersionTest, LinkVerdictPerPlatformTest, ModuleUpdatesGoLiveTest, ModulePlatformSurfaceJsonTest, ModulePlatformLinkTest, ModulePlatformMemberLinkTest and ReleaseLinkGateTest on macOS arm64. Result: Total 109, Failed 0, and the trx lists the new test as Passed.

Pairs-with: none — test-only diagnostic; one InternalsVisibleTo

🤖 Generated with Claude Code

…5212 / #890)

Memex.Portal.Shared.Test compiles small stand-in assemblies in memory. On
Linux x64 CI those compiles have died in the #890 emit NRE, lost references
(CS0246/CS0234) or emitted a DLL missing its own type, and each red read as
a defect of whichever test compiled next.

All six stand-in Emit helpers (ModuleLinkVersionTest, LinkVerdictPerPlatformTest,
ModuleUpdatesGoLiveTest, ModulePlatformSurfaceJsonTest, ModulePlatformLinkTest,
ModulePlatformMemberLinkTest) now go through one helper, StandInCompile.Emit.
When the emit fails (diagnostics or a throw) it runs
EmitPipeline.ProbeSharedEmitState and appends its canary= verdict to the
failure message and the test output. Diagnostic only: still fails, no retry,
no fallback compiler.

MeshWeaver.Compiler grants InternalsVisibleTo to Memex.Portal.Shared.Test for
the probe. StandInCompileFailureNamesTheEmitCanaryTest pins the verdict line;
NodeTypeCompilation.md documents it.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@meshweaver-cloud
meshweaver-cloud Bot enabled auto-merge October 6, 2026 07:29
@github-actions

github-actions Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

Test Results

   13 files   -     9     13 suites   - 9   36m 39s ⏱️ - 8m 7s
9 363 tests  - 1 435  9 363 ✅  - 1 242  0 💤  - 193  0 ❌ ±0 
9 376 runs   - 1 435  9 376 ✅  - 1 242  0 💤  - 193  0 ❌ ±0 

Results for commit fb6b6b1. ± Comparison against base commit 3a0c2e9.

This pull request removes 1497 and adds 38 tests. Note that renamed tests count towards both.

   --- End of inner exception stack trace ---
   --- End of inner exception stack trace ---, expected: True)
   --- End of inner exception stack trace ---, isDenial: True)
 ---> (Inner Exception #1) MeshWeaver.Mesh.QueryProviderStalledException: Query provider(s) [pg] did not emit an Initial within the query fan-in's 16s bound for query 'nodeType:NodeType' (user 'system'). The merged Initial gates on EVERY provider, so this query has NO snapshot to answer with — it is reported as unavailable (retryable) rather than left hanging with no error. This is an availability failure, never a permission verdict: a consumer deciding access must fail CLOSED and say it could not establish the answer. Fix the stalled provider; never bump the consumer's timeout.<---
 ---> (Inner Exception #1) MeshWeaver.Messaging.Hub.Test.InfrastructureFaultTest+ProviderException (0x80004005): Failed to connect to 10.42.18.4:5432<---
 ---> (Inner Exception #1) System.ArgumentException: Value does not fall within the expected range.<---
 ---> (Inner Exception #1) System.InvalidOperationException: boom<---
 ---> (Inner Exception #1) System.InvalidOperationException: source B is misconfigured<---
 ---> (Inner Exception #1) System.Net.Sockets.SocketException (0xFFFDFFFF): Name or service not known<---
…
Memex.Portal.Shared.Test.InstanceIdRulesMatchTheRegistryTest ‑ TheSetupHostAgreesWithTheRegistry(candidate: "72a5bdbe-292f-41e6-988f-b0b4c3bedf89")
Memex.Portal.Shared.Test.InstanceRebootFaultedRestartTest ‑ ARestartThatCrashed_IsFaulted_RetriedByThePass_AndCompletesOnTheNextAttempt
Memex.Portal.Shared.Test.ModuleReloadFaultedBesideActivationTest ‑ OneModulesCrashedAdopt_BesideAnotherModulesLiveActivation_IsFaulted
Memex.Portal.Shared.Test.ModuleReloadFaultedTest ‑ ADecidedFailure_IsFailed_AndIsNeverRetried
Memex.Portal.Shared.Test.ModuleReloadFaultedTest ‑ ATransientFault_IsFaulted_TheNextPassRetriesIt_AndItSucceeds
Memex.Portal.Shared.Test.ModuleReloadRestartAttemptTest ‑ AFailedRestartAttempt_IsFaulted_AndTheRetryAsksAgain
Memex.Portal.Shared.Test.ModuleReloadRestartAttemptTest ‑ AnInstallThatCannotRestart_IsFailed_AndNeverRetried
Memex.Portal.Shared.Test.ModuleReloadRulesTest ‑ ACrashedItem_IsFaulted_ADecidedFailure_IsFailed
Memex.Portal.Shared.Test.ModuleReloadRulesTest ‑ AFaultedRequest_IsDue_OnThePassCadence_DoubledPerAttempt
Memex.Portal.Shared.Test.ModuleReloadRulesTest ‑ Rearm_StartsTheNextAttempt_FromRequested_KeepingTheLog
…

♻️ This comment has been updated with latest results.

@systemorph-com systemorph-com Bot added the thread:pr-systemorph-meshweaver-6200-610716 https://memex.systemorph.com/Hosting/Triage/_Thread/pr-systemorph-meshweaver-6200 label Oct 6, 2026
@rbuergi
rbuergi disabled auto-merge October 6, 2026 07:39
@rbuergi
rbuergi enabled auto-merge October 6, 2026 07:39
@systemorph-com
systemorph-com Bot disabled auto-merge October 6, 2026 07:44
@github-actions

github-actions Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

Test Results (shard 2)

    5 files  ±0      5 suites  ±0   3m 58s ⏱️ -9s
1 279 tests ±0  1 279 ✅ ±0  0 💤 ±0  0 ❌ ±0 
1 280 runs  ±0  1 280 ✅ ±0  0 💤 ±0  0 ❌ ±0 

Results for commit fb6b6b1. ± Comparison against base commit 3a0c2e9.

♻️ This comment has been updated with latest results.

@github-actions

github-actions Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

Test Results (shard 1)

1 753 tests  ±0   1 751 ✅ ±0   5m 14s ⏱️ -25s
    4 suites ±0       2 💤 ±0 
    4 files   ±0       0 ❌ ±0 

Results for commit fb6b6b1. ± Comparison against base commit 3a0c2e9.

♻️ This comment has been updated with latest results.

@github-actions

github-actions Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

Test Results (shard 0)

  3 files  ±0    3 suites  ±0   3m 27s ⏱️ -1s
566 tests ±0  375 ✅ ±0  191 💤 ±0  0 ❌ ±0 
570 runs  ±0  379 ✅ ±0  191 💤 ±0  0 ❌ ±0 

Results for commit fb6b6b1. ± Comparison against base commit 3a0c2e9.

♻️ This comment has been updated with latest results.

@github-actions

github-actions Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

Test Results (shard 3)

2 518 tests  +42   2 518 ✅ +42   7m 22s ⏱️ -7s
    4 suites ± 0       0 💤 ± 0 
    4 files   ± 0       0 ❌ ± 0 

Results for commit fb6b6b1. ± Comparison against base commit 3a0c2e9.

This pull request removes 81 and adds 123 tests. Note that renamed tests count towards both.
Memex.Portal.Shared.Test.StorageSectionWithoutTypeIsNotConfiguredTest ‑ ABlankType_ReadsAsAwaitingSetup
Memex.Portal.Shared.Test.StorageSectionWithoutTypeIsNotConfiguredTest ‑ APolicyOnlySection_ReadsAsAwaitingSetup
Memex.Portal.Shared.Test.StorageSectionWithoutTypeIsNotConfiguredTest ‑ ARealBackend_ReadsAsConfigured
Memex.Portal.Shared.Test.StorageSectionWithoutTypeIsNotConfiguredTest ‑ NoSectionAtAll_ReadsAsAwaitingSetup
Memex.Portal.Shared.Test.TestRunPreflightRulesTest ‑ APackageAPersonKeepsOnNotify_IsAReportedHold_NotASkewThatRefusesEveryRun
Memex.Portal.Shared.Test.TestRunPreflightRulesTest ‑ APlatformBehindTheTarget_IsAlwaysASkew_ATestRunNeverRollsAnImage
Memex.Portal.Shared.Test.TestRunPreflightRulesTest ‑ ARepublishedVersionWithNewContent_IsBehind_AndTheTargetNamesItsHash
Memex.Portal.Shared.Test.TestRunPreflightRulesTest ‑ AStaleInstance_ConvergesFirst_WhenTheRunMayChangeIt
Memex.Portal.Shared.Test.TestRunPreflightRulesTest ‑ AStaleInstance_FailsNamingTheSkew_WhenTheRunMayNotChangeIt_OrConvergingDidNotCloseIt
Memex.Portal.Shared.Test.TestRunPreflightRulesTest ‑ AnUnreadInstance_HeaderSaysUnknown_NotTheHostProcessVersions
…
Memex.Portal.Shared.Test.StandInCompileFailureNamesTheEmitCanaryTest ‑ AFailedStandInCompile_CarriesTheCanaryVerdict_AndStillFails
Memex.Portal.Shared.Test.SyncTokenScopeTest ‑ ARevokedGrantOffersNothing
Memex.Portal.Shared.Test.SyncTokenScopeTest ‑ AWholeSourceLicenceStaysAWholeSourceScope
Memex.Portal.Shared.Test.SyncTokenScopeTest ‑ AWholeSourceRequest_EXPANDS_ToTheLicensedPackages
Memex.Portal.Shared.Test.SyncTokenScopeTest ‑ AWholeSourceRequest_ExpandsOnlyWithinThatSource
Memex.Portal.Shared.Test.SyncTokenScopeTest ‑ AnExactRequestIsHonoured
Memex.Portal.Shared.Test.SyncTokenScopeTest ‑ AnExpiredEntryIsNotOffered
Memex.Portal.Shared.Test.SyncTokenScopeTest ‑ AnExpiredEntryIsNotOfferedByAWildcardEither
Memex.Portal.Shared.Test.SyncTokenScopeTest ‑ AnUnlicensedRequestIsDropped_NotRefused
Memex.Portal.Shared.Test.SyncTokenScopeTest ‑ DuplicateRequestsCollapse
…

♻️ This comment has been updated with latest results.

@github-actions

github-actions Bot commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

Test Results (shard 4)

    2 files   -     2      2 suites   - 2   5m 46s ⏱️ - 9m 38s
1 353 tests  - 2 263  1 353 ✅  - 2 263  0 💤 ±0  0 ❌ ±0 
1 357 runs   - 2 266  1 357 ✅  - 2 266  0 💤 ±0  0 ❌ ±0 

Results for commit fb6b6b1. ± Comparison against base commit 3a0c2e9.

This pull request removes 3198 and adds 911 tests. Note that renamed tests count towards both.

   --- End of inner exception stack trace ---
   --- End of inner exception stack trace ---, expected: True)
   --- End of inner exception stack trace ---, isDenial: True)
 ---> (Inner Exception #1) MeshWeaver.Mesh.QueryProviderStalledException: Query provider(s) [pg] did not emit an Initial within the query fan-in's 16s bound for query 'nodeType:NodeType' (user 'system'). The merged Initial gates on EVERY provider, so this query has NO snapshot to answer with — it is reported as unavailable (retryable) rather than left hanging with no error. This is an availability failure, never a permission verdict: a consumer deciding access must fail CLOSED and say it could not establish the answer. Fix the stalled provider; never bump the consumer's timeout.<---
 ---> (Inner Exception #1) MeshWeaver.Messaging.Hub.Test.InfrastructureFaultTest+ProviderException (0x80004005): Failed to connect to 10.42.18.4:5432<---
 ---> (Inner Exception #1) System.ArgumentException: Value does not fall within the expected range.<---
 ---> (Inner Exception #1) System.InvalidOperationException: boom<---
 ---> (Inner Exception #1) System.InvalidOperationException: source B is misconfigured<---
 ---> (Inner Exception #1) System.Net.Sockets.SocketException (0xFFFDFFFF): Name or service not known<---
…
Memex.Portal.Shared.Test.InstanceIdRulesMatchTheRegistryTest ‑ TheSetupHostAgreesWithTheRegistry(candidate: "72a5bdbe-292f-41e6-988f-b0b4c3bedf89")
Memex.Portal.Shared.Test.InstanceRebootFaultedRestartTest ‑ ARestartThatCrashed_IsFaulted_RetriedByThePass_AndCompletesOnTheNextAttempt
Memex.Portal.Shared.Test.InstanceRebootTest ‑ ANewerModuleAboveTheFloor_IsDeclinedByName_AndTheRebootStillRestarts
Memex.Portal.Shared.Test.InstanceRebootTest ‑ AProcessThatStillLoadsTheOldModule_TurnsTheRebootRed_NamingTheThreadStart
Memex.Portal.Shared.Test.InstanceRebootTest ‑ AnOlderModuleStoreCopy_IsLandedRestartedAndVerified_InOneReboot
Memex.Portal.Shared.Test.InstanceRebootWatchdogTest ‑ AHealthyInstance_FilesNothing_AndOrdinaryFailuresAreNotAWedge
Memex.Portal.Shared.Test.InstanceRebootWatchdogTest ‑ ASingletonMustPassAfterTheRestart_AStalePassIsRed
Memex.Portal.Shared.Test.InstanceRebootWatchdogTest ‑ RepeatedBindingFaultsOnThreadStart_FireOneSelfReboot_ThenTheRateLimitHolds
Memex.Portal.Shared.Test.InstanceRebootWatchdogTest ‑ TheLaneReboot_HasAFixedPlan_AndFilesOneRequestForTheRequester
Memex.Portal.Shared.Test.LegacySpacePrerenderTest ‑ LiteralText_IsNotReinterpreted(nodeType: "Markdown", text: "{\"body\":\"Literal **JSON**\"}", expected: "<p>{&quot;body&quot;:&quot;Literal <strong>JSON</s"···)
…

@github-actions

github-actions Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

Test Results (shard 5)

    2 files  ±0      2 suites  ±0   8m 48s ⏱️ +12s
1 108 tests ±0  1 108 ✅ ±0  0 💤 ±0  0 ❌ ±0 
1 109 runs  ±0  1 109 ✅ ±0  0 💤 ±0  0 ❌ ±0 

Results for commit fb6b6b1. ± Comparison against base commit 3a0c2e9.

♻️ This comment has been updated with latest results.

@systemorph-com
systemorph-com Bot enabled auto-merge October 6, 2026 10:14
@rbuergi
rbuergi disabled auto-merge October 6, 2026 12:14
@rbuergi
rbuergi enabled auto-merge October 6, 2026 12:14
@rbuergi
rbuergi merged commit a887ae8 into main Oct 6, 2026
88 of 98 checks passed
@rbuergi
rbuergi deleted the test/stand-in-compile-probes-emit-state branch October 10, 2026 13:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

thread:pr-systemorph-meshweaver-6200-610716 https://memex.systemorph.com/Hosting/Triage/_Thread/pr-systemorph-meshweaver-6200

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant