Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3bd55acb98 | ||
|
|
c37b13de31 | ||
|
|
d8d1791c1c | ||
|
|
d10e57aa6e | ||
|
|
414d501847 | ||
|
|
4123905aa1 | ||
|
|
df4e71411f | ||
|
|
6759f0eea1 |
No files matched your search
@@ -7,3 +7,4 @@
|
||||
.DS_Store
|
||||
/.zcode
|
||||
/.claude
|
||||
__pycache__/
|
||||
@@ -4,6 +4,30 @@ All notable changes to lucisv are recorded here. Versions follow
|
||||
[semantic versioning](https://semver.org/); until 1.0 the CLI's exit codes
|
||||
(see `README.md`) are the only frozen contract.
|
||||
|
||||
## 0.50.0 — 2026-09-07
|
||||
|
||||
### The format cache key; performance take 4
|
||||
|
||||
- **`uvm-utils-indent` is part of the format cache key.** In 0.49.0 a
|
||||
clean verdict cached under one setting of `[format] uvm-utils-indent`
|
||||
survived a toggle of the option, so `format --check` could exit 0 where
|
||||
`--no-cache --check` would reformat (found by the repository audit,
|
||||
topo handshake 34). The entry carries the option, the store line has it
|
||||
as a fourth field, and a 0.49.0 store is dropped entry by entry and
|
||||
rebuilt — never trusted, never an error. Regression through the real
|
||||
CLI in both toggle directions.
|
||||
- **Performance take 4** (`docs/performance_take4.md`): 0.49.0 against
|
||||
0.43.0 on opentitan, both binaries driven by one client in one hour.
|
||||
0.44.0's `didOpen` fix confirmed in the release build — 14× on the
|
||||
42 192-line file, 3–7× on ordinary RTL; the CLI unchanged and its
|
||||
formatter verdicts byte-identical on all five trees; the findings filed
|
||||
for the next loop: the lazy code-action offer 2–3 ms dearer per cursor
|
||||
move (the extract and inline gates re-parse a buffer the server already
|
||||
holds), the hierarchical-tail rename at 751 ms, the Style lint class
|
||||
1.27× after `unused-import`, the index 14% bigger at codec 19. The
|
||||
measurement harness now lives in `tools/perf/` and runs from a clean
|
||||
checkout.
|
||||
|
||||
## 0.49.0 — 2026-09-06
|
||||
|
||||
### Inline module; the last coverage gaps
|
||||
|
||||
@@ -70,6 +70,13 @@ is in the decomposition-server README) and `vlog_parser/src/lexer.rs`
|
||||
thresholds: a dev adding to a file near 600 puts the code in a new
|
||||
module.
|
||||
|
||||
Re-measured 2026-09-07 at 0.49.0 (same rule, before `mod tests`): four
|
||||
files over 600 — `lucisv_server/src/state.rs` 958 (grew across §37–§49;
|
||||
a decomposition is filed as TODO §55: scope/widen, the document store,
|
||||
the source selectors are three sentences), `perf.rs` 900 (reasoned),
|
||||
`lexer.rs` 763, `vlog_formatter/src/format/stmt.rs` 604 (at the mark; the
|
||||
next statement arm goes in a new module) — and everything else under it.
|
||||
|
||||
## Rust standards
|
||||
|
||||
- `cargo fmt` clean, `cargo clippy --all-targets` clean (no `#[allow]`
|
||||
|
||||
Generated
+8
-8
@@ -97,7 +97,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "lucisv"
|
||||
version = "0.49.0"
|
||||
version = "0.50.0"
|
||||
dependencies = [
|
||||
"lucisv_core",
|
||||
"rayon",
|
||||
@@ -108,11 +108,11 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "lucisv_core"
|
||||
version = "0.49.0"
|
||||
version = "0.50.0"
|
||||
|
||||
[[package]]
|
||||
name = "lucisv_server"
|
||||
version = "0.49.0"
|
||||
version = "0.50.0"
|
||||
dependencies = [
|
||||
"lsp-server",
|
||||
"lsp-types",
|
||||
@@ -248,14 +248,14 @@ checksum = "e6e4313cd5fcd3dad5cafa179702e2b244f760991f45397d14d4ebf38247da75"
|
||||
|
||||
[[package]]
|
||||
name = "vlog_formatter"
|
||||
version = "0.49.0"
|
||||
version = "0.50.0"
|
||||
dependencies = [
|
||||
"vlog_parser",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "vlog_linter"
|
||||
version = "0.49.0"
|
||||
version = "0.50.0"
|
||||
dependencies = [
|
||||
"lucisv_core",
|
||||
"vlog_formatter",
|
||||
@@ -265,11 +265,11 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "vlog_parser"
|
||||
version = "0.49.0"
|
||||
version = "0.50.0"
|
||||
|
||||
[[package]]
|
||||
name = "vlog_refactor"
|
||||
version = "0.49.0"
|
||||
version = "0.50.0"
|
||||
dependencies = [
|
||||
"vlog_formatter",
|
||||
"vlog_parser",
|
||||
@@ -278,7 +278,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "vlog_semantic"
|
||||
version = "0.49.0"
|
||||
version = "0.50.0"
|
||||
dependencies = [
|
||||
"vlog_parser",
|
||||
]
|
||||
+1
-1
@@ -12,7 +12,7 @@ members = [
|
||||
]
|
||||
|
||||
[workspace.package]
|
||||
version = "0.49.0"
|
||||
version = "0.50.0"
|
||||
authors = ["Guoliang Chen"]
|
||||
edition = "2021"
|
||||
license = "MIT"
|
||||
|
||||
@@ -86,10 +86,9 @@ run over an unchanged tree skips them: the summary says `N files from cache`,
|
||||
and on one core the corpus check goes from 396 ms to 51 ms (2.3× at the default
|
||||
thread count, where parallelism has already taken the easy win).
|
||||
|
||||
An entry is keyed on **(content hash, `line-length`, `indent`, lucisv version)**
|
||||
per file, and only ever records the *already formatted* verdict — a file that
|
||||
would be reformatted, or that failed, is re-checked on every run, so
|
||||
`--check`'s exit codes and `--diff`'s output never go stale. The store is one
|
||||
An entry is keyed on **(content hash, `line-length`, `indent`,
|
||||
`uvm-utils-indent`, lucisv version)** per file, and only ever records the *already formatted* verdict — a file that
|
||||
would be reformatted, or that failed, is re-checked on every run. The store is one
|
||||
text file in `.lucisv_cache/` (self-ignoring, like cargo's `target/`); deleting
|
||||
it, or a corrupted one, costs one slow run and nothing else. `--no-cache`
|
||||
neither reads nor writes it, and `--cache-dir <PATH>` puts it elsewhere (the
|
||||
@@ -97,6 +96,10 @@ default is relative to the current directory). Content hashing is 64-bit
|
||||
FNV-1a and a lookup never crosses files; `docs/features/format-cache/README.md`
|
||||
states the collision posture, the semantics table and the concurrency story.
|
||||
|
||||
(In v0.49.0 only, `uvm-utils-indent` was missing from this key, so a cached
|
||||
clean verdict survived a toggle of the option — fixed in 0.50.0; a 0.49.0
|
||||
store is simply rebuilt.)
|
||||
|
||||
### Ignore files
|
||||
|
||||
While walking a directory, lucisv reads a `.gitignore` in every directory it
|
||||
@@ -177,7 +180,7 @@ formatting choice lucisv leaves to the project, because it changes bytes
|
||||
in existing UVM code (21 of the 860 corpus files).
|
||||
|
||||
An unknown key, a bad value, an out-of-range number, or any TOML beyond the
|
||||
supported subset (tables other than `[lint]` and `[lint.<rule>]`, multi-line
|
||||
supported subset (tables other than `[format]`, `[lint]` and `[lint.<rule>]`, multi-line
|
||||
arrays, unsupported string escapes) is a hard error naming the file and
|
||||
line — exit 2, with nothing written. This is deliberate:
|
||||
a silently ignored `line_length` typo costs more than a strict parser does.
|
||||
@@ -468,7 +471,7 @@ of document layout from language rules:
|
||||
| `crates/vlog_formatter/src/format/` | `ruff_python_formatter` | Per-node formatting rules, one module per grammar domain (`item`, `module`, `instance`, `decl`, `stmt`, `expr`, `class`, `cover`, `sva`, …) |
|
||||
| `crates/vlog_linter` | `ruff_linter` | Rule registry, violations, fix applicability, waivers |
|
||||
| `crates/vlog_semantic` | — | File scopes and references, workspace index, conservative cross-file resolution |
|
||||
| `crates/vlog_refactor` | — | Verified rename, references, port refactors, instantiation plans |
|
||||
| `crates/vlog_refactor` | — | Verified rename/references, ports, imports, extract/inline module, instantiation plans |
|
||||
| `crates/lucisv_core` | — | Shared config, filelists, walks, format cache, atomic replacement |
|
||||
| `crates/lucisv` | the `ruff` CLI | Parallel per-file formatting/linting, reports, stdin, in-place writes |
|
||||
| `crates/lucisv_server` | — | Synchronous LSP loop, open-buffer overlays, indexing, editor capabilities |
|
||||
@@ -480,7 +483,7 @@ Linting consumes the parser, semantics and `lucisv_core` (for the one
|
||||
refactoring consumes the parser and semantics. The CLI reaches
|
||||
semantics through the linter and has no refactoring dependency. The server
|
||||
composes all six libraries. See [topo.md](docs/topo.md) for the full graph,
|
||||
including the linter's formatter dependency used only by tests.
|
||||
including the linter’s and refactor’s formatter dependencies used only by tests.
|
||||
|
||||
Key ideas carried over from ruff/prettier:
|
||||
|
||||
@@ -620,12 +623,19 @@ into ranges. Full semantics, including what happens at a range boundary:
|
||||
|
||||
## Supported syntax
|
||||
|
||||
v0.49.0 adds real `randsequence` productions; nonblocking `->>` event
|
||||
triggers with optional timing; streaming `with [range]`; constant-expression
|
||||
and packed-type cast bases; net drive strengths; statement-level `let`; and
|
||||
min:typ:max clocking skews. The parser, formatter and AST consumers share these
|
||||
nodes. See [coverage gaps](docs/coverage_gaps.md) for the dated survey and
|
||||
remaining semantic limits.
|
||||
|
||||
Basic Verilog-2001 and the common synthesizable SystemVerilog subset:
|
||||
|
||||
- Modules (ANSI and non-ANSI headers), packages, parameter ports,
|
||||
`import`, `timeunit`
|
||||
- Net/variable declarations (`wire`/`reg`/`logic`/`int`/... , signing,
|
||||
packed/unpacked dimensions, net delays), `parameter`/`localparam`,
|
||||
packed/unpacked dimensions, net delays and net drive strengths), `parameter`/`localparam`,
|
||||
`genvar`, `defparam`
|
||||
- `assign` (with delays), `always`/`always_comb`/`always_ff`/`always_latch`,
|
||||
`initial`/`final`
|
||||
@@ -857,8 +867,8 @@ See `docs/features/corpus-check/README.md` for the 820-file corpus baseline:
|
||||
bucket (26 files) and moved the parse rate from 94.1% to 97.1%; 24 of the
|
||||
26 files format, the other 2 advanced to a macro-items blocker and to the
|
||||
`new obj` shallow-copy expression. `randsequence` remained unsupported at
|
||||
this point; the other vendor/formal constructs listed here landed later in
|
||||
0.30.0
|
||||
this point; it shipped as real nodes in 0.49.0. The other vendor/formal
|
||||
constructs listed here landed in 0.30.0
|
||||
11. ~~A macro statement that ends its line followed by a symbol on the next
|
||||
one, the `new obj` shallow copy (IEEE 1800 §8.12), and a based number
|
||||
whose digits come from a macro (`` 32'h`DM_ADDR ``)~~ — **done**; see
|
||||
@@ -898,6 +908,25 @@ go-to-definition, references and document/workspace symbols — the full list,
|
||||
and what is deliberately *not* advertised yet, is in
|
||||
`docs/features/lucisv-server/README.md`.
|
||||
|
||||
The editor now offers these refactorings alongside rename and port propagation:
|
||||
|
||||
| Action | Behavior |
|
||||
|---|---|
|
||||
| Expand wildcard | Replace `.*` with declaration-order named connections; unmatched ports become `.p()` with a warning |
|
||||
| Convert ports to ANSI | Merge a legacy module header and its body port declarations, preserving comments and attributes |
|
||||
| Organize imports | Remove unused imports, merge exact duplicates and sort a top-of-scope run; uncertainty keeps the action conservative |
|
||||
| Extract module | Move selected whole module items into a named module, infer its interface, and insert the replacement instance; create a file when supported or append below the source module |
|
||||
| Inline module | Copy a separate-file module body into its instance site with simple named-connection substitution and collision-aware internal renaming |
|
||||
|
||||
The [language-tools reference](docs/site/src/content/docs/reference/language-tools.md)
|
||||
records commands and refusal limits. Inline-module has a known transitive
|
||||
source-selection gap; review hierarchical uses through wrapper modules before
|
||||
applying it (topology handshake 33).
|
||||
|
||||
In the VS Code hierarchy, **Star as DUT** groups a module’s children and
|
||||
parents into sections alongside Other Modules. Stars persist per workspace;
|
||||
`lucisv.hierarchy.duts` adds team-configured names, which are locked in the menu.
|
||||
|
||||
**VS Code needs no separate binary**: every release on the
|
||||
[releases page](https://git.luci.ooo/lucio/lucisv/releases) carries a
|
||||
platform-specific `.vsix` with both binaries inside it — pick yours
|
||||
|
||||
@@ -710,7 +710,7 @@ section only tracks the milestones.
|
||||
- [x] **M14 `macro-expansion`** — single-step macro expansion on hover
|
||||
(the define-table README's promised follow-up); version 0.5.0 with a
|
||||
CHANGELOG entry covering M7–M14.
|
||||
- [ ] Backlog (~~extract module~~, inline, ~~`.*` expansion~~, ~~ANSI
|
||||
- [x] Backlog (~~extract module~~, ~~inline~~, ~~`.*` expansion~~, ~~ANSI
|
||||
conversion~~, ~~organize imports~~, …) — triaged in the umbrella README after M5.
|
||||
**`.*` expansion shipped 2026-09-05 (§50,
|
||||
`docs/features/expand-wildcard/README.md`)**: the wildcard written out as
|
||||
@@ -758,6 +758,7 @@ section only tracks the milestones.
|
||||
crossing the boundary, which no port can carry; **an `initial`/`final`
|
||||
block**, whose meaning is when it runs; and **an unpacked-array or
|
||||
interface-typed name** crossing, which the port renderer will not write.
|
||||
**All five delivered in loop 2** (§50–§53 across 0.46.0–0.49.0); what each one deliberately refuses is listed under "Open items for loop 3" in the Loop 2 order section.
|
||||
|
||||
## 9. LSP 3.18 protocol audit (2026-08-26)
|
||||
|
||||
@@ -4643,8 +4644,43 @@ re-exports (topo 16) → §49 cross-file instance-member tail in rename
|
||||
0.46.0 → §52 organize imports → §53.1 extract module → 0.47.0 →
|
||||
**§56 DUT-centred hierarchy view (owner request 2026-09-06) → 0.48.0** →
|
||||
§53.2 inline module (its own lane; 53.1 consumed the round, as planned)
|
||||
→ §54 coverage gaps L3/L6/L10 → 0.49.0. Sections after §46 are planned when
|
||||
reached.
|
||||
→ §54 coverage gaps L3/L6/L10 → 0.49.0.
|
||||
|
||||
**Closed 2026-09-07.** Every section above shipped in the release named:
|
||||
0.44.0 (§45, §46), 0.45.0 (§47–§49), 0.46.0 (§50, §51), 0.47.0 (§52,
|
||||
§53.1), 0.48.0/0.48.2 (§56; 0.48.0's first packages were built a commit
|
||||
early and 0.48.1 never built — see the changelog), 0.49.0 (§53.2, §54).
|
||||
Loop 2's dev/QA/lead protocol ran in the main tree with no worktrees;
|
||||
its two release slips are recorded in CLAUDE.md's rules of thumb below
|
||||
(§57) and in the lead's memory.
|
||||
|
||||
**Open items for loop 3** (owner decides; nothing here is in flight):
|
||||
- §44 second finding ruled non-hot; §55 `state.rs` decomposition (958
|
||||
lines, three sentences) — a Fable refactor lane;
|
||||
- topo §2.9-31 DPI-export name binding (dpi-export request (b));
|
||||
- topo §2.9-32 the refactoring verifier and a same-file relocation of a
|
||||
never-dropped piece written as two edits (eq. 3 unreachable);
|
||||
- topo §2.9-33 `module_sources` lacks a transitive-instantiators rung
|
||||
(inline-module's hierarchical scan sees only the handed files);
|
||||
- inline module's deliberate refusals worth their own rounds: same-file
|
||||
`S`, unconnected outputs, any `generate`, prefixing past end labels;
|
||||
extract module's: attributes on absorbed declarations (§51 too), an
|
||||
`interface`'s non-ANSI header (§51), a `.*` inside a `bind` (§50);
|
||||
- `uvm-utils-indent` default (off; 21 corpus files change when on) —
|
||||
revisit after use;
|
||||
- organize imports on files with `` `include``s (refused by design —
|
||||
the preprocessor question, TODO §7's standing non-goal);
|
||||
- **perf take 4 (§58, 2026-09-07) filed:** the lazy `codeAction` offer
|
||||
costs 2–3 ms more at every cursor because `inline_site`/`extract_site`
|
||||
each re-parse the buffer the server already holds (take 4 §8.2 — the
|
||||
fix is §37.1's shape: gate on the document's own tree); §49's tail
|
||||
rename at 751 ms for two files vs 66 ms for one (§8.3 — look at
|
||||
rename's reference walk first, completion on the same surface is
|
||||
free); `check --select error,warning,style` 1.27× on `hw/ip` after
|
||||
`unused-import` (§8.4); two instance-head tails that do not resolve
|
||||
(`pwrmgr.sv` 178:10 in a macro argument, `pinmux.sv` 687:40; §8.5 —
|
||||
a ruling, not a fix); the index +14% at codec 19 (§8.6, watch).
|
||||
Sections after §46 are planned when reached.
|
||||
|
||||
## 45. Small items, round 4 (planned 2026-09-05) — topo §2.9-29, 30, 17, 22
|
||||
|
||||
@@ -4978,7 +5014,10 @@ scope/widen logic, the document store, and the source selectors
|
||||
owner decides where it goes in loop 2.
|
||||
|
||||
- [ ] `state.rs` decomposition (pure move, byte-identical output, test
|
||||
count unchanged); CLAUDE.md's measurement line refreshed
|
||||
count unchanged); CLAUDE.md's measurement line refreshed —
|
||||
**deferred to loop 3 by the lead, 2026-09-07** (958 lines at 0.49.0;
|
||||
the measurement line already says so); a Fable refactor lane when
|
||||
the owner schedules it
|
||||
|
||||
## 50. `.*` expansion (planned 2026-09-05) — the first §8 refactoring
|
||||
|
||||
@@ -5451,7 +5490,8 @@ the existing bookmark does (`hierarchyView.js` `BOOKMARK_KEY`).
|
||||
- [x] 56.2 view: section nodes, icons, context values, persistence,
|
||||
setting union
|
||||
- [x] 56.3 commands, menus, package.json, tests, acceptance checklist row
|
||||
- [ ] docs (lead applies README/site)
|
||||
- [x] docs (lead applies README/site) — applied 2026-09-06 (site editors
|
||||
paragraph, topo node; the extension README rows were the dev's)
|
||||
- [x] Gates: `node --test editors/vscode/*_test.js`; vsix smoke; the plain
|
||||
view pinned unchanged
|
||||
- [x] QA: every section shape attacked on the fixture and on opentitan
|
||||
@@ -5462,29 +5502,160 @@ the existing bookmark does (`hierarchyView.js` `BOOKMARK_KEY`).
|
||||
After §53.2 and §54 merge and 0.49.0 ships, the last lane of loop 2 is the
|
||||
lead's own, no dev/QA:
|
||||
|
||||
- [ ] **Tree:** `git status --porcelain` empty; `git worktree list` shows
|
||||
- [x] **Tree:** `git status --porcelain` empty; `git worktree list` shows
|
||||
the main tree only; `git branch` shows `master` only; no local tag
|
||||
that is not on the server; no stray files in the tree
|
||||
(`corpus-check-results.tsv` is ignored — fine); the scratchpad and
|
||||
`~/.cache/lucisv-baselines/wip-*` snapshots deleted.
|
||||
- [ ] **Remote:** `master` pushed and equal to local; every release tag
|
||||
`~/.cache/lucisv-baselines/wip-*` snapshots deleted. — done
|
||||
2026-09-07 at 4c2dae3 (main tree only, `master` only, every local
|
||||
tag on the server, snapshots and scratch leftovers removed).
|
||||
- [x] **Remote:** `master` pushed and equal to local; every release tag
|
||||
on the server; every release with 8 assets; the published vsix of
|
||||
the final release unzipped and checked for the feature files of
|
||||
loop 2 (`hierarchySections.js`, `extract.js`, no `*_test.js`).
|
||||
- [ ] **TODO.md:** every checkbox either ticked or annotated with a
|
||||
— done 2026-09-07: v0.49.0 has 8 assets (run 270); the darwin-arm64
|
||||
vsix carries `hierarchySections.js` and `extract.js`, no `*_test.js`,
|
||||
version 0.49.0.
|
||||
- [x] **TODO.md:** every checkbox either ticked or annotated with a
|
||||
dated ruling (deferred to whom, or dropped why); the "Loop 2 order"
|
||||
section closed with what shipped in which release; §44/§55 and the
|
||||
topo §2.9 open rows (23 done; 29/30 done; 31 DPI export, 32 the
|
||||
verifier same-file relocation) restated in one "open items" list
|
||||
for loop 3.
|
||||
- [ ] **Docs:** `docs/topo.md` rows for every loop-2 lane present;
|
||||
for loop 3. — done 2026-09-07: the only unticked lines left are
|
||||
§55 (deferred, annotated) and the §57 items that wait on the
|
||||
0.49.0 assets.
|
||||
- [x] **Docs:** `docs/topo.md` rows for every loop-2 lane present;
|
||||
`docs/coverage_gaps.md` struck where delivered; CLAUDE.md's
|
||||
measurement line refreshed (`state.rs` 957 lines → whatever §55
|
||||
leaves it; if §55 does not run, the number and the reason);
|
||||
`docs/manual-acceptance.md` rows through §56; the site rebuilt and
|
||||
committed.
|
||||
- [ ] **Memory:** the paused-state memory rewritten as a short current
|
||||
committed. — done 2026-09-07 (CLAUDE.md re-measured at 0.49.0:
|
||||
state.rs 958 with §55 filed; topo rows for §36–§56; L3/L6/L9/L10
|
||||
struck; acceptance rows 15–17; site rebuilt in the §54 commit).
|
||||
- [x] **Memory:** the paused-state memory rewritten as a short current
|
||||
state (not a running log), with the release list and the open items.
|
||||
- [ ] **Closing release:** if anything above changed a shipped file
|
||||
— done 2026-09-07.
|
||||
- [x] **Closing release:** if anything above changed a shipped file
|
||||
(docs count), a final release `0.49.x`/`0.50.0` cut from the clean
|
||||
tree, its assets verified, and the install line given to the owner.
|
||||
— **ruled 2026-09-07: 0.49.0 is the closing release.** The commits
|
||||
after it are TODO/CLAUDE.md/memory bookkeeping only — nothing that
|
||||
reaches a binary, the extension or the site — so no further tag.
|
||||
|
||||
## 58. Performance take 4 on opentitan (owner request 2026-09-07) — 0.49.0 vs 0.43.0 vs take 3
|
||||
|
||||
§40's protocol, one release later. Read-only measurement; a regression is
|
||||
filed with a reproduction, not fixed in this lane. Output:
|
||||
`docs/performance_take4.md`, the same table shapes as
|
||||
`docs/performance_take3.md` so every row is a before/after (take 3's
|
||||
0.43.0 column carried beside the new 0.49.0 column; 0.39.0 where take 3
|
||||
had it), plus a `docs/perf/README.md` entry. Tree:
|
||||
`/Users/guoliangchen/repo/opentitan` (never written; the three
|
||||
pre-existing modified files stay as they are, `git status --porcelain`
|
||||
checked after every phase). Every run under `tools/guard.sh -m 8 -t 1800`.
|
||||
No `cargo` command in any tree during a timed measurement.
|
||||
|
||||
Binaries: the 0.49.0 CLI is `~/.cache/lucisv-baselines/lucisv-0.49.0`
|
||||
(0.43.0 and 0.39.0 beside it); the 0.49.0 server is
|
||||
`target/release/lucisv-server` in the main tree (the tree's code is
|
||||
4c2dae3 = v0.49.0 — verify by sha or `--version` before use, rebuild
|
||||
once with `cargo build --release -p lucisv_server` only if it is stale,
|
||||
before any timing); the 0.43.0 server is built from the `v0.43.0` tag in a
|
||||
scratch `git worktree` under the scratchpad and the worktree removed after.
|
||||
|
||||
- **The harness is committed this time.** Take 2's client was lost and
|
||||
take 3's was reimplemented from prose; take 3's is gone too (the
|
||||
scratchpad is volatile). Take 4's client and drivers live in
|
||||
`tools/perf/` (`lspclient.py`, `bench.py`, `sweep.sh`,
|
||||
`sweeptable.py`, `outcomes.sh`; Python 3 standard library only, a
|
||||
short README saying how to run each phase). Take 5 reuses them.
|
||||
- **Server, the take-3 request table** (take 3 §2, every row): startup
|
||||
and scan per scope config and cache state (cold / warm), the `didOpen`
|
||||
widen at the default scope, `codeAction` at the take-3 cursors (lazy
|
||||
offer and eager, plus `codeAction/resolve` where an action is offered),
|
||||
`prepareRename` / `rename`, `completion`, `definition`, `hover`,
|
||||
`inlayHint`, `references`, `documentSymbol`, `workspaceSymbol`,
|
||||
`semanticTokens/full`, diagnostics publish, the queue-blocking analysis
|
||||
(take 3 §3), the transport baseline and the `--verbose` cross-check
|
||||
(take 3 §0).
|
||||
- **New rows for what 0.44–0.49 added**, each with the 0.43.0 column
|
||||
beside it where the request exists there:
|
||||
- the `didOpen` delay (§46) confirmed on the wire in the release build:
|
||||
`didOpen` → the request behind it for `aes.sv`, `aes_core.sv`,
|
||||
`spi_device.sv`, `pinmux_reg_top.sv` (the perf README's 2026-09-05
|
||||
table was taken with temporary timings — this is the release
|
||||
number);
|
||||
- `codeAction` at the new offer sites: a `.*` instance (expand
|
||||
wildcard), a non-ANSI module header (convert to ANSI), an `import`
|
||||
line (organize imports), a selection of a few module items (extract
|
||||
module), a separate-file instance with named connections (inline
|
||||
module) — the lazy offer and one `resolve` each; how many actions
|
||||
each cursor offers, so the reader knows what was paid for;
|
||||
- `rename` of a net reached through an instance tail (§49's
|
||||
hierarchical surface) and `completion` after `u_x.` on an instance
|
||||
head — pick real opentitan sites and name them;
|
||||
- `lucisv/moduleHierarchy` (the snapshot the DUT view consumes; the
|
||||
sections themselves are client-side and not measured here);
|
||||
- index store size on disk and the server's peak RSS after the
|
||||
workspace scan, 0.43.0 vs 0.49.0 (`FACTS_FORMAT` 18 → 19 added the
|
||||
hierarchical member table and the re-export group).
|
||||
- **CLI sweeps** as take 3 §7 over the same five trees: `format --check`
|
||||
(cold cache and warm), `check` (default rules; `--select
|
||||
error,warning,style`), wall time and peak RSS, 0.49.0 vs 0.43.0 vs
|
||||
0.39.0; failure counts per tree and every per-file outcome that changed
|
||||
since 0.43.0 (expected candidates: §54's grammar — `randsequence`,
|
||||
`->>`, casts, drive strengths, `let`, clocking skews — and §38's
|
||||
outcomes staying fixed; anything else is a finding). The formatter cache
|
||||
goes to a scratch `--cache-dir`; the index cache to a scratch
|
||||
`storagePath`.
|
||||
- **Method** as take 3 §9: three tries per row, first try and repeat
|
||||
range reported, machine state noted (load average before and after
|
||||
each phase; the machine runs a desktop session — say so).
|
||||
- **Findings:** any row slower than take 3 by more than noise is a filed
|
||||
item with a reproduction; anything faster is credited to the section
|
||||
that did it. The eager `codeAction` path is ruled a non-hot path
|
||||
(owner, 2026-09-05) — report it, do not re-file it.
|
||||
- Feature README: `docs/features/performance-take4/README.md` (Goal,
|
||||
Assumptions, Handshakes, Status, Work log, QA log, Review).
|
||||
|
||||
- [x] harness in `tools/perf/` with its README; runs from a clean checkout
|
||||
- [x] server table re-measured, 0.49.0 vs 0.43.0 vs take 3 — take 4 §2
|
||||
- [x] new rows: didOpen release numbers, the five refactoring offer sites,
|
||||
tail rename and instance-head completion, moduleHierarchy, index
|
||||
size and RSS
|
||||
- [x] CLI sweeps, three binaries, RSS included; outcome diff since 0.43.0
|
||||
- [x] `docs/performance_take4.md` + perf README entry
|
||||
- [x] opentitan status unchanged after every phase; no guard kill
|
||||
- [x] QA: a sample of at least eight rows re-run with the committed
|
||||
harness (both binaries) and checked against the document within its
|
||||
stated tolerance; the outcome diff re-derived; opentitan status;
|
||||
every number quoted in the document found in the raw logs
|
||||
|
||||
## 59. The format cache key omits `uvm-utils-indent` (topo §2.9-34, owner's audit 2026-09-07)
|
||||
|
||||
Filed by the repository analysis: `lucisv_core::cache::Entry` and
|
||||
`lucisv/src/main.rs::entry_for` key a verdict on content, `line-length`
|
||||
and `indent` (and the lucisv version), so toggling `[format]
|
||||
uvm-utils-indent` after a clean `--check` keeps the stale clean verdict
|
||||
(`--check` exits 0 while `--no-cache --check` exits 1). Runs after §58
|
||||
(no build during a timed measurement). Feature README:
|
||||
`docs/features/format-cache/README.md` (work log entry, Handshakes
|
||||
amended: the key now names the option).
|
||||
|
||||
- **The key.** `Entry` gains `uvm_utils_indent: bool`; `entry_for`
|
||||
fills it from `Config`; the store line carries it as a fifth field and
|
||||
a line without it (an older store) is dropped individually, like
|
||||
another version's entry. Equality and the codec round-trip tested in
|
||||
`cache.rs`.
|
||||
- **Regression** as the audit's probe, through the real CLI: a UVM class
|
||||
with `uvm_field_int`, cache a clean verdict with the option false,
|
||||
flip to true → `--check` exits 1; and the other direction.
|
||||
- README: the `--no-cache` workaround paragraph in `README.md` and the
|
||||
topo row 34 struck at merge (lead).
|
||||
|
||||
- [x] `Entry`/`entry_for`/store codec, tests
|
||||
- [x] CLI regression, both toggle directions
|
||||
- [x] format-cache README work log + Handshakes
|
||||
- [x] QA: attack the key (another option, another version, a store line
|
||||
with four fields); confirm the audit's probe passes on the fix and
|
||||
fails on 0.49.0
|
||||
@@ -333,7 +333,12 @@ fn process_file(file: &Path, config: &Config, opts: &Options, cache: &Cache) ->
|
||||
/// the key, not the config file that produced them, so identical settings
|
||||
/// from different `lucisv.toml` files share entries.
|
||||
fn entry_for(content: u64, config: &Config) -> Entry {
|
||||
Entry { content, line_length: config.max_width, indent: config.indent_width }
|
||||
Entry {
|
||||
content,
|
||||
line_length: config.max_width,
|
||||
indent: config.indent_width,
|
||||
uvm_utils_indent: config.uvm_utils_indent,
|
||||
}
|
||||
}
|
||||
|
||||
/// Builds rayon's global pool. Worker stacks are sized for the parser's
|
||||
|
||||
@@ -1267,16 +1267,18 @@ impl TempDir {
|
||||
}
|
||||
}
|
||||
|
||||
/// One hand-written cache line, for the tests that forge entries.
|
||||
/// One hand-written cache line, for the tests that forge entries. The
|
||||
/// fields are the store's, in order; `uvm` is `[format] uvm-utils-indent`.
|
||||
fn cache_line(
|
||||
path: &str,
|
||||
content: &str,
|
||||
line_length: usize,
|
||||
indent: usize,
|
||||
uvm: bool,
|
||||
version: &str,
|
||||
) -> String {
|
||||
let hash = lucisv_core::cache::content_hash(content.as_bytes());
|
||||
format!("{hash:016x}\t{line_length}\t{indent}\t{version}\t{path}\n")
|
||||
format!("{hash:016x}\t{line_length}\t{indent}\t{uvm}\t{version}\t{path}\n")
|
||||
}
|
||||
|
||||
#[test]
|
||||
@@ -1363,7 +1365,8 @@ fn a_hit_skips_the_work_entirely() {
|
||||
let out = run_raw(&["--check", &path, "--cache-dir", &cache]);
|
||||
assert_eq!(code(&out), 2, "without an entry this file is an error");
|
||||
|
||||
std::fs::write(dir.cache_file(), cache_line(&path, UNPARSEABLE, 100, 2, VERSION)).unwrap();
|
||||
std::fs::write(dir.cache_file(), cache_line(&path, UNPARSEABLE, 100, 2, false, VERSION))
|
||||
.unwrap();
|
||||
let out = run_raw(&["--check", &path, "--cache-dir", &cache]);
|
||||
assert_eq!(code(&out), 0, "a hit does no work at all: {}", stderr(&out));
|
||||
assert!(stderr(&out).contains("1 file from cache"), "{}", stderr(&out));
|
||||
@@ -1388,6 +1391,65 @@ fn a_config_file_change_invalidates_the_entry_too() {
|
||||
assert!(stderr(&out).contains("1 file from cache"), "{}", stderr(&out));
|
||||
}
|
||||
|
||||
/// A UVM class whose layout depends on `[format] uvm-utils-indent`: with the
|
||||
/// option on, the `` `uvm_field_* `` macro gains a level. Written here as the
|
||||
/// formatter leaves it with the option *off*.
|
||||
const UVM_CLASS: &str = "class c extends uvm_object;\n `uvm_object_utils_begin(c)\n \
|
||||
`uvm_field_int(a, UVM_DEFAULT)\n `uvm_object_utils_end\nendclass\n";
|
||||
|
||||
#[test]
|
||||
fn changing_uvm_utils_indent_invalidates_the_entry() {
|
||||
let dir = TempDir::new("cache-uvm");
|
||||
dir.write("lucisv.toml", "[format]\nuvm-utils-indent = false\n");
|
||||
let path = dir.write("a.sv", UVM_CLASS);
|
||||
let cache = dir.cache();
|
||||
|
||||
// Clean with the option off, and that verdict is cached.
|
||||
assert_eq!(code(&run_raw(&[&path, "--cache-dir", &cache])), 0);
|
||||
let flat = dir.read("a.sv");
|
||||
let out = run_raw(&["--check", &path, "--cache-dir", &cache]);
|
||||
assert_eq!(code(&out), 0, "{}", stderr(&out));
|
||||
assert!(stderr(&out).contains("1 file from cache"), "{}", stderr(&out));
|
||||
|
||||
// Turning the option on must not hit the entry the option-off run left.
|
||||
dir.write("lucisv.toml", "[format]\nuvm-utils-indent = true\n");
|
||||
let out = run_raw(&["--check", &path, "--cache-dir", &cache]);
|
||||
assert_eq!(code(&out), 1, "uvm-utils-indent is part of the key: {}", stderr(&out));
|
||||
assert!(stdout(&out).contains("would reformat:"), "{}", stdout(&out));
|
||||
|
||||
// Format under the option on, cache *that*, then flip back off.
|
||||
assert_eq!(code(&run_raw(&[&path, "--cache-dir", &cache])), 0);
|
||||
assert_ne!(dir.read("a.sv"), flat, "the option really does change the output");
|
||||
let out = run_raw(&["--check", &path, "--cache-dir", &cache]);
|
||||
assert_eq!(code(&out), 0, "{}", stderr(&out));
|
||||
assert!(stderr(&out).contains("1 file from cache"), "{}", stderr(&out));
|
||||
|
||||
dir.write("lucisv.toml", "[format]\nuvm-utils-indent = false\n");
|
||||
let out = run_raw(&["--check", &path, "--cache-dir", &cache]);
|
||||
assert_eq!(code(&out), 1, "and the other direction too: {}", stderr(&out));
|
||||
assert!(stdout(&out).contains("would reformat:"), "{}", stdout(&out));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn a_store_written_before_the_option_joined_the_key_is_rebuilt() {
|
||||
let dir = TempDir::new("cache-oldshape");
|
||||
let path = dir.write("a.sv", FORMATTED);
|
||||
let cache = dir.cache();
|
||||
std::fs::create_dir_all(dir.path.join("cache-dir")).unwrap();
|
||||
|
||||
// The five-field line lucisv wrote before `uvm-utils-indent` was in the
|
||||
// key. Not corruption: the line is dropped on its own and the run
|
||||
// rebuilds the store in the current shape.
|
||||
let hash = lucisv_core::cache::content_hash(FORMATTED.as_bytes());
|
||||
std::fs::write(dir.cache_file(), format!("{hash:016x}\t100\t2\t{VERSION}\t{path}\n")).unwrap();
|
||||
let out = run_raw(&["--check", &path, "--cache-dir", &cache]);
|
||||
assert_eq!(code(&out), 0, "an older store is never an error: {}", stderr(&out));
|
||||
assert!(!stderr(&out).contains("from cache"), "{}", stderr(&out));
|
||||
|
||||
let out = run_raw(&["--check", &path, "--cache-dir", &cache]);
|
||||
assert!(stderr(&out).contains("1 file from cache"), "the store was rebuilt: {}", stderr(&out));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn an_entry_from_another_lucisv_version_is_ignored() {
|
||||
let dir = TempDir::new("cache-version");
|
||||
@@ -1397,13 +1459,14 @@ fn an_entry_from_another_lucisv_version_is_ignored() {
|
||||
|
||||
// A forged entry claiming this unformatted file is clean. With this
|
||||
// version's stamp it is believed…
|
||||
std::fs::write(dir.cache_file(), cache_line(&path, UNFORMATTED, 100, 2, VERSION)).unwrap();
|
||||
std::fs::write(dir.cache_file(), cache_line(&path, UNFORMATTED, 100, 2, false, VERSION))
|
||||
.unwrap();
|
||||
let out = run_raw(&["--check", &path, "--cache-dir", &cache]);
|
||||
assert_eq!(code(&out), 0, "the forged entry proves entries are really read");
|
||||
assert!(stderr(&out).contains("1 file from cache"), "{}", stderr(&out));
|
||||
|
||||
// …and with any other version's stamp it is not.
|
||||
std::fs::write(dir.cache_file(), cache_line(&path, UNFORMATTED, 100, 2, "0.0.0-other"))
|
||||
std::fs::write(dir.cache_file(), cache_line(&path, UNFORMATTED, 100, 2, false, "0.0.0-other"))
|
||||
.unwrap();
|
||||
let out = run_raw(&["--check", &path, "--cache-dir", &cache]);
|
||||
assert_eq!(code(&out), 1, "another version's entry must not be trusted: {}", stderr(&out));
|
||||
|
||||
@@ -32,6 +32,9 @@ pub struct Entry {
|
||||
pub line_length: usize,
|
||||
/// The `indent` that verdict was reached under.
|
||||
pub indent: usize,
|
||||
/// The `[format] uvm-utils-indent` that verdict was reached under: it
|
||||
/// changes the output of a UVM class, so it is part of the key.
|
||||
pub uvm_utils_indent: bool,
|
||||
}
|
||||
|
||||
/// The cache for one run: loaded once at startup, written once at exit.
|
||||
@@ -104,8 +107,8 @@ impl Cache {
|
||||
let entry = &self.entries[path];
|
||||
let _ = writeln!(
|
||||
text,
|
||||
"{:016x}\t{}\t{}\t{VERSION}\t{path}",
|
||||
entry.content, entry.line_length, entry.indent
|
||||
"{:016x}\t{}\t{}\t{}\t{VERSION}\t{path}",
|
||||
entry.content, entry.line_length, entry.indent, entry.uvm_utils_indent
|
||||
);
|
||||
}
|
||||
text
|
||||
@@ -137,25 +140,49 @@ fn key(path: &Path) -> Option<&str> {
|
||||
Some(text)
|
||||
}
|
||||
|
||||
/// The `(content, line-length, indent)` prefix every store line has ever
|
||||
/// begun with, or `None` when those three fields are not what lucisv writes.
|
||||
fn prefix(content: &str, line_length: &str, indent: &str) -> Option<(u64, usize, usize)> {
|
||||
Some((u64::from_str_radix(content, 16).ok()?, line_length.parse().ok()?, indent.parse().ok()?))
|
||||
}
|
||||
|
||||
/// Parses the store. `None` means "this file is not something lucisv wrote"
|
||||
/// — one malformed line discards the whole cache, because partial trust in
|
||||
/// a file already caught lying is not worth the branch. Entries from
|
||||
/// another lucisv version are dropped individually; that is staleness, not
|
||||
/// corruption.
|
||||
/// another lucisv version, and lines written in an older field layout, are
|
||||
/// dropped individually; that is staleness, not corruption.
|
||||
fn parse(text: &str) -> Option<HashMap<String, Entry>> {
|
||||
let mut entries = HashMap::new();
|
||||
for line in text.lines() {
|
||||
let mut fields = line.splitn(5, '\t');
|
||||
let content = u64::from_str_radix(fields.next()?, 16).ok()?;
|
||||
let line_length = fields.next()?.parse().ok()?;
|
||||
let indent = fields.next()?.parse().ok()?;
|
||||
let version = fields.next()?;
|
||||
let path = fields.next()?;
|
||||
if path.is_empty() {
|
||||
return None;
|
||||
}
|
||||
if version == VERSION {
|
||||
entries.insert(path.to_string(), Entry { content, line_length, indent });
|
||||
let fields: Vec<&str> = line.splitn(6, '\t').collect();
|
||||
match fields[..] {
|
||||
[content, line_length, indent, uvm, version, path] => {
|
||||
let (content, line_length, indent) = prefix(content, line_length, indent)?;
|
||||
let uvm_utils_indent = uvm.parse().ok()?;
|
||||
if path.is_empty() {
|
||||
return None;
|
||||
}
|
||||
if version == VERSION {
|
||||
entries.insert(
|
||||
path.to_string(),
|
||||
Entry { content, line_length, indent, uvm_utils_indent },
|
||||
);
|
||||
}
|
||||
}
|
||||
// A store written before `uvm-utils-indent` joined the key: a
|
||||
// well-formed line of that older shape says nothing about the
|
||||
// option, so it is dropped individually, exactly like another
|
||||
// version's entry. (The version field alone already makes such
|
||||
// a store miss; the codec stays self-describing anyway.)
|
||||
// Anything else on five fields is corruption and discards the
|
||||
// file like any other malformed line.
|
||||
[content, line_length, indent, _version, path] => {
|
||||
prefix(content, line_length, indent)?;
|
||||
if path.is_empty() {
|
||||
return None;
|
||||
}
|
||||
}
|
||||
_ => return None,
|
||||
}
|
||||
}
|
||||
Some(entries)
|
||||
@@ -201,7 +228,7 @@ mod tests {
|
||||
}
|
||||
|
||||
fn entry(content: u64) -> Entry {
|
||||
Entry { content, line_length: 100, indent: 2 }
|
||||
Entry { content, line_length: 100, indent: 2, uvm_utils_indent: false }
|
||||
}
|
||||
|
||||
#[test]
|
||||
@@ -234,9 +261,53 @@ mod tests {
|
||||
assert!(!reloaded.is_clean(&file, entry(0xbeef)));
|
||||
assert!(!reloaded.is_clean(&file, Entry { line_length: 80, ..entry(0xdead) }));
|
||||
assert!(!reloaded.is_clean(&file, Entry { indent: 4, ..entry(0xdead) }));
|
||||
assert!(!reloaded.is_clean(&file, Entry { uvm_utils_indent: true, ..entry(0xdead) }));
|
||||
assert!(!reloaded.is_clean(Path::new("other.sv"), entry(0xdead)));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn uvm_utils_indent_alone_is_a_different_entry() {
|
||||
let on = Entry { uvm_utils_indent: true, ..entry(0xdead) };
|
||||
assert_ne!(entry(0xdead), on, "the option is part of equality");
|
||||
|
||||
// …and it survives the round trip through the store, on its own.
|
||||
let dir = TempDir::new("uvm");
|
||||
let file = dir.file("a.sv");
|
||||
let mut cache = Cache::load(&dir.path);
|
||||
cache.record(&file, on);
|
||||
cache.store();
|
||||
assert!(dir.cache_text().contains("\t100\t2\ttrue\t"), "{}", dir.cache_text());
|
||||
|
||||
let reloaded = Cache::load(&dir.path);
|
||||
assert!(reloaded.is_clean(&file, on));
|
||||
assert!(!reloaded.is_clean(&file, entry(0xdead)), "the option must invalidate the entry");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn a_line_without_the_option_is_dropped_but_not_fatal() {
|
||||
// The five-field shape lucisv wrote before `uvm-utils-indent` joined
|
||||
// the key: stale, like another version's entry, never corruption.
|
||||
let dir = TempDir::new("oldshape");
|
||||
let old = dir.file("old.sv");
|
||||
let mine = dir.file("mine.sv");
|
||||
let text = format!(
|
||||
"{:016x}\t100\t2\t{VERSION}\t{}\n{:016x}\t100\t2\tfalse\t{VERSION}\t{}\n",
|
||||
1,
|
||||
old.to_string_lossy(),
|
||||
2,
|
||||
mine.to_string_lossy()
|
||||
);
|
||||
std::fs::write(dir.path.join(FILE), text).unwrap();
|
||||
|
||||
let cache = Cache::load(&dir.path);
|
||||
assert!(!cache.is_clean(&old, entry(1)), "a line without the option must not be trusted");
|
||||
assert!(cache.is_clean(&mine, entry(2)), "and it does not discard the rest of the file");
|
||||
|
||||
// And it is not carried forward.
|
||||
cache.store();
|
||||
assert!(!dir.cache_text().contains("old.sv"), "{}", dir.cache_text());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn the_file_is_sorted_and_carries_the_version() {
|
||||
let dir = TempDir::new("format");
|
||||
@@ -254,7 +325,7 @@ mod tests {
|
||||
assert!(lines[1].ends_with("b.sv"), "sorted by path: {text}");
|
||||
assert_eq!(
|
||||
lines[0],
|
||||
format!("{:016x}\t100\t2\t{VERSION}\t{}", 1, a.to_string_lossy()),
|
||||
format!("{:016x}\t100\t2\tfalse\t{VERSION}\t{}", 1, a.to_string_lossy()),
|
||||
"{text}"
|
||||
);
|
||||
}
|
||||
@@ -277,12 +348,15 @@ mod tests {
|
||||
"0000000000000001\twide\t2\t0.2.0\t/a.sv\n",
|
||||
"0000000000000001\t100\t2\t0.2.0\n",
|
||||
"0000000000000001\t100\t2\t0.2.0\t\n",
|
||||
"0000000000000001\t100\t2\tyes\t0.2.0\t/a.sv\n",
|
||||
"0000000000000001\t100\t2\tfalse\t0.2.0\t\n",
|
||||
"\0\0\0\n",
|
||||
] {
|
||||
let dir = TempDir::new("corrupt");
|
||||
let file = dir.file("a.sv");
|
||||
// A good line first: a bad one anywhere discards all of them.
|
||||
let good = format!("{:016x}\t100\t2\t{VERSION}\t{}\n", 1, file.to_string_lossy());
|
||||
let good =
|
||||
format!("{:016x}\t100\t2\tfalse\t{VERSION}\t{}\n", 1, file.to_string_lossy());
|
||||
std::fs::write(dir.path.join(FILE), format!("{good}{corrupt}")).unwrap();
|
||||
let cache = Cache::load(&dir.path);
|
||||
assert!(!cache.is_clean(&file, entry(1)), "should have been discarded: {corrupt:?}");
|
||||
@@ -295,7 +369,8 @@ mod tests {
|
||||
let old = dir.file("old.sv");
|
||||
let mine = dir.file("mine.sv");
|
||||
let text = format!(
|
||||
"{:016x}\t100\t2\t0.0.0-not-this-one\t{}\n{:016x}\t100\t2\t{VERSION}\t{}\n",
|
||||
"{:016x}\t100\t2\tfalse\t0.0.0-not-this-one\t{}\n\
|
||||
{:016x}\t100\t2\tfalse\t{VERSION}\t{}\n",
|
||||
1,
|
||||
old.to_string_lossy(),
|
||||
2,
|
||||
|
||||
+11
-7
@@ -1,6 +1,6 @@
|
||||
# Verilog/SystemVerilog coverage gaps — ranked (2026-09-01)
|
||||
|
||||
**Reading this report today (2026-09-05).** The survey below is a historical
|
||||
**Reading this report today (2026-09-07).** The survey below is a historical
|
||||
v0.21.0 measurement with later amendments, not a fresh list of current failures.
|
||||
Use [repository-analysis.md](repository-analysis.md) and [topo.md](topo.md) for
|
||||
current implementation status. Original probe counts remain historical.
|
||||
@@ -12,12 +12,16 @@ The prior audit's atomic-write, project lint-selection and directory-cycle
|
||||
findings are also fixed. Bare item-level `begin` blocks are recovered for
|
||||
lint/editor consumers; strict formatting still refuses them.
|
||||
|
||||
At committed `9ef1058`, type-name spans replace `vlog_semantic/src/scan.rs`,
|
||||
and package re-exports resolve through shared member edges (facts codec 18).
|
||||
Both are accepted for the next release. The active hierarchical-tail work
|
||||
proposes codec 19; QA is pending, and handshake 23 remains open. DPI-export
|
||||
name binding is a separate remaining gap (handshake 31), and generate-block
|
||||
hierarchy and cross-file macro expansion remain outside these fixes.
|
||||
Current snapshot **`df4e714`**, latest release **v0.49.0**: type-name spans,
|
||||
package re-exports and hierarchical tails shipped in v0.45.0 (facts codec
|
||||
**19**, handshake 23 closed). v0.46–0.49 added five refactorings, the
|
||||
`unused-import` rule (**74 rules** total), and the DUT hierarchy view. The
|
||||
L3 grammar forms, L6 real `randsequence` nodes, L9 ANSI conversion and L10
|
||||
optional UVM indentation are delivered, as annotated below. DPI-export name
|
||||
binding (handshake 31), generate-block hierarchy and cross-file macro expansion
|
||||
remain gaps. Refactor handshakes 32–33 and the newly reproduced UVM-option
|
||||
cache omission (34, fixed in 0.50.0 by TODO §59) are detailed in the current repository analysis. These
|
||||
status updates do not replace the original survey with a new corpus sweep.
|
||||
|
||||
What lucisv 0.21.0 does not yet handle, ranked by severity, from two
|
||||
independent sweeps crossed against each other:
|
||||
|
||||
@@ -23,12 +23,17 @@ what they would have been anyway (modulo one extra summary segment).
|
||||
assumption parallel-files already relies on. If that ever stops being
|
||||
true (a formatter that reads the file's *name*, or another file), this
|
||||
cache silently goes wrong and the assumption must be revisited here.
|
||||
- **`line-length` and `indent` are the whole config surface.** They are
|
||||
the only two things `lucisv_core::config::FileConfig` can put into
|
||||
`vlog_formatter::Config`. The key stores the *resolved values*, not the
|
||||
config file's path or mtime — so moving a `lucisv.toml` around, or
|
||||
switching from a file to an equivalent `--line-length` flag, correctly
|
||||
does **not** invalidate anything, while a real value change does.
|
||||
- **The key covers every `FileConfig` field that reaches the formatter.**
|
||||
Today that is `line-length`, `indent` and `[format] uvm-utils-indent` —
|
||||
everything `lucisv_core::config::FileConfig` can put into
|
||||
`vlog_formatter::Config` (see `lucisv/src/args.rs::config_with`). Any
|
||||
future setting that changes formatted output must join `Entry` and the
|
||||
store line in the same change; a setting left out is a stale clean
|
||||
verdict, which is exactly the bug TODO §59 fixed. The key stores the
|
||||
*resolved values*, not the config file's path or mtime — so moving a
|
||||
`lucisv.toml` around, or switching from a file to an equivalent
|
||||
`--line-length` flag, correctly does **not** invalidate anything, while
|
||||
a real value change does.
|
||||
`exclude` is not part of the key: it changes *which* files are visited,
|
||||
never how one is formatted.
|
||||
- **The version string is the workspace version** (`env!("CARGO_PKG_VERSION")`
|
||||
@@ -56,8 +61,8 @@ what they would have been anyway (modulo one extra summary segment).
|
||||
|
||||
### The key
|
||||
|
||||
Per file: **(content hash, line-length, indent, lucisv version)**, keyed on
|
||||
the file path.
|
||||
Per file: **(content hash, line-length, indent, uvm-utils-indent, lucisv
|
||||
version)**, keyed on the file path.
|
||||
|
||||
- **Content hash: hand-rolled FNV-1a, 64-bit**, over the file's bytes
|
||||
(`cache::content_hash`). Two reasons it is not
|
||||
@@ -111,7 +116,7 @@ the hash of **the bytes that were written** goes in.
|
||||
|
||||
| Situation | Cache read | Cache write | Reported as |
|
||||
|---|---|---|---|
|
||||
| Hit (hash + line-length + indent + version all match) | skip all work | entry kept | `left unchanged`, plus `N files from cache` |
|
||||
| Hit (hash + line-length + indent + uvm-utils-indent + version all match) | skip all work | entry kept | `left unchanged`, plus `N files from cache` |
|
||||
| Miss, file is already formatted | — | record `hash(src)` | `left unchanged` |
|
||||
| Miss, file rewritten in place (write succeeded) | — | record `hash(output)` | `reformatted` |
|
||||
| Miss, `--check`/`--diff` says it would reformat | — | **nothing** | `would be reformatted`, exit 1 |
|
||||
@@ -140,7 +145,7 @@ One text file, `<cache-dir>/cache`, one line per path, tab-separated,
|
||||
hand-rolled in the style of the corpus TSV:
|
||||
|
||||
```
|
||||
<content-hash, 16 hex digits>\t<line-length>\t<indent>\t<version>\t<path>
|
||||
<content-hash, 16 hex digits>\t<line-length>\t<indent>\t<uvm-utils-indent, `true`/`false`>\t<version>\t<path>
|
||||
```
|
||||
|
||||
The path is last because it is the only field that can contain
|
||||
@@ -153,7 +158,7 @@ third-party dependency between them (`rayon`, in `lucisv`). `serde` exists
|
||||
in the workspace only because `lucisv_server` needs it for LSP wire
|
||||
messages — `lucisv`/`lucisv_core` do not depend on it, and taking it here
|
||||
would put a proc-macro build step into the CLI's dependency graph to
|
||||
encode five fields. Five fields on a line need no schema; CLAUDE.md's
|
||||
encode six fields. Six fields on a line need no schema; CLAUDE.md's
|
||||
"standard library first" says so.
|
||||
|
||||
Loading, corruption and staleness:
|
||||
@@ -168,6 +173,15 @@ Loading, corruption and staleness:
|
||||
silently (that is not corruption, just another lucisv's entry). It is not
|
||||
carried forward on write, so alternating between two lucisv versions
|
||||
rebuilds the cache each time.
|
||||
- **A well-formed line in an older field layout is dropped the same way.**
|
||||
A five-field line is the shape lucisv wrote before `uvm-utils-indent`
|
||||
joined the key: it says nothing about the option, so it is skipped
|
||||
individually rather than trusted or treated as corruption. (The version
|
||||
field alone already makes a 0.49.0 store miss at 0.50.0; the tolerance
|
||||
is what keeps the codec self-describing when the two ever come apart —
|
||||
a hand-written store, a downgrade.) A five-field line that is *not*
|
||||
well formed in that older shape is corruption like any other, and
|
||||
discards the file.
|
||||
- **Writing is atomic**: the new text goes to `<cache-dir>/cache.<pid>.tmp`
|
||||
and is `rename`d over `cache`. A reader therefore sees the old file or
|
||||
the new one, never a half-written one.
|
||||
@@ -256,12 +270,19 @@ the only writer of an entry is the code path that just observed
|
||||
- **Consumes `docs/features/config-discovery/README.md`'s promise** that
|
||||
the cache key "must include the resolved per-file settings … not just
|
||||
file content + lucisv version". Done, with the *values*
|
||||
(`Config::max_width`, `Config::indent_width`) rather than the config
|
||||
file's identity, so two trees governed by different `lucisv.toml` files
|
||||
that happen to say the same thing share entries correctly.
|
||||
- **Consumes `vlog_formatter::Config`** read-only, for its two fields.
|
||||
Nothing in `vlog_parser` / `vlog_formatter` / `vlog_linter` was
|
||||
touched.
|
||||
(`Config::max_width`, `Config::indent_width`,
|
||||
`Config::uvm_utils_indent`) rather than the config file's identity, so
|
||||
two trees governed by different `lucisv.toml` files that happen to say
|
||||
the same thing share entries correctly.
|
||||
- **Consumes `vlog_formatter::Config`** read-only, for every field
|
||||
`args.rs::config_with` can set from a `lucisv.toml`. **The contract this
|
||||
crate owes back (TODO §59, 2026-09-07):** a new formatter setting that
|
||||
changes output is a change to `cache::Entry`, to
|
||||
`lucisv/src/main.rs::entry_for` and to the store line, in the same
|
||||
commit — otherwise a warm cache serves the old setting's verdict.
|
||||
`Config::uvm_utils_indent` was added in 0.49.0 without that and is the
|
||||
reason this line exists. Nothing in `vlog_parser` / `vlog_formatter` /
|
||||
`vlog_linter` was touched.
|
||||
- **Where the module lives: `lucisv_core::cache`,** next to `config` and
|
||||
`walk`. `lucisv_core` is by its own doc comment "the parts of lucisv that
|
||||
decide *which* files are processed and *with what settings*", and "this
|
||||
@@ -269,8 +290,9 @@ the only writer of an entry is the code path that just observed
|
||||
It also keeps the door open for `lucisv_server`: a language server that
|
||||
wanted to avoid re-formatting an unedited buffer on save would want the
|
||||
same predicate, and would otherwise have to duplicate the file format.
|
||||
Nothing in the module is CLI-specific — it takes paths, `u64`s and two
|
||||
`usize`s and has no opinion about arguments or reporting.
|
||||
Nothing in the module is CLI-specific — it takes paths and the bare
|
||||
scalars of the key (a `u64`, two `usize`s and a `bool`) and has no
|
||||
opinion about arguments or reporting.
|
||||
- **Promises to whoever changes the formatter's output** (alignment
|
||||
inference, `--lines`, any style change): **bump the workspace version**,
|
||||
or every user with a warm cache keeps their old formatting on files
|
||||
@@ -289,7 +311,10 @@ the only writer of an entry is the code path that just observed
|
||||
(`load` / `disabled` / `is_clean` / `record` / `store`).
|
||||
- [x] Hand-rolled tab-separated store, sorted by path, atomic
|
||||
temp+rename write, self-ignoring `.gitignore` in the cache dir.
|
||||
- [x] Corrupt / unreadable / wrong-version entries ignored, never fatal.
|
||||
- [x] Corrupt / unreadable / wrong-version entries ignored, never fatal;
|
||||
so is a line in the pre-`uvm-utils-indent` five-field shape.
|
||||
- [x] `[format] uvm-utils-indent` in `Entry`, in `entry_for` and as the
|
||||
store's fourth field (TODO §59).
|
||||
- [x] `--no-cache` and `--cache-dir <PATH>` in `args.rs` and `--help`,
|
||||
accepted (and inert) for `lucisv check`.
|
||||
- [x] Lookup at the top of `process_file`; entries collected through the
|
||||
@@ -303,7 +328,8 @@ the only writer of an entry is the code path that just observed
|
||||
content change invalidates, indent change invalidates, wrong
|
||||
version ignored, `--no-cache`, corrupt file tolerated, `--check`
|
||||
exit codes, `--threads` determinism with a warm cache, default
|
||||
cache dir is cwd-relative and self-ignoring).
|
||||
cache dir is cwd-relative and self-ignoring, `uvm-utils-indent`
|
||||
invalidates in both directions, an older store is rebuilt).
|
||||
- [x] Root `.gitignore` entry, `README.md` Cache section, `TODO.md` §3
|
||||
box.
|
||||
- [x] `cargo fmt`, `cargo clippy --all-targets`, `cargo test`.
|
||||
@@ -438,6 +464,75 @@ their work lands.
|
||||
- No `Cargo.toml` / `Cargo.lock` change: no new dependency, and
|
||||
`lucisv_core` still has an empty `[dependencies]`.
|
||||
|
||||
### 2026-09-07 — dev agent (TODO §59: `uvm-utils-indent` joins the key)
|
||||
|
||||
The owner's audit (topo §2.9 row 34, and the "Confirmed cache omission"
|
||||
paragraph of `docs/repository-analysis.md`) found the key stale against
|
||||
0.49.0's `[format] uvm-utils-indent`. `args.rs::config_with` sets
|
||||
`Config::uvm_utils_indent`, the formatter indents `` `uvm_field_* ``
|
||||
under it, but `Entry` and `entry_for` still named only content,
|
||||
line-length and indent — so a clean `--check` cached with the option off
|
||||
kept exiting 0 after the option was turned on, while `--no-cache
|
||||
--check` exited 1. Reproduced first, on the fixture from the audit.
|
||||
|
||||
**The fix, four lines of real change.** `Entry` gains
|
||||
`uvm_utils_indent: bool` (equality is derived, so the key follows for
|
||||
free); `lucisv/src/main.rs::entry_for` fills it from the same `Config`
|
||||
the formatter is handed; `render` writes it as the store's fourth field,
|
||||
`true`/`false`, after `indent` and before the version.
|
||||
|
||||
**Why `true`/`false` and not `0`/`1`.** The parser's style is one
|
||||
`.parse()` per field; `bool: FromStr` accepts exactly `true`/`false`, so
|
||||
the round trip is `{}` out and `.parse().ok()?` back, with no mapping
|
||||
either way and no new failure mode. A numeric encoding would have needed
|
||||
a hand-written `"0" => false` match for no gain.
|
||||
|
||||
**The five-field tolerance.** `parse` now matches on the field slice:
|
||||
six fields is the current shape; five fields *that are well formed in
|
||||
the old shape* (hex content, numeric line-length and indent, non-empty
|
||||
path) is a store written before the option joined the key, and is
|
||||
dropped individually exactly like another version's entry; anything else
|
||||
still discards the whole file, because partial trust in a file caught
|
||||
lying is still not worth the branch. The precision matters — a blanket
|
||||
"wrong field count → skip the line" would have quietly forgiven
|
||||
`not-hex\t100\t2\t0.2.0\t/a.sv`, which the corruption tests require to be
|
||||
fatal. The version field alone already makes a 0.49.0 store miss at
|
||||
0.50.0, so this tolerance buys nothing today; it is there so the codec
|
||||
stays self-describing when the two come apart (a hand-written store, a
|
||||
downgrade).
|
||||
|
||||
**Tests.** `cache.rs`:
|
||||
`uvm_utils_indent_alone_is_a_different_entry` (equality differs on the
|
||||
option alone; the line round-trips carrying it),
|
||||
`a_line_without_the_option_is_dropped_but_not_fatal` (an old-shape line
|
||||
next to a current one: the old one is not trusted, the current one
|
||||
survives, and the old one is not carried forward), plus the option's
|
||||
column added to `entries_round_trip_through_the_file`,
|
||||
`the_file_is_sorted_and_carries_the_version`,
|
||||
`another_versions_entry_is_dropped_but_not_fatal` and two new
|
||||
six-field corruption cases (a non-boolean option, an empty path).
|
||||
`crates/lucisv/tests/cli.rs`:
|
||||
`changing_uvm_utils_indent_invalidates_the_entry` — the audit's own
|
||||
probe through the real binary, in both directions (clean under `false`,
|
||||
cached, flip to `true` → exit 1; format under `true`, cached, flip back
|
||||
to `false` → exit 1) — and
|
||||
`a_store_written_before_the_option_joined_the_key_is_rebuilt`. The CLI
|
||||
regression was checked against the bug: with `entry_for` pinned to
|
||||
`false` it fails with "1 file from cache" at exit 0, which is exactly
|
||||
the audit's step 2.
|
||||
|
||||
**Note for the lead.** `README.md`'s key sentence (line ~89, which still
|
||||
lists four fields) and its `--no-cache` workaround paragraph (lines
|
||||
~99-103, "In v0.49.0, the new `uvm-utils-indent` option is missing from
|
||||
this key") are now stale, as is `docs/topo.md` row 34, and
|
||||
`docs/repository-analysis.md`'s "Confirmed cache omission" paragraph
|
||||
describes a fixed bug. Per the brief this lane did not touch those three
|
||||
files; they are the lead's to strike at merge.
|
||||
|
||||
**Gates:** `cargo fmt` clean, `cargo clippy --all-targets` silent,
|
||||
`cargo test -p lucisv_core` / `-p lucisv` / `--workspace` green, all
|
||||
through `tools/guard.sh -m 8 -t 1800`.
|
||||
|
||||
## QA log
|
||||
|
||||
### 2026-08-19 — QA agent
|
||||
@@ -595,8 +690,219 @@ apply, but the same spirit (attack the exact class of thing that could
|
||||
silently corrupt trust) was applied here to the cache's own trust
|
||||
boundary instead.
|
||||
|
||||
### 2026-09-07 — QA agent (TODO §59: `uvm-utils-indent` joins the key)
|
||||
|
||||
Read CLAUDE.md, TODO §59, this README's amended Handshakes and the
|
||||
2026-09-07 dev entry above, then `git diff` for `cache.rs`, `main.rs`,
|
||||
`cli.rs`. The workspace built clean on trunk this time (no concurrent
|
||||
lane mid-landing), so all gates ran directly, no scratchpad rsync
|
||||
needed.
|
||||
|
||||
**Gates.**
|
||||
- `cargo fmt -- --check`: clean.
|
||||
- `tools/guard.sh -m 8 -t 1800 -- cargo clippy --all-targets`: silent.
|
||||
Re-ran scoped with `-p lucisv_core -p lucisv --all-targets --
|
||||
-D warnings` after a touch to force recompilation (not just a cached
|
||||
"Finished"): still silent.
|
||||
- `tools/guard.sh -m 8 -t 1800 -- cargo test -p lucisv_core -p lucisv`:
|
||||
**36** (`lucisv` unit) + **107** (`cli.rs`) + **102** (`lucisv_core`
|
||||
unit) = 245, all green. (The dev's log counts pre-date this run; §59
|
||||
added 2 `cache.rs` unit tests, 2 `cli.rs` tests, and touched shared
|
||||
corruption-vector tests in place, so the totals climbed from the
|
||||
2026-08-19 136 baseline.) Confirmed
|
||||
`a_store_written_before_the_option_joined_the_key_is_rebuilt` and
|
||||
`changing_uvm_utils_indent_invalidates_the_entry` both present and
|
||||
passing.
|
||||
- `cargo build --release -p lucisv`: clean, used for every probe below
|
||||
as `target/release/lucisv`.
|
||||
|
||||
**Step 2 — the audit's probe, by hand, `--cache-dir` in a scratch dir**
|
||||
(fixture: the UVM class from the brief, `[format]
|
||||
uvm-utils-indent = false` first).
|
||||
|
||||
- Fixed binary: format under `false` → `--check` exits 0, `1 file from
|
||||
cache`. Flip to `true` → `--check` exits **1**, `would reformat:
|
||||
c.sv`. Correct.
|
||||
- 0.49.0 baseline (`~/.cache/lucisv-baselines/lucisv-0.49.0`): same
|
||||
sequence — format under `false`, cache hit, flip to `true` →
|
||||
`--check` exits **0**, `1 file from cache` (the bug, reproduced
|
||||
exactly), while `--check --no-cache` on the same binary correctly
|
||||
says `would reformat` / exit 1 — confirming the option really does
|
||||
change output and only the cache is stale.
|
||||
- Other direction on the fixed binary: format under `true` (file is
|
||||
reformatted, output differs from the `false` rendering — confirmed
|
||||
`assert_ne!`-style by hand), cache hit under `true`, flip to `false`
|
||||
→ exits **1**. Correct.
|
||||
|
||||
**Step 3 — attacking the key.**
|
||||
|
||||
- (a) Entry recorded under `true`, then run under `false` with the
|
||||
same content: `--check` reports `would reformat`, no `from cache` —
|
||||
miss, as required.
|
||||
- (b) Option set via a `lucisv.toml` in a **parent** directory (file
|
||||
under `sub/`, config in the parent, config discovery finds it):
|
||||
formatted clean under `false`, cache hit; flipped the *parent*
|
||||
config to `true` → `--check` exits 1, `would reformat`. The key
|
||||
follows the resolved value regardless of which directory in the
|
||||
chain set it, as the Assumptions section claims.
|
||||
- (c) A store written by the real 0.49.0 binary (five fields) read by
|
||||
the fixed binary: not an error, `1 file left unchanged` **without**
|
||||
"from cache" (the old-shape line is dropped individually, not
|
||||
trusted), and the store is six fields after this run. The next
|
||||
`--check` is then `1 file from cache` in the new shape. Matches the
|
||||
five-field-tolerance branch exactly.
|
||||
- (d) A store written by the fixed binary (six fields) read by the
|
||||
real 0.49.0 binary: read `crates/lucisv_core/src/cache.rs` at
|
||||
`v0.49.0` (`git show v0.49.0:...`) — its parser is
|
||||
`line.splitn(5, '\t')`. Against a six-field line this splits on only
|
||||
the first 4 tabs, so 0.49.0's "version" slot actually receives the
|
||||
*uvm* field's text (`"false"`/`"true"`) and its "path" slot receives
|
||||
everything after that, `"<real-version>\t<real-path>"` (with the
|
||||
join tab folded in raw). Since that captured "version" text is never
|
||||
equal to 0.49.0's own `VERSION` constant, the `if version == VERSION`
|
||||
check fails and the line is silently **not inserted** — the same
|
||||
code path 0.49.0 already uses for "another version's entry," not an
|
||||
error return. No `path.is_empty()` trip either (path is nonempty).
|
||||
Verified empirically: 0.49.0 read the six-field store, did not
|
||||
crash, reported plain `1 file left unchanged` (no "from cache" — a
|
||||
real re-verify, not a false hit, and correct anyway since the file
|
||||
is genuinely clean), and rewrote the store back to its own five-field
|
||||
shape on exit. No false hit, no crash, confirmed both by code
|
||||
reading and by running it.
|
||||
- (e) Six-field line with `uvm` = `"1"`: `bool::from_str` only accepts
|
||||
the literal strings `true`/`false`, so `.parse().ok()?` fails and
|
||||
`parse()` returns `None` → whole store discarded. Verified: seeded a
|
||||
store with one genuine clean entry plus this line, `--check` on the
|
||||
genuine file no longer says "from cache" (it re-verified). The
|
||||
`"yes"` case is already the unit test
|
||||
`a_corrupt_file_is_ignored_wholesale`'s `"...\tyes\t0.2.0\t/a.sv\n"`
|
||||
vector — read it, it exercises the same `.parse().ok()?` branch as
|
||||
`"1"` does (both are non-`true`/`false` strings; no reason for one to
|
||||
behave differently from the other, and this run confirms `"1"`
|
||||
directly since the brief calls it out by name). Five-field line with
|
||||
non-hex content (`"nothex\t100\t2\t0.49.0\tc.sv"`): `prefix()`'s
|
||||
`u64::from_str_radix(content, 16)` fails first, `?` short-circuits
|
||||
before the shape is even fully validated → `None` → discarded.
|
||||
Verified by hand: seeded that single bad line, `--check` did not
|
||||
trust it (no "from cache"), file re-verified clean on its own
|
||||
merits.
|
||||
- (f) Two files, one old-shape (five-field, `a.sv`) and one new-shape
|
||||
(six-field, `b.sv`) line in the same store: `--check a.sv b.sv`
|
||||
reports `2 files left unchanged, 1 file from cache` — exactly one
|
||||
hit (`b.sv`), `a.sv` silently rebuilt, neither line poisoned the
|
||||
other. Matches `a_line_without_the_option_is_dropped_but_not_fatal`.
|
||||
|
||||
Also checked, prompted by the TODO item's own wording ("a store line
|
||||
with four fields"): a genuine four-field line (`hash\t100\t2\t0.49.0`,
|
||||
no `uvm`/no path) matches neither the six- nor the five-field pattern
|
||||
in `parse`'s `match`, falls to `_ => return None`, and **discards the
|
||||
whole store** — including a separately-present, otherwise-good
|
||||
six-field entry for another file. Verified: seeded a good entry for
|
||||
`realfile.sv` plus a bogus four-field line, and the previously-good
|
||||
entry was no longer served ("from cache" absent) on the next
|
||||
`--check`. This is the fourth malformed-line shape (three, five,
|
||||
seven+ fields all land here too, by the same `_` arm) and behaves like
|
||||
every other corruption case — correct, and consistent with "guilty
|
||||
until proven innocent" for a change that *could* have silently
|
||||
widened forgiveness but provably didn't.
|
||||
|
||||
**Step 4 — path shapes that could confound the parser.** Read `parse`
|
||||
and `splitn(6, '\t')`. The path field is always the **last** slot
|
||||
(index 5) of an at-most-6-way split, so no matter what the path
|
||||
contains, it receives everything left after the fifth tab is
|
||||
consumed — it cannot be mistaken for field 4 (`uvm`) and cannot cause
|
||||
a `true`/`false` field to be mis-identified as a path or vice versa:
|
||||
- **Path literally `"true"`**: line
|
||||
`42b10c60d1dbc11a\t100\t2\tfalse\t0.49.0\ttrue` parses to
|
||||
`uvm_utils_indent = false`, `path = "true"` — positionally
|
||||
unambiguous. Verified with a real file named `true` in a scratch
|
||||
dir: formats, caches, hits on the next `--check`.
|
||||
- **Path containing an embedded tab**: `key()` (used both to look up
|
||||
and to record) rejects any path containing `\t` or `\n` outright, so
|
||||
**lucisv itself can never write such a line** — this class is only
|
||||
reachable via a hand-forged/corrupted store. Reasoned from
|
||||
`splitn(6, '\t')`: a forged line
|
||||
`deadbeefdeadbeef\t100\t2\ttrue\t0.49.0\ta\tb.sv` (6 tabs, one more
|
||||
than the 5 the split consumes) parses with `path = "a\tb.sv"` intact
|
||||
— the sixth-and-final split field folds the extra tab in, so it
|
||||
round-trips as one field rather than desyncing the columns. Since
|
||||
`key()` can never *produce* a tab-containing lookup key for a real
|
||||
file, this forged entry can never be hit by any real run; verified
|
||||
by seeding exactly this line plus a real file, confirming no crash
|
||||
and no false hit, and that the forged line (path does not exist on
|
||||
disk) is silently pruned by `render()`'s existence check on the next
|
||||
write.
|
||||
|
||||
**Step 5 — README cross-check.** Handshakes' "Consumes
|
||||
`vlog_formatter::Config`" paragraph states the obligation on the next
|
||||
formatter setting explicitly, naming `Entry`, `entry_for` and "the
|
||||
store line" together, in the same commit — matches CLAUDE.md's rule 4
|
||||
posture (widen the safety-adjacent surface only with the accompanying
|
||||
proof). The Storage section's line grammar
|
||||
(`<hash>\t<line-length>\t<indent>\t<uvm-utils-indent>\t<version>\t<path>`)
|
||||
matches `render()`'s `writeln!` argument order exactly
|
||||
(content, line_length, indent, uvm_utils_indent, VERSION, path).
|
||||
|
||||
**Step 6 — size.** `cache.rs`: 191 lines before `mod tests` (118
|
||||
non-blank/non-comment) — nowhere near the 300–600 target.
|
||||
`lucisv/src/main.rs`: 568 lines before `mod tests` — the `entry_for`
|
||||
change added 4 lines and did not push it toward a threshold. No file
|
||||
touched by this diff is newly over any CLAUDE.md size line.
|
||||
|
||||
**One non-blocking observation for the lead.** Step 3(c)/(d) used
|
||||
today's actual pairing — the release-tagged `lucisv-0.49.0` baseline
|
||||
against this uncommitted fix's local build, which *also* self-reports
|
||||
`CARGO_PKG_VERSION = "0.49.0"` because the workspace version has not
|
||||
been bumped for this change. That means in exactly the scenario just
|
||||
tested, the **shape-based** (five- vs six-field) tolerance is what
|
||||
kept the cross-binary read safe — the *version* field could not have,
|
||||
since both binaries carry the identical string. This slightly
|
||||
sharpens (not contradicts, once you know which pairing was meant) the
|
||||
dev's work-log claim that the five-field tolerance "buys nothing
|
||||
today" — that claim is true only *after* whatever release actually
|
||||
ships this fix bumps `Cargo.toml`'s version per the existing
|
||||
release-commit pattern (`git log` shows each `Release X.Y.Z` commit
|
||||
does this), which is a lead/release-time step, not something this
|
||||
diff needed to do itself. Recorded so the version bump isn't skipped
|
||||
at merge — no code change needed here, the fallback already covers
|
||||
the pre-bump window correctly, as demonstrated above.
|
||||
|
||||
**Verdict: PASS.** No corruption, no crash, no false hit, no
|
||||
mis-parse in any attacked case; both directions of the audit's own
|
||||
probe reproduce the bug on 0.49.0 and are fixed on the new binary;
|
||||
the five-field tolerance is precise (old-shape-well-formed lines drop
|
||||
individually, anything else on five fields is fatal like any other
|
||||
malformed line, confirmed with `"nothex"` content); a four-field line
|
||||
(the TODO item's own wording) discards the whole store as corruption,
|
||||
confirmed by direct repro; no file crossed a CLAUDE.md size threshold.
|
||||
Ticking the §59 QA line in `TODO.md`.
|
||||
|
||||
## Review
|
||||
|
||||
**2026-09-07 (lead, §59).** Accepted. Read the diff (`Entry`, the store
|
||||
line, `parse`'s two arms, `entry_for`, the six cache tests, the two CLI
|
||||
regressions) and both logs.
|
||||
|
||||
- The key now covers every `FileConfig` field that reaches the formatter,
|
||||
and the Handshakes say so as an obligation on whoever adds the next one.
|
||||
That is the actual fix; the codec change is its consequence.
|
||||
- The five-field arm is deliberately *conditional* (well-formed old shape
|
||||
only), so the existing "one malformed line discards the store" posture
|
||||
is unchanged — the corruption tests still bite on a non-hex content,
|
||||
a `yes` option, an empty path. Right call; a blanket field-count skip
|
||||
would have been a forgiveness with no attack test behind it.
|
||||
- QA's cross-version check is the one that matters: a 0.49.0 store is
|
||||
dropped individually and rebuilt; a 0.50.0 store read by 0.49.0 lands
|
||||
the option text in 0.49.0's version slot and is skipped as another
|
||||
version's entry. Neither direction can produce a false hit.
|
||||
- QA's note on the version bump is taken: the release chain bumps
|
||||
`CARGO_PKG_VERSION` to 0.50.0 before the tag, so the version field
|
||||
invalidates a 0.49.0 store on its own and the shape arm is belt and
|
||||
braces.
|
||||
- Docs applied at merge: README.md's key sentence and the workaround
|
||||
paragraph replaced by a one-line history note; topo row 34 struck;
|
||||
repository-analysis and coverage_gaps annotated as fixed.
|
||||
|
||||
**2026-08-19 — lead. Verdict: accepted and committed. Warm runs are
|
||||
2-4× faster in parallel and up to 7.7× single-threaded, bought without
|
||||
touching a single correctness property.**
|
||||
|
||||
@@ -0,0 +1,355 @@
|
||||
# performance-take4
|
||||
|
||||
TODO §58 — the fourth opentitan performance round. **0.49.0 against 0.43.0**,
|
||||
with take 3's 0.43.0 column carried beside every row so each one is a
|
||||
before/after, and 0.39.0 kept for the CLI sweeps. Output:
|
||||
`docs/performance_take4.md`, a `docs/perf/README.md` entry, and — the round's
|
||||
one durable artefact — a **committed** harness in `tools/perf/`.
|
||||
|
||||
## Goal
|
||||
|
||||
Measure what 0.44–0.49 did to the server and the CLI on a 3 976-file corpus,
|
||||
with the same table shapes take 3 used, so a reader can put the two documents
|
||||
side by side and read a row across four releases. Read-only: a regression is
|
||||
filed with a reproduction, never fixed here. And leave behind the client the
|
||||
last three rounds each lost — take 2's scripts were gone when take 3 ran, and
|
||||
take 3's were gone when this one started, so take 3's numbers had to be
|
||||
re-derived from take 2's *prose*. `tools/perf/` ends that.
|
||||
|
||||
## Assumptions
|
||||
|
||||
- **The tree at `4c2dae3` is 0.49.0.** Verified: `target/release/lucisv
|
||||
--version` prints `0.49.0`, and the server binary's mtime (01:13) is later
|
||||
than the last change under `crates/` (01:12:49), so no rebuild was needed
|
||||
before timing.
|
||||
- **The two servers differ only in their code.** Both were driven by the same
|
||||
Python client, in the same session, on the same corpus commit, within one
|
||||
hour of each other. That is what makes tonight's 0.43.0 column — not take
|
||||
3's — the honest baseline: the harness and the machine are held fixed.
|
||||
- **The machine is a desktop, and it was busier than take 3's.** Load average
|
||||
3.7–7.1 throughout, with WindowServer at 45–51% and loginwindow at 24–29%.
|
||||
Take 3 measured at load 2–4. Sub-millisecond rows therefore sit on a fatter
|
||||
floor than take 3's; §9 says so and §8.9 dismisses the lot. Every
|
||||
conclusion below is drawn from a 0.49.0-vs-0.43.0 pair taken on this
|
||||
machine, in this state.
|
||||
- **`--select error,warning,style` is not "all rules"** — three rule classes
|
||||
by name, which is what §58 asked for.
|
||||
- **"Cold cache" is lucisv's store, not the OS page cache.** opentitan has now
|
||||
been walked by four measurement rounds.
|
||||
|
||||
## Handshakes
|
||||
|
||||
- **Consumes** `lucisv-server`'s wire protocol: `initialize` with
|
||||
`initializationOptions.storagePath` (index-persistence),
|
||||
`workspace/configuration` for the `lucisv` section (index-scope's
|
||||
`index.scope` / `index.scopeDepth`), `--verbose`'s
|
||||
`timing: <method> answered in <n> ms` over `window/logMessage`
|
||||
(verbose-timing), and `lucisv/moduleHierarchy` with `params: {}`
|
||||
(dut-hierarchy). None of these is changed by this round.
|
||||
- **Consumes** the CLI's `format --cache-dir <path> --check`,
|
||||
`format --no-cache --check` and `check [--select …]`. Note the argument
|
||||
order: `--cache-dir` is a *subcommand* option, so it follows `format`.
|
||||
- **Promises** `tools/perf/` to take 5: `lspclient.py` and `bench.py` keep
|
||||
their phase names and their `results.jsonl` row shape
|
||||
(`phase`/`label`/`row`/`ms`/`n`/`note`), so a later round can diff a row
|
||||
against this one by name. A phase that changes what it measures gets a new
|
||||
name rather than a new meaning.
|
||||
- **Requests nothing** of another module. Two observations that a future lane
|
||||
may want are filed as findings in `docs/performance_take4.md` §8, not as
|
||||
handshake requests, because this lane fixes nothing.
|
||||
|
||||
## Status / TODO
|
||||
|
||||
- [x] harness in `tools/perf/` with its README; runs from a clean checkout
|
||||
- [x] server table re-measured, 0.49.0 vs 0.43.0 vs take 3 — take 4 §2
|
||||
- [x] new rows: didOpen release numbers, the five refactoring offer sites,
|
||||
tail rename and instance-head completion, moduleHierarchy, index size
|
||||
and RSS
|
||||
- [x] CLI sweeps, three binaries, RSS included; outcome diff since 0.43.0
|
||||
- [x] `docs/performance_take4.md` + perf README entry
|
||||
- [x] opentitan status unchanged after every phase; no guard kill
|
||||
- [x] QA (TODO §58's last line) — PASS, see QA log
|
||||
|
||||
## Work log
|
||||
|
||||
**2026-09-07 (dev).**
|
||||
|
||||
- Read CLAUDE.md, TODO §58, `docs/performance_take3.md` in full, and the perf
|
||||
README's 2026-09-05 entry. Recorded provenance for all five binaries
|
||||
(§1). Confirmed the tree's server binary is current; **no rebuild ran**.
|
||||
- Built the 0.43.0 server from the `v0.43.0` tag in a scratch `git worktree`
|
||||
under the scratchpad (57.75 s, under the guard). The main tree was never
|
||||
checked out, reset or stashed. The worktree was removed after the last
|
||||
measurement.
|
||||
- Wrote `tools/perf/` — `lspclient.py`, `sites.py`, `bench.py`, `sweep.sh`,
|
||||
`sweeptable.py`, `outcomes.sh`, `README.md`. Standard library only.
|
||||
Deviations from take 3's client, all deliberate: sites are resolved from
|
||||
the file *text* at run time rather than hard-coded; the scan barrier is
|
||||
1.5 s of silence rather than the `$/progress` `end` (the end report is
|
||||
followed by more chatter); and there is a `probe` phase, which is how the
|
||||
new offer sites below were found rather than guessed.
|
||||
- **Found the new offer sites empirically.** Swept every instantiation-shaped
|
||||
and `import` line in a set of RTL files with `codeAction` and kept the
|
||||
positions that actually offer. That turned up
|
||||
`sha3_fpv.sv 54:4` (expand `.*`), `aes_sbox_canright_masked.sv 42:2`
|
||||
(organize imports), `aes_wrap.sv 66:2` (inline `tlul_cmd_intg_gen`) and
|
||||
confirmed take 3's `aes_wrap.sv 78:2` (connect 2 missing ports). **There is
|
||||
no `convert to ANSI` site**: a scan of all 1 311 module headers in
|
||||
opentitan's `hw/` found zero non-ANSI ones, so that row measures an ANSI
|
||||
header instead and the corpus fact is reported in §6b.
|
||||
- **Found the §49 tail site empirically too.** The first two candidates did
|
||||
not resolve — `pwrmgr.sv`'s `u_fsm.state_q` sits inside a `` ` ``-macro
|
||||
assertion argument, and `pinmux.sv`'s `u_reg.intg_err` did not resolve
|
||||
either — so the round uses `entropy_src_core.sv`'s
|
||||
`u_entropy_src_main_sm.state_q`, which does. The two that do not are
|
||||
recorded in §8.
|
||||
- Ran the untimed per-file outcome sweeps for all three CLI binaries, then
|
||||
the timed CLI sweeps, then the LSP phases for 0.49.0 and for 0.43.0.
|
||||
`git -C opentitan status --porcelain` was checked after every phase and
|
||||
reported the same three pre-existing modified files every time. **No guard
|
||||
kill occurred**; the largest resident set anything reached was 588 MB
|
||||
(`lucisv-server` after a warm workspace scan), 7% of the 8 GB limit.
|
||||
- Three phases (`widen`, `blockers`, `rss`) were first written with one try
|
||||
per cell; that violated §58's three-tries rule, so they were rewritten to
|
||||
loop and **re-run on both binaries**, and the single-try rows were deleted
|
||||
from `results.jsonl` before the re-run. Nothing else in the file was
|
||||
edited after it was written.
|
||||
- **Split the harness after the measurements and re-verified it.** `bench.py`
|
||||
reached 537 production lines, over §58's ~500; the phases for what 0.44–0.49
|
||||
added moved to `phases_new.py` and the shared registry/config/session code
|
||||
to `harness.py` (330 / 152 / 76 production lines). **Every one of the 20
|
||||
phases was then re-run through the split files**, and ten rows were checked
|
||||
against the document within its stated tolerances — `didOpen
|
||||
pinmux_reg_top.sv` (doc 112.1 / 127.9–130.7 → 125.6 / 113.1–129.7 ms), the
|
||||
tail rename (793.2 / 750.7–751.9 → 785.0 / 746.3–753.9), the 128-fan-out
|
||||
eager `codeAction` (511.8 / 467.1–473.6 → 506.8 / 474.2), `moduleHierarchy`
|
||||
(76.2 / 41.1–53.8 → 68.7 / 41.1–53.1), the port-action resolve
|
||||
(163.9 / 158.2–159.5 → 163.1 / 157.3–160.4), the warm workspace scan
|
||||
(1 266 → 1 248), cold RSS (542 736 → 541 152 KB), `rename` on `aes`
|
||||
(165.1 / 133.5–139.4 → 164.5 / 137.2), `didOpen spi_device.sv`
|
||||
(15.5 / 13.8–15.1 → 13.7 / 15.3–15.0) and `tailcompletion`
|
||||
(1.11 / 0.45–0.53 → 0.96 / 0.47). All inside tolerance; the verification run
|
||||
is `scratchpad/verify.jsonl`, labelled `verify-0.49.0`.
|
||||
- Wrote `docs/performance_take4.md` (§0–§10), the perf README entry, and
|
||||
ticked §58's dev lines in `TODO.md`.
|
||||
|
||||
## QA log
|
||||
|
||||
**2026-09-07 (QA).**
|
||||
|
||||
Read CLAUDE.md, TODO §58, this README, `docs/performance_take4.md` in full
|
||||
(961 lines), `tools/perf/README.md`, the harness source, and the dev's raw
|
||||
logs at `~/.cache/lucisv-perf/take4/{results.jsonl,verify.jsonl}` and the
|
||||
scratchpad (`logs/`, `outcomes/`, `sweep/`, `census.py` +
|
||||
`logs/census-0.49.0.txt`).
|
||||
|
||||
**Setup.** `python3 -m py_compile tools/perf/*.py` — clean. Built the
|
||||
0.43.0 server from a fresh clone (not a worktree, per the hard rules):
|
||||
`git clone -q --no-checkout … && git checkout -q v0.43.0`, then
|
||||
`tools/guard.sh -m 8 -t 1800 -- cargo build --release -p lucisv_server`
|
||||
(58.10 s, no kill). Binary sha256 `7f0f27d6…`, matches §1's row exactly.
|
||||
Verified `target/release/lucisv --version` → `0.49.0` and
|
||||
`lucisv-server` sha256 `c6e40ecd…`, matching §1. All three CLI baseline
|
||||
shas/sizes (`0c943c4c…`/3236768 B for 0.49.0, `89379a12…`/2828576 B for
|
||||
0.43.0) matched by direct `shasum`/`ls`.
|
||||
|
||||
**1. Harness.** Compiles clean. Ran every phase listed below through
|
||||
`tools/perf/bench.py` exactly as `tools/perf/README.md` documents — no
|
||||
undocumented step was needed. One thing the README doesn't spell out:
|
||||
`bench.py`'s `--tries N` is the *repeat* count, and the printed/recorded
|
||||
list is `[first, repeat×N]` (so `--tries 4` prints 5 numbers) — obvious
|
||||
once seen, but worth a line in the README for take 5.
|
||||
|
||||
**2. Rows re-run, both binaries, committed harness** (`--tries 3` or `4`
|
||||
matching the phase; my raw rows are in
|
||||
`scratchpad/qa/results/results.jsonl`, labels `0.49.0-qa`/`0.43.0-qa`):
|
||||
|
||||
| Row | Doc (first / repeats) | **QA re-run 0.49.0** | **QA re-run 0.43.0** | Verdict |
|
||||
|---|---|---|---|---|
|
||||
| Workspace scan, cold | 2712/2691–2712 (49) · 2645/2640–2656 (43) | **2712.4/2690.9–2711.9** | **2637.0/2620.9–2632.3** | in band |
|
||||
| Workspace scan, warm | 1266.1/1239.8–1285.6 (49) · 1173.4/1167.1–1173.6 (43) | **1252.1/1244.7–1271.5** | **1183.6/1168.7–1185.3** | in band |
|
||||
| `didOpen pinmux_reg_top.sv`→request | 112.1/127.9–130.7 (49) · 1605/1604–1611 (43) | **127.5/103.4–126.5** (mean 119.1, doc mean 123.6, −3.6%) | **1621.1/1518.6–1565.7** (mean 1568.4, doc mean 1607.4, −2.4%) | in band (§9's ±10%/±5%) |
|
||||
| `codeAction prim_flop_2sync (128)`, lazy | 15.0/8.1–10.5 | **17.5/7.2–11.0** | **13.3/9.8–11.5** | in band |
|
||||
| `codeAction prim_flop_2sync (128)`, eager | 511.8/467.1–473.6 | **511.8/468.8–473.1** (traced exactly to the dev's own row, see §4 below) — QA re-run: **497.2/468.4–479.1** | **271.0/237.0–241.2** | in band |
|
||||
| `codeAction` comment line, lazy (§8.2) | 4.70/3.18–3.84 (49) · 2.17/1.12–1.32 (43) | **2.81/2.24–2.38** (run1), **7.43/4.11–5.46** (run2) | **1.81/1.15–1.61** | see finding B below |
|
||||
| `rename` on `aes` | 165.1/133.5–139.4 (49) · 159.8/133.2–136.2 (43) | **165.0/133.5–139.4** | **158.5/130.7–135.5** | in band |
|
||||
| `completion` at 0 chars | 7.2/4.2–5.3 (49) · 7.8/4.2–5.4 (43) | **7.1/3.9–5.1** | **9.0/4.4–5.0** | in band |
|
||||
| tail `rename` (§49, new row) | 793.2/750.7–751.9 (49) · 88.0/65.8–66.7 (43) | **777.8/747.9–751.2**, tail edited | **87.4/65.6–66.4**, tail NOT edited | in band, correctness match |
|
||||
| `moduleHierarchy` (new row) | 76.2/41.1–53.8 (49) · 70.3/41.0–48.8 (43) | **71.9/40.8–53.9**, 2 600 051 B, 1546/1529/schema 2 | **70.3/40.8–44.3** (a subset of retries) | in band, payload byte-identical |
|
||||
|
||||
10 rows re-run (task asked for 8), both binaries, all inside §9's stated
|
||||
tolerance bands except the comment-line row, which is finding B.
|
||||
|
||||
**3. CLI outcome diff, independently re-derived**, two trees (`hw/ip`,
|
||||
`hw/top_earlgrey/ip`), plus `hw/top_darjeeling/ip` to nail down the
|
||||
17/2/1 split:
|
||||
|
||||
- `format --check --no-cache`: `diff` against 0.43.0/0.49.0 is **empty**
|
||||
on both `hw/ip` (1777 lines each) and `hw/top_earlgrey/ip` (47 lines
|
||||
each) — byte-identical formatter verdicts, confirmed.
|
||||
- `check` (default rules): `diff` empty on both trees (446/15 lines) —
|
||||
byte-identical, confirmed.
|
||||
- `check --select error,warning,style`: `hw/ip` 7734→7751 (**+17**),
|
||||
`hw/top_earlgrey/ip` 551→553 (**+2**), `hw/top_darjeeling/ip`
|
||||
382→383 (**+1**) — **17+2+1 = 20**, every added line is a
|
||||
`[unused-import]` style finding, nothing else changed anywhere. Doc's
|
||||
claim confirmed exactly.
|
||||
- Re-timed `format --check` warm and `check` default on `hw/ip`, three
|
||||
tries, three binaries, `/usr/bin/time -l`: format warm 0.55–0.67 s
|
||||
across all three binaries (doc: 0.58–0.63); `check` default
|
||||
0.35–0.41 s (doc: 0.34–0.41); `check --select` 0.46–0.60 s, confirming
|
||||
the 1.27×-ish slope (mine: 0.47 mean 0.43 → 0.59 mean 0.49, 1.26×;
|
||||
doc 1.27×). All in band.
|
||||
|
||||
**4. §8.2 mechanism, read not fixed.** `crates/vlog_refactor/src/inline/mod.rs:73`
|
||||
(`inline_site`) and `crates/vlog_refactor/src/extract/mod.rs:82`
|
||||
(`extract_site`) both call `parse_source_tolerant(text)` — a full tolerant
|
||||
parse of the whole buffer — on every invocation, and refuse (`None`) if
|
||||
that parse produced any diagnostic. Both are called from the server's
|
||||
`code_actions` gating on *every* `textDocument/codeAction`:
|
||||
`crates/lucisv_server/src/inline_module.rs:50` and
|
||||
`crates/lucisv_server/src/extract.rs:76`/`:113`. The doc's claim — the
|
||||
gates parse the cursor's buffer on every request, unconditionally, offer
|
||||
or not — is accurate and the two file:line citations for `inline_site`
|
||||
check out exactly; the doc names `extract_site` in prose but doesn't cite
|
||||
its own definition/call site (`extract/mod.rs:82`, `extract.rs:76`) — a
|
||||
cosmetic citation gap, not a wrong claim, since I verified `extract_site`
|
||||
does the identical thing.
|
||||
|
||||
**5. Attack — internal consistency and corpus facts.**
|
||||
|
||||
- **Census (§6b, 2 440 positions, extract 89%/inline 11%).** The dev's
|
||||
`scratchpad/census.py` + `logs/census-0.49.0.txt` gives files 205,
|
||||
positions 2440, extract 2171, inline 263, organize 12, connect 1 —
|
||||
matches the document exactly. I re-ran an independent subset (aes/rtl
|
||||
only, 40 files, edited `dirs=` in a copy of the script) and got 914
|
||||
positions, extract 870 (95.2%), inline 129 (14.1%), organize 12,
|
||||
connect 1 — the organize/connect *sites* are byte-identical to the
|
||||
full run's list (all 12 organize sites and the 1 connect site live in
|
||||
`aes/rtl`), and the extract/inline proportions are in the same range;
|
||||
the difference from 89%/11% is explained by `prim/rtl`'s different mix
|
||||
of item shapes, not an inconsistency.
|
||||
- **"Zero non-ANSI headers of 1 311" (§6b).** No script or log for this
|
||||
claim exists anywhere in `tools/perf/` or the scratchpad — filed as
|
||||
finding A. I wrote an independent census (line-anchored `module NAME`
|
||||
regex, comments stripped, port-list scanned for `input`/`output`/
|
||||
`inout`/`ref`) over all 3 932 `.sv`/`.v` files under `opentitan/hw`:
|
||||
1310 module headers (doc: 1311, a 1-header methodology difference),
|
||||
2 apparent "non-ANSI" hits that turned out to be false positives on
|
||||
inspection (`hw/vendor/lowrisc_ibex/.../tb.sv` and
|
||||
`hw/vendor/pulp_riscv_dbg/tb/tb_top.sv` — both `module NAME #(params) ;`
|
||||
with **no port list at all**, not a non-ANSI port list). Net: **zero
|
||||
genuine non-ANSI headers**, confirming the doc's claim in substance
|
||||
even though it isn't traceable to a committed artifact.
|
||||
- **File-count sanity**: `find hw/ -name '*.sv' -o -name '*.v' | wc -l`
|
||||
→ 3932, matches §6b's "3 932 `.sv`/`.v` files" exactly.
|
||||
|
||||
**6. Traceability sample (task asked for 25; I checked ~30).** Every one
|
||||
of the following was found verbatim in `results.jsonl`, a `sweep/*.txt`
|
||||
log, `logs/sweeptable.txt`, an `outcomes/*.txt` file, or
|
||||
`logs/census-0.49.0.txt`: the §0 `prim_flop_2sync (128) eager` wire/verbose
|
||||
pair, the §1 sha256/size sextet, the §2 workspace-scan cold/warm rows, the
|
||||
`didOpen pinmux_reg_top.sv` row, the tail-rename row, `codeAction
|
||||
prim_flop_2sync (128) eager` and `prim_alert_sender (67) eager`, `didOpen
|
||||
aes_core.sv`, the `expand .*` offer+resolve pair, `rename aes`, the
|
||||
`spi_device.sv` widen cell, `moduleHierarchy` (both binaries, payload
|
||||
2 600 051 B, 1546/1529/schema 2), the cold/warm RSS triples and index
|
||||
sizes (45404/39940 KB) for both binaries, every `hw/ip` row in
|
||||
`sweeptable.txt` (format cold/warm, check default/select, RSS), every
|
||||
outcome-count line (`found 445/446/7751/7734/7735 violations`, `1772/1773
|
||||
files would be reformatted`), and the load-average extremes (7.10, 3.68)
|
||||
in `logs/outcomes-load-before.txt`/`logs/lsp-0.49.0-machine.txt`. **Not
|
||||
traceable**: the §6b "1 311 module headers / zero non-ANSI" pair (finding
|
||||
A above) — no script, log, or note anywhere records how it was computed.
|
||||
|
||||
**7. opentitan and tree status.** `git -C opentitan status --porcelain`
|
||||
checked after every phase of my own re-runs (scan, didopen, codeaction ×2,
|
||||
rename, completion, hierarchy, tailrename, both outcome sweeps, both
|
||||
timed sweeps, the census re-run) — every single time, exactly the three
|
||||
pre-existing files: `hw/ip/aes/dv/tb/tb.sv`,
|
||||
`hw/top_darjeeling/ip/ast/rtl/ast.sv`, `hw/top_earlgrey/ip/ast/rtl/ast.sv`.
|
||||
Never written to otherwise. Main tree `git status --short` shows only the
|
||||
dev's untracked/modified files (`TODO.md`, `docs/perf/README.md`,
|
||||
`docs/features/performance-take4/`, `docs/performance_take4.md`,
|
||||
`tools/perf/`) plus this QA-log edit. **No guard kill** in any of my
|
||||
~20 guarded invocations (server sessions, the one `cargo build`, CLI
|
||||
sweeps); largest RSS I observed was the 0.49.0 server's 588 608 KB after
|
||||
a warm scan, same as the doc reports.
|
||||
|
||||
### Findings
|
||||
|
||||
**A (low, traceability).** `docs/performance_take4.md:428-430`'s "zero
|
||||
non-ANSI headers" / "1 311 module headers" claim has no backing script or
|
||||
log anywhere in `tools/perf/` or the scratchpad, unlike every other census
|
||||
in this round. This breaks `tools/perf/README.md:103-104`'s own rule
|
||||
("Nothing in the document may quote a number that is not in this file or
|
||||
in a sweep.sh / outcomes.sh log"). Independently reproduced as
|
||||
substantively correct (§5 above: 1310 headers, 0 genuine non-ANSI after
|
||||
excluding two no-port-list false positives) — not a correctness defect,
|
||||
but the number should not have shipped without a saved script, and a
|
||||
future round should add one before quoting a from-scratch corpus census.
|
||||
|
||||
**B (informational, not blocking).** The comment-line lazy `codeAction`
|
||||
row — §8.2's central piece of evidence for the "2.9×" gate-cost claim —
|
||||
is noisier than its own 1–20 ms/±20% tolerance band. Two independent QA
|
||||
reruns of the `codeaction` phase on the *same* 0.49.0 binary, minutes
|
||||
apart, gave means of 2.42 ms and 5.25 ms for this row (doc: 3.91 ms
|
||||
mean), a 2.2× swing between two back-to-back runs of the identical
|
||||
binary and harness — each individual run falls outside ±20% of the
|
||||
document's number, in opposite directions. The qualitative finding holds
|
||||
(0.49.0 consistently slower than 0.43.0 at this cursor: my 0.43.0 mean
|
||||
was 1.43 ms both times) and the *average* of my two 0.49.0 reruns
|
||||
(≈2.68×) lands close to the doc's claimed 2.9×, but a single three/four-try
|
||||
reading — which is what the document and the harness's default both
|
||||
take — is not reliable at this row's magnitude on this machine. Not a
|
||||
finding against the document's conclusion, but future rounds should take
|
||||
more tries (8–10) for any sub-5 ms row used as load-bearing evidence for a
|
||||
specific multiplier.
|
||||
|
||||
### Verdict: **PASS**
|
||||
|
||||
Both findings are minor and non-blocking: finding A is a traceability gap
|
||||
with a substance-confirmed number, finding B is a reproducibility caveat
|
||||
that strengthens rather than undermines the document's own qualitative
|
||||
claim. Every row I re-ran landed inside §9's tolerance or is explained by
|
||||
machine noise the document already documents; the CLI outcome diff
|
||||
("byte-identical formatter verdicts", "20 new unused-import findings,
|
||||
17/2/1 split") reproduced exactly on three independent trees; the §8.2
|
||||
mechanism claim checks out against the source; opentitan was never
|
||||
written to; the main tree carries only the dev's files; no guard kill
|
||||
occurred anywhere in this QA pass.
|
||||
|
||||
## Review
|
||||
|
||||
**2026-09-07 (lead).** Accepted. Read the document end to end, the §2 table
|
||||
against take 3's, the perf README entry, the harness README and the QA log.
|
||||
|
||||
- The round answers the question it was asked: 0.49.0 against 0.43.0 with
|
||||
the same client in the same hour, so the columns are comparable in a way
|
||||
take 3's could not be. The one-line reading (four things moved) is
|
||||
supported by the table, and §8.9's dismissal of the sub-millisecond rows
|
||||
is the right call on a desktop-loaded machine.
|
||||
- §8.2 verified in the source by me and by QA: `inline_site` and
|
||||
`extract_site` each re-parse the whole buffer on every `codeAction`
|
||||
(`crates/vlog_refactor/src/inline/mod.rs:74`, `extract/mod.rs:83`),
|
||||
called from `inline_module.rs:51` and `extract.rs:76`, while the server
|
||||
already holds the document's tree. The fix is the shape §37.1 used and is
|
||||
filed for the owner's ruling in TODO's loop-3 list, not done here (this
|
||||
lane fixes nothing, by design).
|
||||
- §8.3 (the tail rename at 751 ms) is filed correctly as a cost of a
|
||||
correct answer; `completion` on the same surface being free points at
|
||||
rename's reference walk, which is where a future lane should look first.
|
||||
- The harness is the durable result: nine files, standard library only,
|
||||
phases named so take 5 can diff rows by name. The 500-line split was the
|
||||
right response to §58's size rule.
|
||||
- QA finding A (the header census untraceable) fixed by a traceability
|
||||
note in §6b naming the method and QA's independent count; finding B (the
|
||||
comment-line row noisier than its band) is already stated in the
|
||||
document's tolerance text and the multiplier holds across both QA
|
||||
reruns, so no change.
|
||||
- Deviations accepted: the busier machine (stated as the largest caveat,
|
||||
mitigated structurally), the six-file harness, the ANSI row measuring an
|
||||
ANSI header because the corpus has no other kind.
|
||||
|
||||
Docs applied at merge: perf README entry (the dev's), TODO §58 ticked, the
|
||||
§8.2 gate and §8.3 walk added to the loop-3 open items.
|
||||
@@ -1109,3 +1109,88 @@ measures the same as 0.43.0 everywhere in the "before" column, so this was
|
||||
never a regression — the rule had been ordered that way since it was
|
||||
written. Published diagnostics are byte-identical before and after. Full
|
||||
account: `docs/features/didopen-cost/README.md`.
|
||||
|
||||
### 2026-09-07 — take 4
|
||||
|
||||
TODO §58. **0.49.0 against 0.43.0** on opentitan `0098135264`, both binaries
|
||||
measured in the same hour with the same client. Full document:
|
||||
[`../performance_take4.md`](../performance_take4.md) (§0–§10). Feature
|
||||
README: `docs/features/performance-take4/README.md`.
|
||||
|
||||
**The harness is now in the repository.** Take 2's, take 3's and take 1's
|
||||
clients all lived in a scratch directory and all three are gone — take 3's
|
||||
numbers had to be re-derived from take 2's prose. Take 4's lives in
|
||||
`tools/perf/` (`lspclient.py`, `sites.py`, `bench.py`, `sweep.sh`,
|
||||
`sweeptable.py`, `outcomes.sh`, `README.md`; Python 3 standard library only,
|
||||
runs from a clean checkout). Take 5 reuses it. Sites are resolved from the
|
||||
file text at run time, and the new offer sites were *found* with a `probe`
|
||||
phase rather than guessed.
|
||||
|
||||
**Credits — what got faster.**
|
||||
|
||||
| | 0.43.0 | 0.49.0 | credit |
|
||||
|---|---:|---:|---|
|
||||
| `didOpen pinmux_reg_top.sv` (42 192 L) → next request | 1 605 / 1 604 / 1 611 ms | **112 / 131 / 128 ms** | **§46**, **14×** |
|
||||
| `didOpen spi_device.sv` → next request | 98.7 / 75.2 / 99.5 ms | **15.5 / 13.8 / 15.1 ms** | §46, 6× |
|
||||
| `didOpen aes_core.sv` → next request | 42.6 / 63.0 / 63.1 ms | **11.0 / 4.0 / 10.4 ms** | §46, 7× |
|
||||
| a `didOpen` of an in-scope file at the default scope | 33–69 ms | **5–21 ms** | §46 — take 3's §8.4 **closed** |
|
||||
| `completion` after an instance head + `.` | 24 items, 0.52–0.66 ms | **26 items, 0.45–0.53 ms** | §49, free |
|
||||
| `rename` through an instance tail | 1 file, tail unedited | **2 files, tail edited** | §49, correctness (but see below) |
|
||||
|
||||
The 2026-09-05 entry above took its §46 numbers with temporary timings; **the
|
||||
release build confirms them at the same magnitude**, which was the point of
|
||||
this round's `didopen` phase.
|
||||
|
||||
**Filed findings** (in `performance_take4.md` §8; nothing was fixed here):
|
||||
|
||||
- **§8.2 (medium)** — the *lazy* `codeAction` offer costs 2–5 ms more at every
|
||||
cursor, offered or not: a plain comment line, where **zero** actions are
|
||||
offered on either binary, went 1.12–1.32 → 3.18–3.84 ms (2.9×), and the
|
||||
`definition` pipelined behind a `codeAction` went 3.3–7.3 → 11.2–15.9 ms.
|
||||
The mechanism is the new offers' gates (`inline_site`, `extract_site`) each
|
||||
parsing the cursor's buffer on every cursor move. Still inside a frame; the
|
||||
margin is gone.
|
||||
- **§8.3 (low–medium)** — §49's tail rename is **11.3×** a same-file rename:
|
||||
751 ms for two edited files against 66 ms for one. The correctness is right;
|
||||
the cost freezes the serial queue for three quarters of a second.
|
||||
- **§8.4 (low)** — `check --select error,warning,style` is 1.27× slower on
|
||||
`hw/ip` (0.45 → 0.57 s). 0.48.0's new `unused-import` rule explains part of
|
||||
it; `check` with the *default* rules did **not** move, so take 3's §8.5 has
|
||||
stopped accumulating on the default path.
|
||||
- **§8.5 (low)** — two instance-head tails on this corpus do not resolve
|
||||
(`pwrmgr.sv` 178:10 inside a `` ` ``-macro argument; `pinmux.sv` 687:40).
|
||||
Filed as a question, not a defect claim.
|
||||
- **§8.6 (watch)** — the index is +13.7% on disk (39.0 → 44.3 MB) and
|
||||
+12.6/+15.1% resident (482 → 542 MB cold, 509 → 586 MB warm), which is
|
||||
`FACTS_FORMAT` 18 → 19 and is proportionate.
|
||||
|
||||
**Reported, not re-filed:** the eager `codeAction` path (a client without
|
||||
`codeAction.resolveSupport`) is **1.95–2.07× dearer** at every fan-out —
|
||||
243 → 470 ms at 128 files. The owner ruled it a non-hot path on 2026-09-05, so
|
||||
take 4 reports the number and does not file it again.
|
||||
|
||||
**Outcome diff, 0.43.0 → 0.49.0** (`format --check --no-cache`, `check`,
|
||||
`check --select …` over the same five trees): `format --check` and default
|
||||
`check` are **byte-identical on all five trees** — §54's grammar additions
|
||||
change no per-file verdict on this corpus, and §38's fixes stay fixed. The
|
||||
only change anywhere is **20 new `unused-import` style findings** (`hw/ip`
|
||||
+17, `hw/top_earlgrey/ip` +2, `hw/top_darjeeling/ip` +1), all from the rule
|
||||
0.48.0 added. No violation disappeared. Nothing is unexplained.
|
||||
|
||||
**Two corpus facts worth remembering.** Opentitan has **zero** non-ANSI module
|
||||
headers (all 1 311 headers scanned), so §51's `convert to ANSI` has no site
|
||||
here at all. And take 3's "the lightbulb is almost never lit" no longer
|
||||
describes this corpus: a 205-file, 2 440-position census at 0.49.0 finds
|
||||
`extract selection` offered at **89%** of positions and `inline` at **11%**,
|
||||
against exactly **one** port-refactoring offer — the same `aes_wrap.sv` 78:2
|
||||
take 3 found.
|
||||
|
||||
**Caveat, stated because it is the largest one in the document.** The machine
|
||||
ran a live desktop session throughout (WindowServer 45–51%, load average
|
||||
3.7–7.1); take 3 measured at load 2–4. The transport floor moved 4× between
|
||||
two sessions of the same client minutes apart. The mitigation is structural —
|
||||
both binaries were measured alternating within the hour with one client — and
|
||||
every conclusion above is a 0.49.0-vs-0.43.0 pair from that window. Nothing
|
||||
under 0.5 ms is read. No guard kill; the largest resident set anything reached
|
||||
was 588 MB, 7% of the 8 GB limit. The opentitan checkout was never written and
|
||||
its `git status --porcelain` was checked after every phase.
|
||||
@@ -0,0 +1,968 @@
|
||||
# lucisv performance against opentitan — take 4
|
||||
|
||||
Same corpus, same scenarios, same machine as [`performance.md`](performance.md)
|
||||
(take 1), [`performance_take2.md`](performance_take2.md) (take 2) and
|
||||
[`performance_take3.md`](performance_take3.md) (take 3). Take 3 measured
|
||||
**0.43.0** against **0.39.0**. Take 4 measures **0.49.0 (`4c2dae3`)** against
|
||||
**0.43.0 (`73799f3`)**, and every table carries take 3's own 0.43.0 column
|
||||
beside a *fresh* 0.43.0 column taken tonight, with tonight's harness, so each
|
||||
row is a before/after with the harness held fixed.
|
||||
|
||||
Six releases separate the two binaries. Four of them added a refactoring
|
||||
(§50 expand `.*`, §51 convert to ANSI, §52 organize imports, §53 extract and
|
||||
inline module), one fixed the `didOpen` delay take 3 filed (§46), one added a
|
||||
hierarchical member surface to rename and completion (§49), and one bumped the
|
||||
index's on-disk format (18 → 19). All six show up below.
|
||||
|
||||
Every LSP number is a client-observed round trip on a monotonic clock
|
||||
(`time.perf_counter`) — what the editor, and therefore the user, actually
|
||||
experiences. **Read §9 before quoting any of them**: this machine was busier
|
||||
than take 3's.
|
||||
|
||||
**The harness is committed this time.** `tools/perf/` — see §10.
|
||||
|
||||
---
|
||||
|
||||
## 0. The transport baseline, and the server's own clock beside the wire
|
||||
|
||||
Take 3 established that the shipped `--verbose` flag
|
||||
(`docs/features/verbose-timing/`) logs `timing: <method> answered in <n> ms`
|
||||
per request, and that the wire is the server plus 0.2–0.4 ms. Take 4 re-takes
|
||||
that cross-check on both binaries. Nothing was instrumented for this round:
|
||||
the default (no `--verbose`) sessions produce every number in this document,
|
||||
and one supplementary session per shape was re-run *with* `--verbose`.
|
||||
|
||||
| `codeAction` at the cursor | wire, no `--verbose` | wire, `--verbose` session | the server's own line |
|
||||
|---|---:|---:|---:|
|
||||
| **0.49.0** `prim_flop_2sync` (128), eager | 481.6 / 468.2–477.3 ms | 508.5 / 469.4–488.2 ms | 508.2 / 469.1–488.0 ms |
|
||||
| **0.49.0** `prim_flop_2sync` (128), lazy | 15.8 / 7.8–11.0 ms | 9.0 / 6.6–8.0 ms | 8.8 / 6.5–7.8 ms |
|
||||
| **0.49.0** `aes` (6), eager | 119.4 / 87.6–91.9 ms | 118.9 / 87.6–91.5 ms | 117.9 / 87.4–91.4 ms |
|
||||
| **0.49.0** comment line | 5.9 / 2.3–2.9 ms | 4.1 / 1.9–2.9 ms | 3.5 / 1.8–2.6 ms |
|
||||
| **0.43.0** `prim_flop_2sync` (128), eager | 239.3 / 238.0–239.7 ms | 255.8 / 237.8–239.5 ms | 255.6 / 237.6–239.3 ms |
|
||||
| **0.43.0** `prim_flop_2sync` (128), lazy | 19.4 / 12.5–13.2 ms | 16.7 / 10.2–12.4 ms | 16.4 / 10.0–12.2 ms |
|
||||
| **0.43.0** `aes` (6), eager | 75.2 / 43.5–43.9 ms | 70.9 / 43.2–44.0 ms | 70.5 / 43.0–43.8 ms |
|
||||
| **0.43.0** comment line | 3.9 / 1.3–2.1 ms | 4.7 / 1.1–1.9 ms | 4.3 / 1.0–1.8 ms |
|
||||
|
||||
**The wire is the server plus 0.1–0.3 ms on every repeat (worst single reading 1.2 ms, a first try).** Take 3's finding
|
||||
holds one release later and on a different harness, which is worth one line:
|
||||
it means every large movement below is server work, not transport.
|
||||
|
||||
The transport baseline — an unknown method, `$/lucisvNoSuchMethod`, rejected
|
||||
without work:
|
||||
|
||||
| | take 1 | take 2 | take 3 (0.43.0) | **take 4, 0.49.0** | **take 4, 0.43.0** |
|
||||
|---|---:|---:|---:|---:|---:|
|
||||
| first in a settled session | 0.02 ms | 0.019 ms | 0.24 ms | **0.63 ms** | **0.17 ms** |
|
||||
| repeats | ≈0.05 ms | ≈0.05 ms | 0.059–0.092 ms | **0.09–0.32 ms** | **0.04–0.06 ms** |
|
||||
|
||||
The two take-4 columns are the same client, minutes apart, and they differ by
|
||||
3–5×. **That is the noise floor of this machine, not a property of either
|
||||
binary**, and it is the reason no conclusion below is drawn from any movement
|
||||
under 0.5 ms. §8.9 lists them and dismisses them.
|
||||
|
||||
---
|
||||
|
||||
## 1. Environment and provenance
|
||||
|
||||
| | take 3 | **take 4** |
|
||||
|---|---|---|
|
||||
| Machine | Apple M1 Max, 10 cores, 64 GB | **same machine** |
|
||||
| OS | macOS 27.0 (26A5425a) | macOS 27.0 (**26A5425a**) — same build |
|
||||
| Date | 2026-09-05 ~02:45–04:00 | **2026-09-07 ~02:44–03:25** |
|
||||
| Server under test | 0.43.0 `73799f3`, 5 676 528 B | **0.49.0 `4c2dae3`, `target/release/lucisv-server`, 6 273 184 B, sha256 `c6e40ecd…`**, Mach-O arm64 |
|
||||
| Baseline server | 0.39.0, built for the round | **0.43.0 `73799f3`, 5 676 592 B, sha256 `7f0f27d6…`** — built for this round in a scratch `git worktree` at `v0.43.0` (`cargo build --release -p lucisv_server`, 57.75 s), removed afterwards |
|
||||
| CLI binaries | 0.43.0 / 0.41.0 / 0.39.0 | **0.49.0 (3 236 768 B, `0c943c4c…`), 0.43.0 (2 828 576 B, `89379a12…`), 0.39.0 (2 770 688 B, `4caf841f…`)** from `~/.cache/lucisv-baselines/` |
|
||||
| Corpus | `/Users/guoliangchen/repo/opentitan` @ `0098135264` | **same commit**, 3 976 indexed + 3 skipped, same three pre-existing modified files |
|
||||
| Scenario file | `hw/ip/aes/dv/tb/tb.sv`; `aes` at 0-based 44:2 | same file, same position, resolved from the text at run time |
|
||||
| Client | `scratchpad/perf3/*.py` (gone) | **`tools/perf/` — committed** (§10) |
|
||||
| Guard | every run, no kill | **every server session, every `lucisv` invocation and the one `cargo build` went through `tools/guard.sh -m 8 -t 1800`. No guard kill occurred.** |
|
||||
| Machine state | load 2–4, quiet | **load 3.7–7.1 throughout** — a live desktop session (WindowServer 45–51%, loginwindow 24–29%). See §9 |
|
||||
|
||||
### 1a. Why tonight's 0.43.0 column is the one to read
|
||||
|
||||
Take 3's 0.43.0 numbers were taken on a quieter machine with a different
|
||||
Python client. Tonight's were taken on this machine, with this client, within
|
||||
one hour of the 0.49.0 numbers beside them. **Every conclusion in this
|
||||
document is drawn from a take-4 pair**; take 3's column is carried so a reader
|
||||
can see the three-round trend, and where the two 0.43.0 columns disagree that
|
||||
disagreement is the machine and the harness, which §9 quantifies.
|
||||
|
||||
### 1b. The corpus is unchanged from take 3
|
||||
|
||||
`hw/ip/aes/dv/tb/tb.sv` is still modified and still lucisv-clean, so
|
||||
`textDocument/diagnostic` still returns **0 items** and the `aes`
|
||||
instantiation still raises no quick fix. The other two modified files
|
||||
(`hw/top_{darjeeling,earlgrey}/ip/ast/rtl/ast.sv`) are in no scenario.
|
||||
`git -C opentitan status --porcelain` was checked after every phase and
|
||||
reported exactly those three files every time.
|
||||
|
||||
### 1c. What the client does
|
||||
|
||||
Framed JSON-RPC over the server's stdio; `workspace/configuration` answered
|
||||
with a per-session scope word; cache warmth controlled through
|
||||
`initializationOptions.storagePath`; client capabilities settable per session
|
||||
(with and without `codeAction.resolveSupport.properties: ["edit"]`, so the
|
||||
lazy and eager `codeAction` shapes are both measurable); every request timed
|
||||
from send to response. Three differences from take 3's, all deliberate:
|
||||
|
||||
1. **Positions are resolved from the file text at run time**, by searching for
|
||||
the token, not by a hard-coded line number. Every 0-based position quoted
|
||||
below is what that search resolved to on `0098135264`.
|
||||
2. **The scan barrier is 1.5 s of silence, not the `$/progress` `end`.** The
|
||||
end report is followed by more indexing chatter, so silence is the honest
|
||||
barrier. Take 3 used the same rule.
|
||||
3. **There is a `probe` phase**, and it is how §6b's new offer sites were
|
||||
found rather than guessed.
|
||||
|
||||
---
|
||||
|
||||
## 2. Summary table — worst first, take 3 → take 4
|
||||
|
||||
Workspace scope, warm cache, unless the row says otherwise. "Repeats" is the
|
||||
range over the 2nd–4th identical request in the same session; "first" is that
|
||||
request issued as the first real request of a dedicated session, after the
|
||||
scan settled.
|
||||
|
||||
| Action | T3's 0.43.0 | **0.43.0 tonight** | **0.49.0** |
|
||||
|---|---:|---:|---:|
|
||||
| Workspace scan, **cold** cache (didOpen → 3 976 indexed) | 2 867 / 2 754–2 773 ms | **2 645 / 2 640–2 656 ms** | **2 712 / 2 691–2 712 ms** |
|
||||
| `didOpen pinmux_reg_top.sv` (42 192 L) → the request behind it | *not measured* | **1 605 / 1 604–1 611 ms** | **112 / 128–131 ms** |
|
||||
| Workspace scan, **warm** cache | 1 229.8 / 1 220.5–1 229.7 ms | **1 173.4 / 1 167.1–1 173.6 ms** | **1 266.1 / 1 239.8–1 285.6 ms** |
|
||||
| First `didOpen` of an RTL file at the **default** scope (`aes.sv`, widens to `hw/ip`) | 1 081.6 cold / 365.1 warm | **1 046.6 / 1 019.8–1 042.0 cold; 344.9 / 338.9–340.4 warm** | **1 072.4 / 1 051.4–1 075.8 cold; 367.0 / 351.0–378.1 warm** |
|
||||
| `textDocument/rename` on a net named through an **instance tail** (§49) | *no such answer* | **88.0 / 65.8–66.7 ms, 1 file, tail NOT edited** | **793.2 / 750.7–751.9 ms, 2 files, tail edited** |
|
||||
| `textDocument/codeAction`, `prim_flop_2sync` (128), **eager** client | 270.2 / 252.9–255.2 ms | **267.1 / 238.6–243.3 ms** | **511.8 / 467.1–473.6 ms** |
|
||||
| `textDocument/codeAction`, `prim_alert_sender` (67), eager | 213.4 / 196.0–196.5 ms | **211.5 / 183.0–192.4 ms** | **405.1 / 362.3–368.8 ms** |
|
||||
| `textDocument/codeAction`, `prim_lc_sync` (42), eager | 148.0 / 128.9–130.4 ms | **138.6 / 121.5–124.9 ms** | **270.0 / 254.7–255.7 ms** |
|
||||
| `codeAction` at `aes_wrap.sv` 78:2, eager (the one offering cursor) | 143.8 / 123.9–124.4 ms | **145.6 / 115.4–118.6 ms** | **167.9 / 159.9–160.9 ms** |
|
||||
| `codeAction/resolve` at that cursor | 119.5 / 119.5–121.9 ms | **111.0 / 110.4–112.7 ms** | **163.9 / 158.2–159.5 ms** |
|
||||
| `textDocument/rename` on `aes` (edits computed, not applied) | 151.8 / 139.1–140.7 ms (9 files) | **159.8 / 133.2–136.2 ms (9)** | **165.1 / 133.5–139.4 ms (9)** |
|
||||
| — anything queued behind that rename | 160.8 ms | **159.3 / 132.8–157.9 ms** | **160.7 / 145.1–161.7 ms** |
|
||||
| diagnostics **publish** after a `didChange` (~150 ms is the debounce) | 161.1 / 159.6–163.4 ms | **164.0 / 164.3–167.4 ms** | **164.5 / 153.5–160.7 ms** |
|
||||
| `textDocument/codeAction`, `aes` (6), eager | 66.1 / 45.7–48.2 ms | **61.5 / 43.5–46.1 ms** | **114.0 / 88.3–90.7 ms** |
|
||||
| `didOpen spi_device.sv` (1 985 L) → the request behind it | *not measured* | **98.7 / 75.2–99.5 ms** | **15.5 / 13.8–15.1 ms** |
|
||||
| `expand .*` resolve at `sha3_fpv.sv` 54:4 (32 connections) | *no such action* | *no such action* | **67.8 / 66.9–67.0 ms** |
|
||||
| `didOpen aes_core.sv` (1 145 L) → the request behind it | *not measured* | **42.6 / 63.0–63.1 ms** | **11.0 / 4.0–10.4 ms** |
|
||||
| `codeAction` offer at `aes_wrap.sv` 78:2, **lazy** | 33.3 / 21.2–26.8 ms | **20.8 / 18.9–20.2 ms** | **28.6 / 23.6–24.4 ms** |
|
||||
| `codeAction`, `aes_reg_top` (fan-out 1), lazy | 27.1 / 16.4–20.6 ms | **17.6 / 14.2–15.2 ms** | **29.8 / 21.8–23.5 ms** |
|
||||
| `lucisv/moduleHierarchy` (1 546 modules, 2.6 MB) | *not measured* | **70.3 / 41.0–48.8 ms** | **76.2 / 41.1–53.8 ms** |
|
||||
| `codeAction`, `prim_flop_2sync` (128), **lazy** (the offer) | 24.0 / 15.6–16.9 ms | **16.7 / 10.5–13.2 ms** | **15.0 / 8.1–10.5 ms** |
|
||||
| `workspace/symbol "aes"` (256 results) | 8.8 / 7.2–7.9 ms | **18.2 / 8.2–13.3 ms** | **18.2 / 8.7–12.7 ms** |
|
||||
| — anything queued behind it | 11.0 ms | **17.7 / 17.9–18.4 ms** | **18.4 / 15.2–18.0 ms** |
|
||||
| `codeAction`, `prim_alert_sender` (67), lazy | 14.8 / 8.6–10.8 ms | **14.7 / 8.5–12.2 ms** | **13.2 / 9.0–11.5 ms** |
|
||||
| `codeAction` **on the `aes` instantiation**, lazy | 5.15 / 4.05–4.24 ms | **7.4 / 4.0–4.9 ms** | **14.2 / 7.9–9.8 ms** |
|
||||
| — definition pipelined behind that codeAction | 5.15 ms | **7.6 / 3.4–7.6 ms** | **14.7 / 11.4–16.2 ms** |
|
||||
| `codeAction`, `prim_lc_sync` (42), lazy | 17.3 / 7.2–8.6 ms | **18.1 / 7.4–9.4 ms** | **7.0 / 6.0–6.2 ms** |
|
||||
| `didOpen aes.sv` (326 L) → the request behind it | *not measured* | **11.3 / 4.3–11.4 ms** | **5.1 / 3.5–3.7 ms** |
|
||||
| `organize imports` resolve at `aes_sbox_canright_masked.sv` 42:2 | *no such action* | *no such action* | **9.6 / 9.6–9.6 ms** |
|
||||
| `textDocument/completion` at 0 typed characters (512 items) | 9.5 / 2.3–2.8 ms | **7.8 / 4.2–5.4 ms** | **7.2 / 4.2–5.3 ms** |
|
||||
| `textDocument/completion` at `aes` (512 items) | 10.4 / 7.8–9.2 ms | **8.6 / 6.8–7.4 ms** | **9.1 / 7.0–8.2 ms** |
|
||||
| `codeAction` on a **comment line** (contrast), lazy | 1.69 / 0.66–0.81 ms | **2.2 / 1.1–1.3 ms** | **4.7 / 3.2–3.8 ms** |
|
||||
| `textDocument/references` on `.clk_i` (12 hits) | 0.56 / 0.51–0.72 ms | **1.54 / 0.70–0.81 ms** | **1.65 / 1.01–1.15 ms** |
|
||||
| `textDocument/signatureHelp` inside the port list | 0.70 / 0.57–0.62 ms | **2.50 / 1.09–1.24 ms** | **3.06 / 1.12–1.26 ms** |
|
||||
| `didChange` flush (`foldingRange` barrier) | 0.95 / 0.58–0.80 ms | **2.32 / 1.04–1.28 ms** | **1.79 / 0.89–0.97 ms** |
|
||||
| `textDocument/references` on `aes` (14 hits) | 0.85 / 0.54–0.61 ms | **2.80 / 1.32–1.50 ms** | **0.92 / 0.58–0.60 ms** |
|
||||
| `textDocument/completion` after an instance head + `.` (26 items) | *no such answer* | **1.72 / 0.52–0.66 ms (24 items)** | **1.11 / 0.45–0.53 ms (26)** |
|
||||
| `textDocument/inlayHint` (whole file, 4 hints) | 0.49 / 0.26–0.43 ms | **1.90 / 0.65–0.85 ms** | **2.04 / 0.57–0.81 ms** |
|
||||
| `textDocument/semanticTokens/full` | 0.21 / 0.19–0.25 ms | **1.03 / 0.45–0.57 ms** | **0.39 / 0.23–0.30 ms** |
|
||||
| `textDocument/diagnostic` (pull, 0 items — §1b) | 0.34 / 0.17–0.19 ms | **1.02 / 0.46–0.68 ms** | **0.93 / 0.38–0.47 ms** |
|
||||
| `textDocument/documentSymbol` | 0.18 / 0.12–0.15 ms | **0.69 / 0.27–0.31 ms** | **0.61 / 0.25–0.31 ms** |
|
||||
| `textDocument/prepareRename` on `aes` (pressing F2) | 0.31 / 0.08–0.16 ms | **0.37 / 0.13–0.15 ms** | **0.71 / 0.12–0.91 ms** |
|
||||
| — anything queued behind that prepareRename | 0.37 ms | **0.26 / 0.36–0.83 ms** | **0.78 / 0.24–0.63 ms** |
|
||||
| `textDocument/definition` on `aes` | 0.19 / 0.07–0.09 ms | **0.87 / 0.11–0.16 ms** | **0.47 / 0.13–0.17 ms** |
|
||||
| `textDocument/hover` on `aes` | 0.18 / 0.06–0.08 ms | **0.26 / 0.05–0.08 ms** | **0.86 / 0.15–0.18 ms** |
|
||||
| `textDocument/foldingRange` | 0.10 / 0.05–0.07 ms | **0.44 / 0.08–0.10 ms** | **0.73 / 0.12–0.18 ms** |
|
||||
| `textDocument/documentHighlight` | 0.10 / 0.04–0.05 ms | **0.19 / 0.07–0.08 ms** | **0.61 / 0.16–0.21 ms** |
|
||||
| `textDocument/selectionRange` | 0.09 / 0.05 ms | **0.95 / 0.13–0.28 ms** | **1.79 / 0.17–0.27 ms** |
|
||||
| `textDocument/codeLens` | 0.07 / 0.04–0.05 ms | **0.47 / 0.15–0.17 ms** | **0.23 / 0.09–0.10 ms** |
|
||||
| `textDocument/typeDefinition` on `aes` | 0.06 / 0.05–0.06 ms | **0.46 / 0.14–0.17 ms** | **0.67 / 0.11–0.17 ms** |
|
||||
| `textDocument/documentLink` | 0.06 / 0.04–0.05 ms | **0.49 / 0.13–0.16 ms** | **1.09 / 0.08–0.11 ms** |
|
||||
| `initialize` → response | 2.3 – 4.4 ms | **233.5 ms** (a cold `exec`, the session's first spawn) | **0.27 ms** |
|
||||
| *transport baseline (does no work)* | *0.06 – 0.24 ms* | *0.04 – 0.17 ms* | *0.09 – 0.63 ms* |
|
||||
|
||||
**The one-line reading of that table.** Four things moved, and only four:
|
||||
|
||||
1. **§46's `didOpen` fix is real in the release build, and it is the round's
|
||||
headline** — a 42 192-line file's open costs **1 605 ms at 0.43.0 and
|
||||
112 ms at 0.49.0**, a **14×**; every RTL file measured is 3–7× cheaper
|
||||
(§5c).
|
||||
2. **The eager `codeAction` path is ~2× dearer** at every fan-out. It is a
|
||||
ruled non-hot path (owner, 2026-09-05), so it is reported, not re-filed —
|
||||
but the number crossed 500 ms and §6a says who pays it.
|
||||
3. **§49's tail rename buys correctness at 11.3× the cost**: 66 ms answering
|
||||
one file and warning about the tail, against 751 ms answering two files
|
||||
and editing it (§6c). Filed as §8.3.
|
||||
4. **The index costs ~14% more**, on disk and in the server's resident set
|
||||
(§6e), which is what `FACTS_FORMAT` 18 → 19 bought.
|
||||
|
||||
Everything else in the table is inside the machine's noise, and §8.9 says so
|
||||
one row at a time. In particular: **the lazy `codeAction` offer, `rename`,
|
||||
`completion`, the scan, the diagnostics publish and every sub-millisecond
|
||||
navigation request are the same on both binaries.**
|
||||
|
||||
---
|
||||
|
||||
## 3. The queue-blocking analysis
|
||||
|
||||
The server still runs a single-threaded request loop, so the latency a user
|
||||
feels for request *R* is *R*'s cost plus everything queued ahead of it. Each
|
||||
slow request was sent, then — back to back, no wait — the three requests a
|
||||
real editor fires on every cursor move. Three tries; `definition` is the
|
||||
first follower.
|
||||
|
||||
| Sent first (the blocker) | Its own cost, T3 0.43.0 | **0.43.0 tonight** | **0.49.0** | `definition` behind it, **0.43.0** | **0.49.0** |
|
||||
|---|---:|---:|---:|---:|---:|
|
||||
| `codeAction` on the `aes` token (lazy) | 5.07 ms | **7.55 / 3.35–7.56 ms** | **14.67 / 11.40–16.20 ms** | 3.28 – 7.34 ms | 11.24 – 15.94 ms |
|
||||
| `prepareRename` on `aes` | 0.34 ms | **0.26 / 0.36–0.83 ms** | **0.78 / 0.24–0.63 ms** | 0.19 – 0.38 ms | 0.15 – 0.44 ms |
|
||||
| `rename` on `aes` | 160.8 ms | **159.3 / 132.9–157.9 ms** | **160.7 / 145.2–161.7 ms** | 132.8 – 159.2 ms | 145.1 – 161.5 ms |
|
||||
| `workspace/symbol "aes"` | 11.0 ms | **17.7 / 17.9–18.4 ms** | **18.4 / 15.2–18.0 ms** | 17.1 – 17.3 ms | 14.8 – 17.7 ms |
|
||||
|
||||
`hover` and `documentSymbol` behind each leader land 0.01–0.3 ms after the
|
||||
`definition`, as in all three earlier takes: **the queue is still strictly
|
||||
serial and the follower still pays the leader's bill almost exactly.**
|
||||
|
||||
Take 3's structural conclusion was that "the hot path is clean" — `codeAction`
|
||||
5 ms and `completion` 2–3 ms, both inside a 16 ms frame. **That conclusion
|
||||
survives, with one qualification.** The lazy `codeAction` on the `aes` token
|
||||
is 11.4–16.2 ms at 0.49.0 against 3.4–7.6 at 0.43.0: still under the frame
|
||||
budget, but no longer comfortably. The cost is the new offers' own gates —
|
||||
`inline_site` and `extract_site` each parse the cursor's buffer — and it is
|
||||
paid on every cursor move whether or not anything is offered. §8.2 files it.
|
||||
|
||||
What is left genuinely slow is unchanged in kind: user-initiated (`rename`,
|
||||
160 ms; the tail rename, 751 ms), once-per-session (the scan, 1.2–2.7 s), or
|
||||
paid only by a client that cannot resolve a code action (§6a).
|
||||
|
||||
---
|
||||
|
||||
## 4. Startup and scan, per scope config and cache state
|
||||
|
||||
`didOpen tb.sv` → 1.5 s of silence, three runs per cell. "Cold" = the
|
||||
`storagePath` directory was `rm -rf`'d immediately before; "warm" = it carries
|
||||
a previous run's store.
|
||||
|
||||
| Scope config | Cache | T3 0.43.0 | **0.43.0 tonight** | **0.49.0** | files |
|
||||
|---|---|---:|---:|---:|---|
|
||||
| **default** (`[{}]`) | cold | 81.9 / 92.5 / 93.1 ms | **95.0 / 101.7 / 101.6** | **83.8 / 110.3 / 103.6** | 124 |
|
||||
| **default** | warm | 39.4 / 40.3 / 41.8 ms | **53.1 / 54.8 / 55.5** | **55.8 / 54.7 / 56.6** | 124, 123 from cache |
|
||||
| `{"index":{}}` | cold | 88.8 / 90.1 / 94.5 ms | **96.6 / 91.3 / 103.9** | **98.1 / 95.2 / 103.6** | 124 |
|
||||
| `{"index":{}}` | warm | 34.7 / 39.1 / 39.3 ms | **44.6 / 58.4 / 54.2** | **41.8 / 54.8 / 56.4** | 124 |
|
||||
| explicit `scopeDepth: 0` | cold | 93.5 / 101.6 / 105.5 ms | **107.4 / 114.8 / 106.1** | **107.4 / 108.8 / 115.8** | 1 (after a ~100 ms 124-file scan is thrown away) |
|
||||
| explicit `scopeDepth: 0` | warm | 42.3 / 49.3 / 49.6 ms | **56.6 / 60.4 / 58.9** | **58.8 / 62.3 / 67.9** | 1 |
|
||||
| `workspace` | cold | 2 754 / 2 773 / 2 867 ms | **2 645 / 2 640 / 2 656** | **2 712 / 2 691 / 2 712** | 3 976, 3 skipped |
|
||||
| `workspace` | warm | 1 220.5 / 1 229.7 / 1 229.8 ms | **1 173.4 / 1 167.1 / 1 173.6** | **1 266.1 / 1 239.8 / 1 285.6** | 3 975 from cache |
|
||||
|
||||
- **The scan did not change.** Cold workspace is +2.4% at 0.49.0, warm is
|
||||
+8.7%; the warm band across both binaries is 1 167–1 286 ms, and 0.43.0's
|
||||
own two columns (take 3's 1 220–1 230 and tonight's 1 167–1 174) differ by
|
||||
4.5% on their own. §8.9.
|
||||
- **Every small-scope cell is 10–40% dearer than take 3's**, on *both*
|
||||
binaries, in lockstep. That is the machine (§9), not a release: the 0.43.0
|
||||
binary is the same binary take 3 measured.
|
||||
- **Persistence still buys ~54%** on the workspace scan (2 676 → 1 218 ms,
|
||||
mean of six runs across both binaries) and ~44% on the default scope
|
||||
(99.3 → 55.1 ms). Take 3 measured 57% / 57%
|
||||
on a quieter machine.
|
||||
- **A cold workspace scan is still not fully cold**: the trace is
|
||||
`0 files → 124 files → 3 976 files`, and the workspace bar reports "123 from
|
||||
cache" even on a wiped store — those 123 are the default scan's own writes,
|
||||
read back seconds later. Unchanged from take 3.
|
||||
- `initialize` still does no scanning. The one 233 ms reading is the session's
|
||||
very first process spawn — a cold `exec`, exactly the outlier take 3 saw.
|
||||
|
||||
### 4b. What each scope answers, at 0.49.0
|
||||
|
||||
Take 3's §4b table, re-taken at both binaries. The `aes` instantiation in
|
||||
`tb.sv`. **Every count below is identical on 0.43.0 and 0.49.0.**
|
||||
|
||||
| Request | default | explicit `scopeDepth 0` | workspace |
|
||||
|---|---|---|---|
|
||||
| `definition` | **1 result**, 0.11–0.21 ms | 0 results | 1 result, 0.22–0.30 ms |
|
||||
| `typeDefinition` | 1 result | 0 results | 1 result |
|
||||
| `hover` | 1 result | 0 results | 1 result |
|
||||
| `references` | **11 results**, 0.44–0.50 ms | 0 results | **14 results**, 1.07–1.14 ms |
|
||||
| `documentHighlight` | 1 result | 0 results | 1 result |
|
||||
| `signatureHelp` | 0 results | 0 results | 0 results |
|
||||
| `workspace/symbol "aes"` | 256, 3.4–4.0 ms | 0 results, 0.09 ms | 256, 9.0–12.3 ms |
|
||||
| `inlayHint` (whole file) | **0** | 0 | **4** |
|
||||
|
||||
Take 3's §4b holds on every row, at both binaries: the counts (1 / 11 / 14 /
|
||||
256 / 0-vs-4) are byte-for-byte what take 3 recorded, and §37.2's ruling that
|
||||
`inlayHint`'s zero at the default scope is a scope-reach result rather than an
|
||||
inlay defect still stands.
|
||||
|
||||
---
|
||||
|
||||
## 5. The `didOpen` widen and the `didOpen` delay
|
||||
|
||||
### 5a. At `scopeDepth 0` — apples to apples with all three earlier takes
|
||||
|
||||
`tb.sv` open, then RTL files opened one at a time; the request sent
|
||||
immediately afterwards waits for the widen. Three tries.
|
||||
|
||||
| Widening `didOpen` | T3 0.43.0 cold | T3 warm | **0.43.0 cold** | **0.43.0 warm** | **0.49.0 cold** | **0.49.0 warm** |
|
||||
|---|---:|---:|---:|---:|---:|---:|
|
||||
| `hw/ip/aes/rtl/aes.sv` | 19.3 ms | 18.5 ms | **28.4 / 16.3 / 29.0** | **27.8 / 24.3 / 29.3** | **29.5 / 18.8 / 27.9** | **30.3 / 27.7 / 30.7** |
|
||||
| `hw/ip/kmac/rtl/kmac.sv` | 32.9 ms | 25.9 ms | **46.7 / 56.0 / 56.0** | **33.5 / 32.8 / 35.3** | **52.3 / 53.7 / 53.0** | **35.6 / 34.2 / 37.3** |
|
||||
| `hw/ip/hmac/rtl/hmac.sv` | 30.4 ms | 20.4 ms | **42.4 / 36.9 / 45.9** | **32.9 / 33.4 / 36.2** | **34.8 / 36.0 / 44.0** | **34.7 / 32.7 / 31.8** |
|
||||
| `hw/ip/spi_device/rtl/spi_device.sv` | 85.2 ms | 37.0 ms | **93.5 / 101.9 / 102.0** | **54.7 / 58.0 / 57.5** | **105.4 / 107.5 / 102.1** | **56.9 / 56.0 / 60.0** |
|
||||
|
||||
`spi_device` is still the ceiling, for the reason take 1 gave. **The two
|
||||
binaries are the same on every cell**, and both are 20–50% above take 3's
|
||||
0.43.0 column, which is the machine. At this scope each open *is* a rescan, so
|
||||
§46 has nothing to remove.
|
||||
|
||||
### 5b. At the default scope — the widen row, and the three that follow it
|
||||
|
||||
| Widening `didOpen` | T3 0.43.0 cold | T3 warm | **0.43.0 cold** | **0.43.0 warm** | **0.49.0 cold** | **0.49.0 warm** |
|
||||
|---|---:|---:|---:|---:|---:|---:|
|
||||
| `aes.sv` (widens `hw/ip/aes` → **`hw/ip`, 1 807 files**) | 1 081.6 ms | 365.1 ms | **1 046.6 / 1 042.0 / 1 019.8** | **344.9 / 340.4 / 338.9** | **1 072.4 / 1 075.8 / 1 051.4** | **367.0 / 351.0 / 378.1** |
|
||||
| `kmac.sv` (already in scope) | 24.3 ms | 31.1 ms | **53.4 / 23.9 / 48.5** | **35.3 / 45.0 / 44.7** | **12.7 / 5.5 / 9.6** | **6.6 / 9.5 / 11.6** |
|
||||
| `hmac.sv` (already in scope) | 22.6 ms | 21.1 ms | **31.7 / 38.4 / 26.2** | **36.4 / 35.7 / 33.5** | **17.5 / 9.1 / 7.4** | **9.3 / 11.6 / 4.9** |
|
||||
| `spi_device.sv` (already in scope) | 47.6 ms | 51.2 ms | **68.8 / 35.3 / 55.8** | **46.5 / 58.2 / 68.9** | **19.9 / 6.2 / 18.0** | **8.5 / 21.0 / 15.4** |
|
||||
|
||||
**The widen row itself did not move**: 340 ms warm at 0.43.0, 365 ms at
|
||||
0.49.0, against take 3's 365 — the same number, three ways. Take 2's
|
||||
"1.5-second hang on the most common navigation a Verilog user performs" stays
|
||||
closed.
|
||||
|
||||
**The three rows under it are take 3's §8.4, and they are fixed.** A `didOpen`
|
||||
of a file already in scope cost 21–51 ms in take 3 and 33–69 ms here at
|
||||
0.43.0; at 0.49.0 it is **5–21 ms**, a 3–5× on every cell. That is §46, and
|
||||
§5c measures it properly.
|
||||
|
||||
### 5c. §46 on the wire, in the release build — the round's headline
|
||||
|
||||
Take 3 filed the delay (§8.4); 0.44.0 fixed it; the perf README's 2026-09-05
|
||||
table was taken with *temporary* timings on a release build. These are the
|
||||
release numbers, workspace scope, warm store, `didOpen` → the
|
||||
`textDocument/definition` behind it, three tries.
|
||||
|
||||
| file | lines | perf README "before" | **0.43.0, tonight** | perf README "after" | **0.49.0, tonight** | factor |
|
||||
|---|---:|---|---:|---|---:|---:|
|
||||
| `aes.sv` | 326 | 8.1 / 5.9 / 10.1 ms | **11.3 / 4.3 / 11.4** | 4.3 / 1.8 / 2.3 ms | **5.1 / 3.5 / 3.7** | ~2× |
|
||||
| `aes_core.sv` | 1 145 | 56.2 / 54.0 / 48.0 ms | **42.6 / 63.0 / 63.1** | 5.9 / 6.9 / 6.3 ms | **11.0 / 4.0 / 10.4** | **7×** |
|
||||
| `spi_device.sv` | 1 985 | 94.2 / 103.4 / 88.6 ms | **98.7 / 75.2 / 99.5** | 6.0 / 8.6 / 8.7 ms | **15.5 / 13.8 / 15.1** | **6×** |
|
||||
| `pinmux_reg_top.sv` | 42 192 | 1 742 / 1 740 / 1 757 ms | **1 605 / 1 604 / 1 611** | 116.5 / 116.2 / 117.3 ms | **112.1 / 127.9 / 130.7** | **13×** |
|
||||
|
||||
The release build **confirms the fix at the same magnitude the temporary
|
||||
timings reported**, and the largest file in opentitan opens in a tenth of a
|
||||
frame-budget-heavy second rather than in a second and a half. The absolute
|
||||
values here run 1.3–2× above the perf README's on the small files and are
|
||||
level on the large one, which is the expected shape when the machine is
|
||||
busier: a 4 ms row is mostly floor, a 1 600 ms row is mostly work.
|
||||
|
||||
**The same cost was paid on every keystroke flush**, not just on opens
|
||||
(`docs/features/didopen-cost/`), so this is a typing-latency fix as much as a
|
||||
navigation one. That is the strongest single result in this document.
|
||||
|
||||
---
|
||||
|
||||
## 6. `codeAction`, refactorings, rename and the index
|
||||
|
||||
### 6a. Cost against the module's fan-out — the eager path doubled
|
||||
|
||||
Workspace scope, warm cache, cursor on a module instantiation, four tries
|
||||
each. "Lazy" is a client that advertises
|
||||
`textDocument.codeAction.resolveSupport.properties: ["edit"]` (what VS Code
|
||||
sends); "eager" is a client that does not. Fan-outs re-derived with take 3's
|
||||
`grep -rlE '^\s*<module>( |#|$)' --include='*.sv'` and **identical to take 2's
|
||||
and take 3's** (1 / 6 / 42 / 67 / 128).
|
||||
|
||||
| Module at the cursor | files | T3 0.43 eager | **0.43 eager** | **0.49 eager** | T3 0.43 lazy | **0.43 lazy** | **0.49 lazy** | actions at 0.49 |
|
||||
|---|---:|---:|---:|---:|---:|---:|---:|---:|
|
||||
| `aes_reg_top` (in `aes.sv` 103:0) | 1 | 27.7 / 16.3–21.8 | **36.2 / 16.0–22.6** | **30.6 / 22.8–24.2** | 27.1 / 16.4–20.6 | **17.6 / 14.2–15.2** | **29.8 / 21.8–23.5** | **2** |
|
||||
| `aes` (in `tb.sv` 44:2) | 6 | 66.1 / 45.7–48.2 | **61.5 / 43.5–46.1** | **114.0 / 88.3–90.7** | 5.15 / 4.05–4.24 | **7.4 / 4.0–4.9** | **14.2 / 7.9–9.8** | **1** |
|
||||
| `prim_lc_sync` (in `aes.sv` 118:2) | 42 | 148.0 / 128.9–130.4 | **138.6 / 121.5–124.9** | **270.0 / 254.7–255.7** | 17.3 / 7.2–8.6 | **18.1 / 7.4–9.4** | **7.0 / 6.0–6.2** | **1** |
|
||||
| `prim_alert_sender` (in `aes.sv` 235:4) | 67 | 213.4 / 196.0–196.5 | **211.5 / 183.0–192.4** | **405.1 / 362.3–368.8** | 14.8 / 8.6–10.8 | **14.7 / 8.5–12.2** | **13.2 / 9.0–11.5** | **1** |
|
||||
| `prim_flop_2sync` (in `aon_timer.sv` 83:2) | 128 | 270.2 / 252.9–255.2 | **267.1 / 238.6–243.3** | **511.8 / 467.1–473.6** | 24.0 / 15.6–16.9 | **16.7 / 10.5–13.2** | **15.0 / 8.1–10.5** | **2** |
|
||||
| *(contrast) a comment line* | — | 1.80 / 0.71–0.78 | **2.41 / 1.33–1.58** | **7.44 / 4.34–4.95** | 1.69 / 0.66–0.81 | **2.17 / 1.12–1.32** | **4.70 / 3.18–3.84** | **0** |
|
||||
| **`aes` in `aes_wrap.sv` 78:2 — the offering cursor** | 6 | 143.8 / 123.9–124.4 | **145.6 / 115.4–118.6** | **167.9 / 159.9–160.9** | 33.3 / 21.2–26.8 | **20.8 / 18.9–20.2** | **28.6 / 23.6–24.4** | **2** |
|
||||
|
||||
Two readings, in opposite directions.
|
||||
|
||||
**The lazy offer is still `O(1)` in the fan-out and is unchanged where it
|
||||
matters.** 6.0 ms at 42 files, 9.0 at 67, 8.1 at 128 — flat, and slightly
|
||||
*better* than 0.43.0 at the two largest fan-outs. Take 2's "reads as a hang"
|
||||
line at 200 ms is nowhere near crossed for a resolving client.
|
||||
|
||||
**The eager path is 1.95–2.07× dearer at every fan-out above 1**: 46 → 90 ms
|
||||
at 6 files, 125 → 255 at 42, 192 → 368 at 67, 243 → 473 at 128. A consistent
|
||||
factor across four fan-out points, on the same night, on the same machine,
|
||||
with the `--verbose` server's own clock agreeing to 0.5 ms (§0). **The eager
|
||||
`codeAction` path is a ruled non-hot path (owner, 2026-09-05), so this is
|
||||
reported and not re-filed** — but the number is now half a second at the
|
||||
largest fan-out, and §6b shows the eager client also computes strictly more
|
||||
offers than it used to.
|
||||
|
||||
**The two small-cursor rows moved the wrong way for a lazy client too**, and
|
||||
this one *is* filed (§8.2): the `aes` cursor is 4.0–4.9 → 7.9–9.8 ms and a
|
||||
plain comment line is 1.1–1.3 → 3.2–3.8 ms. Nothing is offered at a comment
|
||||
line on either binary; the extra 2 ms is the new offers' gates asking, on
|
||||
every cursor move.
|
||||
|
||||
### 6b. What is offered now, and how often — the census re-taken
|
||||
|
||||
Take 3 swept every instantiation-shaped line in **205 RTL files** — all 165 of
|
||||
`hw/ip/prim/rtl` and all 40 of `hw/ip/aes/rtl` — and found **exactly one
|
||||
position offering a port refactoring**. Take 4 re-ran that sweep at 0.49.0
|
||||
over the same 205 files, adding `import` lines, and classified every offer.
|
||||
**2 440 positions:**
|
||||
|
||||
| Offer | positions offering it | where |
|
||||
|---|---:|---|
|
||||
| `lucisv: extract selection into module…` (§53.1) | **2 171** (89%) | nearly everywhere a whole module item starts |
|
||||
| ``lucisv: inline `M` here`` (§53.2) | **263** (11%) | every instantiation whose buffer parses clean |
|
||||
| `lucisv: organize imports (removes 1, sorts 1)` (§52) | **12** | 2 files: `aes_sbox_canright_masked{,_noreuse}.sv` |
|
||||
| `lucisv: connect N missing ports` (§37/ports) | **1** | `hw/ip/aes/rtl/aes_wrap.sv` 0-based 78:2 — take 3's cursor, unmoved |
|
||||
| `lucisv: expand .* (N connections)` (§50) | **0** | no `.*` in these 205 files (8 files corpus-wide have one) |
|
||||
| `lucisv: remove port …` | **0** | refuses when the module's body uses the port — real RTL always does |
|
||||
|
||||
**Take 3's §8.7 — "the lightbulb is almost never lit" — is no longer true, and
|
||||
that is the mechanism behind §6a's eager number.** At 0.43.0 a cursor on an
|
||||
instantiation offered nothing at all on this corpus except at one position; at
|
||||
0.49.0 it offers one or two things almost everywhere. Both new offers are
|
||||
cheap by construction — `extract` and `inline` carry a `Command`, not an edit,
|
||||
so neither reads the workspace at offer time — but each has a *gate* that
|
||||
parses the cursor's buffer, and that gate runs on every `codeAction`.
|
||||
|
||||
**There is no `convert to ANSI` (§51) site on this corpus.** A scan of all
|
||||
**1 311 module headers** in opentitan's `hw/` (3 932 `.sv`/`.v` files) found
|
||||
**zero** non-ANSI headers — every one declares its ports in the header. So
|
||||
that row below measures an ANSI header, where the action is correctly not
|
||||
offered, and §51's cost on this corpus is exactly the cost of saying no.
|
||||
|
||||
*Traceability note (lead, after QA).* The header scan was a one-off census,
|
||||
not a harness phase, so it has no log: a line-anchored `module NAME` match
|
||||
over every `.sv`/`.v` under `hw/`, comments stripped, the port list checked
|
||||
for a direction keyword. QA re-derived it independently: 1 310 headers, two
|
||||
apparent non-ANSI hits that are `module NAME #(…);` with **no** port list at
|
||||
all, net zero genuine non-ANSI headers. Read "1 311" as "all of them"; the
|
||||
one-header difference is the two scans' treatment of a macro-wrapped header.
|
||||
|
||||
### 6c. The five new offer sites, offer and resolve
|
||||
|
||||
Lazy client, workspace scope, warm cache, four tries. Each row names a real
|
||||
opentitan position, 0-based.
|
||||
|
||||
| Site | file, position | actions offered | **offer, 0.49.0** | **resolve, 0.49.0** | **0.43.0 offer** |
|
||||
|---|---|---:|---:|---:|---:|
|
||||
| **expand `.*`** — `sha3 #(…) u_sha3 ( .* );` | `hw/ip/kmac/fpv/tb/sha3_fpv.sv` 54:4 | 2 (`expand .* (32 connections)`, `extract`) | **8.2 / 6.2–7.3 ms** | **67.8 / 66.9–67.0 ms**, 1 file | 0 actions, 2.1 / 1.7–1.8 ms |
|
||||
| **organize imports** — 2 imports, 1 unused | `hw/ip/aes/rtl/aes_sbox_canright_masked.sv` 42:2 | 2 (`organize imports (removes 1, sorts 1)`, `extract`) | **30.1 / 13.8–19.5 ms** | **9.6 / 9.6–9.6 ms**, 1 file | 0 actions, 18.5 / 12.7–15.1 ms |
|
||||
| **inline module** — a separate-file instance with named connections | `hw/ip/aes/rtl/aes_wrap.sv` 66:2 (`tlul_cmd_intg_gen u_…`) | 2 (``inline `tlul_cmd_intg_gen` here``, `extract`) | **31.7 / 13.9–19.5 ms** | **0.05 / 0.03–0.04 ms** (a `Command`) | 0 actions, 27.1 / 10.8–16.7 ms |
|
||||
| **extract module** — a 3-item selection | `hw/ip/aes/rtl/aes.sv` 220:0–222:53 (three status `assign`s) | 1 (`extract selection into module…`) | **8.0 / 3.7–5.0 ms** | **0.19 / 0.08–0.13 ms** (a `Command`) | 0 actions, 20.1 / 5.3–7.4 ms |
|
||||
| **port actions** — take 3's cursor | `hw/ip/aes/rtl/aes_wrap.sv` 78:2 | 2 (`connect 2 missing ports`, `extract`) | **28.6 / 23.6–24.4 ms** | **163.9 / 158.2–159.5 ms**, 1 file | 1 action, 20.8 / 18.9–20.2 ms |
|
||||
| **convert to ANSI** — *no site exists* (§6b); an ANSI header instead | `hw/ip/aes/rtl/aes.sv` 8:0 (`module aes`) | 0 | **2.8 / 2.2–2.4 ms** | *n/a* | 0 actions, 5.2 / 3.5–3.9 ms |
|
||||
|
||||
Three things worth stating plainly:
|
||||
|
||||
- **`inline` and `extract` cost nothing to *pick*** — 0.05 and 0.19 ms —
|
||||
because the action carries a `workspace/executeCommand`, not an edit. The
|
||||
work happens when the command runs, which this round does not measure
|
||||
(running it would edit the corpus). The design is deliberate and is
|
||||
documented in `crates/lucisv_server/src/inline_module.rs`'s own header.
|
||||
- **`organize imports` is the opposite shape**: the offer computes the whole
|
||||
edit (30 / 14–19 ms, because judging it means reading the package closure),
|
||||
and the resolve is a cheap re-run at 9.6 ms.
|
||||
- **`expand .*` is `O(connections)` on resolve**: 68 ms for 32 connections,
|
||||
against an 8 ms offer. That is the right split.
|
||||
|
||||
**The port-actions resolve is 1.44× dearer at 0.49.0** (110 → 159 ms) at the
|
||||
one cursor on this corpus that offers it, and the eager one-shot is 1.36×
|
||||
(117 → 160 ms). Filed with §8.2.
|
||||
|
||||
### 6d. `prepareRename`, `rename`, and §49's hierarchical tail
|
||||
|
||||
`prepareRename` remains flat and free — 0.12–0.91 ms at 0.49.0, 0.13–0.15 at
|
||||
0.43.0 — with the byte-identical answer take 2 pinned
|
||||
(`{"placeholder":"aes","range":{"start":{"line":44,"character":2},"end":{"line":44,"character":5}}}`).
|
||||
|
||||
`rename` on `aes` is **165.1 / 133.5–139.4 ms at 0.49.0** against
|
||||
**159.8 / 133.2–136.2 at 0.43.0**, both editing **9 files** — flat, and level
|
||||
with take 3's 151.8 / 139.1–140.7.
|
||||
|
||||
**The tail rename is the round's one large regression, and it is a regression
|
||||
that buys a correctness fix.** §49 gave a module a second, *hierarchical*
|
||||
member surface — its nets, variables and instances, not only its ports — so a
|
||||
rename can follow `u_x.sig` across a file boundary.
|
||||
|
||||
| | **0.43.0** | **0.49.0** |
|
||||
|---|---:|---:|
|
||||
| `rename` `state_q` at `hw/ip/entropy_src/rtl/entropy_src_main_sm.sv` 41:19 | **88.0 / 65.8–66.7 ms** | **793.2 / 750.7–751.9 ms** |
|
||||
| files edited | **1** (`entropy_src_main_sm.sv`) | **2** (+ `entropy_src_core.sv`) |
|
||||
| the tail `u_entropy_src_main_sm.state_q` | **not edited**, warned about | **edited** |
|
||||
|
||||
**11.3× for one extra edited file.** The rename is user-initiated and rare, so
|
||||
this is a low-severity finding — but it is 0.75 s of a frozen single-threaded
|
||||
queue on a keystroke-shaped gesture (F2, type, Enter), and everything queued
|
||||
behind it pays the same. Filed as §8.3.
|
||||
|
||||
**Two tails on this corpus do *not* resolve**, and both are worth recording so
|
||||
nobody re-derives them as bugs:
|
||||
|
||||
- `hw/top_earlgrey/ip_autogen/pwrmgr/rtl/pwrmgr.sv` 178:10,
|
||||
`u_fsm.state_q` — inside a `` ` ``-macro assertion argument. The rename
|
||||
edits `pwrmgr_fsm.sv` alone.
|
||||
- `hw/top_earlgrey/ip_autogen/pinmux/rtl/pinmux.sv` 687:40, `u_reg.intg_err` —
|
||||
likewise not edited, and `completion` after `u_reg.` there returns 0 items.
|
||||
|
||||
§49's own README rules a *generate-block-scoped* tail an honest refusal; these
|
||||
two are a different shape and are filed as §8.5 for a future round to classify.
|
||||
|
||||
### 6e. `completion`, the instance-head tail, `moduleHierarchy`, the index
|
||||
|
||||
**`completion` did not move.** Every prefix is within 0.6 ms of 0.43.0 and
|
||||
every one returns the same item count:
|
||||
|
||||
| Typed prefix | items | **0.43.0** | **0.49.0** | T3 0.43.0 |
|
||||
|---|---:|---:|---:|---:|
|
||||
| `` (empty) | 512 | 7.8 / 4.2–5.4 ms | **7.2 / 4.2–5.3 ms** | 9.5 / 2.3–2.8 |
|
||||
| `a` | 512 | 4.4 / 3.1–3.3 | **4.5 / 3.1–3.3** | 3.2 / 2.5–2.7 |
|
||||
| `ae` | 512 | 3.5 / 2.6–2.7 | **3.6 / 2.7–2.9** | 4.0 / 2.6–2.9 |
|
||||
| `aes` | 512 | 8.6 / 6.8–7.4 | **9.1 / 7.0–8.2** | 10.4 / 7.8–9.2 |
|
||||
| `aes_` | 512 | 6.8 / 6.2–6.4 | **7.1 / 6.7–6.9** | 7.5 / 6.8–8.2 |
|
||||
| `prim_` | 512 | 4.2 / 3.4–3.6 | **4.1 / 3.6–3.8** | 5.1 / 4.0–4.4 |
|
||||
| `clk` | 512 | 3.9 / 3.3–3.3 | **4.2 / 3.3–3.5** | 4.4 / 3.3–3.9 |
|
||||
| `aes_reg` | 512 | 3.2 / 2.6–2.8 | **3.3 / 2.7–2.9** | 3.8 / 2.9–3.0 |
|
||||
| `zzzz` | 1 | 1.2 / 0.29–0.31 | **1.2 / 0.31–0.35** | 1.4 / 0.31–0.34 |
|
||||
|
||||
**Completion after an instance head and a `.`** — §49's other surface, at
|
||||
`hw/ip/entropy_src/rtl/entropy_src_core.sv` 3091:29
|
||||
(`u_entropy_src_main_sm.`):
|
||||
|
||||
| | **0.43.0** | **0.49.0** |
|
||||
|---|---:|---:|
|
||||
| round trip | 1.72 / 0.52–0.66 ms | **1.11 / 0.45–0.53 ms** |
|
||||
| items | **24** | **26** |
|
||||
|
||||
**Two more members for no time at all** — the hierarchical surface arrives
|
||||
free on this path, which is the shape §49 wanted and the opposite of the
|
||||
rename row above.
|
||||
|
||||
**`lucisv/moduleHierarchy`** — the flat snapshot the VS Code DUT sidebar
|
||||
consumes (`params: {}`; the sections are client-side and not measured here):
|
||||
|
||||
| | **0.43.0** | **0.49.0** |
|
||||
|---|---:|---:|
|
||||
| round trip | 70.3 / 41.0–48.8 ms | **76.2 / 41.1–53.8 ms** |
|
||||
| payload | 2 600 051 B | **2 600 051 B** — byte-identical |
|
||||
| content | 1 546 modules over 1 529 files, `schemaVersion` 2 | same |
|
||||
|
||||
Unchanged, and the payload is 2.6 MB — the compaction its own module
|
||||
documents (11.6 MB → 1.9 MB) is holding. It is sent on demand, not on every
|
||||
save, so 40–76 ms is a fair price; it is also the single largest message this
|
||||
server writes, and it blocks the queue for that whole time (§3's rule).
|
||||
|
||||
**The index's size, on disk and resident.** `FACTS_FORMAT` 18 → 19 added the
|
||||
hierarchical member table and the re-export group:
|
||||
|
||||
| | **0.43.0** | **0.49.0** | change |
|
||||
|---|---:|---:|---:|
|
||||
| index store on disk, after a workspace scan | **39 940 KB** (39.0 MB) | **45 404 KB** (44.3 MB) | **+13.7%** |
|
||||
| server RSS after a **cold** workspace scan (3 tries) | 479 520 / 483 056 / 481 936 KB | **544 800 / 539 392 / 542 736 KB** | **+12.6%** |
|
||||
| server RSS after a **warm** workspace scan (3 tries) | 512 544 / 512 400 / 501 872 KB | **581 072 / 588 608 / 587 264 KB** | **+15.1%** |
|
||||
|
||||
**+13.7% on disk and +12.6/+15.1% resident, which is a proportionate price** for what §49 and §48
|
||||
bought — a 3 976-file design costs the editor 530–590 MB resident and 44 MB on
|
||||
disk. Worth a glance next round rather than a finding: the disk and the
|
||||
resident set moved by the same fraction, so this is the index growing, not a
|
||||
leak. Also worth knowing: **a warm scan holds more than a cold one on both
|
||||
binaries** — 27 MB more at 0.43.0, 42 MB more at 0.49.0 — because the store
|
||||
is read into memory as well as built.
|
||||
|
||||
---
|
||||
|
||||
## 7. The CLI sweeps
|
||||
|
||||
`format --check` and `check` over five trees, three binaries, three tries each,
|
||||
wall clock and peak RSS from `/usr/bin/time -l`, everything under
|
||||
`tools/guard.sh`. The formatter cache lives in a scratch `--cache-dir` outside
|
||||
the corpus. File counts: `hw/ip` 1 807, `hw/top_earlgrey/ip` 46,
|
||||
`hw/top_darjeeling/ip` 49, `hw/dv` 365, `hw/vendor` 287 — unchanged from
|
||||
take 3.
|
||||
|
||||
| Tree | command | **0.49.0** | **0.43.0** | 0.39.0 | peak RSS, 0.49 → 0.43 → 0.39 (MB) |
|
||||
|---|---|---:|---:|---:|---:|
|
||||
| `hw/ip` | `format --check`, cold cache | 0.60 / 0.64–0.67 | 0.64 / 0.60–0.64 | 0.60 / 0.60–0.62 | 216 → 237 → 238 |
|
||||
| `hw/ip` | `format --check`, warm cache | 0.60 / 0.62–0.63 | 0.58 / 0.60–0.63 | 0.63 / 0.56–0.57 | 217 → 214 → 228 |
|
||||
| `hw/ip` | `check` (default rules) | 0.37 / 0.38–0.40 | 0.41 / 0.38–0.41 | 0.34 / 0.35 | 190 → 176 → 186 |
|
||||
| `hw/ip` | `check --select error,warning,style` | **0.57 / 0.58–0.60** | 0.45 / 0.44–0.47 | 0.40 / 0.40–0.41 | 212 → 175 → 190 |
|
||||
| `hw/top_earlgrey/ip` | `format --check`, cold / warm | 0.04 / 0.04 | 0.04 / 0.04 | 0.03 / 0.04 | 34 → 32 → 31 |
|
||||
| `hw/top_earlgrey/ip` | `check` / `--select …` | 0.03 / 0.04 | 0.02 / 0.03 | 0.03 / 0.03 | 33 → 38 → 30 |
|
||||
| `hw/top_darjeeling/ip` | `format --check`, cold / warm | 0.04 / 0.03 | 0.03 / 0.03 | 0.03 / 0.03 | 22 → 22 → 24 |
|
||||
| `hw/top_darjeeling/ip` | `check` / `--select …` | 0.02 / 0.03 | 0.02 / 0.02 | 0.02 / 0.03 | 27 → 27 → 26 |
|
||||
| `hw/dv` | `format --check`, cold / warm | 0.07 / 0.07 | 0.07 / 0.07 | 0.06 / 0.06 | 27 → 27 → 29 |
|
||||
| `hw/dv` | `check` / `--select …` | 0.05 / 0.08 | 0.06 / 0.07 | 0.05 / 0.06 | 30 → 33 → 31 |
|
||||
| `hw/vendor` | `format --check`, cold / warm | 0.10 / 0.10 | 0.12 / 0.09 | 0.10 / 0.10 | 45 → 44 → 44 |
|
||||
| `hw/vendor` | `check` / `--select …` | 0.08 / 0.11 | 0.08 / 0.09 | 0.07 / 0.09 | 53 → 50 → 48 |
|
||||
|
||||
- **`format --check` did not move at all.** Every cell on every tree is inside
|
||||
the three binaries' own spread. The biggest tree, 1 807 files, is checked
|
||||
for formatting in 0.6 s on ten cores at ~220 MB, exactly as in take 3.
|
||||
- **`check --select error,warning,style` is 1.27× slower than 0.43.0 on
|
||||
`hw/ip`** (0.45 → 0.57 s), 1.22× on `hw/vendor` (0.09 → 0.11) and 1.14× on
|
||||
`hw/dv` (0.07 → 0.08). **Most of this is more work, not slower work**:
|
||||
0.49.0 runs the new `unused-import` rule (0.48.0, §52's shared judgement)
|
||||
and finds 17 more violations on `hw/ip`. §8.4 files what is left.
|
||||
- **`check` with default rules did *not* slow down** (0.41 → 0.37 s on
|
||||
`hw/ip`), which is the same reading from the other side: `unused-import` is
|
||||
Style and off by default, so the default rule set is untouched. Take 3's
|
||||
§8.5 ("`check` is 6–10% slower than 0.39.0") therefore **stops
|
||||
accumulating** on the default path: 0.34–0.35 s at 0.39.0, 0.38–0.41 at
|
||||
0.43.0, 0.37–0.40 at 0.49.0.
|
||||
- **The formatter cache still buys nothing on opentitan**, and for the reason
|
||||
take 3 gave: it remembers already-formatted files, and opentitan has 30 of
|
||||
1 807 in `hw/ip`, 3 of 365 in `hw/dv`, 12 of 287 in `hw/vendor`. The cold
|
||||
and warm rows are within noise everywhere.
|
||||
- **Peak RSS scales with the tree, not the version.** 22–53 MB for the four
|
||||
small trees, 175–238 MB for `hw/ip`; no version is consistently above
|
||||
another and the ordering flips between rows, so nothing is claimed.
|
||||
|
||||
### 7a. Failure counts, and every per-file outcome that changed
|
||||
|
||||
`format --check --no-cache`, `check` and `check --select error,warning,style`,
|
||||
full runs, all three binaries, paths made relative and sorted so two runs
|
||||
differ only where an *outcome* did.
|
||||
|
||||
| Tree | 0.39.0 `format --check` | 0.43.0 | **0.49.0** |
|
||||
|---|---|---|---|
|
||||
| `hw/ip` | 1773 would reformat, 30 unchanged, 4 failed | 1772, 30, 4 | **1772, 30, 4** |
|
||||
| `hw/top_earlgrey/ip` | 46 would reformat | 46 | **46** |
|
||||
| `hw/top_darjeeling/ip` | 48 would reformat, 1 failed | 48, 1 | **48, 1** |
|
||||
| `hw/dv` | 361, 3 unchanged, 1 failed | 362, 3, 0 | **362, 3, 0** |
|
||||
| `hw/vendor` | 270, 12 unchanged, 5 failed | 271, 12, 4 | **271, 12, 4** |
|
||||
|
||||
**`format --check --no-cache` is byte-identical between 0.43.0 and 0.49.0 on
|
||||
all five trees** — not one per-file verdict changed, and not one parse error
|
||||
appeared or disappeared. §54's grammar additions (`randsequence`, `->>`,
|
||||
casts, drive strengths, `let`, clocking skews) were the expected candidates;
|
||||
**none of them changes an outcome on this corpus**, because none of those
|
||||
shapes appears in a file that lucisv did not already handle. §38's fixes stay
|
||||
fixed.
|
||||
|
||||
**`check` with default rules is byte-identical too** — `hw/ip` 445,
|
||||
`hw/top_earlgrey/ip` 14, `hw/top_darjeeling/ip` 23, `hw/dv` 85, `hw/vendor`
|
||||
231 + 1 file that cannot be checked, at both 0.43.0 and 0.49.0.
|
||||
|
||||
**`check --select error,warning,style` changed in exactly one way: 20 new
|
||||
`unused-import` findings, and nothing else.**
|
||||
|
||||
| Tree | 0.43.0 | **0.49.0** | delta |
|
||||
|---|---:|---:|---:|
|
||||
| `hw/ip` | 7 734 | **7 751** | +17 |
|
||||
| `hw/top_earlgrey/ip` | 551 | **553** | +2 |
|
||||
| `hw/top_darjeeling/ip` | 382 | **383** | +1 |
|
||||
| `hw/dv` | 1 158 | **1 158** | 0 |
|
||||
| `hw/vendor` | 1 666 | **1 666** | 0 |
|
||||
|
||||
Every one of the 20 is a line of the form
|
||||
``<file>:<line>:<col>: style: `pkg::*` is imported but nothing in this scope
|
||||
uses it [unused-import]``, and **no violation disappeared**. `unused-import`
|
||||
is the rule 0.48.0 added out of organize-imports' judgement (CHANGELOG 0.48.0:
|
||||
"Style, off by default, safe fix"), which is why the default rule set is
|
||||
untouched. **The outcome diff is fully explained; there is no unexplained
|
||||
change on any tree, for any command, at any rule set.**
|
||||
|
||||
The files that still fail to parse, unchanged from take 3 apart from the two
|
||||
0.42/0.43 fixes it recorded:
|
||||
`hw/ip/edn/dv/env/edn_env_cfg.sv`, `hw/ip/kmac/fpv/tb/keccak_2share_fpv.sv`,
|
||||
`hw/ip/kmac/pre_dv/kmac_reduced_tb/rtl/kmac_reduced_tb.sv`,
|
||||
`hw/ip/spi_device/dv/env/spi_device_scoreboard.sv`,
|
||||
`hw/top_darjeeling/ip/ast/rtl/ast.sv` (a locally modified file),
|
||||
`hw/vendor/lowrisc_ibex/dv/formal/check/peek/compare_helper.sv`,
|
||||
`hw/vendor/lowrisc_ibex/dv/uvm/core_ibex/riscv_dv_extension/riscv_core_setting.tpl.sv`
|
||||
(a template, not SystemVerilog),
|
||||
`hw/vendor/lowrisc_ibex/syn/rtl/latch_map.v`,
|
||||
`hw/vendor/lowrisc_ibex/vendor/google_riscv-dv/src/riscv_instr_cover_group.sv`.
|
||||
|
||||
---
|
||||
|
||||
## 8. Findings — filed, not fixed
|
||||
|
||||
Ordered by how much they matter. Nothing here was fixed in this round.
|
||||
|
||||
### 8.1 CREDIT, not a finding — what got faster
|
||||
|
||||
Stated first so the rest reads in proportion.
|
||||
|
||||
| What | 0.43.0 | **0.49.0** | Credit |
|
||||
|---|---:|---:|---|
|
||||
| `didOpen` of opentitan's largest file → the next request | 1 605 / 1 604–1 611 ms | **112 / 128–131 ms** | **§46** (0.44.0) — **14×** |
|
||||
| `didOpen spi_device.sv` → the next request | 98.7 / 75.2–99.5 ms | **15.5 / 13.8–15.1 ms** | **§46** — 6× |
|
||||
| `didOpen aes_core.sv` → the next request | 42.6 / 63.0–63.1 ms | **11.0 / 4.0–10.4 ms** | **§46** — 7× |
|
||||
| A `didOpen` of a file already in scope, default scope (take 3's §8.4) | 33–69 ms | **5–21 ms** | **§46** — 3–5×; **take 3's §8.4 is closed** |
|
||||
| `rename` through an instance tail | 1 file, tail unedited | **2 files, tail edited** | **§49** — correctness, at a cost (§8.3) |
|
||||
| `completion` after an instance head + `.` | 24 items, 1.72 / 0.52–0.66 ms | **26 items, 1.11 / 0.45–0.53 ms** | **§49** — free |
|
||||
| `codeAction` lazy offer at 42 files | 18.1 / 7.4–9.4 ms | **7.0 / 6.0–6.2 ms** | unattributed; §37.1's shape holding |
|
||||
|
||||
**§46 closes take 3's §8.4 outright**, and it is the largest improvement any
|
||||
of the four rounds has measured on a per-keystroke path.
|
||||
|
||||
### 8.2 FINDING (medium) — the lazy `codeAction` offer costs 2–3 ms more at every cursor, offered or not
|
||||
|
||||
**What.** For a resolving client — the majority since 0.41.0, and what VS Code
|
||||
sends — `textDocument/codeAction` costs 2–5 ms more at 0.49.0 than at 0.43.0
|
||||
at the *small* cursors, including cursors where nothing is offered:
|
||||
|
||||
| cursor | 0.43.0 repeats | **0.49.0 repeats** | factor |
|
||||
|---|---:|---:|---:|
|
||||
| a plain comment line (0 actions on both) | 1.12 – 1.32 ms | **3.18 – 3.84 ms** | **2.9×** |
|
||||
| `aes` in `tb.sv` (1 action at 0.49, 0 at 0.43) | 4.0 – 4.9 ms | **7.9 – 9.8 ms** | 2.0× |
|
||||
| `aes_reg_top` in `aes.sv` (2 actions at 0.49, 0 at 0.43) | 14.2 – 15.2 ms | **21.8 – 23.5 ms** | 1.5× |
|
||||
| pipelined `definition` behind the `aes` codeAction (§3) | 3.3 – 7.3 ms | **11.2 – 15.9 ms** | 2.2× |
|
||||
|
||||
**Why it matters.** `codeAction` fires on every cursor move, and every request
|
||||
behind it in the serial queue pays its bill (§3). At 0.43.0 a cursor move cost
|
||||
the queue 3–7 ms; at 0.49.0 it costs 11–16 ms. Still inside a 16 ms frame, but
|
||||
the margin is gone, and this is a request the user never asked for.
|
||||
|
||||
**The mechanism, as far as this round can see it without bisecting.** The
|
||||
comment-line row is the cleanest evidence: **zero** actions are offered on
|
||||
either binary, so the extra 2 ms is not the cost of producing an offer. It is
|
||||
the cost of the new offers' *gates* — `vlog_refactor::inline_site` and
|
||||
`extract_site` each run a tolerant parse of the cursor's buffer
|
||||
(`crates/vlog_refactor/src/inline/mod.rs:73`,
|
||||
`crates/lucisv_server/src/inline_module.rs:50`) — asked on every cursor move.
|
||||
Not bisected; candidates are §52, §53.1 and §53.2, which are the three that
|
||||
added a gate.
|
||||
|
||||
**Reproduce.** `bench.py codeaction`, then read the `comment line, lazy` rows
|
||||
for the two labels; or `bench.py probe --probe hw/ip/aes/dv/tb/tb.sv:43:2`.
|
||||
Workspace scope, warm store, `tb.sv` open, four tries. The `--verbose`
|
||||
server's own line agrees with the wire to 0.5 ms (§0), so this is server work.
|
||||
|
||||
**A cheap direction, if a future round wants one:** the two gates parse the
|
||||
same buffer the server already has parsed for diagnostics and symbols. Take 3
|
||||
made the same observation about the port offer, and §37.1's answer — do not
|
||||
compute what nobody asked for — is the shape that worked.
|
||||
|
||||
### 8.2b REPORTED, not filed — the eager `codeAction` path is ~2× dearer
|
||||
|
||||
The eager path (a client without
|
||||
`codeAction.resolveSupport.properties: ["edit"]` — Vim/Neovim setups and
|
||||
simple clients) is **1.95–2.07× slower at 0.49.0 than 0.43.0** at every
|
||||
fan-out above 1: 46 → 90 ms at 6 files, 125 → 255 at 42, 192 → 368 at 67,
|
||||
243 → 473 at 128 (§6a). Take 3 filed the earlier 1.37× step as its §8.2; **the
|
||||
owner ruled the eager path a non-hot path on 2026-09-05**, so take 4 reports
|
||||
the number and does not re-file it. Two facts for whoever reads it next: it
|
||||
now crosses half a second at the largest fan-out, and the resolve at the one
|
||||
offering cursor moved with it (110 → 159 ms, §6c), which the *lazy* client
|
||||
pays too — but only on a click.
|
||||
|
||||
### 8.3 FINDING (low–medium) — §49's tail rename is 11× a same-file rename
|
||||
|
||||
**What.** Renaming a variable that a hierarchical tail names from another file
|
||||
costs **793.2 / 750.7–751.9 ms at 0.49.0** against **88.0 / 65.8–66.7 ms at
|
||||
0.43.0**, for one extra edited file.
|
||||
|
||||
**Reproduce.** `bench.py tailrename`. `textDocument/rename` on `state_q` at
|
||||
`hw/ip/entropy_src/rtl/entropy_src_main_sm.sv` 0-based 41:19, newName
|
||||
anything, workspace scope, warm store, with
|
||||
`hw/ip/entropy_src/rtl/entropy_src_core.sv` also open. 0.43.0 returns 1 file
|
||||
and warns about the tail; 0.49.0 returns 2 files and edits it. The edits are
|
||||
discarded.
|
||||
|
||||
**Why it is filed and not credited.** The correctness is unambiguously right —
|
||||
§49's whole point is that the old answer handed back a design that no longer
|
||||
elaborates — and a rename is user-initiated and rare. But 0.75 s freezes the
|
||||
single-threaded queue for three quarters of a second on an F2-shaped gesture,
|
||||
and everything behind it waits (§3). Compare the ordinary `rename` on `aes`,
|
||||
which edits **nine** files in 133–139 ms: the tail rename edits **two** in
|
||||
751 ms, so this is not "more files", it is a different and much more expensive
|
||||
lookup. `completion` on the same surface is *free* (§6e), which suggests the
|
||||
cost is in rename's reference walk rather than in the surface itself.
|
||||
|
||||
**Not bisected.** The candidate is §49's hierarchical member walk in
|
||||
`workspace/record.rs` / `resolve.rs::head_surface`.
|
||||
|
||||
### 8.4 FINDING (low) — `check --select error,warning,style` is 1.27× slower, beyond the new rule's own work
|
||||
|
||||
`hw/ip`: 0.45 → 0.57 s (mean of three); `hw/vendor` 0.09 → 0.11;
|
||||
`hw/dv` 0.07 → 0.08. 0.49.0 does find 20 more violations (§7a), all from
|
||||
0.48.0's `unused-import`, so **some** of this is honest extra work — but 20
|
||||
extra findings across 2 554 files is not obviously 120 ms of work on `hw/ip`,
|
||||
and `check` with the *default* rules did not move at all (0.41 → 0.37 s), so
|
||||
the whole difference sits in the Style class. Take 3's §8.5 asked whether its
|
||||
6–10% would keep accumulating; on the default path the answer is **no**, and
|
||||
on the Style path it is **yes, once, when a rule was added**. Not bisected.
|
||||
120 ms on the largest tree in opentitan is not a user-visible cost; filed so
|
||||
the next round can see whether adding the *next* Style rule costs the same
|
||||
again.
|
||||
|
||||
**Reproduce.** `tools/perf/sweep.sh <binary> <label> <opentitan> <outdir> 3`,
|
||||
then `sweeptable.py <outdir>`; read the `hw/ip` / `check --select …` row.
|
||||
|
||||
### 8.5 FINDING (low) — two hierarchical tails on this corpus do not resolve
|
||||
|
||||
`hw/top_earlgrey/ip_autogen/pwrmgr/rtl/pwrmgr.sv` 178:10 (`u_fsm.state_q`,
|
||||
inside a `` ` ``-macro assertion argument) and
|
||||
`hw/top_earlgrey/ip_autogen/pinmux/rtl/pinmux.sv` 687:40 (`u_reg.intg_err`)
|
||||
are both instance-head tails whose head is instantiated in the same file and
|
||||
whose target is declared in another. Neither is edited by a rename at
|
||||
0.49.0, and `completion` after `u_reg.` at the second returns **0 items**.
|
||||
§49's README rules a *generate-block-scoped* tail an honest refusal and pins
|
||||
it with a test; neither of these is that shape. This is filed as a question,
|
||||
not an assertion of a defect: a future round (or §49's author) should say
|
||||
which of the two rules applies, so the refusal is documented rather than
|
||||
observed.
|
||||
|
||||
**Reproduce.** `bench.py probe` is for `codeAction`; for these, issue
|
||||
`textDocument/rename` at the declaration
|
||||
(`pwrmgr_fsm.sv` 109:28 for the first) with both files open at workspace
|
||||
scope, and read the edit set.
|
||||
|
||||
### 8.6 WATCH — the index is 14% bigger, on disk and resident
|
||||
|
||||
39.0 → 44.3 MB on disk, 482 → 542 MB resident cold (+12.6%), 509 → 586 MB warm (+15.1%) (§6e).
|
||||
Proportionate to what `FACTS_FORMAT` 18 → 19 added and consistent across the
|
||||
two measures, so not a leak. Recorded because half a gigabyte is what an
|
||||
editor session on this design now holds, and because a fifth round should see
|
||||
whether the next format bump costs another 14%.
|
||||
|
||||
### 8.7 STILL SLOW — the cold workspace scan at ~2.7 s
|
||||
|
||||
2 640–2 712 ms across both binaries, essentially unmoved across four takes
|
||||
(3 003 → 2 958 → 2 767 → 2 676 mean) and still the largest absolute number in
|
||||
the document. Once per session per cold cache; never any round's target.
|
||||
|
||||
### 8.8 CLOSED — take 3's findings, one by one
|
||||
|
||||
| Take 3 finding | Status at 0.49.0 |
|
||||
|---|---|
|
||||
| §8.2 eager `codeAction` 1.37× slower than take 2 | **Superseded.** Another 1.95–2.07× on top, but the path was ruled non-hot; reported as §8.2b |
|
||||
| §8.3 `rename` ~1.4× slower in absolute terms | **Still true, still flat.** 133–139 ms at both binaries, 9 files, ~15 ms per edited file |
|
||||
| §8.4 `didOpen` of an in-scope file delays the next request 21–51 ms | **CLOSED — fixed by §46**, measured in the release build at §5c |
|
||||
| §8.5 `check` 6–10% slower than 0.39.0 | **Partly closed.** Default rules stopped accumulating (§7); the Style class took one more step when a rule was added (§8.4) |
|
||||
| §8.6 `workspace/symbol` keeps drifting up | **Not readable this round.** 8.7–12.7 ms at 0.49.0 and 8.2–13.3 at 0.43.0 — the two binaries' bands overlap almost entirely, and both are above take 3's 7.2–7.9 on a busier machine. No conclusion |
|
||||
| §8.7 the port refactorings are offered at 1 of 205 RTL files | **Still 1 of 205 for the *port* refactorings** — the same `aes_wrap.sv` 78:2. But §6b's census now finds `extract` at 89% of positions and `inline` at 11%, so "the lightbulb is almost never lit" is no longer the corpus's shape |
|
||||
| §8.8 the cold workspace scan at ~2.8 s | **Unchanged.** §8.7 above |
|
||||
|
||||
### 8.9 Movements inside the noise, listed and dismissed
|
||||
|
||||
Every sub-millisecond navigation row: `definition` (0.87 → 0.47 first),
|
||||
`hover` (0.26 → 0.86), `typeDefinition` (0.46 → 0.67), `documentHighlight`
|
||||
(0.19 → 0.61), `foldingRange` (0.44 → 0.73), `codeLens` (0.47 → 0.23),
|
||||
`documentLink` (0.49 → 1.09), `selectionRange` (0.95 → 1.79),
|
||||
`semanticTokens/full` (1.03 → 0.39), `documentSymbol` (0.69 → 0.61),
|
||||
`diagnostic` (1.02 → 0.93), `prepareRename` (0.37 → 0.71), the `didChange`
|
||||
flush (2.32 → 1.79), `inlayHint` (1.90 → 2.04), `references` on `aes`
|
||||
(2.80 → 0.92) and on `.clk_i` (1.54 → 1.65), `signatureHelp` (2.49 → 3.06),
|
||||
`workspace/symbol` (both bands overlapping), the diagnostics publish
|
||||
(164.0 → 164.5), and every `scan` cell.
|
||||
|
||||
**Every one of these sits on a transport floor that measured 0.04–0.17 ms on
|
||||
one binary and 0.09–0.63 ms on the other, minutes apart, on the same machine
|
||||
(§0).** They move in both directions with no pattern, their result counts are
|
||||
identical on both binaries (§4b), and take 3 measured the *same* 0.43.0 binary
|
||||
at a third set of values. **No conclusion should be drawn from any of them.**
|
||||
|
||||
---
|
||||
|
||||
## 9. Methodology and caveats — read before quoting any number
|
||||
|
||||
Take 1's, take 2's and take 3's caveats still apply. The take-4-specific ones:
|
||||
|
||||
- **Three tries per row, first try and repeat range both reported.** "First"
|
||||
is the request issued as the first real request of a dedicated session,
|
||||
after the scan settled; "repeats" is the 2nd–4th identical request in that
|
||||
same session. Where a row needed its own session (`codeAction`, `rename`,
|
||||
the tail rename, each fan-out cursor, each scope/cache cell, each widen
|
||||
cell) it got one — and where a phase is a once-per-session event (the scan,
|
||||
the widen, the `didOpen` delay, RSS) each try is a **fresh server process**.
|
||||
- **The comparison is binary-to-binary, on one night, with one client.**
|
||||
0.49.0 is the tree's own `target/release/lucisv-server` at `4c2dae3`,
|
||||
verified current against the last change under `crates/` — **no `cargo
|
||||
build` ran for it**. 0.43.0 was built for this round from the `v0.43.0` tag
|
||||
in a scratch `git worktree` under the scratchpad, and the worktree was
|
||||
removed before this document was finished. The main tree was never checked
|
||||
out, reset or stashed.
|
||||
- **Machine state, and it is the biggest caveat in this document.** Apple M1
|
||||
Max, 10 cores, 64 GB, macOS 27.0 (26A5425a). **This machine runs a live
|
||||
desktop session**, and throughout the round WindowServer sat at 45–51% of a
|
||||
core, loginwindow at 24–29%, with a wallpaper extension and two consumer
|
||||
apps at 8–11% each. **Load average was 3.7–7.1** for every phase; take 3
|
||||
measured at 2–4. Nothing unrelated to the desktop was burning CPU — no
|
||||
`rustc`, no build, no other agent — so the round proceeded rather than
|
||||
waiting, and the mitigation is structural: **both binaries were measured in
|
||||
the same window, alternating within the hour, with the same client.** Every
|
||||
comparison in §2–§7 is 0.49.0 against tonight's 0.43.0; take 3's column is
|
||||
context, never a conclusion. The load average was recorded before and after
|
||||
every phase.
|
||||
- **No `cargo` command ran in any tree while a timed measurement was
|
||||
running.** The one `cargo build` (the 0.43.0 worktree) finished 20 minutes
|
||||
before the first timed run.
|
||||
- **The guard.** Every server session, every `lucisv` invocation and the one
|
||||
`cargo build` went through `tools/guard.sh -m 8 -t 1800`. **No guard kill
|
||||
occurred**, and the largest resident set anything reached was 588 MB
|
||||
(`lucisv-server` after a warm workspace scan), 7% of the 8 GB limit; the
|
||||
largest a CLI run reached was 238 MB.
|
||||
- **The opentitan checkout was never written.**
|
||||
`git -C /Users/guoliangchen/repo/opentitan status --porcelain` was checked
|
||||
after every phase and reported the same three pre-existing modified files
|
||||
throughout: `hw/ip/aes/dv/tb/tb.sv`,
|
||||
`hw/top_darjeeling/ip/ast/rtl/ast.sv`, `hw/top_earlgrey/ip/ast/rtl/ast.sv`.
|
||||
`rename`, `codeAction/resolve` and the refactoring resolves all return
|
||||
edits; the client discarded every one. The formatter cache was directed to a
|
||||
scratch `--cache-dir` and the index cache to a scratch
|
||||
`initializationOptions.storagePath`; neither default lands inside the corpus,
|
||||
and both were overridden anyway.
|
||||
- **Tolerances.** Sub-millisecond rows: **±0.5 ms**, and nothing under that is
|
||||
read (§0 measured a 0.04→0.63 ms floor swing between two sessions of the
|
||||
same client). Rows of 1–20 ms: **±20%**. Rows of 20–500 ms: **±10%**.
|
||||
Multi-second rows: **±5%** (the six warm workspace scans span 118 ms across
|
||||
two binaries, 10%; the six cold ones span 72 ms, 2.7%). Take 3's tolerances
|
||||
were tighter on every band because its machine was quieter; a number here
|
||||
that differs from take 3's by less than these bands has not moved.
|
||||
- **Item and result counts are reported beside every timing** where the answer
|
||||
could have changed size, and every one of them is identical on the two
|
||||
binaries except the two the document names (`completion` after an instance
|
||||
head: 24 → 26 items; the tail rename: 1 → 2 files).
|
||||
- **The fan-out counts in §6a are `grep`-derived**
|
||||
(`grep -rlE '^\s*<module>( |#|$)'` over `*.sv`), reproducing take 2's and
|
||||
take 3's counts exactly (1 / 6 / 42 / 67 / 128).
|
||||
- **The offer sites in §6b/§6c were found, not chosen.** Every position was
|
||||
discovered by sweeping `codeAction` over candidate lines and keeping what
|
||||
actually offered; the two sites this document reports as *not* offering
|
||||
(§8.5) are the two candidates that failed, kept rather than dropped.
|
||||
- **`--select error,warning,style` is not "all rules"** — it is the three rule
|
||||
classes by name, which is what §58 asked for.
|
||||
- **Page cache is hot and hotter than ever** — opentitan has now been walked
|
||||
by four measurement rounds plus tonight's outcome sweeps. "Cold cache"
|
||||
means *lucisv's* store was deleted, not that the OS file cache was dropped.
|
||||
- **No code in the lucisv repo was modified for this round** except the
|
||||
creation of `tools/perf/`, this file,
|
||||
`docs/features/performance-take4/README.md`, the `docs/perf/README.md`
|
||||
entry and §58's ticks in `TODO.md`. No Rust source was touched.
|
||||
|
||||
---
|
||||
|
||||
## 10. Raw logs, and where the harness lives
|
||||
|
||||
**The harness is committed**: `tools/perf/` — `lspclient.py`, `sites.py`,
|
||||
`harness.py`, `bench.py`, `phases_new.py`, `sweep.sh`, `sweeptable.py`,
|
||||
`outcomes.sh`, `README.md`. Python 3 standard library only; runs from a clean
|
||||
checkout given an opentitan path and the binaries. `tools/perf/README.md` says
|
||||
how to run each phase. **Take 5 reuses it rather than reimplementing it from
|
||||
this document's prose.**
|
||||
|
||||
The Python was split after the measurements were taken (`bench.py` had reached
|
||||
537 production lines), so **every phase was re-run through the split files and
|
||||
ten rows re-checked against this document within §9's tolerances** — all
|
||||
inside. That verification run is in the raw logs as `verify.jsonl`, labelled
|
||||
`verify-0.49.0`; the feature README lists the ten rows and both readings.
|
||||
|
||||
The raw measurements are under
|
||||
`…/7b09ba01-…/scratchpad/`, and `results.jsonl` is additionally copied to
|
||||
`~/.cache/lucisv-perf/take4/results.jsonl` so it survives the scratchpad.
|
||||
|
||||
| File | What |
|
||||
|---|---|
|
||||
| `verify.jsonl` | the post-split re-run of every phase, label `verify-0.49.0` (§10 above) |
|
||||
| `results.jsonl` | every LSP row, machine-readable: `phase`, `label`, `row`, `ms` (try list), `n`, `titles`, `note`. **Every LSP number in this document is in this file.** Copy at `~/.cache/lucisv-perf/take4/` |
|
||||
| `logs/lsp-0.49.0.log`, `logs/lsp-0.43.0.log` | the phase transcripts, in order |
|
||||
| `logs/lsp-0.49.0-machine.txt`, `logs/lsp-0.43.0-machine.txt` | `uptime` and the top CPU processes, before and after the LSP phases |
|
||||
| `logs/sweep-machine.txt`, `logs/outcomes-load-{before,after}.txt` | the same for the CLI phases |
|
||||
| `sweep/<label>__<tree>__<command>__<cache>.txt` | §7 — the three tries' `/usr/bin/time -l` blocks per cell, 60 files |
|
||||
| `logs/sweeptable.txt` | §7's rendered table and the summary line each cell reported |
|
||||
| `outcomes/<label>.{format,check,check-select}.txt` | §7a — the per-file outcome listings for all three binaries; the diff in §7a is `diff outcomes/0.43.0.* outcomes/0.49.0.*` |
|
||||
| `logs/census-0.49.0.txt` | §6b — the 205-file, 2 440-position offer census |
|
||||
| `caches/` | the scratch `storagePath` stores and the scratch formatter `--cache-dir`; nothing here is inside the corpus |
|
||||
+92
-39
@@ -1,17 +1,17 @@
|
||||
# Repository analysis
|
||||
|
||||
Refreshed **2026-09-05**. Latest release: **v0.44.0** (`66f3898`). This
|
||||
review uses committed snapshot **`9ef1058`**, which also includes accepted
|
||||
type-name-spans and package-reexports work intended for v0.45.0. The active
|
||||
hierarchical-tail changes are described separately; their QA is still open.
|
||||
Refreshed **2026-09-07** against committed snapshot **`df4e714`**. Latest
|
||||
release: **v0.49.0** (`4c2dae3`). The working tree was clean at the start of
|
||||
this review. Loop 2 is closed; no uncommitted feature work is included.
|
||||
|
||||
## Assessment and current status
|
||||
|
||||
lucisv remains an eight-crate toolchain: six reusable Rust libraries, CLI and
|
||||
LSP binaries, editor integration, corpus/release tools, and a static docs site.
|
||||
The architecture still separates syntax, formatting, semantics, linting,
|
||||
refactoring, and project inputs. The three issues raised by the September 4
|
||||
audit have been fixed; they should no longer be treated as open priorities.
|
||||
refactoring, and project inputs. The September 4 audit findings are fixed.
|
||||
This refresh reproduced a new cache-key omission, documented below alongside
|
||||
the remaining refactor limits.
|
||||
|
||||
| Change | Status at this refresh | Implementation and contract |
|
||||
|---|---|---|
|
||||
@@ -22,9 +22,13 @@ audit have been fixed; they should no longer be treated as open priorities.
|
||||
| Cycle-aware walks and net-delay comment slots | Released in v0.43.0 | Directory identity prevents cycles; comments around a delay's `#` are preserved |
|
||||
| Walk warnings, editor rule-name warnings, aggregate overrides and delay-list comments | Released in v0.44.0 | Recoverable walk problems warn and continue; editor name typos log once; aggregate override expressions and delay-list comment slots are handled |
|
||||
| didOpen cost | Released in v0.44.0 | `undriven-net` asks the workspace mention oracle after local guards; findings and synchronous request ordering stay unchanged |
|
||||
| Type-name spans | Committed, accepted for v0.45.0 | `DataType::name_span()` / `segments()` and disable-target spans replace semantic name scanning; `scan.rs` is deleted |
|
||||
| Package re-exports | Committed, accepted for v0.45.0 | Export name halves are references; the shared member walk follows cycle-guarded re-export edges; persisted facts gain `RX`, codec **18** |
|
||||
| Hierarchical tails | **Working tree, QA pending** | Proposed codec **19**, tagged member/reference surfaces, instance-tail resolution and completion, and cross-file rename updates |
|
||||
| Type-name spans | Released in v0.45.0 | `DataType::name_span()` / `segments()` and disable-target spans replace semantic name scanning; `scan.rs` is deleted |
|
||||
| Package re-exports | Released in v0.45.0 | Export name halves are references; the shared member walk follows cycle-guarded re-export edges; persisted facts gain `RX`; current codec **19** |
|
||||
| Hierarchical tails | Released in v0.45.0 | Codec **19**, tagged member/reference surfaces, instance-tail resolution and completion, and cross-file rename updates |
|
||||
| Expand wildcard; convert ports to ANSI | Released in v0.46.0 | `.*` expands in declaration order with `.p()` and a warning for unmatched ports; legacy header/body declarations merge with comments and attributes preserved |
|
||||
| Organize imports; unused-import; extract module | Released in v0.47.0 | Shared semantic import usage feeds linter and refactor; **74 rules**; extraction infers ports/parameters/imports and creates a file when supported, or appends below the source module |
|
||||
| DUT hierarchy | Released in v0.48.0; packaging corrected in v0.48.2 | Client-only children/parents/other sections over the existing snapshot; saved workspace choices plus configured DUTs |
|
||||
| Inline module; final coverage additions | Released in v0.49.0 | Separate-file body copy with connection substitution and collision-aware renaming; six grammar gaps closed; real `randsequence` nodes; optional UVM indentation, default off |
|
||||
|
||||
The current source of truth for feature acceptance is each feature's QA/review
|
||||
log and [TODO.md](../TODO.md). The [topology](topo.md) records the interfaces
|
||||
@@ -37,20 +41,21 @@ two edits have disjoint ownership.
|
||||
|---|---|
|
||||
| `crates/vlog_parser` | Lexer/trivia, strict and tolerant recursive descent, AST/spans; `src/lib.rs`, `parser/`, `ast/` |
|
||||
| `crates/vlog_formatter` | AST → document IR → printer, alignment, fences/ranges, equivalence and convergence; `format/mod.rs`, `verify.rs` |
|
||||
| `crates/vlog_semantic` | File binding/resolution, workspace facts and member lookup; `bind/`, `resolve.rs`, `workspace/`, `facts.rs`; committed `workspace/reexport.rs`, active `workspace/hierarchy.rs` |
|
||||
| `crates/vlog_linter` | 73-rule registry, lazy semantics, options, severities, inline/external waivers and fixes; `lib.rs`, `context.rs`, `registry.rs`, `waiver_file.rs` |
|
||||
| `crates/vlog_refactor` | Rename/references, port edits, instance plans; shared `scope.rs`, whole-edit verification in `check.rs` |
|
||||
| `crates/vlog_semantic` | File binding/resolution, workspace facts and member lookup; `bind/`, `resolve.rs`, `workspace/`, `facts.rs`; `workspace/reexport.rs`, `workspace/hierarchy.rs`, shared import usage in `imports.rs` |
|
||||
| `crates/vlog_linter` | 74-rule registry, lazy semantics, options, severities, inline/external waivers and fixes; `lib.rs`, `context.rs`, `registry.rs`, `waiver_file.rs` |
|
||||
| `crates/vlog_refactor` | Rename/references, ports, imports, extract/inline module, instance plans; `scope.rs`, `ports/`, `imports.rs`, `extract/`, `inline/`, whole-edit verification and piece ledger in `check/` |
|
||||
| `crates/lucisv_core` | Config, filelists, cycle-aware walks and warning channel, format cache, atomic replacement; no language-engine dependency |
|
||||
| `crates/lucisv` | Argument handling, input discovery/dedup, worker pool, reports and source writes |
|
||||
| `crates/lucisv_server` | Ordered LSP loop and workspace overlays; `server/`, `state.rs`, capability handlers; project lint validation/logging in `lint/project.rs` |
|
||||
| `editors/` | VS Code client/grammar/settings/hierarchy UI and configuration for other editors |
|
||||
| `crates/lucisv_server` | Ordered LSP loop and workspace overlays; `server/`, `state.rs`, capability handlers including `imports.rs`, `extract.rs`, `inline_module.rs`; project lint validation/logging in `lint/project.rs` |
|
||||
| `editors/` | VS Code client/grammar/settings/hierarchy UI and other editor configuration; `hierarchySections.js` models DUT sections, `extract.js` supplies the module-name prompt |
|
||||
| `tools/`, `scripts/`, `.gitea/workflows/` | Resource guard, corpus evaluation, artifact checks and releases |
|
||||
| `docs/features/` | Implementation contracts, dated measurements, QA and acceptance records |
|
||||
| `docs/site/` | User-facing static documentation and tracked generated output |
|
||||
|
||||
The crate dependency graph is unchanged. Parser and core have no dependencies;
|
||||
formatter and semantics each depend on parser; linter and refactor depend on
|
||||
parser and semantics. The linter depends on the formatter only in tests.
|
||||
Parser and core have no dependencies; formatter and semantics each depend on
|
||||
parser; linter and refactor depend on parser and semantics. Linter also consumes
|
||||
core’s path matcher for external waivers. Both linter and refactor depend on
|
||||
the formatter **only in tests**.
|
||||
The CLI composes core/parser/formatter/linter; the server composes all six
|
||||
libraries. External Rust dependencies stay in the CLI worker pool and server
|
||||
LSP/JSON stack.
|
||||
@@ -77,24 +82,70 @@ can come from the index; members and open buffers use text-based positions.
|
||||
Refactor source selectors must include every file an engine might edit or
|
||||
refuse over, even when completion or navigation can answer from fewer files.
|
||||
|
||||
**New committed semantic contracts:** a type-name segment is derived from AST
|
||||
**Semantic contracts:** a type-name segment is derived from AST
|
||||
span data and verified against the source by `Binder::exact_or_empty`. The
|
||||
source parameter to analysis remains necessary even though `scan.rs` is gone.
|
||||
A package re-export records reference edges without adding a local import.
|
||||
`export *::*` expands the package's imports into re-export facts; member lookup
|
||||
follows those edges with cycle guards. Cache codec 18 prevents older stores
|
||||
follows those edges with cycle guards. Cache codec 19 prevents older stores
|
||||
from silently omitting this information.
|
||||
|
||||
## Active work and remaining limits
|
||||
The delivered hierarchical-tail contract uses `Surface::{Connection,
|
||||
Hierarchical}`, a second member table, surface tags on persisted declarations
|
||||
and references, and codec 19. Connection completion and port propagation retain
|
||||
the ports/parameters view; instance tails additionally reach internal nets,
|
||||
variables and nested instances. Topology handshake 23 is closed.
|
||||
|
||||
TODO §49 owns hierarchical-tail resolution. At this refresh, its working tree
|
||||
adds `Surface::{Connection, Hierarchical}`, a second member table, surface tags
|
||||
on persisted declarations/references, and codec 19. Connection completion and
|
||||
port propagation retain the existing ports/parameters view; paths behind an
|
||||
instance can additionally reach internal nets, variables and nested instances.
|
||||
Member completion and rename fan-out are part of the same contract. The feature
|
||||
README reports development checks; independent QA is still pending, so topology
|
||||
handshake 23 remains open. No working-tree API is treated as released here.
|
||||
`vlog_semantic::imports` supplies the shared usage judgement for organize-imports
|
||||
and the Style, default-off `unused-import` rule. Package re-exports count as use;
|
||||
unknown packages, macro/conditional uses and external inheritance are treated
|
||||
conservatively. Refactor `check/ledger.rs` tracks comment/attribute text,
|
||||
counts and positions for moves and copies, separately from formatter
|
||||
normalization. `RefactorEdit::created` lists new paths whose initial contents
|
||||
also appear as offset-zero insertions in `edits`; server resource operations
|
||||
honor client file-creation support. Inline copies leave their source file
|
||||
unchanged.
|
||||
|
||||
## Remaining limits and open work
|
||||
|
||||
**Cache omission (topology handshake 34, fixed in 0.50.0).** The CLI applies the new
|
||||
`Config::uvm_utils_indent` field, but `lucisv/src/main.rs::entry_for` and
|
||||
`lucisv_core::cache::Entry` omit it from cache equality and serialization.
|
||||
A private-cache probe using the archived CLI and this class reproduced:
|
||||
|
||||
```systemverilog
|
||||
class c extends uvm_object;
|
||||
`uvm_object_utils_begin(c)
|
||||
`uvm_field_int(a, UVM_DEFAULT)
|
||||
`uvm_object_utils_end
|
||||
endclass
|
||||
```
|
||||
|
||||
1. `[format] uvm-utils-indent = false`, `--check`: exit **0**, unchanged.
|
||||
2. Change only the option to `true`, `--check`: exit **0**, one cache hit.
|
||||
3. Same config, `--no-cache --check`: exit **1**, would reformat.
|
||||
|
||||
**Fixed 2026-09-07 (TODO §59, ships in 0.50.0):** the option is in the key
|
||||
and in the store line, a 0.49.0 store is rebuilt rather than trusted, and the
|
||||
probe above is a CLI regression test in both toggle directions
|
||||
(`changing_uvm_utils_indent_invalidates_the_entry`). The paragraph is kept as
|
||||
the record of the finding.
|
||||
|
||||
**Refactor limits:** inline-module requires a separate-file source module and
|
||||
simple named connections. It refuses wildcards, positional/expression or
|
||||
unconnected ports, unsupported port types, generate, initial/final,
|
||||
macros/directives, and hierarchical uses found in its inputs. QA recorded a
|
||||
source-selection gap: `module_sources` can omit a file reaching the instance
|
||||
through an intermediate module, bypassing the hierarchical-use refusal
|
||||
(**handshake 33**). The verifier also has a bounded testability gap for
|
||||
same-file relocation of protected pieces (**32**); no current planner produces
|
||||
that edit shape. See the [extract/inline QA record](features/extract-inline-module/README.md).
|
||||
|
||||
TODO **§55** defers `state.rs` decomposition to Loop 3. The September 7
|
||||
measurement in `CLAUDE.md` reports 958 production lines there, `perf.rs` 900
|
||||
with a recorded reason, `lexer.rs` 763, and `format/stmt.rs` 604. TODO §57
|
||||
still has remote-artifact and memory bookkeeping unchecked; this review does
|
||||
not certify remote releases or manual editor acceptance.
|
||||
|
||||
Remaining constraints include generate-block-scoped hierarchical paths,
|
||||
cross-file macro expansion, and compiler elaboration. Package re-export support
|
||||
@@ -128,23 +179,25 @@ is part of this refresh.
|
||||
|
||||
## Validation of this refresh
|
||||
|
||||
Checks ran against an isolated archive of committed `9ef1058`, with a separate
|
||||
build directory and the repository resource guard. This avoids the live agents'
|
||||
target directory and does not certify their uncommitted changes.
|
||||
Checks ran against an isolated archive of committed `df4e714`, with a separate
|
||||
build directory and the repository resource guard. This validates a fixed
|
||||
source snapshot without sharing another task’s build directory.
|
||||
|
||||
- `cargo fmt --all -- --check`: passed.
|
||||
- `cargo clippy --offline --workspace --all-targets -- -D warnings`: passed.
|
||||
- `cargo test --offline --workspace`: **3,829 passed, 0 failed, 44 ignored**,
|
||||
across 49 harnesses, under `tools/guard.sh`. The archive did not include the
|
||||
- `cargo test --offline --workspace`: **4,163 passed, 0 failed, 44 ignored**,
|
||||
across 55 harnesses, under `tools/guard.sh`. The archive did not include the
|
||||
ignored/untracked corpus checkout, and ignored measurement tests were not run.
|
||||
- `node --test editors/vscode/*_test.js`: **5 test files passed** (extract
|
||||
input, hierarchy model/sections/view, restart behavior). The cache probe
|
||||
above also ran under the resource guard.
|
||||
- `ASTRO_TELEMETRY_DISABLED=1 npm run build` in `docs/site`: passed;
|
||||
13 pages, Pagefind search and sitemaps rebuilt.
|
||||
- Generated-site validation: **820** local links, assets and anchors checked,
|
||||
zero errors. Relative links in the root analysis/topology/coverage docs also
|
||||
passed. `git diff --check` passed for these documentation changes.
|
||||
- Generated-site validation: **836** local links, assets and anchors checked,
|
||||
zero errors. All **26** relative file links in README, analysis, topology and
|
||||
coverage docs also passed. `git diff --check` passed for these documentation changes.
|
||||
|
||||
The previous audit's 3,745 passing tests describe its September 4 snapshot;
|
||||
they are not reused as the test result for this revision. This refresh changes
|
||||
documentation only and leaves feature QA logs and backlog checkboxes to their
|
||||
Earlier test totals describe earlier snapshots; the results above were
|
||||
measured again for this revision. This refresh changes documentation only and leaves feature QA logs and backlog checkboxes to their
|
||||
owners. No corpus/OpenTitan sweep, new benchmark, release packaging or
|
||||
publishing was performed.
|
||||
+12
-2
@@ -70,7 +70,7 @@
|
||||
})();
|
||||
</script></sl-sidebar-state-persist><div class="md:sl-hidden"><div class="mobile-preferences sl-flex astro-b5gddk54"><div class="social-icons astro-b5gddk54"><a href="https://git.luci.ooo/lucio/verilogrustformatter" rel="me" class="sl-flex astro-cg55etiy"><span class="sr-only astro-cg55etiy">Source repository</span><svg aria-hidden="true" class="astro-cg55etiy astro-n5k4ipy7" width="16" height="16" viewBox="0 0 24 24" fill="currentColor" style="--sl-icon-size: 1em;"><path d="M12 .3a12 12 0 0 0-3.8 23.38c.6.12.83-.26.83-.57L9 21.07c-3.34.72-4.04-1.61-4.04-1.61-.55-1.39-1.34-1.76-1.34-1.76-1.08-.74.09-.73.09-.73 1.2.09 1.83 1.24 1.83 1.24 1.08 1.83 2.81 1.3 3.5 1 .1-.78.42-1.31.76-1.61-2.67-.3-5.47-1.33-5.47-5.93 0-1.31.47-2.38 1.24-3.22-.14-.3-.54-1.52.1-3.18 0 0 1-.32 3.3 1.23a11.5 11.5 0 0 1 6 0c2.28-1.55 3.29-1.23 3.29-1.23.64 1.66.24 2.88.12 3.18a4.65 4.65 0 0 1 1.23 3.22c0 4.61-2.8 5.63-5.48 5.92.42.36.81 1.1.81 2.22l-.01 3.29c0 .31.2.69.82.57A12 12 0 0 0 12 .3Z"/></svg></a></div><starlight-theme-select><label style="--sl-select-width: 6.25em" class="astro-r2p65idu"><span class="sr-only astro-r2p65idu">Select theme</span><svg aria-hidden="true" class="icon label-icon astro-r2p65idu astro-n5k4ipy7" width="16" height="16" viewBox="0 0 24 24" fill="currentColor" style="--sl-icon-size: 1em;"><path d="M21 14h-1V7a3 3 0 0 0-3-3H7a3 3 0 0 0-3 3v7H3a1 1 0 0 0-1 1v2a3 3 0 0 0 3 3h14a3 3 0 0 0 3-3v-2a1 1 0 0 0-1-1ZM6 7a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v7H6V7Zm14 10a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1v-1h16v1Z"/></svg><select autocomplete="off" class="astro-r2p65idu"><option value="dark" class="astro-r2p65idu">Dark</option><option value="light" class="astro-r2p65idu">Light</option><option value="auto" selected class="astro-r2p65idu">Auto</option></select><svg aria-hidden="true" class="icon caret astro-r2p65idu astro-n5k4ipy7" width="16" height="16" viewBox="0 0 24 24" fill="currentColor" style="--sl-icon-size: 1em;"><path d="M17 9.17a1 1 0 0 0-1.41 0L12 12.71 8.46 9.17a1 1 0 1 0-1.41 1.42l4.24 4.24a1.002 1.002 0 0 0 1.42 0L17 10.59a1.002 1.002 0 0 0 0-1.42Z"/></svg></label></starlight-theme-select><script>
|
||||
StarlightThemeProvider.updatePickers();
|
||||
</script></div></div></div></div></nav><div class="main-frame astro-gqpr5s5a"><script type="module">var e=document.getElementById(`starlight__sidebar`),t=e?.querySelector(`sl-sidebar-state-persist`),n=`sl-sidebar-state`,r=()=>{let r=[],i=t?.dataset.hash||``;try{let e=sessionStorage.getItem(n),t=JSON.parse(e||`{}`);Array.isArray(t.open)&&t.hash===i&&(r=t.open)}catch{}return{hash:i,open:r,scroll:e?.scrollTop||0}},i=e=>{try{sessionStorage.setItem(n,JSON.stringify(e))}catch{}},a=()=>i(r()),o=(e,t)=>{let n=r();n.open[t]=e,i(n)};t?.addEventListener(`click`,e=>{if(!(e.target instanceof Element))return;let t=e.target.closest(`summary`)?.closest(`details`);if(!t)return;let n=t.querySelector(`sl-sidebar-restore`),r=parseInt(n?.dataset.index||``);isNaN(r)||o(!t.open,r)}),addEventListener(`visibilitychange`,()=>{document.visibilityState===`hidden`&&a()});</script><div class="lg:sl-flex astro-abfeecmu"><aside class="right-sidebar-container print:hidden astro-abfeecmu"><div class="right-sidebar astro-abfeecmu"><div class="lg:sl-hidden astro-q5mffni3"><mobile-starlight-toc data-min-h="2" data-max-h="3" class="astro-5ulgm6bh"><nav aria-labelledby="starlight__on-this-page--mobile" class="astro-5ulgm6bh"><details id="starlight__mobile-toc" class="astro-5ulgm6bh"><summary id="starlight__on-this-page--mobile" class="sl-flex astro-5ulgm6bh"><span class="toggle sl-flex astro-5ulgm6bh">On this page<svg aria-hidden="true" class="caret astro-5ulgm6bh astro-n5k4ipy7" width="16" height="16" viewBox="0 0 24 24" fill="currentColor" style="--sl-icon-size: 1rem;"><path d="m14.83 11.29-4.24-4.24a1 1 0 1 0-1.42 1.41L12.71 12l-3.54 3.54a1 1 0 0 0 0 1.41 1 1 0 0 0 .71.29 1 1 0 0 0 .71-.29l4.24-4.24a1.002 1.002 0 0 0 0-1.42Z"/></svg></span><span class="display-current astro-5ulgm6bh"></span></summary><div class="dropdown astro-5ulgm6bh"><ul class="isMobile astro-cxyftcne" style="--depth: 0;"><li style="--depth: 0;" class="astro-cxyftcne"><a href="#_top" style="--depth: 0;" class="astro-cxyftcne"><span style="--depth: 0;" class="astro-cxyftcne">Overview</span></a></li><li style="--depth: 0;" class="astro-cxyftcne"><a href="#core-style" style="--depth: 0;" class="astro-cxyftcne"><span style="--depth: 0;" class="astro-cxyftcne">Core style</span></a></li><li style="--depth: 0;" class="astro-cxyftcne"><a href="#alignment-is-inferred" style="--depth: 0;" class="astro-cxyftcne"><span style="--depth: 0;" class="astro-cxyftcne">Alignment is inferred</span></a></li><li style="--depth: 0;" class="astro-cxyftcne"><a href="#format-fences" style="--depth: 0;" class="astro-cxyftcne"><span style="--depth: 0;" class="astro-cxyftcne">Format fences</span></a></li><li style="--depth: 0;" class="astro-cxyftcne"><a href="#range-formatting" style="--depth: 0;" class="astro-cxyftcne"><span style="--depth: 0;" class="astro-cxyftcne">Range formatting</span></a></li><li style="--depth: 0;" class="astro-cxyftcne"><a href="#safety-invariants" style="--depth: 0;" class="astro-cxyftcne"><span style="--depth: 0;" class="astro-cxyftcne">Safety invariants</span></a></li></ul></div></details></nav></mobile-starlight-toc><script type="module" src="/_astro/MobileTableOfContents.astro_astro_type_script_index_0_lang.BcSo_yiZ.js"></script></div><div class="right-sidebar-panel sl-hidden lg:sl-block astro-q5mffni3"><div class="sl-container astro-q5mffni3"><starlight-toc data-min-h="2" data-max-h="3"><nav aria-labelledby="starlight__on-this-page"><h2 id="starlight__on-this-page">On this page</h2><ul class="astro-cxyftcne" style="--depth: 0;"><li style="--depth: 0;" class="astro-cxyftcne"><a href="#_top" style="--depth: 0;" class="astro-cxyftcne"><span style="--depth: 0;" class="astro-cxyftcne">Overview</span></a></li><li style="--depth: 0;" class="astro-cxyftcne"><a href="#core-style" style="--depth: 0;" class="astro-cxyftcne"><span style="--depth: 0;" class="astro-cxyftcne">Core style</span></a></li><li style="--depth: 0;" class="astro-cxyftcne"><a href="#alignment-is-inferred" style="--depth: 0;" class="astro-cxyftcne"><span style="--depth: 0;" class="astro-cxyftcne">Alignment is inferred</span></a></li><li style="--depth: 0;" class="astro-cxyftcne"><a href="#format-fences" style="--depth: 0;" class="astro-cxyftcne"><span style="--depth: 0;" class="astro-cxyftcne">Format fences</span></a></li><li style="--depth: 0;" class="astro-cxyftcne"><a href="#range-formatting" style="--depth: 0;" class="astro-cxyftcne"><span style="--depth: 0;" class="astro-cxyftcne">Range formatting</span></a></li><li style="--depth: 0;" class="astro-cxyftcne"><a href="#safety-invariants" style="--depth: 0;" class="astro-cxyftcne"><span style="--depth: 0;" class="astro-cxyftcne">Safety invariants</span></a></li></ul></nav></starlight-toc><script type="module" src="/_astro/TableOfContents.astro_astro_type_script_index_0_lang.Csloo1VZ.js"></script></div></div></div></aside><div class="main-pane astro-abfeecmu"><main data-pagefind-body class="astro-vdxcvpsm" lang="en" dir="ltr"><div class="content-panel astro-oLine truncated
|
||||
</script></div></div></div></div></nav><div class="main-frame astro-gqpr5s5a"><script type="module">var e=document.getElementById(`starlight__sidebar`),t=e?.querySelector(`sl-sidebar-state-persist`),n=`sl-sidebar-state`,r=()=>{let r=[],i=t?.dataset.hash||``;try{let e=sessionStorage.getItem(n),t=JSON.parse(e||`{}`);Array.isArray(t.open)&&t.hash===i&&(r=t.open)}catch{}return{hash:i,open:r,scroll:e?.scrollTop||0}},i=e=>{try{sessionStorage.setItem(n,JSON.stringify(e))}catch{}},a=()=>i(r()),o=(e,t)=>{let n=r();n.open[t]=e,i(n)};t?.addEventListener(`click`,e=>{if(!(e.target instanceof Element))return;let t=e.target.closest(`summary`)?.closest(`details`);if(!t)return;let n=t.querySelector(`sl-sidebar-restore`),r=parseInt(n?.dataset.index||``);isNaN(r)||o(!t.open,r)}),addEventListener(`visibilitychange`,()=>{document.visibilityState===`hidden`&&a()});</script><div class="lg:sl-flex astro-abfeecmu"><aside class="right-sidebar-container print:hidden astro-abfeecmu"><div class="right-sidebar astro-abfeecmu"><div class="lg:sl-hidden astro-q5mffni3"><mobile-starlight-toc data-min-h="2" data-max-h="3" class="astro-5ulgm6bh"><nav aria-labelledby="starlight__on-this-page--mobile" class="astro-5ulgm6bh"><details id="starlight__mobile-toc" class="astro-5ulgm6bh"><summary id="starlight__on-this-page--mobile" class="sl-flex astro-5ulgm6bh"><span class="toggle sl-flex astro-5ulgm6bh">On this page<svg aria-hidden="true" class="caret astro-5ulgm6bh astro-n5k4ipy7" width="16" height="16" viewBox="0 0 24 24" fill="currentColor" style="--sl-icon-size: 1rem;"><path d="m14.83 11.29-4.24-4.24a1 1 0 1 0-1.42 1.41L12.71 12l-3.54 3.54a1 1 0 0 0 0 1.41 1 1 0 0 0 .71.29 1 1 0 0 0 .71-.29l4.24-4.24a1.002 1.002 0 0 0 0-1.42Z"/></svg></span><span class="display-current astro-5ulgm6bh"></span></summary><div class="dropdown astro-5ulgm6bh"><ul class="isMobile astro-cxyftcne" style="--depth: 0;"><li style="--depth: 0;" class="astro-cxyftcne"><a href="#_top" style="--depth: 0;" class="astro-cxyftcne"><span style="--depth: 0;" class="astro-cxyftcne">Overview</span></a></li><li style="--depth: 0;" class="astro-cxyftcne"><a href="#core-style" style="--depth: 0;" class="astro-cxyftcne"><span style="--depth: 0;" class="astro-cxyftcne">Core style</span></a></li><li style="--depth: 0;" class="astro-cxyftcne"><a href="#uvm-utilities-indentation" style="--depth: 0;" class="astro-cxyftcne"><span style="--depth: 0;" class="astro-cxyftcne">UVM utilities indentation</span></a></li><li style="--depth: 0;" class="astro-cxyftcne"><a href="#alignment-is-inferred" style="--depth: 0;" class="astro-cxyftcne"><span style="--depth: 0;" class="astro-cxyftcne">Alignment is inferred</span></a></li><li style="--depth: 0;" class="astro-cxyftcne"><a href="#format-fences" style="--depth: 0;" class="astro-cxyftcne"><span style="--depth: 0;" class="astro-cxyftcne">Format fences</span></a></li><li style="--depth: 0;" class="astro-cxyftcne"><a href="#range-formatting" style="--depth: 0;" class="astro-cxyftcne"><span style="--depth: 0;" class="astro-cxyftcne">Range formatting</span></a></li><li style="--depth: 0;" class="astro-cxyftcne"><a href="#safety-invariants" style="--depth: 0;" class="astro-cxyftcne"><span style="--depth: 0;" class="astro-cxyftcne">Safety invariants</span></a></li></ul></div></details></nav></mobile-starlight-toc><script type="module" src="/_astro/MobileTableOfContents.astro_astro_type_script_index_0_lang.BcSo_yiZ.js"></script></div><div class="right-sidebar-panel sl-hidden lg:sl-block astro-q5mffni3"><div class="sl-container astro-q5mffni3"><starlight-toc data-min-h="2" data-max-h="3"><nav aria-labelledby="starlight__on-this-page"><h2 id="starlight__on-this-page">On this page</h2><ul class="astro-cxyftcne" style="--depth: 0;"><li style="--depth: 0;" class="astro-cxyftcne"><a href="#_top" style="--depth: 0;" class="astro-cxyftcne"><span style="--depth: 0;" class="astro-cxyftcne">Overview</span></a></li><li style="--depth: 0;" class="astro-cxyftcne"><a href="#core-style" style="--depth: 0;" class="astro-cxyftcne"><span style="--depth: 0;" class="astro-cxyftcne">Core style</span></a></li><li style="--depth: 0;" class="astro-cxyftcne"><a href="#uvm-utilities-indentation" style="--depth: 0;" class="astro-cxyftcne"><span style="--depth: 0;" class="astro-cxyftcne">UVM utilities indentation</span></a></li><li style="--depth: 0;" class="astro-cxyftcne"><a href="#alignment-is-inferred" style="--depth: 0;" class="astro-cxyftcne"><span style="--depth: 0;" class="astro-cxyftcne">Alignment is inferred</span></a></li><li style="--depth: 0;" class="astro-cxyftcne"><a href="#format-fences" style="--depth: 0;" class="astro-cxyftcne"><span style="--depth: 0;" class="astro-cxyftcne">Format fences</span></a></li><li style="--depth: 0;" class="astro-cxyftcne"><a href="#range-formatting" style="--depth: 0;" class="astro-cxyftcne"><span style="--depth: 0;" class="astro-cxyftcne">Range formatting</span></a></li><li style="--depth: 0;" class="astro-cxyftcne"><a href="#safety-invarLine truncated
|
||||
<div class="sl-heading-wrapper level-h2"><h2 id="core-style">Core style</h2><a class="sl-anchor-link" href="#core-style"><span aria-hidden="true" class="sl-anchor-icon"><svg width="16" height="16" viewBox="0 0 24 24" fill="currentColor"><path d="m12.11 15.39-3.88 3.88a2.52 2.52 0 0 1-3.5 0 2.47 2.47 0 0 1 0-3.5l3.88-3.88a1 1 0 1 0-1.42-1.42l-3.88 3.89a4.48 4.48 0 0 0 6.33 6.33l3.89-3.88a1 1 0 0 0-1.42-1.42m8.58-12.08a4.49 4.49 0 0 0-6.33 0l-3.89 3.88a1 1 0 1 0 1.42 1.42l3.88-3.88a2.52 2.52 0 0 1 3.5 0 2.47 2.47 0 0 1 0 3.5l-3.88 3.88a1 1 0 0 0 0 1.42 1 1 0 0 0 1.42 0l3.88-3.89a4.49 4.49 0 0 0 0-6.33M8.83 15.17a1 1 0 0 0 .71.29 1 1 0 0 0 .71-.29l4.92-4.92a1 1 0 1 0-1.42-1.42l-4.92 4.92a1 1 0 0 0 0 1.42"></path></svg></span><span class="sr-only" data-pagefind-ignore>Section titled “Core style”</span></a></div>
|
||||
<ul>
|
||||
<li>2-space indentation and 100-column lines by default.</li>
|
||||
@@ -80,12 +80,22 @@
|
||||
<li>At most one preserved blank line between adjacent items.</li>
|
||||
<li>Compiler directives, attributes, and supported verbatim constructs keep their source text.</li>
|
||||
</ul>
|
||||
<div class="sl-heading-wrapper level-h2"><h2 id="uvm-utilities-indentation">UVM utilities indentation</h2><a class="sl-anchor-link" href="#uvm-utilities-indentation"><span aria-hidden="true" class="sl-anchor-icon"><svg width="16" height="16" viewBox="0 0 24 24" fill="currentColor"><path d="m12.11 15.39-3.88 3.88a2.52 2.52 0 0 1-3.5 0 2.47 2.47 0 0 1 0-3.5l3.88-3.88a1 1 0 1 0-1.42-1.42l-3.88 3.89a4.48 4.48 0 0 0 6.33 6.33l3.89-3.88a1 1 0 0 0-1.42-1.42m8.58-12.08a4.49 4.49 0 0 0-6.33 0l-3.89 3.88a1 1 0 1 0 1.42 1.42l3.88-3.88a2.52 2.52 0 0 1 3.5 0 2.47 2.47 0 0 1 0 3.5l-3.88 3.88a1 1 0 0 0 0 1.42 1 1 0 0 0 1.42 0l3.88-3.89a4.49 4.49 0 0 0 0-6.33M8.83 15.17a1 1 0 0 0 .71.29 1 1 0 0 0 .71-.29l4.92-4.92a1 1 0 1 0-1.42-1.42l-4.92 4.92a1 1 0 0 0 0 1.42"></path></svg></span><span class="sr-only" data-pagefind-ignore>Section titled “UVM utilities indentation”</span></a></div>
|
||||
<p>To indent field macros inside UVM utilities blocks one additional level:</p>
|
||||
<div class="expressive-code"><link rel="stylesheet" href="/_astro/ec.w36nc.css"><script type="module" src="/_astro/ec.0vx5m.js"></script><figure class="frame not-content"><figcaption class="header"></figcaption><pre data-language="toml"><code><div class="ec-line"><div class="code"><span style="--0:#D6DEEB;--1:#403F53">[format]</span></div></div><div class="ec-line"><div class="code"><span style="--0:#C5E478;--1:#3B61B0">uvm-utils-indent</span><span style="--0:#D6DEEB;--1:#403F53"> = </span><span style="--0:#FF6A83;--1:#A24848">true</span></div></div></code></pre><div class="copy"><div aria-live="polite"></div><button title="Copy to clipboard" data-copied="Copied!" data-code="[format]uvm-utils-indent = true"><div></div></button></div></figure></div>
|
||||
<p>This v0.49.0 option is off by default. It applies to <code dir="auto">uvm_field_*</code> macros
|
||||
between <code dir="auto">uvm_*_utils_begin</code> and <code dir="auto">uvm_*_utils_end</code>. In editors,
|
||||
<code dir="auto">lucisv.format.uvmUtilsIndent</code> is the fallback; project configuration wins.
|
||||
Short, comment-free enum bodies already fit on one line without another key.</p>
|
||||
<p>After toggling this option, run the CLI with <code dir="auto">--no-cache</code> or remove its format
|
||||
cache: v0.49.0 does not include this option in the cache key. See
|
||||
<a href="/start/configuration/#cache">configuration</a>.</p>
|
||||
<div class="sl-heading-wrapper level-h2"><h2 id="alignment-is-inferred">Alignment is inferred</h2><a class="sl-anchor-link" href="#alignment-is-inferred"><span aria-hidden="true" class="sl-anchor-icon"><svg width="16" height="16" viewBox="0 0 24 24" fill="currentColor"><path d="m12.11 15.39-3.88 3.88a2.52 2.52 0 0 1-3.5 0 2.47 2.47 0 0 1 0-3.5l3.88-3.88a1 1 0 1 0-1.42-1.42l-3.88 3.89a4.48 4.48 0 0 0 6.33 6.33l3.89-3.88a1 1 0 0 0-1.42-1.42m8.58-12.08a4.49 4.49 0 0 0-6.33 0l-3.89 3.88a1 1 0 1 0 1.42 1.42l3.88-3.88a2.52 2.52 0 0 1 3.5 0 2.47 2.47 0 0 1 0 3.5l-3.88 3.88a1 1 0 0 0 0 1.42 1 1 0 0 0 1.42 0l3.88-3.89a4.49 4.49 0 0 0 0-6.33M8.83 15.17a1 1 0 0 0 .71.29 1 1 0 0 0 .71-.29l4.92-4.92a1 1 0 1 0-1.42-1.42l-4.92 4.92a1 1 0 0 0 0 1.42"></path></svg></span><span class="sr-only" data-pagefind-ignore>Section titled “Alignment is inferred”</span></a></div>
|
||||
<p>lucisv recognizes existing columnar intent in adjacent ANSI ports, named connections, and parameter declarations. If a group is already aligned—or uses four or more spaces where one would suffice—it is normalized as a table. Flush-left input stays flush-left.</p>
|
||||
<p>Groups end at blank lines, standalone comments, attributes, or compiler directives. If the widest row exceeds the line limit, the entire group falls back to flush-left, never a half-aligned mixture.</p>
|
||||
<div class="sl-heading-wrapper level-h2"><h2 id="format-fences">Format fences</h2><a class="sl-anchor-link" href="#format-fences"><span aria-hidden="true" class="sl-anchor-icon"><svg width="16" height="16" viewBox="0 0 24 24" fill="currentColor"><path d="m12.11 15.39-3.88 3.88a2.52 2.52 0 0 1-3.5 0 2.47 2.47 0 0 1 0-3.5l3.88-3.88a1 1 0 1 0-1.42-1.42l-3.88 3.89a4.48 4.48 0 0 0 6.33 6.33l3.89-3.88a1 1 0 0 0-1.42-1.42m8.58-12.08a4.49 4.49 0 0 0-6.33 0l-3.89 3.88a1 1 0 1 0 1.42 1.42l3.88-3.88a2.52 2.52 0 0 1 3.5 0 2.47 2.47 0 0 1 0 3.5l-3.88 3.88a1 1 0 0 0 0 1.42 1 1 0 0 0 1.42 0l3.88-3.89a4.49 4.49 0 0 0 0-6.33M8.83 15.17a1 1 0 0 0 .71.29 1 1 0 0 0 .71-.29l4.92-4.92a1 1 0 1 0-1.42-1.42l-4.92 4.92a1 1 0 0 0 0 1.42"></path></svg></span><span class="sr-only" data-pagefind-ignore>Section titled “Format fences”</span></a></div>
|
||||
<p>Use a standalone fence to protect hand-laid-out regions:</p>
|
||||
<div class="expressive-code"><link rel="stylesheet" href="/_astro/ec.w36nc.css"><script type="module" src="/_astro/ec.0vx5m.js"></script><figure class="frame not-content"><figcaption class="header"></figcaption><pre data-language="system-verilog"><code><div class="ec-line"><div class="code"><span style="--0:#919F9F;--1:#5D6376">// verilog_format: off</span></div></div><div class="ec-line"><div class="code"><span style="--0:#C792EA;--1:#8844AE">localparam int</span><span style="--0:#D6DEEB;--1:#403F53"> </span><span style="--0:#82AAFF;--1:#3B61B0">A</span><span style="--0:#D6DEEB;--1:#403F53"> </span><span style="--0:#C792EA;--1:#8844AE">=</span><span style="--0:#D6DEEB;--1:#403F53"> </span><span style="--0:#F78C6C;--1:#AA0982">1</span><span style="--0:#D6DEEB;--1:#403F53">;</span></div></div><div class="ec-line"><div class="code"><span style="--0:#C792EA;--1:#8844AE">localparam int</span><span style="--0:#D6DEEB;--1:#403F53"> </span><span style="--0:#82AAFF;--1:#3B61B0">LONGER</span><span style="--0:#D6DEEB;--1:#403F53"> </span><span style="--0:#C792EA;--1:#8844AE">=</span><span style="--0:#D6DEEB;--1:#403F53"> </span><span style="--0:#F78C6C;--1:#AA0982">22</span><span style="--0:#D6DEEB;--1:#403F53">;</span></div></div><div class="ec-line"><div class="code"><span style="--0:#919F9F;--1:#5D6376">// verilog_format: on</span></div></div></code></pre><div class="copy"><div aria-live="polite"></div><button title="Copy to clipboard" data-copied="Copied!" data-code="// verilog_format: offlocalparam int A = 1;localparam int LONGER = 22;// verilog_format: on"><div></div></button></div></figure></div>
|
||||
<div class="expressive-code"><figure class="frame not-content"><figcaption class="header"></figcaption><pre data-language="system-verilog"><code><div class="ec-line"><div class="code"><span style="--0:#919F9F;--1:#5D6376">// verilog_format: off</span></div></div><div class="ec-line"><div class="code"><span style="--0:#C792EA;--1:#8844AE">localparam int</span><span style="--0:#D6DEEB;--1:#403F53"> </span><span style="--0:#82AAFF;--1:#3B61B0">A</span><span style="--0:#D6DEEB;--1:#403F53"> </span><span style="--0:#C792EA;--1:#8844AE">=</span><span style="--0:#D6DEEB;--1:#403F53"> </span><span style="--0:#F78C6C;--1:#AA0982">1</span><span style="--0:#D6DEEB;--1:#403F53">;</span></div></div><div class="ec-line"><div class="code"><span style="--0:#C792EA;--1:#8844AE">localparam int</span><span style="--0:#D6DEEB;--1:#403F53"> </span><span style="--0:#82AAFF;--1:#3B61B0">LONGER</span><span style="--0:#D6DEEB;--1:#403F53"> </span><span style="--0:#C792EA;--1:#8844AE">=</span><span style="--0:#D6DEEB;--1:#403F53"> </span><span style="--0:#F78C6C;--1:#AA0982">22</span><span style="--0:#D6DEEB;--1:#403F53">;</span></div></div><div class="ec-line"><div class="code"><span style="--0:#919F9F;--1:#5D6376">// verilog_format: on</span></div></div></code></pre><div class="copy"><div aria-live="polite"></div><button title="Copy to clipboard" data-copied="Copied!" data-code="// verilog_format: offlocalparam int A = 1;localparam int LONGER = 22;// verilog_format: on"><div></div></button></div></figure></div>
|
||||
<p><code dir="auto">// lucisv: off</code> and <code dir="auto">// lucisv: on</code> are aliases. Fences preserve exact bytes between items (including class members) and
|
||||
between statements in blocks, forks, functions, tasks, and procedural bodies.
|
||||
They also prevent lint fixes there. A fence must begin on its own line;
|
||||
|
||||
+6
-1
@@ -87,10 +87,15 @@ fence-blind; callers performing automatic edits must apply that protection.</p>
|
||||
<div class="sl-heading-wrapper level-h2"><h2 id="options-and-diagnostics">Options and diagnostics</h2><a class="sl-anchor-link" href="#options-and-diagnostics"><span aria-hidden="true" class="sl-anchor-icon"><svg width="16" height="16" viewBox="0 0 24 24" fill="currentColor"><path d="m12.11 15.39-3.88 3.88a2.52 2.52 0 0 1-3.5 0 2.47 2.47 0 0 1 0-3.5l3.88-3.88a1 1 0 1 0-1.42-1.42l-3.88 3.89a4.48 4.48 0 0 0 6.33 6.33l3.89-3.88a1 1 0 0 0-1.42-1.42m8.58-12.08a4.49 4.49 0 0 0-6.33 0l-3.89 3.88a1 1 0 1 0 1.42 1.42l3.88-3.88a2.52 2.52 0 0 1 3.5 0 2.47 2.47 0 0 1 0 3.5l-3.88 3.88a1 1 0 0 0 0 1.42 1 1 0 0 0 1.42 0l3.88-3.89a4.49 4.49 0 0 0 0-6.33M8.83 15.17a1 1 0 0 0 .71.29 1 1 0 0 0 .71-.29l4.92-4.92a1 1 0 1 0-1.42-1.42l-4.92 4.92a1 1 0 0 0 0 1.42"></path></svg></span><span class="sr-only" data-pagefind-ignore>Section titled “Options and diagnostics”</span></a></div>
|
||||
<p>Use <code dir="auto">[lint.<rule>]</code> in <code dir="auto">lucisv.toml</code> or <code dir="auto">lucisv.lint.options</code> in the editor for
|
||||
per-rule options. See <a href="/start/configuration/">configuration</a> for precedence.
|
||||
<code dir="auto">lucisv check --rules-doc</code> prints all 73 registered rules, their severity,
|
||||
<code dir="auto">lucisv check --rules-doc</code> prints all 74 registered rules, their severity,
|
||||
default selection, fix applicability, and option defaults.</p>
|
||||
<p>Text output uses <code dir="auto">FILE:LINE:COL: severity: message [rule]</code>. JSON output is one
|
||||
array, with a <code dir="auto">severity</code> field on each diagnostic.</p>
|
||||
<p><code dir="auto">unused-import</code> is a Style rule, off by default even in a project. Enable it
|
||||
explicitly to report unused module/package/class imports using the same
|
||||
analysis as Organize Imports. It stays silent without package facts and
|
||||
preserves uncertain macro or inherited uses. A finding on an import with a
|
||||
comment has no automatic deletion fix.</p>
|
||||
<div class="sl-heading-wrapper level-h2"><h2 id="waivers">Waivers</h2><a class="sl-anchor-link" href="#waivers"><span aria-hidden="true" class="sl-anchor-icon"><svg width="16" height="16" viewBox="0 0 24 24" fill="currentColor"><path d="m12.11 15.39-3.88 3.88a2.52 2.52 0 0 1-3.5 0 2.47 2.47 0 0 1 0-3.5l3.88-3.88a1 1 0 1 0-1.42-1.42l-3.88 3.89a4.48 4.48 0 0 0 6.33 6.33l3.89-3.88a1 1 0 0 0-1.42-1.42m8.58-12.08a4.49 4.49 0 0 0-6.33 0l-3.89 3.88a1 1 0 1 0 1.42 1.42l3.88-3.88a2.52 2.52 0 0 1 3.5 0 2.47 2.47 0 0 1 0 3.5l-3.88 3.88a1 1 0 0 0 0 1.42 1 1 0 0 0 1.42 0l3.88-3.89a4.49 4.49 0 0 0 0-6.33M8.83 15.17a1 1 0 0 0 .71.29 1 1 0 0 0 .71-.29l4.92-4.92a1 1 0 1 0-1.42-1.42l-4.92 4.92a1 1 0 0 0 0 1.42"></path></svg></span><span class="sr-only" data-pagefind-ignore>Section titled “Waivers”</span></a></div>
|
||||
<div class="expressive-code"><figure class="frame not-content"><figcaption class="header"></figcaption><pre data-language="system-verilog"><code><div class="ec-line"><div class="code"><span style="--0:#C792EA;--1:#8844AE">wire</span><span style="--0:#D6DEEB;--1:#403F53"> </span><span style="--0:#C5E478;--1:#3B61B0">a</span><span style="--0:#D6DEEB;--1:#403F53">; </span><span style="--0:#919F9F;--1:#5D6376">// lucisv: waive no-tabs</span></div></div><div class="ec-line"><div class="code"><span style="--0:#919F9F;--1:#5D6376">// lucisv: waive no-tabs</span></div></div><div class="ec-line"><div class="code"><span style="--0:#C792EA;--1:#8844AE">wire</span><span style="--0:#D6DEEB;--1:#403F53"> </span><span style="--0:#C5E478;--1:#3B61B0">b</span><span style="--0:#D6DEEB;--1:#403F53">;</span></div></div><div class="ec-line"><div class="code"><span style="--0:#919F9F;--1:#5D6376">// lucisv: waive-start module-name-style</span></div></div><div class="ec-line"><div class="code"><span style="--0:#C792EA;--1:#8844AE">module</span><span style="--0:#D6DEEB;--1:#403F53"> LegacyName;</span></div></div><div class="ec-line"><div class="code"><span style="--0:#C792EA;--1:#8844AE">endmodule</span></div></div><div class="ec-line"><div class="code"><span style="--0:#919F9F;--1:#5D6376">// lucisv: waive-stop module-name-style</span></div></div></code></pre><div class="copy"><div aria-live="polite"></div><button title="Copy to clipboard" data-copied="Copied!" data-code="wire a; // lucisv: waive no-tabs// lucisv: waive no-tabswire b;// lucisv: waive-start module-name-stylemodule LegacyName;endmodule// lucisv: waive-stop module-name-style"><div></div></button></div></figure></div>
|
||||
<p><code dir="auto">verilog_lint:</code> is accepted in place of <code dir="auto">lucisv:</code> for Verible compatibility. The <code dir="auto">unused-waiver</code> rule reports malformed, unknown, or no-longer-needed suppressions when their target rule is enabled.</p>
|
||||
|
||||
+6
-5
@@ -75,7 +75,7 @@
|
||||
<ul>
|
||||
<li>Modules, interfaces, programs, packages, classes, interface classes, generate regions, and nested classes.</li>
|
||||
<li>ANSI and non-ANSI ports, parameter ports, header imports, <code dir="auto">timeunit</code>, <code dir="auto">genvar</code>, and <code dir="auto">defparam</code>.</li>
|
||||
<li>Net and variable declarations, signing, packed and unpacked dimensions, and net delays.</li>
|
||||
<li>Net and variable declarations, signing, packed and unpacked dimensions, net delays, and net drive strengths.</li>
|
||||
<li><code dir="auto">typedef</code> aliases, enums, packed structs/unions, forward class declarations, anonymous aggregate types, and type parameters.</li>
|
||||
<li>Virtual interfaces, parameterized class types, properties, methods, constructors, prototypes, and out-of-body method definitions.</li>
|
||||
<li>Functions and tasks in ANSI and legacy forms, DPI imports/exports, and package re-exports.</li>
|
||||
@@ -85,7 +85,8 @@
|
||||
<li><code dir="auto">assign</code>, <code dir="auto">always</code>, <code dir="auto">always_comb</code>, <code dir="auto">always_ff</code>, <code dir="auto">always_latch</code>, <code dir="auto">initial</code>, and <code dir="auto">final</code>.</li>
|
||||
<li>Blocks, conditionals, every <code dir="auto">case</code> kind, loops, <code dir="auto">foreach</code>, <code dir="auto">fork/join*</code>, waits, timing controls, events, <code dir="auto">force</code>/<code dir="auto">release</code>, and jump statements.</li>
|
||||
<li>Immediate and concurrent assertions, sequences, properties, <code dir="auto">expect</code>, <code dir="auto">cover sequence</code>, and <code dir="auto">default disable iff</code>. Property and sequence expressions use their LRM precedence and participate in formatting and semantic tools.</li>
|
||||
<li><code dir="auto">randomize() with</code>, <code dir="auto">randcase</code>, <code dir="auto">let</code>, statement labels, array iterator methods, and omitted positional arguments.</li>
|
||||
<li><code dir="auto">randomize() with</code>, <code dir="auto">randcase</code>, real <code dir="auto">randsequence</code> productions, statement-level <code dir="auto">let</code>, statement labels, array iterator methods, and omitted positional arguments.</li>
|
||||
<li>Nonblocking <code dir="auto">->></code> event triggers with optional timing and min:typ:max clocking skews.</li>
|
||||
<li>Constraint blocks and randomization constraint bodies, including <code dir="auto">soft</code>, <code dir="auto">dist</code>, implication, <code dir="auto">foreach</code>, and <code dir="auto">solve before</code>.</li>
|
||||
<li>Covergroups with coverpoints, bins, transitions, crosses, <code dir="auto">with</code>, and <code dir="auto">iff</code> expressions.</li>
|
||||
</ul>
|
||||
@@ -99,7 +100,7 @@
|
||||
</ul>
|
||||
<div class="sl-heading-wrapper level-h2"><h2 id="expressions">Expressions</h2><a class="sl-anchor-link" href="#expressions"><span aria-hidden="true" class="sl-anchor-icon"><svg width="16" height="16" viewBox="0 0 24 24" fill="currentColor"><path d="m12.11 15.39-3.88 3.88a2.52 2.52 0 0 1-3.5 0 2.47 2.47 0 0 1 0-3.5l3.88-3.88a1 1 0 1 0-1.42-1.42l-3.88 3.89a4.48 4.48 0 0 0 6.33 6.33l3.89-3.88a1 1 0 0 0-1.42-1.42m8.58-12.08a4.49 4.49 0 0 0-6.33 0l-3.89 3.88a1 1 0 1 0 1.42 1.42l3.88-3.88a2.52 2.52 0 0 1 3.5 0 2.47 2.47 0 0 1 0 3.5l-3.88 3.88a1 1 0 0 0 0 1.42 1 1 0 0 0 1.42 0l3.88-3.89a4.49 4.49 0 0 0 0-6.33M8.83 15.17a1 1 0 0 0 .71.29 1 1 0 0 0 .71-.29l4.92-4.92a1 1 0 1 0-1.42-1.42l-4.92 4.92a1 1 0 0 0 0 1.42"></path></svg></span><span class="sr-only" data-pagefind-ignore>Section titled “Expressions”</span></a></div>
|
||||
<ul>
|
||||
<li>Full operator precedence, ternaries, concatenation and replication, slices, streaming concatenations, casts, and assignment patterns.</li>
|
||||
<li>Full operator precedence, ternaries, concatenation and replication, slices, streaming concatenations with <code dir="auto">with [range]</code>, constant-expression and packed-type cast bases, and assignment patterns.</li>
|
||||
<li>Hierarchical and package-scoped names, named call arguments, array methods, <code dir="auto">inside</code>, and all supported <code dir="auto">new</code> forms.</li>
|
||||
<li>Dynamic arrays, queues, associative arrays, empty literals, and <code dir="auto">$</code>-bound indexing.</li>
|
||||
<li>Macro invocations in expression, statement, and item position; macro digits in based numbers.</li>
|
||||
@@ -107,6 +108,6 @@
|
||||
<div class="sl-heading-wrapper level-h2"><h2 id="preserved-rather-than-reformatted">Preserved rather than reformatted</h2><a class="sl-anchor-link" href="#preserved-rather-than-reformatted"><span aria-hidden="true" class="sl-anchor-icon"><svg width="16" height="16" viewBox="0 0 24 24" fill="currentColor"><path d="m12.11 15.39-3.88 3.88a2.52 2.52 0 0 1-3.5 0 2.47 2.47 0 0 1 0-3.5l3.88-3.88a1 1 0 1 0-1.42-1.42l-3.88 3.89a4.48 4.48 0 0 0 6.33 6.33l3.89-3.88a1 1 0 0 0-1.42-1.42m8.58-12.08a4.49 4.49 0 0 0-6.33 0l-3.89 3.88a1 1 0 1 0 1.42 1.42l3.88-3.88a2.52 2.52 0 0 1 3.5 0 2.47 2.47 0 0 1 0 3.5l-3.88 3.88a1 1 0 0 0 0 1.42 1 1 0 0 0 1.42 0l3.88-3.89a4.49 4.49 0 0 0 0-6.33M8.83 15.17a1 1 0 0 0 .71.29 1 1 0 0 0 .71-.29l4.92-4.92a1 1 0 1 0-1.42-1.42l-4.92 4.92a1 1 0 0 0 0 1.42"></path></svg></span><span class="sr-only" data-pagefind-ignore>Section titled “Preserved rather than reformatted”</span></a></div>
|
||||
<p>Some constructs are recognized structurally but emitted with their internal source layout intact: compiler directives, macro bodies, <code dir="auto">specify</code>, UDP, checker and config blocks, and carefully recovered conditional-split declarations. Constraint, covergroup and SVA parsers also keep a byte-exact fallback for an unfamiliar body, so unsupported subgrammar does not block the surrounding file.</p>
|
||||
<div class="sl-heading-wrapper level-h2"><h2 id="not-supported">Not supported</h2><a class="sl-anchor-link" href="#not-supported"><span aria-hidden="true" class="sl-anchor-icon"><svg width="16" height="16" viewBox="0 0 24 24" fill="currentColor"><path d="m12.11 15.39-3.88 3.88a2.52 2.52 0 0 1-3.5 0 2.47 2.47 0 0 1 0-3.5l3.88-3.88a1 1 0 1 0-1.42-1.42l-3.88 3.89a4.48 4.48 0 0 0 6.33 6.33l3.89-3.88a1 1 0 0 0-1.42-1.42m8.58-12.08a4.49 4.49 0 0 0-6.33 0l-3.89 3.88a1 1 0 1 0 1.42 1.42l3.88-3.88a2.52 2.52 0 0 1 3.5 0 2.47 2.47 0 0 1 0 3.5l-3.88 3.88a1 1 0 0 0 0 1.42 1 1 0 0 0 1.42 0l3.88-3.89a4.49 4.49 0 0 0 0-6.33M8.83 15.17a1 1 0 0 0 .71.29 1 1 0 0 0 .71-.29l4.92-4.92a1 1 0 1 0-1.42-1.42l-4.92 4.92a1 1 0 0 0 0 1.42"></path></svg></span><span class="sr-only" data-pagefind-ignore>Section titled “Not supported”</span></a></div>
|
||||
<p>A small set of rare expression/port forms remains outside the formatter grammar. lucisv also does not run a preprocessor, so a file that becomes valid only after cross-file macro expansion may not format as a standalone input.</p>
|
||||
<p>Parser acceptance does not imply full elaboration or semantic navigation: generate-block-scoped hierarchical paths and DPI-export name binding remain gaps. lucisv also does not run a preprocessor, so a file that becomes valid only after cross-file macro expansion may not format as a standalone input.</p>
|
||||
<aside aria-label="Safe failure" class="starlight-aside starlight-aside--caution"><p class="starlight-aside__title" aria-hidden="true"><svg viewBox="0 0 24 24" width="16" height="16" fill="currentColor" class="starlight-aside__icon"><path d="M12 16a1 1 0 1 0 0 2 1 1 0 0 0 0-2Zm10.67 1.47-8.05-14a3 3 0 0 0-5.24 0l-8 14A3 3 0 0 0 3.94 22h16.12a3 3 0 0 0 2.61-4.53Zm-1.73 2a1 1 0 0 1-.88.51H3.94a1 1 0 0 1-.88-.51 1 1 0 0 1 0-1l8-14a1 1 0 0 1 1.78 0l8.05 14a1 1 0 0 1 .05 1.02v-.02ZM12 8a1 1 0 0 0-1 1v4a1 1 0 0 0 2 0V9a1 1 0 0 0-1-1Z"/></svg>Safe failure</p><div class="starlight-aside__content"><p>Whole-file formatting returns an error and writes nothing when parsing is incomplete. lucisv never emits a partially understood file.</p></div></aside>
|
||||
</div><footer class="sl-flex astro-xhxjzfa7"><div class="meta sl-flex astro-xhxjzfa7"><a href="https://git.luci.ooo/lucio/verilogrustformatter/src/branch/master/docs/site/src/content/docs/guides/syntax.md" class="sl-flex print:hidden astro-xk5gmzsg"><svg aria-hidden="true" class="astro-xk5gmzsg astro-n5k4ipy7" width="16" height="16" viewBox="0 0 24 24" fill="currentColor" style="--sl-icon-size: 1.2em;"><path d="M22 7.24a1 1 0 0 0-.29-.71l-4.24-4.24a1 1 0 0 0-1.1-.22 1 1 0 0 0-.32.22l-2.83 2.83L2.29 16.05a1 1 0 0 0-.29.71V21a1 1 0 0 0 1 1h4.24a1 1 0 0 0 .76-.29l10.87-10.93L21.71 8c.1-.1.17-.2.22-.33a1 1 0 0 0 0-.24v-.14l.07-.05ZM6.83 20H4v-2.83l9.93-9.93 2.83 2.83L6.83 20ZM18.17 8.66l-2.83-2.83 1.42-1.41 2.82 2.82-1.41 1.42Z"/></svg>Edit page</a><p>Last updated: <time datetime="2026-09-03T09:28:11.000Z">Sep 3, 2026</time></p></div><div class="pagination-links print:hidden astro-jgq3vlii" dir="ltr"><a href="/guides/editors/" rel="prev" class="astro-jgq3vlii"><svg aria-hidden="true" class="astro-jgq3vlii astro-n5k4ipy7" width="16" height="16" viewBox="0 0 24 24" fill="currentColor" style="--sl-icon-size: 1.5rem;"><path d="M17 11H9.41l3.3-3.29a1.004 1.004 0 1 0-1.42-1.42l-5 5a1 1 0 0 0-.21.33 1 1 0 0 0 0 .76 1 1 0 0 0 .21.33l5 5a1.002 1.002 0 0 0 1.639-.325 1 1 0 0 0-.219-1.095L9.41 13H17a1 1 0 0 0 0-2Z"/></svg><span class="astro-jgq3vlii">Previous<br class="astro-jgq3vlii"><span class="link-title astro-jgq3vlii">Editors & LSP</span></span></a><a href="/reference/cli/" rel="next" class="astro-jgq3vlii"><svg aria-hidden="true" class="astro-jgq3vlii astro-n5k4ipy7" width="16" height="16" viewBox="0 0 24 24" fill="currentColor" style="--sl-icon-size: 1.5rem;"><path d="M17.92 11.62a1.001 1.001 0 0 0-.21-.33l-5-5a1.003 1.003 0 1 0-1.42 1.42l3.3 3.29H7a1 1 0 0 0 0 2h7.59l-3.3 3.29a1.002 1.002 0 0 0 .325 1.639 1 1 0 0 0 1.095-.219l5-5a1 1 0 0 0 .21-.33 1 1 0 0 0 0-.76Z"/></svg><span class="astro-jgq3vlii">Next<br class="astro-jgq3vlii"><span class="link-title astro-jgq3vlii">CLI</span></span></a></div></footer></div></div></main></div></div></div></div></body></html>
|
||||
</div><footer class="sl-flex astro-xhxjzfa7"><div class="meta sl-flex astro-xhxjzfa7"><a href="https://git.luci.ooo/lucio/verilogrustformatter/src/branch/master/docs/site/src/content/docs/guides/syntax.md" class="sl-flex print:hidden astro-xk5gmzsg"><svg aria-hidden="true" class="astro-xk5gmzsg astro-n5k4ipy7" width="16" height="16" viewBox="0 0 24 24" fill="currentColor" style="--sl-icon-size: 1.2em;"><path d="M22 7.24a1 1 0 0 0-.29-.71l-4.24-4.24a1 1 0 0 0-1.1-.22 1 1 0 0 0-.32.22l-2.83 2.83L2.29 16.05a1 1 0 0 0-.29.71V21a1 1 0 0 0 1 1h4.24a1 1 0 0 0 .76-.29l10.87-10.93L21.71 8c.1-.1.17-.2.22-.33a1 1 0 0 0 0-.24v-.14l.07-.05ZM6.83 20H4v-2.83l9.93-9.93 2.83 2.83L6.83 20ZM18.17 8.66l-2.83-2.83 1.42-1.41 2.82 2.82-1.41 1.42Z"/></svg>Edit page</a><p>Last updated: <time datetime="2026-09-07T06:12:49.000Z">Sep 7, 2026</time></p></div><div class="pagination-links print:hidden astro-jgq3vlii" dir="ltr"><a href="/guides/editors/" rel="prev" class="astro-jgq3vlii"><svg aria-hidden="true" class="astro-jgq3vlii astro-n5k4ipy7" width="16" height="16" viewBox="0 0 24 24" fill="currentColor" style="--sl-icon-size: 1.5rem;"><path d="M17 11H9.41l3.3-3.29a1.004 1.004 0 1 0-1.42-1.42l-5 5a1 1 0 0 0-.21.33 1 1 0 0 0 0 .76 1 1 0 0 0 .21.33l5 5a1.002 1.002 0 0 0 1.639-.325 1 1 0 0 0-.219-1.095L9.41 13H17a1 1 0 0 0 0-2Z"/></svg><span class="astro-jgq3vlii">Previous<br class="astro-jgq3vlii"><span class="link-title astro-jgq3vlii">Editors & LSP</span></span></a><a href="/reference/cli/" rel="next" class="astro-jgq3vlii"><svg aria-hidden="true" class="astro-jgq3vlii astro-n5k4ipy7" width="16" height="16" viewBox="0 0 24 24" fill="currentColor" style="--sl-icon-size: 1.5rem;"><path d="M17.92 11.62a1.001 1.001 0 0 0-.21-.33l-5-5a1.003 1.003 0 1 0-1.42 1.42l3.3 3.29H7a1 1 0 0 0 0 2h7.59l-3.3 3.29a1.002 1.002 0 0 0 .325 1.639 1 1 0 0 0 1.095-.219l5-5a1 1 0 0 0 .21-.33 1 1 0 0 0 0-.76Z"/></svg><span class="astro-jgq3vlii">Next<br class="astro-jgq3vlii"><span class="link-title astro-jgq3vlii">CLI</span></span></a></div></footer></div></div></main></div></div></div></div></body></html>
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+1
-1
@@ -1 +1 @@
|
||||
{"version":"1.5.2","languages":{"en":{"hash":"en_e3346e8993","wasm":"en","page_count":12}},"include_characters":["_","‿","⁀","⁔","︳","︴","﹍","﹎","﹏","_"]}
|
||||
{"version":"1.5.2","languages":{"en":{"hash":"en_5a9cf9ce1e","wasm":"en","page_count":12}},"include_characters":["_","‿","⁀","⁔","︳","︴","﹍","﹎","﹏","_"]}
|
||||
Binary file not shown.
Binary file not shown.
+27
-13
@@ -102,13 +102,13 @@
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code dir="auto">vlog_refactor</code></td>
|
||||
<td>rename, references, port propagation, instantiation planning</td>
|
||||
<td>rename/references, ports, imports, extract/inline module, instantiation planning</td>
|
||||
<td>language server</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code dir="auto">lucisv_core</code></td>
|
||||
<td>configuration, filelists, walking, exclusions, cache, atomic replacement</td>
|
||||
<td>CLI and language server</td>
|
||||
<td>CLI, language server, linter waiver matching</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code dir="auto">lucisv</code></td>
|
||||
@@ -142,22 +142,24 @@ Only a verified string is returned. Ranges splice whole items; format fences
|
||||
also protect statement scopes, and verification covers the complete output.</li>
|
||||
<li><strong>Lint:</strong> <code dir="auto">ParsedSource</code> bundles one tokenization and tolerant parse;
|
||||
<code dir="auto">LintContext</code> supplies source facts and lazy semantics. The registry selects
|
||||
73 rules with severities and validated options. Inline and external waivers filter findings,
|
||||
74 rules with severities and validated options. Inline and external waivers filter findings,
|
||||
and the front ends protect fenced bytes before applying fixes.</li>
|
||||
<li><strong>Refactor:</strong> parsed spans and resolved references produce an edit plan;
|
||||
the engine checks the whole candidate edit before returning it. Server source
|
||||
selectors bound the input set but must include every file the engine might
|
||||
edit or refuse over. No formatter dependency is involved.</li>
|
||||
edit or refuse over. The formatter is a test-only dependency of this engine.</li>
|
||||
<li><strong>Editor:</strong> one ordered synchronous loop owns <code dir="auto">Workspace</code>; open documents
|
||||
overlay disk facts. Scans publish index/include/completion batches together.
|
||||
Committed closed-file facts persist under codec 18, including package re-exports; a bounded file-view cache serves
|
||||
Closed-file facts persist under codec 19, including package re-exports and
|
||||
tagged connection/hierarchical surfaces; a bounded file-view cache serves
|
||||
queries that still need source text. Lazy port actions defer the edit until
|
||||
selection; recorded file-scope definition positions avoid a closed-file read.</li>
|
||||
</ul>
|
||||
<p><code dir="auto">vlog_parser</code> and <code dir="auto">lucisv_core</code> depend on no other crates. Formatting and
|
||||
semantics each depend on the parser; linting and refactoring depend on parser
|
||||
and semantics. The CLI composes core, parser, formatter, and linter; the server
|
||||
composes all six libraries. The linter’s formatter dependency is test-only.
|
||||
and semantics. Linting also consumes core’s exclusion matcher for waiver
|
||||
locations. The CLI composes core, parser, formatter, and linter; the server
|
||||
composes all six libraries. Both linter and refactor use the formatter only in tests.
|
||||
External dependencies are confined to the CLI worker pool (<code dir="auto">rayon</code>) and the
|
||||
server’s synchronous LSP/JSON stack.</p>
|
||||
<p>The main change-impact boundaries are the AST and all its walkers, formatter
|
||||
@@ -171,12 +173,24 @@ cycle-aware directory walks with recoverable warnings, and inline aggregate
|
||||
overrides. The v0.44.0 <code dir="auto">undriven-net</code> fix asks the workspace mention census only
|
||||
after local guards, reducing editor open/flush latency without changing the
|
||||
rule’s findings or the synchronous request-ordering contract.</p>
|
||||
<p>Two accepted changes are committed after v0.44.0: type names now carry exact
|
||||
AST spans (<code dir="auto">scan.rs</code> is retired), and package re-exports are references and
|
||||
cycle-guarded member edges in codec 18. Re-exporting a name does not import it
|
||||
into the exporting package’s local scope. DPI-export names remain unbound.
|
||||
The separate hierarchical-tail work proposes codec 19 and a module member
|
||||
surface for instance paths; it is still under QA and is not a released API.</p>
|
||||
<p>v0.45.0 shipped exact type-name spans (<code dir="auto">scan.rs</code> is retired), package
|
||||
re-exports and hierarchical tails, with facts codec <strong>19</strong>. Re-exporting a
|
||||
name does not import it into the package’s local scope. Instance paths reach
|
||||
internal nets, variables and nested instances through a separate surface;
|
||||
existing connection queries keep their interface view. Generate-scoped
|
||||
hierarchical paths and DPI-export name binding remain gaps.</p>
|
||||
<p>v0.46–0.49 added wildcard expansion, ANSI conversion, organize-imports,
|
||||
extract-module and inline-module. Import usage lives in semantic <code dir="auto">imports.rs</code>,
|
||||
shared by the refactor and <code dir="auto">unused-import</code> lint rule. Refactor <code dir="auto">check/ledger.rs</code>
|
||||
tracks protected comment/attribute pieces across moves and copies;
|
||||
<code dir="auto">RefactorEdit::created</code> carries new-file operations to the server. The inline
|
||||
source selector still has a known gap for hierarchical uses through
|
||||
intermediate modules; see the <a href="/reference/language-tools/#refactoring">refactoring limits</a>.</p>
|
||||
<p>The DUT hierarchy is client-only over the existing server snapshot.
|
||||
v0.49.0 also adds real <code dir="auto">randsequence</code> nodes and opt-in UVM indentation, whose
|
||||
CLI cache limitation is documented under <a href="/start/configuration/#cache">configuration</a>.
|
||||
This page reflects committed <code dir="auto">df4e714</code>; Loop 2 is closed, with <code dir="auto">state.rs</code>
|
||||
decomposition deferred to Loop 3.</p>
|
||||
<div class="sl-heading-wrapper level-h2"><h2 id="design-invariants">Design invariants</h2><a class="sl-anchor-link" href="#design-invariants"><span aria-hidden="true" class="sl-anchor-icon"><svg width="16" height="16" viewBox="0 0 24 24" fill="currentColor"><path d="m12.11 15.39-3.88 3.88a2.52 2.52 0 0 1-3.5 0 2.47 2.47 0 0 1 0-3.5l3.88-3.88a1 1 0 1 0-1.42-1.42l-3.88 3.89a4.48 4.48 0 0 0 6.33 6.33l3.89-3.88a1 1 0 0 0-1.42-1.42m8.58-12.08a4.49 4.49 0 0 0-6.33 0l-3.89 3.88a1 1 0 1 0 1.42 1.42l3.88-3.88a2.52 2.52 0 0 1 3.5 0 2.47 2.47 0 0 1 0 3.5l-3.88 3.88a1 1 0 0 0 0 1.42 1 1 0 0 0 1.42 0l3.88-3.89a4.49 4.49 0 0 0 0-6.33M8.83 15.17a1 1 0 0 0 .71.29 1 1 0 0 0 .71-.29l4.92-4.92a1 1 0 1 0-1.42-1.42l-4.92 4.92a1 1 0 0 0 0 1.42"></path></svg></span><span class="sr-only" data-pagefind-ignore>Section titled “Design invariants”</span></a></div>
|
||||
<ul>
|
||||
<li><strong>Source fidelity:</strong> comments and blank-line intent survive the parser.</li>
|
||||
|
||||
+28
-1
@@ -289,7 +289,17 @@ index scope when the defining module lives outside the default folder scope.</p>
|
||||
<tr>
|
||||
<td>Port actions</td>
|
||||
<td>code actions / commands</td>
|
||||
<td>Adds, removes, and propagates module ports; expands a <code dir="auto">.*</code> wildcard into the named connections it stands for (a port with no same-named signal in scope becomes <code dir="auto">.p()</code> and is named in a warning) — <code dir="auto">lucisv.expandWildcard</code>; converts a Verilog-2001 header to ANSI, each body declaration merged into the port it described (IEEE 1800 §23.2.2.2) with its comments carried along — <code dir="auto">lucisv.convertToAnsi</code></td>
|
||||
<td>Adds, removes, and propagates module ports</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Expand wildcard</td>
|
||||
<td>code action / <code dir="auto">lucisv.expandWildcard</code></td>
|
||||
<td>Expands <code dir="auto">.*</code> in declaration order; a port with no same-named signal becomes <code dir="auto">.p()</code> and is named in a warning</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Convert ports to ANSI</td>
|
||||
<td>code action / <code dir="auto">lucisv.convertToAnsi</code></td>
|
||||
<td>Merges a legacy header with its body port declarations, preserving comments and attributes</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Organize imports</td>
|
||||
@@ -302,6 +312,11 @@ index scope when the defining module lives outside the default folder scope.</p>
|
||||
<td>Select whole module items and name the module: ports and parameters inferred from what the selection reads and drives, <code dir="auto">import</code>s carried across, the items moved byte for byte, the replacing instantiation rendered from the new module’s own text; a new file where the editor can create one, below the source module otherwise. Refuses with a sentence wherever a direction cannot be known — <code dir="auto">lucisv.extractModule</code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Inline module</td>
|
||||
<td>code action (<code dir="auto">refactor.inline</code>) / <code dir="auto">lucisv.inlineModule</code></td>
|
||||
<td>Copies a separate-file module body into the selected instance site, substitutes named connections and parameter values, and renames internal identifiers on collision</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Instantiate module</td>
|
||||
<td>inline completion / <code dir="auto">lucisv.instantiate</code></td>
|
||||
<td>Builds an instance from an indexed module interface, including in clients without ghost text</td>
|
||||
@@ -318,6 +333,18 @@ index scope when the defining module lives outside the default folder scope.</p>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<p>Inline-module accepts simple named connections to names or literals; it
|
||||
refuses <code dir="auto">.*</code>, positional/expression or unconnected ports, output-to-literal
|
||||
connections, unsupported port types, generate, initial/final and
|
||||
macro/directive bodies. A hierarchical use found in its inputs also refuses
|
||||
the action. There is a known source-selection gap for uses through an
|
||||
intermediate module: a bench referencing <code dir="auto">wrap.u_S.x</code> can be omitted when
|
||||
inlining <code dir="auto">S</code>. Review those uses before applying the edit.</p>
|
||||
<p>The VS Code hierarchy also supports <strong>Star as DUT</strong>, <strong>Unstar DUT</strong> and
|
||||
<strong>Clear DUTs</strong>. Each DUT gets children and parents sections, followed by Other
|
||||
Modules. <code dir="auto">lucisv.hierarchy.duts</code> unions team-configured names with workspace
|
||||
stars; configured names are locked in the menu. This view consumes the
|
||||
unchanged <code dir="auto">lucisv/moduleHierarchy</code> snapshot; it adds no server protocol.</p>
|
||||
<div class="sl-heading-wrapper level-h2"><h2 id="semantic-presentation">Semantic presentation</h2><a class="sl-anchor-link" href="#semantic-presentation"><span aria-hidden="true" class="sl-anchor-icon"><svg width="16" height="16" viewBox="0 0 24 24" fill="currentColor"><path d="m12.11 15.39-3.88 3.88a2.52 2.52 0 0 1-3.5 0 2.47 2.47 0 0 1 0-3.5l3.88-3.88a1 1 0 1 0-1.42-1.42l-3.88 3.89a4.48 4.48 0 0 0 6.33 6.33l3.89-3.88a1 1 0 0 0-1.42-1.42m8.58-12.08a4.49 4.49 0 0 0-6.33 0l-3.89 3.88a1 1 0 1 0 1.42 1.42l3.88-3.88a2.52 2.52 0 0 1 3.5 0 2.47 2.47 0 0 1 0 3.5l-3.88 3.88a1 1 0 0 0 0 1.42 1 1 0 0 0 1.42 0l3.88-3.89a4.49 4.49 0 0 0 0-6.33M8.83 15.17a1 1 0 0 0 .71.29 1 1 0 0 0 .71-.29l4.92-4.92a1 1 0 1 0-1.42-1.42l-4.92 4.92a1 1 0 0 0 0 1.42"></path></svg></span><span class="sr-only" data-pagefind-ignore>Section titled “Semantic presentation”</span></a></div>
|
||||
<table>
|
||||
<thead>
|
||||
|
||||
+91
-11
@@ -70,11 +70,10 @@
|
||||
})();
|
||||
</script></sl-sidebar-state-persist><div class="md:sl-hidden"><div class="mobile-preferences sl-flex astro-b5gddk54"><div class="social-icons astro-b5gddk54"><a href="https://git.luci.ooo/lucio/verilogrustformatter" rel="me" class="sl-flex astro-cg55etiy"><span class="sr-only astro-cg55etiy">Source repository</span><svg aria-hidden="true" class="astro-cg55etiy astro-n5k4ipy7" width="16" height="16" viewBox="0 0 24 24" fill="currentColor" style="--sl-icon-size: 1em;"><path d="M12 .3a12 12 0 0 0-3.8 23.38c.6.12.83-.26.83-.57L9 21.07c-3.34.72-4.04-1.61-4.04-1.61-.55-1.39-1.34-1.76-1.34-1.76-1.08-.74.09-.73.09-.73 1.2.09 1.83 1.24 1.83 1.24 1.08 1.83 2.81 1.3 3.5 1 .1-.78.42-1.31.76-1.61-2.67-.3-5.47-1.33-5.47-5.93 0-1.31.47-2.38 1.24-3.22-.14-.3-.54-1.52.1-3.18 0 0 1-.32 3.3 1.23a11.5 11.5 0 0 1 6 0c2.28-1.55 3.29-1.23 3.29-1.23.64 1.66.24 2.88.12 3.18a4.65 4.65 0 0 1 1.23 3.22c0 4.61-2.8 5.63-5.48 5.92.42.36.81 1.1.81 2.22l-.01 3.29c0 .31.2.69.82.57A12 12 0 0 0 12 .3Z"/></svg></a></div><starlight-theme-select><label style="--sl-select-width: 6.25em" class="astro-r2p65idu"><span class="sr-only astro-r2p65idu">Select theme</span><svg aria-hidden="true" class="icon label-icon astro-r2p65idu astro-n5k4ipy7" width="16" height="16" viewBox="0 0 24 24" fill="currentColor" style="--sl-icon-size: 1em;"><path d="M21 14h-1V7a3 3 0 0 0-3-3H7a3 3 0 0 0-3 3v7H3a1 1 0 0 0-1 1v2a3 3 0 0 0 3 3h14a3 3 0 0 0 3-3v-2a1 1 0 0 0-1-1ZM6 7a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v7H6V7Zm14 10a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1v-1h16v1Z"/></svg><select autocomplete="off" class="astro-r2p65idu"><option value="dark" class="astro-r2p65idu">Dark</option><option value="light" class="astro-r2p65idu">Light</option><option value="auto" selected class="astro-r2p65idu">Auto</option></select><svg aria-hidden="true" class="icon caret astro-r2p65idu astro-n5k4ipy7" width="16" height="16" viewBox="0 0 24 24" fill="currentColor" style="--sl-icon-size: 1em;"><path d="M17 9.17a1 1 0 0 0-1.41 0L12 12.71 8.46 9.17a1 1 0 1 0-1.41 1.42l4.24 4.24a1.002 1.002 0 0 0 1.42 0L17 10.59a1.002 1.002 0 0 0 0-1.42Z"/></svg></label></starlight-theme-select><script>
|
||||
StarlightThemeProvider.updatePickers();
|
||||
</script></div></div></div></div></nav><div class="main-frame astro-gqpr5s5a"><script type="module">var e=document.getElementById(`starlight__sidebar`),t=e?.querySelector(`sl-sidebar-state-persist`),n=`sl-sidebar-state`,r=()=>{let r=[],i=t?.dataset.hash||``;try{let e=sessionStorage.getItem(n),t=JSON.parse(e||`{}`);Array.isArray(t.open)&&t.hash===i&&(r=t.open)}catch{}return{hash:i,open:r,scroll:e?.scrollTop||0}},i=e=>{try{sessionStorage.setItem(n,JSON.stringify(e))}catch{}},a=()=>i(r()),o=(e,t)=>{let n=r();n.open[t]=e,i(n)};t?.addEventListener(`click`,e=>{if(!(e.target instanceof Element))return;let t=e.target.closest(`summary`)?.closest(`details`);if(!t)return;let n=t.querySelector(`sl-sidebar-restore`),r=parseInt(n?.dataset.index||``);isNaN(r)||o(!t.open,r)}),addEventListener(`visibilitychange`,()=>{document.visibilityState===`hidden`&&a()});</script><div class="lg:sl-flex astro-abfeecmu"><aside class="right-sidebar-container print:hidden astro-abfeecmu"><div class="right-sidebar astro-abfeecmu"><div class="lg:sl-hidden astro-q5mffni3"><mobile-starlight-toc data-min-h="2" data-max-h="3" class="astro-5ulgm6bh"><nav aria-labelledby="starlight__on-this-page--mobile" class="astro-5ulgm6bh"><details id="starlight__mobile-toc" class="astro-5ulgm6bh"><summary id="starlight__on-this-page--mobile" class="sl-flex astro-5ulgm6bh"><span class="toggle sl-flex astro-5ulgm6bh">On this page<svg aria-hidden="true" class="caret astro-5ulgm6bh astro-n5k4ipy7" width="16" height="16" viewBox="0 0 24 24" fill="currentColor" style="--sl-icon-size: 1rem;"><path d="m14.83 11.29-4.24-4.24a1 1 0 1 0-1.42 1.41L12.71 12l-3.54 3.54a1 1 0 0 0 0 1.41 1 1 0 0 0 .71.29 1 1 0 0 0 .71-.29l4.24-4.24a1.002 1.002 0 0 0 0-1.42Z"/></svg></span><span class="display-current astro-5ulgm6bh"></span></summary><div class="dropdown astro-5ulgm6bh"><ul class="isMobile astro-cxyftcne" style="--depth: 0;"><li style="--depth: 0;" class="astro-cxyftcne"><a href="#_top" style="--depth: 0;" class="astro-cxyftcne"><span style="--depth: 0;" class="astro-cxyftcne">Overview</span></a></li><li style="--depth: 0;" class="astro-cxyftcne"><a href="#vlog_parser" style="--depth: 0;" class="astro-cxyftcne"><span style="--depth: 0;" class="astro-cxyftcne">vlog_parser</span></a><ul class="isMobile astro-cxyftcne" style="--depth: 1;"><li style="--depth: 1;" class="astro-cxyftcne"><a href="#entry-points-and-lexical-utilities" style="--depth: 1;" class="astro-cxyftcne"><span style="--depth: 1;" class="astro-cxyftcne">Entry points and lexical utilities</span></a></li><li style="--depth: 1;" class="astro-cxyftcne"><a href="#coordinates-and-token-queries" style="--depth: 1;" class="astro-cxyftcne"><span style="--depth: 1;" class="astro-cxyftcne">Coordinates and token queries</span></a></li><li style="--depth: 1;" class="astro-cxyftcne"><a href="#ast-queries" style="--depth: 1;" class="astro-cxyftcne"><span style="--depth: 1;" class="astro-cxyftcne">AST queries</span></a></li></ul></li><li style="--depth: 0;" class="astro-cxyftcne"><a href="#vlog_formatter" style="--depth: 0;" class="astro-cxyftcne"><span style="--depth: 0;" class="astro-cxyftcne">vlog_formatter</span></a><ul class="isMobile astro-cxyftcne" style="--depth: 1;"><li style="--depth: 1;" class="astro-cxyftcne"><a href="#formatting-and-verification" style="--depth: 1;" class="astro-cxyftcne"><span style="--depth: 1;" class="astro-cxyftcne">Formatting and verification</span></a></li><li style="--depth: 1;" class="astro-cxyftcne"><a href="#document-model-and-printer" style="--depth: 1;" class="astro-cxyftcne"><span style="--depth: 1;" class="astro-cxyftcne">Document model and printer</span></a></li><li style="--depth: 1;" class="astro-cxyftcne"><a href="#alignment-fences-and-ranges" style="--depth: 1;" class="astro-cxyftcne"><span style="--depth: 1;" class="astro-cxyftcne">Alignment, fences, and ranges</span></a></li></ul></li><li style="--depth: 0;" class="astro-cxyftcne"><a href="#vlog_linter" style="--depth: 0;" class="astro-cxyftcne"><span style="--depth: 0;" class="astro-cxyftcne">vlog_linter</span></a><ul class="isMobile astro-cxyftcne" style="--depth: 1;"><li style="--depth: 1;" class="astro-cxyftcne"><a href="#run-and-select-rules" style="--depth: 1;" class="astro-cxyftcne"><span style="--depth: 1;" class="astro-cxyftcne">Run and select rules</span></a></li><li style="--depth: 1;" class="astro-cxyftcne"><a href="#context-diagnostics-and-fixes" style="--depth: 1;" class="astro-cxyftcne"><span style="--depth: 1;" class="astro-cxyftcne">Context, diagnostics, and fixes</span></a></li></ul></li><li style="--depth: 0;" class="astro-cxyftcne"><a href="#vlog_semantic" style="--depth: 0;" class="astro-cxyftcne"><span style="--depth: 0;" class="astro-cxyftcne">vlog_semantic</span></a><ul class="isMobile astro-cxyftcne" style="--depth: 1;"><li style="--depth: 1;" class="astro-cxyftcne"><a href="#file-semantics" style="--depth: 1;" class="astro-cxyftcne"><span style="--depth: 1;" class="astro-cxyftcne">File semantics</spanLine truncated
|
||||
</script></div></div></div></div></nav><div class="main-frame astro-gqpr5s5a"><script type="module">var e=document.getElementById(`starlight__sidebar`),t=e?.querySelector(`sl-sidebar-state-persist`),n=`sl-sidebar-state`,r=()=>{let r=[],i=t?.dataset.hash||``;try{let e=sessionStorage.getItem(n),t=JSON.parse(e||`{}`);Array.isArray(t.open)&&t.hash===i&&(r=t.open)}catch{}return{hash:i,open:r,scroll:e?.scrollTop||0}},i=e=>{try{sessionStorage.setItem(n,JSON.stringify(e))}catch{}},a=()=>i(r()),o=(e,t)=>{let n=r();n.open[t]=e,i(n)};t?.addEventListener(`click`,e=>{if(!(e.target instanceof Element))return;let t=e.target.closest(`summary`)?.closest(`details`);if(!t)return;let n=t.querySelector(`sl-sidebar-restore`),r=parseInt(n?.dataset.index||``);isNaN(r)||o(!t.open,r)}),addEventListener(`visibilitychange`,()=>{document.visibilityState===`hidden`&&a()});</script><div class="lg:sl-flex astro-abfeecmu"><aside class="right-sidebar-container print:hidden astro-abfeecmu"><div class="right-sidebar astro-abfeecmu"><div class="lg:sl-hidden astro-q5mffni3"><mobile-starlight-toc data-min-h="2" data-max-h="3" class="astro-5ulgm6bh"><nav aria-labelledby="starlight__on-this-page--mobile" class="astro-5ulgm6bh"><details id="starlight__mobile-toc" class="astro-5ulgm6bh"><summary id="starlight__on-this-page--mobile" class="sl-flex astro-5ulgm6bh"><span class="toggle sl-flex astro-5ulgm6bh">On this page<svg aria-hidden="true" class="caret astro-5ulgm6bh astro-n5k4ipy7" width="16" height="16" viewBox="0 0 24 24" fill="currentColor" style="--sl-icon-size: 1rem;"><path d="m14.83 11.29-4.24-4.24a1 1 0 1 0-1.42 1.41L12.71 12l-3.54 3.54a1 1 0 0 0 0 1.41 1 1 0 0 0 .71.29 1 1 0 0 0 .71-.29l4.24-4.24a1.002 1.002 0 0 0 0-1.42Z"/></svg></span><span class="display-current astro-5ulgm6bh"></span></summary><div class="dropdown astro-5ulgm6bh"><ul class="isMobile astro-cxyftcne" style="--depth: 0;"><li style="--depth: 0;" class="astro-cxyftcne"><a href="#_top" style="--depth: 0;" class="astro-cxyftcne"><span style="--depth: 0;" class="astro-cxyftcne">Overview</span></a></li><li style="--depth: 0;" class="astro-cxyftcne"><a href="#vlog_parser" style="--depth: 0;" class="astro-cxyftcne"><span style="--depth: 0;" class="astro-cxyftcne">vlog_parser</span></a><ul class="isMobile astro-cxyftcne" style="--depth: 1;"><li style="--depth: 1;" class="astro-cxyftcne"><a href="#entry-points-and-lexical-utilities" style="--depth: 1;" class="astro-cxyftcne"><span style="--depth: 1;" class="astro-cxyftcne">Entry points and lexical utilities</span></a></li><li style="--depth: 1;" class="astro-cxyftcne"><a href="#coordinates-and-token-queries" style="--depth: 1;" class="astro-cxyftcne"><span style="--depth: 1;" class="astro-cxyftcne">Coordinates and token queries</span></a></li><li style="--depth: 1;" class="astro-cxyftcne"><a href="#ast-queries" style="--depth: 1;" class="astro-cxyftcne"><span style="--depth: 1;" class="astro-cxyftcne">AST queries</span></a></li></ul></li><li style="--depth: 0;" class="astro-cxyftcne"><a href="#vlog_formatter" style="--depth: 0;" class="astro-cxyftcne"><span style="--depth: 0;" class="astro-cxyftcne">vlog_formatter</span></a><ul class="isMobile astro-cxyftcne" style="--depth: 1;"><li style="--depth: 1;" class="astro-cxyftcne"><a href="#formatting-and-verification" style="--depth: 1;" class="astro-cxyftcne"><span style="--depth: 1;" class="astro-cxyftcne">Formatting and verification</span></a></li><li style="--depth: 1;" class="astro-cxyftcne"><a href="#document-model-and-printer" style="--depth: 1;" class="astro-cxyftcne"><span style="--depth: 1;" class="astro-cxyftcne">Document model and printer</span></a></li><li style="--depth: 1;" class="astro-cxyftcne"><a href="#alignment-fences-and-ranges" style="--depth: 1;" class="astro-cxyftcne"><span style="--depth: 1;" class="astro-cxyftcne">Alignment, fences, and ranges</span></a></li></ul></li><li style="--depth: 0;" class="astro-cxyftcne"><a href="#vlog_linter" style="--depth: 0;" class="astro-cxyftcne"><span style="--depth: 0;" class="astro-cxyftcne">vlog_linter</span></a><ul class="isMobile astro-cxyftcne" style="--depth: 1;"><li style="--depth: 1;" class="astro-cxyftcne"><a href="#run-and-select-rules" style="--depth: 1;" class="astro-cxyftcne"><span style="--depth: 1;" class="astro-cxyftcne">Run and select rules</span></a></li><li style="--depth: 1;" class="astro-cxyftcne"><a href="#context-diagnostics-and-fixes" style="--depth: 1;" class="astro-cxyftcne"><span style="--depth: 1;" class="astro-cxyftcne">Context, diagnostics, and fixes</span></a></li></ul></li><li style="--depth: 0;" class="astro-cxyftcne"><a href="#vlog_semantic" style="--depth: 0;" class="astro-cxyftcne"><span style="--depth: 0;" class="astro-cxyftcne">vlog_semantic</span></a><ul class="isMobile astro-cxyftcne" style="--depth: 1;"><li style="--depth: 1;" class="astro-cxyftcne"><a href="#file-semantics" style="--depth: 1;" class="astro-cxyftcne"><span style="--depth: 1;" class="astro-cxyftcne">File semantics</spanLine truncated
|
||||
<p>This is a navigational API index, not source documentation. It summarizes the main public callable surface of the six reusable library crates in the workspace; command-line and language-server binaries are documented in their dedicated references.</p>
|
||||
<p>The latest release is v0.44.0. This index includes the accepted type-name-span
|
||||
and package-re-export additions committed at <code dir="auto">9ef1058</code> for the next release;
|
||||
it excludes the in-progress hierarchical-tail API and codec 19. For the complete signatures and fields,
|
||||
<p>This index reflects <strong>v0.49.0</strong>, reviewed at committed <code dir="auto">df4e714</code>, including
|
||||
hierarchical member surfaces, import usage and module refactorings. For the complete signatures and fields,
|
||||
run <code dir="auto">cargo doc --workspace --no-deps</code>; this hand-maintained index is not an
|
||||
exhaustive replacement for rustdoc. The parser’s strict and tolerant entry
|
||||
points share one grammar; tolerant errors do not imply formatter acceptance.
|
||||
@@ -235,6 +234,9 @@ The CLI and server configure their worker threads accordingly.</p>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<p><code dir="auto">Config</code> exposes <code dir="auto">max_width</code>, <code dir="auto">indent_width</code>, and <code dir="auto">uvm_utils_indent</code> (default
|
||||
<code dir="auto">false</code>, new in v0.49.0). Exhaustive struct literals must include the new field;
|
||||
<code dir="auto">Config { max_width: 120, ..Config::default() }</code> keeps the other defaults.</p>
|
||||
<div class="sl-heading-wrapper level-h3"><h3 id="document-model-and-printer">Document model and printer</h3><a class="sl-anchor-link" href="#document-model-and-printer"><span aria-hidden="true" class="sl-anchor-icon"><svg width="16" height="16" viewBox="0 0 24 24" fill="currentColor"><path d="m12.11 15.39-3.88 3.88a2.52 2.52 0 0 1-3.5 0 2.47 2.47 0 0 1 0-3.5l3.88-3.88a1 1 0 1 0-1.42-1.42l-3.88 3.89a4.48 4.48 0 0 0 6.33 6.33l3.89-3.88a1 1 0 0 0-1.42-1.42m8.58-12.08a4.49 4.49 0 0 0-6.33 0l-3.89 3.88a1 1 0 1 0 1.42 1.42l3.88-3.88a2.52 2.52 0 0 1 3.5 0 2.47 2.47 0 0 1 0 3.5l-3.88 3.88a1 1 0 0 0 0 1.42 1 1 0 0 0 1.42 0l3.88-3.89a4.49 4.49 0 0 0 0-6.33M8.83 15.17a1 1 0 0 0 .71.29 1 1 0 0 0 .71-.29l4.92-4.92a1 1 0 1 0-1.42-1.42l-4.92 4.92a1 1 0 0 0 0 1.42"></path></svg></span><span class="sr-only" data-pagefind-ignore>Section titled “Document model and printer”</span></a></div>
|
||||
<table>
|
||||
<thead>
|
||||
@@ -368,11 +370,11 @@ The CLI and server configure their worker threads accordingly.</p>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code dir="auto">LintContext</code></td>
|
||||
<td><code dir="auto">new</code>, <code dir="auto">from_parse</code>, <code dir="auto">with_tab_width</code>, <code dir="auto">with_line_length</code>, <code dir="auto">with_options</code>, <code dir="auto">with_semantics</code>, <code dir="auto">with_oracle</code>, <code dir="auto">mentioned_elsewhere</code>, <code dir="auto">has_oracle</code>, <code dir="auto">module_interface</code>, <code dir="auto">parsed_cleanly</code>, <code dir="auto">line_length</code>, <code dir="auto">options</code>, <code dir="auto">option_bool</code>, <code dir="auto">option_int</code>, <code dir="auto">option_str</code>, <code dir="auto">option_list</code>, <code dir="auto">option_is_set</code>, <code dir="auto">semantics</code>, <code dir="auto">source</code>, <code dir="auto">tokens</code>, <code dir="auto">file</code>, <code dir="auto">line_index</code>, <code dir="auto">path</code>, <code dir="auto">tab_width</code>, <code dir="auto">line_text</code>, <code dir="auto">touches_string</code>, <code dir="auto">comments</code></td>
|
||||
<td><code dir="auto">new</code>, <code dir="auto">from_parse</code>, <code dir="auto">with_tab_width</code>, <code dir="auto">with_line_length</code>, <code dir="auto">with_options</code>, <code dir="auto">with_semantics</code>, <code dir="auto">with_oracle</code>, <code dir="auto">mentioned_elsewhere</code>, <code dir="auto">has_oracle</code>, <code dir="auto">module_interface</code>, <code dir="auto">package_exports</code>, <code dir="auto">parsed_cleanly</code>, <code dir="auto">line_length</code>, <code dir="auto">options</code>, <code dir="auto">option_bool</code>, <code dir="auto">option_int</code>, <code dir="auto">option_str</code>, <code dir="auto">option_list</code>, <code dir="auto">option_is_set</code>, <code dir="auto">semantics</code>, <code dir="auto">source</code>, <code dir="auto">tokens</code>, <code dir="auto">file</code>, <code dir="auto">line_index</code>, <code dir="auto">path</code>, <code dir="auto">tab_width</code>, <code dir="auto">line_text</code>, <code dir="auto">touches_string</code>, <code dir="auto">comments</code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code dir="auto">MentionOracle</code></td>
|
||||
<td>Supply <code dir="auto">mentioned_outside</code> and optional <code dir="auto">module_interface</code> for project-aware checks</td>
|
||||
<td>Supply <code dir="auto">mentioned_outside</code> and optional <code dir="auto">module_interface</code> / <code dir="auto">package_exports</code> for project-aware checks</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code dir="auto">Violation</code></td>
|
||||
@@ -459,7 +461,7 @@ The CLI and server configure their worker threads accordingly.</p>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td><code dir="auto">WorkspaceIndex</code></td>
|
||||
<td><code dir="auto">build</code>, <code dir="auto">files</code>, <code dir="auto">path</code>, <code dir="auto">file_id</code>, <code dir="auto">units</code>, <code dir="auto">member</code>, <code dir="auto">members_of</code>, <code dir="auto">members_of_chain</code>, <code dir="auto">member_unit</code>, <code dir="auto">instantiations_of</code>, <code dir="auto">subclasses_of</code>, <code dir="auto">base_of</code>, <code dir="auto">instantiations</code>, <code dir="auto">subclasses</code>, <code dir="auto">facts_for</code>, <code dir="auto">defines</code>, <code dir="auto">find_define</code>, <code dir="auto">references_to</code>, <code dir="auto">references_are_ambiguous</code>, <code dir="auto">files_spelling</code>, <code dir="auto">files_mentioning</code>, <code dir="auto">files_naming_in_macros</code>, <code dir="auto">mentioned_outside</code>, <code dir="auto">workspace_symbols</code>, <code dir="auto">units_of</code>, <code dir="auto">instantiable_units</code>, <code dir="auto">counts</code>, <code dir="auto">update_file</code>, <code dir="auto">update_facts</code>, <code dir="auto">absorb</code>, <code dir="auto">remove_file</code>, <code dir="auto">fingerprint</code></td>
|
||||
<td><code dir="auto">build</code>, <code dir="auto">files</code>, <code dir="auto">path</code>, <code dir="auto">file_id</code>, <code dir="auto">units</code>, <code dir="auto">member</code>, <code dir="auto">members_of</code>, <code dir="auto">members_of_chain</code>, <code dir="auto">member_unit</code>, <code dir="auto">member_in</code>, <code dir="auto">hierarchical_declarations</code>, <code dir="auto">members_of_chain_in</code>, <code dir="auto">member_unit_in</code>, <code dir="auto">instantiations_of</code>, <code dir="auto">subclasses_of</code>, <code dir="auto">base_of</code>, <code dir="auto">instantiations</code>, <code dir="auto">subclasses</code>, <code dir="auto">facts_for</code>, <code dir="auto">defines</code>, <code dir="auto">find_define</code>, <code dir="auto">references_to</code>, <code dir="auto">references_are_ambiguous</code>, <code dir="auto">files_spelling</code>, <code dir="auto">files_mentioning</code>, <code dir="auto">files_naming_in_macros</code>, <code dir="auto">mentioned_outside</code>, <code dir="auto">workspace_symbols</code>, <code dir="auto">units_of</code>, <code dir="auto">instantiable_units</code>, <code dir="auto">counts</code>, <code dir="auto">update_file</code>, <code dir="auto">update_facts</code>, <code dir="auto">absorb</code>, <code dir="auto">remove_file</code>, <code dir="auto">fingerprint</code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code dir="auto">IndexBuilder</code></td>
|
||||
@@ -495,10 +497,40 @@ The CLI and server configure their worker threads accordingly.</p>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<p><code dir="auto">FACTS_FORMAT</code> is <strong>18</strong> in the committed snapshot. Cached facts include
|
||||
normal/macro identifier censuses and package re-export edges (the <code dir="auto">RX</code> group); <code dir="auto">Def::lines.positions</code> can carry <code dir="auto">DeclPositions</code> with UTF-16 ranges
|
||||
<p><code dir="auto">Surface::{Connection, Hierarchical}</code> selects the existing interface view or
|
||||
the wider instance-tail view. Hierarchical reads add nets, variables and nested
|
||||
instances without making them legal named port connections.</p>
|
||||
<p><code dir="auto">FACTS_FORMAT</code> is <strong>19</strong> in this snapshot. Cached facts include
|
||||
normal/macro identifier censuses, package re-export edges (the <code dir="auto">RX</code> group),
|
||||
and declaration/reference surface tags; <code dir="auto">Def::lines.positions</code> can carry <code dir="auto">DeclPositions</code> with UTF-16 ranges
|
||||
for file-scope declarations. Any persisted shape or fact-census change needs
|
||||
a codec-version decision so stale caches cannot silently omit answers.</p>
|
||||
<div class="sl-heading-wrapper level-h3"><h3 id="import-usage">Import usage</h3><a class="sl-anchor-link" href="#import-usage"><span aria-hidden="true" class="sl-anchor-icon"><svg width="16" height="16" viewBox="0 0 24 24" fill="currentColor"><path d="m12.11 15.39-3.88 3.88a2.52 2.52 0 0 1-3.5 0 2.47 2.47 0 0 1 0-3.5l3.88-3.88a1 1 0 1 0-1.42-1.42l-3.88 3.89a4.48 4.48 0 0 0 6.33 6.33l3.89-3.88a1 1 0 0 0-1.42-1.42m8.58-12.08a4.49 4.49 0 0 0-6.33 0l-3.89 3.88a1 1 0 1 0 1.42 1.42l3.88-3.88a2.52 2.52 0 0 1 3.5 0 2.47 2.47 0 0 1 0 3.5l-3.88 3.88a1 1 0 0 0 0 1.42 1 1 0 0 0 1.42 0l3.88-3.89a4.49 4.49 0 0 0 0-6.33M8.83 15.17a1 1 0 0 0 .71.29 1 1 0 0 0 .71-.29l4.92-4.92a1 1 0 1 0-1.42-1.42l-4.92 4.92a1 1 0 0 0 0 1.42"></path></svg></span><span class="sr-only" data-pagefind-ignore>Section titled “Import usage”</span></a></div>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Function or type</th>
|
||||
<th>Purpose</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td><code dir="auto">import_usage</code>, <code dir="auto">import_scopes</code>, <code dir="auto">unused_imports</code></td>
|
||||
<td>Shared scope-aware usage analysis consumed by organize-imports and the linter</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code dir="auto">PackageExports</code> / <code dir="auto">Exports</code></td>
|
||||
<td>Package-member oracle and its known/unknown result; implemented by <code dir="auto">WorkspaceIndex</code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code dir="auto">ImportUse</code>, <code dir="auto">ImportScope</code>, <code dir="auto">UnusedImport</code></td>
|
||||
<td>Usage evidence, scope inputs and unused-import findings</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<p>These names are exported both from <code dir="auto">vlog_semantic::imports</code> and the crate root.
|
||||
Package exports count as use; unresolved or macro-hidden uses keep removal
|
||||
conservative.</p>
|
||||
<div class="sl-heading-wrapper level-h2"><h2 id="vlog_refactor"><code dir="auto">vlog_refactor</code></h2><a class="sl-anchor-link" href="#vlog_refactor"><span aria-hidden="true" class="sl-anchor-icon"><svg width="16" height="16" viewBox="0 0 24 24" fill="currentColor"><path d="m12.11 15.39-3.88 3.88a2.52 2.52 0 0 1-3.5 0 2.47 2.47 0 0 1 0-3.5l3.88-3.88a1 1 0 1 0-1.42-1.42l-3.88 3.89a4.48 4.48 0 0 0 6.33 6.33l3.89-3.88a1 1 0 0 0-1.42-1.42m8.58-12.08a4.49 4.49 0 0 0-6.33 0l-3.89 3.88a1 1 0 1 0 1.42 1.42l3.88-3.88a2.52 2.52 0 0 1 3.5 0 2.47 2.47 0 0 1 0 3.5l-3.88 3.88a1 1 0 0 0 0 1.42 1 1 0 0 0 1.42 0l3.88-3.89a4.49 4.49 0 0 0 0-6.33M8.83 15.17a1 1 0 0 0 .71.29 1 1 0 0 0 .71-.29l4.92-4.92a1 1 0 1 0-1.42-1.42l-4.92 4.92a1 1 0 0 0 0 1.42"></path></svg></span><span class="sr-only" data-pagefind-ignore>Section titled “vlog_refactor”</span></a></div>
|
||||
<div class="sl-heading-wrapper level-h3"><h3 id="rename-and-references">Rename and references</h3><a class="sl-anchor-link" href="#rename-and-references"><span aria-hidden="true" class="sl-anchor-icon"><svg width="16" height="16" viewBox="0 0 24 24" fill="currentColor"><path d="m12.11 15.39-3.88 3.88a2.52 2.52 0 0 1-3.5 0 2.47 2.47 0 0 1 0-3.5l3.88-3.88a1 1 0 1 0-1.42-1.42l-3.88 3.89a4.48 4.48 0 0 0 6.33 6.33l3.89-3.88a1 1 0 0 0-1.42-1.42m8.58-12.08a4.49 4.49 0 0 0-6.33 0l-3.89 3.88a1 1 0 1 0 1.42 1.42l3.88-3.88a2.52 2.52 0 0 1 3.5 0 2.47 2.47 0 0 1 0 3.5l-3.88 3.88a1 1 0 0 0 0 1.42 1 1 0 0 0 1.42 0l3.88-3.89a4.49 4.49 0 0 0 0-6.33M8.83 15.17a1 1 0 0 0 .71.29 1 1 0 0 0 .71-.29l4.92-4.92a1 1 0 1 0-1.42-1.42l-4.92 4.92a1 1 0 0 0 0 1.42"></path></svg></span><span class="sr-only" data-pagefind-ignore>Section titled “Rename and references”</span></a></div>
|
||||
<table>
|
||||
@@ -541,6 +573,14 @@ a codec-version decision so stale caches cannot silently omit answers.</p>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td><code dir="auto">expand_wildcard</code></td>
|
||||
<td>Replace <code dir="auto">.*</code> with named connections and warnings for unmatched ports</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code dir="auto">convert_to_ansi</code></td>
|
||||
<td>Merge a non-ANSI header and body port declarations</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code dir="auto">add_port</code></td>
|
||||
<td>Add a port to a module interface</td>
|
||||
</tr>
|
||||
@@ -593,11 +633,51 @@ a codec-version decision so stale caches cannot silently omit answers.</p>
|
||||
<td><code dir="auto">instance_name</code>, <code dir="auto">has_escaped_identifier</code>, <code dir="auto">render</code>, <code dir="auto">render_with</code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code dir="auto">WorkspaceEdit</code></td>
|
||||
<td><code dir="auto">file_count</code>, <code dir="auto">edit_count</code>, <code dir="auto">edits_for</code></td>
|
||||
<td><code dir="auto">RefactorEdit</code></td>
|
||||
<td><code dir="auto">file_count</code>, <code dir="auto">edit_count</code>, <code dir="auto">edits_for</code>; fields <code dir="auto">edits</code>, <code dir="auto">warnings</code>, <code dir="auto">created</code></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="sl-heading-wrapper level-h3"><h3 id="imports-and-module-transformations">Imports and module transformations</h3><a class="sl-anchor-link" href="#imports-and-module-transformations"><span aria-hidden="true" class="sl-anchor-icon"><svg width="16" height="16" viewBox="0 0 24 24" fill="currentColor"><path d="m12.11 15.39-3.88 3.88a2.52 2.52 0 0 1-3.5 0 2.47 2.47 0 0 1 0-3.5l3.88-3.88a1 1 0 1 0-1.42-1.42l-3.88 3.89a4.48 4.48 0 0 0 6.33 6.33l3.89-3.88a1 1 0 0 0-1.42-1.42m8.58-12.08a4.49 4.49 0 0 0-6.33 0l-3.89 3.88a1 1 0 1 0 1.42 1.42l3.88-3.88a2.52 2.52 0 0 1 3.5 0 2.47 2.47 0 0 1 0 3.5l-3.88 3.88a1 1 0 0 0 0 1.42 1 1 0 0 0 1.42 0l3.88-3.89a4.49 4.49 0 0 0 0-6.33M8.83 15.17a1 1 0 0 0 .71.29 1 1 0 0 0 .71-.29l4.92-4.92a1 1 0 1 0-1.42-1.42l-4.92 4.92a1 1 0 0 0 0 1.42"></path></svg></span><span class="sr-only" data-pagefind-ignore>Section titled “Imports and module transformations”</span></a></div>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Function or type</th>
|
||||
<th>Purpose</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td><code dir="auto">organize_imports</code></td>
|
||||
<td>Remove unused imports, merge duplicates and sort a scope’s initial import run</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code dir="auto">organize_counts</code>, <code dir="auto">organize_title</code>, <code dir="auto">imported_packages</code>, <code dir="auto">unused_imports</code></td>
|
||||
<td>Action preflight, labels, package source selection and unused-import ranges</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code dir="auto">extract_site</code>, <code dir="auto">extract_title</code>, <code dir="auto">extract_module</code></td>
|
||||
<td>Preflight selected module items, label the action and plan extraction</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code dir="auto">ExtractSite</code>, <code dir="auto">Home</code></td>
|
||||
<td>Extraction source requirements and destination choice</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code dir="auto">inline_site</code>, <code dir="auto">inline_title</code>, <code dir="auto">inline_module</code></td>
|
||||
<td>Preflight an instance, label the action and plan body substitution</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code dir="auto">InlineSite</code></td>
|
||||
<td>Instance/module identities used to gather inline inputs</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<p>Apply a <code dir="auto">RefactorEdit</code> as one complete operation. Each path in <code dir="auto">created</code> also
|
||||
has one offset-zero insertion in <code dir="auto">edits</code>; create those files before applying
|
||||
text edits. Engines do no I/O. Callers must supply every file needed for edits
|
||||
and refusal checks; current inline source-selection and verifier limits are
|
||||
recorded in the repository topology, handshakes 32–33.</p>
|
||||
<div class="sl-heading-wrapper level-h2"><h2 id="lucisv_core"><code dir="auto">lucisv_core</code></h2><a class="sl-anchor-link" href="#lucisv_core"><span aria-hidden="true" class="sl-anchor-icon"><svg width="16" height="16" viewBox="0 0 24 24" fill="currentColor"><path d="m12.11 15.39-3.88 3.88a2.52 2.52 0 0 1-3.5 0 2.47 2.47 0 0 1 0-3.5l3.88-3.88a1 1 0 1 0-1.42-1.42l-3.88 3.89a4.48 4.48 0 0 0 6.33 6.33l3.89-3.88a1 1 0 0 0-1.42-1.42m8.58-12.08a4.49 4.49 0 0 0-6.33 0l-3.89 3.88a1 1 0 1 0 1.42 1.42l3.88-3.88a2.52 2.52 0 0 1 3.5 0 2.47 2.47 0 0 1 0 3.5l-3.88 3.88a1 1 0 0 0 0 1.42 1 1 0 0 0 1.42 0l3.88-3.89a4.49 4.49 0 0 0 0-6.33M8.83 15.17a1 1 0 0 0 .71.29 1 1 0 0 0 .71-.29l4.92-4.92a1 1 0 1 0-1.42-1.42l-4.92 4.92a1 1 0 0 0 0 1.42"></path></svg></span><span class="sr-only" data-pagefind-ignore>Section titled “lucisv_core”</span></a></div>
|
||||
<div class="sl-heading-wrapper level-h3"><h3 id="project-inputs">Project inputs</h3><a class="sl-anchor-link" href="#project-inputs"><span aria-hidden="true" class="sl-anchor-icon"><svg width="16" height="16" viewBox="0 0 24 24" fill="currentColor"><path d="m12.11 15.39-3.88 3.88a2.52 2.52 0 0 1-3.5 0 2.47 2.47 0 0 1 0-3.5l3.88-3.88a1 1 0 1 0-1.42-1.42l-3.88 3.89a4.48 4.48 0 0 0 6.33 6.33l3.89-3.88a1 1 0 0 0-1.42-1.42m8.58-12.08a4.49 4.49 0 0 0-6.33 0l-3.89 3.88a1 1 0 1 0 1.42 1.42l3.88-3.88a2.52 2.52 0 0 1 3.5 0 2.47 2.47 0 0 1 0 3.5l-3.88 3.88a1 1 0 0 0 0 1.42 1 1 0 0 0 1.42 0l3.88-3.89a4.49 4.49 0 0 0 0-6.33M8.83 15.17a1 1 0 0 0 .71.29 1 1 0 0 0 .71-.29l4.92-4.92a1 1 0 1 0-1.42-1.42l-4.92 4.92a1 1 0 0 0 0 1.42"></path></svg></span><span class="sr-only" data-pagefind-ignore>Section titled “Project inputs”</span></a></div>
|
||||
<table>
|
||||
|
||||
+14
-3
@@ -72,9 +72,10 @@
|
||||
StarlightThemeProvider.updatePickers();
|
||||
</script></div></div></div></div></nav><div class="main-frame astro-gqpr5s5a"><script type="module">var e=document.getElementById(`starlight__sidebar`),t=e?.querySelector(`sl-sidebar-state-persist`),n=`sl-sidebar-state`,r=()=>{let r=[],i=t?.dataset.hash||``;try{let e=sessionStorage.getItem(n),t=JSON.parse(e||`{}`);Array.isArray(t.open)&&t.hash===i&&(r=t.open)}catch{}return{hash:i,open:r,scroll:e?.scrollTop||0}},i=e=>{try{sessionStorage.setItem(n,JSON.stringify(e))}catch{}},a=()=>i(r()),o=(e,t)=>{let n=r();n.open[t]=e,i(n)};t?.addEventListener(`click`,e=>{if(!(e.target instanceof Element))return;let t=e.target.closest(`summary`)?.closest(`details`);if(!t)return;let n=t.querySelector(`sl-sidebar-restore`),r=parseInt(n?.dataset.index||``);isNaN(r)||o(!t.open,r)}),addEventListener(`visibilitychange`,()=>{document.visibilityState===`hidden`&&a()});</script><div class="lg:sl-flex astro-abfeecmu"><aside class="right-sidebar-container print:hidden astro-abfeecmu"><div class="right-sidebar astro-abfeecmu"><div class="lg:sl-hidden astro-q5mffni3"><mobile-starlight-toc data-min-h="2" data-max-h="3" class="astro-5ulgm6bh"><nav aria-labelledby="starlight__on-this-page--mobile" class="astro-5ulgm6bh"><details id="starlight__mobile-toc" class="astro-5ulgm6bh"><summary id="starlight__on-this-page--mobile" class="sl-flex astro-5ulgm6bh"><span class="toggle sl-flex astro-5ulgm6bh">On this page<svg aria-hidden="true" class="caret astro-5ulgm6bh astro-n5k4ipy7" width="16" height="16" viewBox="0 0 24 24" fill="currentColor" style="--sl-icon-size: 1rem;"><path d="m14.83 11.29-4.24-4.24a1 1 0 1 0-1.42 1.41L12.71 12l-3.54 3.54a1 1 0 0 0 0 1.41 1 1 0 0 0 .71.29 1 1 0 0 0 .71-.29l4.24-4.24a1.002 1.002 0 0 0 0-1.42Z"/></svg></span><span class="display-current astro-5ulgm6bh"></span></summary><div class="dropdown astro-5ulgm6bh"><ul class="isMobile astro-cxyftcne" style="--depth: 0;"><li style="--depth: 0;" class="astro-cxyftcne"><a href="#_top" style="--depth: 0;" class="astro-cxyftcne"><span style="--depth: 0;" class="astro-cxyftcne">Overview</span></a></li><li style="--depth: 0;" class="astro-cxyftcne"><a href="#keys" style="--depth: 0;" class="astro-cxyftcne"><span style="--depth: 0;" class="astro-cxyftcne">Keys</span></a></li><li style="--depth: 0;" class="astro-cxyftcne"><a href="#discovery" style="--depth: 0;" class="astro-cxyftcne"><span style="--depth: 0;" class="astro-cxyftcne">Discovery</span></a></li><li style="--depth: 0;" class="astro-cxyftcne"><a href="#strict-parsing" style="--depth: 0;" class="astro-cxyftcne"><span style="--depth: 0;" class="astro-cxyftcne">Strict parsing</span></a></li><li style="--depth: 0;" class="astro-cxyftcne"><a href="#editor-settings" style="--depth: 0;" class="astro-cxyftcne"><span style="--depth: 0;" class="astro-cxyftcne">Editor settings</span></a></li><li style="--depth: 0;" class="astro-cxyftcne"><a href="#cache" style="--depth: 0;" class="astro-cxyftcne"><span style="--depth: 0;" class="astro-cxyftcne">Cache</span></a></li></ul></div></details></nav></mobile-starlight-toc><script type="module" src="/_astro/MobileTableOfContents.astro_astro_type_script_index_0_lang.BcSo_yiZ.js"></script></div><div class="right-sidebar-panel sl-hidden lg:sl-block astro-q5mffni3"><div class="sl-container astro-q5mffni3"><starlight-toc data-min-h="2" data-max-h="3"><nav aria-labelledby="starlight__on-this-page"><h2 id="starlight__on-this-page">On this page</h2><ul class="astro-cxyftcne" style="--depth: 0;"><li style="--depth: 0;" class="astro-cxyftcne"><a href="#_top" style="--depth: 0;" class="astro-cxyftcne"><span style="--depth: 0;" class="astro-cxyftcne">Overview</span></a></li><li style="--depth: 0;" class="astro-cxyftcne"><a href="#keys" style="--depth: 0;" class="astro-cxyftcne"><span style="--depth: 0;" class="astro-cxyftcne">Keys</span></a></li><li style="--depth: 0;" class="astro-cxyftcne"><a href="#discovery" style="--depth: 0;" class="astro-cxyftcne"><span style="--depth: 0;" class="astro-cxyftcne">Discovery</span></a></li><li style="--depth: 0;" class="astro-cxyftcne"><a href="#strict-parsing" style="--depth: 0;" class="astro-cxyftcne"><span style="--depth: 0;" class="astro-cxyftcne">Strict parsing</span></a></li><li style="--depth: 0;" class="astro-cxyftcne"><a href="#editor-settings" style="--depth: 0;" class="astro-cxyftcne"><span style="--depth: 0;" class="astro-cxyftcne">Editor settings</span></a></li><li style="--depth: 0;" class="astro-cxyftcne"><a href="#cache" style="--depth: 0;" class="astro-cxyftcne"><span style="--depth: 0;" class="astro-cxyftcne">Cache</span></a></li></ul></nav></starlight-toc><script type="module" src="/_astro/TableOfContents.astro_astro_type_script_index_0_lang.Csloo1VZ.js"></script></div></div></div></aside><div class="main-pane astro-abfeecmu"><main data-pagefind-body class="astro-vdxcvpsm" lang="en" dir="ltr"><div class="content-panel astro-oil7k7jf"><div class="sl-container astro-oil7k7jf"><h1 id="_top" class="astro-2sm4b3ln">Configuration</h1></div></div><diLine truncated
|
||||
<div class="expressive-code"><link rel="stylesheet" href="/_astro/ec.w36nc.css"><script type="module" src="/_astro/ec.0vx5m.js"></script><figure class="frame has-title not-content"><figcaption class="header"><span class="title">lucisv.toml</span></figcaption><pre data-language="toml"><code><div class="ec-line"><div class="code"><span style="--0:#C5E478;--1:#3B61B0">line-length</span><span style="--0:#D6DEEB;--1:#403F53"> = </span><span style="--0:#F78C6C;--1:#AA0982">100</span></div></div><div class="ec-line"><div class="code"><span style="--0:#C5E478;--1:#3B61B0">indent</span><span style="--0:#D6DEEB;--1:#403F53"> = </span><span style="--0:#F78C6C;--1:#AA0982">2</span></div></div><div class="ec-line"><div class="code"><span style="--0:#C5E478;--1:#3B61B0">exclude</span><span style="--0:#D6DEEB;--1:#403F53"> = [</span><span style="--0:#D9F5DD;--1:#111111">"</span><span style="--0:#ECC48D;--1:#984E4D">*_gen.sv</span><span style="--0:#D9F5DD;--1:#111111">"</span><span style="--0:#D6DEEB;--1:#403F53">, </span><span style="--0:#D9F5DD;--1:#111111">"</span><span style="--0:#ECC48D;--1:#984E4D">build</span><span style="--0:#D9F5DD;--1:#111111">"</span><span style="--0:#D6DEEB;--1:#403F53">]</span></div></div><div class="ec-line"><div class="code"><span style="--0:#C5E478;--1:#3B61B0">filelist</span><span style="--0:#D6DEEB;--1:#403F53"> = </span><span style="--0:#D9F5DD;--1:#111111">"</span><span style="--0:#ECC48D;--1:#984E4D">rtl/files.f</span><span style="--0:#D9F5DD;--1:#111111">"</span></div></div><div class="ec-line"><div class="code">
|
||||
</div></div><div class="ec-line"><div class="code"><span style="--0:#D6DEEB;--1:#403F53">[format]</span></div></div><div class="ec-line"><div class="code"><span style="--0:#C5E478;--1:#3B61B0">uvm-utils-indent</span><span style="--0:#D6DEEB;--1:#403F53"> = </span><span style="--0:#FF6A83;--1:#A24848">false</span></div></div><div class="ec-line"><div class="code">
|
||||
</div></div><div class="ec-line"><div class="code"><span style="--0:#D6DEEB;--1:#403F53">[lint]</span></div></div><div class="ec-line"><div class="code"><span style="--0:#C5E478;--1:#3B61B0">select</span><span style="--0:#D6DEEB;--1:#403F53"> = [</span><span style="--0:#D9F5DD;--1:#111111">"</span><span style="--0:#ECC48D;--1:#984E4D">no-tabs</span><span style="--0:#D9F5DD;--1:#111111">"</span><span style="--0:#D6DEEB;--1:#403F53">, </span><span style="--0:#D9F5DD;--1:#111111">"</span><span style="--0:#ECC48D;--1:#984E4D">unused-signal</span><span style="--0:#D9F5DD;--1:#111111">"</span><span style="--0:#D6DEEB;--1:#403F53">]</span></div></div><div class="ec-line"><div class="code"><span style="--0:#C5E478;--1:#3B61B0">ignore</span><span style="--0:#D6DEEB;--1:#403F53"> = [</span><span style="--0:#D9F5DD;--1:#111111">"</span><span style="--0:#ECC48D;--1:#984E4D">module-filename</span><span style="--0:#D9F5DD;--1:#111111">"</span><span style="--0:#D6DEEB;--1:#403F53">]</span></div></div><div class="ec-line"><div class="code">
|
||||
</div></div><div class="ec-line"><div class="code"><span style="--0:#D6DEEB;--1:#403F53">[lint.line-length]</span></div></div><div class="ec-line"><div class="code"><span style="--0:#C5E478;--1:#3B61B0">length</span><span style="--0:#D6DEEB;--1:#403F53"> = </span><span style="--0:#F78C6C;--1:#AA0982">120</span></div></div><div class="ec-line"><div class="code">
|
||||
</div></div><div class="ec-line"><div class="code"><span style="--0:#D6DEEB;--1:#403F53">[lint.signal-name-style]</span></div></div><div class="ec-line"><div class="code"><span style="--0:#C5E478;--1:#3B61B0">style_regex</span><span style="--0:#D6DEEB;--1:#403F53"> = </span><span style="--0:#D9F5DD;--1:#111111">"</span><span style="--0:#ECC48D;--1:#984E4D">[a-z_0-9]+</span><span style="--0:#D9F5DD;--1:#111111">"</span></div></div></code></pre><div class="copy"><div aria-live="polite"></div><button title="Copy to clipboard" data-copied="Copied!" data-code="line-length = 100indent = 2exclude = ["*_gen.sv", "build"]filelist = "rtl/files.f"[lint]select = ["no-tabs", "unused-signal"]ignore = ["module-filename"][lint.line-length]length = 120[lint.signal-name-style]style_regex = "[a-z_0-9]+""><div></div></button></div></figure></div>
|
||||
</div></div><div class="ec-line"><div class="code"><span style="--0:#D6DEEB;--1:#403F53">[lint.signal-name-style]</span></div></div><div class="ec-line"><div class="code"><span style="--0:#C5E478;--1:#3B61B0">style_regex</span><span style="--0:#D6DEEB;--1:#403F53"> = </span><span style="--0:#D9F5DD;--1:#111111">"</span><span style="--0:#ECC48D;--1:#984E4D">[a-z_0-9]+</span><span style="--0:#D9F5DD;--1:#111111">"</span></div></div></code></pre><div class="copy"><div aria-live="polite"></div><button title="Copy to clipboard" data-copied="Copied!" data-code="line-length = 100indent = 2exclude = ["*_gen.sv", "build"]filelist = "rtl/files.f"[format]uvm-utils-indent = false[lint]select = ["no-tabs", "unused-signal"]ignore = ["module-filename"][lint.line-length]length = 120[lint.signal-name-style]style_regex = "[a-z_0-9]+""><div></div></button></div></figure></div>
|
||||
<div class="sl-heading-wrapper level-h2"><h2 id="keys">Keys</h2><a class="sl-anchor-link" href="#keys"><span aria-hidden="true" class="sl-anchor-icon"><svg width="16" height="16" viewBox="0 0 24 24" fill="currentColor"><path d="m12.11 15.39-3.88 3.88a2.52 2.52 0 0 1-3.5 0 2.47 2.47 0 0 1 0-3.5l3.88-3.88a1 1 0 1 0-1.42-1.42l-3.88 3.89a4.48 4.48 0 0 0 6.33 6.33l3.89-3.88a1 1 0 0 0-1.42-1.42m8.58-12.08a4.49 4.49 0 0 0-6.33 0l-3.89 3.88a1 1 0 1 0 1.42 1.42l3.88-3.88a2.52 2.52 0 0 1 3.5 0 2.47 2.47 0 0 1 0 3.5l-3.88 3.88a1 1 0 0 0 0 1.42 1 1 0 0 0 1.42 0l3.88-3.89a4.49 4.49 0 0 0 0-6.33M8.83 15.17a1 1 0 0 0 .71.29 1 1 0 0 0 .71-.29l4.92-4.92a1 1 0 1 0-1.42-1.42l-4.92 4.92a1 1 0 0 0 0 1.42"></path></svg></span><span class="sr-only" data-pagefind-ignore>Section titled “Keys”</span></a></div>
|
||||
<table>
|
||||
<thead>
|
||||
@@ -160,7 +161,7 @@ not enable a rule that is off by default.</p>
|
||||
</ol>
|
||||
<p>The first file wins; configuration files are never merged. CLI options override file values per setting. Exclusions are the exception: configuration and CLI patterns are combined.</p>
|
||||
<div class="sl-heading-wrapper level-h2"><h2 id="strict-parsing">Strict parsing</h2><a class="sl-anchor-link" href="#strict-parsing"><span aria-hidden="true" class="sl-anchor-icon"><svg width="16" height="16" viewBox="0 0 24 24" fill="currentColor"><path d="m12.11 15.39-3.88 3.88a2.52 2.52 0 0 1-3.5 0 2.47 2.47 0 0 1 0-3.5l3.88-3.88a1 1 0 1 0-1.42-1.42l-3.88 3.89a4.48 4.48 0 0 0 6.33 6.33l3.89-3.88a1 1 0 0 0-1.42-1.42m8.58-12.08a4.49 4.49 0 0 0-6.33 0l-3.89 3.88a1 1 0 1 0 1.42 1.42l3.88-3.88a2.52 2.52 0 0 1 3.5 0 2.47 2.47 0 0 1 0 3.5l-3.88 3.88a1 1 0 0 0 0 1.42 1 1 0 0 0 1.42 0l3.88-3.89a4.49 4.49 0 0 0 0-6.33M8.83 15.17a1 1 0 0 0 .71.29 1 1 0 0 0 .71-.29l4.92-4.92a1 1 0 1 0-1.42-1.42l-4.92 4.92a1 1 0 0 0 0 1.42"></path></svg></span><span class="sr-only" data-pagefind-ignore>Section titled “Strict parsing”</span></a></div>
|
||||
<p>Unknown keys, out-of-range numbers, invalid values, tables other than <code dir="auto">[lint]</code> and <code dir="auto">[lint.<rule>]</code>, and multiline arrays are rejected. This is a deliberate TOML subset. Top-level strings reject backslashes; per-rule strings retain backslashes literally for the pattern dialect and reject embedded quotes. They do not decode TOML string escapes. A bad configuration is an error for the CLI, preventing partial writes. In an editor, the server reports the problem and falls back to the next available setting.</p>
|
||||
<p>Unknown keys, out-of-range numbers, invalid values, tables other than <code dir="auto">[format]</code>, <code dir="auto">[lint]</code> and <code dir="auto">[lint.<rule>]</code>, and multiline arrays are rejected. This is a deliberate TOML subset. Top-level strings reject backslashes; per-rule strings retain backslashes literally for the pattern dialect and reject embedded quotes. They do not decode TOML string escapes. A bad configuration is an error for the CLI, preventing partial writes. In an editor, the server reports the problem and falls back to the next available setting.</p>
|
||||
<div class="sl-heading-wrapper level-h2"><h2 id="editor-settings">Editor settings</h2><a class="sl-anchor-link" href="#editor-settings"><span aria-hidden="true" class="sl-anchor-icon"><svg width="16" height="16" viewBox="0 0 24 24" fill="currentColor"><path d="m12.11 15.39-3.88 3.88a2.52 2.52 0 0 1-3.5 0 2.47 2.47 0 0 1 0-3.5l3.88-3.88a1 1 0 1 0-1.42-1.42l-3.88 3.89a4.48 4.48 0 0 0 6.33 6.33l3.89-3.88a1 1 0 0 0-1.42-1.42m8.58-12.08a4.49 4.49 0 0 0-6.33 0l-3.89 3.88a1 1 0 1 0 1.42 1.42l3.88-3.88a2.52 2.52 0 0 1 3.5 0 2.47 2.47 0 0 1 0 3.5l-3.88 3.88a1 1 0 0 0 0 1.42 1 1 0 0 0 1.42 0l3.88-3.89a4.49 4.49 0 0 0 0-6.33M8.83 15.17a1 1 0 0 0 .71.29 1 1 0 0 0 .71-.29l4.92-4.92a1 1 0 1 0-1.42-1.42l-4.92 4.92a1 1 0 0 0 0 1.42"></path></svg></span><span class="sr-only" data-pagefind-ignore>Section titled “Editor settings”</span></a></div>
|
||||
<table>
|
||||
<thead>
|
||||
@@ -222,6 +223,11 @@ not enable a rule that is off by default.</p>
|
||||
<td>Extra workspace index exclusions</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code dir="auto">lucisv.hierarchy.duts</code></td>
|
||||
<td style="text-align: right"><code dir="auto">[]</code></td>
|
||||
<td>DUT module names in the VS Code hierarchy; union with saved workspace stars, locked in the menu</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code dir="auto">lucisv.filelist</code></td>
|
||||
<td style="text-align: right"><code dir="auto">""</code></td>
|
||||
<td>Filelist that defines the workspace index</td>
|
||||
@@ -315,4 +321,9 @@ re-arms logging for newly introduced mistakes. An empty editor selection is
|
||||
the fallback sentinel, so it does not clear a non-empty project selection.</p>
|
||||
<div class="sl-heading-wrapper level-h2"><h2 id="cache">Cache</h2><a class="sl-anchor-link" href="#cache"><span aria-hidden="true" class="sl-anchor-icon"><svg width="16" height="16" viewBox="0 0 24 24" fill="currentColor"><path d="m12.11 15.39-3.88 3.88a2.52 2.52 0 0 1-3.5 0 2.47 2.47 0 0 1 0-3.5l3.88-3.88a1 1 0 1 0-1.42-1.42l-3.88 3.89a4.48 4.48 0 0 0 6.33 6.33l3.89-3.88a1 1 0 0 0-1.42-1.42m8.58-12.08a4.49 4.49 0 0 0-6.33 0l-3.89 3.88a1 1 0 1 0 1.42 1.42l3.88-3.88a2.52 2.52 0 0 1 3.5 0 2.47 2.47 0 0 1 0 3.5l-3.88 3.88a1 1 0 0 0 0 1.42 1 1 0 0 0 1.42 0l3.88-3.89a4.49 4.49 0 0 0 0-6.33M8.83 15.17a1 1 0 0 0 .71.29 1 1 0 0 0 .71-.29l4.92-4.92a1 1 0 1 0-1.42-1.42l-4.92 4.92a1 1 0 0 0 0 1.42"></path></svg></span><span class="sr-only" data-pagefind-ignore>Section titled “Cache”</span></a></div>
|
||||
<p>Successful “already formatted” verdicts are cached under <code dir="auto">.lucisv_cache/</code>. Entries are keyed by file, content hash, line length, indentation, and lucisv version. Files that would change or fail are never cached. Use <code dir="auto">--no-cache</code> to disable reads and writes or <code dir="auto">--cache-dir</code> to relocate the store.</p>
|
||||
</div><footer class="sl-flex astro-xhxjzfa7"><div class="meta sl-flex astro-xhxjzfa7"><a href="https://git.luci.ooo/lucio/verilogrustformatter/src/branch/master/docs/site/src/content/docs/start/configuration.md" class="sl-flex print:hidden astro-xk5gmzsg"><svg aria-hidden="true" class="astro-xk5gmzsg astro-n5k4ipy7" width="16" height="16" viewBox="0 0 24 24" fill="currentColor" style="--sl-icon-size: 1.2em;"><path d="M22 7.24a1 1 0 0 0-.29-.71l-4.24-4.24a1 1 0 0 0-1.1-.22 1 1 0 0 0-.32.22l-2.83 2.83L2.29 16.05a1 1 0 0 0-.29.71V21a1 1 0 0 0 1 1h4.24a1 1 0 0 0 .76-.29l10.87-10.93L21.71 8c.1-.1.17-.2.22-.33a1 1 0 0 0 0-.24v-.14l.07-.05ZM6.83 20H4v-2.83l9.93-9.93 2.83 2.83L6.83 20ZM18.17 8.66l-2.83-2.83 1.42-1.41 2.82 2.82-1.41 1.42Z"/></svg>Edit page</a><p>Last updated: <time datetime="2026-09-05T18:35:57.000Z">Sep 5, 2026</time></p></div><div class="pagination-links print:hidden astro-jgq3vlii" dir="ltr"><a href="/start/quick-start/" rel="prev" class="astro-jgq3vlii"><svg aria-hidden="true" class="astro-jgq3vlii astro-n5k4ipy7" width="16" height="16" viewBox="0 0 24 24" fill="currentColor" style="--sl-icon-size: 1.5rem;"><path d="M17 11H9.41l3.3-3.29a1.004 1.004 0 1 0-1.42-1.42l-5 5a1 1 0 0 0-.21.33 1 1 0 0 0 0 .76 1 1 0 0 0 .21.33l5 5a1.002 1.002 0 0 0 1.639-.325 1 1 0 0 0-.219-1.095L9.41 13H17a1 1 0 0 0 0-2Z"/></svg><span class="astro-jgq3vlii">Previous<br class="astro-jgq3vlii"><span class="link-title astro-jgq3vlii">Quick start</span></span></a><a href="/guides/formatter/" rel="next" class="astro-jgq3vlii"><svg aria-hidden="true" class="astro-jgq3vlii astro-n5k4ipy7" width="16" height="16" viewBox="0 0 24 24" fill="currentColor" style="--sl-icon-size: 1.5rem;"><path d="M17.92 11.62a1.001 1.001 0 0 0-.21-.33l-5-5a1.003 1.003 0 1 0-1.42 1.42l3.3 3.29H7a1 1 0 0 0 0 2h7.59l-3.3 3.29a1.002 1.002 0 0 0 .325 1.639 1 1 0 0 0 1.095-.219l5-5a1 1 0 0 0 .21-.33 1 1 0 0 0 0-.76Z"/></svg><span class="astro-jgq3vlii">Next<br class="astro-jgq3vlii"><span class="link-title astro-jgq3vlii">Formatter</span></span></a></div></footer></div></div></main></div></div></div></div></body></html>
|
||||
<p>In <strong>v0.49.0</strong>, the cache key omits <code dir="auto">uvm-utils-indent</code>. Changing that option
|
||||
alone can reuse an incorrect clean verdict, including in <code dir="auto">--check</code> mode.
|
||||
After toggling it, use <code dir="auto">--no-cache</code> or delete <code dir="auto">.lucisv_cache/</code> (or your custom
|
||||
cache directory) before formatting or checking again. Editor formatting does
|
||||
not use this CLI format cache.</p>
|
||||
</div><footer class="sl-flex astro-xhxjzfa7"><div class="meta sl-flex astro-xhxjzfa7"><a href="https://git.luci.ooo/lucio/verilogrustformatter/src/branch/master/docs/site/src/content/docs/start/configuration.md" class="sl-flex print:hidden astro-xk5gmzsg"><svg aria-hidden="true" class="astro-xk5gmzsg astro-n5k4ipy7" width="16" height="16" viewBox="0 0 24 24" fill="currentColor" style="--sl-icon-size: 1.2em;"><path d="M22 7.24a1 1 0 0 0-.29-.71l-4.24-4.24a1 1 0 0 0-1.1-.22 1 1 0 0 0-.32.22l-2.83 2.83L2.29 16.05a1 1 0 0 0-.29.71V21a1 1 0 0 0 1 1h4.24a1 1 0 0 0 .76-.29l10.87-10.93L21.71 8c.1-.1.17-.2.22-.33a1 1 0 0 0 0-.24v-.14l.07-.05ZM6.83 20H4v-2.83l9.93-9.93 2.83 2.83L6.83 20ZM18.17 8.66l-2.83-2.83 1.42-1.41 2.82 2.82-1.41 1.42Z"/></svg>Edit page</a><p>Last updated: <time datetime="2026-09-07T06:12:49.000Z">Sep 7, 2026</time></p></div><div class="pagination-links print:hidden astro-jgq3vlii" dir="ltr"><a href="/start/quick-start/" rel="prev" class="astro-jgq3vlii"><svg aria-hidden="true" class="astro-jgq3vlii astro-n5k4ipy7" width="16" height="16" viewBox="0 0 24 24" fill="currentColor" style="--sl-icon-size: 1.5rem;"><path d="M17 11H9.41l3.3-3.29a1.004 1.004 0 1 0-1.42-1.42l-5 5a1 1 0 0 0-.21.33 1 1 0 0 0 0 .76 1 1 0 0 0 .21.33l5 5a1.002 1.002 0 0 0 1.639-.325 1 1 0 0 0-.219-1.095L9.41 13H17a1 1 0 0 0 0-2Z"/></svg><span class="astro-jgq3vlii">Previous<br class="astro-jgq3vlii"><span class="link-title astro-jgq3vlii">Quick start</span></span></a><a href="/guides/formatter/" rel="next" class="astro-jgq3vlii"><svg aria-hidden="true" class="astro-jgq3vlii astro-n5k4ipy7" width="16" height="16" viewBox="0 0 24 24" fill="currentColor" style="--sl-icon-size: 1.5rem;"><path d="M17.92 11.62a1.001 1.001 0 0 0-.21-.33l-5-5a1.003 1.003 0 1 0-1.42 1.42l3.3 3.29H7a1 1 0 0 0 0 2h7.59l-3.3 3.29a1.002 1.002 0 0 0 .325 1.639 1 1 0 0 0 1.095-.219l5-5a1 1 0 0 0 .21-.33 1 1 0 0 0 0-.76Z"/></svg><span class="astro-jgq3vlii">Next<br class="astro-jgq3vlii"><span class="link-title astro-jgq3vlii">Formatter</span></span></a></div></footer></div></div></main></div></div></div></div></body></html>
|
||||
@@ -14,6 +14,24 @@ lucisv uses a Wadler/Prettier-style document model. Breakable constructs render
|
||||
- At most one preserved blank line between adjacent items.
|
||||
- Compiler directives, attributes, and supported verbatim constructs keep their source text.
|
||||
|
||||
## UVM utilities indentation
|
||||
|
||||
To indent field macros inside UVM utilities blocks one additional level:
|
||||
|
||||
```toml
|
||||
[format]
|
||||
uvm-utils-indent = true
|
||||
```
|
||||
|
||||
This v0.49.0 option is off by default. It applies to `uvm_field_*` macros
|
||||
between `uvm_*_utils_begin` and `uvm_*_utils_end`. In editors,
|
||||
`lucisv.format.uvmUtilsIndent` is the fallback; project configuration wins.
|
||||
Short, comment-free enum bodies already fit on one line without another key.
|
||||
|
||||
After toggling this option, run the CLI with `--no-cache` or remove its format
|
||||
cache: v0.49.0 does not include this option in the cache key. See
|
||||
[configuration](/start/configuration/#cache).
|
||||
|
||||
## Alignment is inferred
|
||||
|
||||
lucisv recognizes existing columnar intent in adjacent ANSI ports, named connections, and parameter declarations. If a group is already aligned—or uses four or more spaces where one would suffice—it is normalized as a table. Flush-left input stays flush-left.
|
||||
|
||||
@@ -35,12 +35,18 @@ fence-blind; callers performing automatic edits must apply that protection.
|
||||
|
||||
Use `[lint.<rule>]` in `lucisv.toml` or `lucisv.lint.options` in the editor for
|
||||
per-rule options. See [configuration](/start/configuration/) for precedence.
|
||||
`lucisv check --rules-doc` prints all 73 registered rules, their severity,
|
||||
`lucisv check --rules-doc` prints all 74 registered rules, their severity,
|
||||
default selection, fix applicability, and option defaults.
|
||||
|
||||
Text output uses `FILE:LINE:COL: severity: message [rule]`. JSON output is one
|
||||
array, with a `severity` field on each diagnostic.
|
||||
|
||||
`unused-import` is a Style rule, off by default even in a project. Enable it
|
||||
explicitly to report unused module/package/class imports using the same
|
||||
analysis as Organize Imports. It stays silent without package facts and
|
||||
preserves uncertain macro or inherited uses. A finding on an import with a
|
||||
comment has no automatic deletion fix.
|
||||
|
||||
## Waivers
|
||||
|
||||
```system-verilog
|
||||
|
||||
@@ -9,7 +9,7 @@ lucisv targets Verilog-2001 and the common synthesizable SystemVerilog subset, p
|
||||
|
||||
- Modules, interfaces, programs, packages, classes, interface classes, generate regions, and nested classes.
|
||||
- ANSI and non-ANSI ports, parameter ports, header imports, `timeunit`, `genvar`, and `defparam`.
|
||||
- Net and variable declarations, signing, packed and unpacked dimensions, and net delays.
|
||||
- Net and variable declarations, signing, packed and unpacked dimensions, net delays, and net drive strengths.
|
||||
- `typedef` aliases, enums, packed structs/unions, forward class declarations, anonymous aggregate types, and type parameters.
|
||||
- Virtual interfaces, parameterized class types, properties, methods, constructors, prototypes, and out-of-body method definitions.
|
||||
- Functions and tasks in ANSI and legacy forms, DPI imports/exports, and package re-exports.
|
||||
@@ -19,7 +19,8 @@ lucisv targets Verilog-2001 and the common synthesizable SystemVerilog subset, p
|
||||
- `assign`, `always`, `always_comb`, `always_ff`, `always_latch`, `initial`, and `final`.
|
||||
- Blocks, conditionals, every `case` kind, loops, `foreach`, `fork/join*`, waits, timing controls, events, `force`/`release`, and jump statements.
|
||||
- Immediate and concurrent assertions, sequences, properties, `expect`, `cover sequence`, and `default disable iff`. Property and sequence expressions use their LRM precedence and participate in formatting and semantic tools.
|
||||
- `randomize() with`, `randcase`, `let`, statement labels, array iterator methods, and omitted positional arguments.
|
||||
- `randomize() with`, `randcase`, real `randsequence` productions, statement-level `let`, statement labels, array iterator methods, and omitted positional arguments.
|
||||
- Nonblocking `->>` event triggers with optional timing and min:typ:max clocking skews.
|
||||
- Constraint blocks and randomization constraint bodies, including `soft`, `dist`, implication, `foreach`, and `solve before`.
|
||||
- Covergroups with coverpoints, bins, transitions, crosses, `with`, and `iff` expressions.
|
||||
|
||||
@@ -33,7 +34,7 @@ lucisv targets Verilog-2001 and the common synthesizable SystemVerilog subset, p
|
||||
|
||||
## Expressions
|
||||
|
||||
- Full operator precedence, ternaries, concatenation and replication, slices, streaming concatenations, casts, and assignment patterns.
|
||||
- Full operator precedence, ternaries, concatenation and replication, slices, streaming concatenations with `with [range]`, constant-expression and packed-type cast bases, and assignment patterns.
|
||||
- Hierarchical and package-scoped names, named call arguments, array methods, `inside`, and all supported `new` forms.
|
||||
- Dynamic arrays, queues, associative arrays, empty literals, and `$`-bound indexing.
|
||||
- Macro invocations in expression, statement, and item position; macro digits in based numbers.
|
||||
@@ -44,7 +45,7 @@ Some constructs are recognized structurally but emitted with their internal sour
|
||||
|
||||
## Not supported
|
||||
|
||||
A small set of rare expression/port forms remains outside the formatter grammar. lucisv also does not run a preprocessor, so a file that becomes valid only after cross-file macro expansion may not format as a standalone input.
|
||||
Parser acceptance does not imply full elaboration or semantic navigation: generate-block-scoped hierarchical paths and DPI-export name binding remain gaps. lucisv also does not run a preprocessor, so a file that becomes valid only after cross-file macro expansion may not format as a standalone input.
|
||||
|
||||
:::caution[Safe failure]
|
||||
Whole-file formatting returns an error and writes nothing when parsing is incomplete. lucisv never emits a partially understood file.
|
||||
|
||||
@@ -11,8 +11,8 @@ lucisv follows the same separation of concerns that makes ruff fast and maintain
|
||||
| `vlog_formatter` | document IR, width-aware printer, formatting rules, fences, ranges, verification | CLI and language server |
|
||||
| `vlog_linter` | rule registry, diagnostics, fixes, waiver engine | CLI and language server |
|
||||
| `vlog_semantic` | scopes, symbols, references, workspace units, external resolution | linter, refactors, language server |
|
||||
| `vlog_refactor` | rename, references, port propagation, instantiation planning | language server |
|
||||
| `lucisv_core` | configuration, filelists, walking, exclusions, cache, atomic replacement | CLI and language server |
|
||||
| `vlog_refactor` | rename/references, ports, imports, extract/inline module, instantiation planning | language server |
|
||||
| `lucisv_core` | configuration, filelists, walking, exclusions, cache, atomic replacement | CLI, language server, linter waiver matching |
|
||||
| `lucisv` | argument parsing, parallel per-file processing, reports, write orchestration | command-line users and CI |
|
||||
| `lucisv_server` | LSP transport, overlays, indexing, capabilities, editor settings | all LSP clients |
|
||||
|
||||
@@ -39,22 +39,24 @@ lucisv follows the same separation of concerns that makes ruff fast and maintain
|
||||
also protect statement scopes, and verification covers the complete output.
|
||||
- **Lint:** `ParsedSource` bundles one tokenization and tolerant parse;
|
||||
`LintContext` supplies source facts and lazy semantics. The registry selects
|
||||
73 rules with severities and validated options. Inline and external waivers filter findings,
|
||||
74 rules with severities and validated options. Inline and external waivers filter findings,
|
||||
and the front ends protect fenced bytes before applying fixes.
|
||||
- **Refactor:** parsed spans and resolved references produce an edit plan;
|
||||
the engine checks the whole candidate edit before returning it. Server source
|
||||
selectors bound the input set but must include every file the engine might
|
||||
edit or refuse over. No formatter dependency is involved.
|
||||
edit or refuse over. The formatter is a test-only dependency of this engine.
|
||||
- **Editor:** one ordered synchronous loop owns `Workspace`; open documents
|
||||
overlay disk facts. Scans publish index/include/completion batches together.
|
||||
Committed closed-file facts persist under codec 18, including package re-exports; a bounded file-view cache serves
|
||||
Closed-file facts persist under codec 19, including package re-exports and
|
||||
tagged connection/hierarchical surfaces; a bounded file-view cache serves
|
||||
queries that still need source text. Lazy port actions defer the edit until
|
||||
selection; recorded file-scope definition positions avoid a closed-file read.
|
||||
|
||||
`vlog_parser` and `lucisv_core` depend on no other crates. Formatting and
|
||||
semantics each depend on the parser; linting and refactoring depend on parser
|
||||
and semantics. The CLI composes core, parser, formatter, and linter; the server
|
||||
composes all six libraries. The linter's formatter dependency is test-only.
|
||||
and semantics. Linting also consumes core’s exclusion matcher for waiver
|
||||
locations. The CLI composes core, parser, formatter, and linter; the server
|
||||
composes all six libraries. Both linter and refactor use the formatter only in tests.
|
||||
External dependencies are confined to the CLI worker pool (`rayon`) and the
|
||||
server's synchronous LSP/JSON stack.
|
||||
|
||||
@@ -72,12 +74,26 @@ overrides. The v0.44.0 `undriven-net` fix asks the workspace mention census only
|
||||
after local guards, reducing editor open/flush latency without changing the
|
||||
rule's findings or the synchronous request-ordering contract.
|
||||
|
||||
Two accepted changes are committed after v0.44.0: type names now carry exact
|
||||
AST spans (`scan.rs` is retired), and package re-exports are references and
|
||||
cycle-guarded member edges in codec 18. Re-exporting a name does not import it
|
||||
into the exporting package's local scope. DPI-export names remain unbound.
|
||||
The separate hierarchical-tail work proposes codec 19 and a module member
|
||||
surface for instance paths; it is still under QA and is not a released API.
|
||||
v0.45.0 shipped exact type-name spans (`scan.rs` is retired), package
|
||||
re-exports and hierarchical tails, with facts codec **19**. Re-exporting a
|
||||
name does not import it into the package’s local scope. Instance paths reach
|
||||
internal nets, variables and nested instances through a separate surface;
|
||||
existing connection queries keep their interface view. Generate-scoped
|
||||
hierarchical paths and DPI-export name binding remain gaps.
|
||||
|
||||
v0.46–0.49 added wildcard expansion, ANSI conversion, organize-imports,
|
||||
extract-module and inline-module. Import usage lives in semantic `imports.rs`,
|
||||
shared by the refactor and `unused-import` lint rule. Refactor `check/ledger.rs`
|
||||
tracks protected comment/attribute pieces across moves and copies;
|
||||
`RefactorEdit::created` carries new-file operations to the server. The inline
|
||||
source selector still has a known gap for hierarchical uses through
|
||||
intermediate modules; see the [refactoring limits](/reference/language-tools/#refactoring).
|
||||
|
||||
The DUT hierarchy is client-only over the existing server snapshot.
|
||||
v0.49.0 also adds real `randsequence` nodes and opt-in UVM indentation, whose
|
||||
CLI cache limitation is documented under [configuration](/start/configuration/#cache).
|
||||
This page reflects committed `df4e714`; Loop 2 is closed, with `state.rs`
|
||||
decomposition deferred to Loop 3.
|
||||
|
||||
## Design invariants
|
||||
|
||||
|
||||
@@ -68,13 +68,30 @@ index scope when the defining module lives outside the default folder scope.
|
||||
|---|---|---|
|
||||
| Prepare rename | `textDocument/prepareRename` | Verifies the target and returns its editable range |
|
||||
| Rename | `textDocument/rename` | Renames local or workspace-resolved symbols |
|
||||
| Port actions | code actions / commands | Adds, removes, and propagates module ports; expands a `.*` wildcard into the named connections it stands for (a port with no same-named signal in scope becomes `.p()` and is named in a warning) — `lucisv.expandWildcard`; converts a Verilog-2001 header to ANSI, each body declaration merged into the port it described (IEEE 1800 §23.2.2.2) with its comments carried along — `lucisv.convertToAnsi` |
|
||||
| Port actions | code actions / commands | Adds, removes, and propagates module ports |
|
||||
| Expand wildcard | code action / `lucisv.expandWildcard` | Expands `.*` in declaration order; a port with no same-named signal becomes `.p()` and is named in a warning |
|
||||
| Convert ports to ANSI | code action / `lucisv.convertToAnsi` | Merges a legacy header with its body port declarations, preserving comments and attributes |
|
||||
| Organize imports | code action (`source.organizeImports`) / command | Removes the `import pkg::*;` lines nothing in the scope reaches through, merges exact duplicates and sorts the run at the top of a module, package or class; refuses rather than guesses wherever a macro, a conditional directive, an unknown package or a base class in another file could hide a use — `lucisv.organizeImports` |
|
||||
| Extract module | code action (`refactor.extract`) / command | Select whole module items and name the module: ports and parameters inferred from what the selection reads and drives, `import`s carried across, the items moved byte for byte, the replacing instantiation rendered from the new module's own text; a new file where the editor can create one, below the source module otherwise. Refuses with a sentence wherever a direction cannot be known — `lucisv.extractModule` |
|
||||
| Inline module | code action (`refactor.inline`) / `lucisv.inlineModule` | Copies a separate-file module body into the selected instance site, substitutes named connections and parameter values, and renames internal identifiers on collision |
|
||||
| Instantiate module | inline completion / `lucisv.instantiate` | Builds an instance from an indexed module interface, including in clients without ghost text |
|
||||
| Apply workspace edit | `workspace/applyEdit` | Delivers multi-file refactor changes to the client |
|
||||
| Show definition | `window/showDocument` | Opens a generated or resolved target after an action |
|
||||
|
||||
Inline-module accepts simple named connections to names or literals; it
|
||||
refuses `.*`, positional/expression or unconnected ports, output-to-literal
|
||||
connections, unsupported port types, generate, initial/final and
|
||||
macro/directive bodies. A hierarchical use found in its inputs also refuses
|
||||
the action. There is a known source-selection gap for uses through an
|
||||
intermediate module: a bench referencing `wrap.u_S.x` can be omitted when
|
||||
inlining `S`. Review those uses before applying the edit.
|
||||
|
||||
The VS Code hierarchy also supports **Star as DUT**, **Unstar DUT** and
|
||||
**Clear DUTs**. Each DUT gets children and parents sections, followed by Other
|
||||
Modules. `lucisv.hierarchy.duts` unions team-configured names with workspace
|
||||
stars; configured names are locked in the menu. This view consumes the
|
||||
unchanged `lucisv/moduleHierarchy` snapshot; it adds no server protocol.
|
||||
|
||||
## Semantic presentation
|
||||
|
||||
| Tool | Protocol method | What it does |
|
||||
|
||||
@@ -7,9 +7,8 @@ description: Navigational index of the main public APIs in lucisv’s reusable R
|
||||
|
||||
This is a navigational API index, not source documentation. It summarizes the main public callable surface of the six reusable library crates in the workspace; command-line and language-server binaries are documented in their dedicated references.
|
||||
|
||||
The latest release is v0.44.0. This index includes the accepted type-name-span
|
||||
and package-re-export additions committed at `9ef1058` for the next release;
|
||||
it excludes the in-progress hierarchical-tail API and codec 19. For the complete signatures and fields,
|
||||
This index reflects **v0.49.0**, reviewed at committed `df4e714`, including
|
||||
hierarchical member surfaces, import usage and module refactorings. For the complete signatures and fields,
|
||||
run `cargo doc --workspace --no-deps`; this hand-maintained index is not an
|
||||
exhaustive replacement for rustdoc. The parser's strict and tolerant entry
|
||||
points share one grammar; tolerant errors do not imply formatter acceptance.
|
||||
@@ -68,6 +67,10 @@ The CLI and server configure their worker threads accordingly.
|
||||
| `verify_equivalence` | Re-lex and compare normalized tokens, including comments |
|
||||
| `verify_convergence` | Confirm a second formatting pass is identical |
|
||||
|
||||
`Config` exposes `max_width`, `indent_width`, and `uvm_utils_indent` (default
|
||||
`false`, new in v0.49.0). Exhaustive struct literals must include the new field;
|
||||
`Config { max_width: 120, ..Config::default() }` keeps the other defaults.
|
||||
|
||||
### Document model and printer
|
||||
|
||||
| Function | Purpose |
|
||||
@@ -111,8 +114,8 @@ The CLI and server configure their worker threads accordingly.
|
||||
| Type | Public surface |
|
||||
|---|---|
|
||||
| `ParsedSource` | `parse`, `lex_error`, `tokens`, `file`, `context` |
|
||||
| `LintContext` | `new`, `from_parse`, `with_tab_width`, `with_line_length`, `with_options`, `with_semantics`, `with_oracle`, `mentioned_elsewhere`, `has_oracle`, `module_interface`, `parsed_cleanly`, `line_length`, `options`, `option_bool`, `option_int`, `option_str`, `option_list`, `option_is_set`, `semantics`, `source`, `tokens`, `file`, `line_index`, `path`, `tab_width`, `line_text`, `touches_string`, `comments` |
|
||||
| `MentionOracle` | Supply `mentioned_outside` and optional `module_interface` for project-aware checks |
|
||||
| `LintContext` | `new`, `from_parse`, `with_tab_width`, `with_line_length`, `with_options`, `with_semantics`, `with_oracle`, `mentioned_elsewhere`, `has_oracle`, `module_interface`, `package_exports`, `parsed_cleanly`, `line_length`, `options`, `option_bool`, `option_int`, `option_str`, `option_list`, `option_is_set`, `semantics`, `source`, `tokens`, `file`, `line_index`, `path`, `tab_width`, `line_text`, `touches_string`, `comments` |
|
||||
| `MentionOracle` | Supply `mentioned_outside` and optional `module_interface` / `package_exports` for project-aware checks |
|
||||
| `Violation` | `new`, `with_fix` |
|
||||
| `Fix` | `safe`, `unsafe_fix` |
|
||||
| `Applicability` | `as_str` |
|
||||
@@ -140,7 +143,7 @@ The CLI and server configure their worker threads accordingly.
|
||||
|
||||
| Function or type | Public methods |
|
||||
|---|---|
|
||||
| `WorkspaceIndex` | `build`, `files`, `path`, `file_id`, `units`, `member`, `members_of`, `members_of_chain`, `member_unit`, `instantiations_of`, `subclasses_of`, `base_of`, `instantiations`, `subclasses`, `facts_for`, `defines`, `find_define`, `references_to`, `references_are_ambiguous`, `files_spelling`, `files_mentioning`, `files_naming_in_macros`, `mentioned_outside`, `workspace_symbols`, `units_of`, `instantiable_units`, `counts`, `update_file`, `update_facts`, `absorb`, `remove_file`, `fingerprint` |
|
||||
| `WorkspaceIndex` | `build`, `files`, `path`, `file_id`, `units`, `member`, `members_of`, `members_of_chain`, `member_unit`, `member_in`, `hierarchical_declarations`, `members_of_chain_in`, `member_unit_in`, `instantiations_of`, `subclasses_of`, `base_of`, `instantiations`, `subclasses`, `facts_for`, `defines`, `find_define`, `references_to`, `references_are_ambiguous`, `files_spelling`, `files_mentioning`, `files_naming_in_macros`, `mentioned_outside`, `workspace_symbols`, `units_of`, `instantiable_units`, `counts`, `update_file`, `update_facts`, `absorb`, `remove_file`, `fingerprint` |
|
||||
| `IndexBuilder` | `new`, `add_file`, `add_facts`, `finish` |
|
||||
| `FileFacts` | `of`, `from_analysis`, `words`, `macro_words`, `path`, `encode`, `decode` |
|
||||
| `DefinitionKey` | `of` |
|
||||
@@ -150,11 +153,28 @@ The CLI and server configure their worker threads accordingly.
|
||||
| `index_order` | Sort workspace inputs into their deterministic index order |
|
||||
| `words::harvest` / `harvest_text` / `harvest_raw` | Build the shared identifier census from tokens or source text |
|
||||
|
||||
`FACTS_FORMAT` is **18** in the committed snapshot. Cached facts include
|
||||
normal/macro identifier censuses and package re-export edges (the `RX` group); `Def::lines.positions` can carry `DeclPositions` with UTF-16 ranges
|
||||
`Surface::{Connection, Hierarchical}` selects the existing interface view or
|
||||
the wider instance-tail view. Hierarchical reads add nets, variables and nested
|
||||
instances without making them legal named port connections.
|
||||
|
||||
`FACTS_FORMAT` is **19** in this snapshot. Cached facts include
|
||||
normal/macro identifier censuses, package re-export edges (the `RX` group),
|
||||
and declaration/reference surface tags; `Def::lines.positions` can carry `DeclPositions` with UTF-16 ranges
|
||||
for file-scope declarations. Any persisted shape or fact-census change needs
|
||||
a codec-version decision so stale caches cannot silently omit answers.
|
||||
|
||||
### Import usage
|
||||
|
||||
| Function or type | Purpose |
|
||||
|---|---|
|
||||
| `import_usage`, `import_scopes`, `unused_imports` | Shared scope-aware usage analysis consumed by organize-imports and the linter |
|
||||
| `PackageExports` / `Exports` | Package-member oracle and its known/unknown result; implemented by `WorkspaceIndex` |
|
||||
| `ImportUse`, `ImportScope`, `UnusedImport` | Usage evidence, scope inputs and unused-import findings |
|
||||
|
||||
These names are exported both from `vlog_semantic::imports` and the crate root.
|
||||
Package exports count as use; unresolved or macro-hidden uses keep removal
|
||||
conservative.
|
||||
|
||||
## `vlog_refactor`
|
||||
|
||||
### Rename and references
|
||||
@@ -171,6 +191,8 @@ a codec-version decision so stale caches cannot silently omit answers.
|
||||
|
||||
| Function or type | Public methods |
|
||||
|---|---|
|
||||
| `expand_wildcard` | Replace `.*` with named connections and warnings for unmatched ports |
|
||||
| `convert_to_ansi` | Merge a non-ANSI header and body port declarations |
|
||||
| `add_port` | Add a port to a module interface |
|
||||
| `remove_port` | Remove a port from a module interface |
|
||||
| `propagate_ports` | Carry interface changes through instantiations |
|
||||
@@ -184,7 +206,24 @@ a codec-version decision so stale caches cannot silently omit answers.
|
||||
| `instantiation_plan` | Build an instantiation plan from an indexed module |
|
||||
| `PortAction` | `label` |
|
||||
| `InstantiationPlan` | `instance_name`, `has_escaped_identifier`, `render`, `render_with` |
|
||||
| `WorkspaceEdit` | `file_count`, `edit_count`, `edits_for` |
|
||||
| `RefactorEdit` | `file_count`, `edit_count`, `edits_for`; fields `edits`, `warnings`, `created` |
|
||||
|
||||
### Imports and module transformations
|
||||
|
||||
| Function or type | Purpose |
|
||||
|---|---|
|
||||
| `organize_imports` | Remove unused imports, merge duplicates and sort a scope’s initial import run |
|
||||
| `organize_counts`, `organize_title`, `imported_packages`, `unused_imports` | Action preflight, labels, package source selection and unused-import ranges |
|
||||
| `extract_site`, `extract_title`, `extract_module` | Preflight selected module items, label the action and plan extraction |
|
||||
| `ExtractSite`, `Home` | Extraction source requirements and destination choice |
|
||||
| `inline_site`, `inline_title`, `inline_module` | Preflight an instance, label the action and plan body substitution |
|
||||
| `InlineSite` | Instance/module identities used to gather inline inputs |
|
||||
|
||||
Apply a `RefactorEdit` as one complete operation. Each path in `created` also
|
||||
has one offset-zero insertion in `edits`; create those files before applying
|
||||
text edits. Engines do no I/O. Callers must supply every file needed for edits
|
||||
and refusal checks; current inline source-selection and verifier limits are
|
||||
recorded in the repository topology, handshakes 32–33.
|
||||
|
||||
## `lucisv_core`
|
||||
|
||||
|
||||
@@ -11,6 +11,9 @@ indent = 2
|
||||
exclude = ["*_gen.sv", "build"]
|
||||
filelist = "rtl/files.f"
|
||||
|
||||
[format]
|
||||
uvm-utils-indent = false
|
||||
|
||||
[lint]
|
||||
select = ["no-tabs", "unused-signal"]
|
||||
ignore = ["module-filename"]
|
||||
@@ -55,7 +58,7 @@ The first file wins; configuration files are never merged. CLI options override
|
||||
|
||||
## Strict parsing
|
||||
|
||||
Unknown keys, out-of-range numbers, invalid values, tables other than `[lint]` and `[lint.<rule>]`, and multiline arrays are rejected. This is a deliberate TOML subset. Top-level strings reject backslashes; per-rule strings retain backslashes literally for the pattern dialect and reject embedded quotes. They do not decode TOML string escapes. A bad configuration is an error for the CLI, preventing partial writes. In an editor, the server reports the problem and falls back to the next available setting.
|
||||
Unknown keys, out-of-range numbers, invalid values, tables other than `[format]`, `[lint]` and `[lint.<rule>]`, and multiline arrays are rejected. This is a deliberate TOML subset. Top-level strings reject backslashes; per-rule strings retain backslashes literally for the pattern dialect and reject embedded quotes. They do not decode TOML string escapes. A bad configuration is an error for the CLI, preventing partial writes. In an editor, the server reports the problem and falls back to the next available setting.
|
||||
|
||||
## Editor settings
|
||||
|
||||
@@ -71,6 +74,7 @@ Unknown keys, out-of-range numbers, invalid values, tables other than `[lint]` a
|
||||
| `lucisv.lineLength` | `null` | Editor fallback for maximum width |
|
||||
| `lucisv.indent` | `null` | Editor fallback for indentation |
|
||||
| `lucisv.exclude` | `[]` | Extra workspace index exclusions |
|
||||
| `lucisv.hierarchy.duts` | `[]` | DUT module names in the VS Code hierarchy; union with saved workspace stars, locked in the menu |
|
||||
| `lucisv.filelist` | `""` | Filelist that defines the workspace index |
|
||||
| `lucisv.index.scope` | `folder` | Index the configured folder or widen to the workspace |
|
||||
| `lucisv.index.scopeDepth` | `2` | Parent-directory depth used by folder-scope indexing |
|
||||
@@ -111,3 +115,9 @@ the fallback sentinel, so it does not clear a non-empty project selection.
|
||||
## Cache
|
||||
|
||||
Successful “already formatted” verdicts are cached under `.lucisv_cache/`. Entries are keyed by file, content hash, line length, indentation, and lucisv version. Files that would change or fail are never cached. Use `--no-cache` to disable reads and writes or `--cache-dir` to relocate the store.
|
||||
|
||||
In **v0.49.0**, the cache key omits `uvm-utils-indent`. Changing that option
|
||||
alone can reuse an incorrect clean verdict, including in `--check` mode.
|
||||
After toggling it, use `--no-cache` or delete `.lucisv_cache/` (or your custom
|
||||
cache directory) before formatting or checking again. Editor formatting does
|
||||
not use this CLI format cache.
|
||||
+78
-47
@@ -24,20 +24,21 @@ null-items (108 feature READMEs); updated 2026-09-02 through v0.33.0 for the
|
||||
testbench grammar/semantics wave, comment slots, bind semantics, SVA bodies,
|
||||
and the four decomposition rounds (125 feature READMEs).
|
||||
|
||||
**Code audit refreshed 2026-09-05.** Latest release: **v0.44.0**
|
||||
(`66f3898`). Committed snapshot: **`9ef1058`**, including type-name-spans
|
||||
(TODO §47) and package-reexports (§48), both accepted for v0.45.0. The
|
||||
committed facts codec is **18**; the active **hierarchical-tail** work (§49)
|
||||
uses **19** in the working tree and is awaiting QA. Public contracts below
|
||||
describe committed code unless explicitly marked in progress. Do not treat
|
||||
the working-tree codec or an unchecked QA item as a released guarantee.
|
||||
**Code audit refreshed 2026-09-07.** Latest release: **v0.49.0**
|
||||
(`4c2dae3`); committed snapshot: **`df4e714`**, clean at review start.
|
||||
Type-name spans, package re-exports and hierarchical tails shipped in v0.45.0;
|
||||
the current facts codec is **19**. v0.46–0.49 added five refactorings,
|
||||
`unused-import` (74 rules), DUT hierarchy sections, real `randsequence` nodes,
|
||||
and opt-in UVM indentation. These are released contracts, not pending lanes.
|
||||
|
||||
The original audit's atomic-write, lint-config and walk-cycle findings are
|
||||
closed in v0.43.0. External waivers shipped in v0.42.0; walk warnings,
|
||||
inline aggregate overrides and the didOpen cost fix shipped in v0.44.0.
|
||||
See [repository-analysis.md](repository-analysis.md) for current priorities
|
||||
and dated verification evidence. Feature QA logs and TODO checkboxes remain
|
||||
the authority for work being completed by other agents.
|
||||
Loop 2 is closed. TODO §55 defers `state.rs` decomposition to Loop 3;
|
||||
§2.9 retains DPI-export binding (31), refactor-verifier relocation (32),
|
||||
transitive inline source selection (33), and older open requests. This audit
|
||||
adds the reproduced UVM-option cache omission (34). The September 4
|
||||
atomic-write, lint-config and walk-cycle findings remain closed in v0.43.0.
|
||||
See [repository-analysis.md](repository-analysis.md) for evidence and validation.
|
||||
Feature QA logs and TODO checkboxes remain the acceptance authority; remote
|
||||
artifact verification and manual editor acceptance were not repeated here.
|
||||
|
||||
**Edge notation, used in all three sections:**
|
||||
|
||||
@@ -72,6 +73,7 @@ graph TD
|
||||
S[vlog_semantic] --> P
|
||||
L[vlog_linter] --> P
|
||||
L --> S
|
||||
L --> C
|
||||
R[vlog_refactor] --> P
|
||||
R --> S
|
||||
CLI[lucisv (CLI)] --> C
|
||||
@@ -85,6 +87,7 @@ graph TD
|
||||
SRV --> F
|
||||
SRV --> L
|
||||
L -.dev-dep (fix harness).-> F
|
||||
R -.dev-dep (refactor acceptance).-> F
|
||||
VSC[editors/vscode] -.spawn contract.-> SRV
|
||||
VSC -.KEYWORDS grammar lock.-> P
|
||||
NVIM[editors/nvim (docs)] -.spawn contract.-> SRV
|
||||
@@ -118,9 +121,9 @@ what a change on the pointed-to side must not silently break.
|
||||
| `vlog_formatter ──▶ vlog_parser` | depends | `parse(tokens, source)` / `parse_source`, the whole AST, `tokenize` (re-used by `verify.rs` to re-lex both sides of the safety net), trivia attachment (`Meta::{leading,trailing,before_sep,attrs}` — comments are never dropped), `RawText.col` (the dedent column for verbatim re-indent), spans. The formatter is the AST's primary consumer: **every new `ItemKind`/`StmtKind`/`ExprKind` variant costs an arm in `format/`** (its matches are exhaustive). |
|
||||
| `vlog_semantic ──▶ vlog_parser` | depends | The AST read-only, `parse_source_tolerant`/`parse_tolerant` (never fails; `Error` nodes are opaque leaves), the **name-span contract** `src[name_span] == name` on every declaring node, `token::is_keyword`, `defines::collect_defines`/`DefineTable`, `TextRange`. `bind/`'s `ItemKind`/`ExprKind`/`DimKind` matches are exhaustive — new variants cost an arm here too. |
|
||||
| `vlog_linter ──▶ vlog_parser` | depends | `ParsedSource::parse` = `tokenize` + `parse_tolerant` (one-parse bundle), `LineIndex`, `TextRange`, AST shapes walked by `visit.rs` (which ends in `_ => {}`, so new variants usually cost nothing here), token facts for text rules (a macro use is one `Ident` token; a directive is one `Directive` token). |
|
||||
| `vlog_linter ──▶ vlog_semantic` | depends | `analyze`, `Semantics::{symbols, references, references_of}` for semantic rules, including signal usage and duplicate-declaration checks. `Semantics::duplicates()` was added by linter-expansion-1 without changing persisted facts. `LintContext::semantics()` computes analysis lazily when a rule asks for it. Justified in `vlog_linter/Cargo.toml`; adds no external code (`vlog_semantic` is `vlog_parser` + std). |
|
||||
| `vlog_linter ──▶ vlog_semantic` | depends | `analyze`, `Semantics::{symbols, references, references_of}` and shared `imports::{import_usage, unused_imports, PackageExports}` for semantic rules, including signal usage and duplicate-declaration checks. `Semantics::duplicates()` was added by linter-expansion-1 without changing persisted facts. `LintContext::semantics()` computes analysis lazily when a rule asks for it. Justified in `vlog_linter/Cargo.toml`; adds no external code (`vlog_semantic` is `vlog_parser` + std). |
|
||||
| `vlog_linter ──▶ lucisv_core` | depends | `walk::is_excluded`, the `--exclude` matcher, reused for a waiver file's `--location` so one pattern language serves the whole tool (waiver-files, §39, 2026-09-04). `lucisv_core` still depends on nothing, so no cycle. |
|
||||
| `vlog_linter ──▶ vlog_formatter` **(dev-only)** | depends (tests) | The `.lint` fix harness asserts a lint fix never produces text `format_source` refuses. **The library dependency list is still `vlog_parser` + `vlog_semantic` + std** — `cargo tree -p vlog_linter -e normal` is the pinned check. Do not promote this to a normal dep; the fence filter deliberately lives in the front ends instead (see shared-fence-filter, §2.4). |
|
||||
| `vlog_linter ──▶ vlog_formatter` **(dev-only)** | depends (tests) | The `.lint` fix harness asserts a lint fix never produces text `format_source` refuses. **The library dependency list is `vlog_parser` + `vlog_semantic` + `lucisv_core` + std** — `cargo tree -p vlog_linter -e normal` is the pinned check. Do not promote this to a normal dep; the fence filter deliberately lives in the front ends instead (see shared-fence-filter, §2.4). |
|
||||
| `vlog_refactor ──▶ vlog_formatter` **(dev-only)** | depends (tests) | expand-wildcard (§50, 2026-09-05): the acceptance tests format and converge what an expansion writes. No production edge. |
|
||||
| `vlog_refactor ──▶ vlog_semantic` (organize-imports) | depends | `imports::{import_usage, import_scopes, unused_imports, PackageExports, Exports}` — the one "is this import used" judgement, shared with the linter (§52, 2026-09-05). |
|
||||
| `vlog_linter ──▶ vlog_semantic` (organize-imports) | depends | the same `imports::*` judgement behind the `unused-import` rule; `MentionOracle::package_exports` is a new default method, so no implementor broke (§52). |
|
||||
@@ -128,7 +131,7 @@ what a change on the pointed-to side must not silently break.
|
||||
| `lucisv_server ◀── vlog_refactor` (extract-module) | depends | `RefactorEdit::created` — the files an edit creates, read by `lucisv_server::extract` to emit `CreateFile` document changes when `ClientAbilities::create_files` (read at `initialize`: `workspace.workspaceEdit.documentChanges` + `resourceOperations: create`) allows, else the same-file fallback (§53.1, 2026-09-06). |
|
||||
| `vlog_refactor ──▶ vlog_parser` | depends | `tokenize`, `parse_source_tolerant` + diagnostics, `LineIndex`, `TextRange`, the port/instantiation/module AST shapes, `token::is_keyword` (new-name validity), `defines` via the index. Every edit span originates in a parsed node — no textual search-and-replace. |
|
||||
| `vlog_refactor ──▶ vlog_semantic` | depends | `Semantics` queries (`symbol_at`, `references_of`, `reference_id_at`, …), `Resolution` variants (three of them are refusal rules), `WorkspaceIndex` + `resolve_external` + `ExternalTarget`, and the exactness promise on `name_span` (re-checked before each edit is emitted). One historical exception: refactor-rename added `Target::Declaration` + end-label uses *into* `vlog_semantic` (lead-authorized, additive — see §2.6). |
|
||||
| `lucisv ──▶ lucisv_core` | depends | `config::{FileConfig, Discovery}` (lucisv.toml discovery — `config::parse` is reached through `Discovery`, not called directly), `walk::{collect_files, EXTENSIONS}` (the `.gitignore`/`--exclude` walk), `filelist::read` (`-f`), `cache` (the format cache), `atomic::write_atomic` (formatter and lint-fix replacement). (`walk::is_excluded` is `pub` but currently has no consumer outside the crate.) |
|
||||
| `lucisv ──▶ lucisv_core` | depends | `config::{FileConfig, Discovery}` (lucisv.toml discovery — `config::parse` is reached through `Discovery`, not called directly), `walk::{collect_files, EXTENSIONS}` (the `.gitignore`/`--exclude` walk), `filelist::read` (`-f`), `cache` (the format cache), `atomic::write_atomic` (formatter and lint-fix replacement). (`walk::is_excluded` also supplies the linter’s external-waiver location matcher.) |
|
||||
| `lucisv ──▶ vlog_formatter` | depends | `format_source` / `format_range` / `LineRanges` / `Config` / `FormatError`, and `fence::{protected_regions, is_protected}` (the `--fix` fence filter — the linter crate deliberately has no fence notion). |
|
||||
| `lucisv ──▶ vlog_linter` | depends | The public linter API for `lucisv check` — `lint` + `LintContext`/`ParsedSource`, `apply_fixes`, `select_rules` (the CLI does not call `run` itself). Relies on: rule names stable, linting never panics/writes, findings sorted by `(span.start, span.end, rule)`. |
|
||||
| `lucisv ──▶ vlog_parser` | depends | `LineIndex` / `TextRange` for lint report coordinates, plus `PARSE_STACK_SIZE` for both the named `lucisv` thread and rayon workers. (The CLI otherwise reaches the parser through the formatter and linter.) |
|
||||
@@ -138,8 +141,8 @@ what a change on the pointed-to side must not silently break.
|
||||
| `lucisv_server ──▶ vlog_semantic` | depends | `analyze`/`Semantics` (every navigation answer), `WorkspaceIndex` (build/incremental update, units/members/defines, `instantiations_of`/`subclasses_of` edge tables, `FileFacts` codec for the persistent cache), `resolve_external` overlay, `index_order`/`IndexBuilder` (watched builds). |
|
||||
| `lucisv_server ◀──▶ vlog_semantic` | handshake | Two negotiated additions, both 2026-08-28 and both additive: **`Symbol::detail_span` / `Def::detail_span`** (where a non-ANSI port's body declaration completes the header that names it — the server's hover card and `nav::definition` both read it, and they show/jump to it in the same order), and **`Semantics::symbols_named`** (name → declarations, built in `analyze`, in declaration order — the server replaced two scan-every-symbol loops with it and the *first-match tie-break must stay declaration order* or hover's choice between two live declarations of one name changes). `docs/features/port-detail-spans/README.md`. |
|
||||
| `lucisv_server ◀──▶ vlog_semantic` | handshake | Three later additive performance surfaces: **`DeclLines` / `Def::lines`** record declaration and detail lines at index time (`FACTS_FORMAT` 3 → 4); **`WorkspaceIndex::absorb`** folds a scan batch with one merge rather than one merge per file; and **`WorkspaceIndex::files_spelling`** finds external uses by spelling, resolved or not, for rename's dangling-use refusal. The first feeds hover-line-index, the second scan-interleave, and the third refactor-rename's six-rung fan-out. Changing the facts codec, reference-fact census or merge semantics breaks those consumers. |
|
||||
| `lucisv_server ──▶ vlog_refactor` | depends | `prepare_rename`/`rename`, `find_references`, the port refactorings, `instantiation_plan`/`render_with`/`module_definition` (the inline instantiation ghost, signature help, inlay hints — the completion popup stopped consuming them 2026-08-30, names-only tier). Promise consumed: never a partial edit — `Ok` verified whole, `Err` is a sentence. |
|
||||
| `lucisv_server ◀──▶ vlog_refactor` | handshake | Request-scope selectors added for the performance wave: `prepare_rename_here` must produce the same answer/refusal text as whole-scope `prepare_rename`; `rename_name_at` must name the target that the rename engine acts on; `port_action_modules` and `enclosing_module` must name every module the corresponding port action/command can edit. The server uses those names only to choose an index-derived superset of files; the engine remains the authority. |
|
||||
| `lucisv_server ──▶ vlog_refactor` | depends | `prepare_rename`/`rename`, `find_references`, the port refactorings, `organize_imports`, `extract_module`, `inline_module`, `RefactorEdit::{edits,warnings,created}`, `instantiation_plan`/`render_with`/`module_definition` (the inline instantiation ghost, signature help, inlay hints — the completion popup stopped consuming them 2026-08-30, names-only tier). Promise consumed: never a partial edit — `Ok` verified whole, `Err` is a sentence. |
|
||||
| `lucisv_server ◀──▶ vlog_refactor` | handshake | Request-scope selectors added for the performance wave: `prepare_rename_here` must produce the same answer/refusal text as whole-scope `prepare_rename`; `rename_name_at` must name the target that the rename engine acts on; `port_action_modules` and `enclosing_module` must name every module the corresponding port action/command can edit. The server uses those names to choose an index-derived file set; `extract_site`, `inline_site` and `imported_packages` also name source requirements. The engine remains the authority, and every selector must supply a superset of files needed for edits and refusals (inline gap: §2.9-33). |
|
||||
| `lucisv_server ──▶ vlog_formatter` | depends | `format_source`, `format_range`/`LineRanges` (range, ranges, on-type formatting), `Config`, `fence::protected_regions` (quick-fix filter). |
|
||||
| `lucisv_server ──▶ vlog_linter` | depends | `run`, `lint` + `LintContext::from_parse` (lints from the `Document`'s own parse — one-parse), `default_rules`, `apply_fixes`, `rule_by_name`. Same three promises the CLI relies on. |
|
||||
| `lucisv_server ──▶ lsp-server / lsp-types` | depends | The transport (synchronous, no async runtime) and the protocol data model. Both pinned exactly. cancel-request additionally relies on `lsp-server 0.10.0`'s stdio transport being a **rendezvous channel** (its own forwarder queue exists because of it) — a version bump must re-read that crate's `stdio.rs`. |
|
||||
@@ -150,21 +153,22 @@ what a change on the pointed-to side must not silently break.
|
||||
| `CI (Gitea Actions) ──▶ tools/` | depends | `release.yml` is (almost) all `tools/` one-liners — `release.sh --cross`, `audit_artifacts.sh`, `prune_release_assets.sh`, `release_notes.sh`, `publish_release.sh` — so every release step runs by hand too; its only inline logic is the tag-vs-`lucisv --version` check. `ci.yml` is plain `cargo fmt`/`clippy`/`test` plus `scripts/corpus_gate.sh` (which reaches `tools/corpus_fetch.sh` on a cache miss). Tag `vX.Y.Z` must equal the workspace version; release notes come from `CHANGELOG.md`'s `## <version> — <date>` headings via `release_notes.sh`. |
|
||||
| `scripts/score.sh + tools/corpus_check.sh ──▶ lucisv` | depends | The frozen 0/1/2 exit-code contract, plus a **textual** dependency on the message prefixes `parse error:` / `lex error:` / `verification failed:` (a standing fragile coupling — rewording those means telling corpus-check; see §2.9). |
|
||||
|
||||
**Deliberately absent crate edges** (independence you can rely on):
|
||||
**Deliberately absent production edges** (also check shared file ownership):
|
||||
|
||||
- `lucisv` (CLI) does **not** depend on `vlog_semantic` or `vlog_refactor` —
|
||||
the CLI formats and lints; semantic lints reach it only *through*
|
||||
`vlog_linter`, and refactoring is server-only today.
|
||||
- `vlog_refactor` does **not** depend on `vlog_formatter` — refactored output
|
||||
- `vlog_refactor` has **no production dependency** on `vlog_formatter` — refactored output
|
||||
is edited source, not reformatted source (refactor README, by design).
|
||||
- Among `vlog_formatter`, `vlog_semantic`, `vlog_refactor`, `vlog_linter`
|
||||
there are exactly two build-time inter-crate edges — `vlog_linter →
|
||||
there are exactly two production inter-crate edges — `vlog_linter →
|
||||
vlog_semantic` and `vlog_refactor → vlog_semantic` — plus `vlog_linter →
|
||||
vlog_formatter` as a **dev-dependency only**. All four depend on
|
||||
vlog_formatter` and `vlog_refactor → vlog_formatter` as **test-only
|
||||
dependencies**. All four depend on
|
||||
`vlog_parser`. `vlog_formatter` is the isolated one: nothing in this group
|
||||
depends on it at build time and it depends on none of them. Formatter work
|
||||
and semantic work are parallel-safe except where both touch
|
||||
`vlog_parser::ast`.
|
||||
depends on it in production and it depends on none of them. Formatter and
|
||||
semantic lanes still need disjoint file ownership and
|
||||
a check of shared AST changes and open handshakes before parallel work.
|
||||
- `lucisv_core` depends on nothing and nothing in it knows about Verilog —
|
||||
it is "which files, with what settings".
|
||||
- `vlog_parser` depends on nothing. It is also the **highest-contention
|
||||
@@ -183,9 +187,9 @@ grammar, depth/chain budgets from recursion-limit — since the 2026-09-02
|
||||
decomposition one module per grammar domain: `cursor`, `recover`,
|
||||
`directive`, `split`, `verbatim`, `item`, `module`, `decl`, `tf`,
|
||||
`instance`, `recover_list` (header/list-local tolerant recovery), `stmt`, `keyword_stmt`, `expr`, `primary`, `class`,
|
||||
`covergroup`, `assertion`, `sva`, tests in `parser/tests/`) → `ast/`
|
||||
`covergroup`, `assertion`, `sva`, `randsequence`, tests in `parser/tests/`) → `ast/`
|
||||
(`mod` holds `Meta`/`Comment`/spans/`RawText`; `module`, `decl`, `stmt`,
|
||||
`expr`, `class`, `covergroup`, `sva` hold the nodes, all re-exported as
|
||||
`expr`, `class`, `covergroup`, `sva`, `randsequence` hold the nodes, all re-exported as
|
||||
`vlog_parser::ast::*`); `span.rs`
|
||||
(`TextRange`), `line_index.rs` (offset↔line:col), `defines.rs` (the
|
||||
`` `define`` table, reads the token stream, expands nothing). `tests/spans.rs`
|
||||
@@ -197,7 +201,7 @@ server queue and `lsp-server` I/O threads are proven not to parse.
|
||||
|
||||
**`vlog_formatter`** — the pipeline is `format/` (per-node rules; since
|
||||
2026-09-02 `mod` + `verbatim`, `comment`, `phrase`, `list`, `item`, `module`,
|
||||
`instance`, `decl`, `routine`, `class`, `cover`, `sva`, `stmt`, `expr`) →
|
||||
`instance`, `decl`, `routine`, `class`, `cover`, `sva`, `randsequence`, `stmt`, `expr`) →
|
||||
`doc.rs` (the Wadler IR) → `printer.rs` (width-aware printing);
|
||||
`verify.rs` (the runtime safety net: token equivalence + convergence —
|
||||
CLAUDE.md invariant #4 territory, see §3.3); `fence.rs` (format-off regions +
|
||||
@@ -213,13 +217,15 @@ an error means emit nothing.
|
||||
`workspace/` (`mod` = the tables, `index` = queries and `build`, `update` =
|
||||
incremental update and `fingerprint`, `record` = the `FileFacts` read-off,
|
||||
`external` = the overlay, `reexport` = cycle-guarded package member traversal;
|
||||
active §49 adds `hierarchy` and a second member table; `WorkspaceIndex`: units, members, defines, instantiation and
|
||||
`hierarchy` = tagged connection/hierarchical member tables; `WorkspaceIndex`: units, members, defines, instantiation and
|
||||
inheritance edge tables, incremental `update_file`/`remove_file`,
|
||||
reference postings, `files_spelling`, batch `absorb`, declaration `DeclLines`,
|
||||
`fingerprint`); `facts.rs` (`FileFacts` codec for the persistent cache;
|
||||
`FACTS_FORMAT` is 18 in committed code (19 in the active §49 work));
|
||||
`FACTS_FORMAT` is **19**);
|
||||
`instantiations.rs`, `classes.rs` (the shared walks, lifted from the server
|
||||
so the index census and the request handlers cannot drift).
|
||||
so the index census and the request handlers cannot drift); `imports.rs`
|
||||
(`import_usage`, `import_scopes`, `unused_imports`, `Exports`, `PackageExports`)
|
||||
is the shared usage judgement consumed by organize-imports and the linter.
|
||||
|
||||
**`lucisv_core`** — `config.rs` (`lucisv.toml` parsing + `Discovery`, the
|
||||
upward search with its per-instance cache), `walk.rs` (`collect_files`,
|
||||
@@ -243,7 +249,7 @@ lazy `semantics()`), `visit.rs` (the item/statement walk), `waiver.rs` (inline
|
||||
waivers), `waiver_file.rs` (`ExternalWaivers`, usage tracking, unused reports),
|
||||
`violation.rs` (+ `Fix`, `Applicability`), `signals.rs` (the shared signal
|
||||
table for the three semantic rules), `naming.rs`, `rule_docs.rs`
|
||||
(`rules_markdown()` — docs generated from the registry). There are 73 rules;
|
||||
(`rules_markdown()` — docs generated from the registry). There are 74 rules;
|
||||
`severity.rs` classifies them, `options.rs` validates per-rule configuration,
|
||||
`regex.rs` implements the bounded pattern dialect, and `vscode.rs` generates
|
||||
editor rule toggles. `decls.rs`, `module_decls.rs`, `exprs.rs`, `preproc.rs`,
|
||||
@@ -254,11 +260,17 @@ editor rule toggles. `decls.rs`, `module_decls.rs`, `exprs.rs`, `preproc.rs`,
|
||||
also the engine of `references.rs::find_references`; publishes the cheap
|
||||
`prepare_rename_here`/`rename_name_at` selectors whose parity with the full
|
||||
engine is test-pinned), `ports/` (one file per refactoring: `find`, `add`,
|
||||
`remove`, `propagate`, `list`;
|
||||
`remove`, `propagate`, `list`, `expand`, `ansi`, `merge`;
|
||||
`port_action_modules`/`enclosing_module`, the names the server uses to bound
|
||||
the input set), `instantiate.rs` (plans + rendering; the one layout both plain
|
||||
and snippet spellings go through), `check.rs` (whole-edit verification:
|
||||
re-tokenize + re-resolve, refuse everything on any drift).
|
||||
and snippet spellings go through); `imports.rs` (organize-imports);
|
||||
`extract/` (`mod`, `boundary`, `render`, `region`, `flow`) and `inline/`
|
||||
(`mod`, `site`, `source`, `render`) plan module moves/copies. `check/`
|
||||
(`mod`, `ledger`) verifies edits with re-tokenization/resolution and the exact
|
||||
comment/attribute piece ledger. `RefactorEdit::created` lists new paths, each
|
||||
also represented by one insertion at offset zero in `edits`; server `CreateFile`
|
||||
operations must precede those edits. Same-file relocation verification and
|
||||
inline source fan-out remain open in §2.9-32/33.
|
||||
|
||||
**`lucisv` (CLI)** — `main.rs` (args → walk → per-file worker pool;
|
||||
`process_file` is the cache-aware unit of work; panic hook installed once at
|
||||
@@ -277,7 +289,7 @@ spans two layers — the include graph *and* the `documentLink` handler;
|
||||
| loop | `server/` (since 2026-09-02: `mod` = the loop; `dispatch`, `client`, `index`, `notification`, `progress`, `diagnostics`, `batch`, `formatting`, `large_file`, `semantic_tokens`; tests in `server/tests/`) | the message loop + queue/burst (cancel-request), dispatch, `Pending` map for server-initiated requests, stepped startup scans with mid-scan request drains, held-request ordering for rescans, reindex/widen orchestration, progress/log senders, optional `timing:` instrumentation |
|
||||
| state | `state.rs` | `Workspace` (roots, scope ladder, index, include graph, candidates, index cache, open `Document`s with overlay, bounded closed-file `FileView` cache), `Scan` (whole or additive widen), fan-out source selectors (`module_sources`, `rename_sources`, `include_sources`), and `Document` (text, tokens, tree, semantics, diagnostics, `large` flag) |
|
||||
| substrate | `convert.rs`, `uri.rs`, `locate.rs`, `pairs.rs`, `includes.rs`, `candidates.rs`, `index_cache.rs`, `watch.rs`, `settings.rs`, `templates.rs`, `sync.rs` | position math, URI↔path, location building, the begin/end scope matcher, the include graph, completion word/module tables and their scan-batch forms, the persistent index store, watcher registration, `lucisv.*` settings parsing, snippet registry, incremental text sync |
|
||||
| handlers | one file per capability: `format.rs`, `diagnostics.rs`, `lint.rs`, `hover.rs`, `expand.rs`, `nav.rs`, `type_def.rs`, `type_hierarchy.rs`, `hierarchy.rs`, `design_hierarchy.rs`, `symbols.rs`, `tokens.rs`, `completion/` (`mod`, `member`, `module`, `tiers`, `word`, `site`; test harness in `harness`), `signature.rs`, `inlay.rs`, `inline.rs`, `lens.rs`, `code_action.rs`, `rename.rs`, `ports.rs`, `folding.rs`, `selection.rs`, `linked.rs`, `on_type.rs`, `includes.rs` (links), `file_ops.rs`, `instantiate.rs`, `large.rs` | each is a mostly-pure function over `Document`/`Workspace`; protocol only, no language analysis of its own (anything that looks like analysis in here is a bug or a Handshake request — lucisv-server README) |
|
||||
| handlers | one file per capability: `format.rs`, `diagnostics.rs`, `lint.rs`, `hover.rs`, `expand.rs`, `nav.rs`, `type_def.rs`, `type_hierarchy.rs`, `hierarchy.rs`, `design_hierarchy.rs`, `symbols.rs`, `tokens.rs`, `completion/` (`mod`, `member`, `module`, `tiers`, `word`, `site`; test harness in `harness`), `signature.rs`, `inlay.rs`, `inline.rs`, `lens.rs`, `code_action.rs`, `rename.rs`, `ports.rs`, `imports.rs`, `extract.rs`, `inline_module.rs`, `folding.rs`, `selection.rs`, `linked.rs`, `on_type.rs`, `includes.rs` (links), `file_ops.rs`, `instantiate.rs`, `large.rs` | each is a mostly-pure function over `Document`/`Workspace`; protocol only, no language analysis of its own (anything that looks like analysis in here is a bug or a Handshake request — lucisv-server README) |
|
||||
|
||||
**`editors/vscode`** — `extension.js` (spawn + rainbow decorations + storage
|
||||
path; ~everything else is `vscode-languageclient` driven off advertised
|
||||
@@ -286,7 +298,9 @@ colour ids), `syntaxes/` (hand-maintained grammar, test-locked to
|
||||
`KEYWORDS`), `snippets/` (static, server-independent), `restart.js` (the one
|
||||
serialized start/restart chain, so a `lucisv.verbose` toggle cannot be lost to
|
||||
an in-flight start — shipped, shared by the extension restart paths),
|
||||
`hierarchyView.js`/`hierarchyModel.js` (the indexed instance hierarchy sidebar),
|
||||
`hierarchyView.js`/`hierarchyModel.js`/`hierarchySections.js` (the indexed
|
||||
instance hierarchy sidebar and client-only DUT sections), `extract.js`
|
||||
(the module-name input and extract command),
|
||||
`smoke.js` (headless handshake check) and `restart_test.js` (headless check of
|
||||
that chain, against a scripted fake client), `README.md` (the Marketplace
|
||||
Details page, owned by editor-marketplace-page).
|
||||
@@ -310,7 +324,7 @@ output after content changes, and keep historical measurements dated.
|
||||
| header-recovery | parser `ListElem::{Ok,Error}`, `ExprKind::Error`, `recover_list.rs` → formatter, semantic, linter, refactor and server list walkers | Tolerant mode preserves valid siblings; strict formatting still rejects malformed input |
|
||||
| linter-expansion-1 | `Severity`, `Violation::severity`, `rules_named`, `MentionOracle::module_interface`, `Semantics::duplicates` ↔ CLI reports, server diagnostics/settings, generated VS Code toggles | Delivered; duplicate facts are in-memory only |
|
||||
| linter-expansion-2 | core `FileConfig::lint_options`/`LintOption` → linter `RuleOptions`; registry specs ↔ CLI validation, server option overlay and editor settings | Delivered; core records raw values and does not depend on the linter |
|
||||
| linter-expansion-3 | shared scoped-item/expression/preprocessor walkers ↔ 73-rule registry, rule docs and generated editor toggles | Delivered; rule names and option keys are user-facing contracts |
|
||||
| linter-expansion-3 | shared scoped-item/expression/preprocessor walkers ↔ registry (73 rules at delivery, now 74), rule docs and generated editor toggles | Delivered; rule names and option keys are user-facing contracts |
|
||||
| small-items-3 | parser `ItemKind::GenBlock` → every recursive item walker; `recover_list` lookahead; core `atomic::write_atomic` → CLI format/fix and format cache | Delivered in v0.40.0; per-operation temp ownership and canonical CLI dedup followed in v0.43.0 (§2.9-26) |
|
||||
| lazy-code-action | refactor `sites_phrase` ↔ server `ports.rs`; `ClientAbilities::code_action_resolve` ↔ dispatch and `{uri, position, title}` action data; indexed `DeclPositions` → `locate::definition_location` | Delivered in v0.41.0; clients without resolve support retain eager port actions, lint fixes remain eager |
|
||||
| parser-skips | parser `module.rs`/`split.rs` rival-header detection; `DataDecl::delay: Option<NetDelay>` → formatter `format/decl.rs` and semantic `bind/decl.rs` | **Released in v0.42.0**; preserves the written delay position; no verifier normalization change |
|
||||
@@ -319,9 +333,14 @@ output after content changes, and keep historical measurements dated.
|
||||
| lint-config-contract | server `lint/project.rs` parses project selection/options/waivers; `ProjectLint` → lint selection, `ConfigProblems`/`ProblemLog` → diagnostics logging | Released in v0.43.0; editor lists override project lists when non-empty, separately for select and ignore |
|
||||
| walk-cycles / small-items-4 | core directory identity set and warning sink ↔ CLI/server walk callers; parser delay-comment fields and `ExprKind::Type` → formatter and instance planning | Released in v0.43–0.44; warning paths continue without changing CLI status, direct missing inputs remain errors |
|
||||
| didopen-cost | `undriven-net` local guards → existing `MentionOracle` predicate; diagnostics equality → server publish/request ordering | Released in v0.44.0; no new async work or index API |
|
||||
| type-name-spans | parser `DataType::name_span`/`segments`, disable-target span → binder `exact_or_empty` and census | Committed after v0.44.0; `scan.rs` deleted; source text remains the exact-span oracle |
|
||||
| package-reexports | binder export references → `FileFacts` RX group, codec 18 ↔ workspace `reexport.rs` and shared member queries | Committed after v0.44.0; package exports add no local import; DPI-export names remain unbound |
|
||||
| hierarchical-tail | proposed `Surface` tags on declarations/references, codec 19 ↔ `workspace/hierarchy.rs`, member-tail resolution, completion and rename source selection | **In progress, QA pending (TODO §49)**; connection surface stays unchanged, instance tails read the new hierarchical surface |
|
||||
| type-name-spans | parser `DataType::name_span`/`segments`, disable-target span → binder `exact_or_empty` and census | Released in v0.45.0; `scan.rs` deleted; source text remains the exact-span oracle |
|
||||
| package-reexports | binder export references → `FileFacts` RX group (introduced at codec 18, now 19) ↔ workspace `reexport.rs` and shared member queries | Released in v0.45.0; package exports add no local import; DPI-export names remain unbound |
|
||||
| hierarchical-tail | `Surface` tags on declarations/references, codec 19 ↔ `workspace/hierarchy.rs`, member-tail resolution, completion and rename source selection | Released in v0.45.0; §2.9-23 closed; connection surface stays unchanged, instance tails read the hierarchical surface |
|
||||
| expand-wildcard / convert-to-ansi | `ports/{expand,ansi,merge}.rs` ↔ whole-edit verifier; server `ports.rs`, commands and action titles ↔ extension manifest; refactor → formatter test-only edge | Released in v0.46.0; explicit unmatched-port warnings and conservative merge/refusal rules |
|
||||
| organize-imports | semantic `imports.rs` → linter `unused-import` and refactor `imports.rs`; server `imports.rs` ↔ `source.organizeImports` / `lucisv.organizeImports` | Released in v0.47.0; 74 rules, new rule default off; package re-exports count as usage |
|
||||
| extract / inline module | refactor `extract/`, `inline/`, `check/ledger.rs`, `RefactorEdit::created` ↔ server `extract.rs`, `inline_module.rs`, source selectors and client resource capabilities; extension `extract.js` ↔ name prompt | Extract v0.47.0, inline v0.49.0; file copies/moves preserve protected pieces; open §2.9-32/33 |
|
||||
| dut-hierarchy | extension `hierarchySections.js` ↔ model/view, manifest commands, `lucisv.hierarchy.duts`, workspace state; consumes unchanged `lucisv/moduleHierarchy` snapshot | Delivered in v0.48.0, package corrected in v0.48.2; configured DUTs are locked, saved and configured names union |
|
||||
| coverage-gaps-l | new `randsequence` AST/parser/formatter modules and six grammar additions → all AST walkers and grammar keyword lock; `Config::uvm_utils_indent` ↔ core `[format]`, CLI config merge, server setting and extension manifest | Released in v0.49.0; default-off output option; cache-key omission open in §2.9-34 |
|
||||
|
||||
The lazy action resolves against current workspace state and rejects a stale
|
||||
or inapplicable action. Indexed definition locations bypass closed-file reads
|
||||
@@ -660,7 +679,7 @@ update the filing README(s) and this file.
|
||||
| ~~20~~ | ~~Rename loses its heads-up for an **unresolvable member/hierarchical tail** spelling the renamed name (`unknown_mod u_x (); … u_x.sig` when `unknown_mod` is indexed nowhere): before class-member-access the tail had no reference and `rename.rs::stray_reason` warned "a hierarchical or member tail, which lucisv does not resolve"; since round 2 it carries an `ExternalCandidate` the workspace cannot answer, which the engine neither edits (correct) nor mentions. Wanted: a warning for candidate references that spell the old name and stayed unresolved through the overlay — one message per file. Pinned as a premise by `a_hierarchical_tail_that_cannot_resolve_is_left_alone_and_named_as_such`. Same class as item 18.~~ — **delivered 2026-09-02 by comment-slots**: `Scope::unresolved_candidate_warnings` — a reference that stayed `ExternalTarget::StillUnresolved` through the overlay (or an `InheritedCandidate` that missed) is reported one line per (file, unit), run over every file that spells the name. The premise pin is inverted. Surfaced item 23 in the process | class-member-access round 2 (lead) | ~~vlog_refactor (`rename.rs`)~~ done |
|
||||
| ~~21~~ | ~~`Parser::parse_scoped_name` joins a `pkg::name` chain into one `String`, erasing the segment boundary, so an escaped segment (`\my-pkg ::\state-t` as a type, an instantiated module or a `bind` target) is reprinted without its terminating space and **refused by the safety net** — an error, never a corruption. Wanted: the AST keeps the segments (as `parse_method_name` already does for `FunctionDecl::scope`). Pinned by `escaped_identifiers.cases`'s one `#SKIP` and `verification::an_escaped_name_in_a_scoped_type_is_rejected_rather_than_corrupted`, both of which must keep failing-to-format until delivered~~ — **delivered 2026-09-02 by comment-slots**: `Parser::push_scope_segment` is the one join for every `::` chain and writes the escaped segment's terminator; `parse_method_name` keeps real segments (`ScopeSeg`, one comment slot per `::`). The `#SKIP` is a live case and the verification pin is inverted, with a new pair asserting the tightened spelling is still refused | escaped-identifiers | ~~vlog_parser~~ done |
|
||||
| ~~22~~ | ~~**Comment slots in shared expression/name machinery** drop the comment and the safety net refuses the file: `q[/*c*/ i]` (index expressions), `x inside {[/*c*/ 0:3]}` and `n /*c*/ inside {` (`inside` / `parse_value_range`), `pkg/*c*/ ::cls::name` (`parse_method_name` chains), `foreach (q[/*c*/ i])` (`parse_foreach_target`), `static /*c*/ constraint` / `pure /*c*/ static function` (`take_member_prefix`). Found by constraint-bodies' exhaustive gap fuzzer (358 gaps; these 40 fail identically on v0.26.0 in the same constructs outside a constraint). Inside a constraint they are regressions relative to the verbatim era — but no opentitan file hits one (sweep unchanged). Wanted: a parser-wide round giving each slot a `Meta`/comments field, then re-running the fuzzer to zero.~~ — **delivered 2026-09-02 by comment-slots**: ~70 named comment fields across `ExprKind`/`Stmt`/declarations/headers/labels (`SegmentComments`, `BinaryComments`, `CastComments`, `LabelComments`, `Stmt::before_semi` + `StmtKind::takes_semi()`), three duplicated grammars folded into `parse_postfix_segment` / `parse_value_range`, and four gap fuzzers at zero — covergroup 329, fragment 153, constraint 395 (committed at last), RTL 352 (new). Corpus (860 files) and opentitan (3 975 files) byte-identical to v0.30.0. Deliberately left: `if`/`case` in-paren comments still recovered print-side by `header_parens` (only `after_kw` got a slot) — a real slot there would change existing layout A fifth fuzzer bar 2026-09-05 (small-items-4, TODO §45.4): the **delay list** — `#(1:2:3)` on nets and continuous assignments, `#(rise, fall)` on gates — gained `MinTypMaxComments`, `ast::DelayValue`, `ContAssign::{after_hash, after_delay}`, `GateInstantiation::{before_hash, after_hash, before_semi}`, `GateInstance::before_args`; `EXPECTED_RTL_GAPS` 374 → 419 at zero. | constraint-bodies (dev + QA) | ~~vlog_parser~~ done |
|
||||
| ~~23~~ | ~~A **cross-file instance-member tail does not resolve for rename**: with `module sub` in `sub.sv` and `assign w = u_x.sig;` in `top.sv`, renaming `sub`'s `wire sig` edits `sub.sv` only — the same shape in one file resolves and is edited (`a_hierarchical_tail_that_resolves_is_renamed_with_its_declaration`). Since comment-slots the rename *says so* (item 20's warning); the edit itself is the gap. Modules export ports and parameters only (the class-member-access round 2 ruling), so an internal net is exactly what the cross-file hop refuses — the fix is either an export rule for nets named through an instance or a rename-time in-file fallback resolution of the tail. **Active owner: hierarchical-tail (TODO §49), working-tree implementation present; QA pending.** Keep this request open until acceptance.~~ — **delivered 2026-09-05 by hierarchical-tail (TODO §49):** a module has two member surfaces — the *connection* surface (ports, parameters; unchanged for every existing reader) and the *hierarchical* surface (plus nets, variables, instances; a second index table, `FACTS_FORMAT` 19) read only by the tail walk behind an instance head (`Surface::Hierarchical` from `resolve.rs::head_surface`). `assign w = u_x.sig;` resolves cross-file, the rename edits both files, the §2.9-20 warning is retired for a resolved tail. A generate-block-scoped net (`u_x.gen[0].sig`) is on neither surface and is still refused honestly. 514 references newly resolve over opentitan `hw/`. | comment-slots (dev, surfaced by the §2.9-20 control test) | vlog_semantic / vlog_refactor |
|
||||
| ~~23~~ | ~~A **cross-file instance-member tail does not resolve for rename**: with `module sub` in `sub.sv` and `assign w = u_x.sig;` in `top.sv`, renaming `sub`'s `wire sig` edits `sub.sv` only — the same shape in one file resolves and is edited (`a_hierarchical_tail_that_resolves_is_renamed_with_its_declaration`). Since comment-slots the rename *says so* (item 20's warning); the edit itself is the gap. Modules export ports and parameters only (the class-member-access round 2 ruling), so an internal net is exactly what the cross-file hop refuses — the fix is either an export rule for nets named through an instance or a rename-time in-file fallback resolution of the tail.~~ — **delivered 2026-09-05 by hierarchical-tail (TODO §49):** a module has two member surfaces — the *connection* surface (ports, parameters; unchanged for every existing reader) and the *hierarchical* surface (plus nets, variables, instances; a second index table, `FACTS_FORMAT` 19) read only by the tail walk behind an instance head (`Surface::Hierarchical` from `resolve.rs::head_surface`). `assign w = u_x.sig;` resolves cross-file, the rename edits both files, the §2.9-20 warning is retired for a resolved tail. A generate-block-scoped net (`u_x.gen[0].sig`) is on neither surface and is still refused honestly. 514 references newly resolve over opentitan `hw/`. | comment-slots (dev, surfaced by the §2.9-20 control test) | vlog_semantic / vlog_refactor |
|
||||
| ~~24~~ | ~~A **half-typed `#(` parameter override whose value can read as a call** (`sub #(.W(` ⏎ `u0 (.a(x))`) — the greedy expression grammar swallows the next instance's name before any error fires, so the whole instantiation still degrades to an item-level `Error` node instead of getting header recovery's benefit. Found by §32's QA; the fix is a lookahead in the override grammar (an identifier followed by `(` on a later line is the next instance, not a call).~~ — **delivered 2026-09-04 by small-items-3 (TODO §36)** | header-recovery (QA) | vlog_parser |
|
||||
| ~~25~~ | ~~The parser **refuses** a module-scope `begin … end` and a bare `begin` inside a `generate` region (an `ItemKind::Error`) rather than recovering them as an unnamed generate block, so `module-begin-block` and `v2001-generate-begin` (TODO §35) fire on an error leaf and the rest of the unit is lost to recovery. Wanted: tolerant-mode recovery that keeps the block's items.~~ — **delivered 2026-09-04 by small-items-3 (TODO §36)** | linter-expansion-3 (dev) | vlog_parser |
|
||||
| ~~26~~ | ~~**Same-target atomic writers share a temp path.** `atomic::temp_path` uses canonical target + process ID; parallel workers following distinct symlink spellings can reach that same name, while CLI dedup is lexical. A bounded direct helper probe (100 rounds, two threads, 1 MiB each) returned 100 write errors in 200 calls; no mixed final bytes observed in that probe. Use exclusive per-operation temp creation and coordinate/deduplicate target writes. See repository-analysis.md for limits.~~ — **closed by §41 (0.43.0):** unique `O_EXCL` temps (`.{name}.{pid}.{n}.lucisv-tmp`), dedup on `fs::canonicalize`; two *processes* remain last-writer-wins by design, stated in `atomic.rs` | repository audit, 2026-09-04 | lucisv_core / lucisv |
|
||||
@@ -671,6 +690,7 @@ update the filing README(s) and this file.
|
||||
| 31 | **DPI-export name binding remains open.** Package re-export resolution closed §2.9-16, but the name in a DPI export is still not a semantic reference. Keep this separate from the delivered package-member traversal. | dpi-export request (b); package-reexports | vlog_semantic |
|
||||
| 32 | **The refactoring verifier does not catch a same-file relocation of a never-dropped piece written as two well-formed edits** (delete here, insert there): `verify_move` computes `after` by applying the edits, so `positions_match`'s reconstruction cannot diverge from it and equation 3 of the ledger is unreachable through any real caller. No planner produces the shape today. Wanted: an independent `after` (the client's applied text, or a second reconstruction) and a test that isolates equation 3. Found by extract-module's QA re-attack. | extract-inline-module (QA) | vlog_refactor |
|
||||
| 33 | **`module_sources`' fan-out has no rung for a file that reaches an instance through an intermediate module it does not itself instantiate** (a bench naming `wrap.u_S.x` where `wrap` instantiates `S`): inline-module's hierarchical-reference refusal sees only the handed files, so such a reference is missed. Wanted: a transitive-instantiators rung (§49's hierarchical surface knows the path) in `module_sources` for the refactorings that must see every hierarchical use. Found by §53.2's QA. | extract-inline-module (QA) | lucisv_server / vlog_refactor |
|
||||
| ~~34~~ | ~~**The format cache omits `Config::uvm_utils_indent`.** CLI `args.rs::config_with` applies the key, but `main.rs::entry_for` and core `cache::Entry` serialize/compare only content, line length and indent (plus the store version). On one UVM class: cache a clean verdict with the option false, change only the option to true, then cached `--check` exits 0 while `--no-cache --check` exits 1. Wanted: key/equality/codec coverage for the option and a regression for both toggle directions. Until fixed, use `--no-cache` or delete the format cache after toggling. See repository-analysis.md for the bounded reproduction.~~ — **fixed 2026-09-07 (TODO §59, 0.50.0):** `Entry` carries `uvm_utils_indent`, `entry_for` fills it, the store line has it as a fourth field; a well-formed five-field (0.49.0) line is dropped individually like another version's entry; the audit's probe is `changing_uvm_utils_indent_invalidates_the_entry` in `lucisv/tests/cli.rs`, both directions. | repository audit, 2026-09-07 | lucisv_core / lucisv |
|
||||
|
||||
---
|
||||
|
||||
@@ -691,13 +711,13 @@ untouched, reusing existing arms.
|
||||
|---|---|
|
||||
| `vlog_parser` | spans, name-spans, recursion-limit, error-recovery, define-table, lexer-cleanup, decomposition-parser, and the grammar lane: *macro-items*, *classes*, *bind*, *dynamic-types*, *types-decls*, *item-misc*, *directives-in-lists*, *directives-in-instances*, *dpi-export*, *assertions*, *interfaces*, *expressions-2*, *dv-statements*, *mop-up-2*, *directive-split*, *ansi-first-port*, *null-items*, *constraint-bodies*, *covergroup-bodies*, *fragment-mode*, *vendor-formal-grammar*, *comment-slots*, *bind-semantics*, *sva-bodies* (most also add formatter arms — parser+formatter pairs by default; directive-split and ansi-first-port reused existing arms and left `vlog_formatter/src` untouched) |
|
||||
| `vlog_formatter` | safety-net (`verify.rs`), case-tables, formatter-bug-fixes, corpus-bugs, comments-round, comments-round-2, alignment (`align.rs`), format-fences (`fence.rs`), range-formatting (`range.rs`), shared-fence-filter, decomposition-formatter, and the layout halves of constraint-bodies, covergroup-bodies, comment-slots, bind-semantics and sva-bodies (`format/`) |
|
||||
| `vlog_semantic` | vlog-semantic (`bind/`, `resolve.rs`, `model.rs`), workspace-index (`workspace/`), decomposition-semantic, class-semantics, interface-semantics, class-member-access, struct-members, overlay-promotion, port-detail-spans (`Symbol`/`Def::detail_span` and `Semantics::symbols_named`), hover-line-index (`DeclLines`, facts codec), vscode-hierarchy-sidebar's declaration/instance positions, scan-interleave (`WorkspaceIndex::absorb`), semantic-lints-on's word census, bind-semantics and sva-bodies, refactor-rename's performance amendment (`files_spelling`), plus the index halves of indexing-ux (`index_order`/`IndexBuilder`), index-scope (order-insensitive `finish`, facts-from-analysis), incremental-index (`update_file`, edge/reference tables, `instantiations.rs`, `classes.rs`), index-persistence (`facts.rs`; committed `FACTS_FORMAT` 18; active §49 uses 19; plus a small `vlog_parser::defines` touch — `DefineTable::from_entries`, `Eq` derives) |
|
||||
| `vlog_semantic` | vlog-semantic (`bind/`, `resolve.rs`, `model.rs`), workspace-index (`workspace/`), decomposition-semantic, class-semantics, interface-semantics, class-member-access, struct-members, overlay-promotion, port-detail-spans (`Symbol`/`Def::detail_span` and `Semantics::symbols_named`), hover-line-index (`DeclLines`, facts codec), vscode-hierarchy-sidebar's declaration/instance positions, scan-interleave (`WorkspaceIndex::absorb`), semantic-lints-on's word census, bind-semantics and sva-bodies, refactor-rename's performance amendment (`files_spelling`), plus the index halves of indexing-ux (`index_order`/`IndexBuilder`), index-scope (order-insensitive `finish`, facts-from-analysis), incremental-index (`update_file`, edge/reference tables, `instantiations.rs`, `classes.rs`), index-persistence (`facts.rs`; `FACTS_FORMAT` 19; plus a small `vlog_parser::defines` touch — `DefineTable::from_entries`, `Eq` derives) |
|
||||
| `vlog_linter` | linter-core, lint-harness, lint-rules-2, semantic-lints (`signals.rs`), semantic-lints-on (workspace oracle), one-parse (`context.rs`) |
|
||||
| `vlog_refactor` | refactor (plan), refactor-rename (including `prepare_rename_here` / `rename_name_at` selector half), refactor-ports (including module-target selectors), refactor-instantiate, references-nav (whole-scope equivalence oracle), and the refactor half of decomposition-semantic |
|
||||
| `vlog_refactor` | refactor (plan), refactor-rename (including `prepare_rename_here` / `rename_name_at` selector half), refactor-ports (including module-target selectors), refactor-instantiate, references-nav (whole-scope equivalence oracle), and the refactor half of decomposition-semantic; expand-wildcard and convert-to-ansi (`ports/`), organize-imports (`imports.rs`), extract-inline-module (`extract/`, `inline/`, `check/ledger.rs`) |
|
||||
| `lucisv_core` | lucisv-core-lift (`config.rs`, `walk.rs`), filelist (`filelist.rs`), format-cache (`cache.rs`) |
|
||||
| `lucisv` (CLI) | cli-polish, config-discovery (wiring), parallel-files, cli-filelist, linter-core (CLI half in `lint.rs`), one-parse (`lint.rs` parses once via `ParsedSource`), format-cache (wiring), release-prep (`--version` contract) |
|
||||
| `lucisv_server` | lucisv-server (trunk), decomposition-server (`server/`, `completion/`), and one or two modules per capability feature: editor-scopes→`pairs.rs`, filelist→scope ladder in `state.rs`, include-nav→`includes.rs`, completion-core/fuzzy-completion/member-completion→`completion/`+`candidates.rs`, completion-templates→`templates.rs`, inline-templates→`inline.rs`, inline-instantiation→`inline.rs`+`completion/`+`candidates.rs` (+`settings.rs` key), bind-semantics→`instantiate.rs`, macro-expansion→`expand.rs`, hierarchy→`hierarchy.rs`, vscode-hierarchy-sidebar→`design_hierarchy.rs`, type-hierarchy→`type_hierarchy.rs`, type-definition→`type_def.rs`, code-lens→`lens.rs`, inlay-hints→`inlay.rs`, server-lint→`lint.rs`+`lint/project.rs`+`code_action.rs`, one-parse→`lint.rs`+`state.rs` (`Document.tree`), refactor wiring/performance fan-outs→`rename.rs`/`ports.rs`+`state.rs`, apply-edit+folders-and-config+cancel-request+work-done-progress→`server/`, editor-settings+indexing-ux+index-scope+index-persistence→`settings.rs`+`state.rs`(+`index_cache.rs`), incremental-sync→`sync.rs`, file-watching→`watch.rs`, file-operations→`file_ops.rs` (+`include_sources` in `state.rs`), pull-diagnostics→`diagnostics.rs`+`server/`, semantic-tokens-delta→`tokens.rs`+`server/semantic_tokens.rs`, on-type-formatting→`on_type.rs`, will-save-wait-until→`format.rs` (+`settings.rs`/`main.rs`), selection-range→`selection.rs`, linked-editing→`linked.rs`, references-nav (server half)→`folding.rs`+`nav.rs`, large-file-mode→`large.rs`+`server/large_file.rs`, lsp-318-extras→`format.rs` (+`main.rs` capability), hover-declarations→`hover.rs`(+`nav.rs`), port-detail-spans (server half)→`hover.rs`+`nav.rs`, hover-line-index→`hover.rs`+`locate.rs`+`state.rs`, scan-interleave/change-debounce/verbose-timing→`server/`+`state.rs`, perf measurements→`src/perf.rs` (`docs/perf/README.md`, not a feature README), interactive-latency→`state.rs` (the two token searches) + `selection.rs`/`on_type.rs`/`completion/`/`inline.rs` (their callers) + `src/perf.rs`/`tests/e2e.rs` (its measurements), editor-packaging (grammar test)→`tests/grammar.rs` |
|
||||
| `editors/vscode` | editor-packaging, editor-snippets, editor-settings (manifest half), editor-scopes (rainbow half), vscode-hierarchy-sidebar (`hierarchyView.js`/`hierarchyModel.js`), editor-platform-vsix, editor-marketplace-page, index-persistence (`storagePath` line), verbose-timing (`lucisv.verbose`, spawn args and restart in `extension.js`) |
|
||||
| `editors/vscode` | editor-packaging, editor-snippets, editor-settings (manifest half), editor-scopes (rainbow half), vscode-hierarchy-sidebar (`hierarchyView.js`/`hierarchyModel.js`), dut-hierarchy (`hierarchySections.js`), extract-inline-module (`extract.js`), editor-platform-vsix, editor-marketplace-page, index-persistence (`storagePath` line), verbose-timing (`lucisv.verbose`, spawn args and restart in `extension.js`) |
|
||||
| `tools/` + CI | corpus-check, release-prep, ci-release, editor-platform-vsix (staging), range-formatting (`lucisv-changed.sh`) |
|
||||
|
||||
### 3.2 The combined picture
|
||||
@@ -717,7 +737,7 @@ graph TD
|
||||
lc[linter-core + rules + harness + semantic-lints]
|
||||
end
|
||||
subgraph refac [vlog_refactor]
|
||||
ms[M2 rename / M3 ports / M4 instantiate / references]
|
||||
ms[rename / ports / instantiate / references / imports / extract / inline]
|
||||
end
|
||||
subgraph corelib [lucisv_core]
|
||||
cw[config + walk + filelist + cache]
|
||||
@@ -736,6 +756,9 @@ graph TD
|
||||
sem --> parser
|
||||
lint --> parser
|
||||
lint --> sem
|
||||
lint --> corelib
|
||||
lint -.test-only.-> fmt
|
||||
refac -.test-only.-> fmt
|
||||
refac --> parser
|
||||
refac --> sem
|
||||
srv --> parser
|
||||
@@ -782,13 +805,21 @@ ownership explicitly.
|
||||
| `lucisv_server/src/server/` | lucisv-server; amended by cancel-request, change-debounce, scan-interleave, index-scope, verbose-timing | every request/notification and every rebuild trigger | One ordered loop owns all mutable server state. A startup scan may publish a prefix and answer queued work between files; a request queued behind a rescan trigger is held until that rescan lands, and its cancel travels with it. Never make the distinction time-based: machine load must not change which index a request sees. Verbose timing may observe each wrapper/lifecycle but must be entirely silent when off and must not move protocol ordering. The queue thread only forwards protocol messages and must never parse. |
|
||||
| `lucisv_server/src/state.rs` | lucisv-server; amended by filelist, index-scope, scan-interleave, indexing-ux, incremental-index, index-persistence, hover-line-index, large-file-mode, one-parse (`Document.tree`), editor-settings + folders-and-config (`set_client_settings`/`change_roots`), include-nav (the include graph), completion-core (candidates), file-watching, interactive-latency (`first_token_reaching`/`first_token_from`), refactor performance fan-outs | every handler | `Workspace` is immutable through request handlers except the interior-mutable four-entry/8 MiB `FileView` cache. The scope ladder (filelist > `index.scope: "workspace"` > folder-scope at shipped depth 2; a rootless session never climbs; it reads flat at depth 0 and walks descendants at positive depth (including the default 2)) and open-buffer overlay are contracts. `Scan` has whole/widen shapes but one step/finish path; index/candidate/include prefixes publish together. `module_sources`, `rename_sources`, and `include_sources` must remain supersets of what their engines can edit/refuse over; `rename_sources` falls back to `sources()` when an ambiguous posting prevents a proven bound. `update_one` and a completed scan must equal a fresh build (`fingerprint`). Handlers reading `doc.text` instead of tokens/tree must check `doc.large`. |
|
||||
| `lucisv_server/src/settings.rs` | editor-settings | folders-and-config, indexing-ux, index-scope, index-persistence, inline-templates, will-save-wait-until, filelist, large-file-mode | One parser for both doors (push and pull, via `from_section` re-wrapping). Every key drops garbage independently; defaults that are not "silence" (1 MiB cap, log on, persist on, 4 MiB large-file threshold) are hand-written in `Default`. `set_client_settings` returns whether a reindex is owed — new keys must decide that question explicitly. |
|
||||
| `vlog_semantic/src/workspace/` (+ `facts.rs`) | workspace-index; extended by incremental-index, index-persistence, index-scope, hover-line-index, scan-interleave, member semantics, semantic-lints-on, bind-semantics, SVA bodies and refactor-rename performance | server state, hierarchy/lens/type-hierarchy, refactor, completion, semantic lints | Determinism (same inputs → same index, any order), the `paths` spelling coupling with `resolve.rs`, `FACTS_FORMAT` bumped on any codec change (committed 18; active §49 uses 19), edge/posting tables built by the same lifted walks the engines use. `DeclLines` must round-trip and participate in `fingerprint`; `absorb` must equal one build over the resulting record set; `files_spelling` must continue to include unresolved non-empty external/inherited paths or rename loses its dangling-use refusal; `FileFacts::words` is the shared project mention/completion census. |
|
||||
| `vlog_semantic/src/workspace/` (+ `facts.rs`) | workspace-index; extended by incremental-index, index-persistence, index-scope, hover-line-index, scan-interleave, member semantics, semantic-lints-on, bind-semantics, SVA bodies and refactor-rename performance | server state, hierarchy/lens/type-hierarchy, refactor, completion, semantic lints | Determinism (same inputs → same index, any order), the `paths` spelling coupling with `resolve.rs`, `FACTS_FORMAT` bumped on any codec change (current 19), edge/posting tables built by the same lifted walks the engines use. `DeclLines` must round-trip and participate in `fingerprint`; `absorb` must equal one build over the resulting record set; `files_spelling` must continue to include unresolved non-empty external/inherited paths or rename loses its dangling-use refusal; `FileFacts::words` is the shared project mention/completion census. |
|
||||
| `vlog_refactor/src/rename/` | refactor-rename; shared by references-nav and the performance wave | server rename/prepareRename/references and port refactor verification | `Scope` remains the whole-scope authority and `collect_occurrences` the one rename/references walk. The fast `prepare_rename_here` answer/refusal and `rename_name_at` target are parity contracts, not alternate semantics. Any new refusal must be expressible on the fast path or force a deferral; any new occurrence shape must be reflected in the server fan-out or trigger its all-sources fallback. |
|
||||
| `vlog_parser/src/token.rs` keyword table | completion-core (`KEYWORDS` export) | lexer, pairs.rs, editor grammar (test-locked), completion | Adding a keyword = lexer change + `pairs.rs` re-check + a hand edit to the grammar (`tests/grammar.rs` names the missing word) + potentially `verify.rs`-adjacent behavior. dv-statements added `randcase`/`let` to `is_keyword` and recorded it as shared with the adjacent lexer-cleanup round — the precedent for treating this file as coordinated even between back-to-back rounds. |
|
||||
| `editors/vscode/package.json` | editor-packaging | editor-settings, editor-scopes (colour ids), editor-snippets, index-persistence, verbose-timing, platform-vsix, marketplace-page | Settings/colour/snippet ids referenced from `extension.js` or the server must move in lockstep; mismatches are *silent* (VS Code ignores unknown ids). `lucisv.verbose` is special: it changes a spawn argument and therefore restarts the server instead of flowing through the ordinary settings push. Version number is one of the four version files. |
|
||||
| `tools/release.sh` artifact names | release-prep / editor-platform-vsix | ci-release (`prune_release_assets.sh`), `audit_artifacts.sh`, extension `bin/` layouts | Renaming a `.vsix` is a two-file change (`release.sh` + `prune_release_assets.sh`'s suffix list); renaming a per-triple binary is a two-file change (`release.sh` + `audit_artifacts.sh`, which skips `.vsix` and hard-fails on an unknown binary name). Get the wrong pair and the release fails by name. |
|
||||
| The frozen CLI contract | cli-polish | corpus scripts, CI users, every new CLI mode | Exit codes 0/1/2 forever; stdout stays machine-readable (JSON mode prints exactly one array; warnings to stderr). |
|
||||
|
||||
The 2026-09-07 size measurement in `CLAUDE.md` puts `state.rs` at 958
|
||||
production lines; its decomposition is deferred to Loop 3 (TODO §55).
|
||||
Additional shared boundaries are `vlog_refactor/src/check/ledger.rs` (every
|
||||
move/copy planner), `vlog_semantic/src/imports.rs` (linter and refactor usage
|
||||
agreement), and `Config` → core config → CLI/server settings → format cache
|
||||
(the newly missing cache field is §2.9-34). Changes to these require joint
|
||||
contract review even when their source files are separate.
|
||||
|
||||
### 3.4 Working rules distilled for parallel agents
|
||||
|
||||
1. **Pick lanes, not files.** The eight lanes in §2 are the intended
|
||||
|
||||
@@ -5,6 +5,14 @@ for you. The extension and its bundled language server share one version
|
||||
number; the full engineering notes live in the
|
||||
[project changelog](https://git.luci.ooo/lucio/lucisv/src/branch/master/CHANGELOG.md).
|
||||
|
||||
## 0.50.0 — 2026-09-07
|
||||
|
||||
- The CLI's format cache now keys on `uvm-utils-indent`, so toggling
|
||||
`lucisv.format.uvmUtilsIndent` (or the `[format]` key) can no longer
|
||||
leave a stale "already formatted" verdict behind; a 0.49.0 cache is
|
||||
rebuilt automatically. The bundled server is 0.50.0; nothing changes in
|
||||
the editor itself.
|
||||
|
||||
## 0.49.0 — 2026-09-06
|
||||
|
||||
- **Inline module** from the lightbulb on an instantiation: the module's
|
||||
|
||||
@@ -30,7 +30,7 @@ Install **lucisv — Verilog/SystemVerilog** from the VS Code Extensions view,
|
||||
then open a Verilog or SystemVerilog file. There is no separate server or CLI
|
||||
setup.
|
||||
|
||||
The current release is **0.49.0**. Its platform packages include both
|
||||
The current release is **0.50.0**. Its platform packages include both
|
||||
`lucisv-server` and the `lucisv` command-line tool:
|
||||
|
||||
| Package target | Machines |
|
||||
@@ -374,6 +374,11 @@ Every nesting color is a proper VS Code theme color:
|
||||
}
|
||||
```
|
||||
|
||||
## Release 0.50.0 highlights
|
||||
|
||||
Version 0.50.0 fixes the CLI's format cache ignoring `uvm-utils-indent`
|
||||
and ships performance take 4 with a committed harness.
|
||||
|
||||
## Release 0.49.0 highlights
|
||||
|
||||
Version 0.49.0 adds inline module (the reverse of extract), the last six
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
"name": "lucisv",
|
||||
"displayName": "lucisv — Verilog/SystemVerilog",
|
||||
"description": "Fast Verilog/SystemVerilog formatting, linting, navigation, refactoring, semantic highlighting and RTL design intelligence.",
|
||||
"version": "0.49.0",
|
||||
"version": "0.50.0",
|
||||
"publisher": "guoliangchen",
|
||||
"author": "Guoliang Chen",
|
||||
"license": "MIT",
|
||||
|
||||
@@ -0,0 +1,104 @@
|
||||
# `tools/perf` — the lucisv performance harness
|
||||
|
||||
Take 1's, take 2's and take 3's measurement clients all lived in a scratch
|
||||
directory and all three are gone; take 3's numbers had to be re-derived from
|
||||
take 2's *prose*. This directory is the fix. Everything a performance round
|
||||
needs is here, in Python 3 with **no third-party packages**, so it runs from a
|
||||
clean checkout given an opentitan path and a pair of binaries.
|
||||
|
||||
Written for take 4 (`docs/performance_take4.md`, TODO §58). Take 5 reuses it.
|
||||
|
||||
| File | What it is |
|
||||
|---|---|
|
||||
| `lspclient.py` | framed JSON-RPC over a `lucisv-server` child process: the `workspace/configuration` pull answered per session, per-session client capabilities (with and without `codeAction.resolveSupport`), `storagePath` cache control, `window/logMessage` capture including a `--verbose` server's own `timing:` lines |
|
||||
| `sites.py` | every opentitan position a phase measures, named by the *text* it wants rather than a line number |
|
||||
| `harness.py` | what every phase shares: the registry, the run's configuration, the session factory, the recorder |
|
||||
| `bench.py` | the command line, and the phases that reproduce take 3's tables |
|
||||
| `phases_new.py` | the phases for what 0.44–0.49 added: the new offer sites, §49's surface, §46's `didOpen` fix, `moduleHierarchy`, index size and RSS |
|
||||
| `sweep.sh` | the timed CLI sweeps (`format --check`, `check`) over five trees, `/usr/bin/time -l` |
|
||||
| `sweeptable.py` | those logs → the document's §7 Markdown table |
|
||||
| `outcomes.sh` | the untimed per-file outcome runs, for the release-to-release outcome diff |
|
||||
|
||||
## The rules every run obeys
|
||||
|
||||
- **Everything goes through the guard.** `tools/guard.sh -m 8 -t 1800 --
|
||||
<command>` wraps every server session, every `lucisv` invocation and every
|
||||
`cargo` build. `sweep.sh` and `outcomes.sh` wrap their own children; wrap
|
||||
`bench.py` yourself. A guard kill is a finding — report the command and the
|
||||
limit, never raise it.
|
||||
- **The corpus is read-only.** The formatter cache goes to a scratch
|
||||
`--cache-dir`, the index cache to a scratch `storagePath`
|
||||
(`bench.py --storage`), and every edit a request returns (`rename`,
|
||||
`codeAction/resolve`) is discarded by the client. Check
|
||||
`git -C <opentitan> status --porcelain` after every phase.
|
||||
- **No `cargo` command runs anywhere while a timed phase is running**, and the
|
||||
machine's load average is noted before and after each phase.
|
||||
- **Three tries per row**, first try and repeat range both reported.
|
||||
|
||||
## Running a phase
|
||||
|
||||
```sh
|
||||
SP=/tmp/perf # scratch: caches, logs, results.jsonl
|
||||
OT=$HOME/repo/opentitan
|
||||
tools/guard.sh -m 8 -t 1800 -- python3 tools/perf/bench.py nav \
|
||||
--server target/release/lucisv-server \
|
||||
--label 0.49.0 --opentitan "$OT" \
|
||||
--storage "$SP/caches/0.49.0" --out "$SP/results.jsonl" --tries 3
|
||||
```
|
||||
|
||||
Every phase takes the same arguments. `--label` is what tells two binaries
|
||||
apart in `results.jsonl`; run each phase once per binary.
|
||||
|
||||
| Phase | Document section | What it does |
|
||||
|---|---|---|
|
||||
| `baseline` | §0 | `initialize`, and the transport floor (`$/lucisvNoSuchMethod`, rejected without work) |
|
||||
| `verbose` | §0 | four `codeAction` shapes, each with and without `--verbose`, so the server's own `timing:` line sits beside the wire |
|
||||
| `scan` | §4 | the (scope × cache state) startup matrix: `default`, `{"index":{}}`, `scopeDepth 0`, `workspace`, cold and warm |
|
||||
| `scopes` | §4b | what each scope *answers* at the `aes` instantiation — counts, not just times |
|
||||
| `nav` | §2 | the cheap per-cursor requests at workspace scope, one dedicated session each |
|
||||
| `flush` | §2 | the `didChange` flush, measured with a `foldingRange` barrier |
|
||||
| `codeaction` | §6a | the five fan-out cursors (1 / 6 / 42 / 67 / 128 files), lazy and eager |
|
||||
| `portaction` | §6 | the one opentitan cursor that offers a port refactoring: offer and `codeAction/resolve` |
|
||||
| `refactor` | §6b | the offer sites 0.44–0.49 added — expand `.*`, organize imports, inline module, port actions, and an ANSI header as the contrast — plus the extract-module *selection* |
|
||||
| `rename` | §6c | `prepareRename` and `rename` on `aes` |
|
||||
| `tailrename` | §6c | §49's hierarchical tail: a variable renamed at its declaration, named through an instance from another file |
|
||||
| `blockers` | §3 | the queue-blocking analysis: a slow leader, then the three requests an editor fires on every cursor move |
|
||||
| `widen` | §5 | the `didOpen` widen at `scopeDepth 0` and at the default scope, cold and warm |
|
||||
| `didopen` | §5/§46 | `didOpen` → the request behind it, workspace scope, the four files the perf README's 2026-09-05 table used |
|
||||
| `diagnostics` | §2 | the publish after a `didChange` (≈150 ms of it is the debounce) |
|
||||
| `completion` | §6d | the typed-prefix curve |
|
||||
| `tailcompletion` | §6d | completion after an instance head and a `.` |
|
||||
| `hierarchy` | §6 | `lucisv/moduleHierarchy`, the snapshot the DUT sidebar consumes |
|
||||
| `rss` | §6 | server RSS after the workspace scan, and the index store's size on disk |
|
||||
| `probe` | — | ad-hoc: `--probe FILE:LINE:CHAR` (0-based) prints what a cursor offers. This is how `sites.REFACTOR_SITES` was found |
|
||||
|
||||
## The CLI sweeps
|
||||
|
||||
```sh
|
||||
tools/perf/sweep.sh ~/.cache/lucisv-baselines/lucisv-0.49.0 0.49.0 "$OT" "$SP/sweep" 3
|
||||
python3 tools/perf/sweeptable.py "$SP/sweep" --labels 0.49.0,0.43.0,0.39.0
|
||||
```
|
||||
|
||||
`sweep.sh` writes one log per (label, tree, command, cache state) holding the
|
||||
three tries' `/usr/bin/time -l` blocks; `sweeptable.py` reads them all and
|
||||
prints the table plus the summary line each run reported, so a timing that
|
||||
moved because the *work* moved is not mistaken for a timing change.
|
||||
|
||||
## The outcome diff
|
||||
|
||||
```sh
|
||||
tools/perf/outcomes.sh ~/.cache/lucisv-baselines/lucisv-0.43.0 0.43.0 "$OT" "$SP/outcomes"
|
||||
tools/perf/outcomes.sh ~/.cache/lucisv-baselines/lucisv-0.49.0 0.49.0 "$OT" "$SP/outcomes"
|
||||
diff "$SP/outcomes/0.43.0.format.txt" "$SP/outcomes/0.49.0.format.txt"
|
||||
```
|
||||
|
||||
Untimed, `--no-cache`, paths rewritten relative to the corpus root and sorted,
|
||||
so two runs differ only where a per-file *outcome* did. Every difference is
|
||||
either explained by a TODO section or is a finding.
|
||||
|
||||
## `results.jsonl`
|
||||
|
||||
One JSON object per row: `phase`, `label`, `row`, `ms` (the try list, first
|
||||
try first), and whatever else the phase knows — `n` (a result count, a file
|
||||
count, a byte count), `titles`, `note`. Nothing in the document may quote a
|
||||
number that is not in this file or in a `sweep.sh` / `outcomes.sh` log.
|
||||
@@ -0,0 +1,436 @@
|
||||
#!/usr/bin/env python3
|
||||
"""The lucisv LSP performance phases — take 3's request table.
|
||||
|
||||
python3 tools/perf/bench.py <phase> --server <path> --label <name> \
|
||||
--opentitan DIR --storage DIR --out results.jsonl [--tries N]
|
||||
|
||||
Every phase opens its own `lucisv-server` sessions, times requests on the wire
|
||||
with `time.perf_counter`, and appends one JSON object per row to
|
||||
`results.jsonl`. Nothing is ever written into the corpus: the index cache is
|
||||
directed at `--storage`, and every edit a request returns (`rename`,
|
||||
`codeAction/resolve`) is discarded.
|
||||
|
||||
This file holds the phases that reproduce `docs/performance_take3.md`'s
|
||||
tables; `phases_new.py` holds the phases for what 0.44–0.49 added, and
|
||||
`harness.py` holds what both share. Run every invocation under
|
||||
`tools/guard.sh -m 8 -t 1800 --`; see `tools/perf/README.md`.
|
||||
"""
|
||||
|
||||
import argparse
|
||||
import json
|
||||
import os
|
||||
import sys
|
||||
import time
|
||||
|
||||
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
|
||||
|
||||
import harness # noqa: E402
|
||||
import sites # noqa: E402
|
||||
from harness import ( # noqa: E402
|
||||
ARGS, at, code_action_params, doc, phase, pos, record, result_count,
|
||||
session, settled, tries,
|
||||
)
|
||||
|
||||
import phases_new # noqa: E402,F401 — registers its own phases
|
||||
|
||||
|
||||
# =========================================================================
|
||||
# §0 — the transport baseline and the `--verbose` cross-check
|
||||
# =========================================================================
|
||||
|
||||
|
||||
@phase("baseline")
|
||||
def phase_baseline():
|
||||
with session("workspace") as s:
|
||||
init = s.initialize()
|
||||
record(phase="baseline", row="initialize", ms=[init])
|
||||
s.did_open(sites.path(sites.TB))
|
||||
s.wait_quiet(1.5)
|
||||
s.take_notifications()
|
||||
ms = tries(s, "$/lucisvNoSuchMethod", {}, 4)
|
||||
record(phase="baseline", row="transport baseline ($/lucisvNoSuchMethod)", ms=ms)
|
||||
|
||||
|
||||
@phase("verbose")
|
||||
def phase_verbose():
|
||||
"""The wire beside the server's own `timing:` line, three shapes (§0)."""
|
||||
shapes = [
|
||||
("prim_flop_2sync (128), eager", False, sites.AON_TIMER, "prim_flop_2sync #(", 2),
|
||||
("prim_flop_2sync (128), lazy", True, sites.AON_TIMER, "prim_flop_2sync #(", 2),
|
||||
("aes (6), eager", False, sites.TB, " aes #(", 2),
|
||||
("comment line", True, sites.TB, "// ", 2),
|
||||
]
|
||||
for label, lazy, relative, needle, offset in shapes:
|
||||
for verbose in (False, True):
|
||||
with session("workspace", resolve_support=lazy, verbose=verbose) as s:
|
||||
settled(s)
|
||||
s.did_open(sites.path(relative))
|
||||
s.wait_quiet(0.6)
|
||||
s.take_notifications()
|
||||
s.take_timings()
|
||||
params = at(relative, needle, 1, offset)
|
||||
params["range"] = {"start": params.pop("position"), "end": None}
|
||||
params["range"]["end"] = params["range"]["start"]
|
||||
params["context"] = {"diagnostics": []}
|
||||
ms = tries(s, "textDocument/codeAction", params, 4)
|
||||
server_ms = [t[1] for t in s.take_timings("textDocument/codeAction")]
|
||||
record(phase="verbose", row=label, ms=ms,
|
||||
note="verbose" if verbose else "quiet",
|
||||
server_ms=server_ms)
|
||||
|
||||
|
||||
# =========================================================================
|
||||
# §4 — startup and scan, per scope config and cache state
|
||||
# =========================================================================
|
||||
|
||||
|
||||
@phase("scan")
|
||||
def phase_scan():
|
||||
"""§4 — one cell per (scope, cache state), `--tries` runs each.
|
||||
|
||||
"Cold" wipes the `storagePath` directory immediately before each run;
|
||||
"warm" leaves the previous run's store in place. The barrier is 1.5 s of
|
||||
silence after the `didOpen`, not the `$/progress` `end`, because the end
|
||||
report is followed by more indexing chatter.
|
||||
"""
|
||||
for scope in ("default", "empty-index", "depth0", "workspace"):
|
||||
for cache in ("cold", "warm"):
|
||||
runs, note = [], ""
|
||||
for _ in range(ARGS.tries):
|
||||
cold = cache == "cold"
|
||||
with session(scope, cold=cold, storage_name="scan-" + scope) as s:
|
||||
s.initialize()
|
||||
started = time.perf_counter()
|
||||
s.did_open(sites.path(sites.TB))
|
||||
s.wait_quiet(1.5)
|
||||
runs.append((time.perf_counter() - started) * 1000.0 - 1500.0)
|
||||
ends = [
|
||||
n["params"]["value"].get("message", "")
|
||||
for n in s.notifications
|
||||
if n["method"] == "$/progress"
|
||||
and n["params"]["value"].get("kind") == "end"
|
||||
]
|
||||
note = " | ".join(ends[-2:])
|
||||
record(phase="scan", row="%s, %s cache" % (scope, cache), ms=runs, note=note)
|
||||
|
||||
|
||||
@phase("scopes")
|
||||
def phase_scopes():
|
||||
"""§4b — what each scope answers at the `aes` instantiation in `tb.sv`."""
|
||||
asks = [
|
||||
("definition", "textDocument/definition", {}),
|
||||
("typeDefinition", "textDocument/typeDefinition", {}),
|
||||
("hover", "textDocument/hover", {}),
|
||||
("references", "textDocument/references", {"context": {"includeDeclaration": True}}),
|
||||
("documentHighlight", "textDocument/documentHighlight", {}),
|
||||
("signatureHelp", "textDocument/signatureHelp", {}),
|
||||
]
|
||||
for scope in ("default", "depth0", "workspace"):
|
||||
with session(scope, storage_name="scopes-" + scope) as s:
|
||||
settled(s)
|
||||
for name, method, extra in asks:
|
||||
params = dict(at(sites.TB, " aes #(", 1, 2))
|
||||
params.update(extra)
|
||||
ms = tries(s, method, params)
|
||||
_, message = s.request(method, params)
|
||||
record(phase="scopes", row="%s @ %s" % (name, scope), ms=ms,
|
||||
n=result_count(message))
|
||||
ms = tries(s, "workspace/symbol", {"query": "aes"})
|
||||
_, message = s.request("workspace/symbol", {"query": "aes"})
|
||||
record(phase="scopes", row="workspace/symbol 'aes' @ %s" % scope, ms=ms,
|
||||
n=result_count(message))
|
||||
hint = {"textDocument": doc(sites.TB),
|
||||
"range": {"start": {"line": 0, "character": 0},
|
||||
"end": {"line": 9999, "character": 0}}}
|
||||
ms = tries(s, "textDocument/inlayHint", hint)
|
||||
_, message = s.request("textDocument/inlayHint", hint)
|
||||
record(phase="scopes", row="inlayHint @ %s" % scope, ms=ms,
|
||||
n=result_count(message))
|
||||
|
||||
|
||||
# =========================================================================
|
||||
# §2 — the navigation table at workspace scope
|
||||
# =========================================================================
|
||||
|
||||
|
||||
@phase("nav")
|
||||
def phase_nav():
|
||||
rows = [
|
||||
("definition on aes", "textDocument/definition", at(sites.TB, " aes #(", 1, 2)),
|
||||
("hover on aes", "textDocument/hover", at(sites.TB, " aes #(", 1, 2)),
|
||||
("typeDefinition on aes", "textDocument/typeDefinition", at(sites.TB, " aes #(", 1, 2)),
|
||||
("documentHighlight", "textDocument/documentHighlight", at(sites.TB, " aes #(", 1, 2)),
|
||||
("references on aes", "textDocument/references",
|
||||
dict(at(sites.TB, " aes #(", 1, 2), context={"includeDeclaration": True})),
|
||||
("references on .clk_i", "textDocument/references",
|
||||
dict(at(sites.TB, " .clk_i", 1, 5), context={"includeDeclaration": True})),
|
||||
("signatureHelp in the port list", "textDocument/signatureHelp",
|
||||
at(sites.TB, " .clk_i", 1, 22)),
|
||||
("documentSymbol", "textDocument/documentSymbol", {"textDocument": doc(sites.TB)}),
|
||||
("foldingRange", "textDocument/foldingRange", {"textDocument": doc(sites.TB)}),
|
||||
("codeLens", "textDocument/codeLens", {"textDocument": doc(sites.TB)}),
|
||||
("documentLink", "textDocument/documentLink", {"textDocument": doc(sites.TB)}),
|
||||
("selectionRange", "textDocument/selectionRange",
|
||||
{"textDocument": doc(sites.TB), "positions": [pos(sites.TB, " aes #(", 1, 2)]}),
|
||||
("semanticTokens/full", "textDocument/semanticTokens/full",
|
||||
{"textDocument": doc(sites.TB)}),
|
||||
("inlayHint (whole file)", "textDocument/inlayHint",
|
||||
{"textDocument": doc(sites.TB),
|
||||
"range": {"start": {"line": 0, "character": 0},
|
||||
"end": {"line": 9999, "character": 0}}}),
|
||||
("diagnostic (pull)", "textDocument/diagnostic", {"textDocument": doc(sites.TB)}),
|
||||
("workspace/symbol 'aes'", "workspace/symbol", {"query": "aes"}),
|
||||
]
|
||||
for row, method, params in rows:
|
||||
with session("workspace") as s:
|
||||
settled(s)
|
||||
ms = tries(s, method, params, ARGS.tries + 1)
|
||||
_, message = s.request(method, params)
|
||||
record(phase="nav", row=row, ms=ms, n=result_count(message), method=method)
|
||||
|
||||
|
||||
@phase("flush")
|
||||
def phase_flush():
|
||||
"""The `didChange` flush, measured with a `foldingRange` barrier."""
|
||||
with session("workspace") as s:
|
||||
settled(s)
|
||||
text = open(sites.path(sites.TB), encoding="utf-8", errors="replace").read()
|
||||
runs = []
|
||||
for version in range(2, 2 + ARGS.tries + 1):
|
||||
s.did_change(sites.path(sites.TB), text + "\n// take4 %d\n" % version, version)
|
||||
runs.append(s.ms("textDocument/foldingRange", {"textDocument": doc(sites.TB)}))
|
||||
record(phase="flush", row="didChange flush (foldingRange barrier)", ms=runs)
|
||||
|
||||
|
||||
# =========================================================================
|
||||
# §6 — codeAction, offer and resolve
|
||||
# =========================================================================
|
||||
|
||||
|
||||
@phase("codeaction")
|
||||
def phase_codeaction():
|
||||
for lazy in (True, False):
|
||||
for label, relative, needle, occurrence, fanout, offset in sites.FANOUT_CURSORS:
|
||||
with session("workspace", resolve_support=lazy) as s:
|
||||
settled(s)
|
||||
if relative != sites.TB:
|
||||
s.did_open(sites.path(relative))
|
||||
s.wait_quiet(0.6)
|
||||
s.take_notifications()
|
||||
params = code_action_params(relative, needle, occurrence, offset)
|
||||
ms = tries(s, "textDocument/codeAction", params, ARGS.tries + 1)
|
||||
_, message = s.request("textDocument/codeAction", params)
|
||||
record(phase="codeaction",
|
||||
row="%s (fan-out %d), %s" % (label, fanout, "lazy" if lazy else "eager"),
|
||||
ms=ms, n=result_count(message),
|
||||
titles=[a.get("title") for a in (message.get("result") or [])])
|
||||
with session("workspace", resolve_support=lazy) as s:
|
||||
settled(s)
|
||||
params = code_action_params(sites.TB, " // ", 1, 2)
|
||||
ms = tries(s, "textDocument/codeAction", params, ARGS.tries + 1)
|
||||
_, message = s.request("textDocument/codeAction", params)
|
||||
record(phase="codeaction", row="comment line, %s" % ("lazy" if lazy else "eager"),
|
||||
ms=ms, n=result_count(message))
|
||||
|
||||
|
||||
@phase("portaction")
|
||||
def phase_portaction():
|
||||
"""The one opentitan cursor that offers a port refactoring: offer + resolve."""
|
||||
for lazy in (True, False):
|
||||
with session("workspace", resolve_support=lazy) as s:
|
||||
settled(s)
|
||||
s.did_open(sites.path(sites.AES_WRAP))
|
||||
s.wait_quiet(0.6)
|
||||
s.take_notifications()
|
||||
params = code_action_params(sites.AES_WRAP, " aes #(", 1, 2)
|
||||
ms = tries(s, "textDocument/codeAction", params, ARGS.tries + 1)
|
||||
_, message = s.request("textDocument/codeAction", params)
|
||||
offered = message.get("result") or []
|
||||
record(phase="portaction",
|
||||
row="aes_wrap.sv offer, %s" % ("lazy" if lazy else "eager"),
|
||||
ms=ms, n=len(offered),
|
||||
titles=[a.get("title") for a in offered],
|
||||
has_edit=[("edit" in a) for a in offered])
|
||||
if lazy and offered:
|
||||
resolves = [s.ms("codeAction/resolve", offered[0])
|
||||
for _ in range(ARGS.tries + 1)]
|
||||
_, resolved = s.request("codeAction/resolve", offered[0])
|
||||
edit = (resolved.get("result") or {}).get("edit") or {}
|
||||
files = edit.get("changes") or {u: 1 for u in
|
||||
(c.get("textDocument", {}).get("uri")
|
||||
for c in edit.get("documentChanges") or [])}
|
||||
record(phase="portaction", row="aes_wrap.sv codeAction/resolve", ms=resolves,
|
||||
n=len(files), titles=[(resolved.get("result") or {}).get("title")])
|
||||
|
||||
|
||||
# =========================================================================
|
||||
# §6c / §49 — rename, and the hierarchical tail
|
||||
# =========================================================================
|
||||
|
||||
|
||||
@phase("rename")
|
||||
def phase_rename():
|
||||
with session("workspace") as s:
|
||||
settled(s)
|
||||
where = at(sites.TB, " aes #(", 1, 2)
|
||||
ms = tries(s, "textDocument/prepareRename", where, ARGS.tries + 1)
|
||||
_, message = s.request("textDocument/prepareRename", where)
|
||||
record(phase="rename", row="prepareRename on aes", ms=ms,
|
||||
note=json.dumps(message.get("result")))
|
||||
params = dict(where, newName="aes_renamed")
|
||||
ms = tries(s, "textDocument/rename", params, ARGS.tries + 1)
|
||||
_, message = s.request("textDocument/rename", params)
|
||||
record(phase="rename", row="rename aes -> aes_renamed", ms=ms,
|
||||
n=len(phases_new.edited_uris(message)))
|
||||
|
||||
|
||||
|
||||
@phase("blockers")
|
||||
def phase_blockers():
|
||||
leaders = [
|
||||
("codeAction on the aes token", "textDocument/codeAction",
|
||||
lambda: code_action_params(sites.TB, " aes #(", 1, 2)),
|
||||
("prepareRename on aes", "textDocument/prepareRename",
|
||||
lambda: at(sites.TB, " aes #(", 1, 2)),
|
||||
("rename on aes", "textDocument/rename",
|
||||
lambda: dict(at(sites.TB, " aes #(", 1, 2), newName="aes_renamed")),
|
||||
("workspace/symbol 'aes'", "workspace/symbol", lambda: {"query": "aes"}),
|
||||
]
|
||||
followers = [
|
||||
("definition", "textDocument/definition", lambda: at(sites.TB, " aes #(", 1, 2)),
|
||||
("hover", "textDocument/hover", lambda: at(sites.TB, " aes #(", 1, 2)),
|
||||
("documentSymbol", "textDocument/documentSymbol",
|
||||
lambda: {"textDocument": doc(sites.TB)}),
|
||||
]
|
||||
for row, method, make in leaders:
|
||||
own, behind = [], []
|
||||
for _ in range(ARGS.tries):
|
||||
with session("workspace") as s:
|
||||
settled(s)
|
||||
lead = s.send(method, make())
|
||||
ids = [(name, s.send(m, mk())) for name, m, mk in followers]
|
||||
own.append(s.await_id(lead)[0])
|
||||
behind.append([(name, s.await_id(rid)[0]) for name, rid in ids])
|
||||
record(phase="blockers", row=row, ms=own,
|
||||
note=" | ".join("; ".join("%s %.2f" % (n, v) for n, v in one)
|
||||
for one in behind))
|
||||
|
||||
|
||||
# =========================================================================
|
||||
# §5 / §46 — the didOpen widen, and the didOpen delay
|
||||
# =========================================================================
|
||||
|
||||
|
||||
@phase("widen")
|
||||
def phase_widen():
|
||||
"""§5 — a `didOpen` that may widen the scope, then the request behind it.
|
||||
|
||||
One session per (scope, cache, try): the widen is a once-per-session event,
|
||||
so a second try inside the same session would measure nothing.
|
||||
"""
|
||||
for scope in ("depth0", "default"):
|
||||
for cache in ("cold", "warm"):
|
||||
runs = {relative: [] for relative in sites.WIDEN_FILES}
|
||||
seconds = {relative: [] for relative in sites.WIDEN_FILES}
|
||||
for _ in range(ARGS.tries):
|
||||
with session(scope, cold=(cache == "cold"),
|
||||
storage_name="widen-" + scope) as s:
|
||||
settled(s)
|
||||
for relative in sites.WIDEN_FILES:
|
||||
started = time.perf_counter()
|
||||
s.did_open(sites.path(relative))
|
||||
s.ms("textDocument/definition", at(relative, "module ", 1, 0))
|
||||
runs[relative].append((time.perf_counter() - started) * 1000.0)
|
||||
seconds[relative].append(
|
||||
s.ms("textDocument/definition", at(relative, "module ", 1, 0)))
|
||||
s.wait_quiet(0.5)
|
||||
s.take_notifications()
|
||||
for relative in sites.WIDEN_FILES:
|
||||
record(phase="widen",
|
||||
row="%s @ %s, %s" % (os.path.basename(relative), scope, cache),
|
||||
ms=runs[relative],
|
||||
note="second definition " + " / ".join(
|
||||
"%.2f" % v for v in seconds[relative]))
|
||||
|
||||
|
||||
# =========================================================================
|
||||
# diagnostics, completion, hierarchy, RSS
|
||||
# =========================================================================
|
||||
|
||||
|
||||
@phase("diagnostics")
|
||||
def phase_diagnostics():
|
||||
with session("workspace") as s:
|
||||
settled(s)
|
||||
text = open(sites.path(sites.TB), encoding="utf-8", errors="replace").read()
|
||||
runs = []
|
||||
for version in range(2, 2 + ARGS.tries + 1):
|
||||
s.take_notifications()
|
||||
started = time.perf_counter()
|
||||
s.did_change(sites.path(sites.TB), text + "\n// take4 %d\n" % version, version)
|
||||
while True:
|
||||
s.drain()
|
||||
if any(n["method"] == "textDocument/publishDiagnostics"
|
||||
for n in s.notifications):
|
||||
break
|
||||
if time.perf_counter() - started > 30:
|
||||
raise TimeoutError("no diagnostics published")
|
||||
time.sleep(0.001)
|
||||
runs.append((time.perf_counter() - started) * 1000.0)
|
||||
record(phase="diagnostics", row="publish after didChange (incl. ~150 ms debounce)",
|
||||
ms=runs)
|
||||
|
||||
|
||||
@phase("completion")
|
||||
def phase_completion():
|
||||
with session("workspace") as s:
|
||||
settled(s)
|
||||
text = open(sites.path(sites.TB), encoding="utf-8", errors="replace").read()
|
||||
base = text.rstrip("\n")
|
||||
for version, prefix in enumerate(sites.COMPLETION_PREFIXES, start=2):
|
||||
body = base + "\n" + prefix + "\n"
|
||||
s.did_change(sites.path(sites.TB), body, version)
|
||||
where = {"textDocument": doc(sites.TB),
|
||||
"position": {"line": body.count("\n") - 1, "character": len(prefix)}}
|
||||
ms = tries(s, "textDocument/completion", where, ARGS.tries + 1)
|
||||
_, message = s.request("textDocument/completion", where)
|
||||
record(phase="completion", row="completion after %r" % prefix, ms=ms,
|
||||
n=result_count(message))
|
||||
|
||||
|
||||
@phase("probe")
|
||||
def phase_probe():
|
||||
"""Ad-hoc: what does a cursor offer? `--probe FILE:LINE:CHAR` (0-based)."""
|
||||
relative, line, character = ARGS.probe.rsplit(":", 2)
|
||||
where = {"line": int(line), "character": int(character)}
|
||||
with session("workspace", resolve_support=True) as s:
|
||||
settled(s)
|
||||
s.did_open(sites.path(relative))
|
||||
s.wait_quiet(0.8)
|
||||
s.take_notifications()
|
||||
params = {"textDocument": doc(relative), "range": {"start": where, "end": where},
|
||||
"context": {"diagnostics": []}}
|
||||
ms = tries(s, "textDocument/codeAction", params, 2)
|
||||
_, message = s.request("textDocument/codeAction", params)
|
||||
offered = message.get("result") or []
|
||||
record(phase="probe", row="%s %s:%s" % (relative, line, character), ms=ms,
|
||||
n=len(offered), titles=[a.get("title") for a in offered])
|
||||
|
||||
|
||||
def main():
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument("phase", choices=sorted(harness.PHASES))
|
||||
parser.add_argument("--server", required=True)
|
||||
parser.add_argument("--label", required=True)
|
||||
parser.add_argument("--opentitan", default=sites.ROOT)
|
||||
parser.add_argument("--storage", required=True)
|
||||
parser.add_argument("--out", required=True)
|
||||
parser.add_argument("--tries", type=int, default=3)
|
||||
parser.add_argument("--probe", default="",
|
||||
help="for the `probe` phase: FILE:LINE:CHAR, 0-based")
|
||||
harness.configure(parser.parse_args())
|
||||
harness.PHASES[ARGS.phase]()
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
@@ -0,0 +1,128 @@
|
||||
"""What every phase shares: the registry, the session factory, the recorder.
|
||||
|
||||
`bench.py` owns the command line and the take-3 table's phases; `phases_new.py`
|
||||
owns the phases for what 0.44–0.49 added. Both import from here, so the run's
|
||||
configuration lives in exactly one place.
|
||||
|
||||
`ARGS` is a `Namespace` that is *mutated* by [`configure`], never rebound, so
|
||||
`from harness import ARGS` in another module keeps seeing the live values.
|
||||
"""
|
||||
|
||||
import argparse
|
||||
import json
|
||||
import os
|
||||
import time
|
||||
|
||||
import sites
|
||||
from lspclient import Session, find_position, summarize, uri # noqa: F401
|
||||
|
||||
PHASES = {}
|
||||
|
||||
#: The run's configuration. Filled by `configure()`; never reassigned.
|
||||
ARGS = argparse.Namespace(
|
||||
server=None, label=None, opentitan=None, storage=None, out=None,
|
||||
tries=3, probe="",
|
||||
)
|
||||
|
||||
|
||||
def configure(parsed):
|
||||
"""Adopt a parsed command line, and point `sites` at the corpus."""
|
||||
for key, value in vars(parsed).items():
|
||||
setattr(ARGS, key, value)
|
||||
ARGS.opentitan = os.path.abspath(ARGS.opentitan)
|
||||
ARGS.out = os.path.abspath(ARGS.out)
|
||||
sites.ROOT = ARGS.opentitan
|
||||
os.makedirs(ARGS.storage, exist_ok=True)
|
||||
|
||||
|
||||
def phase(name):
|
||||
"""Register a phase under the name `bench.py <name>` runs."""
|
||||
|
||||
def register(fn):
|
||||
PHASES[name] = fn
|
||||
return fn
|
||||
|
||||
return register
|
||||
|
||||
|
||||
def record(**fields):
|
||||
"""Append one row to results.jsonl and echo it as a readable line."""
|
||||
fields.setdefault("ts", time.strftime("%Y-%m-%dT%H:%M:%S"))
|
||||
fields.setdefault("label", ARGS.label)
|
||||
with open(ARGS.out, "a", encoding="utf-8") as handle:
|
||||
handle.write(json.dumps(fields) + "\n")
|
||||
ms = fields.get("ms")
|
||||
shown = " ".join("%.3f" % v for v in ms) if ms else ""
|
||||
print("%-11s %-52s %s %s" % (fields["phase"], fields.get("row", ""), shown,
|
||||
fields.get("note", "")), flush=True)
|
||||
|
||||
|
||||
def session(scope="workspace", cold=False, resolve_support=True, verbose=False,
|
||||
storage_name=None):
|
||||
"""A session at one scope, its index store under `--storage/<name>`.
|
||||
|
||||
Never the default store: the corpus must not be written near, and cache
|
||||
warmth has to be controllable per cell.
|
||||
"""
|
||||
store = os.path.join(ARGS.storage, storage_name or scope)
|
||||
return Session(
|
||||
server=ARGS.server,
|
||||
root=sites.ROOT,
|
||||
storage=store,
|
||||
scope=sites.SCOPES[scope],
|
||||
resolve_support=resolve_support,
|
||||
verbose=verbose,
|
||||
cold=cold,
|
||||
)
|
||||
|
||||
|
||||
def settled(s, open_file=sites.TB):
|
||||
"""Initialize, open a buffer, and wait for the scan to go quiet."""
|
||||
s.initialize()
|
||||
s.did_open(sites.path(open_file))
|
||||
s.wait_quiet(1.5)
|
||||
s.take_notifications()
|
||||
return s
|
||||
|
||||
|
||||
def tries(s, method, params, n=None):
|
||||
"""`n` identical requests; returns the millisecond list."""
|
||||
n = n or ARGS.tries
|
||||
return [s.ms(method, params) for _ in range(n)]
|
||||
|
||||
|
||||
def pos(relative, needle, occurrence=1, offset=0):
|
||||
"""0-based `{line, character}` of a token, resolved from the file text."""
|
||||
line, character = find_position(sites.path(relative), needle, occurrence, offset)
|
||||
return {"line": line, "character": character}
|
||||
|
||||
|
||||
def doc(relative):
|
||||
return {"uri": uri(sites.path(relative))}
|
||||
|
||||
|
||||
def at(relative, needle, occurrence=1, offset=0):
|
||||
"""A position request's params at a token."""
|
||||
return {"textDocument": doc(relative), "position": pos(relative, needle, occurrence, offset)}
|
||||
|
||||
|
||||
def code_action_params(relative, needle, occurrence=1, offset=0):
|
||||
"""A zero-width `textDocument/codeAction` range at a token."""
|
||||
where = pos(relative, needle, occurrence, offset)
|
||||
return {
|
||||
"textDocument": doc(relative),
|
||||
"range": {"start": where, "end": where},
|
||||
"context": {"diagnostics": []},
|
||||
}
|
||||
|
||||
|
||||
def result_count(message):
|
||||
"""How many things an answer carried — a list, an item list, or one thing."""
|
||||
result = message.get("result")
|
||||
if result is None:
|
||||
return 0
|
||||
if isinstance(result, list):
|
||||
return len(result)
|
||||
if isinstance(result, dict) and "items" in result:
|
||||
return len(result["items"])
|
||||
return 1
|
||||
@@ -0,0 +1,394 @@
|
||||
"""A minimal LSP client for the lucisv performance rounds.
|
||||
|
||||
Framed JSON-RPC over a `lucisv-server` child process's stdio. Python 3
|
||||
standard library only, no third-party packages, so it runs from a clean
|
||||
checkout with nothing installed.
|
||||
|
||||
What it does that a generic client does not, and why each exists:
|
||||
|
||||
- **The configuration pull is answered per session.** `lucisv-server` pulls
|
||||
`workspace/configuration` for the `lucisv` section; the index scope it gets
|
||||
back decides how many files are scanned, which is the single biggest lever
|
||||
on every number in a perf round. `Session(scope=...)` writes that reply.
|
||||
- **Client capabilities are settable per session.** A session that advertises
|
||||
`textDocument.codeAction.resolveSupport.properties: ["edit"]` gets the lazy
|
||||
`codeAction` offer (TODO §37.1); one that does not gets the eager shape.
|
||||
Both must be measurable from one harness.
|
||||
- **`storagePath` is always ours.** The index cache is directed at a scratch
|
||||
directory so cache warmth is controlled (delete it = cold) and so nothing
|
||||
is ever written near the corpus.
|
||||
- **`window/logMessage` is captured**, so a `--verbose` server's own
|
||||
`timing: <method> answered in <n> ms` lines can be read beside the wire.
|
||||
|
||||
Everything is timed with `time.perf_counter` from just before the write to
|
||||
just after the matching response is parsed: what an editor experiences.
|
||||
"""
|
||||
|
||||
import json
|
||||
import os
|
||||
import re
|
||||
import shutil
|
||||
import subprocess
|
||||
import threading
|
||||
import time
|
||||
|
||||
# The server's own timing line, from `--verbose` (docs/features/verbose-timing).
|
||||
TIMING_LINE = re.compile(r"timing: (\S+) answered in ([0-9.]+) ?ms")
|
||||
|
||||
|
||||
def uri(path):
|
||||
"""A `file://` URI for an absolute path, percent-encoding what LSP needs."""
|
||||
from urllib.parse import quote
|
||||
|
||||
return "file://" + quote(os.path.abspath(path))
|
||||
|
||||
|
||||
class Session:
|
||||
"""One `lucisv-server` process, driven over stdio.
|
||||
|
||||
Use as a context manager; the process is shut down and reaped on exit.
|
||||
"""
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
server,
|
||||
root,
|
||||
storage,
|
||||
scope=None,
|
||||
resolve_support=True,
|
||||
verbose=False,
|
||||
cold=False,
|
||||
guard=None,
|
||||
):
|
||||
self.server = server
|
||||
self.root = os.path.abspath(root)
|
||||
self.storage = os.path.abspath(storage)
|
||||
self.scope = scope if scope is not None else {}
|
||||
self.resolve_support = resolve_support
|
||||
self.verbose = verbose
|
||||
self.next_id = 1
|
||||
self.notifications = [] # every server->client notification, in order
|
||||
self.log_messages = [] # window/logMessage texts only
|
||||
self.timings = [] # (method, ms) from a --verbose server
|
||||
self.pending = {} # id -> (method, sent_at) for in-flight requests
|
||||
self.proc = None
|
||||
self._reader = None
|
||||
self._lock = threading.Lock()
|
||||
self._inbox = [] # parsed messages not yet consumed
|
||||
self._cond = threading.Condition(self._lock)
|
||||
self._cold = cold
|
||||
self._guard = guard or []
|
||||
|
||||
# -- lifecycle ---------------------------------------------------------
|
||||
|
||||
def __enter__(self):
|
||||
if self._cold:
|
||||
shutil.rmtree(self.storage, ignore_errors=True)
|
||||
os.makedirs(self.storage, exist_ok=True)
|
||||
cmd = list(self._guard) + [self.server]
|
||||
if self.verbose:
|
||||
cmd.append("--verbose")
|
||||
cmd.append("--stdio")
|
||||
self.proc = subprocess.Popen(
|
||||
cmd,
|
||||
stdin=subprocess.PIPE,
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.DEVNULL,
|
||||
)
|
||||
self._reader = threading.Thread(target=self._read_loop, daemon=True)
|
||||
self._reader.start()
|
||||
return self
|
||||
|
||||
def __exit__(self, *_):
|
||||
self.close()
|
||||
return False
|
||||
|
||||
def close(self):
|
||||
if self.proc is None:
|
||||
return
|
||||
try:
|
||||
self.notify("exit", None)
|
||||
except Exception:
|
||||
pass
|
||||
try:
|
||||
self.proc.stdin.close()
|
||||
except Exception:
|
||||
pass
|
||||
try:
|
||||
self.proc.wait(timeout=10)
|
||||
except Exception:
|
||||
self.proc.kill()
|
||||
self.proc.wait()
|
||||
self.proc = None
|
||||
|
||||
# -- framing -----------------------------------------------------------
|
||||
|
||||
def _write(self, message):
|
||||
body = json.dumps(message).encode("utf-8")
|
||||
header = ("Content-Length: %d\r\n\r\n" % len(body)).encode("ascii")
|
||||
self.proc.stdin.write(header + body)
|
||||
self.proc.stdin.flush()
|
||||
|
||||
def _read_loop(self):
|
||||
stream = self.proc.stdout
|
||||
while True:
|
||||
length = None
|
||||
while True:
|
||||
line = stream.readline()
|
||||
if not line:
|
||||
return
|
||||
line = line.decode("utf-8", "replace").strip()
|
||||
if line == "":
|
||||
break
|
||||
if line.lower().startswith("content-length:"):
|
||||
length = int(line.split(":", 1)[1].strip())
|
||||
if length is None:
|
||||
continue
|
||||
payload = b""
|
||||
while len(payload) < length:
|
||||
chunk = stream.read(length - len(payload))
|
||||
if not chunk:
|
||||
return
|
||||
payload += chunk
|
||||
try:
|
||||
message = json.loads(payload.decode("utf-8"))
|
||||
except ValueError:
|
||||
continue
|
||||
self._dispatch(message)
|
||||
|
||||
def _dispatch(self, message):
|
||||
with self._cond:
|
||||
self._inbox.append(message)
|
||||
self._cond.notify_all()
|
||||
# Server->client requests must be answered from the reader thread, or
|
||||
# the server blocks and every timing after it is a lie.
|
||||
if "method" in message and "id" in message:
|
||||
self._answer_server_request(message)
|
||||
|
||||
def _answer_server_request(self, message):
|
||||
method = message["method"]
|
||||
if method == "workspace/configuration":
|
||||
items = message.get("params", {}).get("items", [])
|
||||
self._write(
|
||||
{
|
||||
"jsonrpc": "2.0",
|
||||
"id": message["id"],
|
||||
"result": [self.scope for _ in items] or [self.scope],
|
||||
}
|
||||
)
|
||||
elif method in ("window/workDoneProgress/create", "client/registerCapability"):
|
||||
self._write({"jsonrpc": "2.0", "id": message["id"], "result": None})
|
||||
else:
|
||||
self._write({"jsonrpc": "2.0", "id": message["id"], "result": None})
|
||||
|
||||
# -- traffic -----------------------------------------------------------
|
||||
|
||||
def notify(self, method, params):
|
||||
self._write({"jsonrpc": "2.0", "method": method, "params": params})
|
||||
|
||||
def send(self, method, params):
|
||||
"""Send a request without waiting; returns its id (for pipelining)."""
|
||||
rid = self.next_id
|
||||
self.next_id += 1
|
||||
self.pending[rid] = (method, time.perf_counter())
|
||||
self._write({"jsonrpc": "2.0", "id": rid, "method": method, "params": params})
|
||||
return rid
|
||||
|
||||
def await_id(self, rid, timeout=300.0):
|
||||
"""Wait for the response to `rid`; returns (elapsed_ms, message)."""
|
||||
deadline = time.time() + timeout
|
||||
while True:
|
||||
with self._cond:
|
||||
for i, message in enumerate(self._inbox):
|
||||
if message.get("id") == rid and "method" not in message:
|
||||
self._inbox.pop(i)
|
||||
done = time.perf_counter()
|
||||
_, sent = self.pending.pop(rid)
|
||||
self._drain_locked()
|
||||
return (done - sent) * 1000.0, message
|
||||
self._drain_locked()
|
||||
remaining = deadline - time.time()
|
||||
if remaining <= 0:
|
||||
raise TimeoutError("no response to request %d" % rid)
|
||||
self._cond.wait(min(remaining, 0.05))
|
||||
|
||||
def request(self, method, params, timeout=300.0):
|
||||
"""Send and wait. Returns (elapsed_ms, result_or_error_message)."""
|
||||
return self.await_id(self.send(method, params), timeout)
|
||||
|
||||
def ms(self, method, params, timeout=300.0):
|
||||
"""Just the round trip in milliseconds."""
|
||||
return self.request(method, params, timeout)[0]
|
||||
|
||||
# -- notification bookkeeping -----------------------------------------
|
||||
|
||||
def _drain_locked(self):
|
||||
"""Move server notifications out of the inbox into the log."""
|
||||
kept = []
|
||||
for message in self._inbox:
|
||||
if "method" in message and "id" not in message:
|
||||
self.notifications.append(message)
|
||||
if message["method"] == "window/logMessage":
|
||||
text = message.get("params", {}).get("message", "")
|
||||
self.log_messages.append(text)
|
||||
found = TIMING_LINE.search(text)
|
||||
if found:
|
||||
self.timings.append((found.group(1), float(found.group(2))))
|
||||
else:
|
||||
kept.append(message)
|
||||
self._inbox[:] = kept
|
||||
|
||||
def drain(self):
|
||||
with self._cond:
|
||||
self._drain_locked()
|
||||
|
||||
def wait_quiet(self, quiet=1.5, timeout=300.0):
|
||||
"""Block until no notification has arrived for `quiet` seconds.
|
||||
|
||||
The scan's end is not one message: `$/progress` `end` can be followed
|
||||
by more indexing chatter, so silence is the reliable barrier. Returns
|
||||
the seconds from entry to the last notification seen.
|
||||
"""
|
||||
started = time.perf_counter()
|
||||
last = time.perf_counter()
|
||||
seen = len(self.notifications)
|
||||
deadline = time.time() + timeout
|
||||
while True:
|
||||
self.drain()
|
||||
if len(self.notifications) != seen:
|
||||
seen = len(self.notifications)
|
||||
last = time.perf_counter()
|
||||
if time.perf_counter() - last >= quiet:
|
||||
return (last - started) * 1000.0
|
||||
if time.time() > deadline:
|
||||
raise TimeoutError("server never went quiet")
|
||||
time.sleep(0.005)
|
||||
|
||||
def take_notifications(self, method=None):
|
||||
"""Consume and return the notifications logged so far."""
|
||||
self.drain()
|
||||
found = [n for n in self.notifications if method is None or n["method"] == method]
|
||||
self.notifications = []
|
||||
return found
|
||||
|
||||
def take_timings(self, method=None):
|
||||
self.drain()
|
||||
found = [t for t in self.timings if method is None or t[0] == method]
|
||||
self.timings = []
|
||||
return found
|
||||
|
||||
# -- protocol shortcuts ------------------------------------------------
|
||||
|
||||
def capabilities(self):
|
||||
"""The client capabilities this session advertises."""
|
||||
code_action = {
|
||||
"codeActionLiteralSupport": {
|
||||
"codeActionKind": {"valueSet": ["", "quickfix", "refactor", "source"]}
|
||||
},
|
||||
"dataSupport": True,
|
||||
}
|
||||
if self.resolve_support:
|
||||
code_action["resolveSupport"] = {"properties": ["edit"]}
|
||||
return {
|
||||
"workspace": {
|
||||
"configuration": True,
|
||||
"workspaceEdit": {"documentChanges": True},
|
||||
"symbol": {"dynamicRegistration": False},
|
||||
"didChangeConfiguration": {"dynamicRegistration": False},
|
||||
},
|
||||
"textDocument": {
|
||||
"synchronization": {"dynamicRegistration": False},
|
||||
"codeAction": code_action,
|
||||
"completion": {"completionItem": {"snippetSupport": True}},
|
||||
"hover": {"contentFormat": ["markdown", "plaintext"]},
|
||||
"rename": {"prepareSupport": True},
|
||||
"publishDiagnostics": {"relatedInformation": True},
|
||||
"semanticTokens": {
|
||||
"requests": {"full": True},
|
||||
"tokenTypes": [],
|
||||
"tokenModifiers": [],
|
||||
"formats": ["relative"],
|
||||
},
|
||||
"inlayHint": {"dynamicRegistration": False},
|
||||
},
|
||||
"window": {"workDoneProgress": True},
|
||||
}
|
||||
|
||||
def initialize(self):
|
||||
"""`initialize` + `initialized`; returns the request's milliseconds."""
|
||||
params = {
|
||||
"processId": os.getpid(),
|
||||
"rootUri": uri(self.root),
|
||||
"capabilities": self.capabilities(),
|
||||
"initializationOptions": {"storagePath": self.storage},
|
||||
"workspaceFolders": [{"uri": uri(self.root), "name": "opentitan"}],
|
||||
}
|
||||
elapsed, _ = self.request("initialize", params)
|
||||
self.notify("initialized", {})
|
||||
return elapsed
|
||||
|
||||
def did_open(self, path, language="systemverilog"):
|
||||
with open(path, "r", encoding="utf-8", errors="replace") as handle:
|
||||
text = handle.read()
|
||||
self.notify(
|
||||
"textDocument/didOpen",
|
||||
{
|
||||
"textDocument": {
|
||||
"uri": uri(path),
|
||||
"languageId": language,
|
||||
"version": 1,
|
||||
"text": text,
|
||||
}
|
||||
},
|
||||
)
|
||||
return text
|
||||
|
||||
def did_change(self, path, text, version=2):
|
||||
self.notify(
|
||||
"textDocument/didChange",
|
||||
{
|
||||
"textDocument": {"uri": uri(path), "version": version},
|
||||
"contentChanges": [{"text": text}],
|
||||
},
|
||||
)
|
||||
|
||||
def at(self, path, line, character, method, extra=None):
|
||||
"""A position request's params, 0-based line and UTF-16 character."""
|
||||
params = {
|
||||
"textDocument": {"uri": uri(path)},
|
||||
"position": {"line": line, "character": character},
|
||||
}
|
||||
if extra:
|
||||
params.update(extra)
|
||||
return method, params
|
||||
|
||||
|
||||
def find_position(path, needle, occurrence=1, offset=0):
|
||||
"""0-based (line, character) of the `occurrence`th `needle` in a file.
|
||||
|
||||
Positions are resolved from the text at run time rather than hard-coded,
|
||||
so a corpus that moves by a line does not silently measure the wrong
|
||||
token. `offset` shifts the character within the match.
|
||||
"""
|
||||
with open(path, "r", encoding="utf-8", errors="replace") as handle:
|
||||
seen = 0
|
||||
for number, line in enumerate(handle):
|
||||
start = 0
|
||||
while True:
|
||||
found = line.find(needle, start)
|
||||
if found < 0:
|
||||
break
|
||||
seen += 1
|
||||
if seen == occurrence:
|
||||
return number, found + offset
|
||||
start = found + 1
|
||||
raise LookupError("%r not found %dx in %s" % (needle, occurrence, path))
|
||||
|
||||
|
||||
def summarize(values):
|
||||
"""(first, min_of_repeats, max_of_repeats) from a try list."""
|
||||
if not values:
|
||||
return None, None, None
|
||||
if len(values) == 1:
|
||||
return values[0], values[0], values[0]
|
||||
return values[0], min(values[1:]), max(values[1:])
|
||||
Executable
+47
@@ -0,0 +1,47 @@
|
||||
#!/usr/bin/env bash
|
||||
# The per-file outcome runs, for the release-to-release outcome diff.
|
||||
#
|
||||
# tools/perf/outcomes.sh <lucisv-binary> <label> <opentitan-dir> <out-dir>
|
||||
#
|
||||
# `format --check --no-cache` and `check` over the five trees, with every
|
||||
# per-file line kept. `--no-cache` so the verdict is computed, never recalled,
|
||||
# and so the two binaries are compared on the same work. Paths are rewritten
|
||||
# relative to the corpus root, so two runs differ only where an *outcome* did.
|
||||
#
|
||||
# Writes `<out-dir>/<label>.format.txt`, `<label>.check.txt`,
|
||||
# `<label>.check-select.txt`. Diff two labels with:
|
||||
#
|
||||
# diff <out-dir>/0.43.0.format.txt <out-dir>/0.49.0.format.txt
|
||||
#
|
||||
# Untimed — correctness, not timing — so it is safe to run beside other work.
|
||||
# Still guarded, like every `lucisv` invocation in this round.
|
||||
set -u
|
||||
|
||||
BIN=${1:?usage: outcomes.sh <binary> <label> <opentitan> <outdir>}
|
||||
LABEL=${2:?}
|
||||
OT=${3:?}
|
||||
OUT=${4:?}
|
||||
|
||||
HERE=$(cd "$(dirname "$0")" && pwd)
|
||||
GUARD="$HERE/../guard.sh"
|
||||
TREES="hw/ip hw/top_earlgrey/ip hw/top_darjeeling/ip hw/dv hw/vendor"
|
||||
|
||||
mkdir -p "$OUT"
|
||||
|
||||
emit() {
|
||||
local suffix=$1
|
||||
shift
|
||||
local out="$OUT/${LABEL}.${suffix}.txt"
|
||||
: >"$out"
|
||||
for tree in $TREES; do
|
||||
echo "=== $tree ===" >>"$out"
|
||||
"$GUARD" -m 8 -t 1800 -- "$BIN" "$@" "$OT/$tree" 2>&1 |
|
||||
sed "s#$OT/##g" |
|
||||
LC_ALL=C sort >>"$out"
|
||||
done
|
||||
echo "wrote $out"
|
||||
}
|
||||
|
||||
emit format format --no-cache --check
|
||||
emit check check
|
||||
emit check-select check --select error,warning,style
|
||||
@@ -0,0 +1,191 @@
|
||||
#!/usr/bin/env python3
|
||||
"""The phases for what 0.44–0.49 added: the new offer sites, §49's
|
||||
hierarchical surface, §46's `didOpen` fix on the wire, `lucisv/moduleHierarchy`
|
||||
and the index's cost on disk and in memory.
|
||||
|
||||
Imported by `bench.py`, which owns the registry and the command line; nothing
|
||||
here is run directly. Split out of `bench.py` so each file stays inside
|
||||
CLAUDE.md's size rule and each has one sentence: `bench.py` is the take-3
|
||||
table, this is what changed since it.
|
||||
"""
|
||||
|
||||
import json
|
||||
import os
|
||||
import subprocess
|
||||
import time
|
||||
|
||||
from harness import (
|
||||
ARGS, Session, at, code_action_params, doc, phase, pos, record,
|
||||
result_count, session, settled, sites, tries,
|
||||
)
|
||||
|
||||
|
||||
@phase("refactor")
|
||||
def phase_refactor():
|
||||
"""The offer sites 0.44–0.49 added: what is offered, and what it costs."""
|
||||
for label, relative, needle, occurrence, offset in sites.REFACTOR_SITES:
|
||||
with session("workspace", resolve_support=True) as s:
|
||||
settled(s)
|
||||
s.did_open(sites.path(relative))
|
||||
s.wait_quiet(0.6)
|
||||
s.take_notifications()
|
||||
params = code_action_params(relative, needle, occurrence, offset)
|
||||
ms = tries(s, "textDocument/codeAction", params, ARGS.tries + 1)
|
||||
_, message = s.request("textDocument/codeAction", params)
|
||||
offered = message.get("result") or []
|
||||
record(phase="refactor", row="%s offer" % label, ms=ms, n=len(offered),
|
||||
titles=[a.get("title") for a in offered],
|
||||
file=relative, position=params["range"]["start"])
|
||||
for action in offered:
|
||||
if "edit" in action:
|
||||
continue
|
||||
resolves = [s.ms("codeAction/resolve", action) for _ in range(ARGS.tries + 1)]
|
||||
_, resolved = s.request("codeAction/resolve", action)
|
||||
edit = (resolved.get("result") or {}).get("edit") or {}
|
||||
record(phase="refactor", row="%s resolve: %s" % (label, action.get("title")),
|
||||
ms=resolves, n=len(edit.get("changes") or
|
||||
edit.get("documentChanges") or []))
|
||||
# `extract module` is a selection, not a point.
|
||||
relative, first, first_n, last, last_n = sites.EXTRACT_SELECTION
|
||||
start = pos(relative, first, first_n)
|
||||
end = pos(relative, last, last_n)
|
||||
end = {"line": end["line"], "character": end["character"] + len(last)}
|
||||
with session("workspace", resolve_support=True) as s:
|
||||
settled(s)
|
||||
s.did_open(sites.path(relative))
|
||||
s.wait_quiet(0.6)
|
||||
s.take_notifications()
|
||||
params = {"textDocument": doc(relative),
|
||||
"range": {"start": start, "end": end},
|
||||
"context": {"diagnostics": []}}
|
||||
ms = tries(s, "textDocument/codeAction", params, ARGS.tries + 1)
|
||||
_, message = s.request("textDocument/codeAction", params)
|
||||
offered = message.get("result") or []
|
||||
record(phase="refactor", row="extract-module offer (selection)", ms=ms, n=len(offered),
|
||||
titles=[a.get("title") for a in offered], file=relative,
|
||||
position=start, note="selection %d:%d-%d:%d" % (
|
||||
start["line"], start["character"], end["line"], end["character"]))
|
||||
for action in offered:
|
||||
if "edit" in action:
|
||||
continue
|
||||
resolves = [s.ms("codeAction/resolve", action) for _ in range(ARGS.tries + 1)]
|
||||
record(phase="refactor", row="extract-module resolve: %s" % action.get("title"),
|
||||
ms=resolves)
|
||||
|
||||
|
||||
@phase("tailrename")
|
||||
def phase_tailrename():
|
||||
"""§49 — a net renamed at its declaration, named through an instance tail."""
|
||||
relative, needle, occurrence, offset = sites.TAIL_RENAME
|
||||
with session("workspace") as s:
|
||||
settled(s)
|
||||
s.did_open(sites.path(relative))
|
||||
s.did_open(sites.path(sites.TAIL_TAIL_FILE))
|
||||
s.wait_quiet(0.8)
|
||||
s.take_notifications()
|
||||
where = at(relative, needle, occurrence, offset)
|
||||
record(phase="tailrename", row="tail rename cursor", ms=[0.0],
|
||||
note=json.dumps(where["position"]), file=relative)
|
||||
params = dict(where, newName="state_q_x")
|
||||
ms = tries(s, "textDocument/rename", params, ARGS.tries + 1)
|
||||
_, message = s.request("textDocument/rename", params)
|
||||
uris = edited_uris(message)
|
||||
tail = os.path.basename(sites.TAIL_TAIL_FILE)
|
||||
record(phase="tailrename",
|
||||
row="rename state_q (tail through u_entropy_src_main_sm)",
|
||||
ms=ms, n=len(uris),
|
||||
note="tail edited" if any(tail in u for u in uris) else "TAIL NOT EDITED",
|
||||
titles=sorted(os.path.basename(u) for u in uris))
|
||||
|
||||
def edited_uris(message):
|
||||
"""The URIs a `WorkspaceEdit` touches, whichever shape it came in."""
|
||||
edit = message.get("result") or {}
|
||||
if not isinstance(edit, dict):
|
||||
return []
|
||||
if edit.get("changes"):
|
||||
return list(edit["changes"].keys())
|
||||
return [c.get("textDocument", {}).get("uri", "")
|
||||
for c in edit.get("documentChanges") or []]
|
||||
|
||||
|
||||
@phase("didopen")
|
||||
def phase_didopen():
|
||||
"""§46 — `didOpen` → the request behind it, workspace scope, warm store."""
|
||||
for relative in sites.DIDOPEN_FILES:
|
||||
runs, seconds = [], []
|
||||
for _ in range(ARGS.tries):
|
||||
with session("workspace") as s:
|
||||
settled(s)
|
||||
started = time.perf_counter()
|
||||
s.did_open(sites.path(relative))
|
||||
s.ms("textDocument/definition", at(relative, "module ", 1, 0))
|
||||
runs.append((time.perf_counter() - started) * 1000.0)
|
||||
seconds.append(s.ms("textDocument/definition", at(relative, "module ", 1, 0)))
|
||||
lines = sum(1 for _ in open(sites.path(relative), encoding="utf-8", errors="replace"))
|
||||
record(phase="didopen", row="didOpen %s -> definition" % os.path.basename(relative),
|
||||
ms=runs, n=lines,
|
||||
note="second definition " + " / ".join("%.2f" % v for v in seconds))
|
||||
|
||||
|
||||
@phase("tailcompletion")
|
||||
def phase_tailcompletion():
|
||||
"""Completion after `u_x.` on an instance head (§49's surface)."""
|
||||
relative, needle, occurrence, offset = sites.TAIL_HEAD_COMPLETION
|
||||
with session("workspace") as s:
|
||||
settled(s)
|
||||
s.did_open(sites.path(relative))
|
||||
s.wait_quiet(0.8)
|
||||
s.take_notifications()
|
||||
where = at(relative, needle, occurrence, offset)
|
||||
ms = tries(s, "textDocument/completion", where, ARGS.tries + 1)
|
||||
_, message = s.request("textDocument/completion", where)
|
||||
items = (message.get("result") or {})
|
||||
items = items.get("items", items) if isinstance(items, dict) else items
|
||||
record(phase="tailcompletion",
|
||||
row="completion after an instance head + '.' (%s)" % os.path.basename(
|
||||
sites.path(relative)),
|
||||
ms=ms, n=result_count(message),
|
||||
titles=[i.get("label") for i in (items or [])[:8]])
|
||||
|
||||
|
||||
@phase("hierarchy")
|
||||
def phase_hierarchy():
|
||||
with session("workspace") as s:
|
||||
settled(s)
|
||||
ms = tries(s, "lucisv/moduleHierarchy", {}, ARGS.tries + 1)
|
||||
_, message = s.request("lucisv/moduleHierarchy", {})
|
||||
result = message.get("result") or {}
|
||||
payload = len(json.dumps(result))
|
||||
record(phase="hierarchy", row="lucisv/moduleHierarchy", ms=ms, n=payload,
|
||||
note="modules %d, files %d, schema %s" % (
|
||||
len(result.get("modules") or []), len(result.get("files") or []),
|
||||
result.get("schemaVersion")))
|
||||
|
||||
|
||||
@phase("rss")
|
||||
def phase_rss():
|
||||
"""Server peak RSS after the workspace scan, and the index store on disk.
|
||||
|
||||
RSS is read with `ps -o rss=` on the server's own pid a second after the
|
||||
scan settles, so it is the resident set of a server that has finished
|
||||
indexing and is idle — what an editor session actually holds.
|
||||
"""
|
||||
store = os.path.join(ARGS.storage, "rss")
|
||||
for cache in ("cold", "warm"):
|
||||
rss, size = [], "0"
|
||||
for _ in range(ARGS.tries):
|
||||
s = Session(server=ARGS.server, root=sites.ROOT, storage=store,
|
||||
scope=sites.SCOPES["workspace"], cold=(cache == "cold"))
|
||||
with s:
|
||||
settled(s)
|
||||
time.sleep(1.0)
|
||||
rss.append(float(subprocess.run(
|
||||
["ps", "-o", "rss=", "-p", str(s.proc.pid)],
|
||||
capture_output=True, text=True).stdout.strip()))
|
||||
size = subprocess.run(["du", "-sk", store], capture_output=True,
|
||||
text=True).stdout.split()[0]
|
||||
record(phase="rss", row="server RSS after workspace scan, %s cache" % cache,
|
||||
ms=rss, n=int(size),
|
||||
note="RSS KB above; index store %s KB" % size)
|
||||
|
||||
|
||||
@@ -0,0 +1,122 @@
|
||||
"""The opentitan positions every perf phase measures, resolved at run time.
|
||||
|
||||
Nothing here is a hard-coded line number: each site names the *text* it wants
|
||||
and `lspclient.find_position` locates it when the phase runs, so a corpus that
|
||||
moves by a line measures the same token rather than a silent neighbour. The
|
||||
0-based positions in `docs/performance_take4.md` are what these resolve to on
|
||||
opentitan `0098135264`.
|
||||
|
||||
`ROOT` is overridden by `bench.py --opentitan`; every path below hangs off it.
|
||||
"""
|
||||
|
||||
import os
|
||||
|
||||
ROOT = os.environ.get("OPENTITAN", "/Users/guoliangchen/repo/opentitan")
|
||||
|
||||
|
||||
def path(relative):
|
||||
return os.path.join(ROOT, relative)
|
||||
|
||||
|
||||
# -- the take-3 scenario files ---------------------------------------------
|
||||
|
||||
TB = "hw/ip/aes/dv/tb/tb.sv"
|
||||
AES = "hw/ip/aes/rtl/aes.sv"
|
||||
AES_CORE = "hw/ip/aes/rtl/aes_core.sv"
|
||||
AES_WRAP = "hw/ip/aes/rtl/aes_wrap.sv"
|
||||
AON_TIMER = "hw/ip/aon_timer/rtl/aon_timer.sv"
|
||||
KMAC = "hw/ip/kmac/rtl/kmac.sv"
|
||||
HMAC = "hw/ip/hmac/rtl/hmac.sv"
|
||||
SPI_DEVICE = "hw/ip/spi_device/rtl/spi_device.sv"
|
||||
PINMUX_REG_TOP = "hw/top_darjeeling/ip_autogen/pinmux/rtl/pinmux_reg_top.sv"
|
||||
AES_BIND = "hw/ip/aes/dv/sva/aes_bind.sv"
|
||||
ENTROPY_SRC_CORE = "hw/ip/entropy_src/rtl/entropy_src_core.sv"
|
||||
ENTROPY_SRC_SM = "hw/ip/entropy_src/rtl/entropy_src_main_sm.sv"
|
||||
SHA3_FPV = "hw/ip/kmac/fpv/tb/sha3_fpv.sv"
|
||||
AES_SBOX_MASKED = "hw/ip/aes/rtl/aes_sbox_canright_masked.sv"
|
||||
|
||||
# The take-3 `codeAction` cursors:
|
||||
# (label, file, needle, occurrence, fan-out, cursor offset into the needle).
|
||||
# The cursor lands on the module name. The fan-out is
|
||||
# `grep -rlE '^\s*<module>( |#|$)' --include='*.sv'` over the corpus,
|
||||
# re-derived for take 4 and identical to take 3's (1 / 6 / 42 / 67 / 128).
|
||||
# The fan-out is `grep -rlE '^\s*<module>( |#|$)' --include='*.sv'` over the
|
||||
# tree, re-derived for take 4 and identical to take 3's (1 / 6 / 42 / 67 / 128).
|
||||
FANOUT_CURSORS = [
|
||||
("aes_reg_top", AES, "aes_reg_top u_reg (", 1, 1, 0),
|
||||
("aes", TB, " aes #(", 1, 6, 2),
|
||||
("prim_lc_sync", AES, "prim_lc_sync #(", 1, 42, 0),
|
||||
("prim_alert_sender", AES, "prim_alert_sender #(", 1, 67, 0),
|
||||
("prim_flop_2sync", AON_TIMER, "prim_flop_2sync #(", 1, 128, 0),
|
||||
]
|
||||
|
||||
# The scope replies handed back to `workspace/configuration`, by name.
|
||||
SCOPES = {
|
||||
"default": {},
|
||||
"empty-index": {"index": {}},
|
||||
"depth0": {"index": {"scopeDepth": 0}},
|
||||
"workspace": {"index": {"scope": "workspace"}},
|
||||
}
|
||||
|
||||
# Files opened one at a time in the widen phases (§5), with their sizes.
|
||||
WIDEN_FILES = [AES, KMAC, HMAC, SPI_DEVICE]
|
||||
|
||||
# §46's didOpen → next-request files, the perf README's 2026-09-05 set.
|
||||
DIDOPEN_FILES = [AES, AES_CORE, SPI_DEVICE, PINMUX_REG_TOP]
|
||||
|
||||
# The five refactoring offer sites 0.44–0.49 added, each a real opentitan
|
||||
# position. `kind` names the action the site is meant to raise; the phase
|
||||
# records what is actually offered, which is the point of measuring it.
|
||||
# Each site was found by sweeping every instantiation-shaped and `import` line
|
||||
# in a set of RTL files and keeping the positions that actually offer (the
|
||||
# sweep is `bench.py probe`, one cursor at a time). The 0-based positions these
|
||||
# resolve to on opentitan `0098135264` are named in `docs/performance_take4.md`
|
||||
# §6b. There is **no** `convert to ANSI` site: opentitan has zero non-ANSI
|
||||
# module headers (§6b), so the last row measures an ANSI header, where the
|
||||
# action is correctly not offered.
|
||||
REFACTOR_SITES = [
|
||||
# A wildcard connection: `sha3 #(.EnMasking(...)) u_sha3 ( .* );` → 54:4.
|
||||
("expand-wildcard", SHA3_FPV, " ) u_sha3 (", 1, 4),
|
||||
# Two imports, one unused and one out of order → 42:2.
|
||||
("organize-imports", AES_SBOX_MASKED, " import aes_pkg::*;", 1, 2),
|
||||
# A separate-file instance written with named connections → 66:2.
|
||||
("inline-module", AES_WRAP, " tlul_cmd_intg_gen tlul_cmd_intg_gen (", 1, 2),
|
||||
# The take-3 offer site, still the one port-refactoring cursor found → 78:2.
|
||||
("port-actions", AES_WRAP, " aes #(", 1, 2),
|
||||
# An ANSI module header: the contrast row for `convert to ANSI` → 8:0.
|
||||
("ansi-header (no offer expected)", AES, "module aes", 1, 0),
|
||||
]
|
||||
|
||||
# The `extract module` site is a *selection*, not a point: three contiguous
|
||||
# whole module items — `aes.sv`'s three status `assign`s. The span runs from
|
||||
# the first needle's start to the end of the second needle.
|
||||
EXTRACT_SELECTION = (
|
||||
AES,
|
||||
" assign idle_o", 1,
|
||||
" assign input_ready_o = reg2hw.status.input_ready.q;", 1,
|
||||
)
|
||||
|
||||
# §49's hierarchical tail. `entropy_src_main_sm.sv` declares `state_q` — a
|
||||
# variable, not a port, so only the *hierarchical* surface reaches it — and
|
||||
# `entropy_src_core.sv` instantiates that module as `u_entropy_src_main_sm`
|
||||
# and names `u_entropy_src_main_sm.state_q`. The rename is issued at the
|
||||
# declaration; the row records whether the tail's file joins the edit set,
|
||||
# which is exactly what §49 changed.
|
||||
TAIL_RENAME = (ENTROPY_SRC_SM, "state_d, state_q;", 1, len("state_d, "))
|
||||
TAIL_TAIL_FILE = ENTROPY_SRC_CORE
|
||||
TAIL_HEAD_COMPLETION = (
|
||||
ENTROPY_SRC_CORE,
|
||||
"u_entropy_src_main_sm.state_q", 1, len("u_entropy_src_main_sm."),
|
||||
)
|
||||
|
||||
# The completion prefixes of take 3 §6d, typed at a fresh line in `tb.sv`.
|
||||
COMPLETION_PREFIXES = ["", "a", "ae", "aes", "aes_", "prim_", "clk", "aes_reg", "zzzz"]
|
||||
|
||||
# The five CLI sweep trees (`sweep.sh` reads the same list).
|
||||
TREES = [
|
||||
"hw/ip",
|
||||
"hw/top_earlgrey/ip",
|
||||
"hw/top_darjeeling/ip",
|
||||
"hw/dv",
|
||||
"hw/vendor",
|
||||
]
|
||||
Executable
+54
@@ -0,0 +1,54 @@
|
||||
#!/usr/bin/env bash
|
||||
# The timed CLI sweeps: `format --check` (cold and warm cache) and `check`
|
||||
# (default rules, and `--select error,warning,style`) over five opentitan
|
||||
# trees, one binary at a time, three tries per cell, wall clock and peak RSS
|
||||
# from `/usr/bin/time -l`.
|
||||
#
|
||||
# tools/perf/sweep.sh <lucisv-binary> <label> <opentitan-dir> <out-dir> [tries]
|
||||
#
|
||||
# Each cell writes `<out-dir>/<label>__<tree>__<command>__<cache>.txt`, which
|
||||
# holds the three runs' `/usr/bin/time -l` blocks; `sweeptable.py` reads them.
|
||||
# The formatter cache is a scratch `--cache-dir` under `<out-dir>`, so nothing
|
||||
# is ever written into the corpus.
|
||||
#
|
||||
# Every `lucisv` invocation goes through `tools/guard.sh -m 8 -t 1800`.
|
||||
set -u
|
||||
|
||||
BIN=${1:?usage: sweep.sh <binary> <label> <opentitan> <outdir> [tries]}
|
||||
LABEL=${2:?}
|
||||
OT=${3:?}
|
||||
OUT=${4:?}
|
||||
TRIES=${5:-3}
|
||||
|
||||
HERE=$(cd "$(dirname "$0")" && pwd)
|
||||
GUARD="$HERE/../guard.sh"
|
||||
CACHE="$OUT/fmtcache"
|
||||
|
||||
TREES="hw/ip hw/top_earlgrey/ip hw/top_darjeeling/ip hw/dv hw/vendor"
|
||||
|
||||
mkdir -p "$OUT"
|
||||
|
||||
run_cell() {
|
||||
local tree=$1 name=$2 cache=$3
|
||||
shift 3
|
||||
local safe=${tree//\//_}
|
||||
local log="$OUT/${LABEL}__${safe}__${name}__${cache}.txt"
|
||||
: >"$log"
|
||||
if [ "$cache" = cold ]; then rm -rf "$CACHE"; fi
|
||||
local i
|
||||
for i in $(seq 1 "$TRIES"); do
|
||||
echo "--- try $i ---" >>"$log"
|
||||
# `-l` puts the resource block on stderr; both streams are kept.
|
||||
"$GUARD" -m 8 -t 1800 -- /usr/bin/time -l "$BIN" "$@" >>"$log" 2>>"$log"
|
||||
echo "--- exit $? ---" >>"$log"
|
||||
done
|
||||
echo "$log"
|
||||
}
|
||||
|
||||
for tree in $TREES; do
|
||||
echo "== $LABEL $tree"
|
||||
run_cell "$tree" format cold format --cache-dir "$CACHE" --check "$OT/$tree"
|
||||
run_cell "$tree" format warm format --cache-dir "$CACHE" --check "$OT/$tree"
|
||||
run_cell "$tree" check default check "$OT/$tree"
|
||||
run_cell "$tree" check select check --select error,warning,style "$OT/$tree"
|
||||
done
|
||||
@@ -0,0 +1,96 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Turn `sweep.sh`'s `/usr/bin/time -l` logs into the document's §7 table.
|
||||
|
||||
python3 tools/perf/sweeptable.py <out-dir> [--labels 0.49.0,0.43.0,0.39.0]
|
||||
|
||||
Reads every `<label>__<tree>__<command>__<cache>.txt` in `<out-dir>`, pulls the
|
||||
`real` seconds and the `maximum resident set size` out of each try's block, and
|
||||
prints a Markdown table with one row per (tree, command, cache) and one column
|
||||
per label — first try, then the range over the repeats, then peak RSS.
|
||||
|
||||
It also prints the summary line each run reported (`N files would be
|
||||
reformatted`, the finding count), because a timing that moved because the work
|
||||
moved is not a timing finding.
|
||||
"""
|
||||
|
||||
import argparse
|
||||
import os
|
||||
import re
|
||||
import sys
|
||||
|
||||
REAL = re.compile(r"([0-9.]+)\s+real")
|
||||
RSS = re.compile(r"(\d+)\s+maximum resident set size")
|
||||
COMMANDS = [("format", "cold"), ("format", "warm"), ("check", "default"), ("check", "select")]
|
||||
COMMAND_NAMES = {
|
||||
("format", "cold"): "`format --check`, cold cache",
|
||||
("format", "warm"): "`format --check`, warm cache",
|
||||
("check", "default"): "`check` (default rules)",
|
||||
("check", "select"): "`check --select error,warning,style`",
|
||||
}
|
||||
TREES = ["hw/ip", "hw/top_earlgrey/ip", "hw/top_darjeeling/ip", "hw/dv", "hw/vendor"]
|
||||
|
||||
|
||||
def cell(directory, label, tree, command, cache):
|
||||
"""(reals, peak_rss_mb, summary_lines) for one cell, or None if absent."""
|
||||
name = "%s__%s__%s__%s.txt" % (label, tree.replace("/", "_"), command, cache)
|
||||
path = os.path.join(directory, name)
|
||||
if not os.path.exists(path):
|
||||
return None
|
||||
text = open(path, encoding="utf-8", errors="replace").read()
|
||||
reals = [float(v) for v in REAL.findall(text)]
|
||||
rss = [int(v) for v in RSS.findall(text)]
|
||||
# The run's own total line, not its per-file lines: a timing that moved
|
||||
# because the *work* moved is not a timing finding.
|
||||
summary = [
|
||||
line.strip()
|
||||
for line in text.splitlines()
|
||||
if re.match(r"^(\d+ files? would be reformatted|found \d+ violations|"
|
||||
r"no violations|All \d+)", line.strip())
|
||||
]
|
||||
return reals, (max(rss) / 1048576.0 if rss else 0.0), summary
|
||||
|
||||
|
||||
def render(reals):
|
||||
if not reals:
|
||||
return "—"
|
||||
if len(reals) == 1:
|
||||
return "%.2f" % reals[0]
|
||||
rest = reals[1:]
|
||||
if abs(max(rest) - min(rest)) < 0.005:
|
||||
return "%.2f / %.2f" % (reals[0], min(rest))
|
||||
return "%.2f / %.2f–%.2f" % (reals[0], min(rest), max(rest))
|
||||
|
||||
|
||||
def main():
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument("directory")
|
||||
parser.add_argument("--labels", default="0.49.0,0.43.0,0.39.0")
|
||||
args = parser.parse_args()
|
||||
labels = args.labels.split(",")
|
||||
|
||||
print("| Tree | command | " + " | ".join(labels) + " | peak RSS (MB) |")
|
||||
print("|---|---|" + "---:|" * (len(labels) + 1))
|
||||
for tree in TREES:
|
||||
for command, cache in COMMANDS:
|
||||
cells = [cell(args.directory, label, tree, command, cache) for label in labels]
|
||||
if not any(cells):
|
||||
continue
|
||||
times = " | ".join(render(c[0]) if c else "—" for c in cells)
|
||||
rss = " → ".join("%.0f" % c[1] for c in cells if c)
|
||||
print("| `%s` | %s | %s | %s |" % (tree, COMMAND_NAMES[(command, cache)], times, rss))
|
||||
|
||||
print()
|
||||
print("Summary lines, per cell (what the run reported):")
|
||||
for tree in TREES:
|
||||
for command, cache in COMMANDS:
|
||||
for label in labels:
|
||||
found = cell(args.directory, label, tree, command, cache)
|
||||
if not found or not found[2]:
|
||||
continue
|
||||
print(" %-22s %-8s %-8s %-8s %s" % (
|
||||
tree, command, cache, label, found[2][0]))
|
||||
return 0
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
sys.exit(main())
|
||||
Reference in new issue
Block a user