Skip to content

sieve C9: record gen-c output determinism of t27c on 12 specs #6517

Closed

Description

@gHashTag

Boundary

  • specs/compiler/theory/reproducible.t27 (new file; nothing else)

User Scenarios

Requirements

  • Run t27c gen-c <spec> twice on each of these 12 specs and compare the two outputs with cmp:

    • specs/compiler/theory/sieve.t27
    • specs/compiler/theory/toolchain.t27
    • specs/compiler/theory/isa_round_trip.t27
    • specs/isa/ternary_encoding.t27
    • specs/fpga/assembler.t27
    • specs/tri/t27b/steward.t27
    • specs/queen/priority.t27
    • specs/compiler/core/t27core.t27
    • specs/math/constants.t27
    • specs/numeric/gf16.t27
    • specs/base/types.t27
    • specs/fpga/linker.t27

    Skip any spec that does not exist and record it as skipped.

  • Record the result in the new module CompilerTheoryReproducible (specs/compiler/theory/reproducible.t27):

    • one pub fn identical(i: u32) -> bool and one pub fn spec_count() -> u32;
    • the master commit the run used, as a ; comment;
    • ; prose that explains this is output determinism of one t27c binary, not a bit-identical build of t27c itself. The latter needs two independent builds of t27c and stays open.
  • Tests that call these functions at run time:

    • count the identical outputs and assert the number observed;
    • a negative control: two different specs whose gen-c outputs differ (cmp exits 1), recorded and asserted as different.
  • Lines start with ; for prose (never a bare ;), ASCII only, English identifiers.

  • The PR contains only .t27 and t27c-generated files (owner hard rule 2026-10-05).

  • The PR says Closes #<this issue> and Refs #6488.

Success Criteria

  • t27c typecheck specs/compiler/theory/reproducible.t27 prints Typecheck OK (0 errors.
  • t27c gen-c specs/compiler/theory/reproducible.t27 > /tmp/r1.c && t27c gen-c specs/compiler/theory/reproducible.t27 > /tmp/r2.c && cmp /tmp/r1.c /tmp/r2.c exits 0.
  • grep -c '^test ' specs/compiler/theory/reproducible.t27 prints 2 or more.
  • git diff --name-only origin/master...HEAD lists only specs/compiler/theory/reproducible.t27.

Metadata

Metadata

Assignees

No one assigned

    Labels

    priority/highMust fix before next milestone

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions