unique — validation proof

Go’s own unique 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 unique row in Validated Test Packages.

Validated 2026-09-22 · converter c6fdbe73c

21 matched · 1 disclosed — Go 1.24.13, windows/amd64, converted package src/core/unique.

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

Verdicts

Test go test go2cs
TestHandle pass pass
TestHandle/testEface/"hello" pass pass
TestHandle/testEface/<nil> pass pass
TestHandle/testIntArray/unique.testIntArray{7,_77,_777,_7777} pass pass
TestHandle/testString/"" pass pass
TestHandle/testString/"bar" pass pass
TestHandle/testString/"foo" pass pass
TestHandle/testStringArray/unique.testStringArray{"a",_"b",_"c"} pass pass
TestHandle/testStringStruct/unique.testStringStruct{a:"x"} pass pass
TestHandle/testStringStructArrayStruct/unique.testStringStructArrayStruct{s:[2]unique.testStringStruct{unique.testStringStruct{a:"y"},_unique.testStringStruct{a:"z"}}} pass pass
TestHandle/testStruct/unique.testStruct{z:0.5,_b:"184"} pass pass
TestHandle/testZeroSize/unique.testZeroSize{} pass pass
TestHandleUnsafeString pass pass
TestMakeCloneSeq pass pass
TestMakeCloneSeq/testEface pass pass
TestMakeCloneSeq/testIntArray pass pass
TestMakeCloneSeq/testString pass pass
TestMakeCloneSeq/testStringArray pass pass
TestMakeCloneSeq/testStringStruct pass pass
TestMakeCloneSeq/testStringStructArrayStruct pass pass
TestMakeCloneSeq/testStruct pass pass
TestMakeClonesStrings pass fail (disclosed)

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
TestMakeClonesStrings codegen-liveness codegen-liveness: Go’s liveness maps drop a local at its LAST USE, so the test’s cloned string is unreachable before runtime.GC() and the finalizer on its backing runs inside the one-second wait. The converted @string is a 16-byte readonly struct (byte[] + int + int – exactly one managed reference), and the host keeps a caller frame slot rooted while the local remains in scope, so the backing survives the collection and the wait times out with Go’s own message. MEASURED with a six-arm instrument, ONE ARM PER PROCESS, every arm also run under Go as its own oracle, and two controls that disagree in both directions at every configuration (a deliberately rooted referent reads RETAINED; a plainly dead byte slice, sharing none of the string machinery, reads COLLECTED). Readings as Go / Release+TC0 / Release-tiered / Debug – (1) caller slot LIVE: COLLECTED / RETAINED / RETAINED / RETAINED; (2) caller slot OVERWRITTEN: COLLECTED / COLLECTED / RETAINED / RETAINED; (3) by-value hand-off to a callee THEN overwritten: COLLECTED / COLLECTED / RETAINED / RETAINED; (4) the real unique.Make call THEN overwritten, handle KeepAlive’d across the collection: COLLECTED / COLLECTED / RETAINED / RETAINED. Arms 2, 3 and 4 are identical in all four columns, so neither the callee’s by-value copy nor the intern map nor the handle holds the caller’s bytes: the clone half and the referent bridge both work, measured rather than argued, and the pin is SOLELY the caller’s frame slot. This test’s own shape is arm 1 – it never overwrites its local – which retains at every configuration. Optimization honours an overwritten slot at Release+TC0 and does not under tiering or in Debug, and it frees a merely-dead-but-in-scope slot at NO configuration measured. That is the host’s liveness model, a representational fact rather than an unbuilt feature, which is why this is disclosed and not billed as work.

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.