Review round §61.2 (R1a/R1b): one lint pass per document revision shared by the diagnostics publish and quick-fix discovery, keyed by value on every input of lint_with (waiver contents included) and cleared by every index mutation's overlay refresh; a --verbose codeaction stage trace first showed the 23 ms is three semantic rules and the first-after-edit is the flush; pinmux menu 22.6 → 1.0 ms, queued definition 22.4 → 0.8, publish and memory unchanged
This commit is contained in:
1 parent
51cbfd27df
commit
a1c77c053f
17 files changed
+2637
-103
No files matched your search
+237
-2
@@ -2009,8 +2009,8 @@ checks in its full experiment record. Targets are proposed gates, not promises.
|
||||
|
||||
| ID | Hypothesis / proposed work | 0.51.0 review baseline | Proposed gate | Owner / candidate commit | Candidate result / raw evidence | Decision |
|
||||
|---|---|---|---|---|---|---|
|
||||
| R1a | Dependency-correct lint-result reuse removes repeated quickfix work | pinmux all 25.0 ms; quickfix 23.1 ms; queued definition 24.2 ms | unchanged all/queued ≤16 ms; current results after every invalidation | — | — | Pending |
|
||||
| R1b | Profile then reduce dirty-buffer analysis on the first action after an edit | pinmux 135.9 ms; unchanged repeat about 24 ms | first-edit reduction shown separately; didChange ordering preserved | — | — | Pending |
|
||||
| R1a | Dependency-correct lint-result reuse removes repeated quickfix work | pinmux all 25.0 ms; quickfix 23.1 ms; queued definition 24.2 ms | unchanged all/queued ≤16 ms; current results after every invalidation | dev (Opus), §61.2, tree at `51cbfd2` + the §61.2 diff | Paired against this session's own reference (`51cbfd2`, 22.61 / 24.51 / 22.39 ms): **all families 0.98 ms (−95.6%)**, **quickfix only 0.11 ms (−99.5%)**, **queued definition leader/follower 0.78 / 0.76 ms (−96.5%)**. Snapshot on the `Document`, key compared by value; idle RSS at 100 open buffers 574.0 → 574.6 MiB (+0.1%); diagnostics publish +0.3%. 21 tests added, one per invalidation row plus a stale-fix attack. [Record R1a-2026-09-08](#experiment-record--r1a-2026-09-08-stage-r1a); `~/.cache/lucisv-perf/take5r-2/` | Retained — QA PASS → lead; committed 2026-09-08 |
|
||||
| R1b | Profile then reduce dirty-buffer analysis on the first action after an edit | pinmux 135.9 ms; unchanged repeat about 24 ms | first-edit reduction shown separately; didChange ordering preserved | dev (Opus), §61.2, trace-only build of `51cbfd2` + `lint_trace.rs` | **Attribution, no behaviour change.** The unchanged 22 ms menu is **20.9 ms `lint_with`**, 0.04 ms config I/O, 0.01 ms run build, 0.03 ms serialization, fence skipped (zero violations). Of the 127.5 ms first-after-edit: **99.7 ms flush** (1 parse of 1.3 MB + the diagnostics publish, itself **21.1 ms**) and **20.2 ms** the handler's own second pass — so a lint cache can only remove one 21 ms pass, which R1a then did (**125.65 → 106.89 ms, −14.9%**). Per-rule ablation: `unused-signal` +8.2, `undriven-net` +7.4, `multiply-driven` +7.5 ms over a 1.3 ms floor; the other 55 default rules ≤ +2.2 ms each. [Record R1b-2026-09-08](#experiment-record--r1b-2026-09-08-stage-r1b) | Retained — QA PASS → lead; committed 2026-09-08 |
|
||||
| R2a | Remove redundant discovery metadata/config work | traced warm discovery 205.0 ms; first useful answer 328.2 ms paired | first useful answer ≤200 ms milestone, correct settled target | — | — | Pending |
|
||||
| R2b | Begin useful local-folder work before full discovery/cache loading finishes | warm cache open 92.3 ms in traced session; cold/warm first answer 286.8/328.2 ms | single coherent scan, correct results across startup ordering cases | — | — | Pending |
|
||||
| R3a | Engine-owned empty-cursor preflight avoids whole-workspace materialization | no-symbol refusal 2,192 ms; 3,975 parses, candidate-only trace | ≤16 ms; zero closed-workspace parses; exact refusal/precedence | dev (Opus), §61.1, tree at `e13ae4c` + the §61.1 diff | **0.3 ms** repeat median (paired reference 2,012.3 ms, −100.0%); `trace_parses` **0**, `trace_selected` **0** off the wire; refusal byte-identical; peak RSS 909 → 429 MiB. [Record R3a-2026-09-08](#experiment-record--r3a-2026-09-08-stage-r3a); `~/.cache/lucisv-perf/take5r-1/` | Retained — QA PASS → lead; committed 2026-09-08 |
|
||||
@@ -2024,6 +2024,241 @@ warm idle memory gain and all source-selection/fence/after-index contracts in
|
||||
[topo.md](../topo.md). Cross-module API changes need their handshake recorded
|
||||
before implementation; no verifier forgiveness may be weakened for speed.
|
||||
|
||||
## Experiment record — R1b-2026-09-08 (stage R1b)
|
||||
|
||||
- **Experiment ID / stage / date / owner:** `R1b-2026-09-08` / R1b (TODO
|
||||
§61.2) / 2026-09-08, America/Chicago / dev agent (Opus).
|
||||
- **Hypothesis and exact expected work reduction:** none — this is the
|
||||
review's "trace the stages first". The expected *output* is an attribution
|
||||
of the 23 ms quickfix menu and the 136 ms first-after-edit across config
|
||||
discovery, `LintRun` build, lint, fence and serialization, plus the dirty
|
||||
buffer flush measured apart from the handler.
|
||||
- **Reference commit, candidate commit or diff hash, binary hashes:** the
|
||||
traced build is trunk `51cbfd27dfd22720856c501c9c17277460cc6a68` plus
|
||||
`lint_trace.rs` and its call sites — behaviour-identical, the trace armed
|
||||
only under `--verbose`. Release, rustc 1.97.1 (Homebrew). The R1b numbers
|
||||
are candidate-only by construction: the reference has no trace to read.
|
||||
- **Files changed / API contracts amended / topology references:**
|
||||
`crates/lucisv_server/src/lint_trace.rs` (new), `lint.rs` (two stages around
|
||||
the discovery and the run build, one around `lint_with`), `fences.rs` (a
|
||||
read-only `held` predicate), `code_action.rs` (the serialization stage),
|
||||
`server/dispatch.rs` (`flush_dirty_traced`, and the line). No contract
|
||||
amended. `tools/perf/phases_r1.py` (new): phases `actionprofile` and
|
||||
`ruleablation`.
|
||||
- **Workload, corpus/input hashes, open files, cursor/range, rules, client
|
||||
capabilities:** OpenTitan, the three known pre-existing modified files,
|
||||
`git status --porcelain` checked after every phase. Cursors are
|
||||
`phases_p1.EDIT_CURSORS` — the pinmux comment, the `tb.sv` comment, the
|
||||
`aes.sv` `aes_reg_top` instance — so the profile rows sit beside the
|
||||
`offeredit` latency rows they explain. Lazy resolving client. 57 default
|
||||
rules (the workspace set).
|
||||
- **Machine, compiler/profile, threads, load before/after, competing
|
||||
activity:** M1 Max, macOS 27.0, release profile, default worker count. Load
|
||||
1.9–3.6 one-minute across both phases. No build or test suite overlapped a
|
||||
timed run.
|
||||
- **Commands, cache reset/prime steps, trial ordering and fresh-session
|
||||
count:** `bench.py actionprofile --tries 3` and `bench.py ruleablation
|
||||
--tries 3`, each through `tools/guard.sh -m 8 -t 1800`. One fresh
|
||||
`--verbose` session per cursor; the ablation is one warm session with
|
||||
`lucisv.lint.select` pushed by `didChangeConfiguration` per row (a selection
|
||||
change rescans nothing — `notification.rs::apply_settings`), with the
|
||||
unrestricted control taken first **and** last.
|
||||
- **Raw evidence path, explicit units, full sample arrays:**
|
||||
`~/.cache/lucisv-perf/take5r-2/results.jsonl`, label `r1b-cand`. Latency in
|
||||
`ms`; every field of the trace line is a `trace_*` row field
|
||||
(`trace_action_lint`, `trace_flush_wall`, `trace_flush_parses`, …).
|
||||
- **Reference first / repeat median / range; candidate first / repeat median /
|
||||
range:** pinmux comment — first request of a session 25.10; unchanged
|
||||
repeats **21.97** (21.82–22.01); queued behind a definition 22.33; first
|
||||
after a `didChange` **127.54** (121.84–130.67). `tb.sv` 0.52 / 0.98;
|
||||
`aes.sv` 3.20 / 4.19.
|
||||
- **Work counts: reads, parses, analyzed/selected/watched/edited files and
|
||||
bytes:** the unchanged menu performs **0** whole-file parses and **1**
|
||||
`lint_with` pass over 57 rules finding **0** violations; the fence filter is
|
||||
skipped (no fix to protect, §P1a). The first request after a `didChange`
|
||||
performs **1** parse — the flush's — and **2** `lint_with` passes over the
|
||||
same revision.
|
||||
- **Result/status/count/fingerprint comparisons, warnings and refusal
|
||||
checks:** every row `status=ok`; result counts unchanged from the reference
|
||||
rows of the same cursors. No edit-bearing row in this phase.
|
||||
- **Idle RSS / peak RSS / cache size / guard outcomes:** not sampled here (the
|
||||
memory cell belongs to R1a). **Zero guard kills.**
|
||||
- **Target achieved or missed; paired improvement and variability:** not a
|
||||
target — an attribution. The two numbers the review asked for:
|
||||
**the 23 ms is `lint_with` (20.9 of 22.0)**, config I/O being 0.04 ms; and
|
||||
**the 136 ms is 78% dirty-buffer flush** (99.7 ms of 127.5, of which 21.1 ms
|
||||
is the diagnostics pass, leaving ~78.6 ms of `Document::new`), with the
|
||||
handler's own 20.2 ms lint pass the only part a cache can remove.
|
||||
- **Where the reference disagrees with the baseline beyond tolerance (neither
|
||||
number adjusted):** the review's cells are 25.0 (all families), 23.1
|
||||
(quickfix) and 135.9 (first after change); this session reads 22.0–22.6,
|
||||
24.5 and 127.5 — within 3–7% and in both directions, on a machine whose load
|
||||
was at the low end of the review's band. Nothing is adjusted.
|
||||
- **Correctness tests and logs:** 4 unit tests in `lint_trace.rs` (an unarmed
|
||||
trace records nothing and returns the work; `close_flush` divides the
|
||||
request; one recompute makes the whole request a miss; the line names every
|
||||
stage in both groups). The whole workspace suite is reported under R1a,
|
||||
which is the change that could break something.
|
||||
- **Interpretation, remaining bottleneck, tradeoffs, rejected alternatives:**
|
||||
the per-rule ablation is the finding the previous lane guessed at ("it may
|
||||
be cheaper to ask *which* rules cost 24 ms than to cache their answer"):
|
||||
three semantic rules — `unused-signal` **+8.2 ms**, `multiply-driven`
|
||||
**+7.5**, `undriven-net` **+7.4** over a **1.3 ms** floor — are effectively
|
||||
the whole pass, and the other 55 default rules together are about 2 ms.
|
||||
Making *those* cheaper is a `vlog_linter` change and is not this lane's; a
|
||||
snapshot is what removes the repetition without touching a rule. **Rejected
|
||||
alternative:** splitting the flush into parse / analysis / overlay stages,
|
||||
which lives inside `Document::new` and `Workspace::set_document` — outside
|
||||
this lane's file ownership, and unnecessary for the question asked, since
|
||||
flush-minus-diagnostics answers it.
|
||||
- **Decision: retain / revise / reject / defer; next stage justified by
|
||||
evidence:** **retain** the trace (it is what R1a is judged by, and what a
|
||||
future lane will read when it goes after the 78 ms rebuild). The rule cost
|
||||
is filed as evidence for whoever takes the semantic rules on.
|
||||
- **QA result and lead review link:** pending —
|
||||
`docs/features/perf5r-lint-snapshot/README.md`.
|
||||
|
||||
## Experiment record — R1a-2026-09-08 (stage R1a)
|
||||
|
||||
- **Experiment ID / stage / date / owner:** `R1a-2026-09-08` / R1a (TODO
|
||||
§61.2) / 2026-09-08, America/Chicago / dev agent (Opus).
|
||||
- **Hypothesis and exact expected work reduction:** R1b measured a request
|
||||
that runs `lint_with` **twice** on one revision — once to publish
|
||||
diagnostics, once to discover quick fixes — and a repeat menu that runs it
|
||||
again on a revision nothing has touched. If one snapshot per open
|
||||
`Document`, keyed by every input of that call, is read by both doors, the
|
||||
expected reduction is **the whole 21 ms pass on every unchanged request**
|
||||
and **one of the two passes** on the first request after an edit.
|
||||
- **Reference commit, candidate commit or diff hash, binary hashes:**
|
||||
reference = trunk `51cbfd27dfd22720856c501c9c17277460cc6a68` (0.51.0 plus
|
||||
§61.1's rename preflight, which this lane does not touch), built from a
|
||||
clean clone in scratch, binary
|
||||
`5d2a7aa2a4fd0d1747aec4011a482defd2d8a1dccc08b6156b17d9a820375770`.
|
||||
Candidate = that tree plus the §61.2 diff, binary
|
||||
`827c7ac222c829d12a4e245b4d720b67a3dca6c799fd6bb8ee525fe697587b12`. Both
|
||||
`--release --locked`, rustc 1.97.1 (Homebrew).
|
||||
- **Files changed / API contracts amended / topology references:**
|
||||
`crates/lucisv_server/src/lint_snapshot.rs` (new), `lint.rs`,
|
||||
`code_action.rs`, `server/dispatch.rs`, `state/mod.rs` (**one field**, its
|
||||
two initializers and one line in `refresh_overlay`),
|
||||
`server/tests/lint_snapshot.rs` (new). In-crate signature changes:
|
||||
`lint::violations_in` and `lint::fixable` return `Arc<[Violation]>`, and
|
||||
`fixable`/`code_action::code_actions` no longer take a `tab_width` — the
|
||||
width is on the `LintRun`, read through `format::indent_width`, whose call
|
||||
the dispatcher no longer makes. `vlog_linter`, `vlog_formatter` and
|
||||
`fence.rs` are untouched; the shared-fence-filter contract is not amended. A
|
||||
`docs/topo.md` amendment is *requested* in the feature README's Handshakes
|
||||
and was not applied by this lane.
|
||||
- **Workload, corpus/input hashes, open files, cursor/range, rules, client
|
||||
capabilities:** OpenTitan, the three known pre-existing modified files,
|
||||
`git status --porcelain` checked after **every** phase invocation. Cursors
|
||||
are `tools/perf/sites.py`'s and `phases_p1.EDIT_CURSORS`', unchanged. Client
|
||||
shapes are in every row.
|
||||
- **Machine, compiler/profile, threads, load before/after, competing
|
||||
activity:** M1 Max, macOS 27.0, release profile, default worker count. Load
|
||||
recorded before every phase: **2.47–5.88** one-minute, inside the review's
|
||||
own 2.82–6.00 band. **No build, test suite or second benchmark overlapped
|
||||
any timed run** — both binaries and both test suites finished first.
|
||||
- **Commands, cache reset/prime steps, trial ordering and fresh-session
|
||||
count:** 12 guarded `bench.py <phase>` invocations, `--tries 3`, each
|
||||
through `tools/guard.sh -m 8 -t 1800`. Phases `offerkinds offeredit
|
||||
offerqueue codeaction diagnostics didopen snapshotrss`, each once per
|
||||
binary, with reference/candidate order **alternated between phases**
|
||||
(`offerkinds` ref→cand, `offeredit` cand→ref, `offerqueue` ref→cand,
|
||||
`codeaction` cand→ref, `diagnostics` ref→cand, `didopen` cand→ref,
|
||||
`snapshotrss` ref→cand), plus `actionprofile` on the candidate for its
|
||||
trace. Separate `--storage` per (label, phase); `snapshotrss` and `didopen`
|
||||
open a fresh process per try.
|
||||
- **Raw evidence path, explicit units, full sample arrays:**
|
||||
`~/.cache/lucisv-perf/take5r-2/results.jsonl`, labels `r1a-ref`,
|
||||
`r1a-cand`, `r1a-cand-2` (the corrected trace run). Units in every row:
|
||||
latency `ms`, memory `rss_kib` / `peak_rss_kib`. Trace fields are `trace_*`.
|
||||
- **Reference first / repeat median / range; candidate first / repeat median /
|
||||
range:** pinmux all families — reference 30.84 / **22.61** / 21.9–24.5;
|
||||
candidate 2.42 / **0.98** / 0.41–1.24. Quickfix only — reference 22.35 /
|
||||
**24.51**; candidate 0.15 / **0.11**. `offeredit` repeat — reference 23.88 /
|
||||
**23.44**; candidate 0.23 / **0.18**. First after `didChange` — reference
|
||||
128.96 / **125.65** / 123.5–129.0; candidate 106.07 / **106.89** /
|
||||
105.1–108.6. Queued definition (leader / follower, pipeline 3) — reference
|
||||
22.39 / 22.38; candidate **0.78 / 0.76**. Diagnostics publish — reference
|
||||
**162.29**, candidate **162.75**. The full arrays are in the JSONL.
|
||||
- **Work counts: reads, parses, analyzed/selected/watched/edited files and
|
||||
bytes:** the unchanged menu now runs **zero** `lint_with` passes
|
||||
(`trace_action_lint=0.00ms`, `trace_action_snapshot=hit`) and **zero**
|
||||
parses. The first request after a `didChange` runs **one** pass, the
|
||||
diagnostics publish's, inside the flush (`trace_flush_lint=21.87ms`,
|
||||
`snapshot=miss`) and **none** in the handler (`snapshot=hit`) — down from
|
||||
two. Config discovery still runs per request; the
|
||||
indent-width read moved from the dispatcher into the run, so a code-action
|
||||
request does the same two `Discovery` walks it always did and the
|
||||
diagnostics publish now does two where it did one — about **+0.11 ms** on
|
||||
the config stage, publish row **+0.3%**. A handshake request to give
|
||||
`format::indent_width` a form that takes an already-read `FileConfig` is
|
||||
recorded in the feature README.
|
||||
- **Result/status/count/fingerprint comparisons, warnings and refusal
|
||||
checks:** every row `status=ok`, and every row's `result_count` equal
|
||||
between the two binaries — the pinmux cursor offers nothing before and
|
||||
after, the `aes_reg_top` cursor offers the same port actions, the take-3
|
||||
`codeaction` cells answer the same counts. The correctness argument is the
|
||||
test matrix rather than a fingerprint: this lane changes no edit, only when
|
||||
one is computed.
|
||||
- **Idle RSS / peak RSS / cache size / guard outcomes:** a new `snapshotrss`
|
||||
phase opens 1 / 10 / 100 RTL buffers, sends one quickfix-only `codeAction`
|
||||
into each so that every open document holds a snapshot, and reads idle RSS a
|
||||
second after the session goes quiet: **420.9 → 422.2 MiB (1 buffer)**,
|
||||
**429.4 → 428.4 (10)**, **574.0 → 574.6 (100, +0.1%)**. **Zero guard
|
||||
kills.**
|
||||
- **Target achieved or missed; paired improvement and variability:**
|
||||
**achieved.** Gate ≤16 ms unchanged menu → **0.98 ms** (quickfix-only
|
||||
0.11); gate ≤16 ms queued definition → **0.76 ms**; gate "first-after-edit
|
||||
improved and reported separately with its stage split" → **125.65 → 106.89
|
||||
ms (−14.9%)**, with the split saying the remaining 106 ms is 84 ms of
|
||||
`Document::new` plus the 22 ms diagnostics pass and **0.00 ms** of
|
||||
code-action lint; gate "diagnostics publish must not regress" → **+0.3%**;
|
||||
gate "no higher retained memory" → **+0.1% at 100 buffers**. Unchanged rows
|
||||
move −23% to +15% on sub-10 ms cells, in both directions and with no
|
||||
pattern: `didopen` (median of three fresh processes) 4.53 → 3.49, 5.72 →
|
||||
5.56, 8.68 → 8.15, and the `tb.sv` menu 0.19 → 0.23 / 1.26 → 1.45. None of
|
||||
these is read as movement at that scale.
|
||||
- **Where the reference disagrees with the baseline beyond tolerance (neither
|
||||
number adjusted):** the review's 0.51.0 cells are 25.0 / 23.1 / 24.2 /
|
||||
135.9 ms; this session's own reference reads 22.6 / 24.5 / 22.4 / 125.7 —
|
||||
within about 8% in both directions. The improvement is stated against **this
|
||||
session's own reference**, so the ratios are unaffected.
|
||||
- **Correctness tests and logs:** `cargo fmt` clean; guarded `cargo clippy
|
||||
--all-targets` clean, no new `#[allow]`; guarded `cargo test --workspace`
|
||||
**4 343 passed, 0 failed** against the reference tree's **4 322 passed, 0
|
||||
failed** measured the same way — **+21, none removed**, confirmed by
|
||||
diffing `cargo test -- --list` between the two trees. The 21 are: 11 in
|
||||
`server/tests/lint_snapshot.rs` (one per invalidation-table row — an edited
|
||||
buffer, a large buffer, a pushed rule selection, a rewritten `lucisv.toml`,
|
||||
a rewritten waiver file, a changed indent width, a change in **another**
|
||||
file that moves the census, close/reopen, a UTF-16 fix range, the shared
|
||||
pass, and the **stale-fix attack**), 4 in `lint_snapshot.rs` (every field of
|
||||
the key forces a recompute; a same-length waiver rewrite is a different
|
||||
key), 4 in `lint_trace.rs`, 2 in `lint.rs` (the indent ladder rung by rung;
|
||||
a reused snapshot compared violation for violation and fix for fix against a
|
||||
fresh `lint_with`).
|
||||
- **Interpretation, remaining bottleneck, tradeoffs, rejected alternatives:**
|
||||
the code-action path is now transport-bound on the largest file in
|
||||
opentitan. What is left of the edit-time pause is **not** lint: ~84 ms of
|
||||
`Document::new` on 1.3 MB, which is a parser/analysis question and belongs
|
||||
with the review's item 4 as a separate lane. **Rejected alternatives:**
|
||||
hashing the key (a digest would make "no stale fix" a collision argument
|
||||
instead of a `PartialEq` fact); keying on the waiver files' mtime or length
|
||||
(weaker than the contents, and wrong across a same-second rewrite);
|
||||
memoizing the `FileConfig` read (the trace measures it at 0.04–0.16 ms, and
|
||||
its failure mode would be a stale *rule selection* on files nothing
|
||||
watches); an index generation counter (`refresh_overlay` is already called
|
||||
at every index mutation, so a counter would be a second thing to keep in
|
||||
step); a bounded map keyed by URI (a field on the `Document` is dropped by
|
||||
`didClose` for free and cannot outlive its text).
|
||||
- **Decision: retain / revise / reject / defer; next stage justified by
|
||||
evidence:** **retain.** The next lever on this path is the 84 ms
|
||||
`Document::new`, not the linter.
|
||||
- **QA result and lead review link:** pending —
|
||||
`docs/features/perf5r-lint-snapshot/README.md`.
|
||||
|
||||
## Experiment record — R3a-2026-09-08 (stage R3a)
|
||||
|
||||
- **Experiment ID / stage / date / owner:** `R3a-2026-09-08` / R3a (TODO §61.1)
|
||||
|
||||
Reference in new issue
Block a user