eadee02c37ec3da3f4dcc367bb2b8787826fd8ff
54
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
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.
Co-Authored-By: Claude Fable 5.1 <[email protected]> |
||
|
|
e6eaf53c35 |
Organize imports: unused imports removed, duplicates merged, the run sorted; the unused-import rule; source.organizeImports
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]> |
||
|
|
aa479cf701 |
Convert ports to ANSI: a Verilog-2001 header merged with its body declarations, and a verifier that never drops a comment or an attribute
TODO §51 (docs/features/ansi-conversion), the second §8 refactoring. `vlog_refactor::convert_to_ansi` (ports/ansi.rs, ports/merge.rs): for a `PortList::NonAnsi` module, each header name gains its direction, net or variable type, signing and packed dims from the body declarations that describe it, merged per IEEE 1800 §23.2.2.2 (`output b; reg [7:0] b;` → `output reg [7:0] b`), as insertions around the untouched name so no reference anchor moves; the absorbed declarations are deleted with their comments carried onto the ports. Twenty-three refusals, each a sentence (port expressions, disagreeing ranges, initialisers, directives, a comment that would have to move into a one-line list, an attributed declaration). Code action `lucisv: convert ports to ANSI (N ports)` and command `lucisv.convertToAnsi`. Review rework (QA's two HIGHs, invariant 4): the verifier's comment rule is now `never_dropped` over comments and attribute instances alike — `has ≥ had`, `wrote ≤ gone` unless the text is the one generated placeholder, `has == had − gone + wrote` — with masked-corruption attack tests, re-attacked by QA (30-plus pairs, a neutering pass). Neither the corpus nor opentitan holds a non-ANSI module; acceptance is by round trip (ANSI → 2001 → ANSI, same ports/types in order) over five corpus modules and 290 of 291 opentitan candidates (the one failure is kmac_reduced_tb.sv's pre-existing trailing-comma parse error). 0 of 854 corpus files differ from 0.45.0. Co-Authored-By: Claude Fable 5.1 <[email protected]> |
||
|
|
d9ed2c447a |
Expand .*: a wildcard connection written out as the named connections it stands for
TODO §50 (docs/features/expand-wildcard), the first §8 refactoring. `vlog_refactor::expand_wildcard` (ports/expand.rs): at the cursor's instantiation, every port not explicitly connected becomes `.p(p)` when a same-named net, variable or port is declared in the instance's scope (generate block → parents → module; IEEE 1800 §23.3.2.4 read strictly — a parameter, genvar, type, instance or tf argument does not bind) and `.p()` plus a warning otherwise, in declaration order, replacing the `.*` element through the ports engine's splice and verifier. Refusals: no `.*`, two, a positional list, a `bind` directive, a multi-instance statement, a parse diagnostic in either file, compiler directives in either list, an unknown or twice-declared module, and a `.*` that binds nothing. Server: the lazy code action `lucisv: expand .* (N connections)` and the command `lucisv.expandWildcard`; a title-rewrite bug in the lazy offer path (`counted`) fixed on the way. Corpus: 11 of 21 sites expand (the rest refused honestly); opentitan `hw/`: 9 of 66 (50 are `bind`), each verified, two surfacing real FPV-wrapper drift. 0 of 854 corpus files differ. Dev-dependency vlog_refactor → vlog_formatter (tests). Co-Authored-By: Claude Fable 5.1 <[email protected]> |
||
|
|
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]>
|
||
|
|
9ef1058059 |
Package re-exports as real references: bound halves, RX facts, the member walk through re-exports
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]> |
||
|
|
8145a67be6 |
The didOpen delay: undriven-net asks the workspace census last, not once per declaration
TODO §46 (docs/features/didopen-cost). Closes take-3 finding §8.4 (§44b). Measured first: on opentitan the open of a 42 192-line file cost 1 745 ms, of which the lint pass was 1 654 ms and `undriven-net` alone 1 608 ms — the rule asked `WorkspaceIndex::files_mentioning` (a walk over all 3 976 indexed files) once per declaration, ahead of the local guards that silence almost all of them. Six lines reordered so the oracle is asked last, as `unused-signal` always did: same findings, same order (pinned by a counting-oracle unit test that fails on a revert, and shown byte-identical against 0.43.0 over a crafted workspace and four opentitan IPs). didOpen → next request: 1 742 → 117 ms on the largest file, 51–95 → 5–8 ms on typical IPs, the same on every keystroke flush. No debounce added; three wire-level pins with a debug-build bound. Docs: take-3 §8.4 annotated, docs/perf/README.md entry. Co-Authored-By: Claude Fable 5.1 <[email protected]> |
||
|
|
4b2dad87fe |
One lint-configuration contract for project and editor: the server picks the editor's selection when set, else the project's, and logs rejected project entries once
TODO §42 (docs/features/lint-config-contract). Closes topo §2.9-28 and repository-analysis finding 2. `enabled_rules(settings, project, has_oracle)`: rung 2 is `lucisv.lint.select` when non-empty else `[lint] select`, rung 5 the same for `ignore` — the CLI's `pick` applied to the editor — so one buffer linted two ways is linted the same way (asserted equal over the wire for three configurations). `lint::project`: `ProjectLint` read from the `Discovery` result `configured` already computes (no extra read per pass); an unknown rule name in a project list is dropped and said rather than silently emptying the selection. `ConfigProblems`/`ProblemLog`: rejected `[lint.<rule>]` options, unknown names and bad `[lint] waivers` lines are logged once per (config file, entry) in `lucisv check`'s wording, re-armed when the config's lint content changes; the buffer keeps linting with the entry dropped. Docs applied: README, the linter guide, configuration.md, the analysis, topo (28 struck; 29 filed for the editor-side unknown-name silence), site rebuilt. Co-Authored-By: Claude Fable 5.1 <[email protected]> |
||
|
|
8a92e79fc0 |
External waiver files: Verible's format from lucisv.toml, --waiver-file and the editor, union with inline waivers, honoured by quick fixes
TODO §39 (docs/features/waiver-files). Closes §4's last waiver item. `vlog_linter::waiver_file`: `waive --rule=<rule> [--line=N|N-M] [--location=<pattern>]`, `#` comments, BOM tolerated; `--location` is the `--exclude` matcher (`lucisv_core::walk::is_excluded`, a new vlog_linter → lucisv_core edge), a regex-looking pattern refused by name. `lint_with(ctx, rules, external)` applies inline and external waivers as a union and reports which external directives fired; `lucisv check` reports the dead ones under `unused-waiver` at the waiver file's line after the whole run. Discovery: `[lint] waivers` (relative to the toml), `--waiver-file` (repeatable), `lucisv.lint.waivers` (first workspace root); bad lines fail the CLI run with file:line and are dropped and logged once by the server. Review rework (QA's HIGH): the server's code-action path now lints with the buffer's `LintRun` — its enabled rules and external waivers — so a quick fix is never offered, nor applied by fix-on-save, for a waived finding. Docs: Waivers sections in README and the linter guide, cli and configuration rows, topo edge, site rebuilt. Co-Authored-By: Claude Fable 5.1 <[email protected]> |
||
|
|
9604753b6c |
Lazy codeAction/resolve for the port refactorings, definitions from the index, the inlayHint zero ruled correct
TODO §37 (docs/features/lazy-code-action). Closes the four §10 lines.
37.1 For a client whose resolveSupport lists "edit", the port actions are
offered over the buffer plus the instantiated module's declaration alone
(`ports::offers`, `offer_sources`), carrying `data {uri, position,
title}` and no edit; `codeAction/resolve` (`ports::resolve`) re-runs the
eager path and returns the matching action, matched on the title minus
its count phrase, erroring when the action is gone or the buffer is on
the large-file path. Clients without resolve support get today's eager
answer. Offer flat at ~55 µs from a 3- to a 128-file fan-out where the
eager path was linear; ~4.5 ms vs ~77 ms over the wire on opentitan's
128-file case.
37.2 The inlayHint zero at the default scope is correct: the hinted
module (`pins_if`) is declared outside what the scope reaches, and
definition/hover answer nothing there either. Pinned, not changed.
37.3 `locate::definition_location`: an index-only Location for a closed
file's file-scope declaration from its recorded `DeclPositions`; nav and
workspace symbols routed through it (0.4 µs vs 28 µs). Open buffers keep
the file-read path.
Co-Authored-By: Claude Fable 5.1 <[email protected]>
|
||
|
|
8adb6c8ac1 |
Linter expansion, wave 3: the remaining nineteen Verible rules, forbidden-macro, void-cast's forbidden calls, and the e2e options case
TODO section 35 (54 -> 73 rules: every rule in Verible's published list but forbid-implicit-declarations). module-begin-block, legacy-generate-region, legacy-genvar-declaration, v2001-generate-begin, explicit-function-lifetime, explicit-task-lifetime (both exempt out-of-body definitions after a census showed 948 of 960 findings were exactly that shape), positive-meaning-parameter-name, suggest-parentheses (safe fix, truth-tabled), unpacked-dimensions-range-ordering, uvm-macro-semicolon, create-object-name-match, numeric-format-string-style, macro-string-concatenation, disable-statement, forbidden-macro, endif-comment (safe fix), forbid-line-continuations, dff-name-style, proper-parameter-declaration. Verible's forbidden-symbol is the source-file name of invalid-system-task-function (read in its rule .cc), so it is that rule's symbols option, nothing fires twice; void-cast gains forbidden_calls. Shared readers: walk_items_scoped, exprs.rs, preproc.rs. A checked-in e2e case drives lucisv.lint.options over the wire. Two rules fire on an error leaf because the parser refuses a module-scope begin/end and a bare generate begin - filed as docs/topo.md 2.9-25. 3 695 tests / 48 binaries; corpus 814/820 byte-identical to 0.38.0; opentitan default-set census 1 053 -> 1 169, the arithmetic balancing to the six default-on additions; timing unchanged. docs/features/linter-expansion-3/README.md. Co-Authored-By: Claude Fable 5 <[email protected]> |
||
|
|
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]>
|
||
|
|
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]>
|
||
|
|
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]>
|
||
|
|
a0c290ccc2 |
Comment slots in shared machinery: an owner for every gap, four fuzzers at zero, and the small-correctness residue
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]> |
||
|
|
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]> |
||
|
|
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]> |
||
|
|
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]>
|
||
|
|
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]>
|
||
|
|
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]> |
||
|
|
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]> |
||
|
|
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]>
|
||
|
|
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]>
|
||
|
|
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]> |
||
|
|
f3b5a9d189 |
Fuzzy completion: clkenq reaches clk_osc_en_q, at VS Code's own floor
Prefix matching below three typed characters, subsequence from three up — the owner's ruling, which is VS Code's own rule. The scope, index-name and word tiers match by case-insensitive subsequence at 3+, ranked prefix-first then by a three-pass greedy-tighten scorer (boundary and contiguity bonuses, gap penalties); module, keyword, template and macro tiers unchanged, and the instantiation ghost's exact-match probe deliberately stays exact. The scan is affordable because every word and unit name carries a 32-bit character mask beside it, written in exactly two places so table and mask cannot desync: a clkenq keystroke rejects 99.6% of opentitan's 100k-word table with one AND each (+0.05 ms); the pathological class is three very common letters (aes +0.8 ms, QA's ena ~3-4 ms answered-in), accepted at lead review as imperceptible in a popup. Responses below the floor are always isIncomplete — a complete two-character answer would be client-filtered and the third keystroke, the one that turns fuzzy on, would never reach the server. QA verified clkenq -> clk_osc_en_q live in a real opentitan buffer (gfr_clk_mux2.sv) and the 2-to-3 transition over the wire; ten adversarial matcher attacks all passed. docs/features/fuzzy-completion/README.md; TODO.md section 13. Co-Authored-By: Claude Fable 5 <[email protected]> |
||
|
|
03a4958294 |
Inline instantiation round 2: the space is the commitment, and every indexed module answers
Two owner rulings from live use. The ghost now fires only after 'name<space>' — aes alone may still be growing into aes_dft, so the typed space is what says the name is finished; an Ident ending at the cursor offers nothing at all. And a module declared in more than one file no longer declines: completion::nearest_definition picks the copy sharing the most leading path components with the asking buffer (a top_earlgrey buffer gets top_earlgrey's ast_dft), then the shallowest, then the lexicographically smallest — the depth term is QA's catch, fixed at review, so a direct sibling beats a deeper subdirectory copy that ties on the prefix. vlog_refactor::module_definition keeps its ambiguity refusal for its own callers. The refusal residue is now the enumerable inline::NoGhost, and QA's sweep proves the ruling: 1131/1131 opentitan module names ghost, zero declines (199 multiply-declared, tb 61 ways), ast_dft and io_osc verified from both tops over the wire, 0.05-0.08 ms per non-matching keystroke. Co-Authored-By: Claude Fable 5 <[email protected]> |
||
|
|
cadb4319e4 |
Inline instantiation: the popup names the module, the ghost writes the rest
Two levels, sized for opentitan. Tier 0 of the completion popup stops planning skeletons (up to 64 file reads + header parses per keystroke) and offers module names alone; once the identifier at the cursor exactly matches an indexed module, textDocument/inlineCompletion ghosts the full instantiation — every parameter, every port, each a tabstop, in-scope signals auto-connected — planned once through the existing header-slice path and the FileView cache. Candidates::has_module is the per-keystroke probe: a case-sensitive binary search whose str-order premise is pinned. lucisv.inlineInstantiation (default on) gates it, independent of inlineTemplates. Measured on opentitan: non-matching keystroke 0.10-0.17 ms warm, ghost 0.6-1.1 ms for aes (14 params/16 ports), 2.5 ms cold for the 112-parameter top_earlgrey; popup module tier reads no files at all. Lead corrections at merge: four doc references to a lucisv/instantiate command that never existed, replaced by the honest gap (topo 2.9-19: no skeleton path for clients without inlineCompletion); extension and nvim README docs delivered. docs/features/inline-instantiation/README.md; TODO.md section 12. Co-Authored-By: Claude Fable 5 <[email protected]> |
||
|
|
40094c4c4e |
lucisv-server --verbose: per-operation timing as a shipped toggle
The hand-patched diagnostic build becomes a feature: --verbose gates the timing lines (request answered / notification handled / HELD behind a rescan / scan and widen lifecycle / flush / reindex_one, the exact wordings of the two diagnostic builds) as LOG messages into the client's output channel; without the flag not one line is sent and the cost is one branch, measured unmeasurable against HEAD. Unknown args exit 2 with usage before the transport opens. The extension gains lucisv.verbose (default off) and its first restart-on-settings machinery: restart.js, one serialized chain reconciling to the last toggle, no client transition outside it — activation and deactivate included — after QA twice caught the alternatives (a mid-start toggle silently rejoining the stale start; deactivate's out-of-chain stop orphaning a spawn). Headless node harness restart_test.js, 44 checks, five mutations caught. Spawn contract amended everywhere it is written: no args required, --verbose optional. Co-Authored-By: Claude Fable 5 <[email protected]> |
||
|
|
61f345aca7 |
Performance wave Lane B: completion hot path, highlight fix, scope default
Completion stops parsing whole declaring files per keystroke: tier 0
slices the module header at its terminating ';' via a whitelist walk
over a bounded lex window, anchored on the index span and re-planning
whole-file on anything unrecognized (non-ANSI included); the module
table replaces a per-keystroke workspace_symbols(""). 53 -> 3.2 ms at
the empty prefix (opentitan wire 63-66 -> 13-15 ms; typing an 11-char
word 201 -> 64 ms), items pinned byte-identical.
documentHighlight answered 0 on any name the file uses but does not
declare (both cursor questions were single-file); nav gains
external_occurrences over the overlay, grouping by the whole defs()
slice, written failing-first and pinned at the two opentitan
positions over the wire.
lucisv.index.scopeDepth default 0 -> 2 (behavior change; CHANGELOG at
release): a dv/tb file now indexes its IP block (21 files / 15 ms)
instead of one file with every cross-file answer empty. Rootless
sessions no longer climb (latent unnamed-tree walk removed).
Dev Opus + QA Sonnet in a dedicated worktree; QA SHIP with one LOW
(pre-existing attribute-instance indexing gap, pinned) and one
recorded asymmetry. Lead-reviewed.
Co-Authored-By: Claude Fable 5 <[email protected]>
|
||
|
|
bf9170a850 |
A scope widen indexes the folders it added, not everything again
Every F12 jump into a new folder didOpen-widened the scope and re-ran a full rescan of all folders accumulated so far, growing with browsing (opentitan, warm: 120-169 ms per jump, ~90 ms of it re-opening and decoding the whole persistent store). widen_of chooses: pure folder adds take a widen scan over only the new files (absorbed into the live index/candidates/includes, open buffers refreshed from held analyses, store handle kept, no compaction); anything else still takes the whole rescan; mid-scan defers to one whole follow-up. Jumps now cost the new folder alone (12-44 ms flat), first definition of a session 99.7 -> 0.9 ms. IncludeGraph stores edges as the filesystem answered them and re-spells on relearn so a newly scoped file lends its spelling to earlier edges. Watcher-coverage narrowing documented: watcher-less clients lose the widen's incidental disk re-read, same staleness class as the save path since 2026-08-27. QA was stopped by the owner mid-gates after its adversarial phases; lead gates run twice, green. Co-Authored-By: Claude Fable 5 <[email protected]> |
||
|
|
172a034c67 |
The startup scan answers requests as it goes
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]> |
||
|
|
20567e1a7f |
The index carries every declaration's line, and hover stops re-reading files
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]> |
||
|
|
cf32e92e58 |
A rescan reuses what open buffers already analyzed
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]> |
||
|
|
a4f23db2c7 |
Typing costs one reanalysis per burst, not one per keystroke
Every `didChange` used to run a full reparse, reanalysis, lint and diagnostics publish. In a 10 000-line buffer that is 31 ms of work per keystroke, nearly all of it thrown away by the next one. The text stays exactly current after every notification — incremental sync is applied immediately, and while a change is pending the buffer the server holds *is* the pending text. Only the analysis is deferred, and it is flushed by the first thing that needs it: the next request, the next non-`didChange` notification, or a 150 ms quiet-period timer in the message loop. Requests therefore see exactly what they saw before; nothing answers from a stale buffer. The invariant this replaces was "one didChange = one set_document = one generation bump". It is now one *flush* = one `set_document` per dirty buffer. The observable consequence is that intermediate diagnostics states are no longer published, which the e2e test pins: what is drawn is always a state the buffer really passed through, there are simply fewer of them. Closing a buffer drops its pending text before the flush rather than after it, so a file closed mid-edit is not analyzed and republished for nobody a line before its squiggles are cleared. Also measures it over the wire, against the shipped binary: a burst of ten keystrokes produces one `publishDiagnostics`, counted at the drain rather than reasoned about. The burst is measured last, because every `wait_for` accepts any publish and an earlier position would let a second one be absorbed by the next row's wait and never counted. Co-Authored-By: Claude Opus 5 <[email protected]> |
||
|
|
bc606dd6bd |
Large-file fast path: 100 MB netlists open in 40 ms
Owner-requested round, the last of the large-workarea wave. Above lucisv.largeFile.threshold (4 MiB default, 0 disables) a buffer opens as a line index and nothing else — no lex, no parse, no semantics, and its path removed from the index sources so nothing describes it by stale disk bytes. Viewport highlighting lexes only the requested window (snap to a line boundary, budget-bounded backward comment scan, imperfection documented); semanticTokens/full answers the spec's cancellation errors because the shipped VS Code binary marks tokens complete on ANY non-error answer and never asks for ranges again — settled by reading the bundle, verified independently by QA, pinned with the client-library citations. Same-file definition/references shipped on measurement (worst 37 ms vs the 150 ms budget); every other handler answers as the empty file by construction; formatting alone says why aloud. Two client facts recorded: VS Code never syncs files over 50 MB, and above 20 MB our viewport tokens are the only color. QA rejected the first cut on the round's true shape — thousands of tokens on one long line went quadratic through per-call UTF-16 conversion (7.86 s to color one 269 KB line). The fix adds a monotonic PositionWalker to convert.rs (restart-on-backwards proven load-bearing by the out-of-order tail-comment shape), adopted at three sites for 546x/759x on the probes — and it fixed ordinary files' semantic tokens too (2.06 s to 232 ms on a one-line buffer), a cost the normal path had always paid. Probes are now normally-running gates with 4.5x margins, walker-vs-per-call equivalence swept over gnarly fixtures and adversarial ping-pong. 51 tests added across both rounds (dev 43+5, QA 6+3, minus overlaps), 2 ignored probes. Completes the owner's large-workarea requests. docs/features/large-file-mode/README.md Co-Authored-By: Claude Fable 5 <[email protected]> |
||
|
|
e4b1f55c12 |
Persistent index cache: a half-indexed workarea resumes where it stopped
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]> |
||
|
|
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]> |
||
|
|
7266b13702 |
Index scope: open-file-first, folder-scoped by default
Owner-requested round. The scope ladder: a filelist still defines the whole project and outranks everything; lucisv.index.scope=workspace restores the walk-the-roots behavior (the same function, not an equal-output one — pinned); the new default walks only the union of folders a buffer has been opened from, each raised lucisv.index.scopeDepth ancestor levels (default 0), clamped at the deepest containing root. Opening a file outside the scope widens it and reindexes through the existing progress/generation machinery; scope grows only along the open axis within a session. Cross-file answers are scope-relative and the docs say so loudly, with the one-line migration in the setting description. The round also closes indexing-ux QA's MEDIUM builder footgun: IndexBuilder::finish now sorts and dedups before assigning FileIds, so no insertion order can reach the result — pinned by a permanent three-order fingerprint test — which makes feeding open files first provably a progress nicety. 151 existing tests swept mechanically (QA sampled 40+ sites: constructor swaps only); lead fixed the one vacuous tail QA found plus two premise/comment hygiene items. 19 tests added. Known deltas documented: a root's .gitignore does not reach a walk starting below it (filed against lucisv_core); rootless depth-0 keeps its flat read; startup index is empty until the first didOpen. docs/features/index-scope/README.md Co-Authored-By: Claude Fable 5 <[email protected]> |
||
|
|
8c8cfc538e |
Indexing UX for large workareas: size cap, counting bar, output log
Owner-requested round. lucisv.index.maxFileSize (default 1 MiB, 0
disables, junk values fall back to the default — misparse must never
un-cap) skips walked files at one fs::metadata call before any read;
open buffers are always served uncapped, a cap change rescans like
exclude does, and the cap reads consistently through every sources()
consumer — documented per consumer, with the write-path warning gap
(a rename silently leaving a capped file stale) filed as a follow-up.
The indexing bar now counts: $/progress reports '137/860 path' with a
monotonic percentage over the post-exclude post-cap denominator,
throttled to ≤1000 reports per rescan with the last file always
reporting. Enabled by vlog_semantic's new IndexBuilder (add_file/
finish) with build() redefined as the loop over the newly-exported
index_order — the FileId ordering rule is now a call, not a comment.
QA proved both production callers order correctly; hardening the
builder against out-of-order future callers is round 18's acceptance
test. lucisv.index.logFiles (default on) streams 'indexing: path' and
cap-skip lines to the editor's Output panel at LOG level; the skip
count survives in the end message when logging is off. Measured
overhead ≈2.6% on the 860-file corpus; 0 corpus files exceed 1 MiB
and the default-capped index is pinned identical to uncapped.
21 tests added + QA's attack set + the lead's human_size boundary fix
('1024.0 KiB' can no longer be printed for a byte short of a MiB).
docs/features/indexing-ux/README.md
Co-Authored-By: Claude Fable 5 <[email protected]>
|
||
|
|
c47b16a65e |
LSP §9c: 3.18 extras — rangesFormatting ships, two honest parkings
textDocument/rangesFormatting: the engine took multi-range LineRanges
natively (this is literally the CLI's --lines a-b,c-d call), so the
server adapter is map(lines_of) around it and the verified
all-or-nothing contract rides through whole. range_formatting is now
DEFINED as the one-element case, making refusal equality structural;
lines_of extracted with its own test, plus a latent debug-overflow fix
(end.line + 1 at u32::MAX -> saturating, proven by deliberate
breakage). The capability widens documentRangeFormattingProvider from
true to {rangesSupport: true} only for clients that asked (read from
the raw initialize params; lsp-types 0.97 spells neither half) — every
pre-round client sees a byte-identical initialize result, proven on
the wire. The round's discovery: vscode-languageclient 9.0.1 has been
sending rangesSupport and gating its multi-range provider on our
answer all along — the bare boolean was turning the feature off.
SnippetTextEdit and workspace/textDocumentContent are parked with
evidence: absent from lsp-types 0.97 and from the pinned client's
node_modules (a snippet edit sent today would write literal ${1:...}
into the buffer), and the thin extension deliberately has no content
provider. Each parking carries a one-grep re-check trigger. The
whole-document reply shape is kept: splitting per-range would claim
byte ownership the engine never verified.
24 tests added; QA re-ran every evidence grep, verified the client
citations against formatting.js, and closed with zero findings. This
completes TODO.md §9c and the LSP 3.18 audit's feature work.
docs/features/lsp-318-extras/README.md
Co-Authored-By: Claude Fable 5 <[email protected]>
|
||
|
|
17fb2129db |
LSP §9c: didChangeWorkspaceFolders + server-pull configuration
Folders: workspace.workspaceFolders advertised with change notifications; added/removed folders adjust the root set through one 8-line Workspace::change_roots (removals first, dedup, did-it-move bool) and one reindex per moving notification — progress bar, code- lens refresh and diagnostics generation all ride along, pinned. Open buffers in a removed folder keep today's rootless conventions with no new code. The source watcher's base-less glob needs no re- registration; the absolute-path filelist watcher re-registers through the same before/after comparison the settings push already ran. Configuration: clients advertising workspace.configuration get one pull at startup and one per empty didChangeConfiguration; the answer funnels through the same parser and applier as the push, so the two doors cannot drift, and every malformed answer shape lands on defaults, silently. The outstanding-request routing refactored to one Pending enum map — applyEdit's shipped behavior re-proven under three-way out-of-order interleaving. Push-with-payload stays the unchanged legacy path. 38 tests added (dev 27 + QA 11, closing every claim that lacked one: roots.first() reordering, last-root-removed totality, double pulls, stale answers, the pull-answer-moves-the-filelist chain, rootless- gains-first-folder). QA's F1 — a subfolder added as its own root is its own root, outside the parent's exclude — accepted as the per-root model and documented in Assumptions. docs/features/folders-and-config/README.md Co-Authored-By: Claude Fable 5 <[email protected]> |
||
|
|
33d2f2814f |
LSP §9c: workspace file operations — renames rewrite includes
workspace/willRenameFiles rewrites every `include whose RESOLVED target is a renamed file — never a name match — sweeping sources() so unopened files count and open buffers contribute unsaved text. Rewrites preserve the include's form where the new location allows (bare stays bare in-dir; otherwise the shortest suffix that resolves under the rungs that form uses; ../ last; absolute stays absolute), a still-resolving include gets no edit, and an unrewritable one is left untouched with a warning rather than given an invented path. Directory renames ride the same prefix mapping for free, and the mirror case — the including file itself moving breaks its own-dir rung — ships with the same machinery. didRenameFiles/didDeleteFiles nudge the index through the watcher's own predicate. Three checks guard the write path: the edit range is the path token minus delimiters by construction; the rewritten line re-scans and re-lexes to exactly one include of the same form; and the rewritten path must resolve_as_if to exactly the new location against the post-rename filesystem — with every edit addressed to the PRE-rename uri, the spec detail a client silently drops edits over, pinned on the wire by QA. QA's corpus probe (a real ibex header, 87 real includers) caught the round's one real bug — unnormalized includer paths turning same-directory renames into false warnings — fixed with one normalize. Batch renames do not compound; recorded as a documented choice bounded by the safety net. 42 tests added (dev 33 + QA 9). verify.rs untouched. docs/features/file-operations/README.md Co-Authored-By: Claude Fable 5 <[email protected]> |
||
|
|
203e9b1a4f |
LSP §9c: type hierarchy over extends
textDocument/prepareTypeHierarchy + typeHierarchy/supertypes/subtypes for SystemVerilog classes. Supertypes is one computed offset into the existing resolution machinery — the overlay promotion made cross-file bare class names answerable, and the offset is the LAST byte of the extends name span so pkg::base lands in the tail's reference, never the package's. Subtypes is a workspace census on the callers_of_each pattern (one sources() pass, prefilter, deterministic sort), matching the base name as written — 0 of the corpus's 270 extends clauses are qualified, and the asymmetry with supertypes is documented and pinned from both directions, including the same-name/different-file consequence. Ambiguous bases answer every declaration, like definition. Modules stay on callHierarchy by scope ruling. lsp-types 0.97 has no server-side typeHierarchyProvider field, so initialize_value() inserts the one key into the serialized result — QA's strip-and-compare test proves every other key survives with identical values. QA also traced the parser to show the degenerate extends spans the code guards against cannot be constructed, corrected two README figures the lead applied (the 309 extends count did not reproduce; 270 does), and pinned the generate-block walk gap as a scoped choice. Interface classes stay blocked on the parser, pinned. 45 tests added (dev 33 + QA 12), including the real ibex UVM chain and a 10-deep expansion. The inheritance-edge index want is filed beside the instantiation-edge Handshake as one future round. docs/features/type-hierarchy/README.md Co-Authored-By: Claude Fable 5 <[email protected]> |
||
|
|
3bc61f9eab |
LSP §9c: textDocument/onTypeFormatting — two triggers, one engine
';' range-formats exactly the finished statement's line through the existing verified all-or-nothing engine — no new formatting authority, gated on one lexer fact (the token ending at the offset is a real ';', so string/comment/macro semicolons decline). '\n' re-indents only the line the newline opened, via a token-stream nesting model whose edit is confined by construction to that line's leading whitespace — a model bug can be a wrong indent, never a moved byte. The path never speaks: no popups on refusal (it fires per keystroke), and the config warning is deliberately not raised here — its dedup re-arms on the didChange every keystroke produces, so it would fire per character; pinned in both directions (silent on keystrokes, still warning on requests). The nesting model was derived against the formatter itself: a corpus anchor test (77,528 lines answered, 67.9% coverage floor, 0 disagreements) forced nine of its ten rules and caught a real unconditional-pop bug mid-round. The anchor stays a normally-running test by lead ruling — it is the correctness gate over the one piece of formatting logic outside the verified engine. 49 tests added (dev 43 + QA 6: CRLF confinement, mixed tab/space, macro-body and EOF semicolons, format-off fence riding through, whole-file ifdef). verify.rs untouched; formatter suites untouched and green. docs/features/on-type-formatting/README.md Co-Authored-By: Claude Fable 5 <[email protected]> |
||
|
|
01c76067e8 |
LSP §9c: textDocument/codeLens — instantiation counts that jump
One lens per module and interface declaration: 'no/1/N instantiations', counting instantiation sites workspace-wide through the one census the server has — hierarchy.rs's walk, refactored so the batch is the primitive (callers_of_each over one sources() pass; incoming is now a one-element batch, behavior byte-identical, amortization pinned by a corpus ratio test that fails if it goes linear). Clicking runs lucisv.showInstantiations through the existing executeCommand path, answering the site locations and pushing window/showDocument (first site, takeFocus, selection) when the client can take it; the zero-count lens is display-only. workspace/codeLens/refresh rides each reindex after the progress bar comes down, capability-gated, once per rescan. 42 tests added (dev 33 + QA 9): count agreement with incomingCalls, the absolute census policies pinned at the lens layer (multi-instance statements are one site, textual recursion, both ifdef arms, name collisions), one-sources()-read-per-request, showDocument/applyEdit response independence, and grep-derived ground truth on a real corpus file. The instantiation-edge-table request is now a concrete vlog_semantic Handshake — two features pay the walk it would delete. docs/features/code-lens/README.md Co-Authored-By: Claude Fable 5 <[email protected]> |
||
|
|
34938fbcf1 |
LSP §9c: textDocument/linkedEditingRange
SystemVerilog's closing labels now edit as one: module/interface, package, class, function, task, clocking, generate and statement blocks, fork/join, and the prefix-labeled b : begin ... end : b form — every pair read off the AST's own end_label_span fields (the parser already recorded both halves on one node; no parser change). A pair is offered only when both halves exist and hold identical plain-identifier text: mismatched labels, absent labels, and escaped identifiers all answer null rather than link something a keystroke would corrupt. The response carries the SV word pattern (with $), whose anchoring QA verified against VS Code's linked-editing source — full-string validation, anchors correct. 33 tests added (dev 25 + QA 8): exact-range decoding through the server's own position converter (never the colon), the both-labels and stray-second-end tolerant-parse shapes, identically-named nested blocks pinned by exact ranges, and an 83k-offset corpus sweep asserting totality and the identical-text/non-overlap invariants over real labeled RTL. program/property/sequence/covergroup are filed as parser Handshake wants. docs/features/linked-editing/README.md Co-Authored-By: Claude Fable 5 <[email protected]> |
||
|
|
5d0725c158 |
LSP §9c: textDocument/typeDefinition
From a name to its type's declaration: variable to typedef/enum/struct, handle to class, instance name to module, interface signal to interface. The whole feature is one redirection — find where the declaration wrote its type name (the same window vlog_semantic's binder searched), then run nav::definition there — so cross-file resolution, ambiguity, and position conversion are F12's, unchanged. One hop on typedef aliases, never a chain; built-ins answer empty. One stopgap with a three-condition fence: vlog_semantic reports an unqualified lexical miss as NotFound — or InheritedCandidate inside any extending class, the UVM norm — without consulting the workspace overlay, so indexed_type asks the index directly for file-scope Module/Class/Typedef declarations only, never for a qualified member (the lead-added guard: a pkg:: qualifier must not be discarded into a bare-name sweep — proven by deliberate breakage). The Handshake filed in the README covers promoting both miss spellings so the whole fallback deletes when vlog_semantic lands it. Also filed: the parser gap where an ANSI header's direction-less first port fails to parse. QA rejected the first cut — the corpus sweep found the InheritedCandidate miss live on ibex DV files — and the fix round answered with a one-pattern widening whose safety was derived from three independent vlog_semantic citations. 45 unit tests + 1 e2e; the corpus spot-check now asserts two real UVM-shaped jumps positively. docs/features/type-definition/README.md Co-Authored-By: Claude Fable 5 <[email protected]> |
||
|
|
6523c604bb |
LSP §9b: $/cancelRequest — burst reads, stateless cancellation
run() now reads in bursts: one blocking receive plus everything already queued behind it, processed strictly in arrival order. A request whose $/cancelRequest sits in the same burst is answered RequestCancelled (-32800) without being dispatched; cancels naming anything else — an already-answered request, one never received, a server-initiated id — are dropped on the spot, so cancellation holds no state that can leak or misfire. shutdown is honoured before the cancel set is consulted, and a didChange queued ahead of a request is still applied first. The enabling change: lsp-server 0.10's stdio transport uses rendezvous channels, so a client's backlog never queues on connection.receiver — it sits invisible in the OS pipe (dev measured 0/5 cancels honoured under the original drain design). A single forwarder thread moves messages onto an unbounded queue, stopping at shutdown because handle_shutdown reads the following exit off the connection itself. First thread in this server; QA re-derived the hand-off from the vendored lsp-server source and found no steal or deadlock window. 15 tests added (dev 11 + QA 4), covering the full cancel matrix (both id types, double cancel, orphan drop with id-reuse proof, malformed params), the forwarder against a real Connection, and an e2e flood of 20 requests with cancels asserting schedule-independent properties — green across twelve consecutive runs. Completes TODO.md §9b. docs/features/cancel-request/README.md Co-Authored-By: Claude Fable 5 <[email protected]> |
||
|
|
e165c37a3a |
LSP §9b: work-done progress on workspace rescans
Every index rescan — the startup build included — now puts up a real progress bar for clients that advertise window.workDoneProgress: window/workDoneProgress/create with a fresh lucisv-index-N token, a Begin titled 'Indexing Verilog workspace' (cancellable: false — nothing in a single-threaded server can cancel; no percentage — the rescan is one opaque call and an invented number would be a lie), the scan, then End naming the indexed file count. The Option<ProgressToken> returned by begin_indexing IS the capability gate, so an unpaired or uninvited bar is structurally impossible; create answers ride the existing ignored-response path with no risk to applyEdit routing (one shared id counter). The startup build got the bar because initialize_finish completes before Server::new — the same fact watcher registration already relied on. 14 tests added (dev 10 + QA 4: watcher-after-bar ordering, both response-interleaving directions, capability-off on the watcher/config paths, rootless zero-count startup), all decoding real wire JSON for the sequence, token type, title, and message. docs/features/work-done-progress/README.md Co-Authored-By: Claude Fable 5 <[email protected]> |
||
|
|
00c03eccf9 |
LSP §9b: semantic tokens range + full/delta
tokens.rs is now one tokenizer behind three pure steps — absolute() classifies and splits, within() filters by overlap, encode() delta- encodes — so textDocument/semanticTokens/range and /full share one implementation and cannot drift; QA proved the refactor byte-identical to the old encoder over a 41k-token corpus file against the pre-change binary. Range answers are self-contained (overlapping tokens kept whole, re-encoded from the document start) and carry no resultId — a delta never diffs against a partial view. /full/delta remembers each open buffer's last answer under a per-answer id (dropped on didClose; stale or foreign ids answer full) and diffs by common-prefix/suffix trim to a single edit, the suffix counted over what the prefix left — the classic overlap trap, deliberately broken by dev and QA separately and caught by the suite both times. Edit indices are wire-array u32 positions (5 per token), pinned. No token request touches the pull-diagnostics generation. 38 tests added (dev 29 + QA 9), including two independently written edit appliers cross-checked over 200 random pairs and two differently seeded randomized sweeps through the real tokenizer. docs/features/semantic-tokens-delta/README.md Co-Authored-By: Claude Fable 5 <[email protected]> |