Skip to content

test(verilog): terminate the r_ca_2 fixture's call statement - #2400

Merged
gHashTag merged 1 commit into
masterfrom
fix/2399-rca2-terminator
Aug 22, 2026
Merged

test(verilog): terminate the r_ca_2 fixture's call statement#2400
gHashTag merged 1 commit into
masterfrom
fix/2399-rca2-terminator

Conversation

@gHashTag

Copy link
Copy Markdown
Owner

Closes #2399

What

r_ca_2_synthetic_no_comment_only_call_argument never reaches its subject. Its fixture
fails to parse:

Error: Compile error: parse error in fn 'driver' near line 8:
       unexpected token after expression statement: KwReturn

The test's name is wrong about the cause

Isolated with four probes:

fixture result
consume([1,2,3,4]) then return parse error
consume([1,2,3,4]); then return OK
consume(7) then return parse error
consume([1,2,3,4]) as last statement OK

The array literal is irrelevant. The condition is an expression statement without a
terminating ;, followed by another statement
. The fixture omits the semicolon.

Fix

One character. With consume([1, 2, 3, 4]); both tests in the file pass, and the test
finally measures what it names: the emitter writes consume(0 /* TODO: array literal [1,2,3,4] not yet lowered to Verilog */) — a real argument plus a comment, not a
comment standing in for one.

Note what this does not fix. Array literals in call position are genuinely not
lowered; the emitter says so in its own output and emits 0. R-CA-2 is the narrower rule
that the argument must not be comment-only, and that rule holds.

Related measurement, offered as context and not as a claim of breakage

Sweeping t27c parse over all 650 .t27 files under specs/: 496 parse, 154 do not.
The 496 matches the repository's own recorded baseline, so this is the known state, not a
regression.

The single largest failure kind is the same mechanism as above — 28 of the 154 report
unexpected token after expression statement. For example specs/server/session.t27:187:

assert(SessionState::Pending == 0)
assert(SessionState::Active == 1)

Whether the parser should accept newline-terminated expression statements is a language
decision, not a defect I am asserting.
717 spec files use ; line endings, so the
semicolon form is clearly the norm; the question is only whether the other form should be
rejected. Raising it rather than answering it.

I also nearly reported a much larger and much wronger number: t27c gen-verilog fails on
649 of 650, because most specs are not hardware specs and that backend legitimately
declines them. t27c corpus's own help text warns about exactly this class of measurement
"a parser error count moves three orders of magnitude from one character and RISES when
a real defect is fixed (T119)"
.

Why it stayed red

Target 65 of 73; cargo test -p t27c --tests stops at the first failing target (#2382).
This is 1 of the 7 in #2386, leaving 1.

Related: #2386, #2382.

@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-22 10:48:03 UTC

Summary

Status Count
Total Open PRs 3
PRs with Failing Checks 1
PRs with All Checks Green 2
READY 1
FAILING 1
PENDING 0

Seal Status

  • ⚠️ STALE -- sha256(compiler.rs)=fba627661c36 != 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 fixture failed to parse, so the test never reached its rule. The
cause is not the array literal its name blames: consume(7) followed by
return fails identically, and the same call with a ; or as the final
statement parses. The condition is an expression statement without a
terminator followed by another statement.

With the terminator both tests pass and measure what they name -- the
emitter writes a real argument plus a comment, not a comment standing in
for one. Array literals in call position remain unlowered; R-CA-2 is the
narrower rule.

Closes #2399
@gHashTag
gHashTag force-pushed the fix/2399-rca2-terminator branch from 8ad9eb9 to bd967bd Compare August 22, 2026 11:04
@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-22 11:04:38 UTC

Summary

Status Count
Total Open PRs 4
PRs with Failing Checks 1
PRs with All Checks Green 3
READY 1
FAILING 1
PENDING 0

Seal Status

  • ⚠️ STALE -- sha256(compiler.rs)=ee73b41dba8f != 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 99c0b34 into master Aug 22, 2026
23 of 26 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.

r_ca_2 fixture omits a statement terminator, so the test dies at parse and never checks its rule

1 participant