baf0bf16f02ad84b2c780da4f732a96bbcd99be2
31
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
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]> |
||
|
|
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]> |
||
|
|
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]> |
||
|
|
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]>
|
||
|
|
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]> |
||
|
|
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]> |
||
|
|
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]> |
||
|
|
d4eb8f48ff |
The stack fits the nesting limit by construction, on every thread
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]> |
||
|
|
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]> |
||
|
|
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]> |
||
|
|
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]> |
||
|
|
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]>
|
||
|
|
839a28ec8d |
vlog_parser: a direction-less first ANSI port parses
IEEE 1800 §23.2.2.2 allows an ANSI header's first port to carry no
direction — the normal spelling for interface ports — but
parse_port_list classified any leading identifier as a non-ANSI list
and errored on what followed. One clause fixes it: a leading Ident is
ANSI when the parser's existing type-then-name lookahead
(at_typed_declarator, which already walks pkg:: chains, #() overrides
and packed dims) or the new 4-token modport lookahead (ident.ident
ident) says so; the complement is exactly the old non-ANSI list, and
macro-led lists never enter the clause. bus_if.mp was a second,
independent gap (it parsed in no position before) and is glued into
DataType::name the way pkg::t already was. No AST change — the new
ports are AnsiPort { dir: None }, the shape later ports always had.
Two match-widenings ride along: bind_data_type and type_def's
type_span read the pre-dot half as the type, and the modport half is
bindable by nothing — pinned for rename by QA.
The safety case, established twice (dev, then QA independently via a
worktree build): corpus 813/820 both sides, TSVs byte-identical, and
all 820 formatted outputs SHA-256-identical across the change; zero
snapshot churn; verify.rs untouched. QA's boundary AST-diff harness
(~20 shapes at the classification edge) and a 50-file
direction-stripping fuzz sweep found no misfire. The
previously-blocked fixtures flipped to first-port order; instantiate
now plans interface-typed port lists instead of refusing. The two
remaining unsupported shapes (generic interface ports, virtual
modport declarations) are pinned by a lead-added test so a future
round changes them on purpose.
24 tests added (dev 21 + QA 2 + lead 1).
docs/features/ansi-first-port/README.md
Co-Authored-By: Claude Fable 5 <[email protected]>
|
||
|
|
0e740d77ec |
vlog_semantic: type-position misses reach the workspace overlay
Delivers the Handshake docs/features/type-definition/README.md filed: an unqualified lexical miss written where a TYPE goes — bus_if bus;, my_cls h;, a cross-file typedef — now carries its bare name to the workspace overlay (last, so imports still win), in both spellings: ExternalCandidate, and InheritedCandidate inside extending classes, whose base and count (7,841, bit-identical) are untouched. The mechanism is a new Target::Type emitted only by bind_data_type's unqualified arm; value-position identifiers, disable labels and redeclarations keep their pre-round Target::Lexical behavior — NotFound stays NotFound, and rename keeps refusing them. That value/type split is the round's story: QA rejected the first cut with a kept repro proving a value-position typo could rename an unrelated same-named module cross-file (write-by-coincidence, pre-round refused), and disproved the work log's exposure claim against the pre-round source. The fix is a four-line behavior delta; QA re-killed the regression from three angles and reproduced every corpus figure to the digit. Result over the 860-file corpus: NotFound 1,418 -> 1,256, 418 clean-file references gained a jump target, none lost one, 141 coincidence-answers deliberately given back. The server's stopgap is deleted whole: type_def.rs::indexed_type, qualifier guard included — all 45 type-definition tests green unchanged, and cross-file interface rename from a type window is newly possible and pinned. Corpus formatter results byte-identical (813/820 both trees). New docs/features/overlay-promotion/README.md; the vlog-semantic and workspace-index tables re-measured (the committed baselines had gone stale several rounds ago; both READMEs now carry the three-state table). Co-Authored-By: Claude Fable 5 <[email protected]> |
||
|
|
33f58196e3 |
Refactoring M2: vlog_refactor crate + LSP rename
New crate vlog_refactor: rename any symbol vlog_semantic resolves, in-file and cross-file, with whole-edit-or-nothing verification (token identity + before/after resolution print over every file spelling either name). End labels rename too via a new vlog_semantic Target::Declaration bound at declaration time. Server ships prepareRename/rename; refusals are LSP request errors, define-body/macro-argument/hierarchical-tail occurrences warn instead of guessing. QA round 1 found two silent HIGHs (third-file collision, macro-argument silence) — both closed with regression tests. Co-Authored-By: Claude Fable 5 <[email protected]> |
||
|
|
54b0ca3896 |
Add class-semantics and lexer-cleanup (round 20)
class-semantics: classes are first-class in vlog_semantic -- class
scopes and symbols, member/method/prototype binding, this.x
(nearest-class-only), super.x, cls::x with lexical unit heads,
out-of-body cls::method bound into the class's scope with the extern
prototype as the definition (rule 10), and the honest
InheritedCandidate{base, paths} shape: a member miss in an extending
class records what the unknown base might supply (import paths
included) and is never chased, not even in-file -- the future
inheritance round's worklist, measured at 1303 candidates. Unit-name
misses stay ExternalCandidate (QA-found, lead-ruled: bases supply
members, not package names; +170 recovered navigations, pinned).
Workspace index gains classes as units (246) and their members
(11399). scan.rs migrated to parser name-spans: 26 call sites down
to the 2 documented consumers. 114044 spans, 0 unplaced, 0 panics;
UVM code now has hover/definition/references/outline.
lexer-cleanup: the three filed gaps -- @(* ) lexes via a
starts_attribute backoff (an attribute cannot begin with `)`; real
attributes pinned, no misfire on legal expressions), a leading BOM
is accepted as a named losslessness exception (mid-file BOM errors
clearly; 20k-case position fuzz clean), and non-ASCII lex errors now
decode the full character AND surface through vfmt check's error
slot (exit 2, matching format, text-rule findings still reported --
the silent-pass hole closed). The macro space-before-paren item is
parked with a QA-hardened analysis: the reading depends on a
definition vfmt cannot see, any fixed answer is provably wrong for
one population, and today's behavior fails safe.
827 workspace tests. Dev: 2 Fable agents; QA: 2 Opus agents; reviews
in docs/features/{class-semantics,lexer-cleanup}/README.md.
Co-Authored-By: Claude Fable 5 <[email protected]>
|
||
|
|
1ac9746c45 |
Add workspace-index and name-spans (jointly: round 10)
workspace-index (vlog_semantic): cross-file resolution -- the
owner's `import pkg::*;`-anywhere requirement delivered.
WorkspaceIndex maps modules/packages/file-scope typedefs, package
exports, module ports/params and per-file define tables; built
tolerantly (broken files still contribute), deterministic by
construction (FileIds assigned after path sort). resolve_external
answers ExternalCandidates in a two-layer overlay keyed by
ReferenceId -- Semantics stays a pure single-file fact; local
declarations outrank imports. Corpus: 87% of external candidates
answered (external rate 19.6% -> 2.6% on clean files), ambiguity
kept honest (OpenTitan prim_generic/prim_xilinx), 0.7s build,
workspace_symbols substring search.
name-spans (vlog_parser): the approved vlog-semantic handshake --
the parser records every declared name's span at parse time (28
fields across 21 node kinds; Name/ImportPath bundles where parallel
Vecs could desync; ImportPath splits p::x for the index). Content-
pinned by the exhaustive walker on every source, mutation-tested
three ways, zero behavior change (corpus md5 exact, QA byte-compared
formatter output against a HEAD worktree). scan.rs is now one
consumer away from deletion (DataType span, handshake item 2).
TODO §6 foundations complete: spans, error recovery, define table,
single-file semantics, workspace index. Next: vfmt_server.
Dev: 2 Opus agents; QA: 2 Sonnet agents; reviews in
docs/features/{workspace-index,name-spans}/README.md.
Co-Authored-By: Claude Fable 5 <[email protected]>
|
||
|
|
7cf657a538 |
Add vlog_semantic and parallel-files (jointly: shared root manifest)
vlog_semantic (new crate): single-file symbol tables and reference
resolution -- the layer that powers go-to-definition, references,
hover and document outline, and later the semantic lint rules.
Two-pass bind-then-resolve (Verilog forward references), 15 symbol
kinds, scope tree, and a three-state Resolution (Resolved /
ExternalCandidate carrying import paths for the future workspace
index / NotFound). scan.rs recovers name spans the AST lacks (95k
corpus spans verified; handshake filed and approved to move
name_span into the parser, which deletes the module). Corpus
baseline: 79.5% in-file resolution, 0.9% unresolved on clean files,
zero panics including tolerant-parse trees.
parallel-files (vfmt): rayon-parallel per-file formatting -- first
dependency, exact-pinned with written justification. 8 MiB worker
stacks discharge the recursion-limit handshake (sabotage-verified);
single-install panic hook discharges the cli-polish handshake;
deterministic input-order output (one stdout/stderr hash across 14
corpus runs at 4 thread counts); --threads flag; hand-rolled
.gitignore subset with 16/16 differential agreement against git
check-ignore. 3.6x wall-clock on the 860-file corpus.
Dev: 2 Opus agents; QA: 2 Sonnet agents; reviews in
docs/features/{vlog-semantic,parallel-files}/README.md.
Co-Authored-By: Claude Fable 5 <[email protected]>
|