Skip to content

EPIC: golden reference language -- the compiler sieve (TNF-style theorems), and t27 passes it #6488

Closed
13 of 15 issues completed

Description

@gHashTag

Owner order, 2026-10-05: compare compilers along these axes and state the conclusions as theorems, the way the TNF work does; the task is to create the golden reference programming language. Then: save it as an epic, pin it, and give it priority for the Queen.

Goal

Derive the golden reference programming language the way TNF derived linear-9 (.claude/skills/tnf-gfternary.md, "THE GOLDEN SIEVE"): from a sieve, not by choice. Then make t27 pass the sieve.

The compiler sieve

One filter per comparison axis. Each filter is a decidable predicate with a numbered theorem in .t27 (invariant / test) and its source in a ; comment.

Filter Axis Source
C1 semantic preservation CompCert
C2 translation validation (each compiled result checked) Pnueli et al.; Necula
C3 differential testing Csmith, EMI, YARPGen
C4 Diverse Double-Compiling vs the Thompson trojan Thompson 1984; Wheeler 2009
C5 Futamura projections Futamura 1971
C6 JIT warmup Barrett et al. 2017
C7 compile speed and code quality --
C8 retargetability --
C9 reproducible builds reproducible-builds.org
C10 vacuity-aware coverage (an empty test run is not a pass) Zig #13633 lesson
  • Candidates: t27c, t27b, Zig self-hosted aarch64/x86_64, rustc_codegen_cranelift, Go SSA, QBE, CompCert, LLVM.
  • Values: TRUE / FALSE / UNKNOWN. A value with no published source is UNKNOWN, never a guess.
  • Theorems to state, in TNF style:
    • which filters actually remove a candidate, and which are subsumed or never fire (the T441 analog);
    • which candidates survive;
    • what the derived golden language is;
    • where t27 fails today, with the issue that fixes each failure.

Known t27 gaps (each is a sub-task)

Rules

  • Only t27 (owner hard rule 2026-10-05): every PR under this epic contains only .t27 specs and files t27c generates. Hand-written foreign code is denied by lefthook and CI.
  • Numbers come from a run or a cited publication. No number without a source.
  • Queen bees take the sub-issues that carry the four headings; this epic itself is not a bee task.

