GoPatina

The evidence: GoPatina's speed and correctness, as a study

GoPatina makes two measurable claims, and this page reports them the way a scientific paper would: what is tested, how, on which machines, with which statistics, what has been measured so far, and what could make the results wrong. The speed bar is met on its primary metric, user instructions, at 5σ and at 6σ (test server, 2026-11-22); on run time it is not yet decided, and the correctness bar is pending. Nothing here claims more than was measured. Summaries are on the benchmarks and correctness pages.

1. Hypotheses

Speed. For each benchmark, let μ be the mean of the paired log ratios ln(TGoPatina / TRust), and δ = ln 1.005 ≈ 0.0049875, a margin of about ±0.5% on the ratio. H₀: |μ| ≥ δ, the two differ by at least the margin. H₁: |μ| < δ, they are equivalent. "Identical speed" means H₀ is rejected at 5σ.

Correctness. Let p be the probability that a test is a defect, and p₀ = 3.4 × 10⁻⁶, the Six Sigma rate of 3.4 defects per million opportunities (DPMO). H₀: p ≥ p₀. H₁: p < p₀, shown at 6σ confidence.

2. Method

3. Apparatus

AspectLocal runs (not official)Test server (official)
MachineIntel Core i7-8650U, 8 logical CPUs, 60 GiB RAM (a laptop)Intel Xeon Gold 6152 at 2.10 GHz, 7 vCPUs, 7 GB RAM (a rented virtual server)
Operating systemLinux 7.0.0-43 x86_64Ubuntu 24.04, Linux 6.8.0
ToolchainsGo 1.27.1; rustc 1.93.0 (latest stable on the machine, and the version emitted crates pin)Go 1.27.1; Rust 1.100.0 stable, and 1.93.0 for emitted crates
Loadin normal use: load average 2 to 37 on 8 CPUsthe pilot: load average 0.2 to 2.3; the counter runs: 7.6 to 9.8, beside the long correctness run, which leaves instruction counts unchanged but disturbs cycles and wall time
Recorded with each resultcommit, versions, date, loadcommit, versions, CPU model, date, load

4. Statistical analysis

Speed: two one-sided tests (TOST). The two binaries run alternately in ABBA order after warm-up runs, so slow drift affects both alike. From the N paired log ratios, with mean μ̂ and standard deviation s, the (1 − 2α) confidence interval is μ̂ ± t1−α, N−1 · s / √N, with α = Φ(−5) ≈ 2.87 × 10⁻⁷ for each one-sided test. The benchmark is equivalent when the whole interval lies inside (−δ, δ), slower or faster when it lies wholly beyond, and inconclusive otherwise. N is chosen from a 100-run pilot as N ≈ (5 · s / (δ − |μ̂|))², so that the interval can fit inside the margin. Across the three benchmarks, the chance of any false "equivalent" is at most 3α ≈ 8.6 × 10⁻⁷ (Bonferroni).

Correctness: a zero-defect bound at 6σ. With 0 defects in N independent tests, the exact one-sided upper bound on p at confidence 1 − α is 1 − α1/N, which is below −ln(α) / N. H₀ is rejected at level α when N ≥ −ln(α) / p₀. The bar uses α = Φ(−6) ≈ 9.87 × 10⁻¹⁰, 6σ confidence, so it needs 0 defects in at least 6,099,050 tests. On the way there, 0 defects in 881,098 tests show the same rate at 95% confidence (α = 0.05, where −ln(α) / N ≈ 3 / N is the rule of three); that is reported as a milestone, not as the bar. The 3.4 per million comes from the Six Sigma convention: a mean 6σ from its limit, less the conventional 1.5σ long-term drift, leaves 4.5σ, and P(Z > 4.5) ≈ 3.4 × 10⁻⁶.

5. Results

