Repository navigation
fix: keep ConfigureAwait(options) validation frame in controlled awaitables - #80
Merged
Merged
Conversation
…tables The controlled ConfigureAwait(ConfigureAwaitOptions) awaitable constructors are [StackTraceHidden] and validate through the BCL's ConfigureAwait. Once the JIT optimizes them (Tier1 in a long sequential run, or TieredCompilation=0), it inlines ConfigureAwait into the hidden frame, so the BCL's frame disappears from the trace of invalid options. NoInlining | NoOptimization keeps the BCL call a real frame. The awaiter conformance probe disables JIT optimization so the BCL oracle has the frames of a non-inlined call in every run, and CI runs the awaiter conformance class sequentially without tiered compilation. Fixes #79
ReubenBond
added a commit
to ReubenBond/orleans
that referenced
this pull request
Nov 23, 2026
…cts its options Port of ReubenBond/Clockwork@f2dbc6c (ReubenBond/Clockwork#80, fixing ReubenBond/Clockwork#79). The controlled ConfigureAwait(ConfigureAwaitOptions) awaitables validate their options by calling the BCL's ConfigureAwait from [StackTraceHidden] constructors. Once the JIT optimized a constructor, through tiering in a long run or with tiered compilation off, it inlined the BCL call into the hidden frame, so an invalid option's ArgumentOutOfRangeException lost the BCL's ConfigureAwait frame which an uninstrumented call shows. Both constructors are now NoInlining and NoOptimization. The conformance probe compiles without optimization, so the BCL side of the comparison keeps the frames of a non-inlined call in every run, and the compatibility notes record the frame. The Simulation packaging and lowering CI job gains upstream's regression lane: ControlledAwaiterConformanceTests in Release with --parallel none and tiered compilation and ReadyToRun off, which fails four cases without the fix. The simulation suites ran with collection-level parallelism through their own testconfig.json, because this oracle failed under sequential order. Every simulation suite now passes sequentially, so they take Orleans' sequential test configuration; sequential order is what exposed this divergence. The suites keep workstation garbage collection for their heap oracles.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Agent assessment
Self-reported assessment, not an independent review.
Assessed revision:
f2dbc6c30037e17e339d0b045a6a762c396af380Root cause
ControlledConfiguredTaskAwaitable(Task, ConfigureAwaitOptions)and its generic counterpart are[StackTraceHidden]and validate options by calling the BCL'sConfigureAwait(options). Once the JIT optimizes these constructors (Tier1 after enough calls in a long sequential run, orDOTNET_TieredCompilation=0), it inlinesConfigureAwaitinto the hidden frame, so the BCL'sConfigureAwaitframe disappears from theArgumentOutOfRangeExceptiontrace. The BCL oracle's probe runs once per fresh assembly at Tier0, so it always keeps the frame — hence the order dependence.Fix
NoInlining | NoOptimization, so the BCL call stays a real frame: invalid options throw from the BCL'sConfigureAwaitframe, as from a non-inlined call, in every tier.DebuggableAttribute), so the BCL oracle also has the frames of a non-inlined call when the probe itself is optimized (TC=0).ControlledAwaiterConformanceTestssequentially in Release without tiered compilation, which reproduces the failure deterministically without the fix (4 failures) and passes with it.docs/compatibility.mdstates the frame contract.Validation
dotnet run --project tests/Clockwork.Conformance.Tests/... -c Release|Debug --no-build -- --parallel collections|none: 1507/1507 in all four.DOTNET_TieredCompilation=0 DOTNET_ReadyToRun=0 ... -c Release|Debug -- --parallel none --filter-class *ControlledAwaiterConformanceTests: 49/49; 45/49 (4 Reject cases fail) with the source fix reverted.Fixes #79