Skip to content

A bare call is a statement, not a clause head - #2773

Merged
gHashTag merged 2 commits into
masterfrom
w699-bare-call
Aug 29, 2026
Merged

A bare call is a statement, not a clause head#2773
gHashTag merged 2 commits into
masterfrom
w699-bare-call

Conversation

@gHashTag

Copy link
Copy Markdown
Owner

Refs #2754

Found by tri discard top, which exists because a count of 87 does not say where to start. The largest entry was 1 873 tokens.

test deque_init_empty
    var data : [10]i32 = undefined;
    deque_init(&data, &front, &back, &count);   <- discarded
    assert count == 0                           <- and this

deque_init is an Ident, so it was read as a clause head and its argument list as the clause's value. That shape is not a clause, the lowering failed, and the whole block fell to the discard — taking the assertions with it.

The calls are what set up the state the assertions check. Recovering the asserts without them would have produced code that cannot run, which is why this rung is worth more than its token count.

Same guards as the const/var arm: only once the block's column is known, only at or deeper than it, never at column 1 where a body statement and a module declaration are indistinguishable (W905). A shape it cannot read restores and falls through to the clause reading, costing only itself.

before after
discarded tokens 32 485 30 451 (−2 034)
cc accepts 157 158
Zig / rustc / iverilog / ALL FOUR 217 / 214 / 373 / 63 unchanged

Per-spec: exactly one row moved, and it moved up.

The ratchet from two hours ago paid for itself on the next commit

#2772 taught the ledger to carry a magnitude. Without being asked, it named all six improved specs and by how much:

< specs/isa/ternary_deque.t27        discards 749, pinned at 1873 (-1124)
< specs/isa/ternary_bitwise.t27      discards 674, pinned at 1223  (-549)
< specs/isa/ternary_shift.t27        discards 552, pinned at  705  (-153)
< specs/isa/ternary_arithmetic.t27   discards 807, pinned at  907  (-100)
< specs/fpga/vcd_conformance_compare.t27  38, pinned at  120   (-82)
< specs/memory/notebooklm.t27        discards 441, pinned at  467   (-26)

Before that PR this improvement would have been invisible: the population stayed at 87 either way. Re-blessed to 30 451; 19 specs re-sealed and 14 twins synced with tri seals sync-twins.

parse-conform               20/20, new case load-bearing (reverting the fix fails it)
cargo test --no-fail-fast   2429 passed, 0 failed
suite --ratchet             RATCHET: CLEAN, exit 0
check_seal_coverage.py      exit 0
check_specs_generate.py     exit 0

The second commit corrects a test count I wrote in the first before measuring it — 2430 where the measurement is 2429. Corrected by a follow-up rather than an amend.

🤖 Generated with Claude Code

gHashTag and others added 2 commits August 29, 2026 08:23
W699 rung 4, found by `tri discard top` -- the command exists because a count of
87 does not say where to start, and the largest entry was 1 873 tokens.

    test deque_init_empty
        var data : [10]i32 = undefined;
        deque_init(&data, &front, &back, &count);   <- discarded
        assert count == 0                           <- and this

`deque_init` is an Ident, so it was read as a CLAUSE HEAD and its argument list
as the clause's value. That shape is not a clause, the lowering failed, and the
whole block fell to the discard -- taking the assertions with it.

The calls are what SET UP the state the assertions check. Recovering the asserts
without them would have produced code that cannot run; this is why the rung is
worth more than its token count.

Same guards as the const/var arm: only once the block's column is known, only at
or deeper than it, never at column 1 where a body statement and a module
declaration are indistinguishable (W905). A shape it cannot read restores and
falls through to the clause reading, costing only itself.

    discarded tokens   32485 -> 30451  (-2034)
    cc accepts it        157 -> 158
    Zig 217, rustc 214, iverilog 373, ALL FOUR 63 -- all held
    per-spec: one row moved, and it moved UP

THE RATCHET FROM TWO HOURS AGO PAID FOR ITSELF ON THE NEXT COMMIT. It named all
six improved specs and by how much, without being asked:

    < specs/isa/ternary_deque.t27     discards 749, pinned at 1873 (-1124)
    < specs/isa/ternary_bitwise.t27   discards 674, pinned at 1223 (-549)
    < specs/isa/ternary_shift.t27     discards 552, pinned at  705 (-153)
    < specs/isa/ternary_arithmetic.t27 discards 807, pinned at 907 (-100)
    < specs/fpga/vcd_conformance_compare.t27  38, pinned at 120 (-82)
    < specs/memory/notebooklm.t27     discards 441, pinned at  467 (-26)

Re-blessed: 87 entries, 30 451 tokens. 19 specs re-sealed, 14 twins synced.

    parse-conform              20/20, new case load-bearing (reverting fails it)
    cargo test --no-fail-fast  2430 passed, 0 failed
    suite --ratchet            RATCHET: CLEAN, exit 0
    check_seal_coverage.py     exit 0
    check_specs_generate.py    exit 0

Refs #2754

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The previous commit's message says `cargo test --no-fail-fast  2430 passed`.
Measured: 2429. I wrote the number expecting the new conformance case to add one,
and it does not -- `parse-conform` is a `t27c` subcommand, not a cargo test, so
the 20th case is checked by `t27c parse-conform` and never appears in that total.

Corrected here rather than by amending: the previous commit is pushed, and a
mangled number in a message is not worth rewriting history for (skill 155, which
I wrote after doing exactly that earlier today).

    cargo test --no-fail-fast   2429 passed, 0 failed
    t27c parse-conform          20 cases, 20 passing

Refs #2754

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@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 01:25:12 UTC

Summary

Status Count
Total Open PRs 8
PRs with Failing Checks 7
PRs with All Checks Green 1
READY 0
FAILING 7
PENDING 0

Seal Status

  • ⚠️ STALE -- sha256(compiler.rs)=3e563db2d411 != 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
gHashTag merged commit 033ff62 into master Aug 29, 2026
34 checks passed
@gHashTag
gHashTag deleted the w699-bare-call branch August 29, 2026 01:36
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