69 Commits
Author SHA1 Message Date
Guoliang ChenandClaude Mythos 5.2 80017a59f2 Release 0.65.5: named formatting styles
release / build-and-publish (push) Successful in 5m22s
TODO §71.5. One setting picks a house layout — [format] style in
lucisv.toml, --style, the lucisv.format.style drop-down, the server and MCP:
lucisv (default), google, lowrisc, ansi, microsoft, nxp, and auto. Seven
layout rules (indent, width, begin placement, else placement, else after a
labelled end, one-per-line lists, list indent, alignment), one row per style
in one table in crates/vlog_formatter/src/style.rs. google and lowrisc follow
those published guides; ansi, microsoft and nxp are lucisv's guesses and say
so. auto formats with each preset and keeps the result that changes the
fewest lines (crates/vlog_formatter/src/auto.rs); the language server
remembers each document's preset (lucisv_server/src/auto_style.rs) so
selection and on-type formatting do not repeat the search. The style is part
of the format cache key.

Proof: default output byte-identical to 0.65.4 on 4 921 files (corpus +
OpenTitan hw) against an independently rebuilt 0.65.4; every style formatted
three times over the same files with no verification error, crash, token or
comment difference (independent lexer) or second-run change. verify.rs is
untouched.

Dev (three rounds), QA (two rounds, pass with findings) and lead review are
in docs/features/format-styles/README.md. Three one-line calls were added to
lucisv_server/src/server/notification.rs for the memory's invalidation.
TODO.md files the pre-existing bugs QA met on the way.