Activity

  1. pinned this issue on Oct 5, 2026
  2. 27 remaining items

  3. gHashTag commented on Oct 8, 2026

    @gHashTag
    OwnerAuthor

    C4 now has signed, citable evidence (#7706, #7711).

    The t27b lab signs a DDC receipt whenever S, E or FROZEN_HASH move:

    • domain t27-ddc-receipt-v1;
    • key a05db80f53c317f6;
    • trust NAMED.

    The latest receipt is https://t27b-lab-production.up.railway.app/ddc/latest.receipt.json, for master 927b1ef. Running t27c ddc-receipt verify from a checkout of that commit exits 4:

    • Verdict: DDC_BACKEND_AGREEMENT. C4 holds: false.
    • Routes A, B and C are gen-c + cc, t27b and the Zig reference. Each one's stage 2 equals E (sha256 3efc314e...), and S is 261f436a....
    • Every route parsed S with bootstrap/src/compiler.rs@39fa3908, so the agreement is of back ends only (T729, T732).

    What would change the verdict. The receipt will read DDC_INDEPENDENT (exit 0) as soon as a route parses S with a front end that does not share compiler.rs. That is #5980's self-hosted front end. The sieve's t27c C4 cell stays FALSE and maps to #5980 until then.

    Also on record:

  4. gHashTag commented on Oct 9, 2026

    @gHashTag
    OwnerAuthor

    C9 (reproducible builds) measured, in #8148 / PR #8181. Commit be97577, rustc 1.99.0, x86_64 release, seven builds on the two labs, varying path, clock, user, TZ, locale, umask, SOURCE_DATE_EPOCH, clone depth, CARGO_HOME and host.

    • t27b: TRUE. All seven builds give 258950de2fa4a978.... The aarch64 cross build gives b0917f8870d89991... in both of its builds.
    • t27c: FALSE, fix issue t27c build is not reproducible: git short-sha length and CARGO_HOME path are baked into the binary (sieve C9) #8178. The seven builds give four binaries: c661e5ec... (A, B, D), 477efb0f... (depth-1 clone), 5f327808... (other CARGO_HOME), ac69ce14... (t27b lab). The two causes are build.rs's git rev-parse --short length (7 vs 9) and the absolute CARGO_HOME registry paths in panic locations. With --remap-path-prefix=$CARGO_HOME=/cargo, t27c gives one binary, 253be263..., across both labs and all three cache paths.
    • gen, gen-c and gen-rust: deterministic over the 2037-slot corpus, across five runs and three distinct binaries.

    The rule and data are in specs/compiler/theory/reproducible.t27. The sieve is updated: T738-T741 counts change, and G8 stays PARTIAL.

  5. gHashTag commented on Oct 9, 2026

    @gHashTag
    OwnerAuthor

    Sieve C6/C7 re-read (#7596), PR #8182.

    Run details. Railway t27b lab, master be97577, AMD EPYC 9655. All programs ran as aarch64 under qemu-aarch64 7.2. Load average was recorded per sample and was 21-88 during C6.

    Cell values after #8182:

    Cell Before After
    t27b C6 FALSE TRUE (partial: emulated arm64, six kernels, one run)
    t27b C7 FALSE TRUE
    t27c C7 FALSE TRUE
    t27c C6 NA NA (ahead-of-time compiler)
    • t27c has 3 FALSE cells (C1, C4, C5), and t27b has 1 (C1).
    • G6 goes from MISSING to PARTIAL.
    • Old rows are kept as cell_*_at_be9757784. T752 records the move.

    C6 (2026-10-09 10:23Z-10:39Z). 6 kernels x 10 executions x 500 in-process iterations. The classifier is Barrett et al. 2017, written in t27 (specs/compiler/theory/warmup.t27, T750). The data and the classification are in specs/compiler/theory/warmup_t27b.t27 (T751).

    Kernel Class
    sieve, collatz, ternary FLAT
    fib, matmul GOOD INCONSISTENT (1 of 10 warms up)
    f64loop BAD INCONSISTENT (1 of 10 has no steady state)

    There is no first-iteration spike: iteration 1 / steady mean is 0.90-1.03.

    C7 (2026-10-09 11:32Z-11:50Z). Same method as the comment above: min/median of 5, load recorded. The samples are in specs/compiler/theory/speed_quality.t27 (T753). Geomeans of the median ratios:

    Ratio Kernels Value
    t27b wall / clang -O2 5, f64loop folded by clang 3.13
    t27b run phase / clang -O2 5 2.65
    t27b wall / zig ReleaseFast 6 2.27
    t27b run phase / zig ReleaseFast 6 1.90
    t27b wall / gcc -O2 6 2.72
    gen-c via gcc -O2 / via clang -O2 5 0.98

    Compile times:

    Step Time
    gen-c 3.5-5.7 ms
    gen 4.1-7.9 ms
    t27b JIT compile (qemu) 32.7-86.0 ms
    clang -O2 66-135 ms (22.2x gen-c)
    zig ReleaseFast 15.0-16.4 s (306x the t27b JIT compile)

    Full method and caveats: docs/reports/2026-10-09-sieve-c6-c7.md.

  6. gHashTag commented on Oct 9, 2026

    @gHashTag
    OwnerAuthor

    C9 (#8148, PR #8181) update after #8182 (C6/C7) merged first: master merged into #8181 and the sieve recounted. Combined state: t27c FALSE on C1, C4, C5, C9 (4); t27b FALSE on C1 only (1); 4 filters fire; t27b TRUE 7. sieve.t27 test-report 12/12, reproducible.t27 10/10, 0 vacuous, resealed with t27c built at 5ba4247 on the t27c lab. The C9 verdicts are unchanged: t27b TRUE, t27c FALSE (fix #8178).

  7. added a commit that references this issue on Oct 11, 2026
    6939621
  8. gHashTag commented on Oct 11, 2026

    @gHashTag
    OwnerAuthor

    Closing summary for the audit trail.

    Done: PR #9068 (lane #8965) merged 2026-10-11 12:01:39Z — std.mem.trim / indexOf / indexOfScalar, std.math.approxEqAbs as spliced stdmem.t27 routines, @sqrt comptime fold via the binary128 q_sqrt. Every reference-passing spec the epic's parity set names now runs green on t27b with no mismatches and no vacuous passes.

    Measured on the merged master (a9ad525): reference_pass 1435, t27b_pass 1407 of them, crash 0, per-test disagree 0. The 28-spec gap is specs/ml/** unlocked on the reference after the parity census — next lane #9065.

    Cleanup the merge left: five stale seals + a ledger missing four native rows — fixed by #9070, #9073, #9079 and #9085 (ledger re-blessed from the native run; tracked in #9072).

    🤖 Generated with Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    epicpriority/criticalProduction-blocking, security, or correctness regression

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions