tools: rank what is actually wrong with the generated C - #3466
Merged
Conversation
Refs #3464 Three passes followed one error class from 1729 down to 522 while a family ten times its size sat uncounted, because the first question of each pass was "what is left of what I was doing" rather than "what is biggest now". This asks the second one, and found in a single run what three passes had not: 642 unexpected type name 'Trit': expected expression 412 use of undeclared identifier 'POS' 319 use of undeclared identifier 'NEG' --- 1373 one family, never looked at, against 522 in the class I was shrinking TWO THINGS IT INSISTS ON, both learned the hard way. `-ferror-limit=0`, because clang stops at twenty per file and 141 corpus files reach it, so every total measured without it is a floor -- 3849 reported where the real count was 15188 (#3448). And the compiler's identity printed beside the numbers, because the same command gives 20 on Apple clang and 50 on gcc for the same input (#3450). `--undeclared` splits the 2057 undeclared-function errors by CAUSE, which the totals cannot do: 487 (23%) A declared as `fn` in some spec, not reaching this file len(142), mean(40), decode(26) 149 ( 7%) B the name of a MODULE or spec FILE, called as a function adder_tree(58), ternary_gemm(50), pipeline(40) 1421 (69%) C a name nothing in the tree declares cast_i8(210), compose(76), booth_mul_i32(64) Three causes, three different repairs, and the counts had them in one bucket. A READER, not a gate, and deliberately not wired into CI: it rebuilds the whole corpus, and nothing it prints is a pass/fail claim. Run it at the START of a pass to decide what the pass is about. Its self-check is the usual pair -- a planted error must be counted and a clean file must count zero -- because a report of "0" and a report that could not run look identical. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Contributor
gHashTag
enabled auto-merge (squash)
September 8, 2026 07:00
Contributor
|
📓 NotebookLM Notebook linked to this PR
This notebook contains session context, decisions, and artifacts for this work. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refs #3464
Three passes followed one error class from 1729 down to 522 while a family
ten times its size sat uncounted — because the first question of each pass
was "what is left of what I was doing" rather than "what is biggest now".
This asks the second one, and found in a single run what three passes had not:
Two things it insists on, both learned the hard way
-ferror-limit=0— clang stops at twenty per file and 141 corpus filesreach it, so every total measured without it is a floor: 3849 reported
where the real count was 15188 (gen-c: the element type of a LOCAL array is passed through unmapped (W583, second position) #3448).
Apple clang and 50 on gcc for the same input (Audit every diagnostic counter for a cap, and record the answers #3450).
--undeclaredsplits 2057 errors by causefnin some spec, not reaching this filelen(142),mean(40)adder_tree(58),ternary_gemm(50)cast_i8(210),compose(76)Three causes, three different repairs — and the totals had them in one bucket.
A reader, not a gate
Deliberately not wired into CI: it rebuilds the whole corpus, and nothing
it prints is a pass/fail claim. Run it at the start of a pass to decide what
the pass is about.
Self-check is the usual pair — a planted error must be counted, a clean file
must count zero — because a report of "0" and a report that could not run look
identical.
One thing I got wrong on the way
I printed a list "excluding
lenandexpect" and then read it as if it werebucket A, concluding
cast_i8was declared somewhere — while a grep twocommands earlier had said zero files. The contradiction was on the same
screen.
cast_i8is in bucket C, as the grep said.