fix(typecheck): a spelling already valid in the target is not an unknown type - #3414
Merged
Conversation
…own type Refs #3412, #3408 The unknown-type check asked the Rust emitter whether it knows a name, and the emitter answers by REWRITING it -- `int` becomes `i32`. Spellings already valid in Rust come back unchanged, so `usize`, `isize` and `char` read as undeclared types: 565 of the 1045 remaining warnings, every one of them on `usize`, every one false. That is the second false-positive class in my own check in as many passes, and again it was found by measuring my own output rather than reported. Measured over all 651 specs: unknown type warnings 1045 -> 478 all warnings 1570 -> 1003 exit-code changes 0 Across both passes the check's own false positives fall 1283 -> 478, a 63% cut, and the exit code of `check` has never changed for any spec. `int_value_bits(&base).is_some()` was added here as a second oracle and then removed. Mutation showed why: dropping the explicit list makes `char` warn and the test fail, while dropping `int_value_bits` changes nothing -- the list already covers `usize` and `isize`, and the corpus count is identical without it. That is the second redundant guard removed rather than shipped in as many passes, by the same rule: if no test can tell the difference, it is decoration. The measurement is recorded where the guard would have stood. What remains is real. `Result` 69, `Float` 60, `String` 53, `Int` 32, `Trit` 26, `Bool` 23 -- names nothing declares. FROZEN_HASH updated in the same commit, as M5 requires. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
gHashTag
enabled auto-merge (squash)
September 7, 2026 21:01
Contributor
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 #3412, #3408
The unknown-type check asked the Rust emitter "do you know this name", and the emitter answers by rewriting it —
intbecomesi32. Spellings already valid in Rust come back unchanged, sousize,isizeandcharread as undeclared.565 of the 1045 remaining warnings, every one on
usize, every one false. Second false-positive class in my own check in as many passes, and again found by measuring my own output rather than reported by anyone.Measured, all 651 specs
unknown typewarningsAcross both passes the checks own false positives fall 1283 → 478, a 63% cut, and the exit code of
checkhas never changed for any spec.A second oracle was added and then removed
I first wrote
int_value_bits(&base).is_some()alongside an explicit list. Mutation decided it:charwarns, test failsint_value_bitsThe list already covers
usizeandisize, soint_value_bitscontributed nothing. Removed, with the measurement recorded where it would have stood. That is the second redundant guard removed rather than shipped in as many passes, by the rule I applied to the frontier sort in #3411: if no test can tell the difference, it is decoration.What remains is real
Result69 ·Float60 ·String53 ·Int32 ·Trit26 ·Bool23 — names nothing declares.And it is now small enough to act on: only 6 specs still warn on
Trit, and 4 of them carry zerouselines. One import line inspecs/ar/restraint.t27takes its emitted Rust from 30 rustc errors to 19.Tests
Two new, nine green in the file — one asserting the primitive spellings stay quiet, and its control asserting a genuinely undeclared name beside them still warns, so widening the known set cannot have widened it to everything.
bootstrap/stage0/FROZEN_HASHupdated in the same commit, as M5 requires.