Skip to content

The Rust column measured the ruler: 0 of 559 was never true - #2760

Merged
gHashTag merged 4 commits into
masterfrom
w699-rustc-ruler
Aug 28, 2026
Merged

The Rust column measured the ruler: 0 of 559 was never true#2760
gHashTag merged 4 commits into
masterfrom
w699-rustc-ruler

Conversation

@gHashTag

Copy link
Copy Markdown
Owner

Refs #2754

t27c corpus compiled each generated Rust file with

rustc --edition 2021 --crate-type lib --emit=metadata -A warnings -o /dev/null <file>

and rustc writes its metadata through a temp file next to the output path. With -o /dev/null it tries to create /dev/rmeta<random> and dies:

error: couldn't create a temp dir: Operation not permitted (os error 1)
       at path "/dev/rmeta4HIG1c"

On every input. Reproduced here on a 23-character valid Rust file: it fails with -o /dev/null and exits 0 with -o <path>. rustc 1.98.0 is on PATH, so this was never a missing toolchain.

The Rust column has therefore read zero for as long as it has existed — and that zero was reported as a finding, by me, in this session, including to the owner and in a release note.

Two commits, two different things

1. The ruler. Nothing about the emitted Rust changes:

was is
rustc accepts it 0 144 (22.2%)
ALL FOUR accept 0 60 (9.2%)

2. The largest real defect. Every generated struct carried #[derive(Debug, Clone, serde::Serialize, serde::Deserialize)] unconditionally, and the corpus compiles standalone with no --extern — so every struct-bearing spec failed with cannot find module or crate \serde`. Measured with the ruler fixed: the **first** error in 23 of 38 sampled specs. Behind a cfg_attr` the default output compiles against std alone, and turning the feature on gives byte-for-byte what was emitted before.

before after
rustc accepts it 144 173 (+29)
ALL FOUR accept 60 63 (+3)
Zig accepts it 217 217
cc accepts it 157 157

Zig and C are the control: a change to the Rust emitter must move the Rust numbers and nothing else, and it did.

The gate caught its author

668 seals re-sealed — under the category gen-drift, added this morning in #2746. Until today this gate compared spec_hash only, so a change that alters generated output while leaving every spec untouched — exactly this one — would have passed it without a word.

Suite 2424 passed / 0 failed; seal gate, specs-generate gate and check_gate_preconditions.py all exit 0.

🤖 Generated with Claude Code

gHashTag and others added 3 commits August 29, 2026 01:09
… 559 was never true

`t27c corpus` compiled each generated Rust file with

    rustc --edition 2021 --crate-type lib --emit=metadata -A warnings -o /dev/null <file>

and rustc writes its metadata through a temp file NEXT TO the output path. With
`-o /dev/null` it tries to create `/dev/rmeta<random>` and dies:

    error: couldn't create a temp dir: Operation not permitted (os error 1)
           at path "/dev/rmeta4HIG1c"

On EVERY input. Reproduced here on a 23-character valid Rust file: it fails with
`-o /dev/null` and exits 0 with `-o <path>`. rustc 1.98.0 is on PATH, so this
was never a missing toolchain.

So the Rust column has read zero for as long as it has existed, and that zero
was reported as a finding -- by me, in this session, including to the owner and
in a release note. Corrected:

                            was      is
    rustc accepts it          0     144   (22.2%)
    ALL FOUR accept           0      60    (9.2%)

Nothing about the emitted Rust changed in this commit. The other three columns
are unmoved -- Zig 217, cc 157, Zig-AND-Verilog 194 -- which is the control:
a change to the rustc invocation should move the rustc number and nothing else.

The lesson is the one this repository already has a name for. Every other
backend's check writes to a real file; this one wrote to /dev/null and its
failure looked exactly like "the generated code is bad". A measurement that
cannot succeed is not a measurement of the thing it names.

Refs #2754

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
…the Rust column

Every generated struct carried

    #[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]

unconditionally, and the corpus compiles that output as a standalone
`--crate-type lib` with no `--extern`. So every struct-bearing spec failed with

    error[E0433]: cannot find module or crate `serde`

Measured on this tree with the ruler fixed in the previous commit: the FIRST
error in 23 of 38 sampled specs. Behind a `cfg_attr` the default output compiles
against std alone, and anyone who wants serialisation turns the feature on and
gets byte-for-byte what was emitted before.

                            before   after
    rustc accepts it           144     173   (+29)
    ALL FOUR accept             60      63    (+3)
    Zig accepts it             217     217
    cc accepts it              157     157

Zig and C are the control: a change to the Rust emitter must move the Rust
numbers and nothing else, and it did.

668 seals re-sealed. Worth saying which category caught them: `gen-drift`, added
this morning. Until today this gate compared `spec_hash` only, so a change that
altered generated output while leaving every spec untouched -- exactly this one
-- would have passed it without a word. The gate caught its author's own change
on the commit that made it.

Suite 2424 passed / 0 failed.

Refs #2754

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Refs #2754

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown
Contributor

📓 NotebookLM Notebook linked to this PR

This notebook contains session context, decisions, and artifacts for this work.

@github-actions

Copy link
Copy Markdown
Contributor

PR Dashboard

Generated at: 2026-08-28 18:21:46 UTC

Summary

Status Count
Total Open PRs 10
PRs with Failing Checks 9
PRs with All Checks Green 1
READY 0
FAILING 9
PENDING 0

Seal Status

  • ⚠️ STALE -- sha256(compiler.rs)=33df0f208cee != manifest seal=87e5cbd3ad94.
    The committed NMSE numbers were certified against an older compiler.rs.
    Run scripts/reseal-check.sh locally for the two-step reseal command (advisory; not a merge gate).

Up to date after #2758 and #2759; the ruleset requires it and a rebase would
need a force-push.
@github-actions

Copy link
Copy Markdown
Contributor

📓 NotebookLM Notebook linked to this PR

This notebook contains session context, decisions, and artifacts for this work.

@github-actions

Copy link
Copy Markdown
Contributor

PR Dashboard

Generated at: 2026-08-28 18:33:14 UTC

Summary

Status Count
Total Open PRs 8
PRs with Failing Checks 7
PRs with All Checks Green 1
READY 0
FAILING 7
PENDING 0

Seal Status

  • ⚠️ STALE -- sha256(compiler.rs)=33df0f208cee != manifest seal=87e5cbd3ad94.
    The committed NMSE numbers were certified against an older compiler.rs.
    Run scripts/reseal-check.sh locally for the two-step reseal command (advisory; not a merge gate).

@gHashTag
gHashTag merged commit 1e482f3 into master Aug 28, 2026
34 of 35 checks passed
@gHashTag
gHashTag deleted the w699-rustc-ruler branch August 28, 2026 18:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant