sync — validation proof

Go’s own sync test suite, converted to C# by go2cs, built against the converted standard library, run under the Go-semantics test host, and compared verdict for verdict against a clean go test -json baseline of the same sources. This page is generated by the converter from that comparison — it is the evidence behind the sync row in Validated Test Packages.

Validated 2026-10-25 · converter 3e3f18925

48 matched · 9 disclosed — Go 1.26.10, windows/amd64, converted package src/core/sync.

Measured at Release (tiered JIT off), oracle go version go1.26.10 windows/amd64.

Verdicts

Test go test go2cs
TestCompareAndSwap_NonExistingKey pass pass
TestConcurrentClear pass pass
TestConcurrentRange pass pass
TestCondBroadcast pass pass
TestCondCopy pass pass
TestCondSignal pass pass
TestCondSignalGenerations pass pass
TestCondSignalStealing pass pass
TestIssue40999 pass pass
TestIssue76126 pass pass
TestMapClearOneAllocation pass fail (disclosed)
TestMapMatchesDeepCopy pass pass
TestMapMatchesHashTrieMap pass pass
TestMapMatchesRWMutex pass pass
TestMapRangeNestedCall pass pass
TestMapRangeNoAllocations pass fail (disclosed)
TestMutex pass pass
TestMutexFairness pass pass
TestMutexMisuse pass pass
TestNilPool pass pass
TestNilPool/Get pass pass
TestNilPool/Put pass pass
TestOnce pass pass
TestOnceFunc pass pass
TestOnceFuncGoexit pass pass
TestOnceFuncPanic pass pass
TestOnceFuncPanicNil pass pass
TestOnceFuncPanicTraceback pass pass
TestOncePanic pass pass
TestOnceValue pass pass
TestOnceValuePanic pass pass
TestOnceValues pass pass
TestOnceValuesPanic pass pass
TestOnceXGC pass fail (disclosed)
TestOnceXGC/OnceFunc pass fail (disclosed)
TestOnceXGC/OnceFunc_panic pass fail (disclosed)
TestOnceXGC/OnceValue pass fail (disclosed)
TestOnceXGC/OnceValue_panic pass fail (disclosed)
TestOnceXGC/OnceValues pass fail (disclosed)
TestOnceXGC/OnceValues_panic pass fail (disclosed)
TestParallelReaders pass pass
TestPool pass pass
TestPoolChain pass pass
TestPoolDequeue pass pass
TestPoolGC pass pass
TestPoolNew pass pass
TestPoolRelease pass pass
TestPoolStress pass pass
TestRLocker pass pass
TestRWMutex pass pass
TestRace pass pass
TestSemaphore pass pass
TestWaitGroup pass pass
TestWaitGroupAlign pass pass
TestWaitGroupGo pass pass
TestWaitGroupMisuse pass pass
TestWaitGroupRace pass pass

Disclosed divergences

A disclosed divergence is a specific Go assertion the managed CLR provably cannot satisfy — not a skipped test and not a tolerance. Each one is pinned by exact failure signature in the package’s hand-owned go2cs_test_disclosures.json; a disclosed test that fails any other way is still a hard mismatch.