MeasuredResultWhen and whereStanding
fib speeduser instructions 1.0000024 [1.0000018, 1.0000029]: equivalent; cycles 1.069 [1.001, 1.140] and wall time 1.043 [0.977, 1.114]: inconclusive2026-11-21, laptop, commit 6cb858f, CPU counters, 300 runs per binary, 5σ, tested at ±1% (equivalent at ±0.5% too)not official
sieve speedinstructions 1.302; cycles 1.073 [1.055, 1.092]; wall time 1.067 [1.025, 1.110]: slower on all threesame runnot official; the cause has since been removed (next row)
suffix-sum speedinstructions 1.0000020 [1.0000015, 1.0000026]: equivalent; cycles 0.992 [0.962, 1.022] and wall time 0.977 [0.880, 1.084]: inconclusivesame runnot official
Machine code after RFC 0006the hot loops of all three benchmarks are the same instructions as the hand-written Rust's; what remains is a 3-instruction panic-hook setup at startup (and one alignment no-op in sieve)2026-11-21, rustc 1.93.0compiles only; not a speed measurement
Test-server pilot, wall timefib 0.984 [0.948, 1.021], sieve 0.975 [0.874, 1.087], suffix-sum 1.007 [0.961, 1.056]: all inconclusive; the standard deviation of the log ratios was 7% to 20%2026-11-22, test server, commit 0af9da8, 100 runs per binary, 5σthe noise is far wider than ±0.5%: wall time on this machine cannot decide the bar
Test server, user instructions (the primary metric), one rustc (1.100.0) for bothfib 1.0000082 [1.0000074, 1.0000090], sieve 1.0000062 [1.0000056, 1.0000069], suffix-sum 1.0000071 [1.0000061, 1.0000082] at 6σ: all equivalent; the 5σ run agrees2026-11-22, test server, commit bfed1e1, CPU counters, 100 runs per binarythe speed bar met on its primary metric
Test server, cycles and wall time, the same runsall inconclusive, except fib's cycles at 0.903 [0.881, 0.926], although both binaries execute the same instructionsthe same runs, under loadnot taken as a result: these metrics need a quiet machine
Machine code, rustc 1.100.0fib's hot function identical; each main differs only by the startup panic-hook setup2026-11-22, test servercompiles only; not a speed measurement
The speed bar (±0.5%, at 5σ and 6σ)met on user instructions; on run time not yet decidedtest servermet on the primary metric; run time pending a quiet run
Golden programs106 of 106 match the Go reference build's output, first stderr line and exit statusevery change, in CIpassing
Development smoke runs1,318 generated tests, 0 defects2026-11-21, laptop, three generator versionsfar below 881,098: not evidence for the bar
Defects found by the generated tests3: a shift after a type conversion did not compile; a shift by a constant at least the operand's width gave Rust's result instead of Go's; a float with two equally close shortest representations printed the upper one (all fixed, with golden programs)2026-11-22: test server, programs 150 to 299; laptop, new generator cases before mergingthe run restarts with the fixed compiler
Go compiler disagreements found by the generated tests2: optimized gc builds on amd64 (one from Go 1.22.0, the other from 1.26.0, both up to 1.27.1) printed results that contradict the specification and a hand calculation; the reference build and GoPatina agreed with both2026-11-22, test server, programs 169026 and 174986not GoPatina defects; the Go oracle is now the reference build, and both programs are golden tests
Correctness milestone (≤ 3.4 DPMO at 95% confidence)pending: 0 defects needed in at least 881,098 teststest serverpending
The correctness bar (≤ 3.4 DPMO at 6σ confidence)pending: 0 defects needed in at least 6,099,050 teststest serverpending

Brackets are 5σ intervals of the ratio GoPatina / hand-written Rust; below 1 is faster. Seven defects have been found and fixed so far. By hand: a make with a negative length known only at run time panicked with Rust's message instead of Go's; float-to-integer conversions gave Rust's saturated result where Go's compiler gives another; a width on a slice padded the whole slice, where Go pads each element; and a slice literal printed without a type from its context did not compile when a constant was outside 32 bits. By the generated tests: an expression such as a*b << 27 whose left side ended in a conversion did not compile as Rust; a shift by a constant at least the operand's width gave Rust's result instead of Go's; and a float with two equally close shortest representations printed the upper one, where Go prints the even one. Each fix came with golden programs and a generator case. Raw results and run notes are in BENCHMARKS.md.

6. Threats to validity and limitations

7. Reproducibility

Every result names its commit, toolchains and machine, and its raw JSON is in bench/results. From a checkout of that commit:

bench/run.sh --equiv --runs 100 --out pilot.json          # pilot: read sd_log_ratio
bench/run.sh --equiv --runs N --out equiv.json            # the TOST run, N from the pilot
bench/asm-check.sh                                        # the machine-code comparison
go build -o gopatina ./cmd/gopatina && go build -o gopatina-difftest ./cmd/gopatina-difftest
./gopatina-difftest -seed 1 -programs 6076000 -per 150 -jobs 6 -gopatina ./gopatina >difftest.json   # 6,116,548 tests

Emitted Rust is byte-identical for the same input, and gopatina verify checks that a -patina binary has the same sha256 as a plain cargo build --release --locked of the emitted crate. The formulas are also in docs/QUALITY.md.

8. References