docs: topo — linter-expansion-1/2/3 rows; §2.9-25 filed (module-scope begin/end and bare generate begin refused rather than recovered)
ci / checks (push) Successful in 58s
ci / corpus (push) Successful in 32s

Co-Authored-By: Claude Fable 5 <[email protected]>
This commit is contained in:
lucioandClaude Fable 5 committed 2026-09-04 04:31:36 -05:00
1 parent b1b3cad09b
commit fbee290a0a
1 file changed
+4
+4
View File
@@ -385,6 +385,9 @@ recursion-limit, whose edges sit in §2.1). Code edges:
| `interface-dpi-arms ──▶ interfaces / dpi-export / comment-slots` | depends | (2026-09-02, TODO §30, M13) Modport method prototypes (`import task drive(int x)`) through `Parser::parse_tf_header`/`Fmt::tf_header`, the single header parse and print the function/task declarations now share; bound `Target::InScope` with the formals in a scope of their own; one prototype per `import`/`export` group (the comma list stays an error, recorded). Unnamed DPI formals behind `parse_tf_ports(allow_unnamed)`, the empty-name convention on `TfArg::name`. `const /*c*/ ref` gap owned (`TfArg::after_const`). Zero corpus population; 4 807 files byte-identical. |
| `statement-fences ──▶ format-fences / classes / shared-fence-filter / range-formatting` | depends | (2026-09-02, TODO §31, M9) Fences at statement level and inside class bodies; `protected_regions`/`is_protected` signatures untouched so `lucisv/src/lint.rs` and `lucisv_server/src/lint.rs` are byte-identical; `verify.rs` untouched. One narrowing: a fence written after code on the same line is an ordinary comment everywhere now (it already was at statement level and in the documented rule). |
| `header-recovery ──▶ error-recovery / parser / lucisv_server` | depends | (2026-09-04, TODO §32, M10) An `Error(RawText)` element in the four list element types (`ListElem<T>`) and `ExprKind::Error`; `element_or_recover` with a list-local, bracket-seeded sync set; `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 (the reason `tools/guard.sh` exists); headers keep their node so bodies bind in the right scope; recovery declines on a conditional-compilation directive so `split.rs`'s verbatim rescue keeps strict parity. Every consumer of a port/param/connection/tf-arg list reads it through `ListElem::ok`. Opened §2.9-24. |
| `linter-expansion-1 ──▶ linter-core / semantic-lints-on / editor-settings / vlog_semantic` | depends | (2026-09-03, TODO §33) `Severity` on every rule (Error / Warning / Style) carried through CLI text and JSON, editor `ERROR/WARNING/INFORMATION`, `--rules-doc`, and select/ignore by class word; VS Code `lucisv.lint.severity.*` switches and tri-state `lucisv.lint.rules.<rule>` toggles generated by `vlog_linter::vscode` with a drift test; `lint::enabled_rules` is the one ladder (defaults → select → class switches → per-rule → ignore). Nineteen Error/Warning rules; `Semantics::duplicates()` added additively (no store change). |
| `linter-expansion-2 ──▶ linter-expansion-1 / config-discovery / editor-settings` | depends | (2026-09-04, TODO §34) Per-rule options: `OptionSpec`/`RuleOptions` with one validator behind `[lint.<rule>]` tables (accepted now; `lucisv_core::config` stores them raw) and the editor's `lucisv.lint.options` (bad entries logged and dropped); precedence editor > toml > default key by key; an in-house anchored regex engine run as a Thompson-NFA simulation (linear by construction; unknown escapes refused by name). Eighteen Style rules; the four naming rules take Verible's option spellings with byte-identical defaults; `typedef-structs-unions` allows nested anonymous aggregates by default (lead ruling, opentitan measurement). |
| `linter-expansion-3 ──▶ linter-expansion-2` | depends | (2026-09-04, TODO §35) The remaining nineteen Verible rules (73 in all — every published Verible rule but `forbid-implicit-declarations`); Verible's `forbidden-symbol` is the source-file name of `invalid-system-task-function`, so it is that rule's `symbols` option; `void-cast` gains `forbidden_calls`; the lifetime rules exempt out-of-body definitions (census: 948 of 960 findings). Opened §2.9-25. |
| `constraint-bodies ──▶ classes / out-of-class-constraints / dv-statements / safety-net` | depends | (2026-09-02, round 1 of coverage_gaps C1) `ItemKind::Constraint(ConstraintDecl)` with a structured `ConstraintSet` (`Expr{soft}`, `Implication`, `If`, `Foreach`, `SolveBefore`, `Unique`, `DisableSoft`, `Directive`, `Empty`), `ExprKind::Dist`, and `WithConstraint.block` as `ConstraintBody::{Items, Verbatim}`. The parser takes a `Rewind` snapshot (cursor, **both pending-comment buckets**, depth, links, `open_conds`, diagnostics length), attempts the structured body, and on any error restores it and re-runs v0.26.0's verbatim capture character for character — so an unknown shape *is* the old behavior, not an approximation (pinned on text, slice and `col`). **No keywords reserved**: `soft`/`dist`/`solve`/`before` are matched by text like `restrict`, so `token.rs`, `pairs.rs`, the editor grammar and `tests/grammar.rs` are untouched and `logic before;` keeps working; `:=`/`:/` stay two tokens with a span-adjacency check (a `:/` token would swallow `:/* c */`). Canonical layout: one item per line, `}` at the header column, dist weights as a braced list; a `with` block keeps the source's one-line-or-not shape. `verify.rs` untouched; the constraint attack pairs re-derived plus new ones. Exhaustive arms paid in `format.rs`, `bind.rs`, `tests/spans.rs`; `visit.rs` gets an explicit no-op arm (no items/statements inside). **QA rework**: comments after the round's own text-matched words were dropped; the dev answered with an exhaustive gap fuzzer (a `/*C*/` in every inter-token gap of 15 fixtures, 358 gaps, format + idempotency demanded) and 14 named comment fields plus `ConstraintItemKind::takes_semi()` (one owner of the `;`) and `Parser::gap_before` (the closer-side twin of `take_before_open`); 96 regressions vs v0.26.0 became 40, all in shared machinery outside this lane — §2.9-22. Opentitan: 1 993 of 2 009 bodies structured (fallbacks: 10 macro-item bodies, 6 non-LRM shapes), failure set unchanged, per-file tolerant diagnostics identical, 48 DV files idempotent with comment streams byte-identical. |
| `covergroup-bodies ──▶ constraint-bodies / classes / safety-net` | depends | (2026-09-02, round 2 of coverage_gaps C1) `ItemKind::Covergroup(Box<CovergroupDecl>)` with `CoverItemKind::{Coverpoint, Cross, Option, Directive, Empty}`, `BinDecl { wildcard, kind, name, array, spec: BinSpec::{Values, Transitions, Default, DefaultSequence, Select}, with_expr, iff }`, `SelectExpr` for `binsof … intersect … && !binsof`, one `CoverageEvent` enum. Same `Rewind` fallback as constraints — v0.27.0's flat scan re-run character for character on any failure — and no keywords reserved (`coverpoint`, `bins`, `cross`, `binsof`, `intersect`, `wildcard`, `ignore_bins`, `illegal_bins`, `option`, `type_option` by text). **Two guards in shared expression machinery, the round's one risk**: `at_postfix_segment` refuses `[` followed by `*`/`->`/`=` (no index can start with those — it is what lets `1'b1[*5]` be a transition repeat), and a `no_with` flag while a bin spec operand is read (so the bin's own `with (…)` filter is not eaten as an array-method iterator argument); `(`-disambiguation is by position, the LRM's own rule. `plain_expr_list` → `plain_list` and `constraint_parens` → `guard_parens`, shared with `iff`/`with`. `verify.rs` untouched, twelve attack pairs. The gap fuzzer was built in from day one (329 gaps, 52 fail, all §2.9-22 shared machinery — *asserted* by running each shape outside a covergroup). Opentitan: 544 of 544 covergroups structured, 87/87 DV covergroup files idempotent, failure set and per-file diagnostics identical. `on_type.rs` keeps `covergroup` OPAQUE by argument. |
| `fragment-mode ──▶ error-recovery / define-table / lexer-cleanup / covergroup-bodies` | depends | (2026-09-02, coverage_gaps H4 corrected) Class-body and module-item `.svh` fragments already parsed — the file-scope item loop *is* the class-item loop; the three shapes that did not (statement lists, enum-member lists, cover-item lists) become `SourceFile::fragment: Option<Fragment>` (`items` empty iff `fragment` is `Some`). Detection is a whole-file rule, not an error-message match: the FIRST STRUCTURAL item failed (directives, macro items and null items are legal in every body and do not count; a tolerant `Ok` that recorded a diagnostic counts as failed — the `if … else` generate-vs-statement parity bug), the file does not open with a design-unit keyword, and a shape consumes the file to EOF, tried narrowest-first (cover items → enum members → statements: the wider grammars mis-read the narrower). Each shape re-lexes a fresh token stream — `Rewind` deliberately does not restore the tokens' comment buckets, right for verbatim captures and fatal here. Shared loops lifted (`parse_enum_members`, `parse_cover_items`); formatter prints a fragment at indent 0 through existing printers; binder gives statements a file `Block` scope and enum variants file scope; **no census change** (a fragment's variants are not exported — `pkg::CUSTOM_1` must not resolve to a name that does not exist), FACTS stays 12. Separately, the lexer continues a `` `define `` whose formal-argument `(` touches the name and is still open at end of line, no backslash needed until the list closes — `cip_base_vseq__tl_errors.svh`'s real blocker. Corpus 813 → 814/820; opentitan 12 → 10, exactly the two predicted files. |
@@ -584,6 +587,7 @@ update the filing README(s) and this file.
| ~~22~~ | ~~**Comment slots in shared expression/name machinery** drop the comment and the safety net refuses the file: `q[/*c*/ i]` (index expressions), `x inside {[/*c*/ 0:3]}` and `n /*c*/ inside {` (`inside` / `parse_value_range`), `pkg/*c*/ ::cls::name` (`parse_method_name` chains), `foreach (q[/*c*/ i])` (`parse_foreach_target`), `static /*c*/ constraint` / `pure /*c*/ static function` (`take_member_prefix`). Found by constraint-bodies' exhaustive gap fuzzer (358 gaps; these 40 fail identically on v0.26.0 in the same constructs outside a constraint). Inside a constraint they are regressions relative to the verbatim era — but no opentitan file hits one (sweep unchanged). Wanted: a parser-wide round giving each slot a `Meta`/comments field, then re-running the fuzzer to zero.~~ — **delivered 2026-09-02 by comment-slots**: ~70 named comment fields across `ExprKind`/`Stmt`/declarations/headers/labels (`SegmentComments`, `BinaryComments`, `CastComments`, `LabelComments`, `Stmt::before_semi` + `StmtKind::takes_semi()`), three duplicated grammars folded into `parse_postfix_segment` / `parse_value_range`, and four gap fuzzers at zero — covergroup 329, fragment 153, constraint 395 (committed at last), RTL 352 (new). Corpus (860 files) and opentitan (3 975 files) byte-identical to v0.30.0. Deliberately left: `if`/`case` in-paren comments still recovered print-side by `header_parens` (only `after_kw` got a slot) — a real slot there would change existing layout | constraint-bodies (dev + QA) | ~~vlog_parser~~ done |
| 23 | A **cross-file instance-member tail does not resolve for rename**: with `module sub` in `sub.sv` and `assign w = u_x.sig;` in `top.sv`, renaming `sub`'s `wire sig` edits `sub.sv` only — the same shape in one file resolves and is edited (`a_hierarchical_tail_that_resolves_is_renamed_with_its_declaration`). Since comment-slots the rename *says so* (item 20's warning); the edit itself is the gap. Modules export ports and parameters only (the class-member-access round 2 ruling), so an internal net is exactly what the cross-file hop refuses — the fix is either an export rule for nets named through an instance or a rename-time in-file fallback resolution of the tail. | comment-slots (dev, surfaced by the §2.9-20 control test) | vlog_semantic / vlog_refactor |
| 24 | A **half-typed `#(` parameter override whose value can read as a call** (`sub #(.W(` ⏎ `u0 (.a(x))`) — the greedy expression grammar swallows the next instance's name before any error fires, so the whole instantiation still degrades to an item-level `Error` node instead of getting header recovery's benefit. Found by §32's QA; the fix is a lookahead in the override grammar (an identifier followed by `(` on a later line is the next instance, not a call). | header-recovery (QA) | vlog_parser |
| 25 | The parser **refuses** a module-scope `begin … end` and a bare `begin` inside a `generate` region (an `ItemKind::Error`) rather than recovering them as an unnamed generate block, so `module-begin-block` and `v2001-generate-begin` (TODO §35) fire on an error leaf and the rest of the unit is lost to recovery. Wanted: tolerant-mode recovery that keeps the block's items. | linter-expansion-3 (dev) | vlog_parser |
---