Skip to content

fix(typecheck): a spelling already valid in the target is not an unknown type - #3414

Merged
gHashTag merged 1 commit into
masterfrom
fix/unknown-type-primitives
Sep 7, 2026
Merged

fix(typecheck): a spelling already valid in the target is not an unknown type#3414
gHashTag merged 1 commit into
masterfrom
fix/unknown-type-primitives

Conversation

@gHashTag

@gHashTag gHashTag commented Sep 7, 2026

Copy link
Copy Markdown
Owner

Refs #3412, #3408

The unknown-type check asked the Rust emitter "do you know this 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.

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

before after
unknown type warnings 1045 478
all warnings 1570 1003
exit-code changes 0

Across both passes the checks own false positives fall 1283 → 478, a 63% cut, and the exit code of check has 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:

mutation result
drop the explicit list char warns, test fails
drop int_value_bits nothing changes — test passes, corpus count identical at 478

The list already covers usize and isize, so int_value_bits contributed 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

Result 69 · Float 60 · String 53 · Int 32 · Trit 26 · Bool 23 — names nothing declares.

And it is now small enough to act on: only 6 specs still warn on Trit, and 4 of them carry zero use lines. One import line in specs/ar/restraint.t27 takes 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_HASH updated in the same commit, as M5 requires.

…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
gHashTag enabled auto-merge (squash) September 7, 2026 21:01
@github-actions

github-actions Bot commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

PR Dashboard

Generated at: 2026-09-07 21:01:55 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)=9c910e4dfae2 != 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 7, 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 de8a58b into master Sep 7, 2026
33 of 36 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.

1 participant