Version bump (Cargo.toml, Cargo.lock, editors/vscode/package.json and both
package-lock.json spots); notes in CHANGELOG.md (## 0.65.5) and
editors/vscode/CHANGELOG.md.

Gates: tools/gates.sh PASS on this tree; vlog_formatter 376/0,
lucisv_server 1996/0, corpus 814/6.

Co-Authored-By: Claude Mythos 5.2 <[email protected]>
2026-11-19 07:03:20 -08:00
lucioandClaude Mythos 5.2 14213f6a93 TODO §68.2: an unfinished port connection stays in its own entry, and its errors wait until you pause
Parser (tolerant mode only, parser/recover_list.rs): a lone '.', a
'.name(' left open at its line end and a trailing ',' in a named list are
recovered inside their entry — always a diagnostic, never silent; strict
mode and valid code are unchanged (1 026 inputs old vs new: identical
strict results and trees, byte-identical CLI output; corpus 814/6).
Server (state/port_grace.rs): diagnostics that start inside the entry the
last edit touched, in a named-connection list of an instance, are withheld
for 1.5 s and released by the loop's timeout, an edit elsewhere or a save;
a pulling client that supports it gets workspace/diagnostic/refresh.
A trailing ',' in a named list is now reported in tolerant mode too.
Dev + QA (Opus 5.5); QA failed one gate (lucisv_mcp qa_f1), one fix
round, re-check passed: parser 521, server 1954, mcp 383, formatter 352.
Not yet seen in a running VS Code. docs/features/port-entry-grace; topo
rows for §68.1 and §68.2.

Co-Authored-By: Claude Mythos 5.2 <[email protected]>
2026-11-17 15:40:58 -08:00
lucioandClaude Fable 5.2 3598a9145e TODO §66.2: format_selection lays out only the selected block, at the indentation it already has
A splice: the smallest run of sibling items/statements the selected lines
cover is laid out alone (Printer::print_at with the written leading
whitespace as the base) and replaces its own bytes; the parent is not
re-laid. Whole-file verify_equivalence and convergence still gate the
result; verify.rs is unchanged. A file that does not parse is formatted
when the error lies outside the target. Descent stops only on a unit's
first line; the closing end line alone names its unit. CRLF kept,
including after a trailing // comment. Module-level targets defer to
format_range, which the CLI's --lines still uses.
36 tests in tests/selection.rs; docs/features/selection-formatting.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
2026-11-09 18:53:04 -08:00
lucioandClaude Fable 5.1 a69a1cb528 Coverage gaps L3, L6, L10: six language shapes, randsequence as real nodes, an opt-in uvm_field_* indent
TODO §54 (docs/features/coverage-gaps-l); closes docs/coverage_gaps.md
L3, L6 and L10. The first dev stalled under machine load; a second
finished from the tree.

54.1 `->>` with optional delay or event control (`StmtKind::EventTrigger`),
stream `with [range]` (`ExprKind::StreamWith`), the LRM's other
`casting_type`s, drive strength on a net declaration (`DataDecl::strength`,
whose comment slots also fix a pre-existing refusal on an `assign` with
a comment before its strength), `let` at statement position
(`StmtKind::Let`), and `#(min:typ:max)` clocking skews — `ClockingSkew`
as the LRM's two alternatives, `edge [delay]` | `delay` (review rework of
QA's HIGH). Comment slots added to `let`, stream concatenations and the
clocking grammar; the RTL gap fuzzer at 505 gaps, zero failing.
54.2 `randsequence` (it was a parse error; the keyword is new):
`RandSequence` → `Production` → `Alternative` → `ProdItem` (ref, block,
if, repeat, case, rand join), code blocks by the statement grammar; one
production per line, alternatives aligned; the LRM's examples as cases.
54.3 `[format] uvm-utils-indent` / `lucisv.format.uvmUtilsIndent`, default
off, tracking nested `_begin`/`_end` pairs; 21 corpus files change with
it on, all idempotent. A short comment-free enum body already one-lines,
so no key was built — the behaviour is pinned. `[format]` table tests
added (review rework). `->>`'s event control is bound through the shared
`bind_timing` (review rework of QA's second HIGH).

0 of 820 corpus files differ from 0.48.x with the key off; the opentitan
sweep is identical; no corpus or opentitan file writes any of the new
shapes.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
2026-09-07 01:12:49 -05:00
lucioandClaude Fable 5.1 4d59e80568 Type-name spans on the AST; vlog_semantic/src/scan.rs retired
ci / checks (push) Successful in 1m3s
ci / corpus (push) Successful in 33s
TODO §47 (docs/features/type-name-spans). Closes topo §2.9-2.

`DataType` carries `name_start` (a `u32` in its existing padding, so
`Expr` stays at its 96-byte pin) and derives `name_span()` and
`segments()` — the `::`/`.` split from the span's own text, with a
leading escaped identifier read to its terminator first. Five parser
construction sites set it; an implicit type gets the empty range at the
position its name would have had. `StmtKind::Disable { name, name_span }`.
The binder walks `ty.segments()` and verifies every segment's range
against the source before recording it (`exact_or_empty`); a segment that
does not read back is recorded with the empty range, never dropped, so
the census's `unplaced` counter is the alarm a join regression would
move (review rework of QA's MEDIUM). `scan.rs` deleted; `bind_data_type`
lost its `window` and ten call sites their window arithmetic.

Census unchanged in every field (860 files, 27 486 symbols, 103 870
references, 1 197 unresolved, 0 unplaced); 0 of 860 corpus files differ;
200/200 opentitan definition/hover/typeDefinition answers identical.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
2026-09-05 09:24:19 -05:00
lucioandClaude Fable 5.1 f7956060b3 Small items, round 4: the editor's unknown rule name said once, a warning channel for the walk, inline aggregate override arguments, comment slots inside delay lists
ci / checks (push) Successful in 1m1s
ci / corpus (push) Successful in 32s
TODO §45 (docs/features/small-items-4). Closes topo §2.9-17, 29, 30 and
adds the delay-list bar to §2.9-22.

45.1 `settings::rules` records every dropped `lucisv.lint.select`/`ignore`
name as `lucisv.lint.<setting>: unknown rule: <name>`; `apply_settings`
logs what the previous settings value did not already say — once per
(setting, name), re-armed by a changed list.
45.2 `walk::collect_files` takes a `&mut dyn FnMut(Warning)` sink: an
unreadable directory, an unreadable `.gitignore` and a dangling source
link are warned about and the walk continues; the CLI prints
`warning: <path>: <message>` on stderr before the report with the exit
code unchanged, the server logs once per scan through `report_scope`.
45.3 `parse_expr_or_type` accepts a `struct`/`union`/`enum` head as a
type argument, so `m #(.T(struct packed { logic a; })) u ();` parses and
`instantiation_plan` emits a one-line `parameter type` aggregate default.
45.4 Comment slots for `#(1:2:3)` and gate delay lists
(`MinTypMaxComments`, `DelayValue`, `ContAssign`/`GateInstantiation`/
`GateInstance` slots); `EXPECTED_RTL_GAPS` 374 → 419 at zero failures.
Review rework (QA's MEDIUM): a line comment after a gate instance's `,`
now ends the line, the next instance one level in.

Byte-identity vs 0.43.0: 0 of 820 corpus files and 0 opentitan outcomes
differ.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
2026-09-05 07:12:54 -05:00
lucioandClaude Fable 5.1 ec9ec42276 Walker cycle policy by directory identity, and comment slots around a net delay's #
TODO §43 (docs/features/walk-cycles). Closes topo §2.9-8 and §2.9-27 and
repository-analysis finding 3; §2.9-30 filed.

43.1 `lucisv_core::walk::Walk` keeps a `visited` set keyed on `(dev, ino)`
(the canonical path off unix): each directory is entered once, a symlink
to one already entered is skipped, one not yet entered is followed once,
a dangling directory link is skipped. A dangling link that names a source
file is still handed on, so the front end's "no such file" error survives
(review ruling on QA's finding). Both front ends share the walk unchanged
in signature; a cyclic workspace indexes and a cyclic tree formats, each
file once.

43.2 `NetDelay::{before_hash, after_hash}`: the gaps around `#` have
slots, printed inline; the `#SKIP` in net_delay_position.cases is live
and the RTL gap fuzzer covers the construct (374 gaps, 0 failures).

Byte-identity vs 0.42.0: 0 of 820 corpus files differ. On opentitan the
only per-file change is §41's dedup reporting a same-directory symlink
alias once.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
2026-09-05 02:43:10 -05:00
lucioandClaude Fable 5.1 d5abf81563 The two §11 parser skips: rival unit headers across an ifdef/else split as one verbatim unit, a net delay accepted after the type
TODO §38 (docs/features/parser-skips). Closes the jtag_if.sv and
SimDTM.sv skips from the §11 sweep.

38.1 `Parser::at_rival_header`: in a module/interface/program body, a
continuing directive at the unit's own entry level followed by the same
keyword and name is a header written twice across the arms, not a
nested unit. The error routes into the existing conditional split
(`at_split_conditional` now fires on a rival as well as an open
bracket; `scan_split_extent` runs to the unit's real closer, counting
nested units of the same kind), so the whole unit is one Verbatim item
in both modes. jtag_if.sv now formats (body verbatim, the standing
directive-split trade).

38.2 `DataDecl::delay: Option<NetDelay { expr, after_type }>`: a net
delay is accepted before or after the type (IEEE 1800 §6.7 puts it
after), never both, and printed where it was written. SimDTM.sv now
formats; its four `#0.1` lines come back byte-identical.

Byte-identity vs 0.41.0: 0 of 820 corpus files differ; over 2 554
opentitan files exactly the two named files change outcome.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
2026-09-04 23:06:37 -05:00
lucioandClaude Fable 5.1 a30dda167a Small items, round 3: a bare begin block recovered as a generate block, the half-typed #( override lookahead, atomic in-place writes
TODO §36 (docs/features/small-items-3). Closes topo §2.9-24 and §2.9-25
and the §1 atomic-writes item.

36.1 `ItemKind::GenBlock(Box<GenBlock>)`: in tolerant mode a `begin … end`
at module scope or straight inside a generate region is parsed as an
unnamed generate block with a diagnostic at the keyword, so the items
inside and after it survive; strict mode is untouched. Consumers walk
its items; `module-begin-block`, `v2001-generate-begin` and
`mismatched-labels` read the node. The formatter's `gen_block` is split
by a pure extraction into `begin_block`. One server test that parsed a
3 000-deep begin nest on libtest's thread now runs on PARSE_STACK_SIZE.

36.2 `Parser::value_runs_into_next_instance`, a tolerant-mode lookahead
in `parse_connection`: an unclosed `.NAME(` whose value would swallow
the next instance as a call fails the element instead; `recover_element`
takes the bracket the element stopped on before skipping so the skip
stays at the list's level. The balanced-parens spelling stays greedy.

36.3 `lucisv_core::atomic::write_atomic`: sibling temp file + rename,
permissions preserved, symlink target replaced, read-only target
refused as `fs::write` refused it; used by format, `check --fix` and
the cache.

Also: TODO housekeeping (QA lines of §27–§35 ticked as recorded in
their QA logs; the §27 P6 line and the sva-bodies README checkbox
annotated as delivered by §29), topo §2.9-24/25 struck.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
2026-09-04 17:08:53 -05:00
lucioandClaude Fable 5 747ae02b0e Error recovery inside headers and lists: error elements, a list-local bracket-seeded sync that cannot stall, headers keep their node
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]>
2026-09-04 02:58:24 -05:00
lucioandClaude Fable 5 6a15594ae8 WIP §32 header recovery — DO NOT MERGE: half-finished; a fuzz test loops without advancing and exhausts memory (crashed the machine 2026-09-03)
Checkpoint of the interrupted dev work (rate limit) so master stays
clean. Known state: a_half_typed_instantiation_is_one_error_node
(expected to invert) and tolerant_parse_equals_strict_parse_on_valid_
sources FAIL; the error_recovery test binary exceeds 6 GB under
tools/guard.sh (a non-advancing recovery loop under the delete-any-
character / truncate fuzzers). Resume in a worktree of this branch,
under tools/guard.sh, fixing the advance guarantee first.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-09-03 17:48:28 -07:00
lucioandClaude Fable 5 a0ae5e5fa8 Format fences at statement level and inside class bodies
TODO section 31 (coverage_gaps M9, docs/topo.md 2.9-3).
fence::collect enters class bodies, functions, tasks and always/
initial/final blocks, and statement lists - begin/end, fork/join and
every compound body - through scan_stmt_scope/scan_nested_stmt on the
one scan_units both scope kinds share; stmt_docs/stmt_seq obey the two
swallowed-unit rules item_docs/item_seq had; fence regions merge into
range.rs's plan, which was load-bearing (a fenced statement has no
verbatim run behind it; proved by disabling it). A region opens only at
a line start (opens_line) - the rule the format-fences README has
stated since round 1 - so a fence after code on the same line is an
ordinary comment everywhere, which narrows one accidental item-level
shape (module m; // lucisv: off) and is ruled a drift fix. Deferred
with reasons: port lists, case-item label lists, same-line fences, a
property's locals. verify.rs, lucisv/src/lint.rs and
lucisv_server/src/lint.rs untouched.
Proof: 3 244 tests / 48 binaries, fences.cases 25 -> 38 with the
statement-level entry inverted, corpus 814/820 and 860 files byte-
identical to 0.34.0, opentitan: 4 of its 9 fenced files now keep their
fenced bytes and are fixed points, --check counts identical; 3 348
fence-injection trials with no new refusals.

docs/features/statement-fences/README.md.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-09-03 03:40:12 -07:00
lucioandClaude Fable 5 ee0faa2e18 Modport method prototypes, unnamed DPI formals, and the const ref comment gap
TODO section 30 (coverage_gaps M13, corrected).
A modport port may be a method prototype - import task drive(int x),
export function int get() - parsed by Parser::parse_tf_header, the
one header parse parse_function_decl and parse_task_decl now
destructure, printed by Fmt::tf_header, bound as Target::InScope
(IEEE 1800-2017 25.5: a modport names a member of its own interface)
with the formals declared in a scope of their own; one prototype per
import/export group, the LRM's comma list still a clean error
(recorded narrowing). A DPI import's formals may be unnamed
(35.5.5) behind parse_tf_ports(allow_unnamed), the empty-name
convention documented on TfArg::name, every other caller unchanged
and a non-DPI unnamed formal still an error at its position. M13's
const half was misfiled - const ref already parsed - but the probe
found the unowned gap in const /*c*/ ref, now TfArg::after_const.
Proof: 3 223 tests / 48 binaries, corpus 814/820, 4 807 corpus +
opentitan files byte-identical to 0.33.0 (zero population), QA's
adversarial probes and consumer audit of the possibly-empty names.

docs/features/interface-dpi-arms/README.md.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-09-03 02:27:24 -07:00
lucioandClaude Fable 5 35f0b8d371 Decomposition, lane B: vlog_formatter's format.rs becomes fifteen modules, a pure move
ci / checks (push) Successful in 1m1s
ci / corpus (push) Successful in 28s
TODO section 28, lane B (the file-size rule in CLAUDE.md).
format.rs (5 444 production lines) becomes format/{mod, verbatim,
comment, phrase, list, item, module, instance, decl, routine, class,
cover, sva, stmt, expr}.rs - no file over 600 production lines, the
three dispatch tables (stmt_kind, expr, prop_expr) left whole and
documented as such, sibling modules private with pub(super) entry
points, every public path unchanged (cargo doc item list identical).
Proof: per-binary test counts identical (31/1/5/6/2/22/208/0; workspace
3 215 / 48), 4 807 corpus + opentitan files byte-identical to the
v0.33.0 binary in stdout, exit code and stderr, and a line-multiset +
function-signature census showing only use lines, visibility keywords,
banners and doc comments differ - done by the dev and re-done from
scratch by QA. verify.rs untouched.

docs/features/decomposition-formatter/README.md.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-09-02 16:39:08 -07:00
lucioandClaude Fable 5 a045cd7649 SVA bodies as real nodes: property and sequence expressions with Table 16-3 precedence, declarations, assertions, symbols, and a fallback that speaks
TODO section 27; the SVA half of coverage_gaps C1/M8; docs/topo.md
2.9-18's engine half.
property/sequence declarations, concurrent assert/assume/cover/restrict
property, expect, cover sequence and default disable iff were verbatim
text. They are nodes now: sequence_expr/property_expr as one
precedence-climbing extension of parse_expr (IEEE 1800-2017 Table 16-3
row by row - QA caught two rows transcribed from Table 11-2 and the
rework fixed them: nexttime on not's row, the whole loosest row read
position-independently), typed formals, assertion variables, action
blocks as the statements they are - behind a Rewind snapshot with a
byte-exact per-construct fallback that fires on 0 of 4 792 corpus and
opentitan files. No keyword reserved: operator words are text-matched
in SVA position only. One layout rule: top-level |->, |=>, ##, and, or
break one per line at the parent's indent when the spec does not fit.
SVA gap fuzzer 705 gaps / 0 failing; 46 attack pairs; verify.rs
untouched.
Semantics: SymbolKind::{Property, Sequence}, ScopeKind::PropSeq, formals
and locals scoped, instances resolve in-file and cross-file
(FACTS_FORMAT 15 -> 16); rename, references, document symbols and the
lints see inside; Scope::sva_fallback_warnings names what would still
fall back. macro_use_warnings pinned for a file whose only relationship
to the name is a macro argument (the server half stays filed).
Output moved in 13 corpus and 36 opentitan files, every changed line
inside an SVA construct (proved by tests/census.rs::sva_lines and by
QA's independent re-implementation); the 4 854 ASSERT macro uses are
byte-identical. Corpus 814/820.

docs/features/sva-bodies/README.md. Also carries TODO section 28
(decomposition, planned) and the topo rows for this round.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-09-02 16:02:29 -07:00
lucioandClaude Fable 5 81df63d942 Bind semantics, the spaced macro call and the directive inside a connection, and lucisv.instantiate
TODO section 26; closes docs/topo.md 2.9-15 and 2.9-19; coverage_gaps
M4/M5/M6 corrected against a fresh opentitan census.
A bind directive's target is a path of segments with optional indices
(bind top.gen[0].u_core chk u_chk (...)); a lone target binds as a
module reference, an instance path records nothing rather than a guess.
Each connection's port half resolves against the module being bound in
and its expression half in the target module's scope first, the
workspace's member path when the target lives elsewhere, the writing
scope last (Target::BindScope, resolve::in_bind_target - the
inline-constraint shape). FACTS_FORMAT 14 -> 15: binds now post
references and an instantiation edge.
Expression-position spaced macro calls (assign x = `WIDTH (a + b);)
keep the author's gap, read from the source as glued_null_item reads
its gap; verify.rs untouched, both pins stand. A conditional directive
inside a connection value becomes ExprKind::Verbatim, byte-exact
through raw_inline as Doc::Inline, with the closing paren's line and
the list's break read from the source - so the instantiation keeps its
edge, lens and port references instead of collapsing to opaque bytes
(opentitan: the two padring sites in chip_earlgrey_{asic,cw340}.sv,
+2 edges, everything else byte-identical to 0.31.0).
lucisv.instantiate [uri, position, module] renders the inline ghost's
plan as plain text through workspace/applyEdit for clients without
inline completion; the Neovim README documents it.
QA: 3186 tests / 47 binaries, corpus 814/820, independent binary diff
over corpus and 2 645 opentitan files: only the two named files differ.

docs/features/bind-semantics/README.md.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-09-02 13:15:21 -07:00
lucioandClaude Fable 5 a0c290ccc2 Comment slots in shared machinery: an owner for every gap, four fuzzers at zero, and the small-correctness residue
ci / checks (push) Successful in 57s
ci / corpus (push) Successful in 26s
release / build-and-publish (push) Successful in 5m49s
TODO section 25; closes docs/topo.md 2.9-20, 2.9-21, 2.9-22; opens 2.9-23.
A comment written where no AST node had a field was never deleted: bump
queued it and take_meta handed it to the next node, so it printed one
node later and verify.rs refused the whole file. About seventy named
comment fields now own those gaps - SegmentComments on member/scope/
index/range segments (one parse_postfix_segment replacing three
hand-copied loops), one [a:b] grammar, BinaryComments on inside, casts,
unary/postfix, if/case/for/foreach/do-while headers, @ and # timing,
Stmt::before_semi with StmtKind::takes_semi() as the single owner of
the ; (debug_assert enforced), labels on ten nodes, qualifier runs as
Vec<Qualifier>, function/task/module/package/class/typedef/enum/struct
headers, declarators, ports, connections, instantiations. Each prints
through Fmt::slot_comments, a no-op when empty: 860 corpus and 3 975
opentitan files are byte-identical to v0.30.0 (QA reproduced from an
independent baseline build). Four exhaustive gap fuzzers at zero -
covergroup 329, fragment 153, constraint 395 (committed at last), RTL
352 (new) - are the regression gate. verify.rs untouched, ten attack
pairs. Expression slots are boxed so Expr stays 96 bytes; ast::size_pins
asserts it (QA's one finding).

Also: nav::definition gains the macro branch hover already had (H5);
a cast's type binds as a type via bind_type_expr, FACTS_FORMAT 13 -> 14
(M11); rename reports the candidate references that stayed unresolved
through the overlay, one line per file and unit (2.9-20); the scoped
name join keeps an escaped segment's terminator (2.9-21). One flagged
edit outside scope: a .. in vlog_linter/src/signals.rs patterns.

docs/features/comment-slots/README.md.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-09-02 11:32:16 -07:00
lucioandClaude Fable 5 29096cbbac Vendor and formal collateral: specify, UDPs, checkers, configs, interface classes, alias, union tagged - proven output-neutral
TODO section 23, coverage_gaps M1-M3 with the evidence corrected: every
construct here has zero declarations in the corpus and in opentitan (the
analysis's '13 checker files' were UVM protocol-checker filenames), so
this is a completeness round for vendored cell/IO/memory models and
formal collateral, and the formatted output of all 860 corpus and all
3975 opentitan files is byte-identical to v0.29.0.

Five keywords reserved on a measured zero-collision census (checker,
endchecker, config, endconfig, library); five deliberately not - expect
has 41 real task-call sites, so the statement form is recognised only
when its parentheses hold a sequence operator. One parse_opaque_block
(counts its own opener, keeps the label, leaves a trailing ';' as the
null item empty-item sees) serves specify, primitive with table,
checker and config; library lines parse; specparam is a real
declaration with a rewind for PATHPULSE$; alias a = b = c binds every
term; union tagged formats; interface class routes through the class
prefix with no new kind and no FACTS bump - deliberately, so it cannot
collide with the parallel lane's bump - and implements now contributes
type-hierarchy supertypes. pairs.rs pairs table, checker and config.

docs/features/vendor-formal-grammar/README.md.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-09-02 08:33:30 -07:00
lucioandClaude Fable 5 4e62a14af6 Fragment mode and define continuation: the three .svh shapes that did not parse, and the define that was blamed on its class body
TODO section 22, coverage_gaps H4 corrected. Class-body and module-item
include fragments already parsed - the file-scope item loop is the
class-item loop. The three shapes that did not - a bare statement list,
an enum-member list (riscv-dv's CUSTOM_1, file, included between enum
members), a covergroup-item list - become SourceFile::fragment, detected
by a whole-file rule that cannot misfire on a valid file: the first
structural item failed (directives, macros and null items do not count;
a tolerant Ok that recorded a diagnostic counts as failed - an existing
parity test caught if/else reading as a generate-if to one parser and a
statement to the other), the file does not open with a design-unit
keyword, and a shape consumes the file to EOF, tried narrowest-first.
Each shape re-lexes a fresh token stream - Rewind does not restore the
tokens' comment buckets and the first draft lost comments on
non-fragment files. A fragment formats at indent zero through the
existing printers; its declarations bind; its enum variants are not
exported (pkg::CUSTOM_1 must not resolve to a name that does not
exist). FACTS stays 12.

The other .svh was never a fragment problem: a define whose formal
argument list spans two lines with no backslash. The lexer continues
such a directive until the list closes - incrementally, after QA found
the first cut quadratic on an unclosed list (20000 lines: 2.5 s ->
0.56 ms), pinned by a byte-visit counter.

Opentitan 12 -> 10 failing files, exactly the two predicted; corpus
813 -> 814 of 820; every remaining comment-gap failure proven to fail
identically outside a fragment.

docs/features/fragment-mode/README.md.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-09-02 07:34:31 -07:00
lucioandClaude Fable 5 2734885f2b Covergroup bodies: coverpoints, bins, transitions and crosses are real code - 544 of 544 on opentitan, zero fallbacks
TODO section 21, round 2 of coverage_gaps C1, closing it. A covergroup
was a flat token scan into verbatim text; now ItemKind::Covergroup with
CoverItemKind::{Coverpoint, Cross, Option, Directive, Empty}, BinDecl
(wildcard, kind, array, spec: Values / Transitions / Default /
DefaultSequence / Select, with, iff) and SelectExpr for binsof ...
intersect ... && !binsof - behind the same Rewind fallback as
constraints (v0.27.0's scan re-run character for character on any
failure), no keywords reserved. The bin '(' ambiguity is settled by
position, the LRM's own rule, which replaced a lookahead scan and took
the fallback count to zero. Two guards in shared expression machinery -
an index cannot begin with *, -> or =; a bin's own with (...) filter is
not an array-method iterator argument - both attacked across the corpus
and the opentitan tree. Canonical layout, verify.rs untouched, thirteen
attack pairs. Every sampled expression binds to the class's properties;
cg_inst.cp resolves cross-file; FACTS_FORMAT 11 -> 12. The gap fuzzer
was built in from day one and its classification is asserted, not
claimed.

Opentitan: 544/544 structured, 87/87 DV covergroup files idempotent
with comment streams byte-identical, sweep and per-file diagnostics
identical. Corpus +1139 references, 1135 answered.

docs/features/covergroup-bodies/README.md.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-09-02 06:01:48 -07:00
lucioandClaude Fable 5 bce167c052 Constraint bodies: constraint c { ... } is real code - soft, dist, ->, foreach, solve before - with a rewind to the verbatim it always had
TODO section 20 round 1, coverage_gaps C1 for constraints. A constraint
declaration was opaque text with no name span; renaming a rand field
left constraint c { user_id < 5; } as non-compiling code. Now
ItemKind::Constraint with a structured ConstraintSet (Expr{soft},
Implication, If, Foreach, SolveBefore, Unique, DisableSoft, Directive,
Empty), ExprKind::Dist, and randomize() with bodies as
ConstraintBody::{Items, Verbatim}. The parser attempts the structured
body behind a Rewind snapshot - cursor, both pending-comment buckets,
depth, links, open_conds, diagnostics - and on any error re-runs
v0.26.0's verbatim capture character for character, so an unknown body
IS the old behavior. No keywords reserved: soft/dist/solve/before are
matched by text, so logic before; keeps working and token.rs, pairs.rs
and the editor grammar are untouched. Canonical layout, verify.rs
untouched, attack pairs re-derived and extended. Every operand binds to
the class's properties (foreach vars nest; a with block resolves against
the randomized object's class first), so hover, definition, references
and rename reach inside. FACTS_FORMAT 10 -> 11. Lint rules read
constraint operands.

QA's finding - comments after the round's own words were dropped and
the safety net refused the file - answered with an exhaustive gap fuzzer
(358 gaps, format and idempotency demanded) and fourteen named comment
fields; the forty gaps that remain are shared machinery that fails
identically outside a constraint, filed as topo 2.9-22. Opentitan: 1993
of 2009 bodies structured, sweep unchanged, 48 DV files idempotent with
comment streams byte-identical, per-file diagnostics identical.

docs/features/constraint-bodies/README.md.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-09-02 04:18:18 -07:00
lucioandClaude Fable 5 7d637323a5 Escaped identifiers: the terminating space, written once at fifty sites
coverage_gaps H3. An escaped identifier ends at whitespace (IEEE 1800
5.6.1) and the lexer stops the token before it; the formatter emitted
every name bare or through a format! splice, so \my-signal; re-lexed
as one token and the safety net refused the whole file - netlists and
generated RTL could not be formatted at all. One choke point
(format::named / name_doc, predicate ends_escaped because parser-joined
composites like a.\b end inside an escaped name) now terminates the
name; the space is unconditional and the printer's trailing trim
removes it before a break, so doc.rs and printer.rs are untouched.
verify.rs untouched; eight masked-corruption attack pairs; corpus
byte-identical by construction (every corpus backslash is inside a
string or a comment). Ran in its own worktree in parallel with member
completion. Open, filed as topo 2.9-21: a scoped name whose segment is
escaped is refused, never corrupted, until the parser keeps segments.

docs/features/escaped-identifiers/README.md; TODO.md section 19.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-09-02 02:17:43 -07:00
lucioandClaude Fable 5 307a56e921 Null items: the semicolon after endgenerate, and everywhere else an item may stand
Owner report: 'for loop inside generate shows expected item (found ;) at
endgenerate;'. Lead diagnosis before dispatch: every generate-for spelling
and three systemverilog.io examples already parsed; the failing token was
the lone ';' - IEEE 1800-2017 A.1.4's null item, legal in module,
generate, package, interface, program and class scope and at file scope,
rejected by lucisv in all of them.

ItemKind::Empty, one branch at the top of parse_item_kind, the three
exhaustive arms topo 3.3 predicts and no others. The formatter keeps the
';' where it was written - glued to the previous sibling's line
(endgenerate; end; endmodule; ;;) when no newline separates them and the
';' carries no docs of its own, else on a line of its own - decided from
src spans in item_seq rather than a parser flag. verify.rs untouched,
eight attack pairs. New empty-item lint (slang's -Wempty-member) with a
safe fix whose deletion range structurally cannot swallow a comment.

Corpus byte-identical at 813/820 against the pre-change binary; opentitan
sweep identical file-for-file; empty-item fires zero times there. The LSP
now publishes a warning with a quick fix where it used to publish a parse
error.

docs/features/null-items/README.md; TODO.md section 14.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-09-01 15:01:33 -07:00
lucioandClaude Fable 5 bc533c6cb1 The clocking wave: eight buckets in one round, 43 -> 11 on opentitan
ci / checks (push) Successful in 56s
ci / corpus (push) Successful in 22s
Clocking signal bindings (the one production the modelled node was
missing), default disable iff captured verbatim with six rejection
pairs, iff on event-control terms, indexed bare event names
(chain-charged), gate drive strengths (the mop-up's amortized skip),
program blocks as modules with a different closer, and macros as a
concurrent assertion's whole action — where QA caught a real
regression (a macro BEGINNING a statement, four UVM-idiom shapes) and
the rework moved the decision to the token after the call:
at_statement_tail, one line, with the failure asymmetry argued in the
doc and attacked by QA against the diff rather than trusted. Chain
limit 256 -> 1024 on measured need (567 links in pinmux_reg_top) with
PARSE_STACK_SIZE 16 -> 32 MiB restoring the 3.3x margin, a sabotage
probe proving it real, and parse_sens_list's uncharged chain loop
closed. Whole-tree superset: exactly one output move, ~55 lines of
prim_sync_reqack generate code freed from an assertion's opaque
bytes. Corpus 860 files byte-identical, 813/820. The 11 remaining:
macro fragments (preprocessing decision), vendor non-SV (exclude
patterns recommended), three written-up skips.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-08-29 18:46:58 -07:00
lucioandClaude Fable 5 af3280c651 The mop-up: nine small buckets, forty-five files, no new surface where none was needed
Block-scoped typedef statements (new StmtKind, three arms plus the
typeDefinition hop QA's audit caught missing), system-function casting
types (the bucket the analysis had mislabeled as drive strengths),
enum member ranges, casts over assignment patterns, gate delay lists,
virtual iface.modport through ansi-first-port's own gate, rand on
struct members, foreach skipped dimensions, hierarchical bind instance
paths. OpenTitan sweep 88 -> 43 with zero newly-failing files and the
whole-tree superset check proving 0 of 3,855 previously-passing files
moved; corpus byte-identical at 813/820; tolerant diagnostics 147 -> 0
on the fixed set and 0 files worse anywhere. One skip written up
(pullup drive strength: two AST changes for one file). verify.rs
untouched, no capture added.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-08-29 16:08:51 -07:00
lucioandClaude Fable 5 7f65a2449a The merged-tree pins both lanes promised each other
ci / checks (push) Successful in 48s
ci / corpus (push) Successful in 21s
The refusal pin a_comment_before_a_call_in_a_condition_is_still_refused
flips exactly as Lane B's Handshake said it should now that take_gap
and header_parens share a tree: the shape formats, the comment stays
inside the parens, fixed point asserted, plus the keymgr .cases entry.
And the standing invariant-4 template applied to the directive
capture: three (input, corrupted output) pairs — a dropped `else arm,
swapped arms, a lost `endif — each asserted rejected by the safety
net. Both were flagged by the serial round as the lead's first
post-merge task; done by the lead.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-08-29 13:43:24 -07:00
lucio 3f300fa9e9 Merge testbench-syntax serial round (directive-in-statements + take_gap)
Co-Authored-By: Claude Fable 5 <[email protected]>

# Conflicts:
#	docs/features/formatter-bug-fixes/README.md
2026-08-29 13:38:32 -07:00
lucioandClaude Fable 5 7881cc869c Directives may open inside a statement, and comments keep their owners
Bucket 7: the mirror image of directive-split — an `ifdef opening
INSIDE an assign RHS, expression or instantiation head, where all
three existing directive features trigger on a closing directive and
could not fire. The construct is captured verbatim by two mirror
recoveries sharing one capture step (statement-level first, item-level
behind it), construct_end classifying the head (Semi /
endfunction+label / Unknown -> refuse rather than guess), and
terminated_in_arm honoring both real terminator placements. Both
flagship tb.sv files needed only take_list_directives to stop
harvesting an outer region's `else as a list element. OpenTitan sweep
107 -> 100, exactly the 7 targets (chip_if.sv x2, chip_earlgrey
asic/cw340, jtag_dtm_reg_block, both top_* tb.sv), zero regressions,
corpus per-file byte-identical to baseline.

Also delivers Lane B's Handshake: take_before_open's queue drain was
necessary-but-not-sufficient — CallComments::dangling drained the
same way — both now behind Parser::take_gap (comments kept only when
span.start >= last_end()), verified by composing with Lane B's tree:
keymgr_scoreboard.sv formats, closing the last bucket-2 file.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-08-29 13:38:02 -07:00
lucio 27a652ee3d Merge testbench-syntax Lane B (formatter round-trip bugs)
ci / checks (push) Successful in 54s
ci / corpus (push) Successful in 21s
Co-Authored-By: Claude Fable 5 <[email protected]>

# Conflicts:
#	TODO.md
2026-08-29 12:56:47 -07:00
lucioandClaude Fable 5 d3deacf0f6 Three formatter comment bugs fixed where they lived, safety net unwidened
Bucket 2 of syntax_coverage.md: 12 opentitan files parsed but failed
the formatter's own verification. Three shapes: (A) a line comment
trailing 'end' swallowed a cuddled 'else' into the comment — cuddling
now requires no trailing line comment (block comments still cuddle);
(B) a comment inside if/while/repeat/wait/case header parens printed
after the ')' — Fmt::header_parens finds the real ')' and prints the
split comments through the shared paren layout; (C) 'default;' grew an
invented ':' — the optional colon is read from the source byte. 11 of
12 files now format and round-trip (12 -> 1 verification failures on
the sweep); the 12th is a parser bug filed as a specified Handshake
and delivered by the directive round, not edited cross-lane. verify.rs
untouched; four masked-corruption rejection pairs added per the
standing template; QA's ~30-attack sweep found zero corruption and
pinned two informational boundaries. Formatter output changed:
release must bump the workspace version (format-cache rule).

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-08-29 12:55:51 -07:00
lucioandClaude Fable 5 e2c954ba77 Out-of-class constraints parse: one line, 45 files, a cascade gone
constraint C::name { ... } at file/package scope failed at the `::` —
parse_constraint's name was expect_name where the out-of-body method
path already existed; it is now parse_method_name, and nothing else
moved: the item was always a verbatim leaf, so no AST variant, no
formatter/binder/spans arm, verify.rs untouched. On the real opentitan
checkout: 45 of 45 bucket-1 files unblocked (44 fully clean, the 45th
advancing to its documented bucket-10 gap), whole-sweep failures
151 -> 107 with zero newly-failing files, and the tolerant-mode
cascade collapsing 1,349 diagnostics -> 1 across the bucket — the LSP
win the round was chosen for. Corpus gate exactly at baseline. QA
reproduced every number independently via stash before/after,
attacked the grammar widening and the verbatim byte-integrity, and
pinned the index-opacity promise with the corrected semantic test.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-08-29 11:05:34 -07:00
lucioandClaude Fable 5 d4eb8f48ff The stack fits the nesting limit by construction, on every thread
ci / checks (push) Successful in 42s
ci / corpus (push) Successful in 19s
MAX_NESTING_DEPTH turns over-deep input into a parse error only on a
stack big enough to reach level 64, and that was an unenforced README
assumption: debug frames drifted to ~94 KiB/level under rustc 1.97
(worst family nested case, 5.9 MiB at the limit), so a default 2 MiB
spawned thread aborted around level 30 with the limiter never firing.
New vlog_parser::PARSE_STACK_SIZE (16 MiB, 2.7x the re-measured worst
case) is applied at every parse-reaching site: both binaries' work
moved onto named spawned threads (a main stack is the OS's to size —
1 MiB on win32; pre-fix lucisv aborts under ulimit -s 1024, fixed one
diagnoses), rayon pool workers resized, forwarder and lsp-server IO
threads audited parse-free. Deep-nesting suites across four crates on
controlled stacks, sabotage-verified; caller-side stack contract added
to every public parse entry point's rustdoc. analyze measured at
71 KiB on a max-legal tree — no second bound needed.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-08-28 16:26:06 -07:00
lucioandClaude Fable 5 839a28ec8d vlog_parser: a direction-less first ANSI port parses
IEEE 1800 §23.2.2.2 allows an ANSI header's first port to carry no
direction — the normal spelling for interface ports — but
parse_port_list classified any leading identifier as a non-ANSI list
and errored on what followed. One clause fixes it: a leading Ident is
ANSI when the parser's existing type-then-name lookahead
(at_typed_declarator, which already walks pkg:: chains, #() overrides
and packed dims) or the new 4-token modport lookahead (ident.ident
ident) says so; the complement is exactly the old non-ANSI list, and
macro-led lists never enter the clause. bus_if.mp was a second,
independent gap (it parsed in no position before) and is glued into
DataType::name the way pkg::t already was. No AST change — the new
ports are AnsiPort { dir: None }, the shape later ports always had.
Two match-widenings ride along: bind_data_type and type_def's
type_span read the pre-dot half as the type, and the modport half is
bindable by nothing — pinned for rename by QA.

The safety case, established twice (dev, then QA independently via a
worktree build): corpus 813/820 both sides, TSVs byte-identical, and
all 820 formatted outputs SHA-256-identical across the change; zero
snapshot churn; verify.rs untouched. QA's boundary AST-diff harness
(~20 shapes at the classification edge) and a 50-file
direction-stripping fuzz sweep found no misfire. The
previously-blocked fixtures flipped to first-port order; instantiate
now plans interface-typed port lists instead of refusing. The two
remaining unsupported shapes (generic interface ports, virtual
modport declarations) are pinned by a lead-added test so a future
round changes them on purpose.

24 tests added (dev 21 + QA 2 + lead 1).

docs/features/ansi-first-port/README.md

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-08-26 20:49:16 -07:00
lucioandClaude Fable 5 53f226981f printer: multi-line raw text keeps the column honest
Raw text carrying a string literal across a line break, and the #( ... )
of a parameterized type, were emitted as a single Doc::Text with embedded
newlines -- violating that variant's contract and leaving the printer's
column tracker stale, so every later fits() on the line broke
conservatively. Both now emit Doc::Inline, whose printer arm resumes
measuring from the text's own last line. Output bytes are identical
except where the stale column forced a spurious break: one corpus file
(id_queue_tb.sv) improves, pass set unchanged at 813/820, verify.rs
untouched. Found by QA in the directive-split round; pinned by a printer
test and a classes.cases entry.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-08-26 02:10:10 -07:00
lucioandClaude Fable 5 b77b61e7de directive-split: recover conditional-split constructs as verbatim items
An `ifdef/`else region whose arms are each an incomplete fragment of one
declaration (alternative heads sharing a body; alternative struct bodies
sharing a closing) no longer refuses: the strict parser recovers the whole
construct as a verbatim item, exact source bytes, the constraint/covergroup
precedent. The trigger requires an unmatched open bracket inside a region
genuinely open at item scope — `Parser::open_conds` counts only at the
single ItemKind::Directive producer, so opaque verbatim walks cannot
perturb it, and a recovered block hands back the nesting it swallows.

Corpus: 800 -> 813 / 820 (97.6% -> 99.1%), +13 files (12x
riscv_core_setting.sv, riscv_instr_pkg.sv), pass set a strict superset.
verify.rs untouched. Three dev passes, two adversarial QA rejections
(stray-`endif laundering; open_conds pollution via opaque bodies), QA
round 5 PASS. 26+12 new tests; workspace 1672 passed / 0 failed.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-08-26 01:26:28 -07:00
lucio eeaffafd56 Rename the tool to lucisv (Language Utility for Coding In SystemVerilog) 2026-08-25 23:36:00 -07:00
lucioandClaude Fable 5 71a300d901 QA round 2: review logs and two macro/multi-line-string attack tests
Nothing blocking over mop-up-2 and the round-1 fix commit: corpus
idempotency sweeps at default, --line-length 40 and --indent 4 clean
(800/820), 3038 mutation trials clean, printer fits() change isolated
to zero output differences on the corpus.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-08-21 02:39:55 -07:00
lucioandClaude Fable 5 a4f8476894 Fix round-1 QA findings: Inline width in fits(), action-block nesting, comment gaps
printer::fits() now measures from a multi-line Doc::Inline's last line and
keeps measuring the rest of the group (a with {...} block no longer hides
an overflow). skip_action_stmt tracks begin/end, fork/join, case/endcase
nesting so a concurrent assertion's action block is captured whole.
Comments between bind/target/module and around randomize(...) with are
attached and reprinted instead of being refused by the safety net.
All 800 passing corpus files format byte-identically before and after.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-08-21 02:11:59 -07:00
lucioandClaude Fable 5 e35da292bd Add mop-up-2: macro items ending their line, new shallow copy, 32'h`MACRO
A macro invocation that ends its line is a complete item whatever opens
the next line; new <expr> shallow-copy constructor; a based number whose
digits come from a macro (32'h`BOOT_ADDR) lexes as a base-only number
joined with the macro in the parser. verify.rs untouched, attack tests added.

Coverage loop round 2: 796 -> 800 / 820 (97.1% -> 97.6%).
Feature README: docs/features/mop-up-2/README.md

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-08-21 01:42:53 -07:00
lucioandClaude Fable 5 0557933994 QA round 1: adversarial review logs and a with-block attack test
No blocking findings over the 8 round-1 clusters: whole-corpus idempotency
and comment-preservation sweep clean (796/820), 476-run mutation fuzz clean,
no swallowed errors in the diff. Adds
reindented_string_inside_a_with_block_is_rejected. Findings (non-blocking)
are in each feature README's QA log; the printer fits() / Doc::Inline gap
is fixed separately.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-08-21 01:37:33 -07:00
lucioandClaude Fable 5 f1db1e5746 Add dv-statements: with clauses, foreach targets, randcase, let, labels
randomize()/std::randomize() with { ... } (block verbatim), array-method
with (expr), foreach over scoped/hierarchical/indexed arrays, randcase,
wait fork, import as a statement, let declarations, empty call arguments,
general statement labels, and endtask: name; (stray semicolon kept).
Also fixes a pre-existing verification failure for a comment between a
then-branch and its else.

Coverage loop round 1, cluster 8: 772 -> 796 / 820 (94.1% -> 97.1%).
Feature README: docs/features/dv-statements/README.md

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-08-21 01:19:49 -07:00
lucioandClaude Fable 5 c2ea1656e1 Add expressions-2: casts, streaming, ->, drive strengths, pattern replication
Casts with parenthesized/keyword/scoped bases, streaming operators, -> and <-> implication, assign (weak0, pull1) drive strengths, (* attr *) on named connections, '{N{x}} replication in assignment patterns, x inside `MACRO, const ref tf arguments.

Coverage loop round 1, cluster 7: 751 -> 772 / 820 (91.6% -> 94.1%).
Feature README: docs/features/expressions-2/README.md

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-08-21 00:46:39 -07:00
lucioandClaude Fable 5 d071957393 Add types-decls: inline aggregates, typedef'd types with packed dims
Anonymous enum/struct/union declarations, struct packed as a parameter type default, user_t [N:0] x; at item and statement position, typedef enum with a typedef'd base, nested anonymous structs, localparam type as a body item, multi-declaration for-loop inits.

Coverage loop round 1, cluster 6: 740 -> 751 / 820 (90.2% -> 91.6%).
Feature README: docs/features/types-decls/README.md

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-08-21 00:24:04 -07:00
lucioandClaude Fable 5 2a63faf9a2 Add interfaces, modport, clocking blocks and virtual interface types
interface...endinterface shares the module header/body machinery (ItemKind::Module with kw == "interface"); modport and clocking are structural items; virtual <iface>[#(...)] is accepted in every type position. module-filename now applies to interfaces.

Coverage loop round 1, cluster 5: 712 -> 740 / 820 (86.8% -> 90.2%).
Feature README: docs/features/interfaces/README.md

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-08-21 00:01:53 -07:00
lucioandClaude Fable 5 e24d33afab Add concurrent assertions, sequence and property as verbatim items
assert/assume/cover/restrict property (...) [action block], optionally labeled, at item and statement position; sequence...endsequence and property...endproperty declarations. Verbatim pass-through like constraint/covergroup; verify.rs untouched, attack tests added.

Coverage loop round 1, cluster 4: 699 -> 712 / 820 (85.2% -> 86.8%).
Feature README: docs/features/assertions/README.md

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-08-20 23:38:22 -07:00
lucioandClaude Fable 5 f7c66c79bf Add bind directives
bind <target> [: inst, ...] <module> [#(...)] <inst> (...); reusing the instantiation AST and layout wholesale.

Coverage loop round 1, cluster 3: 671 -> 699 / 820 (81.8% -> 85.2%).
Feature README: docs/features/bind/README.md

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-08-20 23:23:41 -07:00
lucioandClaude Fable 5 8007a71932 Add dpi-export: DPI-C import/export and package export
import "DPI-C" [context|pure] function/task prototypes, export "DPI-C" function/task, and export pkg::*; / pkg::item.

Coverage loop round 1, cluster 2: 661 -> 671 / 820 (80.6% -> 81.8%).
Feature README: docs/features/dpi-export/README.md

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-08-20 23:09:49 -07:00
lucioandClaude Fable 5 f52beff48f Add item-misc: spaced macro calls, line-aware macro items, `error, elab tasks
Macro invocations with whitespace before the argument list, a bare macro on its own line followed by a declaration, `error/`warning directives, and $error/$fatal/$warning/$info as module/generate items.

Coverage loop round 1, cluster 1: 636 -> 661 / 820 (77.6% -> 80.6%).
Feature README: docs/features/item-misc/README.md

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-08-20 22:54:47 -07:00
lucioandClaude Fable 5 54b0ca3896 Add class-semantics and lexer-cleanup (round 20)
class-semantics: classes are first-class in vlog_semantic -- class
scopes and symbols, member/method/prototype binding, this.x
(nearest-class-only), super.x, cls::x with lexical unit heads,
out-of-body cls::method bound into the class's scope with the extern
prototype as the definition (rule 10), and the honest
InheritedCandidate{base, paths} shape: a member miss in an extending
class records what the unknown base might supply (import paths
included) and is never chased, not even in-file -- the future
inheritance round's worklist, measured at 1303 candidates. Unit-name
misses stay ExternalCandidate (QA-found, lead-ruled: bases supply
members, not package names; +170 recovered navigations, pinned).
Workspace index gains classes as units (246) and their members
(11399). scan.rs migrated to parser name-spans: 26 call sites down
to the 2 documented consumers. 114044 spans, 0 unplaced, 0 panics;
UVM code now has hover/definition/references/outline.

lexer-cleanup: the three filed gaps -- @(* ) lexes via a
starts_attribute backoff (an attribute cannot begin with `)`; real
attributes pinned, no misfire on legal expressions), a leading BOM
is accepted as a named losslessness exception (mid-file BOM errors
clearly; 20k-case position fuzz clean), and non-ASCII lex errors now
decode the full character AND surface through vfmt check's error
slot (exit 2, matching format, text-rule findings still reported --
the silent-pass hole closed). The macro space-before-paren item is
parked with a QA-hardened analysis: the reading depends on a
definition vfmt cannot see, any fixed answer is provably wrong for
one population, and today's behavior fails safe.

827 workspace tests. Dev: 2 Fable agents; QA: 2 Opus agents; reviews
in docs/features/{class-semantics,lexer-cleanup}/README.md.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-08-20 00:56:32 -07:00
lucioandClaude Fable 5 da1448ecd0 Add dynamic-types and one-parse (round 19)
dynamic-types: queues ($ as an expression primary -- one grammar
addition and [$], [$:N], q[$-1] all fall out of existing machinery),
dynamic [] and wildcard [*] dims (DimKind, the round's one
non-additive AST change: three consumers, all updated), empty {}
literals, named call arguments f(.a(x)) as ExprKind::NamedArg,
case ... inside with range labels, bare @event sensitivities (also
fixing a pre-existing invented-parens refusal), and macro items
before ident-dot statements. Everything structural, nothing
verbatim; verify.rs and fence.rs byte-identical. Corpus 578 ->
636/820 formattable (70.5% -> 77.6%), parse-error 242 -> 184, 58
gained / 0 lost by path, all 636 round-tripped, all 578 previously-
formattable files byte-compared old-vs-new with zero differences.
Two newly-reachable comment drops fixed in-round (one pre-existing,
one this round's own new code -- split documented honestly post-QA).
New top blockers: interface (25), the `else head-swap (13).

one-parse: LintContext::from_parse accepts pre-built parse products
(Backing enum forced by SourceFile: !Clone; new() stays a one-line
wrapper -- all 12 rule files byte-untouched); ParsedSource::parse
lexes once; vfmt check parses once per file; the server lints from
Document's own products, eliminating the per-keystroke second parse.
Behavior identity proven at the byte level (2.4MB corpus JSON, 13
server publishes, corpus-wide --fix); check --threads 1 20% faster,
server didChange latency roughly halved. protected_regions left
alone per its documented anti-drift signature. Lead fixes on
acceptance: the from_parse contract-cost doc sentence, and a stale-
tree guard test in the server (QA's sabotage passed all 773 tests --
nothing pinned text/tree agreement; now one test does, through the
merged diagnostics path where the stale warning actually lives).

791 workspace tests. Dev: 2 Fable agents; QA: 2 Opus agents; reviews
in docs/features/{dynamic-types,one-parse}/README.md.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-08-19 20:22:18 -07:00