TODO section 32 (coverage_gaps M10).
A typo inside a port list, parameter list, tf-port list, connection
list or a for/if/while/case header no longer destroys the enclosing
module or function. The four list element types and ExprKind gain an
Error(RawText) element; element_or_recover records the diagnostic and
skips to a list-local sync set (',' ')' ';' or a line change) with the
bracket counter seeded from the list's own opener, and list_ends ends
any list whose iteration left the cursor unmoved - the structural
guarantee that closes the non-advancing loop which exhausted memory on
the first cut. Headers are infallible in tolerant mode: the node keeps
its name, the typed elements and its body, so the body binds in the
right scope and there is no orphaned closer; recovery declines on a
conditional-compilation directive so split.rs's verbatim rescue still
runs and strict parity holds (550 fixtures and all 814 strict-parsing
corpus files, Debug-equal). Pins per shape with exact counts; server
pins: document symbols and scoped completion survive a broken header,
one diagnostic, the three validity probes keep their verdicts.
Census over the corpus truncated at each midpoint: error nodes 622 ->
555, diagnostics 1 702 -> 1 826 (surviving modules now report their
missing endmodule). parse_tolerant timing within noise. 3 259 tests on
this branch (0.35.0 + 15 pins); corpus 814/820 byte-identical.
docs/features/header-recovery/README.md.
Co-Authored-By: Claude Fable 5 <[email protected]>
| M7 | Semantic lints (`unused-signal`, `undriven-net`, `multiply-driven`) ship **off by default**. | linter-core / semantic-lints READMEs; blocked on topo §2.9-6 (workspace-wide "does any file mention this name"). | These are the lints RTL engineers want most; the index now has reference postings and `files_spelling`, so §2.9-6 is closer than when filed. |
| M8 | ~~Lint rules do not descend into verbatim regions~~ — **closed at 0.33.0 for what parses**, by construction: the rules read the reference table, and a structured assertion contributes ordinary references to it. A `signals.rs``opaque_span` remains only for a region that fell back. | assertions / clocking-wave / sva-bodies READMEs. | Same root as C1; resolved with it. |
| ~~M9~~ | ~~Statement-level format fences (inside `always`, case items, port lists) and fences inside class bodies (topo §2.9-3).~~ — **closed at 0.34.0+ by TODO §31.** Class bodies and every statement *list* (`begin`…`end`, `fork`…`join*`, function/task bodies, `initial`/`always`/`final` bodies, a `case` item's block body, a statement fragment) are fenceable scopes; `--lines` still loses to a fence. Two of the three named places stay out, with reasons: port/parameter lists and `case`**label** lists print mid-line inside a `Group`, where `Doc::Verbatim` (column-0, break-forcing) cannot stand — that wants a new printer primitive, not a scan arm. Measured on OpenTitan, which has 9 fenced files: four now keep their fenced bytes, including a 110-line class-body region. | statement-fences README; format-fences / classes / shared-fence-filter READMEs amended. | Users protect hand-aligned tables inside procedural blocks; DV users protect them in classes. |
| M10 | Error recovery does not reach headers and lists (port lists, parameter lists, for-headers) — a half-typed port list yields a garbage tree. | error-recovery README (QA-confirmed). | Editing experience: diagnostics cascade while typing a header. |
| ~~M10~~ | ~~Error recovery does not reach headers and lists (port lists, parameter lists, for-headers) — a half-typed port list yields a garbage tree.~~ — **closed by TODO §32.** A list element that does not parse is now a `ListElem::Error` element of its own list and a statement header's broken condition an `ExprKind::Error`, so the module, function or instantiation keeps its name, the elements that were typed and its body: the QA shape that cost 3 items and 2 diagnostics costs 1 and 1, and the `wire w;` under a half-typed `sub u (.a(` is a sibling item again. Measured over the corpus truncated at each file's midpoint: **622 → 555 error nodes** (−11 %), while diagnostics rise 1 702 → 1 826 because the constructs that now survive report their own missing closers (`expected \`endmodule\`` +91) instead of vanishing into one node. | header-recovery README; error-recovery README amended. | Editing experience: diagnostics no longer cascade while typing a header, and the outline keeps the module. |
| M11 | Anonymous aggregate members (`enum {A,B} x;`) not symbols (topo §2.9-13); cast type `state_t'(0)` records no reference. | overlay-promotion README; probe: enum *typedef'd* members do work. | Partial: named enums navigate, anonymous ones do not. |
| M12 | No `lint` key in `lucisv.toml` (topo §2.9-4); no `--rules-doc`. | four READMEs. | Config surface, not language — but it gates per-project rule selection. |
| ~~M13~~ | ~~Modport method prototypes (`import task drive(int x);`), `const` task/function arguments, unnamed DPI formals.~~ — **closed at 0.33.0 by TODO §30.** Modport method prototypes parse, format, bind and span; unnamed DPI formals parse behind the DPI flag only (§35.5.5), print as their type alone and declare nothing. The `const` half was **misfiled**: `const ref` (§13.5.2's only `const` argument form) has parsed and formatted since the corpus shape landed — the probe found only one real gap, a comment written *between*`const` and `ref`, now its own slot. | interface-dpi-arms README; interfaces / dpi-export READMEs. | Real interface-class idioms; each was a small grammar arm. |
@@ -149,9 +149,11 @@ signal named only inside a property edits it, references list it, and the
"at least identifier occurrences" fallback the C1 row asked for was
overtaken rather than built (what the grammar cannot read still rewinds to
the byte-exact capture, and rename *names* those regions instead of going
quiet). What the tables above still leave open, by weight: M10 error recovery
inside headers and lists; the second half of
M12 (`--rules-doc`, §2.9-5); L3, L6, L9 and L10. M13's small
quiet). What the tables above still leave open, by weight: the second half of
`prim_flop_en.sv`, `prim_flop.sv`) with both binaries side by side. Every
single one holds the dev's explanation without exception: before, the
header failure swallowed the whole construct into one error node that said
nothing past its own header (1–2 diagnostics, no closer message, because the
body-parsing loop was never reached); after, the same construct survives its
header and reaches the body loop, which then hits EOF without its
`endmodule`/`endclass`/`endinterface`/`)` and reports exactly that. The
"rise is 91 modules-worth of you-have-not-closed-this-yet, not new noise"
claim holds — confirmed, not just plausible.
**7. Docs.** `docs/features/header-recovery/README.md`: all seven sections
present and current. `docs/features/error-recovery/README.md`: the header
sentence is in Assumptions, the "Not done" line is inverted into a "Done,
2026-09-03" entry with the mechanism named, the "known shapes" amendment note
is present. `docs/coverage_gaps.md`: M10 struck through and closed with the
measured numbers. The §33-linter handshake (three arms to re-apply on
master's files at merge) is named precisely (`visit.rs::walk_param_ports`,
two loops in `signals.rs`). The (undisclosed-in-the-original-plan but
disclosed-in-Handshakes) `vlog_refactor` footprint is noted above under
Gates.
**LOW: `TODO.md` §32's "Gates" checkbox is unticked** despite the Gates line
in this very README's Status/TODO being `[x]` and every gate genuinely
passing (independently re-verified in item 1). `TODO.md:3474-3476`. Easy fix
at merge — tick it; the "QA" line below it is correctly left unticked since
QA (this pass) is what resolves it.
**CLAUDE.md compliance:** no `unwrap()`/`expect()`/`panic!` introduced outside
`#[cfg(test)]` (spot-checked the diff's non-test hunks). No `unsafe`. File
sizes: `recover_list.rs` at 322 production lines, comfortably under 600;
nothing in the diff pushes a file over threshold. Runaway guard: every
`cargo test`, fuzz sweep, corpus/opentitan sweep and server run in this QA
pass went through `tools/guard.sh` — including, notably, the one that caught
my own harness's memory bug (item 2), which is exactly what the guard is
for.
**Verdict: PASS.**
No CRITICAL (opentitan confirmed untouched, twice — the aes-subtree sweep and
the e2e probe). No HIGH (no guard kill, panic or slow parse attributable to
the feature itself — the one guard kill in this pass was my own harness,
isolated and fixed; strict-mode parity holds over the full corpus, not just
the 550 fixtures; every pinned shape's exact counts reproduce). One MEDIUM
(item 4: a half-typed `#(...)` override whose value can extend into a call
swallows the whole instantiation rather than just the element — real, not
forcing, worth a follow-up pin) and two LOW (the `vlog_refactor` footprint
undersold in TODO §32's original file list, though disclosed in Handshakes;
the unticked `TODO.md` Gates checkbox). Recommend the lead tick the Gates
checkbox at merge and decide whether the MEDIUM finding gets a follow-up pin
now or is filed for later — it does not block this round, since it is no
worse than pre-§32 behavior on that specific shape, just not yet improved by
it.
## Review
*(reserved for the lead)*
**2026-09-04 — lead.** Accepted. This round earned its structural rule
the hard way: the first cut's list loop could iterate without consuming
a token, and under the delete-any-character fuzzer it allocated
diagnostics until the machine died. The fix — `list_ends` ends a list
whose iteration left the cursor where it started — is a guarantee a
reader can check in one line, QA read it adversarially and then fuzzed
four mutation classes over thirty files without a stall, and the guard
that now wraps every suite exists because of this lane. The second
finding, strict parity broken by recovery swallowing the failure that
`split.rs` needs to see, is fixed at the one place the two mechanisms
meet. The census is reported honestly: fewer error nodes, more
diagnostics, because a module whose header was cut now survives to
report its missing `endmodule` — the right trade. QA's MEDIUM (a
half-typed `#(` override whose value reads as a call swallows the next
instance's name, so that instantiation still collapses to an item-level
error) is filed as `docs/topo.md` §2.9-24, not a rework: the shape is
outside the plan's list and the fix is a lookahead in the override
grammar, its own small item. TODO's Gates line ticked at review; the
`vlog_refactor` touch (two exhaustive-match arms) accepted. The three
`vlog_linter` arms are re-applied at merge against §33's files. Ships
in 0.37.0.
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.