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]>
type-definition
Goal
textDocument/typeDefinition (TODO.md §9c): from a name to the declaration of
that name's type. Go-to-definition answers "where does this name come
from"; this answers "where does this name's type come from" — from
my_pkg::state_t s; to the typedef of state_t, from bus_if bus or
virtual bus_if vif to the interface bus_if, from the instance name of
sub u_sub (...) to module sub, and from my_cls h; to class my_cls. It
is the second-most-used navigation key in an editor after F12, it is exactly
the jump a Verilog reader wants when a signal is a package enum declared three
files away, and — this is why it is cheap — the answer is a location
textDocument/definition already knows how to compute. Everything this
feature adds is which offset to ask about.
Assumptions
- A declaration's type is written as an identifier, and
vlog_semanticrecorded it as a use.bind.rs::bind_data_typecallsuse_namefor every non-keyword type name, searching the window from the start of the declaration to the first name it declares. This feature finds that same window from the parse tree and picks the reference the binder left in it. A keyword type (logic,wire,int) is never a reference, which is what makes "a built-in has no type definition" fall out with no special case. - The cursor on a use the file binds as a type answers for it too, which
is what
type_name's case 2 is and whattype_use_atimplements. Its doc comment has always named a cast (state_t'(0)) as the shape that reaches it. Amended 2026-09-02 (docs/features/comment-slots/README.md, M11): that was aspirational until the binder started binding a cast's casting type —bind_expr'sCastarm droppedtyoutright, so the cursor onstate_t'found no reference and case 2 never fired there.bind_type_exprgives the casting type a reference and three tests pin the claim:a_cast_reaches_the_typedef_it_names,a_keyword_cast_asks_nothing_of_the_index(int'(x)names nothing, exactly as a keyword type in a declaration does) anda_sized_or_computed_cast_answers_for_its_own_operand($bits(nib_t)'(x)— a width, whose operand is an ordinary use). - One hop, never a chain. With
typedef state_t alias_t; alias_t x;the cursor onxlands onalias_t's typedef, not onstate_t's. That is what every editor's go-to-type-definition does; the user presses the key again for the next hop, and each hop is a place they can read. Chasing the chain to its root would land somewhere the source never mentioned. - The cursor on a type name answers for that name.
state_tinstate_t s;is already a type, so its type definition is its own declaration — the same location F12 gives there. Pinned by a test either way, since it is the one position where "definition" and "type definition" visibly coincide. - A declaration name is not a use. The cursor on the
alias_toftypedef state_t alias_t;takes the hop its declaration offers (state_t) rather than answering itself, which would waste the keystroke. - A
module,interfaceandprogramare one AST node. They were also oneSymbolKind::Module, so an interface was reached by exactly the code that reaches a module. Amended 2026-09-01 (docs/features/interface-semantics/README.md): an interface isSymbolKind::Interfaceand a program is stillModule, sotype_def::type_use_atmatchesTypedef | Class | Module | Interface. What a type-definition jump does is unchanged; only the kind it matches on is wider. - The tree is the tolerant parse. A declaration inside an
Errornode is no declaration at all and answers nothing — the same degradation every other tree-reading handler has (docs/features/error-recovery/README.md). - An
InheritedCandidatein a type position is a lexical miss, not an answer.resolve.rs'smissturns every miss inside a class carrying anextendsintoResolution::InheritedCandidate, whether or not the name has anything to do with inheritance — so in a type window it means only "a base class might declare this type".vlog_semanticnever chases a base chain (in this file or out of it:lexicalwalksscope.parent, which is lexical nesting, andmissrecords the base's name and stops), so no layer can turn that into a location, and the workspace's file-scope type of that name is the best honest answer available. Since 2026-08-26 that answer comes from the overlay itself, which tries the paths such a miss now carries (docs/features/overlay-promotion/README.md) — the reasoning is unchanged, only the layer that acts on it. This is assumed, not enforced: a base class that genuinely declares a nested type of the same name would be the better answer, and nothing here can produce it — but nothing displaces it either, because a resolved name never reaches the sweep. The dayvlog_semanticdoes chase a base, such a reference becomesResolution::Resolvedanddefinitionanswers it directly. Pinned byan_in_file_bases_nested_typedef_does_not_beat_the_workspace_type_because_nothing_finds_it.
Handshakes
Consumed from vlog_parser: ast::{Item, ItemKind, Module, PortList, AnsiPort, ParamPort, TfArg, DataType, Declarator, Typedef, TypedefKind, Instantiation, GenIf, GenElse, GenBlock, Stmt, StmtKind} and TextRange.
Read-only; nothing was changed.
Consumed from vlog_semantic: Semantics::{references, reference_at, symbol}, Reference::{name, name_span, resolved} and SymbolKind.
Read-only; nothing was changed. (Until 2026-08-26 this also read
Resolution::{NotFound, InheritedCandidate} and WorkspaceIndex::{units, path} for the indexed_type fallback; request 1 below landed and the
fallback is gone.)
Consumed from this crate: nav::definition (the whole answer),
nav::symbol_at — widened from private to pub(crate) so the two handlers
cannot disagree about what a position names — and locate::location.
Promised: type_def::type_definition(ws, uri, offset) -> Vec<Location>,
serving server.rs's GotoTypeDefinition arm. Same answer shape as
GotoDefinition: an array in every case, empty where there is nothing to jump
to, every candidate where the workspace declares the name twice, and an empty
array (not null) for a buffer the server was never sent.
Requested of other modules — neither blocked the original round, and neither was done there:
Delivered 2026-08-26 byvlog_semantic: report an unresolved unqualified name as an external candidate, not as a bare lexical miss.overlay-promotion(docs/features/overlay-promotion/README.md): a miss on a name written in a type position — which is every name this feature ever asks about — carries the bare name as its last candidate path in both miss spellings, so the workspace overlay answers them. (A miss in a value position does not, which is what keeps a bare expression identifier from matching a unit on name alone.)indexed_type— its qualifier guard and its kind filter with it — is deleted.type_definitionis now literallynav::definitionof the type name's offset and nothing else. One test changed behavior with it: apackageof the type's name is now answered exactly asdefinitionanswers it, because the shared overlay does not filter by kind and the private fallback did (argued in that feature's Assumptions). The original request read:resolve.rs'slexicalmiss ends inResolution::NotFoundwhenever the file collected no import paths on the way out — or, inside a class with anextends, inResolution::InheritedCandidate— and neither reachesresolve_external, so the workspace overlay never sees the name. That is precisely how aninterfaceis written (bus_if bus;— interfaces live at file scope, not in packages) and how a package-lessclassis used, so the two headline cross-file cases of this feature would answer nothing; and theInheritedCandidatehalf covers nearly every UVM class, since almost all of them extend something. The ask: for aTarget::Lexicalmiss, emitExternalCandidate { paths: vec![name] }— the same shapeTarget::Modulealready emits — in both spellings, i.e. also carry the bare name in thepathsof anInheritedCandidate, so the index's unit table finishes it without losing the recorded base. Until then this feature asks the index itself, in one function (indexed_type) fenced by three conditions: only for a reference the file reported as one of those two misses, only for a file-scope declaration, and only for the kinds that can be a type (Module,Class,Typedef— apackageof that name is not one). When the request above lands, that function is deleted and nothing else in this module changes. (It landed; the function is gone and nothing else in this module changed.)Delivered 2026-08-26 byvlog_parser: an ANSI header whose first port carries no direction does not parse.ansi-first-port(docs/features/ansi-first-port/README.md): the port list is now classified ANSI-or-not by what follows the first identifier, so all three shapes parse into ordinaryAnsiPorts withdir: None, andan_interface_port_reaches_its_interfacewas flipped to write the interface port first (with the second-port ordering kept as its own assertion). Two tests were added here with it — a modport-qualified port and a package-scoped first port. The original request read:module m (bus_if bus, input logic clk);becomes anErroritem, whilemodule m (input logic clk, bus_if bus);parses fine — the list is classified ANSI-or-not from its first element, and a baretype namepair reads as neither a non-ANSI name list nor a directed port.module m (bus_if.mp bus)(a modport-qualified port) andmodule m (my_pkg::state_t s)do not parse either. Not this feature's to fix, and not a regression it caused: the tests here write the interface port second and say why.
Status / TODO
crates/lucisv_server/src/type_def.rs: the offset redirection, the declaration walk, and (until 2026-08-26) the index fallback.type_definition_provideradvertised (TypeDefinitionProviderCapability::Simple(true)).GotoTypeDefinitiondispatched inserver.rs, onGotoDefinition's conventions exactly.nav::symbol_atshared rather than re-implemented.- 24 unit tests: typedef, enum/struct typedef, class handle (module item
and method body), module instance, interface instance / port /
virtualhandle, header parameter, task argument, generate block,pkg::t,import pkg::*+ bare name, cross-file interface, cross-file class, built-ins, a package that is not a type, a refused qualified name, an unopened buffer, a position on no name, ambiguity, UTF-16 positions, one-hop aliasing. - Fix round (2026-08-26):
indexed_type's fence widened to acceptResolution::InheritedCandidateas well asNotFound, closing the QA finding below (a cross-file type used as a member of anyextends-ing class — nearly every UVM class — answered nothing). 4 tests added, QA's regression test flipped, corpus spot-check assertions flipped positive. - Fallback deleted (2026-08-26,
overlay-promotion): Handshake request 1 landed invlog_semantic, soindexed_type— fence, qualifier guard and all — is gone andtype_definitionisnav::definitionof the type name's offset, nothing more. Every test in the suite still passes; two were renamed and one changed behavior (apackageof the type's name is now answered asdefinitionanswers it), each argued in that feature's work log. - Handshake 2 landed (2026-08-26,
ansi-first-port): the three header shapes parse, soan_interface_port_reaches_its_interfacewrites the interface port first (both orderings asserted), and two tests joined it —a_modport_qualified_port_reaches_its_interfaceanda_package_scoped_first_port_reaches_its_typedef.type_spanmatches a type name by the half before its.as well as by its last::segment, which is the one production line that changed. 47 tests. - One e2e round trip: the capability in the real handshake, a cross-file package typedef, and a built-in answered with an empty array.
- TODO.md §9c checkbox;
docs/features/lucisv-server/README.mdcapability table. - Not done, deliberately: a function's return type is not a site — a
cursor on
finfunction state_t f();answers nothing. It is a defensible answer to give and a defensible one to withhold, and giving it needs a guard (the cursor must be in the header, not in the body) that the other sites do not, so it waits for somebody to ask for it. - Not done, deliberately: a
binddirective's instance. Its name is declared into another module's scope, so this file is not the one to answer for it (docs/features/bind/README.md). - Not done: a member's type (
x.field,h.member).vlog_semanticdoes not resolve member access at all, so there is no symbol to ask about — the same boundary hover andreferencesstop at.
Work log
2026-08-26 — dev agent
- Read the semantic layer before writing anything, and the key question came
back "no, but". A
Symbolcarries no type: itsdecl_spanis its declarator (bind.rs::bind_declaratorspassesd.span), so the type name is outside every span the symbol table holds, and there is notypefield anywhere inmodel.rs. What the crate does have is the type name as an ordinaryReference—bind_data_typecallsuse_nameon it, resolved lexically or as apkg::member — which is the whole feature: the answer isnav::definitionof the type name's own offset. Sovlog_semanticwas not modified, as the brief required, and the only thing that had to be built is the map from a position to the type name's position. - That map needs the tree, and is offset-driven, which kept it small.
site_atdescends items, module headers, class bodies, generate blocks and statements, pruning by span containment exactly asselection.rsdoes, and returns the one declaration covering a position: the type name as written plus the window it was written in. The window is deliberately the same one the binder searched (start of the declaration → start of the first declared name), which turns "where is the type name" into a match against the reference table rather than a scan of the text. A qualified type is two references (pkg, thenstate_t) and the second is the one worth jumping to, so a name with::is matched by its last segment; an instantiation stores its name glued, so the whole name is tried first. - New module, not an extension of
nav.rs.nav.rsis definition + references + highlights overSemanticsalone; this needs a parse-tree walk that has no reader there, and the two things it borrows fromnav(thedefinitioncall andsymbol_at) are a public function and a one-word visibility change. Adding ~250 lines of AST walking to a 625-line module whose subject is the symbol table would have made both harder to read. - One walk, not a reuse of
instantiations::sites. That walk finds instantiations only, and this one has to visit declarations in the same containers; running both would mean descending generate blocks twice and keeping two lists of container node kinds in step. The instantiation arm here is two lines. - The cross-file gap found by a failing test, and fenced rather than
papered over.
bus_if busandmy_cls h— an unqualified type name nothing in the file binds — resolve toResolution::NotFound, never to an external candidate, so the workspace overlay never sees them and the two headline cross-file cases returned nothing. Fixing that properly is avlog_semanticchange this round may not make, so it is written up as Handshake request 1 and stood in for byindexed_type: the index's own unit table, asked only for aNotFoundreference, only for file-scope declarations, and only for kinds that can be a type. Two tests pin the fence — apackageof the same name is not an answer, and apkg::missing_tthe overlay already refused is not retried against a decoy module of that name. - Two parser limitations found and recorded, neither touched: an ANSI header whose first port has no direction does not parse, and neither does a modport-qualified or package-qualified header port. Handshake request 2. The interface-port tests write the port second and carry a comment saying why, so the day the parser improves the tests read as deliberate rather than mysterious.
- Conventions followed exactly rather than re-decided: the answer is an
array in every case (
GotoDefinition's shape, including the empty array for an unopened buffer, which is whatself.offset(...).unwrap_or_default()means at both call sites); ambiguity returns every location; positions go throughPositions/locate::location, so UTF-16 is not this module's problem and is pinned by a test anyway. - No new dependencies, no version bump, no engine crate touched. Files
added:
crates/lucisv_server/src/type_def.rs, this README. Files edited:main.rs(module line, capability, capability test),server.rs(imports, one dispatch arm),nav.rs(one visibility word plus its doc line),tests/e2e.rs(one round trip),TODO.md(§9c checkbox),docs/features/lucisv-server/README.md(capability table + Status). - Gates.
cargo fmt --all -- --check: clean.cargo clippy --all-targets: 0 warnings.cargo test --workspace: green.cargo build && node editors/vscode/smoke.js target/debug/lucisv-server: pass. Nogit commit, nogit push.
2026-08-26 — dev agent (fix round: the QA finding)
- The fence widened by one pattern, nothing else.
indexed_type's first condition now readsSome(Resolution::NotFound | Resolution::InheritedCandidate { .. })(crates/lucisv_server/src/type_def.rs:138). The other two — file-scope declarations only (structurally, becauseWorkspaceIndex::unitsholds nothing else) andModule/Class/Typedefkinds only — are untouched, as is every other line of the module. The doc comment now explains why the two resolutions are one case: they are the two spellingsresolve.rs'smissgives the same event, and which one you get depends only on whether anextendshappens to be overhead. - The precedence question, answered by reading rather than assumed. The
brief asked whether in-file inherited resolution can already produce a
location for an in-file base's nested typedef, so that the widening might
displace a better answer. It cannot, at three independent points:
resolve.rs::lexical(crates/vlog_semantic/src/resolve.rs:39-70) walksscope.parent, which is lexical nesting and never a base class's scope;miss(:201-213) records the base's name and stops, exactly as its own doc comment says ("which this crate never chases, in this file or out of it"); andresolve_external(crates/vlog_semantic/src/workspace.rs:382-391) skips anything that is not anExternalCandidate, so anInheritedCandidatenever reaches the overlay either. So the fallback displaces an empty answer, not a better one. Precedence also needs no code of its own now or later, becauseindexed_typeis consulted only afternav::definitioncame back empty (type_def.rs:58-63): the dayvlog_semanticdoes chase a base, the reference becomesResolved,definitionanswers the nested typedef, and the fallback is never reached — the same mechanism that already makes a local genvar of the same name win. Written up in Assumptions and pinned byan_in_file_bases_nested_typedef_does_not_beat_the_workspace_type_because_nothing_finds_it, which asserts both halves: the resolution really isInheritedCandidate(so nothing found the nested typedef) and the answer really is the workspace interface. - QA's regression test flipped, name and fixture kept.
a_class_scoped_type_reference_in_an_extending_class_is_never_found_cross_file→..._is_found_cross_file, same portable fixture, and it still asserts the resolution isInheritedCandidate— the point being that the fence widened andvlog_semanticdid not. - Four tests added (
type_def.rs, all portable, no corpus):a_uvm_shaped_member_type_resolves_cross_file_from_an_extending_class(the ibex shape: a base class that is nowhere in the workspace, two cross-file interfaces as member types, reached from both the type half and the declarator half);an_in_file_bases_nested_typedef_does_not_beat_the_workspace_type_because_nothing_finds_it(the precedence determination above);a_non_type_inherited_reference_is_still_never_a_type_site(an ordinary expression identifier inside an extending class — the one place the widening could have leaked, and it does not, because noSiteis built for an expression statement so the fence is never even consulted); andthe_other_two_fence_conditions_still_hold_under_an_inherited_candidate(three arms, all from inside an extending class: apackageof that name is still not a type; a package member typedef is still not file-scope and so is not in the unit table; apkg::missing_tthe overlay already refused is still not retried against a decoy module of that name). - The corpus spot-check now asserts the fix on the file that found it.
corpus_spot_check_real_uvm_files_no_panic_and_known_jumps's two "known gap" assertions ondv/uvm/core_ibex/env/core_ibex_env_cfg.svbecame positive ones:clk_rst_ifandcore_ibex_dut_probe_ifeach jump to exactly one location, inclk_rst_if.svandcore_ibex_dut_probe_if.svrespectively. Not brittle: both arevirtual <iface> <name>;members of a class the file opens with, both interfaces are vendored in this checkout under those file names, and the probes match on the multi-space alignment the file uses. The test still skips itself whencorpus/is absent, andscrambling_key_agent_cfg— a class genuinely not vendored here — is still asserted empty, which is what keeps the widening from reading as "answer something, anything". - Scope. Files edited:
crates/lucisv_server/src/type_def.rs(one match pattern, its doc comment, the test module) and this README.vlog_semanticuntouched;TODO.mdneeded no truth fix (its §9c line claims the capability, which was true before this round and is more true after). Test count intype_def.rs: 42 (was 38). - Gates.
cargo fmt --all -- --check: clean.cargo clippy --all-targets --workspace: 0 warnings.cargo test --workspace: green (748 passed / 4 ignored inlucisv_server's own suite, 0 failed anywhere).cargo build && node editors/vscode/smoke.js target/debug/lucisv-server:smoke: OK. Nogit commit, nogit push.
2026-08-26 — overlay-promotion dev agent (the Handshake landing)
indexed_typedeleted whole, its qualifier guard and its kind filter with it, andtype_definitionis now three lines: find the type name's offset, asknav::definition, return.Resolutionandcrate::locate::locationare no longer imported by this module at all — the handler builds noLocationof its own, which is the delegation-honesty property QA checked by reading, now true by absence.- The whole suite is the acceptance suite and it still passes — 45 tests,
none added, none removed. 41 are untouched; one had an expectation updated
(below). Three were renamed because they named the deleted function or a
fence that moved, and one of those three —
a_package_of_the_same_name_is_not_a_type— also changed behavior; it is nowa_package_of_the_same_name_answers_exactly_as_definition_answers_it, asserting literal equality withnav::definitionat the same offset. The reason it changed: the shared overlay does not filter the unit table by kind, and the private fallback did. Keeping the old answer would mean rebuilding the fourth resolution layer this round exists to delete, and the input it concerns (thing t;where the workspace's onlythingis a package) does not compile either way. a_plain_expression_use_of_a_workspace_module_name_is_never_a_type_sitekept its name and got stronger, though not the way the round first wrote it. The first cut had it assert thatnav::definitiondoes answer that offset whiletype_definitiondoes not; QA showed the same promotion maderenamerewrite an unrelated file on the same coincidence, so the promotion was narrowed to type positions and the read side went back with the write side. The test now asserts the reference isNotFoundand that neither handler answers it — pinning two independent fences (the model never offers the coincidence; noSiteis built for an expression statement) instead of one.- Everything else about this feature — the offset redirection,
site_at, the one-hop rule, the conventions — is unchanged. Full rationale, consumer audit and corpus measurement:docs/features/overlay-promotion/README.md.
2026-08-26 — ansi-first-port dev agent (Handshake 2 landing)
- The fixtures that wrote the port second are flipped.
an_interface_port_reaches_its_interfacenow declaresmodule m (bus_if bus, input logic clk);— the spelling an interface port is actually written in — and keeps the old ordering as a second module in the same fixture, so the shape that used to be the only one that parsed is still pinned. Two tests joined it:a_modport_qualified_port_reaches_its_interfaceanda_package_scoped_first_port_reaches_its_typedef. - One production line changed here, and it is a widening of a match, not of
an answer.
type_spanalready matched a site's type name by its last::segment (a qualified type is two references and the second is the one worth jumping to); it now also matches the half before a., becausevlog_parserglues an interface port's modport onto the type name the same way it glues apkg::qualifier, andbind_data_typerecords the interface half. Nothing else in this module moved: the answer is stillnav::definitionof a name the binder itself recorded, so a wrong jump would have to be a wrong reference, not a wrong match. - Full rationale, the parser change and the corpus measurement:
docs/features/ansi-first-port/README.md.
QA log
2026-08-26 — QA agent (continuation of an interrupted run)
This run resumed a QA pass interrupted mid-way. The prior pass had already
added 13 tests to crates/lucisv_server/src/type_def.rs (all still present,
all re-run and green below) but had not yet written anything to this log —
its work is folded into the write-up below rather than repeated as a separate
entry, since there was nothing here to distinguish "already recorded" from
"found this session." What follows covers the full original checklist.
A. Gates — all green, re-run from a clean state:
cargo fmt --all -- --check: clean.cargo clippy --all-targets --workspace: 0 warnings.cargo test --workspace: green throughout, including after every change this session made (744 passed / 4 ignored inlucisv_server's own suite, 0 failed anywhere in the workspace both before and after).cargo build && node editors/vscode/smoke.js target/debug/lucisv-server:smoke: OK.
B. Attack surfaces.
-
indexed_typefence — verified clean, with one finding (below).- Shadowing locals:
a_local_declaration_of_the_same_name_wins_over_the_workspace_type(type_def.rs:813) — a genvar namedbus_ifin scope wherebus_ifis also a workspace interface;lexicalresolves it locally (Resolution::Resolved), the fence's first condition never fires, and the answer is the genvar's own declaration. Re-run, passes. - Non-type positions (structural confinement to type windows):
a_plain_expression_use_of_a_workspace_module_name_is_never_a_type_site(type_def.rs:863) —assign x = dup;wheredupis also a workspace module name; noSiteis ever built for an expression statement (site_at/item_siteonly recurse intoDataDecl/PortDecl/ParamDecl/Typedef/Instantiation/statement-declaration kinds — anExprStmtis not one, confirmed by readingstmt_site, type_def.rs:311-343), sotype_definitionanswers empty regardless of the fence. Re-run, passes. - Ambiguity convention vs.
nav::definition's: dev'sa_module_declared_twice_returns_both_declarationsgoes throughTarget::Module'sExternalCandidatepath; QA'sindexed_type_returns_every_workspace_declaration_when_the_name_is_ambiguous(type_def.rs:888) pins the same convention through theindexed_type/NotFoundpath specifically, which none of dev's tests touch. Verified by code reading that both really do share one convention, not two that happen to agree today:indexed_typeandresolve_external(vlog_semantic/src/workspace.rs:382,413) both readWorkspaceIndex::units(name)(workspace.rs:105) — the sameBTreeMapinsertion order, "by file path, then by position in the file" per its own doc comment — so there is structurally one ordering, not a coincidence. Re-run, passes. - Package-of-same-name exclusion: dev's
a_package_of_the_same_name_is_not_a_type(type_def.rs:695). Re-run, passes. - Function/instance/port name collisions: not re-tested empirically —
verified structurally impossible instead.
indexed_typeonly ever seesws.index().units(name), andWorkspaceIndex::add_fileonly inserts a name intounitswhenis_unit(kind)(vlog_semantic/src/workspace.rs:206-219,is_unitat :288-293) is true, which is exactlyModule | Package | Typedef | Class. A function, a task, a port, or an instance name can never appear inunits()at all — there is no fence to test because there is no path for the collision to occur through. This is the same mechanism that makes the package-of-same-name test necessary in the first place (Packageis a unit kind, which is whyindexed_type's own kind filter, not justis_unit, is needed for that one case).
Finding (significant, corpus-derived) — the
NotFound-only fence misses the single most common real-world shape.resolve.rs'smiss(vlog_semantic/src/resolve.rs:190-201) resolves any lexical miss inside a class body carrying anextendsclause asResolution::InheritedCandidate, neverNotFound— unconditionally, regardless of whether the missing name has anything to do with inheritance.indexed_type(type_def.rs:126-130) only fires onNotFound. Consequence: a cross-file interface or package-less class used as the type of any member of any class that extends something — which in practice is nearly every UVM class, since almost all of them extenduvm_object/uvm_component/etc. — falls through both layers and answers nothing, even though the interface or class in question is genuinely declared elsewhere in the workspace. Reproduced live on real corpus text:corpus/ibex/dv/uvm/core_ibex/env/core_ibex_env_cfg.sv:5,7(class core_ibex_env_cfg extends uvm_object;/virtual clk_rst_if ibex_clk_vif;) —clk_rst_if.svis indexed (confirmed viaws.index().units("clk_rst_if")), the reference resolves toInheritedCandidate { base: "uvm_object", .. }rather thanNotFound(confirmed viareference_at), andtype_definitionat that offset returns[]. Pinned as a portable (non-corpus) regression test,a_class_scoped_type_reference_in_an_extending_class_is_never_found_cross_file(type_def.rs:771), and reproduced again on the live corpus file incorpus_spot_check_real_uvm_files_no_panic_and_known_jumps(type_def.rs:1048). Not fixed here: widening the fence to also acceptInheritedCandidatelooks like the natural fix and is probably safe (the fence's other two conditions — file-scope declaration,Module/Class/Typedefkind only — still apply), but it is a production-logic change with its own shadow risk (a name that is genuinely an inherited member, not a type at all, coincidentally sharing a workspace type's name) that deserves its own design pass and tests rather than a QA drive-by fix. Recommend either wideningindexed_type's match at type_def.rs:128 to includeResolution::InheritedCandidate { .. }, or folding it into Handshake request 1 tovlog_semantic, whichever the dev prefers — either way this is the highest-value follow-up this feature has. - Shadowing locals:
-
Position→type-window mapping vs.
bind_data_type— verified clean. Array dims:packed_and_unpacked_array_dimensions_do_not_confuse_the_type_match(type_def.rs:992). Inline anonymous struct:an_inline_anonymous_struct_has_no_type_name_to_jump_to(type_def.rs:942) — both the declarator-name cursor and a cursor inside the inline body answer empty, not a bogus jump. Multiple declarators:a_later_declarator_in_a_multi_declarator_line_still_finds_the_type(type_def.rs:957). Parameter-typed decls: dev'sa_parameter_and_a_task_argument_are_typed_declarations_like_any_other.var/constprefixes:var_const_and_signed_qualifiers_do_not_shift_the_type_window(type_def.rs:976). Function arguments (the task-argument case's twin):a_function_arguments_type_is_reached_like_a_task_arguments(type_def.rs:1004). All re-run/added, all pass. -
One-hop semantics + degenerate
typedef t t;totality — verified clean. Dev'san_alias_chain_is_walked_one_hop_at_a_timeplus QA'sa_self_referential_typedef_is_total_and_does_not_loop(type_def.rs:909), which checks every offset ontypedef t t;answers promptly with no panic and no hang (there is no chain-following code path to loop in the first place — the one-hop design makes this total by construction, and the test pins that operationally). Re-run, passes. -
Delegation honesty — verified clean, by code reading and by test. Every
Locationthis module returns is built bycrate::locate::location—nav::definition's own answers (type_def.rs:58) andindexed_type's fallback answers (type_def.rs:138) both call the same function imported at type_def.rs:45; there is no second, ad hocLocationconstruction anywhere in the file.type_definition_on_a_type_name_agrees_exactly_with_definition(type_def.rs:925) asserts literal equality withnav::definitionat the same offset for the case where the two are supposed to coincide. Re-run, passes. -
Null conventions — verified clean. Built-ins:
a_built_in_type_has_no_declaration_to_jump_to. Unopened buffer:a_buffer_the_server_does_not_hold_answers_nothing. Position on no name:a_position_on_no_name_at_all_answers_nothing. Comment/whitespace cursor:a_position_inside_a_comment_answers_nothing(type_def.rs:1028). Past-EOF:a_position_past_the_end_of_the_file_answers_nothing_not_a_panic(type_def.rs:1021), offset = file length + 5000. All total (emptyVec, never a panic). Re-run, all pass. -
Both claimed parser gaps, reproduced directly against
vlog_parser::parse_source_tolerant(temporary throwaway test, removed after use — not committed):module m (bus_if bus, input logic clk);→Error(RawText), diagnosticexpected \)` (found "bus")at the position right afterbus_if`. Confirms the first-port-direction-less claim exactly.module m (bus_if.mp bus);(modport-qualified) →Error(RawText),expected \)` (found ".")`. Confirms the second claim in the same Handshake bullet.module m (my_pkg::state_t s);(package-qualified) →Error(RawText),expected \)` (found "::")`. Confirms the third. Both Handshake requests in the feature README are accurate as written.
-
CLAUDE.md compliance — verified clean.
- No
unwrap()/expect()/panic!anywhere intype_def.rsoutside#[cfg(test)] mod tests(checked by scanning the file up to that marker);main.rs/server.rs/e2e.rsdiffs use them only inside test code, which CLAUDE.md permits. pub fn type_definitionand the newly-pub(crate)nav::symbol_atboth carry doc comments; no otherpubitems were added.- README sections (Goal/Assumptions/Handshakes/Status/Work log/QA log/ Review) each appear exactly once, in order.
TODO.md's §9c item text is unchanged; only the checkbox flipped and a→ delivered ...annotation was appended in the file's existing, already-established style (18 other items use the same→convention; grepped to confirm this isn't a one-off).
- No
C. Corpus spot-check — completed; found and fixed a test-harness bug along
the way, and found the significant indexed_type gap above.
The interrupted run had left an #[ignore]d scratch test
(qa_scratch_corpus_spot_check) that opened a fresh Workspace and called
open_roots (a full corpus re-index) for every one of ~400 small corpus
files in its panic-sweep loop. That made the test re-scan the whole
corpus/ibex tree (651 files) once per small file — confirmed by running it:
still not finished after 5.5 minutes of CPU time, killed rather than waited
out. This was a test-harness bug, not a product one (Workspace::set_document
only overlays a buffer against an index already built —
crates/lucisv_server/src/state.rs:175-179 — so the fix is to build the
index once and reuse it). Rewrote it as
corpus_spot_check_real_uvm_files_no_panic_and_known_jumps (type_def.rs:1048),
un-ignored, now runs in ~2.6s:
- Full-file offset sweep (every byte offset, no
step_by) overdv/uvm/core_ibex/tb/core_ibex_tb_top.sv(21 KB) and bothcore_ibex_env_cfg.sv/core_ibex_scoreboard.sv— no panic. - A genuine positive control on real corpus text:
clk_rst_if ibex_clk_if(...)incore_ibex_tb_top.sv(a module-scope interface instantiation, not inside any class) jumps to exactly one location, inclk_rst_if.sv— confirming the happy path this feature claims works on code nobody wrote as a fixture. - The
indexed_type/InheritedCandidategap above, reproduced on the same real file it was found in (clk_rst_if,core_ibex_dut_probe_if— both real, indexed interfaces — answer empty insidecore_ibex_env_cfg, whichextends uvm_object). scrambling_key_agent_cfg(dev/prior-run's negative probe) confirmed still empty, and confirmed why: that class is not vendored into this corpus checkout at all (grep -rl "class scrambling_key_agent_cfg" corpus/ibex/finds nothing), so empty is correct regardless of resolution kind — not a second instance of the gap.- 413 small
.sv/.svhfiles undercorpus/ibex(≤4000 bytes each), every third byte offset, sharing the one indexed workspace: no panic.
D. Tests added this session (on top of the 13 the interrupted run had
already added and which are re-verified above): 1 —
a_class_scoped_type_reference_in_an_extending_class_is_never_found_cross_file
(type_def.rs:771) — plus the corpus test rewrite described in C. Total in
type_def.rs: 38 (24 dev + 14 QA). cargo test -p lucisv_server --bin lucisv-server type_def:: : 38 passed, 0 failed.
Overall verdict: not committable as-is. Every hard invariant, every gate,
and six of the seven checklist attack surfaces are clean, and the feature's
core design (offset redirection to nav::definition) is sound and exactly as
documented. But the indexed_type fallback — the piece this feature added
specifically to cover cross-file interfaces and classes — silently answers
nothing for that exact case inside the single most common real-world
container for it (any class with extends), which covers most UVM
environment/agent/scoreboard/sequence classes in practice. That is a
functional gap in the feature's own headline claim, not a cosmetic one, and
it was findable only by running on real code, not by the crafted unit tests
(hence being caught here rather than in dev's own suite). Recommend: dev
either widens the indexed_type fence to accept InheritedCandidate (with
its own shadow-risk tests) or files it as a second, explicit Handshake
request to vlog_semantic; either way, one more QA pass over just that
change before this ships. Nothing else found blocks a commit.
2026-08-26 — QA agent (fix-round re-verification)
Scoped to the fix only, per the lead's brief: not a redo of the original checklist above, all of which stands.
A. Gates — re-run from a clean state, all green:
cargo fmt --all -- --check: clean.cargo clippy --all-targets --workspace: 0 warnings.cargo test --workspace: green throughout — 748 passed / 4 ignored inlucisv_server's own suite before any QA changes (matching dev's claim exactly), 750 passed / 4 ignored after adding the two tests below, 0 failed anywhere in the workspace at every step.cargo build && node editors/vscode/smoke.js target/debug/lucisv-server:smoke: OK.
B. Diff minimality — confirmed by mtime, since neither changed file has any
commit history to git diff against (both are still untracked; this feature
has never been committed). type_def.rs and this README were last written
at 15:12 and 15:14 respectively; every other file the original round touched
(main.rs, nav.rs, server.rs, tests/e2e.rs, TODO.md,
docs/features/lucisv-server/README.md) was last written between 14:19 and
14:30 — nearly 45 minutes earlier, before the fix round started. Consistent
with dev's claim that the fix round touched only type_def.rs (one match
arm, its doc comment, the test module) and this README. Not a substitute for
a real diff, but the strongest signal available without one.
C. The three precedence citations — read directly, all accurate:
resolve.rs::lexical(crates/vlog_semantic/src/resolve.rs:39-70): walksscope.parentonly (line 67); no reference to a base class's scope anywhere in the function. Confirmed.resolve.rs::miss(:201-213): for a non-unit miss, returnsInheritedCandidate { base, external }whennearest_extendsfinds one (line 206) — the base's name only, never chased — and only falls through toNotFound/ExternalCandidateotherwise. Confirmed.workspace.rs::resolve_external(:382-391):let Resolution::ExternalCandidate { paths } = &reference.resolution else { continue };— anInheritedCandidate(orNotFound) is skipped outright, never handed tofollow_paths. Confirmed.
Together these close the precedence question exactly as claimed: no path in
vlog_semantic today can turn an InheritedCandidate into a Location, so
the widened fence only ever fires where nav::definition already came back
empty (type_def.rs:58-63, also read and confirmed).
D. Fence re-attack.
- Original shadowing counterexamples, re-run: all still pass —
a_local_declaration_of_the_same_name_wins_over_the_workspace_type,a_plain_expression_use_of_a_workspace_module_name_is_never_a_type_site,a_package_of_the_same_name_is_not_a_type,indexed_type_returns_every_workspace_declaration_when_the_name_is_ambiguous. Untouched by the fix, verified by reading them, not just by the green suite. - New: a local typedef of the same name inside the extending class's own
body (as opposed to dev's test, which puts it in the base). Added
a_local_typedef_in_the_extending_class_itself_wins_over_the_workspace_type(type_def.rs, QA fix-round section) —class top extends base; typedef int bus_if; bus_if h; endclassalongside a workspace interface also namedbus_if. ConfirmedResolved(notInheritedCandidate) and the jump lands on the in-file typedef, never the workspace interface —lexical's own-scope lookup (resolve.rs:44) wins beforemissever runs, so the widened fence is not even consulted here. Passes. - New: an
InheritedCandidatein a type window matching a workspace MODULE. Addedan_inherited_candidate_reaches_a_same_named_module_exactly_like_not_found_did— a member of an extending class typed as a name that is only a workspace module. Resolution isInheritedCandidateas expected, and the fence's kind filter (Module | Class | Typedef, unconditioned on which resolution triggered it) lets it through exactly as it already would forNotFound— confirmed both by this new pinned test and by re-readingindexed_type(type_def.rs:136-148), which never branches on which of the two resolutions matched. Passes; now pinned permanently. pkg::tqualified references — mostly unaffected, but not entirely, and this predates the fix. Verified by two throwaway probes (not committed — removed after use, per the convention the last QA round set). The common case dev's claim describes is correct: when the qualifying unit is not declared in this file at all, the reference isExternalCandidate(a_qualified_name_the_overlay_refused_is_not_retried_against_the_indexalready pins this). Butresolve.rs::unit_member(:121-166) has its own, separate miss path viaTarget::UnitMember: when the unit is found locally — aClasswithextendswhose own scope lacks the member, or aPackage/extends-lessClasswhose own scope lacks the member — the member reference resolves toInheritedCandidateor plainNotFoundrespectively, exactly the two spellingsindexed_typematches on.indexed_typedoes not look at whichTargetproduced the resolution; it takes the bare member name and searches the whole workspace unit table with it, discarding the qualifier entirely. Reproduced concretely: withclass base; endclass class top extends base; endclassandmodule m; top::ambiguous_member x; endmodule, plus an unrelatedclass ambiguous_memberin another file, the reference resolves toInheritedCandidateandtype_definitionjumps straight to the unrelated decoy — nothing abouttopor itsbasechain was ever consulted. This is not new or introduced by this fix round: the control probe swapstop extends basefor a plainpackage local_pkg; endpackage(so the miss is a bareunit_memberNotFound, the resolution this feature's fence has matched since the original round) and reproduces the identical bare-name jump to the same kind of decoy. So the widening did not create this gap — it already existed forNotFound-via-Target::UnitMemberand was implicitly accepted (or simply not probed) in the original QA round, which testedTarget::Lexical-produced misses and oneTarget::Unitambiguity case, but noTarget::UnitMembermiss on a locally resolved unit. Not filed as a blocking finding against this fix round — it is orthogonal to what changed here — but worth a follow-up: the fence's bare-name lookup is only sound for aTarget::Lexicalmiss (where the bare name really is "does the workspace declare this anywhere"); applying it to aTarget::UnitMembermiss answers a question the qualifier already narrowed and can jump to a declaration with no relationship to the qualifying unit. Recommend a design pass onindexed_typeto check the reference's target kind (or otherwise confine the fence to unqualified names) the next time this file is touched.
E. Corpus spot-check — stable across 3 consecutive runs, ~2.7s each,
checked 413 small corpus files, no panic every time, both now-positive
assertions (clk_rst_if, core_ibex_dut_probe_if) holding every run.
Fixture reasoning independently confirmed: corpus/ibex/dv/uvm/core_ibex/env/core_ibex_dut_probe_if.sv
and corpus/ibex/vendor/lowrisc_ip/dv/sv/common_ifs/clk_rst_if.sv both exist
in this checkout exactly where the test expects them. Not brittle by any
signal found this session.
F. Tests added this session: 2, both permanent —
a_local_typedef_in_the_extending_class_itself_wins_over_the_workspace_type
and an_inherited_candidate_reaches_a_same_named_module_exactly_like_not_found_did.
Total in type_def.rs: 44 (42 + 2 QA). Two additional throwaway probes used
to investigate item D.4 above were removed after confirming the finding, per
the standing convention (not committed).
Overall verdict: committable. The fix is exactly what it claims to be — one match arm widened, nothing else in production code touched, confirmed by mtime and by reading the file in full. The three precedence citations hold up under independent reading. All of the previous QA round's attack surfaces still pass unchanged. Two new attack angles the brief asked for (local same-class shadowing, module-kind parity) are now pinned permanently and both pass. The corpus regression this fix was written for is confirmed fixed and stable. One new, non-blocking finding (D.4 above) is pre-existing scope, not a regression from this round, and is written up for a future pass rather than held against this one.
Review
2026-08-26 — lead
Reviewed the diff, the work log and both QA rounds' logs; re-ran all
gates myself, clean. This round earned its fix cycle. The core design —
type-definition as one redirection into nav::definition, so locations
are only ever built by one code path — is exactly right, and the module
doc explains it well enough to maintain. The original QA round's
rejection was correct and well-evidenced: the fallback built for
cross-file interfaces missed them inside every extending class, found on
a real Ibex file by the corpus sweep. The fix round's widening is sound
because its safety argument was derived — three independent citations
in vlog_semantic proving no layer can turn an InheritedCandidate into a
location today — and the precedence story costs no code by construction.
One lead addition before commit: QA's follow-up probe showed a qualified
member miss (pkg::missing_t against a local package) reaches the
fallback with the same two resolution spellings, and the bare-name sweep
would then discard the qualifier — a wrong jump, which this feature's
own doc comment says is worse than an empty answer. I added the
qualifier guard in indexed_type (decline when the text before the
reference ends with ::), with a pinning test proven by deliberate
breakage (fails with the guard disabled, passes with it). The
vlog_semantic Handshake stays filed covering both miss spellings; when
it lands, indexed_type — guard and all — is deleted whole. QA process
note: the first QA agent was lost to an infrastructure error mid-run;
the resumed agent picked up its uncommitted work, finished the sweep,
and found the rejection-worthy bug in the step the first run never
reached. Accepted as shipped.