Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion bootstrap/tests/verilog_array_literal_expr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ const SPEC: &str = r#"module RCA2Probe {
}

fn driver() {
consume([1, 2, 3, 4])
consume([1, 2, 3, 4]);
return
}
}
Expand Down
48 changes: 48 additions & 0 deletions docs/now/2026-08-22-rca2-terminator.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# NOW — the test died at parse and never reached its rule

Last updated: 2026-08-22

## Add the statement terminator the r_ca_2 fixture omits (Closes #2399)

- Branch: `fix/2399-rca2-terminator`
- Issue: #2399 · part of #2386

### Что легло

One character in `bootstrap/tests/verilog_array_literal_expr.rs` — `consume([1, 2, 3, 4]);`
— plus one line pruned from `scripts/ci/test-baseline.txt` (373 → 372).

**The test's name is wrong about the cause.** Four probes: `consume(7)` followed by
`return` fails identically, and the same call with a `;` or as the final statement parses.
The array literal is irrelevant; the condition is an expression statement without a
terminator followed by another statement.

With the terminator the test 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, which is what R-CA-2 requires.

### Границы честности (BINDING)

- **Array literals in call position are still not lowered.** The emitter says so and emits
`0`. R-CA-2 is the narrower rule that the argument must not be comment-only. This change
does not implement the feature and does not claim to.
- **This is 6 of the 7 in #2386. One remains** (`array_param_index_is_element_part_select`).
- Whether the parser should accept newline-terminated expression statements is a **language
decision**, raised in #2399 and not answered here. 28 of the 154 non-parsing specs fail
this way, including `specs/server/session.t27`.

### A measurement I nearly got wrong

Sweeping `t27c gen-verilog` over `specs/` reports **649 of 650 failing** — which sounds
catastrophic and means almost nothing, because most specs are not hardware specs and that
backend declines them legitimately. The right instrument is `t27c parse`: **496 parse, 154
do not**, and 496 matches the repository's own recorded baseline.

`t27c corpus`'s own help text warns about this exact class: *"a parser error count moves
three orders of magnitude from one character and RISES when a real defect is fixed (T119)"*.

### Evidence

Mutant at `bootstrap/src/compiler.rs:15553` — the `0` dropped so the argument becomes
comment-only — verified planted, with a local `FROZEN_HASH` reseal. Both tests FAILED;
restored, `2 passed; 0 failed`. Neither `compiler.rs` nor `FROZEN_HASH` is in this diff.
3 changes: 1 addition & 2 deletions scripts/ci/test-baseline.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Generated by scripts/ci/test_ratchet.py --emit-baseline.
# Do not hand-edit: regenerate from a real --no-fail-fast log.
# Each line is target<TAB>test for a test failing on master.
# 73 targets ran; 373 failing tests on the Linux runner (pruned by #2389, #2391, #2395).
# 73 targets ran; 372 failing tests on the Linux runner (pruned by #2389, #2391, #2395, #2399).
# Four macOS-only failures pruned by #2387: the baseline describes the
# platform that gates, and a CI-passing test left in it is invisible if it breaks.
src/main.rs compiler::tests_compiler_rejects::lowers_only_first_of_two_modules_characterization
Expand Down Expand Up @@ -375,5 +375,4 @@ tests/icarus_lowerable.rs rejects_w534_negative_witnesses
tests/icarus_lowerable.rs rejects_w537_undefined_struct_witness
tests/icarus_lowerable.rs rejects_w543_nonlowerable_call_init_witness
tests/icarus_lowerable.rs rejects_w561_nonlowerable_struct_return_witnesses
tests/verilog_array_literal_expr.rs r_ca_2_synthetic_no_comment_only_call_argument
tests/verilog_array_param_index.rs array_param_index_is_element_part_select
Loading