70 Commits
Author SHA1 Message Date
Guoliang ChenandClaude Mythos 5.2 58d3db3e3c Release 0.65.6: saving a file no longer re-indexes the workspace
ci / checks (push) Successful in 59s
ci / corpus (push) Successful in 16s
release / build-and-publish (push) Failing after 4m55s
TODO §71.1. On OpenTitan hw (4 058 files) every save cost ~160 ms of
whole-index work, twice (the save and VS Code's watcher echo), and watcher
events for files the index could not hold started whole rescans.

- vlog_semantic: resolution records every table lookup per reading file,
  misses included (workspace/dependents.rs, references.rs, replace.rs); an
  update re-resolves the edited file and the readers of keys whose values
  changed in what resolution reads. An unchanged record merges nothing. When
  the readers hold more than an eighth of all references, old results are
  removed in one pass over the postings.
- lucisv_server: watcher events are classified per file (state/watched.rs);
  the include graph keeps every include line as written and re-resolves the
  lines a named path could satisfy, in one pass per event; an event naming
  more paths than half the index takes the single rescan; an open buffer the
  index does not hold joins on its first save; completion tables are rebuilt
  only for the names a file declares. Every save still republishes every open
  buffer. The line-length lint follows the formatting style's width.
- Fixed on the way: removing an included header left other files' include
  edges pointing at it.

Typical saves: comment or watcher echo <0.3 ms, local signal 4 ms, package
member 12 ms; warm startup +40..120 ms for the readers table.

QA failed the first cut on four stale answers found with an independent
fresh-server oracle; all four are fixed and are differential tests. Dev
(three rounds), QA (two rounds) and lead review:
docs/features/localized-reindex/README.md. TODO.md files lane 71.7 from
what the QA rounds and an investigation found in earlier releases too.

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

Gates: tools/gates.sh PASS on this tree; vlog_semantic 435/0,
lucisv_server 2011/0, lucisv_mcp 384/0.

Co-Authored-By: Claude Mythos 5.2 <[email protected]>
2026-11-19 08:52:01 -08:00
lucioandClaude Opus 5.5 9dc567c72a TODO §65.4: a hierarchical path rooted at a top-level module resolves through the workspace (conservative)
ci / checks (push) Successful in 1m42s
ci / corpus (push) Successful in 32s
`tb.dut.g_sw[0].buf_q` written in a file that does not declare `tb` now
resolves like an instance path: the binder marks a dotted path's head
(Target::PathHead), resolve/root.rs answers a plain lexical miss with a
hierarchical external candidate, head_site roots the spine there, and
fold_path walks it — every hop a module/interface surface. find_references,
LSP references and rename see every segment; $root.tb works; a local `tb`
shadows. FACTS_FORMAT 22.

Rooted only when the root is provable (owner's ruling: conservative): not
when the head has an import candidate (so `import uvm_pkg::*` with uvm_pkg
outside the project stays warned — opentitan's DV force paths behave as
before), not from inside a class, not beside a macro that stands where a
declaration could (item, statement, port list), not when the root name is
also a package or ambiguous. The LSP rename set adds the files of the
path's root and middle hops (sources.rs, WorkspaceIndex::path_units_to).
An unresolved path is warned once.

QA (Opus) x2: F1-F4 and R1 silent-wrong-rename shapes fixed with tests;
QA's attack cases 1-6 each warned or correctly renamed; lucisv check hw
byte-identical to master. Completion after `tb.` deferred (TODO §65.8).
tools/gates.sh: PASS, 15 steps, 5 180 tests, corpus 814/820.
docs/features/top-rooted-paths.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-19 15:34:45 -07:00
lucioandClaude Opus 5.5 ca83f6f99f Review lows L-1–L-4, L-12, L-13: end labels, duplicate generate labels, dotted comments, lex-failure fallbacks, file naming
- L-1: an unowned block's closing label is a use of a same-named block only
  for block constructs and only when it spells the construct's own opening
  label (use_block_end_label); a mismatched `end : a` or an `endfunction : g`
  beside block `g` records nothing.
- L-2: duplicate-declaration stays silent for two block labels only when
  both may be arms of one generate if/case; sibling `for` blocks and a
  procedural block beside a generate one are reported in either order.
  OpenTitan check: 1 158 findings, identical to 0.60.0.
- L-3: a block comment between `.` and the name is still dotted.
- L-4: a bind file that does not lex counts as binding (K2); a pasted
  fragment that does not lex is said, not skipped.
- L-12: no unchecked slice in rename/arms.rs.
- L-13: expand/ansi/inline/extract messages name files by Scope::name_of.

7 tests (L-3/L-4's fail with the fixes disabled). Per-crate suites under the
guard: 80 suites, 5 085 passed, 0 failed, 51 ignored (one combined run was
cut at 1 800 s in vlog_refactor/tests/corpus.rs with syspolicyd at 95 % —
the §65.3 stall).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-14 13:33:27 -07:00
lucioandClaude Opus 5.5 7794d3938b TODO §65.1: rename and references through a generate block label; rename warnings and mentions scoped to the renamed declaration
A path segment naming a block (bare, indexed, nested, cross-file) is now a
reference to its label: vlog_semantic declares a `for` block's label in the
enclosing scope, makes `generate … endgenerate` no scope, gives a block a
member scope, walks an index in a path, and files blocks on a module's
hierarchical surface under `module.label` (FACTS_FORMAT 21). The LSP, CLI
and MCP rename/references get it through the engine; lucisv-mcp's `block`
refusal is lifted. No verifier normalization (attacks in
check/qa_block_paths.rs, qa_block_attacks.rs).

Reworks after QA: unresolved path segments warned in every file of the set;
sibling-arm members warned; a label beside a net is a duplicate-declaration;
function-local block keys never collide; file names path-qualified when base
names collide; rename warnings and lucisv-mcp mentions scoped to the
declaration's home set (rename/home.rs, scoped.rs), falling back to unscoped
on any doubt. TODO §65.4 and §65.6 filed.

docs/features/generate-label-rename. Workspace lib/bins/tests: 79 suites,
5 064 passed, 0 failed, 51 ignored (guard exit 0).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-07 01:01:23 -07:00
lucioandClaude Fable 5.1 a2a22adad8 Cross-file references reach a module's nets, variables and instances (§64.1, QA task_d8afe80f of §63.1): nav.rs's two index questions (leaves_this_file, indexed_def_in_file, the latter shared with hover's live_symbol) asked WorkspaceIndex::member — the connection surface, ports and parameters — so a declaration only a hierarchical path can name (a bind connection's expression half, a u_x.sig tail) was judged unable to leave its file and references fell to the single-file answer, while a rename already edited both files; from a use that did resolve cross-file, the declaring buffer's own uses could not re-identify themselves. Both now ask member_in(…, Surface::Hierarchical); the connection answer comes first and whole from that read, so every port/parameter/package/class/struct answer is byte-identical (nav harness controls and a 948-declaration opentitan census). A hierarchical-only member has no Local postings by the §49 ruling, so nav::declaring_file_uses parses exactly the closed declaring file once per request (0.4–1.5 ms on state_q into a shut entropy_src_main_sm.sv), hierarchical_only asking the index's own table rather than restating surface_of. Three QA rounds (Sonnet, Sonnet, then Fable per the escalation rule): the closed-file path read a cached FileView and rendered against a fresh text_of (a stale offset on a wrong line) — now one fresh read per closed file threaded to the rendering step; every index-time span about a closed file, and the open-buffer declaration fallback (nav::declaration_site), guarded by hover::spells_exactly (pub(crate), shared not copied): a stale index may omit a location, never mislocate one. Accepted: +25 % on a local-net references in a 40 267-line buffer (1.22 → 1.54 ms), the guard is textual (a different exact token at a deleted declaration's old bytes). opentitan: entropy_masking_req from aes.sv now lists aes_bind.sv; state_q lists entropy_src_core.sv; checkout untouched. Tests 4422 → 4459 (11 dev + 1 hover + 1 e2e wire test; 19 QA attacks incl. escaped identifiers, UTF-8 boundaries, a deleted declaring file, oracle equivalence with vlog_refactor::find_references); fmt, clippy, workspace suite green through tools/guard.sh. Feature README docs/features/references-hierarchical-surface; references-nav, hierarchical-tail and hover-declarations READMEs, record.rs's postings comment and the topo row amended; perf entry in docs/perf/README.md. Release 0.55.0 left to the owner.
ci / checks (push) Successful in 1m14s
ci / corpus (push) Successful in 36s
Co-Authored-By: Claude Fable 5.1 <[email protected]>
2026-09-12 14:50:16 -07:00
lucioandClaude Fable 5.1 1b8723ca1f Rename edits and warns about a bind file's own occurrences (§63.1): a bind connection's bare name is a reference on the target's hierarchical surface under target::name (the resolver asked the connection surface — ports and parameters — so an internal net resolved to nothing and, with no name on the path, was never warned about); a hierarchical path in a bind connection is rooted at the bind target (Target::BindMember, walking descend/member_at shared with member_of); a multi-segment target is spelled tb::u_aes for follow_one; FACTS_FORMAT 19 → 20 (a 0.53.0 store rebuilds once); selection was never the gap. Parity: every difference against 0.53.0 is a bind file's new edit or warning (1 758 − 8 = 1 750 sentences held), tail rename 326 ms. 16 engine fixtures (QA's six attacks included), a preflight-parity fixture, a wire-level definition/references test; QA filed the pre-existing nav.rs references gap for loop 3.
ci / checks (push) Successful in 1m9s
ci / corpus (push) Successful in 34s
Co-Authored-By: Claude Fable 5.1 <[email protected]>
2026-09-12 01:05:14 -07:00
lucio 4621214a51 Perf take 5 P4a (§60.4): startup and memory instrumented on the --verbose channel (scan_trace, cache counters, table sizes; scanprofile/scanserve phases) — a session runs an empty scan before configuration that still opens and rewrites the 45 MB store (184 ms of a 1.33 s warm start), warm has no dominant stage and 27 % is store I/O, cold is 59 % parse; P4b ruled
ci / checks (push) Successful in 1m7s
ci / corpus (push) Successful in 35s
2026-09-08 00:05:43 -05:00
lucio e51a2c7f21 Perf take 5 P2a–c (§60.2): rename reuses its analysis, verification untouched — a --verbose stage trace (the tail rename was 238 files, 717 parses, two thirds repeated), one parse+analysis per file inside the scope (FileFacts::analyzed, Scope::build_keeping), the after-index absorbed from the edited files' records with every verifier check unchanged and re-attacked; tail rename 780 → 420 ms, aes rename −25%, resolves −20%, parses K+E
ci / checks (push) Successful in 1m10s
ci / corpus (push) Successful in 45s
2026-09-07 19:37:57 -05: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 e6eaf53c35 Organize imports: unused imports removed, duplicates merged, the run sorted; the unused-import rule; source.organizeImports
ci / checks (push) Successful in 1m2s
ci / corpus (push) Successful in 47s
TODO §52 (docs/features/organize-imports), the third §8 refactoring.

The judgement lives in `vlog_semantic::imports` (one implementation for
the refactoring and the rule): an import is used when a reference in its
scope, or one nested in it, resolves to a member of the package through
it — `resolve::lexical`'s walk stopped at the scope, every import whose
path admits the name and whose package exports it (binder tables
same-file, `members_of_chain` with re-exports otherwise) marked used, a
deliberate superset; a qualified `p::y` and an import's own package name
never count; an `export p::x` / `export p::*` / `export *::*` in the
scope marks the import it re-exports through as used (IEEE 1800 §26.6 —
the review rework of QA's HIGH, pinned four ways). Refuse to judge: an
unknown or twice-declared package, a macro call or conditional directive
anywhere in the scope, a class with an out-of-file base, a parse
diagnostic, two imports on one line. `vlog_refactor::organize_imports`
deletes the unused lines, merges exact duplicates, sorts the run at the
scope's top (package, item, `*` first), keeps every comment; the
verifier's resolution check refuses a removal a reference needs (attack
pair). `unused-import` (Style, off; safe fix) through
`MentionOracle::package_exports`, silent without a project. Server:
`lucisv: organize imports (removes N, sorts M)` under
`source.organizeImports`, `lucisv.organizeImports`.

Corpus: 40 scopes with ≥ 2 imports, 1 organized, 32 refused for macros;
the rule finds 2, both substantiated. opentitan: 33 of 33 UVM env
packages refused (`` `include "uvm_macros.svh" ``). 0 of 860 corpus
files differ from 0.46.0.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
2026-09-05 20:00:31 -05:00
lucioandClaude Fable 5.1 f476c31483 Cross-file instance-member tail: a module's hierarchical surface, read only behind an instance head; rename edits the tail
TODO §49 (docs/features/hierarchical-tail). Closes topo §2.9-23 and
comment-slots finding 2. The first dev was cut off by an outage with the
library half complete; a second finished the tests, README and gates.

`Surface { Connection, Hierarchical }` on `Resolution::ExternalCandidate`
and `MemberSite::Unit`, set by `resolve.rs::head_surface` for an instance
head. `workspace/hierarchy.rs`: `surface_of` (the export rule, re-ruled)
and the two surface-taking reads; the index keeps two disjoint tables —
`members` (connection: ports, parameters; byte-identical to before for
every existing reader) and `hier_members` (nets, variables, instances) —
and a hierarchical read consults the connection table first, so a port
has one record. `FACTS_FORMAT` 18 → 19. `assign w = u_x.sig;` in another
file now resolves to `sub`'s `wire sig`; rename edits both files (nested
`u_a.u_b.sig` included); the §2.9-20 warning is retired for a resolved
tail; a generate-scoped net is still refused honestly. Completion after
`u_x.` in an expression lists the hierarchical surface; a connection
list's does not.

Census: single-file numbers unmoved; 12 939 connection + 5 239
hierarchical-only members; 335 corpus references newly resolve, 514 over
opentitan `hw/` (20 sampled by QA, all genuine). 0 of 860 corpus files
differ. Also: §50/§51 planned, §55 (state.rs size) filed.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
2026-09-05 13:35:57 -05:00
lucioandClaude Fable 5.1 9ef1058059 Package re-exports as real references: bound halves, RX facts, the member walk through re-exports
ci / checks (push) Successful in 1m17s
ci / corpus (push) Successful in 1m52s
TODO §48 (docs/features/package-reexports). Closes topo §2.9-16 and
dpi-export's request (a).

`bind_export_path` records `export pkg::item` as a `Target::Package` use
and a `Target::UnitMember` use, with no scope import (a re-export brings
nothing into the exporting scope, IEEE 1800 §26.6). `FileFacts` gains the
`RX` group (`FACTS_FORMAT` 17 → 18): per package its re-export edges
(package, source, item|*), with `export *::*` expanded into the package's
own imports at record time. `workspace/reexport.rs`: the member lookup
and listing follow re-exports transitively with a visited set, layered
over `own_chain`/`own_members` so the walk cannot recurse into itself;
`Affected::exporters` keeps one-file updates exact and `fingerprint()`
shows the edges. Definition, hover, completion after `pkg::`, references
and rename all read the one edge. Census 103 870 → 103 875 references
(the corpus's two package export lines), 0 unplaced; 0 of 860 corpus
files differ. opentitan: `spi_device_pkg::SramDepth`, reached only
through a re-export, resolves.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
2026-09-05 10:41:54 -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 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
lucio 4ba6eafa2d Merge branch 'wip-header-recovery'
# Conflicts:
#	crates/vlog_linter/src/visit.rs
2026-09-04 03:01:49 -05:00
lucioandClaude Fable 5 cebeff45b4 Linter expansion, wave 1: severities end to end, per-rule editor toggles generated from the registry, and nineteen Error/Warning-class rules
TODO section 33. Every rule states a Severity (error: would likely fail
to compile or elaborate, or silently mis-synthesize; warning: a probable
bug; style), printed in lucisv check text and JSON, mapped to
ERROR/WARNING/INFORMATION in the editor, grouped in --rules-doc, and
accepted by --select/--ignore and [lint] as a class word. VS Code gains
lucisv.lint.severity.{error,warning,style} and one tri-state
lucisv.lint.rules.<rule> per rule (default/on/off - a client sends
every key, so a boolean cannot say unset), generated by
vlog_linter::vscode with a drift test, and lint::enabled_rules is the
one documented ladder: defaults -> select -> class switches -> per-rule
-> ignore. Nineteen new rules (17 -> 36), one file each with true
positives and near-misses: Error - mismatched-labels,
duplicate-declaration (Semantics::duplicates(), additive),
undeclared-identifier (with a project; silent for macro text, included
fragments, hierarchical tails, any name another file mentions),
unknown-port, unknown-parameter; Warning - forbid-defparam,
invalid-system-task-function, truncated-numeric-literal,
undersized-binary-literal (safe fix), suspicious-semicolon,
packed-dimensions-range-ordering, module-port, module-parameter,
explicit-function-task-parameter-type, plusarg-assignment,
instance-shadowing, forbid-negative-array-dim, void-cast,
incomplete-assignment. Every false-positive class found on opentitan
closed with a named test; 3 383 tests / 48 binaries; corpus 814/820
and byte-identical (formatter untouched); vsix smoke OK.

docs/features/linter-expansion-1/README.md.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-09-03 17:49:03 -07: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
lucio ef9ce984b7 Merge branch 'small-1' 2026-09-03 02:41:15 -07:00
lucioandClaude Fable 5 40a7b478c5 Rename warns about macro arguments it did not read; Scope at the crate root; lucisv check --rules-doc
TODO section 29; closes docs/topo.md 2.9-18 (server half) and 2.9-5;
the second half of coverage_gaps M12.
FileFacts::macro_words - the identifier-shaped words seen inside macro
invocations, directive lines and attributes (words::harvest_raw, which
shares its raw-token match with harvest so the two cannot drift) -
tag MW, FACTS_FORMAT 16 -> 17 (+3.1 percent corpus / +1.7 percent
opentitan store, measured). WorkspaceIndex::files_naming_in_macros is
files_mentioning's twin, and lucisv_server::rename appends one warning
per such file that lies outside the set rename_sources built: no new
rung, nothing read, 58 files in 186 microseconds for clk on opentitan.
Pinned by a three-file case and its no-double-warning control, run by
QA against the real server; QA also found an organic instance in
opentitan (cipher_crypt inside a DV_CHECK_FATAL) that 0.33.0 never
mentioned. vlog_refactor's Scope moves to the crate root (pure move,
counts identical). lucisv check --rules-doc prints rules_markdown(),
takes no files, is lint-only; the example binary is gone.
3 226 tests / 48 binaries, corpus 814/820, opentitan check byte-
identical to 0.33.0.

docs/features/macro-word-census/README.md.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-09-03 02:41:15 -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 b57ae35be4 Decomposition, lane D: vlog_semantic's bind.rs and workspace.rs, vlog_refactor's ports.rs and rename.rs become modules, a pure move
TODO section 28, lane D (the file-size rule in CLAUDE.md).
bind.rs (1 718 production lines) becomes bind/{mod, item, decl, class,
cover, stmt, sva, expr}.rs; workspace.rs (1 111) becomes workspace/
{mod, index, update, record, external}.rs with facts.rs and
FACTS_FORMAT untouched; ports.rs (1 391) becomes ports/{mod, find, add,
remove, propagate, list}.rs, one file per refactoring; rename.rs (760)
becomes rename/{mod, scope, warnings, tests}.rs. No function split, no
file over 600 production lines (largest add.rs at 432), every public
path unchanged (crate-root doc pages identical; only private-module
pages relocated). Carved by a range manifest that had to tile the
original byte for byte. Proof: per-binary test counts identical
(vlog_semantic 345 / 17, vlog_refactor 206 / 5, workspace 3 215 / 48),
corpus --stdout byte-identical, and the lucisv check finding lists
byte-identical between this build and the base over the corpus and the
opentitan hw tree - done by the dev and redone from scratch by QA.

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

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-09-02 21:55:55 -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 5051bbdf15 Semantic lints on by default: the index knows who mentions what, and the linter finally asks
TODO section 24, coverage_gaps M7 via topo 2.9-6 and 2.9-4.
unused-signal, undriven-net and multiply-driven shipped off because a
per-file analysis cannot see a signal read or driven from another
file's hierarchy. The index now carries a per-file identifier census -
FileFacts::words, FACTS_FORMAT 12 -> 13, one harvest lifted from the
server's completion candidates and now feeding them back from the store
instead of re-lexing every file at startup (scan -28 percent) - and the
linter gains a MentionOracle: unused-signal and undriven-net say nothing
when the name is mentioned in any other indexed file, the
false-negative-safe direction; multiply-driven shares the gate but never
reads it. The three are on wherever an oracle exists (the editor always,
the CLI when it walks a project) and off for a single file or stdin.
With them, the missing off switch: [lint] select/ignore in lucisv.toml
with CLI flags winning key by key, and lucisv.lint.select/ignore in the
editor.

QA's finding, reworked: the census dropped macro invocations whole, so a
signal named only inside `uvm_info(..., dut.sig) was not silenced; the
harvest now splits macro, directive and attribute words, skipping
double-quoted runs so a "%d" cannot silence a signal named d
project-wide, with workspace-defined macro names filtered out of the
completion table at the reader. Store +16.9 percent corpus / +15.0
percent opentitan, measured.

Corpus unused-signal 52 -> 44 and undriven-net 3 -> 0 with every
silencing hand-checked, nothing added; opentitan - lint-clean under its
own tools - 14 findings, all classified true against the whole repo.
Also: the docs-site rules page gains the empty-item row it lacked.

docs/features/semantic-lints-on/README.md.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-09-02 09:06:08 -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 df85fd3b54 Member completion: a dot means members - item., reg2hw.ctrl., vif.cb., pkg::, and the port map
TODO section 18. Typing a dot used to get the whole-index dump (every
keyword and project word, capped at 512); now the answer after a
separator is exclusively the members of what precedes it, or nothing.
The prefix walk is published from vlog_semantic as MemberSite /
Semantics::member_site / WorkspaceIndex::members_of_chain and the
resolver's own member_of, unit_member, member_in_chain and follow_one
are rewritten to call it - one walk, so the popup cannot list a member
hover would not resolve (pinned structurally). Inherited members ride
the same base chain; this./super./pkg::/cls:: are the same question.
A headless dot inside an instantiation's (...) or #(...) lists the
module's ports or parameters through signature.rs's own list detector
and the Target::Port walk, already-connected ports dropped. Trigger
characters '.' and ':'. Measured cheaper than the dump it replaces
(6-62 us vs 212 us).

QA's finding fixed at the root: the binder had discarded ParamPort.kw
and bound every localparam as Param, so #(. offered prim_fifo_sync's
DepthW. SymbolKind::LocalParam, keyword sticky across continuation
entries as instantiate::params reads it, exported wherever Param is,
'localparam' on the hover card, excluded from the override list only.
FACTS_FORMAT 9 -> 10.

Also carried: TODO sections 19 and 20 (the escaped-identifier and
constraint-body plans) and the topo rows for both lanes.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-09-02 02:05:03 -07:00
lucioandClaude Fable 5 2a2334ef5a Struct members: s.field, reg2hw.ctrl.q and the anonymous aggregates resolve
coverage_gaps H1 + topo 2.9-13 delivered. The in-file gap was one
resolver gate: member_scope now returns any symbol's child scope when it
is a Struct scope, so a typedef, an anonymous struct declarator and an
inline nested field are one rule; fields declare with their own type so
s.hdr.addr hops through a member. Cross-file, struct members export
under the typedef's name, package-nested struct typedefs under their
bare name (the nested-class convention, ambiguity refused), and inline
nested fields - the opentitan register-package shape - under a
synthesized owner.field key carried as the field's type: joined with
'.', not '::', because member_type's last_segment would collapse the
latter to the bare field name and q/d/qe live in every register
package. Anonymous enum variants land in the enclosing scope like
typedef ones. FACTS_FORMAT 8 -> 9; typeDefinition descends into
typedef struct bodies.

Unresolved fell 1203 -> 1162; the corpus store shrank 1.1 percent
(resolved locals encode smaller than the candidates they replaced),
opentitan's register packages grow it 4.3 percent. QA: 28 opentitan
probes, three planted sibling pairs (rxfull/fmtfull, avsetup_rst/
avout_rst, tpm_csb/csb) all correct, zero wrong answers, hover under
0.5 ms.

docs/features/struct-members/README.md; TODO.md section 17.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-09-01 23:53:45 -07:00
lucioandClaude Fable 5 311551f232 Interface semantics: interfaces, modports and clocking blocks become symbols; vif.sig crosses files
coverage_gaps C2/H2, topo 2.9-7 delivered. SymbolKind::{Interface,
Modport, Clocking}; is_instantiable() (Module | Interface) is the one
predicate every 'is this a module' filter reads, pinned in place, so
interfaces stay in the module table, the ghost, the hierarchies and the
refactorings while the card finally says 'interface'. An interface
exports its signals - they ARE its surface - where a module still exports
ports and params only, which is what lets virtual my_if vif; vif.sig
resolve across files. Modport and clocking-internal names bind as
scope-local references (nothing on a miss - a lexical walk would land a
modport port on a file-scope lure); the modport half of bus_if.mp in a
type position is Target::TypeMember, resolved through type_here; a
clocking block carries type_name = its enclosing unit so vif.cb.data
hops through round-2 machinery unchanged. FACTS_FORMAT 7 -> 8.

Unresolved fell 1256 -> 1203 on the corpus, the first movement in three
rounds: the @(cb) / cb.data names that had nothing to bind. Store +1.2
percent. A modport now renames from its type-position use (the refactor
pin flipped at review). QA: 17 opentitan probes, zero wrong answers, all
sub-millisecond; vif.cb.scl_i lands on i2c_if.sv's own signal.

docs/features/interface-semantics/README.md; TODO.md section 16.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-09-01 22:53:27 -07:00
lucioandClaude Fable 5 7ca2508ec7 Member chains and instance heads: cfg.vif.clk, item.hdr.addr, u_sub.port resolve through the index
DV round 2 (TODO section 15 round 2). A chain tail carries spellings -
Target::MemberOf { head, mids } - so in-file it hops declared type to
declared type, and a chain that leaves the file becomes one composed path
Unit::mid::tail that follow_one walks with member_type hops: no deferred
resolution, no ordering assumption, and chain tails post to the index
through the existing contract so hover, references and rename agree.
Def::type_name rides every indexed declaration (FACTS_FORMAT 6 -> 7,
with ReferenceFact base so this.x uses post cross-file); an instance
symbol's type is its module, and modules export ports and parameters -
nets/vars stayed in-file on measurement (+24 percent store, and .port(w)
connections would have resolved to internal nets). Typedef aliases are
chased with a visited guard; a type the workspace declares twice with
different kinds is refused one hop out, the round-1 lesson applied.

The rename truth flipped with it: u_sub.sig IS sub's wire sig and is
renamed alongside it; an unresolvable tail is left alone but no longer
warned about, filed as topo 2.9-20.

Corpus: references 97454 -> 98919, unresolved unchanged at 1256,
store +15.4 percent. QA: zero wrong answers across the attack suite and
15 live opentitan probes.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-09-01 21:35:11 -07:00
lucioandClaude Fable 5 ce2f858e5e Class member access: in_item.user_id resolves, through the handle's type and up its extends chain
DV round 1 (TODO section 15). The tail of head.member gets a reference
when the head is a plain identifier whose declared type (Symbol::type_name,
new) is a class or module: the member is found in that scope, else up the
in-file extends chain, else the workspace's member table chases
WorkspaceIndex::base_of (a subclass-to-base map rebuilt from the existing
inheritance census, no new facts field) - cycle-guarded on both sides and
placed in follow_one so hover, cross-file references and rename cannot
disagree. this.x/super.x misses ride the same loop, delivering topo
2.9-9. An out-of-class method body (task c2::update) sees its class's
members through a stand-in Class scope. FACTS_FORMAT 5 -> 6: the layout is
unchanged but the reference census grew.

Honesty by construction, after QA's one REWORK: a head whose type is
declared in-file as anything without a member scope (typedef, alias,
enum, param) records nothing - a two-state Option had stood in for the
three-state TypeHere question, and a typedef named bus_t could have been
answered by an unrelated class bus_t elsewhere. The fix removed exactly
438 wrong postings from the corpus with unresolved unchanged at 1256.

Hover 7-143 us; opentitan tl_seq_item member 0.12 ms cold, 0.01 ms warm;
store +2.85 percent.

docs/features/class-member-access/README.md.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-09-01 20:17:18 -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 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 651e58bfb3 The design-hierarchy sidebar: codex's feature, integrated
An instance-oriented hierarchy view in the Activity Bar —
lucisv/moduleHierarchy snapshots (schema 2: uri table, flat ranges,
derived ids; 11.6 MB -> 2.3 MB on opentitan) plus
lucisv/moduleHierarchyChanged invalidation, gated on the extension's
initializationOptions. Format 5 carries decl spans, instance
occurrences and client positions for file-scope declarations
(+1.7-1.9 % store), so a snapshot reads no files at all: handler
145-167 -> 17-20 ms settled, a save with the sidebar open 366 ->
141 ms. complete is !scanning && !must_wait, pinned. Owner UI rounds:
no hover preview, all levels collapsed by default with stable ids
across refreshes, and search over a resident flat model (freeze
diagnosed: materialized expanded tree x undebounced double
fuzzyScore x whole-tree clone per keystroke) — prebuilt lowercased
index, bitmask prefilter, top-K counting, 200-row cap with an honest
remainder, single-digit ms over a 120k-entry fixture.
LineIndex::utf16_position unifies the index's and the wire's position
math under a cross-crate agreement test.

Implementation: codex. Integration fixes + owner items: Opus dev.
QA: lead (measurement pass) + Sonnet (SHIP, independent oracles).

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-08-29 03:39:06 -07:00
lucioandClaude Fable 5 1029d2f199 Performance wave Lane A: the rename family reads its fan-out
prepareRename answered F2 by reading every in-scope file (1.6-3.0 s on
opentitan, blocking the loop); it now answers from the open buffer and
the index in 139 ns, with a refusal-by-refusal parity table (7
reproduced, 4 deferred to rename, none lost). rename computes over
rename_sources — declarers, reference postings, open buffers, and,
after QA's HIGH finding gated the round, rung 6: files_spelling over
the index's reference facts (resolved or not, FACTS_FORMAT untouched),
restoring the dangling-new-name capture refusal the first five rungs
lost; the old name needs no rung and the argument is written and
pinned, QA's shadowing hunt included. 3.47 s -> 105 ms at a 7-file
fan-out, rung cost 852 us worst-case, byte-parity swept at four real
cursors and 564 offsets, ambiguity escaping to the whole scope.
willRenameFiles rides IncludeGraph::includers(): 249 ms -> 14 ms over
331 includers of 3 976 files. Accepted residue, documented: files
whose only mention of the name is inside opaque macro tokens lose one
warning flavour; the FileFacts macro census is filed as the real fix.

Dev Opus + QA Sonnet (REWORK-gate, fix, SHIP on re-verify) in a
dedicated worktree. Lead-reviewed and merged.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-08-29 00:11:13 -07:00
lucioandClaude Fable 5 172a034c67 The startup scan answers requests as it goes
ci / checks (push) Successful in 50s
ci / corpus (push) Successful in 21s
A request sent right after initialized waited out the whole startup
scan — 780 ms cold, 287 ms warm over 200 files, against 26-64 us once
the scan was done. The scan is now a value (Scan: begin/step/publish/
finish; rebuild_index_with is the same three-line loop, so one-shot
and interleaved are structurally the same code and fingerprint
identically), fed to the live index with one WorkspaceIndex::absorb
per drain — per-file merging measured quadratic, 11.7 s over 800
files — and the message queue drains between files: the first hover of
a session answers in 15.5 ms cold / 12.8 ms warm against the index so
far, open file first, scan totals inside noise. Order contract kept:
only the startup scan answers mid-way (must_wait holds requests queued
behind any rescan), scans under 64 files stay one-shot (a count, not a
clock), mid-scan rescan requests coalesce into exactly one follow-up,
shutdown stops the scan where it stands. All three tables publish
together. QA pinned the INTERLEAVE_ABOVE boundary, the absorb
duplicate-path edge and the mid-scan didOpen double-publish; the whole
pre-existing suite passes unmodified, stable over repeated runs.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-08-28 20:20:20 -07:00
lucioandClaude Fable 5 20567e1a7f The index carries every declaration's line, and hover stops re-reading files
ci / checks (push) Successful in 40s
ci / corpus (push) Successful in 18s
The owner's first-level cache, realized on the carrier the index
already had: DeclLines (name line + detail line) on every Decl/Def,
computed at index time from the LineIndex the analysis already holds —
tens of KB for 20k modules, FACTS_FORMAT 3->4, old stores discarded
whole. A closed file's hover heading now costs zero I/O (it survives
the file being deleted), and the snippet's one remaining read is
served from a bounded FileView LRU (4 entries / 8 MiB, newest kept,
dropped on set_document/close/update_one/rebuild): repeat hovers into
a 12 MB file go 5.8 ms -> ~1 us, cross-file hover means 40/157 us ->
4.7/12.9 us. Ports ride the same member entries, so their lines came
free. Stale-disk edits leave heading and snippet stale together, the
spells_exactly guard still omits rather than lies, and QA pinned the
pair. Measured and filed, not fixed here: the first request of a
session waits 287-780 ms behind the startup scan (handshake for the
next round).

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-08-28 18:04:38 -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 cf32e92e58 A rescan reuses what open buffers already analyzed
ci / checks (push) Successful in 46s
ci / corpus (push) Successful in 21s
A scope-widening didOpen re-parsed every open buffer's text twice —
once for its index facts, once for its completion words — 210 ms of a
223 ms rescan for one 1.4 MB top.sv. FileFacts::of and words_in each
split so their post-parse half is callable on a finished analysis
(facts_from_analysis, words_of_tokens; one implementation per path, so
the routes cannot drift), and collect_sources hands the index and
candidates builds each open buffer's held analysis instead of its
text, on the whole-rebuild path and didSave's. ~228 ms -> ~23 ms.
Equivalence pinned: encoded facts and fingerprints byte-identical
between the two routes over the corpus and 16 crafted non-corpus
shapes; unsaved-edit, didClose-revert, size-cap and large-file
threshold boundaries tested both directions. IndexEvent::Analyzed
keeps "from cache" meaning the persistent store.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-08-28 15:28:27 -07:00
lucioandClaude Opus 5 d94f9e3de0 Non-ANSI ports carry where their declaration is completed
A port declared the old way is one symbol named in the module header
and finished in the body by `input signed [31:0] data_in;`. The binder
already merged the two; what was missing was a record of *where* the
declaration is completed, so everything reading the symbol saw only
the header's bare `data_in,`.

`Symbol` and the index's `Def` gain `detail_span`, set by the binder
when a body port declaration resolves to a port already declared in
that scope — first writer wins, so a header naming a port twice stays
deterministic and is the linter's to complain about. Old-style task
and function arguments take the same path: the binder performs the
same merge for them, so they are not special-cased.

The persisted facts record grows two numbers per declaration, written
unconditionally so the stream stays flat. `FACTS_FORMAT` moves 2 → 3
because a store written before this cannot be read after it: only the
last declaration in a record is short enough to fail `done()`, and
every earlier one would be read field-shifted by two — a cache handing
back wrong spans, which is the shape the safety invariants exist to
catch. A store from the old format is now discarded whole.

Also: `Semantics::symbols_named`, a name-sorted side table of symbol
ids searched with two `partition_point`s, so looking a name up is a
binary search instead of a walk of every symbol. Stable-sorted, so
symbols sharing a name keep declaration order and the lookup is an
identity against the scan it replaces. A side table rather than a map
keyed by name, because `Semantics` is cloned per document and need not
hold a second copy of every name it already has.

Co-Authored-By: Claude Opus 5 <[email protected]>
2026-08-28 03:15:58 -07:00
lucioandClaude Fable 5 b2d778eb8d Indexed references: postings replace the per-request refactor walk
textDocument/references now reads declaration-to-occurrence postings
merged in WorkspaceIndex from compact per-file reference facts, with
open buffers overlaying live semantics — 0.062 ms/request over 820
files vs 21.7 ms for the old Workspace::sources() walk (~350x). The
walk stays as rename's engine and the equivalence oracle in tests.
FACTS_FORMAT 1->2 discards v1 caches whole. Cursor lookups
(symbol_at/reference_at/token_at) and macro-define lookup move to
binary-searched sorted tables; include definition inspects only the
cursor's line. Ambiguity refusals preserved throughout.

External dev: codex. Lead-reviewed, gates re-run, probe reproduced.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-08-27 21:36:01 -07:00
lucioandClaude Fable 5 e4b1f55c12 Persistent index cache: a half-indexed workarea resumes where it stopped
ci / checks (push) Failing after 8s
ci / corpus (push) Failing after 5s
Owner-requested round. Every parsed file's FileFacts record is written
through to an index-cache store (append per file, atomic compaction at
scan end — a crash loses at most the file in flight), keyed by a
content hash that is the whole key: no mtime fast path, by measured
argument (6 ms of a 181 ms warm scan, and unsound against save-time
write-through). On reopen, hits skip parsing and the resume is
visible — cached: vs indexing: log lines, the bar counting through
hits, and an end message saying how many came from cache. Warm rescan
322 to 179 ms release, 1.5 s to 0.76 s debug; 910 KB store for the
860-file corpus. Location: lucisv.index.cachePath > the extension's
context.storageUri via initializationOptions (the one extension.js
change) > the OS cache dir keyed by workspace identity > nowhere;
lucisv.index.persist (default on) gates both directions immediately.

The cache is a performance artifact, never a correctness input, and
after the fix round that promise is total against everything but
intentional forgery — which the threat model now formally excludes
(same-user disk; a keyed MAC would be theater): a per-record checksum
drops every corrupt-but-parseable line (poisoned and reforged shapes
both pinned so the checksum is never mistaken for a MAC), first-writer
initialization is a create_new claim with structural 100/100 survival,
and a torn multi-byte tail costs exactly the torn record (0 of 583
offsets lose more). Old-format stores discard wholesale. Load==fresh
fingerprint equality swept over the corpus.

45 tests added across the main and fix rounds (dev 33+2, QA 9+3, one
QA test-construction bug self-caught), 2 ignored probes.

docs/features/index-persistence/README.md

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-08-27 16:33:52 -07:00
lucioandClaude Fable 5 5e4aa7bd6f Incremental indexing + the edge tables: one file changed, one file merged
Owner-requested round. WorkspaceIndex::update_file/remove_file replace
one file's contribution without reading or parsing anything else;
Server::reindex_one takes the fast path for a didSave of one held file
or a one-file watcher event (33 ms vs 1.5 s on the corpus, 45x), with
everything else — settings, scope, filelist, multi-file events —
keeping the full rebuild, pinned by a trigger-table test. FileIds stay
sorted positions by deliberate deviation: renumbering through the one
merge both finish and update_file end in makes build(W) byte-identical
to build(W minus F).update_file(F) — fingerprint equality, attacked by
QA across long interleaved sequences, disambiguation flips, define
shadowing and the ghost hunt (the affected-keys union reads old and
new records both). The per-file FileFacts the index retains are the
documented memory cost (~1.4 MB on the corpus).

The two oldest filed Handshakes land: instantiation and inheritance
edge tables, built by the byte-for-byte moved census walks, turn
codeLens counts (92 ms to 0.26 ms), incomingCalls and typeHierarchy
subtypes into lookups — census policies pinned unchanged at both the
consumers and now the source. Counts are as of the index, not of
unsaved keystrokes: the freshness delta is documented and pinned from
both sides. Saves no longer raise a progress bar; generation and lens
refresh still ride. Round 18's three inherited scope obligations are
pinned permanent.

36 tests added (dev 27 + QA 9). Left open, filed: wholesale republish,
Candidates re-derivation cost, incremental removal vs include
re-resolution.

docs/features/incremental-index/README.md

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-08-27 14:35:27 -07:00