Test Class Pinned reason
TestMapClearOneAllocation alloc-count-semantics At-most-one AllocsPerRun assert over sync.Map.Clear (allocs > 1 errors, so the want is at most one object per run). The managed shim reports bytes, not a count (measured 8,960 allocated BYTES over 10 run(s) ... BYTES PER RUN, not an allocation count. The go2cs runtime allocation counter charged none of it), so every object on this path is allocated outside golib (a compiler-emitted closure in converted code, or a BCL internal) and no count is available. A byte figure cannot be compared with an object want at any allocation behavior, so there is nothing to retire and no plan: the entry does not assert that the path allocates too much, it records that the instrument cannot answer the question the test asks. The shim does not simply report zero because that would be a false pass against a want of one. The signature is deliberately want-free: this test is Go 1.24’s rename of 1.23’s TestMapClearNoAllocations, and the want moved from 0 to 1 with it. At go1.26.10 it reads 896 bytes per run on windows (8,960 bytes over 10 runs) and 608 on linux (6,080 bytes over 10 runs), Release with tiering off, with no object charged to golib’s counter.
TestMapRangeNoAllocations alloc-count-semantics Want-zero AllocsPerRun assert over sync.Map.Range with a func(key, value any) bool callback. As with TestMapClearOneAllocation, the shim reports measured 1,520 allocated BYTES over 10 run(s) ... BYTES PER RUN, not an allocation count. The go2cs runtime allocation counter charged none of it, so no object count exists to compare with the want and the figure is byte-derived by construction; the units are incomparable, and there is nothing to retire and no plan. This test is unchanged between Go 1.23 and 1.24 (same name, allocs > 0, want 0); its signature is want-free for consistency with its sibling. At go1.26.10 it reads 152 bytes per run on windows and linux (1,520 bytes over 10 runs), Release with tiering off, with no object charged to golib’s counter.
TestOnceXGC aggregate no failure text of its own — the roll-up of this test’s disclosed subtests
TestOnceXGC/OnceFunc codegen-liveness The test asserts its own frame’s buf is collectible while the frame is still running. sync.OnceFunc DOES drop the wrapped function (measured: the backing array is released after the first call), but the test’s own f := fn(buf) passes the 32-byte slice header BY VALUE, so the x64 ABI makes the caller materialize an address-exposed stack temp; an address-exposed slot is not lifetime-tracked and the CLR reports it live for the whole method, pinning the array until the subtest RETURNS. Go’s per-safepoint liveness maps release the caller’s copy at its last use. Not satisfiable at any layer go2cs owns — it is the CLR’s GC-info conservatism, and it holds in fully optimized code, not just under the non-optimizing JIT.
TestOnceXGC/OnceFunc_panic codegen-liveness codegen-liveness: the same pin as TestOnceXGC/OnceFunc. The subtest’s constructor returns sync.OnceFunc’s own func, so no closure object is shared, but the test’s own f := fn(buf) passes the 32-byte slice header by value, the caller materializes an address-exposed stack temp, and the CLR reports it live for the whole subtest, pinning buf until the subtest returns; Go’s per-safepoint liveness maps release the caller’s copy at its last use. Here f panics on its first call. The hand-owned sync body clears f in a finally, the analogue of Go’s defer, so the panicking path drops f as the returning path does: MEASURED with the build and the first call each in a noinline helper (Go as its own oracle collects it), C# at Release+TC0 and Release tiered COLLECTED, where it was RETAINED before that clear moved into the finally (GolibTests OnceForeignExceptionTests guards it). With sync releasing f, what remains is the test frame’s temp.
TestOnceXGC/OnceValue codegen-liveness codegen-liveness: Two pins hold buf here, and EITHER alone fails the test. (1) The test’s own frame: f := fn(buf) passes the 32-byte slice header by value, the caller materializes an address-exposed stack temp, and the CLR reports it live for the whole subtest – the cause the TestOnceXGC/OnceFunc entry measures. (2) The shared closure object below. the subtest’s constructor is the literal func(buf []byte) func() { f := sync.OnceValue(func() any { buf[0] = 1; return nil }); return func() { f() } }. C# gives every lambda declared in one scope ONE closure object holding all the variables they capture, so the returned func() { f() } shares the object that holds buf, and buf stays reachable for as long as the returned func is – which the test holds across its check. Go captures each variable separately, so its returned func reaches only f, and sync.OnceValue drops its wrapped function after the first call. MEASURED with every arm built and called in noinline helpers, so no test frame roots buf, each arm also run under Go as its own oracle (all collected after the first call), C# at Release+TC0 and Release tiered alike: the test’s own literal – RETAINED; the same sync.OnceValue call with its adapter in a separate function, so the two lambdas do not share a scope – COLLECTED. The OnceFunc subtests, whose constructor returns sync.OnceFunc’s own func with no adapter, are collected by the same probe. Retires only when BOTH pins go: the frame temp, and the shared object (the emission giving the returned func its own closure object, capturing per variable rather than per scope).
TestOnceXGC/OnceValue_panic codegen-liveness codegen-liveness: Two pins hold buf here, and EITHER alone fails the test. (1) The test’s own frame: f := fn(buf) passes the 32-byte slice header by value, the caller materializes an address-exposed stack temp, and the CLR reports it live for the whole subtest – the cause the TestOnceXGC/OnceFunc entry measures. (2) The shared closure object below. the subtest’s constructor is the literal func(buf []byte) func() { f := sync.OnceValue(func() any { buf[0] = 1; panic(“test panic”) }); return func() { f() } }. C# gives every lambda declared in one scope ONE closure object holding all the variables they capture, so the returned func() { f() } shares the object that holds buf, and buf stays reachable for as long as the returned func is – which the test holds across its check. Go captures each variable separately, so its returned func reaches only f, and sync.OnceValue drops its wrapped function after the first call. Here f panics on its first call; the hand-owned sync body clears f in a finally, the analogue of Go’s defer, so the panicking path drops f as the returning path does (GolibTests OnceForeignExceptionTests guards it). MEASURED with every arm built and called in noinline helpers, so no test frame roots buf, each arm also run under Go as its own oracle (all collected after the first call), C# at Release+TC0 and Release tiered alike: the test’s own literal – RETAINED; the same sync.OnceValue call with its adapter in a separate function, so the two lambdas do not share a scope – COLLECTED. The OnceFunc subtests, whose constructor returns sync.OnceFunc’s own func with no adapter, are collected by the same probe. Retires only when BOTH pins go: the frame temp, and the shared object (the emission giving the returned func its own closure object, capturing per variable rather than per scope).
TestOnceXGC/OnceValues codegen-liveness codegen-liveness: Two pins hold buf here, and EITHER alone fails the test. (1) The test’s own frame: f := fn(buf) passes the 32-byte slice header by value, the caller materializes an address-exposed stack temp, and the CLR reports it live for the whole subtest – the cause the TestOnceXGC/OnceFunc entry measures. (2) The shared closure object below. the subtest’s constructor is the literal func(buf []byte) func() { f := sync.OnceValues(func() (any, any) { buf[0] = 1; return nil, nil }); return func() { f() } }. C# gives every lambda declared in one scope ONE closure object holding all the variables they capture, so the returned func() { f() } shares the object that holds buf, and buf stays reachable for as long as the returned func is – which the test holds across its check. Go captures each variable separately, so its returned func reaches only f, and sync.OnceValues drops its wrapped function after the first call. MEASURED with every arm built and called in noinline helpers, so no test frame roots buf, each arm also run under Go as its own oracle (all collected after the first call), C# at Release+TC0 and Release tiered alike: the test’s own literal – RETAINED; the same sync.OnceValues call with its adapter in a separate function, so the two lambdas do not share a scope – COLLECTED. The OnceFunc subtests, whose constructor returns sync.OnceFunc’s own func with no adapter, are collected by the same probe. Retires only when BOTH pins go: the frame temp, and the shared object (the emission giving the returned func its own closure object, capturing per variable rather than per scope).
TestOnceXGC/OnceValues_panic codegen-liveness codegen-liveness: Two pins hold buf here, and EITHER alone fails the test. (1) The test’s own frame: f := fn(buf) passes the 32-byte slice header by value, the caller materializes an address-exposed stack temp, and the CLR reports it live for the whole subtest – the cause the TestOnceXGC/OnceFunc entry measures. (2) The shared closure object below. the subtest’s constructor is the literal func(buf []byte) func() { f := sync.OnceValues(func() (any, any) { buf[0] = 1; panic(“test panic”) }); return func() { f() } }. C# gives every lambda declared in one scope ONE closure object holding all the variables they capture, so the returned func() { f() } shares the object that holds buf, and buf stays reachable for as long as the returned func is – which the test holds across its check. Go captures each variable separately, so its returned func reaches only f, and sync.OnceValues drops its wrapped function after the first call. Here f panics on its first call; the hand-owned sync body clears f in a finally, the analogue of Go’s defer, so the panicking path drops f as the returning path does (GolibTests OnceForeignExceptionTests guards it). MEASURED with every arm built and called in noinline helpers, so no test frame roots buf, each arm also run under Go as its own oracle (all collected after the first call), C# at Release+TC0 and Release tiered alike: the test’s own literal – RETAINED; the same sync.OnceValues call with its adapter in a separate function, so the two lambdas do not share a scope – COLLECTED. The OnceFunc subtests, whose constructor returns sync.OnceFunc’s own func with no adapter, are collected by the same probe. Retires only when BOTH pins go: the frame temp, and the shared object (the emission giving the returned func its own closure object, capturing per variable rather than per scope).

Excluded declarations

Declarations filtered from both sides of the comparison, and therefore not claimed above: Benchmark, Fuzz and Example declarations the converted host does not execute, plus any test requiring a capability the managed runtime does not provide — a testing member the host has not implemented, or a platform behavior it provably cannot reproduce. Each is named with the capability it needs.