Skip to content

fix(tri): restore mod elab; -- the command has not existed since #2427 - #2901

Closed
gHashTag wants to merge 5 commits into
masterfrom
w741
Closed

fix(tri): restore mod elab; -- the command has not existed since #2427#2901
gHashTag wants to merge 5 commits into
masterfrom
w741

Conversation

@gHashTag

@gHashTag gHashTag commented Aug 29, 2026

Copy link
Copy Markdown
Owner

tri elab reports unrecognized subcommand. Its 319-line implementation is in
the tree; nothing declares it.

d64607130 (#2427, a Zig-lexer change to bootstrap/src/compiler.rs) removed
three lines from main.rs in a single hunk — mod elab;, the Elab variant,
the dispatch arm — and left the file. This restores exactly those three lines.

What nothing printed

cargo build green — an undeclared file is not compiled, so it cannot error
cargo test green — the suite went 358 → 354; no gate reads that number
any reachability check none exists for src/

Four tests left the suite without a line of output. The count went down
silently, which is #2895 in another language: nothing here prints what a build
skipped.

Why this command in particular

tri elab exists because tools/check_elab_ratchet.py counted every stderr line
containing " error", and iverilog closes each failing file with N error(s) during elaboration. — a total, which matched. 25 phantoms in a reported 186,
and the number reached commit messages, an issue comment and a status page.

That script still points at the command it lost:

tools/check_elab_ratchet.py:18:    tri elab classify     # the distribution, measured, by message shape
tools/check_elab_ratchet.py:575:        print("    tri elab classify")

After

$ tri elab classify
real diagnostics: 176
summary lines NOT counted: 28  (iverilog prints one per failing file;
  counting it inflates the total by exactly the number of failing files)

   77  Unable to bind wire/reg/memory `X' in `X'
   62  Unable to elaborate condition expression.
   11  the number of indices (N) is greater than the number of dimensions (N).
   ...

elab.rs is not modified. Its four tests pass as written.

Closes #2900



`d64607130` ("[GOLD-RING] parser: the Zig subset lexer.t27 needed", a change to
`bootstrap/src/compiler.rs`) removed three lines from `cli/tri/src/main.rs` in
one hunk: the `mod` declaration, the `Elab` variant and the dispatch arm. The
319-line file stayed. Since then:

    $ tri elab classify
    error: unrecognized subcommand 'elab'

Nothing said so. `cargo build` cannot fail on a file it does not compile, and
the test suite went 358 -> 354 without a gate that reads the number. Four tests
left the suite in silence.

`tools/check_elab_ratchet.py` still instructs its reader to run this command, in
its docstring and in its failure output, and two NOW documents describe it as
working. `tri elab` was written because that same script once counted iverilog's
per-file summary line `N error(s) during elaboration.` as a diagnostic -- 25
phantoms in a reported 186, quoted onward before anyone read the rows.

Restored, it reads:

    real diagnostics: 176
    summary lines NOT counted: 28

Nothing else changes: the file is untouched, and its four tests pass as written.

Closes 2900
@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-29 22:19:16 UTC

Summary

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

Seal Status

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

The general form of the defect in the same commit. Rust compiles a file only if
a `mod` declaration leads to it from the crate root; a file nothing declares is
not unused, it is a file the compiler never opens. It cannot warn, cannot fail
to build, and its `#[test]` functions do not exist for `cargo test`.

    bootstrap     97 files under src/,  90 compiled,   7 orphaned
        bootstrap/src/_enrich/mod.rs                441 lines
        bootstrap/src/math_pslq.rs                  589 lines
        bootstrap/src/neural/attention.rs             4 lines
        bootstrap/src/neural/hslm.rs                  4 lines
        bootstrap/src/runtime_minimal.rs             19 lines
        bootstrap/src/runtime_minimal_test.rs        18 lines
        bootstrap/src/tooling.rs                    409 lines
    cli/tri       33 files under src/,  33 compiled,   0 orphaned

Historical control: the same binary run against origin/master, where `mod elab;`
is still missing, prints

    cli/tri       32 files under src/,  31 compiled,   1 orphaned
        cli/tri/src/elab.rs        319 lines   4 #[test] that cargo cannot see

It fires on the defect and is silent after the fix in the parent commit.

Resolution follows the language rather than a heuristic. `mod c;` in `a/b.rs`
means `a/b/c.rs` or `a/b/c/mod.rs`, never `a/c.rs`; `#[path]` and `include!` are
edges; inline `mod c { }` needs no file. The loose rule -- is this stem named by
any `mod` anywhere -- hides a real orphan behind a same-named module in an
unrelated directory, and its mutation fails the first test here.

`reached` counts files outside `src/` too, because `#[path = "../../gen/..."]`
is a real edge, so the report does not subtract the two and call the difference
orphans; it prints the two comparable sets and says where the rest went.

Refs #2900
@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-29 22:22:29 UTC

Summary

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

Seal Status

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

Copy link
Copy Markdown
Contributor

PR Dashboard

Generated at: 2026-08-29 22:26:15 UTC

Summary

Status Count
Total Open PRs 9
PRs with Failing Checks 7
PRs with All Checks Green 2
READY 0
FAILING 7
PENDING 0

Seal Status

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

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-29 22:33:02 UTC

Summary

Status Count
Total Open PRs 10
PRs with Failing Checks 8
PRs with All Checks Green 2
READY 0
FAILING 8
PENDING 0

Seal Status

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

The gate that would have caught #2427.

    $ tri mods orphan --gate            # at origin/master
    ::error::cli/tri: orphaned rose 0 -> 1. A file left the build and
      nothing else would have said so.
    exit 1

    $ tri mods orphan --gate            # after the fix in this branch
    ORPHAN CEILING: CLEAN
    exit 0

Exact match in both directions, following MAX_SORRY: a count above its ceiling
is a regression, and a count below it is slack the next orphan can hide in.
Both were exercised -- a planted file in cli/tri/src exits 1, and a ceiling
raised to 3 against an actual 0 exits 1 with the instruction to lower it.

`--self-check` is the negative control. It builds a two-file crate in a temp
directory, one declared and one not, and exits non-zero unless exactly the
undeclared file comes back -- so a green run from this gate means the walk was
working, not that it was skipped.

The workflow carries NO `paths:` filter, and the comment says why: the change
that strands a file is a change to the crate ROOT, not to the file that goes
missing. A filter on the stranded path is silent for exactly this defect.

bootstrap's 7 orphans are recorded, not repaired. `tooling.rs` alone holds 7
gate bodies (#2905), and connecting any of them is a decision about what goes
red rather than a repair. The ledger says so in the file, beside the number.

Refs #2900
Refs #2905
@github-actions

Copy link
Copy Markdown
Contributor

📓 NotebookLM Notebook linked to this PR

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

1 similar comment
@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-29 22:33:43 UTC

Summary

Status Count
Total Open PRs 10
PRs with Failing Checks 8
PRs with All Checks Green 2
READY 0
FAILING 8
PENDING 0

Seal Status

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

Copy link
Copy Markdown
Owner Author

Superseded by a clean-history branch: the first commit here said Closes 2900 without the #, which L1 reads per-commit and which cannot be corrected without a force-push. Same three changes, three commits, each carrying a reference.

@gHashTag gHashTag closed this Aug 29, 2026
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.

tri elab has not existed since #2427 deleted three lines of main.rs

1 participant