golang.org/x/sync/semaphore — validation proof

Go’s own golang.org/x/sync/semaphore 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, and written beside the conversion: it is not a row of go2cs’s standard-library roster.

Validated 2026-10-14

7 matched · 1 disclosed — Go 1.24.13, linux/amd64, converted package src/golang.org/x/sync/semaphore.

Measured at Release (tiered JIT off), oracle go version go1.24.13 linux/amd64, with no controlling terminal.

Both sides were built with -tags purego,math_big_pure_go,safe.

Input digest sha256-ed3ee1b889d0eeb98b472fe70e016c59b05164c834ddf284d2298c8b9f873b93: the package’s Go sources, conversion options, target and converter, as its project records them (GoInputDigest).

Verdicts

Test go test go2cs
TestAllocCancelDoesntStarve pass pass
TestLargeAcquireDoesntStarve pass pass
TestWeighted pass pass
TestWeightedAcquire pass fail (disclosed)
TestWeightedAcquireCanceled pass pass
TestWeightedDoesntBlockIfTooBig pass pass
TestWeightedPanic pass pass
TestWeightedTryAcquire 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
TestWeightedAcquire runtime-capability runtime-capability: the test gives each tryAcquire a 10 ms context deadline, and under the -tests host’s configuration of record (Release, tiered compilation off) the FIRST call JIT-compiles the Acquire path at full optimization before its select runs, which on the measuring box (linux/amd64, 4 cores) takes longer than 10 ms, so ctx.Done() is already closed: tries[0] reads false and the warm second call reads true (tries[1]). The converted closure is faithful (semaphore_test.cs: ctx is never reassigned). Discriminator, same box, same converter: -test-tiered gives semaphore 8/8 and the module 28 matched, the windows bank’s count, so the divergence is first-call JIT latency, not conversion. Measured 2 of 2 runs untiered. A faster host that passes it reports this entry ORPHANED (report-only, the row still validates). Retires if the host’s configuration of record warms or tiers first calls. COORD ruling 2026-10-12 (wave 2): disclose with the -test-tiered discriminator as the evidence.

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.