Skip to content

tools: ask every compiler whether it reports what it finds - #3451

Merged
gHashTag merged 1 commit into
masterfrom
measure/uncapped-instruments
Sep 8, 2026
Merged

tools: ask every compiler whether it reports what it finds#3451
gHashTag merged 1 commit into
masterfrom
measure/uncapped-instruments

Conversation

@gHashTag

@gHashTag gHashTag commented Sep 8, 2026

Copy link
Copy Markdown
Owner

Closes #3450 · Refs #3448

One instrument had been censoring its own totals — clang's default
-ferror-limit=20, which made every C error count published for this
repository a floor. The obvious next question is whether the others do the
same, and nobody had asked.

Measured — 50 known errors planted per language

instrument reported verdict
clang (default) 20 truncates
clang -ferror-limit=0 50 complete
rustc 50 complete
zig build-obj 50 complete
iverilog 50 complete — two diagnostic lines per error
yosys 1 aborts on the first error

yosys is not capped, it stops. An error count from it is 0 or 1 and means
nothing; only its pass/fail is a measurement.

Two of the five fixtures were wrong, and both read as findings

  • the Zig fixture named its functions f16 and f32 — which shadow Zig
    primitives
    — so it failed with 2 errors of an entirely different kind
    before reaching the undefined names. Indistinguishable from a cap.
  • the Verilog fixture used implicitly declared identifiers, which yosys
    treats as a warning
    , so it reported zero. Indistinguishable from silence.

Three of five instruments were misread on the first attempt and none of them
was at fault. --self-check now requires each fixture to produce the expected
kind of diagnostic before its count is believed.

What is not affected — measured, not hoped

why
acceptance counts clang's exit code is 1 with and without the limit on a failing file, 0 on a clean one — a count of files that compile cannot be censored by a per-file cap
the repository's gates the only tool invoking cc is check_duplicate_agreement.py, and it reads returncode
the Rust totals (#3437) rustc reports completely

What was wrong is exactly the C error totals in my own reports:

published actual
3849 15188
3825 15133
— (after #3449) 15126

It degrades rather than lying

The CI runner carries neither zig nor yosys, and a gate that cannot run must
say so rather than fail forever. So a runner checks the compilers it has and
names what it skipped; only a run with nothing available exits 2.

control expected got
a planted truncation red exit 1
PATH with clang only pass, naming 4 skips exit 0, NOT CHECKED (4 of 6)
empty PATH could not run exit 2
a fixture that stops producing its error red exit 1

Wired into Spec Guards, under a second.

Closes #3450
Refs #3448

One instrument had been censoring its own totals -- clang's default
`-ferror-limit=20`, which made every C error count published for this
repository a floor. The obvious next question is whether the others do the
same, and nobody had asked.

Planting 50 known errors per language:

    clang (default)            20   TRUNCATES
    clang (-ferror-limit=0)    50   complete
    rustc                      50   complete
    zig                        50   complete
    iverilog                   50   complete (TWO diagnostic lines per error)
    yosys                       1   ABORTS on the first error

yosys is not capped, it stops. An error COUNT from it is 0 or 1 and means
nothing; only its pass/fail is a measurement.

THE FIXTURES WERE THE HARD PART, and two of the five were wrong in ways that
read as findings about the compiler rather than about me:

  * the Zig fixture named its functions `f16` and `f32`, which SHADOW ZIG
    PRIMITIVES, so it failed with 2 errors of a different kind before reaching
    the undefined names -- indistinguishable from a cap;
  * the Verilog fixture used implicitly declared identifiers, which yosys
    treats as a WARNING, so it reported zero -- indistinguishable from silence.

`--self-check` therefore requires each fixture to produce the expected KIND of
diagnostic before its count is believed.

WHAT IS NOT AFFECTED, measured rather than hoped:

  * acceptance counts. Clang's exit code is 1 with and without the limit on a
    failing file, and 0 on a clean one, so a count of FILES that compile cannot
    be censored by a per-file cap. Every `cc accepts N` figure stands.
  * the repository's gates. The only tool invoking `cc` is
    check_duplicate_agreement.py, and it reads `returncode`.
  * the Rust totals, since rustc reports completely.

What was wrong is exactly the C error totals in my own reports: 3849 was
15188, 3825 was 15133, and after #3449 it is 15126.

The tool DEGRADES rather than lying. A runner without zig or yosys checks the
compilers it has and NAMES what it skipped; only a run with nothing available
exits 2. That matters because the CI runner carries neither, and a gate that
cannot run must say so rather than fail forever.

Four controls: a planted truncation reddens it, a one-compiler PATH passes
while naming four skips, an empty PATH exits 2, and a fixture that stops
producing its error fails the self-check.

Wired into Spec Guards, under a second.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@gHashTag
gHashTag enabled auto-merge (squash) September 8, 2026 02:13
@github-actions

github-actions Bot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

PR Dashboard

Generated at: 2026-09-08 02:13:07 UTC

Summary

Status Count
Total Open PRs 16
PRs with Failing Checks 13
PRs with All Checks Green 3
READY 2
FAILING 13
PENDING 0
NO CHECKS YET 0

These columns do not partition: 2 + 13 + 0 + 0 = 15, and there are 16 open PRs. A PR is being counted twice or not at all.

Seal Status

  • ⚠️ STALE -- sha256(compiler.rs)=911a664330ef != 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).

@github-actions

github-actions Bot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

📓 NotebookLM Notebook linked to this PR

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

@gHashTag
gHashTag merged commit 8449b88 into master Sep 8, 2026
24 of 28 checks passed
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.

Audit every diagnostic counter for a cap, and record the answers

1 participant