920 lines
102 KiB
Markdown
920 lines
102 KiB
Markdown
# Performance implementation tracker — take 5
|
||
|
||
**Status: baseline measured; P0 done; P1a, P1b and P1c implemented and measured (2026-09-07; P1c QA pending).** The implementation agent owns the blank candidate columns and experiment entries below. Read [the causes and detailed plan](../performance_take5.md) before selecting work. Baseline provenance and raw rows are in [take5-baseline](take5-baseline/README.md).
|
||
|
||
Do not overwrite the baseline, silently replace a workload, omit refusals, or report a proposed target as an achieved result. Use `not measured`, `blocked`, or `not applicable` rather than zero. Update this file after each measured stage, including rejected changes.
|
||
|
||
## Baseline identity
|
||
|
||
| Field | Recorded baseline | Candidate — agent fills |
|
||
|---|---|---|
|
||
| Source | `bbdbfe9045e8a85f8ea471529ea739af6cade77f`, version 0.50.0 | **P0 (§60.0): same binaries.** Tree at `9c75b7a4e517bdf91151b85814ecbb43e0d8679d` plus the uncommitted P0 working tree; no Rust changed |
|
||
| Source modifications | None to implementation; analysis/evidence docs only | None to implementation; `tools/perf/*` and docs only |
|
||
| Server SHA-256 | `27e0a0df5b77102ec79c23279da64e722bffd440c604ad6d03ff66c2f6398ad3` | `27e0a0df5b77102ec79c23279da64e722bffd440c604ad6d03ff66c2f6398ad3` — identical, verified before timing; **no rebuild** |
|
||
| CLI SHA-256 | `894054128495b764bb966e7b923e08267e57aea83fdc611fad4b4ed7a66b51e3` | `894054128495b764bb966e7b923e08267e57aea83fdc611fad4b4ed7a66b51e3` — identical |
|
||
| Build | release, locked dependencies, workspace LTO enabled | unchanged artifacts; no `cargo` command ran in this round |
|
||
| Corpus | OpenTitan `00981352642fb65ef2b6c47143a0f6bb31fd4a97` | same |
|
||
| Modified corpus inputs | Three existing files, listed/hashed in `metadata.json` | same three; `git status --porcelain` identical after all 16 timed runs |
|
||
| Host / OS | M1 Max; macOS 27.0 `26A5425a` | same host |
|
||
| Date / zone | 2026-09-07, America/Chicago | 2026-09-07, America/Chicago |
|
||
| Load, standard phases | 1-minute samples 2.92–4.59 | 1-minute samples **2.92–5.21**, recorded before and after every phase |
|
||
| Guard | 8 GiB / 1800 s; zero kills in retained runs | 8 GiB / 1800 s on every phase, `lucisv` run and sweep; **zero kills** |
|
||
| Harness | `tools/perf` at baseline HEAD, supplementary probes in evidence README | **`tools/perf` in the working tree of §60.0, uncommitted** — schema 2; the two supplemental probes promoted to the `offerkinds` / `offerqueue` phases; the CLI probe re-run as a scratch script |
|
||
| Warmth / scope / capabilities | Warm workspace, lazy client unless metric says otherwise | same, and the shape is now **in every row** (`client`: `resolveSupport` / `applyEdit` / `createFiles`); `execute` is the only phase advertising `applyEdit` + `createFiles` |
|
||
| Raw evidence | `take5-baseline/*.jsonl`, `metadata.json` | `~/.cache/lucisv-perf/take5-p0/{results.jsonl,results-scan2.jsonl,cli-results.jsonl,runs.jsonl,logs/}` |
|
||
|
||
Before timing, record the exact revision/diff, binaries, compiler, machine, corpus hashes, enabled rules/settings, client capabilities and open-buffer set. Build first and stop all builds before measurements. Keep reference/candidate caches separate; alternate run order. Record actual commands and whether each trial is a new process. Three samples are the historical comparison minimum; for a close decision use at least three sessions and 20 measured requests per session, keep first requests separate and record the full distributions. Do not derive p95/p99 from the three-repeat baseline.
|
||
|
||
## Stage ledger
|
||
|
||
The order follows the plan. Later stages are conditional on the preceding measurements. All candidate statuses start unimplemented.
|
||
|
||
| Stage | Work | Depends on | Owner / commit | Status | Evidence and decision |
|
||
|---|---|---|---|---|---|
|
||
| P0 | Harness status/units/command execution/cold-cache corrections | — | dev (Opus) → QA PASS → lead; committed 2026-09-07 | Done | `docs/features/perf5-p0/README.md`; experiment `P0-2026-09-07` below. Schema 2 shipped; `execute` phase measures the extract/inline commands for the first time; cold sweep tries verified at 0 hits, warm at 30; baseline reproduced on the unchanged binary |
|
||
| P1a | Gate lint/fence/config by requested kinds; avoid fence work without fixes | P0 | dev (Opus) → QA PASS → lead; committed 2026-09-07 | Done | `docs/features/perf5-p1/README.md`; experiment `P1a-2026-09-07` below. Pinmux `only: []` 82.80 → **0.064 ms**; quickfix 84.13 → **23.53**; all families 309.60 → **258.06**. Separates the base at last: lint+config **23.5 ms**, fence parse **59.3 ms** |
|
||
| P1b | Shared parsed selectors; revision-bound fence reuse; invalidate any additional cache correctly | P1a | dev (Opus) → QA PASS → lead; committed 2026-09-07 | Done | Same README; experiment `P1b-2026-09-07`. Pinmux all families **24.02 ms** (−92.2% on REF), queued definition **24.61** (−92.0%). Lint-result reuse **not done** — reason and number in the experiment entry |
|
||
| P1c | Engine-owned lightweight ports/import offers | Reprofile P1b | dev (Opus) → QA REWORK on one documentation point, ruled and applied by the lead → committed 2026-09-07 | Done | `docs/features/perf5-p1/README.md`; experiment `P1c-2026-09-07` below. `aes_reg_top` lazy offer 21.83 → **5.46 ms**, its ports family 21.15 → **3.27**; `aes` 7.76 → **1.74**; the organize-imports offer 15.39 (REF) → **4.88**. **All three targets met.** Answers identical to P1b on 50 rows and to the REF on 65, field by field; the three resolve fingerprints unchanged |
|
||
| P2a | Rename per-stage timings and selected/watched/input counts | P0 | dev (Opus); release `bf584aa0daf6…` → QA PASS → lead; committed 2026-09-07 | Done | `docs/features/perf5-p2/README.md`; experiment `P2a-2026-09-07` below. The tail rename's 780 ms is **238 input files / 4.55 MB and 717 whole-file parses**: `Scope::build` 228.5 ms, the occurrence walk 116.3, `rebuilt_index` 228.4 (the same build again), the after analyses 71.5, warnings 83.6, selection 13.4. 73 % of the request is whole-file parsing and two thirds of that parsing is repeated |
|
||
| P2b | Reuse per-file input analysis in request-local scope | P2a | dev (Opus); release `e555e6c79d8d…` → QA PASS → lead; committed 2026-09-07 | Done | Same README; experiment `P2b-2026-09-07`. Additive `FileFacts::analyzed`; `Scope::build_keeping` analyses the request's file first, reads the cursor's name off it and retains the analyses the rest of the request will ask for. Tail rename 781.7 → **676.6 ms**, parses 717 → **582**; peak RSS unchanged or lower on all eight rows |
|
||
| P2c | Reuse unchanged after-facts/semantics; re-resolve external references | P2b | dev (Opus); release `1601b13a9bac…` → QA PASS → lead; committed 2026-09-07 | Done | Same README; experiment `P2c-2026-09-07`. New `vlog_refactor/src/check/after.rs`: the after-index is the before-index cloned and **absorbed**, and an untouched watched file's after-print is its existing analysis re-resolved. Tail rename **419.9 ms (−46.2 % on REF, 1.86×)**, parses **240 = K + E**; every fingerprint identical. **Target ≥2× missed by 29.7 ms**; the remaining stage is `Scope::build`'s one parse of each of the 238 *selected* files (225 ms), which only §P2d can reach |
|
||
| P2d | Exact-name postings; source-set narrowing only with whole-scope proof | Reprofile P2c; topology 33 for shared module selector | — | Not started | Reprofiled: after §P2c the tail rename is 419.9 ms of which **225 ms is one parse of each selected file** and 83 ms a token scan. There is no duplicated parsing left; the next lever is the size of the selected set |
|
||
| P3 | Reuse CLI census parse for package exports/interfaces | P0; coordinate semantic ownership | — | Not started | — |
|
||
| P4a | Attribute scan/prelude/table-build/cache/RSS cost | P0 | — | Not started | — |
|
||
| P4b | Implement the dominant measured startup/memory fix | P4a; serialize with state/index changes | — | Not started | — |
|
||
| P5 | Parser or cancellable snapshot work only if a new measured case justifies it | Reprofile P1–P4 | — | Deferred | — |
|
||
|
||
## Before / after performance
|
||
|
||
Ordinary latency cells are **first / min–max of three repeats, milliseconds**. Fresh-session rows instead show all-session range. Baseline raw row names below make the comparison auditable. Fill candidate raw samples, median/distribution and counts in an experiment entry; this table is the readable overview. Use paired reference/candidate medians for improvement: `100 × (reference − candidate) / reference`. A cross-day comparison is context only.
|
||
|
||
**P0 note.** P0 changed no production code, so its "candidate" is the *same
|
||
binary re-measured with the corrected harness*. Those cells are marked
|
||
**REF** and are the reference P1+ must be compared against; their "paired
|
||
change" is the reference-against-baseline agreement check, never an
|
||
improvement claim. Baseline cells are untouched.
|
||
|
||
**P1 note.** P1's numbers are *appended* to the Candidate cell behind the
|
||
REF value they are measured against; **no REF or baseline text is replaced**.
|
||
Both stages were taken with the committed harness on their own release
|
||
binaries — P1a `0bf7cf21…`, P1b `540b8b7e…` — three tries per row, lazy
|
||
client, warm workspace scope, scratch index caches, load 3.0–5.6 recorded
|
||
before and after every phase, corpus verified unchanged after every phase,
|
||
zero guard kills. Paired change is `100 × (REF − candidate) / REF` on repeat
|
||
medians. Raw rows: `~/.cache/lucisv-perf/take5-p1/results-p1{a,b}.jsonl`.
|
||
|
||
**P1c note.** Taken on release server sha256
|
||
`33a6888af3f2bc9b3b2d1fb2844f3d93f9f5950839446866838244f913d56cf1`, three
|
||
tries per row, lazy client, warm workspace scope, scratch index caches, load
|
||
3.8–4.9 recorded before and after every phase, corpus verified unchanged after
|
||
every phase, zero guard kills, no `cargo` command during any timed phase. Raw
|
||
rows: `~/.cache/lucisv-perf/take5-p1c/results-p1c.jsonl`. The `refactor` phase
|
||
was **not** run at P1a or P1b, so its rows below are paired against the §P0
|
||
REF and part of each delta is §P1b's.
|
||
|
||
| Metric / baseline source | Baseline | Proposed goal or guardrail | Candidate | Paired change | Verdict |
|
||
|---|---:|---|---|---|---|
|
||
| Pinmux comment, lazy all families (`offer-breakdown`) | 328.41 / 296.78–311.73 ms; 0 actions | Repeated <16 ms; first-after-edit separate | **REF (P0, same binary, `offerkinds`)** 333.89 / 307.35–312.97 ms; 0 actions — REF repeat median **309.60**. **P1a** 289.33 / 251.87–258.91, median 258.06. **P1b** 50.07 / 23.79–24.43, median **24.02**; 0 actions in every try. **P1c** 25.42 / 23.05–23.61, median **23.55**; 0 actions | REF vs baseline +4.1%. **P1a −16.6%, P1b −92.2%, P1c −1.9% on P1b** | REF agrees. P1b is a 12.9× reduction with an identical (empty) answer. **Target <16 ms still missed**, and P1c cannot move it: this cursor offers nothing, so no predicate runs — the remaining 23.6 ms is the lint pass, which is the deferred lint-memo item |
|
||
| Pinmux comment, `only: []` | 78.88 / 79.43–81.62 ms; 0 actions | Return near transport floor; no lint/parse | **REF** 81.72 / 82.27–84.11 ms; 0 actions — REF median **82.80**. **P1a** 0.13 / 0.053–0.070, median 0.064. **P1b** 0.12 / 0.049–0.054, median **0.053** | REF vs baseline +1.7%. **P1a −99.9%, P1b −99.9%** | Goal met: an empty filter answers at the transport floor (that row is itself 0.061–0.102 ms), with no config read, no lint and no parse — asserted by parse count in `an_empty_only_filter_answers_empty_and_does_no_work_at_all` |
|
||
| Pinmux comment, quickfix only | 79.54 / 79.73–80.06 ms; 0 actions | Avoid repeated lint/fence work safely | **REF** 82.76 / 82.50–85.06 ms; 0 actions — REF median **84.13**. **P1a** 24.03 / 23.47–23.85, median 23.53. **P1b** 23.57 / 23.92–24.25, median **24.05** | REF vs baseline +5.5%. **P1a −72.0%, P1b −71.4%** | The 60 ms P1a removed here is the fence parse, skipped because **no finding in this buffer carries a fix**. P1b cannot improve it further: what is left is the configuration read plus the lint pass, and no lint-result reuse was added (see `P1b-2026-09-07`) |
|
||
| Pinmux comment → queued definition (`offer-queue`) | 300.66–304.11 ms follower, 3 pipelines | Repeated follower <16 ms if no other blocker | **REF (`offerqueue`)** follower 339.47 / 309.07 / 309.72 ms; leader 339.53 / 309.08 / 309.73; 3 pipelines, now in `leader_ms`/`follower_ms` — REF follower mean of pipelines 2–3 **309.40**. **P1a** follower 275.77 / 253.20 / 251.68 (mean 2–3 = 252.44). **P1b** follower 43.62 / 25.57 / 23.65 (mean 2–3 = **24.61**). **P1c** follower 38.02 / 25.83 / 23.85 (mean 2–3 = **24.84**) | REF vs baseline +2.0%. **P1a −18.4%, P1b −92.0%, P1c −0.9% on P1b** | The queued definition falls with its blocker, as the plan predicted. **Target <16 ms missed** by the same lint the leader pays; the leader here offers nothing, so P1c has nothing to remove |
|
||
| `tb.sv` comment, lazy (`codeaction`) | 6.15 / 3.22–3.50 ms; 0 actions | Repeated <5 ms; no added parse | **REF** 5.53 / 3.80–4.79 ms; 0 actions — REF median **4.46**. **P1a** 5.99 / 3.89–4.76, median 4.02. **P1b** 5.49 / 3.48–4.29, median **3.65**. **P1c** 3.70 / 2.63–2.98, median **2.73** | REF vs baseline **+27.9%** (outside tolerance, see the P0 entry). **P1a −9.9%, P1b −18.3%, P1c −25.1% on P1b** | Target <5 ms **met**. The same file's `offerkinds` cursor is a sub-millisecond row and is not read (0.60 → 0.84) |
|
||
| `aes` lazy offer (`codeaction`) | 12.39 / 8.15–9.11 ms; 1 action | Repeated <5 ms | **REF** 13.87 / 7.33–9.66 ms; 1 action — REF median **8.17**. **P1a** 14.30 / 7.21–9.60, median 7.92. **P1b** 11.41 / 7.11–9.70, median **7.76**; 1 action in every try. **P1c** 2.72 / 1.60–2.03, median **1.74**; 1 action in every try | REF vs baseline −8.0%. **P1a −3.1%, P1b −5.0%, P1c −77.6% on P1b** | **Target <5 ms met at P1c.** The other three fan-out cursors fall with it: 42 → **0.77**, 67 → **1.78**, 128 → **1.38** ms lazy |
|
||
| `aes_reg_top` lazy offer (`codeaction`) | 32.81 / 22.45–25.09 ms; 2 actions | Repeated <10 ms | **REF** 30.64 / 22.72–24.42 ms; 2 actions — REF median **23.31**. **P1a** 32.24 / 22.08–24.17, median 23.60. **P1b** 31.50 / 20.93–24.42, median **21.83**; 2 actions in every try. **P1c** 6.92 / 4.80–5.62, median **5.46**; 2 actions in every try | REF vs baseline +1.0%. **P1a +1.3% (no change), P1b −6.3%, P1c −75.0% on P1b (−76.6% on REF)** | **Target <10 ms met at P1c.** P1b's residue was the discarded ports plan; §P1c replaced it with a predicate. The 5.46 ms left is dominated by the one parse of `aes_reg_top.sv` (52 461 B, 2.16–2.43 ms standalone) |
|
||
| `aes_reg_top` ports-only offer (`offer-breakdown`) | 21.72 / 21.55–21.78 ms; 0 port actions | Remove throwaway edit computation | **REF (`offerkinds`)** 22.27 / 22.46–22.56 ms; 0 port actions — REF median **22.47**. **P1a** 21.68 / 21.28–21.89, median 21.84. **P1b** 20.86 / 21.14–21.48, median **21.15**; 0 port actions. **P1c** 3.51 / 3.08–3.45, median **3.27**; 0 port actions | REF vs baseline +3.3%. **P1a −2.8%, P1b −5.8%, P1c −84.6% on P1b (−85.5% on REF)** | The row P1c existed for. All four planners refuse at *plan* time here, and the offer used to pay four `WorkspaceIndex::build`s (3.89 ms each, measured) to be told so. The all-family cell at the same cursor is 21.79 → **4.70** |
|
||
| `state_q` tail rename (`tailrename`) | 821.59 / 789.50–809.83 ms; 2 files | At least 2× faster; stretch <200 ms | **REF** 813.44 / 778.77–782.13 ms; **5 edits / 2 files / 0 created**, fingerprint `b39defb21265…` — REF repeat median **780.45**. **P2a** 817.45 / 789.49–782.21, median 784.19. **P2b** 706.50 / 676.19–673.57, median **674.68**. **P2c** 451.54 / 421.27–419.86, median **419.86**; 5 edits / 2 files / 0 created, **fingerprint identical** | REF vs baseline −1.4%. **P2a +0.5% (no change), P2b −13.6%, P2c −46.2% on REF** | **Target ≥2× missed**, at **1.86×**; stretch <200 ms not approached. The measured remaining stage is `Scope::build` — one parse of each of the **238 selected files**, 225 ms of the 420 — plus 83 ms of `warnings`, a token scan. Whole-file parses fell **717 → 240 = K + E** |
|
||
| Ordinary `aes` rename (`rename`) | 168.67 / 139.34–140.35 ms; 9 files | No regression; exact edit/warning parity | **REF** 167.60 / 140.46–142.13 ms; **14 edits / 9 files / 0 created**, fingerprint `fa7e31c78382…` — REF repeat median **141.30**. **P2a** 168.44 / 141.31–140.15, median 140.15. **P2b** 142.71 / 123.11–123.08, median **123.08**. **P2c** 126.13 / 107.15–105.95, median **106.31**; 14 edits / 9 files, **fingerprint identical** | REF vs baseline +1.2%. **P2a −0.8%, P2b −12.9%, P2c −24.8% on REF** | Goal was *no regression*; it is **25 % faster**, with byte-identical edits and warnings. Parses 51 → **22 = K + E** |
|
||
| Common port name `clk_i` at its declaration (`renametrace`, **new**) | not measured | Measure the fan-out's escape hatch | **P2a** 7 249.73 / 7 158.16–7 142.58, median **7 158.16**; the ambiguity hatch fires, so the input is the **whole workspace** — 3 976 files / 35.8 MB, 10 399 parses, peak RSS 1 864 MiB; 2 edits / 2 files, fingerprint `31aadc134628…`. **P2b** median 6 286.13, 9 150 parses, 1 840 MiB. **P2c** 3 985.94 / 3 888.95–3 860.05, median **3 860.05**, **3 977 parses**, 1 830 MiB, **fingerprint identical** | **P2c −46.1% on P2a** | New row, new phase. The worst rename on this corpus, and the one the fallback's cost is really made of. Still 3.9 s: 1 826 ms of it is one parse of each of the 3 976 files, 848 ms `warnings`, 245 ms selection |
|
||
| Unique internal name (`renametrace`, **new**) | not measured | The shape the fan-out is built for | **P2a** median **23.05 ms**; 4 files / 68 KB, 10 parses, fingerprint `5f53e977da59…`. **P2b** 21.84, 9 parses. **P2c** median **19.84**, **5 parses**, **fingerprint identical** | −13.9% | New row. `cipher_alert` in `aes_core.sv` — the case the six rungs exist to make cheap, and they do |
|
||
| Conflicting new name, refused (`renametrace`, **new**) | not measured | A refusal is timed as a refusal | **P2a** median **640.81 ms**, 638 parses, `status: refused`. **P2b** 530.26, 498 parses. **P2c** median **331.18**, **244 parses**; same sentence, same empty-edit fingerprint `96f32d4243b1…` | **−48.3%** | New row. `state_q → state_d` in `entropy_src_main_sm.sv`; the verifier still refuses, in the same words, in half the time |
|
||
| All-sources fallback, ambiguous references (`renametrace`, **new**) | not measured | Do not lose the refusal it exists for | `rstmgr_por` (declared in four files): **P2a** median 2 146.63 ms, **P2c** **2 137.42**; 3 975 parses at both, peak 922 → 927 MiB, same refusal sentence. A cursor on **no symbol** takes the same road through `rename.rs`: 2 136.20 → **2 160.63** | ~0 % | New rows, both unmoved — and correctly so. Both refuse inside `locate`, having paid one whole-workspace `Scope::build` (1 840 ms) and nothing else; there is no repeated work in either for §P2b/§P2c to remove |
|
||
| Definition behind ordinary rename (`blockers`) | 145.99–168.79 ms, 3 pipelines | Falls with rename work | **REF** 163.43 / 161.55 / 161.11 ms, 3 pipelines (now `follower_ms.definition`) — REF mean of pipelines 2–3 **161.33**. **P2a** 158.88 / 158.80 / 154.17 (mean 2–3 = 156.48). **P2b** 148.86 / 138.02 / 145.25 (141.64). **P2c** 130.87 / 123.37 / 120.32 (**121.85**) | REF inside the baseline range; **P2c −24.5% on REF** | The queued definition follows its blocker exactly as the plan predicted |
|
||
| Connect missing ports resolve (`refactor`) | 170.77 / 164.79–165.82 ms; 1 file | Measure collateral benefit; exact edit parity | **REF** 171.37 / 165.77–167.45 ms; 1 file, REF median **166.51**, fingerprint `4b534a16bca7…`. **P1c** 168.01 / 165.15–209.85, median **169.13**; 1 file, 2 edits, **fingerprint identical**. **P2a** median 164.91, **P2b** 165.29, **P2c** 142.25 / 131.21–132.72, median **132.72**; 1 file, 2 edits, **fingerprint identical** | REF vs baseline +0.4%; P1c +1.6%; **P2c −20.3% on REF** | The collateral the plan asked to be measured: `verify_splice` reaches the same after-index and the same re-resolution §P2c gave the rename, and the edit is byte-identical |
|
||
| Expand wildcard resolve (`refactor`) | 73.02 / 70.35–70.73 ms; 1 file, 32 connections | No lost connections/refusals | **REF** 73.61 / 71.67–73.01 ms; 1 file, 32 connections, REF median **71.89**, fingerprint `8f3a26dd147b…`. **P1c** 76.61 / 69.34–71.40, median **70.22**; 1 file, 32 connections, **fingerprint identical**. **P2a** median 70.31, **P2b** 70.29, **P2c** 66.31 / 54.91–55.85, median **54.91**; 1 file, 32 connections, **fingerprint identical** | REF vs baseline +2.2%; P1c −2.3%; **P2c −23.6% on REF** | Agrees; no connection and no refusal moved, and the same §P2c collateral |
|
||
| Eager 128-fan-out offer (`codeaction`) | 518.32 / 495.60–499.69 ms | Compatibility/perf guardrail; not first priority | **REF** 523.16 / 495.13–496.77 ms; 2 actions — REF median **496.24**. **P1b** 519.49 / 492.71–494.57, median **493.92**; 2 actions. **P1c** 516.78 / 492.51–496.34, median **492.54**; 2 actions | REF vs baseline +0.1%. **P1b −0.5%, P1c −0.3%** | Unchanged, which is the guardrail: the eager path's cost is the module's fan-out, and neither P1b nor P1c touched it — `code_actions` still computes and verifies every plan |
|
||
| Port-actions **offer**, `aes_wrap.sv` 78:2 (`refactor`, **new**) | not measured as a row — take 4's §6b prose only | Repeated <5 ms; identical titles | **REF (P0)** 38.79 / 24.57–27.80 ms; 2 actions, REF median **24.84**. **P1c** 1.53 / 1.13–1.45, median **1.19**; 2 actions, same titles | **−95.2% on REF** | New row. The site that actually offers a port refactoring on opentitan. Part of the delta is §P1b's gate (0.06–0.14 ms per family), the rest is §P1c. Not run at P1a/P1b |
|
||
| Organize-imports **offer**, `aes_sbox_canright_masked.sv` 42:2 (`refactor`, **new**) | not measured as a row — take 4 §6c put it at 30.1 / 13.8–19.5 | Repeated <5 ms; identical counts | **REF (P0)** 32.25 / 13.70–18.04 ms; 2 actions, REF median **15.39**. **P1c** 8.42 / 4.69–6.59, median **4.88**; 2 actions, title `lucisv: organize imports (removes 1, sorts 1)` unchanged | **−68.3% on REF** | New row. **Target <5 ms met.** The residue is one `Scope::build` over the buffer and its two packages (2.05 ms standalone); the buffer's own share of it is the handshake request in `perf5-p1`'s README |
|
||
| Organize-imports **resolve** (`refactor`, **new**) | not measured | No lost removal, sort or refusal | **REF (P0)** 9.87 / 9.45–10.15 ms; 1 file, 1 edit, fingerprint `0ee027e37d07…`, REF median **9.45**. **P1c** 14.62 / 9.96–11.97, median **11.03**; 1 file, 1 edit, **fingerprint identical** | +16.7% on REF, inside this document's ±20% band for a 1–20 ms row | New row. The resolve path is unchanged by §P1c — `organize`'s middle was lifted into `planned` and it still verifies the splice |
|
||
| First offer after a `didChange`, same cursor (`offeredit`, **new**) | not measured — the gap the P0 entry named | Track separately from the repeated offer | **P1a** pinmux 383.61 / 366.93–369.71 (median 368.32); `aes_reg_top` instance 35.82 / 23.38–26.30 (24.84); `tb.sv` comment 4.80 / 3.28–3.42 (3.35). **P1b** pinmux 152.88 / 132.68–135.04 (median **133.86**); `aes_reg_top` 28.82 / 22.58–22.75 (**22.66**); `tb.sv` 2.29 / 1.90–2.00 (**1.95**) | P1a → P1b: pinmux **−63.7%**, `aes_reg_top` −8.8%, `tb.sv` −41.8% | New row, new phase `offeredit`. Each try is the *first* `codeAction` after its own `didChange`, so the document rebuild is inside the number; the paired "repeated offer on the unchanged buffer" rows sit beside them in the same session (P1b: pinmux **24.18**, `aes_reg_top` **21.65**, `tb.sv` **0.54**). No REF exists — P0 could not measure it |
|
||
| Extract command actually executed (`execute`, **new**) | not measured — take 4's `extract-module resolve` rows are invalid | Measure the command, not a refusal | **REF** `lucisv.extractModule` at `aes.sv` 220:0–222:53: **257.33 / 245.05–247.00 ms** executeCommand→applyEdit; 2 edits / 2 files / **1 created**; `deliver_ms` 0.015–0.033; status `capture`; fingerprint `090e92e7736e…` — REF median **246.03**. **P2a** median 244.53, **P2b** 244.78, **P2c** 161.41 / 149.25–149.86, median **149.25**; 2 edits / 2 files / 1 created, **fingerprint identical** | new row; **P2c −39.3% on REF** | The gap the tracker's work-count table named is closed — and §P2c's `verify_move` reuse is worth 39 % of the one refactoring command that really runs |
|
||
| Inline command actually executed (`execute`, **new**) | not measured | Measure the command, not a refusal | `lucisv.inlineModule` at `aes_wrap.sv` 66:2 is **refused** (`generate` construct); 6.58 / 5.87–6.20 ms. Not a timing of an inline | new row | Refusal recorded as `refused`; **not quotable** as an inline cost |
|
||
| Extract offered at the inline cursor, refused (`execute`, **new**) | not measured | — | `lucisv.extractModule` at `aes_wrap.sv` 66:2 refused after **817.37 / 793.77–809.07 ms** — REF median ~801. **P2a** 802.03, **P2b** 802.07, **P2c** median **801.23** | new row; **0 % at P2c** | Unchanged, and correctly so: it refuses *immediately after* `Scope::build`, so there is no repeated analysis for §P2b/§P2c to remove. Its cost is `module_sources` selecting hundreds of files for a **package** name — §P2d and handshake 33 territory |
|
||
| Cold workspace scan (`scan`, 3 fresh sessions) | 2830.30–2853.06 ms; mean 2843.00 | Investigation goal <2300 ms | **REF** 2860.12–2868.45 ms; mean 2863.85 | +0.7% on means | Agrees |
|
||
| Warm workspace scan (`scan`, 3 fresh sessions) | 1322.24–1344.03 ms; mean 1332.41 | Investigation goal <1000 ms | **REF** 1346.02–1352.80 ms; mean 1348.94 | +1.2% on means | Agrees |
|
||
| First useful answer during the scan (`scan`, **new**, 3 fresh sessions) | not measured | Stay responsive during a scan (P4) | **REF** cold **84.42–85.87 ms**, warm **206.12–218.72 ms**; 1 location in every session | new row | Warm is 2.5× *slower* than cold to first answer — carried to P4a |
|
||
| Cold idle RSS (`rss`, 3 fresh sessions) | 528.0–530.9 MiB | Investigate ≥15% reduction; counts unchanged | **REF** 526.7 / 530.2 / 535.2 MiB (`rss_kib`, no longer in `ms`) | +0.8% on the maximum | Agrees |
|
||
| Warm idle RSS (`rss`, 3 fresh sessions) | 566.4–573.8 MiB | Investigate ≥15% reduction; measure peak too | **REF** 575.0 / 572.5 / 575.6 MiB | +0.3% on the maximum | Agrees |
|
||
| Peak RSS across the scan (`rss`, **new**) | not measured | Measure peak, not only idle | **REF** cold 526.7 / 530.2 / 535.2 MiB, warm 575.0 / 572.5 / 575.6 MiB — **equal to idle to the KiB in all six sessions** (`ps -o rss=` at 50 ms) | new row | The resident set rises monotonically; there is no transient above idle on this workload |
|
||
| Index store allocated size (`rss`, `du -sk`) | 44.34 MiB | Record codec/version and contents | **REF** 45 404 KiB = **44.34 MiB** (`store_kib`) | 0.0% | Identical |
|
||
| Pinmux open → definition (`didopen`, 3 fresh sessions) | 128.13–129.96 ms | Preserve §46 benefit | **REF** 119.01–131.85 ms | −3.8% on medians | Agrees; §46's fix intact |
|
||
| `tb.sv` dirty-buffer folding barrier (`flush`) | 1.05 / 0.65–0.72 ms | No material regression | **REF** 1.90 / 0.93–1.01 ms | **+35.5%** — outside tolerance, see experiment entry | Disagrees; a ~1 ms row, neither number adjusted |
|
||
| Diagnostics publication (`diagnostics`) | 158.02 / 155.95–157.62 ms | Preserve debounce/burst coalescing | **REF** 156.72 / 152.74–160.55 ms | +1.6% | Agrees |
|
||
| Unblocked definition (`nav`) | 0.365 / 0.048–0.084 ms; 1 location | Transport-sensitive regression control | **REF** 0.528 / 0.145–0.206 ms; 1 location | +132% but **sub-millisecond: not read** | Not read, per the round's own rule |
|
||
| Transport floor (`baseline`) | 0.240 / 0.066–0.070 ms | Record contemporaneous noise | **REF** 0.207 / 0.061–0.102 ms; `status: error` with `expected_status: error` (an unknown method, rejected without work) | +10.6% but **sub-millisecond: not read** | Not read; the row's rejection is now explicit |
|
||
| CLI default, hw/ip | 0.59 / 0.40–0.40 s; 445 findings | First trial outlier; compare paired repeats | **REF** 0.39 / 0.38–0.39 s; 445 findings; stdout sha256 **identical to baseline** | −3.0% on repeats (baseline's first trial excluded as the owner flagged) | Agrees on repeats; outcome byte-identical |
|
||
| CLI all-style, hw/ip | 0.58 / 0.56–0.58 s; mean 0.573 s; 7751 findings | Retain all findings | **REF** 0.58 / 0.59–0.59 s; mean **0.587 s**; 7751 findings; stdout sha256 identical | +2.4% on means | Agrees; reference for P3 |
|
||
| CLI all-style minus unused-import, attribution only | 0.44 / 0.44–0.47 s; mean 0.450 s; 7734 findings | Save ≥half of 123 ms increment with rule enabled | **REF** 0.46 / 0.43–0.46 s; mean **0.450 s**; 7734 findings; stdout sha256 identical | 0.0% on means; the increment reproduces at **137 ms (23.3% of all-style)** against the baseline's 123 ms (21.5%) | Agrees; P3's target is ≥half of the increment measured on its own reference |
|
||
| CLI all-style peak RSS | 208.4 MiB max of 3 | No material memory increase | **REF** 217.0 MiB max of 3 | +4.1% | Agrees |
|
||
| Format check independently cold, hw/ip | 0.67 / 0.59–0.68 s | 0 cache hits; unchanged outcomes | **REF** 0.67 / 0.61–0.70 s; **0 cache hits in all three tries**; 1772 would reformat, 30 unchanged, 4 failed; stdout sha256 identical | +2.0% on means | Agrees, and cold is now provably cold |
|
||
| Format check warm, hw/ip | 0.69 / 0.61–0.63 s | 30 hits; unchanged outcomes | **REF** 0.67 / 0.65–0.66 s; **30 hits in all three tries**; same outcomes; stdout sha256 identical | +2.6% on means | Agrees |
|
||
|
||
## Work counts and gaps that must be filled before attributing gains
|
||
|
||
| Measurement | Baseline knowledge | Reference — agent fills | Candidate — agent fills |
|
||
|---|---|---|---|
|
||
| Additional parses per no-offer all-family action | 5 text-parse entry points confirmed in source; no runtime counter | Still no runtime counter — P0 is harness-only and adds no production instrumentation. The wire-side attribution is reproduced (`offerkinds`): 82.80 ms shared base at the pinmux cursor, +52.7 to +57.6 ms for any one selector family | **Counter added and asserted on.** `vlog_parser::stats::parses()` counts whole-file parses (thread-local; a request is answered on one thread). At a no-offer cursor a *repeated* all-family `codeAction` performs **0** parses, an `only: []` request **0**, and the first request after a `didChange` **≤2** (the document's own parse, plus the fence answer when a fix exists) — `server::tests::code_action`. On the wire the five parses are gone: a single selector family fell from 58.6–59.7 ms to **0.06–0.14 ms** at the pinmux cursor. **P1c:** at a cursor that *does* offer, a repeated ports offer performs **1** parse — the instantiated module's declaring file — and a repeated organize-imports offer **3**, one `Scope::build` over the buffer and the two packages it imports. Both are asserted by count in `server::tests::code_action` against a `resolveSupport` client, which is the path the offer predicates are on |
|
||
| Lint/config/fence time separately | About 80 ms combined on generated file; unseparated | Reproduced but still unseparated: pinmux `only: []` 82.80 ms, quickfix 84.13 ms. Separating them needs P1's counters | **Separated by P1a's gates.** `only: []` now answers in **0.064 ms**, so none of the 82.8 ms was unavoidable. Quickfix-only is **23.53 ms** — the configuration read plus the lint pass. The difference, **59.3 ms, was the fence parse**, and it vanished at this cursor because no finding in `pinmux_reg_top.sv` carries a fix, so §P1a's "no fix, no fence" gate skips it outright |
|
||
| Selector time by family and file size | Filtered ablations preserved in raw data | **Promoted to the committed `offerkinds` phase**: 7 families × 5 cursors × 4 requests, result counts in every row. All-family repeat medians by cursor — tb 1.54 / aes-reg-instance 23.51 / aes-core 10.42 / spi 14.43 / pinmux 309.60 ms. Pinmux by family: `[]` 82.80, quickfix 84.13, extract 140.42, inline 136.37, ports 137.97, organizeImports 135.45 | **P1b, same phase.** All-family repeat medians by cursor — tb **0.60** / aes-reg-instance **21.79** / aes-core **2.30** / spi **3.16** / pinmux **24.02** ms. Pinmux by family: `[]` **0.053**, quickfix **24.05**, extract **0.107**, inline **0.074**, ports **0.063**, organizeImports **0.060** — every selector family is now under a seventh of a millisecond on a 1.3 MB buffer. The one family that did not move is ports **at an offering cursor** (aes-reg-instance 22.47 → **21.15**), which is P1c's row. **P1c, same phase:** aes-reg-instance all families **4.70**, its ports family **3.27** — the last selector family to be measured in whole milliseconds at an offering cursor is now measured in fractions of one, and the 3.27 is dominated by the single parse of the 52 KB declaring file |
|
||
| Tail rename selected paths / input bytes / selection reasons | Not measured; **2 output files is not input count** | Still not measured (needs P2a's server-side instrumentation). What P0 adds is the **output** side, exactly: 5 edits / 2 files / 0 created, fingerprint `b39defb21265…` | **Measured, §P2a.** **238 files / 4 554 326 bytes**, by rung: request 1, declaration 95, reference 122, instantiation 19, macro text 0, speller 0, open buffer 1, fallback **false**. So the input is 119× the output, and it is the declaration and reference rungs of a name 95 files declare. Unchanged at §P2b/§P2c — this lane narrows nothing |
|
||
| Tail rename watched vs edited paths | Edited 2; watched unmeasured | Edited 2, confirmed by `files`; watched still unmeasured — P2a | **Measured, §P2a: watched 106 files / 1 919 528 bytes**, edited 2. Before §P2c all 106 were re-parsed for the after-print; now 2 are (the edited ones) and 104 are re-resolved from the analysis the before-pass made |
|
||
| Tail rename index / parse / analysis / resolution / verification stage times | Not measured | Not measured — P2a | **Measured, §P2a** (ms / whole-file parses): selection 13.4/0, `Scope::build` 228.5/**238**, `locate` 0.5/1, occurrence walk 116.3/**134**, token identity 4.3/0, before-prints 14.0/0, `rebuilt_index` 228.4/**238**, after-prints 71.5/**106**, warnings 83.6/0 — **717 parses**, 73 % of the request. **§P2c**: 13.4 / 225.1 / 0.0 / 12.1 / 4.5 / 14.0 / **37.2** / **7.9** / 83.3 — **240 parses = K + E** |
|
||
| Ordinary rename selected bytes / stages | Edited 9; other counts unmeasured | Edited 9 confirmed (14 edits, fingerprint `fa7e31c78382…`); stages unmeasured — P2a | **Measured, §P2a: 13 files / 400 051 bytes** (request 1, declaration 4, reference 8), watched 12 / 398 160 bytes, edited 9; 51 parses; index 23.4, occurrence walk 19.2, verify 63.3 (rebuild 22.4, after 20.3), warnings 23.4 ms. **§P2c: 22 parses = K + E**, verify 46.8 (rebuild 23.4, after 2.9) |
|
||
| Ambiguous-use all-sources fallback frequency | Not measured | Not measured — P2a | **Measured, §P2a.** Of the eight renames the `renametrace` phase walks, **four** take the whole scope: a common port name (`clk_i`, whose declarations carry ambiguous references), a duplicate module name (`rstmgr_por`, declared in four files), a new name a great many external uses spell, and a cursor on no symbol at all (which `rename.rs` answers with `ws.sources()` outright, without consulting the ladder). Each costs a **3 976-file / 35.8 MB** `Scope::build`, ~1 840 ms, before anything else happens |
|
||
| Per-file parses for CLI census and lint | Multiple paths confirmed; runtime counts unmeasured | Not measured — P3 | — |
|
||
| CLI package-census vs unused-import body time | Combined 123 ms wall increment; stages unseparated | Increment reproduced on the same binary at **137 ms, 23.3% of all-style** (means 0.587 vs 0.450 s, three trials, alternating order, stdout hashes identical to baseline). Stages still unseparated — P3 | — |
|
||
| Startup discovery / hash / decode / merge / candidates / includes / compact | Only combined scan time measured | Still only combined — P4a. P0 adds the scan's *other* half: first useful answer, cold **84.42–85.87 ms** vs warm **206.12–218.72 ms**, and the settle of those same perturbed sessions (cold 2855–2877, warm 1340–1358 ms) | — |
|
||
| Peak server RSS during startup and refactoring | Idle RSS only; peak unmeasured | **Startup peak measured** (`peak_rss_kib`, `ps -o rss=` at 50 ms across the scan): cold 526.7 / 530.2 / 535.2 MiB, warm 575.0 / 572.5 / 575.6 MiB — equal to idle to the KiB in all six sessions, i.e. no transient above idle. Refactoring peak still unmeasured — P2a | **Measured, §P2a, and re-measured at §P2b/§P2c** (MiB, `ps -o rss=` at 50 ms across each rename): tail 590 → 610 → 593; `aes` 582 → 577 → 585; unique internal 570 → 579 → 579; **`clk_i` fallback 1 864 → 1 840 → 1 830**; conflict 647 → 639 → 641; `cipher_alert → clk_i` **1 809 → 1 695 → 1 590**; `rstmgr_por` fallback 922 → 901 → 927; no-symbol 914 → 905 → 918. **No row's peak rose by more than 20 MiB and the two heaviest fell** — retention is bounded to the files the request was going to analyse anyway |
|
||
| First useful response during scan; open buffers 1 / 10 / 100 | Not measured in this round | **First useful response measured** (above), each session a fresh process, kept in separate sessions from the settled rows so the settled series stays comparable. Open buffers 1 / 10 / 100 not measured — P4a | — |
|
||
| Actual inline/extract command time and applyEdit payload | Not measured; existing resolve rows invalid for this purpose | **Measured, phase `execute`.** `lucisv.extractModule` (`aes.sv` 220:0–222:53): 257.33 / 245.05–247.00 ms from `executeCommand` to `workspace/applyEdit`, payload 2 edits / 2 files / 1 created, label `lucisv: lucisv.extractModule`, fingerprint `090e92e7736e…`, declined with `applied: false` (status `capture`), delivery half 0.015–0.033 ms. `lucisv.inlineModule` (`aes_wrap.sv` 66:2) **refused** (`generate` construct) in 6.58 / 5.87–6.20 ms; the extract offer at that same cursor **refused** after 817.37 / 793.77–809.07 ms. Take 4's `*-module resolve` rows are removed, not reinterpreted | — |
|
||
| First offer after didChange vs repeated unchanged offer | Separate distribution needed | Not measured. Every row separates the *first request of a session* from its repeats, but no row yet issues a `didChange` and then re-offers — P1's measurement | **Measured, new phase `offeredit`** (`tools/perf/phases_p1.py`): three `didChange` → `codeAction` pairs, then three repeats at the same cursor in the same session. P1b medians — pinmux **133.86** first-after-edit against **24.18** repeated; `aes_reg_top` instance **22.66** against **21.65**; `tb.sv` comment **1.95** against **0.54**. So on the generated file the edit itself (one `Document::new`: lex, parse, analyze, resolve, line-index 1.3 MB) is ~110 ms and dwarfs the offer; on ordinary files the two are within 1 ms |
|
||
|
||
## Correctness and integration gates
|
||
|
||
P0 changed no production code, so most of these gates have nothing to test at
|
||
this stage; each says so rather than being left ambiguous.
|
||
|
||
| Gate | Required evidence | Candidate result / log |
|
||
|---|---|---|
|
||
| Action parity | Titles/kinds/counts/commands/data or edits/refusals; empty/prefix filters; cursor and selection | **P0: recorded, not yet a comparison.** Every offer row now carries `titles`, the shape of each offer (`edit`/`command`/`data`), `result_count` and the `only` filter it asked with; `offerkinds` walks 7 filters at 5 cursors. This is the reference P1 must match — **P1a/P1b: matched.** Every one of the 60 rows in each stage carries the REF's own `result_count`, and the `codeaction` rows the REF's own `titles`; all 7 filters at all 5 cursors agree. In tests, `vlog_refactor/tests/parsed_selectors.rs` compares old against new at **every byte offset** of five fixtures, and `server/tests/code_action.rs` pins order, prefix filters, the empty filter, a cursor-width extraction and a fix spanning the cursor. **P1c: matched again** — every row of `offerkinds`, `codeaction` and `offerqueue` compared field-by-field against P1b's own record (`result_count`, `titles`, `shapes`, `status`, `fingerprint`, `edits`, `files`, `created`): **50 rows, 0 differences**; against the P0 REF, **65 rows, 0 differences**. In tests, `vlog_refactor/tests/port_offers.rs` compares the offered *menu* against `port_actions`' menu — titles included, in order — at every byte offset of eight fixtures, and `import_offers.rs` compares `organize_offer` against `organize_counts` — counts and refusal sentence — at every byte offset of seven |
|
||
| Reuse freshness | didChange, unsaved overlays, config/options/tab width/waiver changes, index generation, closed files changed on disk | Not applicable at P0. **P1b: one memo exists, the fence answer, and it is bound to the `Document` that owns the text** — `Workspace::set_document` builds a whole new `Document` on every `didOpen`/`didChange`/text-carrying `didSave`, and `answer_request` flushes pending changes before any handler runs, so there is no revision to compare and no way to hold the wrong one. Pinned by `a_fence_typed_into_the_buffer_is_seen_by_the_next_request` (fix → fence typed in → fix withheld → fence removed → fix back). Configuration is **not** memoized: `an_external_waiver_still_keeps_its_fix_out_of_the_offer` writes a `lucisv.toml` between two requests and the second obeys it. An index rebuild between two requests changes nothing at the cursor (`an_index_refresh_does_not_change_what_the_cursor_offers`). **Lint results are not cached** — see the `P1b-2026-09-07` entry for why and for the number |
|
||
| Fence parity | All aliases, class/statement fences, malformed source, raw scan backstop, insertions and multi-edit fixes | Not applicable at P0. **P1: `vlog_formatter/src/fence.rs` is untouched and the shared-fence-filter contract is not amended** — the question asked is still `protected_regions(&doc.text)`, byte for byte, so every alias, class/statement fence, malformed-source case and scan backstop is answered by the same code as before. What changed is *when* it is asked (only when a violation carries a fix) and *how often* (once per document revision). `vlog_formatter`'s own suite is green |
|
||
| Refactor whole-scope parity | Exact edits, warnings, refusal sentences; old/new common names, unresolved and ambiguous uses | **P0 supplies the instrument**: `fingerprint` (sha256 over sorted edits + created paths + warnings) and `edits`/`files`/`created` on every edit-bearing row, plus refusal sentences captured verbatim in `message`. First reference values recorded (tail rename, `aes` rename, extraction). **P2: matched on every row of every stage.** All thirteen edit-bearing rows of `renametrace`, `tailrename`, `rename`, `refactor` and `execute` carry byte-identical fingerprints at §P2a, §P2b and §P2c and equal to the §P0 REF's — `b39defb21265…`, `fa7e31c78382…`, `5f53e977da59…`, `31aadc134628…`, `4b534a16bca7…`, `8f3a26dd147b…`, `0ee027e37d07…`, `090e92e7736e…` — and the three refusal rows carry the same sentences and the same empty-edit fingerprint `96f32d4243b1…`. The common-name, unresolved-new-name and ambiguous-use cases the gate names are the `renametrace` phase's own rows |
|
||
| Topology handshake 33 | Transitive `wrap.u_S.x` refusal coverage before sharing/narrowing module sources | **Still not applicable at P2a–P2c**: `module_sources`, `offer_sources`, `imports::sources` and `rename_sources`' six rungs are untouched, and **no source set was narrowed or shared** — the ladder's only change is that the set it fills now records which rung filled it. Handshake 33 remains §P2d's prerequisite. Not applicable at P0 — no selector shared or narrowed. **Still not applicable at P1**: the four `*_in` selectors take the same decisions over the same tree, and **no source set was narrowed or shared** — `module_sources` / `offer_sources` / `imports::sources` are untouched. Handshake 33 stays P2's prerequisite |
|
||
| Refactor verification | Token identity, semantic identity, parse-diagnostic preservation, comments/attributes, span remapping | **P2: the checks are untouched; their inputs changed.** `Print`, `print`, `Shifts`, `Excluded`, `watched_files`, `tokens_match`, `first_difference`, the `ledger` and the parse-diagnostic comparison are the same code and the same comparisons; what moved is where a `Semantics` and an after-index come from (`check/after.rs`, new). Every existing attack still refuses — `check::tests`' eight `tokens_match` pairs, `check/ledger.rs`'s, `removing_an_import_a_reference_needs_is_rejected`, the `rename/tests.rs` refusals — and **three new attack pairs aimed at the reuse** were added and pass: a stale retained analysis (`a_rename_whose_edit_rebinds_a_name_in_the_edited_file_is_refused`), an after-index that forgot an unedited file (`a_rename_that_would_make_a_third_files_use_ambiguous_is_refused`), and shifted file ids (`a_print_names_paths_so_shifted_file_ids_cannot_change_it`). Not applicable at P0 — the engine's verifiers are untouched. **Unchanged at P1**: nothing below the four gates moved; `extract_module`, `inline_module`, `organize_imports`, `port_actions` and `check::verify` are the same code, and `vlog_refactor`'s own suites are green. **P1c: still unchanged where it matters.** `check::verify_splice`, `check::verify` and `ports::confirm` are untouched, and every resolve/execute path still runs them — the three resolve rows measured above carry fingerprints byte-identical to the REF's. The *offer* predicates deliberately do not run them; that is the only widening, it is confined to a menu, it was already the lazy offer's stated contract, and the every-offset parity suites find **zero** cursors on their fixtures where it changes the answer |
|
||
| CLI output | Compare full findings/fixes/waivers/exit codes, not just counts; disabled-rule run stays attribution-only | **Passed.** stdout sha256 of all five configurations byte-identical to the baseline's; exit codes 1 (lint findings) / 2 (four pre-existing format failures) as before; the `--ignore unused-import` run is recorded as attribution only |
|
||
| Index parity | Fresh/incremental/absorbed fingerprints, unsaved wins, coherent partial publication, scope/filelist/rootless behavior | **P2c pins the absorbed-against-fresh equality where the verifier now stands on it**: `an_absorbed_after_index_is_the_index_a_rebuild_would_give` compares fingerprint, file list **and** a query-level print (`units`, `references_to`, `instantiations_of`, `hierarchical_declarations`, `workspace_symbols`) on nine cases including a file gaining and losing a declaration, an edit that changes what another file resolves to, a re-export chain, an edited package and a file that stops lexing; `absorbing_an_edited_file_keeps_every_file_id` pins id stability; `an_index_from_analyzed_facts_is_the_index_a_build_gives` pins the §P2b assembly. Not applicable at P0. Store size unchanged at 44.34 MiB and the scan's own `$/progress` end messages recorded per cell (`124 → 3976 files indexed, 3975 from cache, 3 skipped` warm) |
|
||
| Persistence | Corrupt/truncated/old-format stores rebuild safely; interrupted writes; content hash retained | Not applicable at P0 |
|
||
| Resources | Guard outcomes, idle and peak memory, allocated/actual store size, stack-size requirement | **P2: zero guard kills** across nineteen timed phases and every `cargo` gate; largest resident set **1 864 MiB** (23 % of the 8 GiB limit), on the §P2a all-sources fallback — and §P2b/§P2c *lowered* it. Peak RSS re-measured per rename at all three stages (the row above); no row rose by more than 20 MiB. The one new retention is a request-local `HashMap<usize, Semantics>` bounded to the files whose text spells one of the two names, which are the files the request analyses anyway. No new parsing thread, so the 16 MiB stack contract is untouched. **Passed.** Every run under `tools/guard.sh -m 8 -t 1800`; **zero kills**; largest resident set 575.6 MiB (7% of the limit). Idle *and* peak RSS now recorded in their own KiB fields; store 44.34 MiB. **P1: zero guard kills** across ten timed runs and every `cargo` gate. Memory not re-measured (P4a's phase); the only new retention is one `Vec<Region>` per open buffer that ever needed a fence answer. No new parsing thread, so the 16 MiB stack contract is untouched |
|
||
| Formatting | `cargo fmt --all -- --check`, appropriate formatter snapshot/idempotency and corpus gates | **P2: `cargo fmt --all -- --check` clean** at every stage; the formatter is not on this change's path (`vlog_formatter` is untouched) and its suite ran green inside each workspace run. `python3 -m py_compile tools/perf/*.py` clean for the new `phases_p2.py`. Not applicable at P0 — no Rust changed, and no `cargo` command may run during a timed round. `python3 -m py_compile tools/perf/*.py` and `bash -n tools/perf/*.sh` clean. **P1: `cargo fmt --all -- --check` clean; `cargo test -p vlog_formatter` green inside the workspace run** (the formatter is not on this change's path — `fence.rs` is untouched — but it was run anyway). `python3 -m py_compile tools/perf/*.py` clean for the new phase |
|
||
| Lint/tests | Guarded affected tests then clippy/workspace tests at integration, no benchmark overlap | **P2: guarded `cargo test --workspace` green before every release build — 4 215 (before the lane) → 4 225 (§P2b) → 4 231 (§P2c), 0 failed, no test removed or weakened**; guarded `cargo clippy --all-targets` clean at each stage with **no new `#[allow]`**; `cargo fmt --all -- --check` clean. **No `cargo` command ran during any timed phase**: each stage built once, to completion, then measured. Not applicable at P0 (no Rust). No benchmark overlapped a build. **P1: `cargo clippy --all-targets` clean at both stages** (one `needless_borrow` introduced by the P1b diff was fixed; **no new `#[allow]`**), `cargo test --workspace` green before each stage's build, all guarded. **No cargo command ran during any timed phase**: each stage built once, to completion, then measured. **P1c: `cargo fmt --all -- --check` clean, guarded `cargo clippy --all-targets` clean, guarded `cargo test --workspace` **4215 passed / 0 failed** (4194 at P1b, +21), then one guarded release build, then four timed phases with no cargo running; zero guard kills; corpus unchanged after every phase. One new `#[allow(clippy::too_many_arguments)]`, on `imports::planned`, with the reason on the line |
|
||
| Documentation | Feature README, handshake updates in topo, accepted numbers in perf README; reserved lead Review untouched by dev | **P2: `docs/features/perf5-p2/README.md` created** with all seven sections, QA and Review left empty, the work log kept as the work went. **`topo.md` is not edited by this lane** — four additive edges (`FileFacts::analyzed`; `vlog_refactor::rename_traced` and its trace values; the server's `rename_trace` module; `rename::rename_traced` / `Workspace::rename_sources_traced` replacing their untraced forms at the one production call site) are written as requests in that README's Handshakes for the lead to apply. `docs/perf/README.md` untouched until the lead accepts these numbers. **Done.** `docs/features/perf5-p0/README.md` created with the required sections (QA and Review left empty); no `topo.md` edge changed because no interface changed; `docs/perf/README.md` carries a note that two take-4 row *meanings* are superseded. **P1: `docs/features/perf5-p1/README.md` created** with all seven sections, QA and Review left empty, the work log kept as the work went. `topo.md` is **not** edited by this lane — the two additive edges (`vlog_parser::stats`, the four `vlog_refactor` `*_in` selectors, the server's `fences` module) are written as requests in that README's Handshakes for the lead to apply. `docs/perf/README.md` untouched until the lead accepts these numbers. **P1c: the same README gains a P1c section in Goal, Handshakes, Status and Work log**, a dated empty QA heading, and two further handshake requests for the lead — the `port_offers` / `organize_offer` topo edges, and a `vlog_semantic` request to expose a `FileFacts` built from an existing analysis (worth ~0.8 ms of the organize-imports offer). Review still untouched by the dev |
|
||
|
||
## Experiment record — P0-2026-09-07 (stage P0)
|
||
|
||
- **Experiment ID / stage / date / owner:** `P0-2026-09-07` / P0 (TODO §60.0)
|
||
/ 2026-09-07, America/Chicago / dev agent (Opus).
|
||
- **Hypothesis and exact expected work reduction:** none — P0 changes no
|
||
production code. The hypothesis is about the *instrument*: that four named
|
||
defects (command-bearing offers timed as resolves, responses discarded by
|
||
`Session.ms`, RSS in a field called `ms`, the format cache reset once per
|
||
cold cell instead of once per cold try) made specific rows mean something
|
||
other than their names, and that fixing them leaves the surviving rows
|
||
agreeing with the owner's baseline within tolerance.
|
||
- **Reference commit, candidate commit or diff hash, binary hashes:** tree at
|
||
`9c75b7a4e517bdf91151b85814ecbb43e0d8679d` plus the uncommitted §60.0
|
||
working tree (`tools/perf/*` and docs only). Binaries **unchanged and
|
||
unrebuilt**: server `27e0a0df5b77102ec79c23279da64e722bffd440c604ad6d03ff66c2f6398ad3`,
|
||
CLI `894054128495b764bb966e7b923e08267e57aea83fdc611fad4b4ed7a66b51e3`,
|
||
both verified against `take5-baseline/metadata.json` before any timing.
|
||
- **Files changed / API contracts amended / topology references:**
|
||
`tools/perf/{schema.py (new), phases_p0.py (new), lspclient.py, harness.py,
|
||
bench.py, phases_new.py, sweep.sh, sweeptable.py, README.md}`;
|
||
`docs/features/perf5-p0/README.md` (new); this file; a note in
|
||
`docs/perf/README.md`; TODO §60.0's dev lines. **No production Rust, no
|
||
`topo.md` edge.** The only new contract is the record schema, stated in
|
||
`tools/perf/README.md` and enforced by `harness.record()` and
|
||
`schema.quotable()`.
|
||
- **Workload, corpus/input hashes, open files, cursor/range, rules, client
|
||
capabilities:** OpenTitan `0098135264`, the same three pre-existing modified
|
||
files (hashes in `take5-baseline/metadata.json`), unchanged after all 16
|
||
timed runs. Cursors and selections are `tools/perf/sites.py`'s, resolved
|
||
from file text at run time: `aes.sv` 220:0–222:53 (extract selection),
|
||
`aes_wrap.sv` 66:2 (inline), pinmux/spi/aes-core/tb comments, the five
|
||
fan-out cursors, `entropy_src_main_sm.sv` `state_q`. Client shape is in
|
||
every row; `execute` is the only session advertising `workspace.applyEdit`
|
||
and `resourceOperations: ["create","rename","delete"]`.
|
||
- **Machine, compiler/profile, threads, load before/after, competing
|
||
activity:** M1 Max, macOS 27.0 `26A5425a`, release+LTO artifacts, default
|
||
worker count. Load 2.92–5.21, recorded before and after every phase. A CI
|
||
runner's `cargo build --release -p lucisv` (an `act` host executor in
|
||
`~/.cache/act`, not this tree) was at 100% of a core at session start; **no
|
||
timing was taken until it exited**. The desktop session ran throughout, as
|
||
in take 4 and the baseline.
|
||
- **Commands, cache reset/prime steps, trial ordering and fresh-session
|
||
count:** 15 guarded `bench.py <phase>` runs (`baseline codeaction offerkinds
|
||
offerqueue refactor execute tailrename rename blockers didopen scan rss
|
||
flush diagnostics nav`, `--tries 3`), then `scan` once more (below), then
|
||
the paired CLI script. Every child through `tools/guard.sh -m 8 -t 1800`.
|
||
Index caches under a scratch `--storage`; the formatter cache under a
|
||
scratch `--cache-dir` deleted before each cold try. CLI configuration order
|
||
alternated per trial; three trials. Fresh-process rows: `scan` (3 per cell),
|
||
`rss` (3 per cell), `didopen` (3), `blockers` (3 per leader).
|
||
- **Raw evidence path, explicit units, full sample arrays:**
|
||
`~/.cache/lucisv-perf/take5-p0/` — `results.jsonl` (114 rows, schema 2),
|
||
`results-scan2.jsonl` (the second `scan` run),
|
||
`results-execute2.jsonl` (the second `execute` run), `cli-results.jsonl`,
|
||
`runs.jsonl` (per-phase command, exit, load before/after, corpus check),
|
||
`logs/`. Units are in every row (`units`); latency is `ms` only, memory is
|
||
`rss_kib` / `peak_rss_kib`, store size is `store_kib`, CLI is `s`.
|
||
- **Reference first / repeat median / range; candidate first / repeat median /
|
||
range:** the Before/after table above carries all of them; the arrays are in
|
||
`results.jsonl`. P0 has no candidate distinct from the reference.
|
||
- **Work counts: reads, parses, analyzed/selected/watched/edited files and
|
||
bytes:** no production counters (P0 adds none). Output-side counts are now
|
||
in the rows: tail rename 5 edits / 2 files / 0 created; `aes` rename 14 / 9
|
||
/ 0; extract command 2 / 2 / **1**; every offer row carries its
|
||
`result_count` and the shape of each offer (`edit` / `command` / `data`).
|
||
- **Result/status/count/fingerprint comparisons, warnings and refusal
|
||
checks:** 114 rows — 110 `ok`, 1 `capture` (the extraction's declined
|
||
`applyEdit`), 2 `refused` (both engine sentences at `aes_wrap.sv` 66:2),
|
||
1 `error` (the transport floor, carrying `expected_status: "error"`).
|
||
Result counts match the baseline everywhere they are comparable. The five
|
||
CLI configurations' **stdout sha256 are byte-identical to the baseline's**.
|
||
Fingerprints recorded for the tail rename (`b39defb21265…`), the `aes`
|
||
rename (`fa7e31c78382…`) and the extraction (`090e92e7736e…`); the baseline
|
||
has none to compare against, so these are the first reference values. The
|
||
`execute` phase was run a second time (after a cosmetic fix to a refused
|
||
row's `note` and `fingerprint`) and reproduced within 1.5% — with the
|
||
**identical** extraction fingerprint `090e92e7736e…`, which is the first
|
||
independent check that the fingerprint is stable across runs.
|
||
- **Idle RSS / peak RSS / cache size / guard outcomes:** idle cold 526.7 /
|
||
530.2 / 535.2 MiB, warm 575.0 / 572.5 / 575.6 MiB; peak equal to idle to
|
||
the KiB in all six sessions; store 44.34 MiB (unchanged); CLI peak 190.3
|
||
(default) / 217.0 (all-style) / 191.4 (all-style minus the rule) / 246.5
|
||
(format cold) / 217.3 (format warm) MiB. **Zero guard kills.**
|
||
- **Target achieved or missed; paired improvement and variability:** P0's
|
||
targets are the plan's four acceptance criteria, all met: a deliberately
|
||
rejected request is recorded as an error (the transport floor, and both
|
||
engine refusals); the inline/extract rows show a command and either an
|
||
`applyEdit` payload or a refusal sentence; cold formatter tries report
|
||
**0 / 0 / 0** cache hits and warm **30 / 30 / 30** on `hw/ip`; RSS and peak
|
||
RSS have their own fields with explicit units. **No performance claim is
|
||
made — the binary did not change.**
|
||
- **Where the reference disagrees with the baseline beyond tolerance
|
||
(neither number adjusted):**
|
||
- `tb.sv` comment, lazy: repeat median 4.46 ms against the baseline's 3.49,
|
||
**+27.9%**, outside the ±20% band a 1–20 ms row gets. A ~4 ms row on a
|
||
desktop machine; the same cursor's `offerkinds` reading (1.54 ms at a
|
||
different comment on the same file, with a `context` the phase builds
|
||
slightly differently) shows how sensitive this row is. Flagged for QA to
|
||
re-take.
|
||
- `didChange` folding barrier: 0.96 ms against 0.71, **+35.5%**. A ~1 ms
|
||
row, above the round's 0.5 ms floor but only just.
|
||
- `nav definition` (+132%) and the transport floor (+10.6%) are both
|
||
**sub-millisecond and are not read**, per take 4 §9's rule that nothing
|
||
under 0.5 ms is a reading. Recorded, not treated as movement.
|
||
- `format-cold` peak RSS 246.5 MiB against the baseline's 202.2 (+21.9%).
|
||
Not a tracker cell; recorded here because it is the one memory number
|
||
that moved by more than a few percent.
|
||
- Everything else agrees within ±5.5%.
|
||
- **Correctness tests and logs:** `python3 -m py_compile tools/perf/*.py` and
|
||
`bash -n tools/perf/*.sh` clean. No Rust changed, so the cargo gates were
|
||
not run (and could not be, mid-round). The corpus check is the correctness
|
||
gate that mattered: `git -C ~/repo/opentitan status --porcelain` after every
|
||
phase and every CLI trial, always the same three files, plus a direct check
|
||
that `aes_extracted.sv` — the file the extraction's own warning says its
|
||
edit would create — **does not exist**.
|
||
- **Interpretation, remaining bottleneck, tradeoffs, rejected alternatives:**
|
||
the instrument now says what it measures, and the two rows take 4 could not
|
||
measure are measured. Two findings came out of the new `execute` phase:
|
||
the extraction costs **~250 ms** of edit computation (delivery is 0.02 ms,
|
||
so it is all engine), and the *extract* offer at `aes_wrap.sv` 66:2 spends
|
||
**793–817 ms** to produce a refusal — a second ~800 ms user-command path
|
||
beside the tail rename, and one that returns nothing. A third observation
|
||
for P4a: the first useful answer during a **cold** scan arrives in 85 ms,
|
||
while during a **warm** scan it takes 210 ms. Rejected alternatives: wrapping
|
||
the server in `/usr/bin/time -l` for a kernel peak-RSS figure (the guard
|
||
already owns that slot, so a 50 ms `ps` poll is used and the row says so);
|
||
folding the CLI `--ignore unused-import` cell into `sweep.sh` (it would
|
||
change the committed sweep's cell set for all five trees, so the paired CLI
|
||
experiment stayed a scratch script as the owner's was); measuring the
|
||
first-useful-answer inside the same sessions as the settled scan (serving a
|
||
request perturbs the scan and would have broken comparability with take 4).
|
||
- **Decision: retain / revise / reject / defer; next stage justified by
|
||
evidence:** **retain.** P1 is justified and unblocked: it now has a
|
||
same-binary reference for every row it will move, measured by the instrument
|
||
it will be judged with, plus the family attribution (82.80 ms shared base
|
||
at the pinmux cursor, +52.7 to +57.6 ms per selector family) it must reduce.
|
||
- **QA result and lead review link:** pending — `docs/features/perf5-p0/README.md`.
|
||
|
||
## Experiment record — P1a-2026-09-07 (stage P1a)
|
||
|
||
- **Experiment ID / stage / date / owner:** `P1a-2026-09-07` / P1a (TODO §60.1)
|
||
/ 2026-09-07, America/Chicago / dev agent (Opus).
|
||
- **Hypothesis and exact expected work reduction:** the ~82.8 ms a pinmux
|
||
code-action paid before any refactoring family was considered is *optional*
|
||
work — a configuration read, a lint pass and a fence parse — done before the
|
||
request's own `context.only` was looked at. Checking the filter first should
|
||
take `only: []` to the transport floor and a refactor-only request to its
|
||
selector alone; and because the fence answer protects *fixes*, a pass whose
|
||
findings carry no fix should not compute it at all.
|
||
- **Reference commit, candidate commit or diff hash, binary hashes:** reference
|
||
is §P0's REF rows on `27e0a0df…` (tree `9c75b7a4…`). Candidate is the working
|
||
tree at `501b36d8b8871ef6af39d6418ffd9290eede411b` plus the §60.1 P1a diff;
|
||
release binary sha256
|
||
`0bf7cf211108a67eb5e695a2ff8b473b669cac22b6e8502e8ff22879d4482ecd`.
|
||
- **Files changed / API contracts amended / topology references:**
|
||
`lucisv_server/src/server/dispatch.rs` (the `CodeActionRequest` arm),
|
||
`code_action.rs` (`wants_fixes`, additive), `lint.rs` (`fixable`'s fence
|
||
gate); `vlog_parser/src/stats.rs` (new) + two increments in
|
||
`parser/mod.rs` + one `pub mod` line; tests in
|
||
`lucisv_server/src/server/tests/code_action.rs` (new) and its `mod` line;
|
||
`tools/perf/phases_p1.py` (new) + one import in `bench.py`. **No contract
|
||
amended.** `fence.rs` untouched, shared-fence-filter unchanged. The one new
|
||
interface is `vlog_parser::stats::parses()`; a `topo.md` edge is *requested*
|
||
in `docs/features/perf5-p1/README.md`, not applied — the dev does not edit
|
||
`topo.md`.
|
||
- **Workload, corpus/input hashes, open files, cursor/range, rules, client
|
||
capabilities:** OpenTitan `0098135264`, the same three pre-existing modified
|
||
files, `git status --porcelain` verified identical after **every** phase.
|
||
Cursors are `tools/perf/sites.py`'s. Client shape recorded in every row
|
||
(lazy: `resolveSupport` true, `applyEdit`/`createFiles` false), except
|
||
`codeaction`'s eager half.
|
||
- **Machine, compiler/profile, threads, load before/after, competing
|
||
activity:** M1 Max, macOS 27.0 `26A5425a`, release profile, default worker
|
||
count. Load 3.04–4.54 before each phase and 3.04–4.50 after. `cargo build
|
||
--release -p lucisv_server` ran **once**, to completion, before the first
|
||
timed phase; no cargo command ran during any timed phase.
|
||
- **Commands, cache reset/prime steps, trial ordering and fresh-session
|
||
count:** five guarded runs, `tools/guard.sh -m 8 -t 1800 -- python3
|
||
tools/perf/bench.py <phase> … --tries 3` for `offerkinds codeaction
|
||
offerqueue blockers offeredit`, in that order, one scratch `--storage` per
|
||
stage. `blockers` is the only fresh-process phase here (3 per leader).
|
||
- **Raw evidence path, explicit units, full sample arrays:**
|
||
`~/.cache/lucisv-perf/take5-p1/results-p1a.jsonl` (60 rows, schema 2),
|
||
`logs-p1a/`, `runs-p1a.txt` (per-phase load and corpus check). Latency is
|
||
`ms` and nothing else.
|
||
- **Reference first / repeat median / range; candidate first / repeat median /
|
||
range:** in the Before/after table above; arrays in the JSONL.
|
||
- **Work counts: reads, parses, analyzed/selected/watched/edited files and
|
||
bytes:** the counter (`vlog_parser::stats::parses()`) is asserted in tests,
|
||
not sampled on the corpus — a released server prints nothing. What the wire
|
||
shows: `only: []` 82.80 → 0.064 ms (the whole base was skippable), quickfix
|
||
84.13 → 23.53 (the fence parse gone), one selector family unchanged at
|
||
58.6–59.7 ms (still a whole-file parse each).
|
||
- **Result/status/count/fingerprint comparisons, warnings and refusal
|
||
checks:** 60 rows, all `status: ok`. **Every result count is identical to
|
||
the REF row's** — the pinmux cursor still offers 0 actions under all seven
|
||
filters, `aes` 1, `aes_reg_top` 2, `prim_flop_2sync` 2 eager. No refusal, no
|
||
warning, no created file; the corpus is unchanged.
|
||
- **Idle RSS / peak RSS / cache size / guard outcomes:** not re-measured (P1
|
||
changes no allocation path; `rss` is P4a's phase). **Zero guard kills** in
|
||
all five runs.
|
||
- **Target achieved or missed; paired improvement and variability:** P1a is a
|
||
step, not the stage's target. Achieved: `only: []` −99.9%, quickfix −72.0%,
|
||
all families −16.6%, queued definition −18.4%. The plan's three timing goals
|
||
are all still missed at this point, by design — the four selector parses are
|
||
P1b's subject.
|
||
- **Correctness tests and logs:** `cargo fmt --all -- --check` clean,
|
||
`cargo clippy --all-targets` clean, `cargo test --workspace` green (all
|
||
suites, `vlog_formatter` included), all under
|
||
`tools/guard.sh -m 8 -t 1800`. Eight new tests pin the empty filter, the
|
||
two gates, the no-fix case, prefix semantics, action order, a fix spanning
|
||
the cursor and the empty-range extraction.
|
||
- **Interpretation, remaining bottleneck, tradeoffs, rejected alternatives:**
|
||
the round's best result is the *attribution*, which no previous take could
|
||
make: at the pinmux cursor the 82.8 ms base was **23.5 ms of configuration
|
||
and lint plus 59.3 ms of fence parse**, and 23.5 + 4 × 58.7 = 258.3 against
|
||
the 258.1 measured — the whole remaining cost is accounted for with nothing
|
||
left over. Rejected: returning for an empty `only` *before* the document
|
||
lookup (it would turn `null` for an unknown buffer into `[]`, a wire change
|
||
for a hash-map lookup's worth of time); memoizing the fence answer here (it
|
||
would have contaminated P1a's number with P1b's).
|
||
- **Decision: retain / revise / reject / defer; next stage justified by
|
||
evidence:** **retain**, and P1b is justified: four whole-file parses of a
|
||
1.3 MB buffer, 58.6–59.7 ms each, are 91% of what is left.
|
||
- **QA result and lead review link:** pending —
|
||
`docs/features/perf5-p1/README.md`.
|
||
|
||
## Experiment record — P1b-2026-09-07 (stage P1b)
|
||
|
||
- **Experiment ID / stage / date / owner:** `P1b-2026-09-07` / P1b (TODO
|
||
§60.1) / 2026-09-07, America/Chicago / dev agent (Opus).
|
||
- **Hypothesis and exact expected work reduction:** each of the four cheap
|
||
gates parses the same bytes the open `Document` already parsed. Handing them
|
||
that parse should remove four whole-file parses per all-family request —
|
||
~235 ms of the pinmux cursor's remaining 258 — and leave the lint pass as
|
||
the residue. The fence answer, memoized per document revision, should remove
|
||
one more parse on buffers that *do* carry a fix (not this one).
|
||
- **Reference commit, candidate commit or diff hash, binary hashes:** the same
|
||
§P0 REF rows are the reference; P1a's rows are reported beside them as the
|
||
intermediate. Candidate is the working tree at `501b36d8…` plus the full
|
||
§60.1 diff; release binary sha256
|
||
`540b8b7ed42218c12fd662b552ddd3cd24026301912e7dc16c14d4d5c29d33e4`.
|
||
- **Files changed / API contracts amended / topology references:** engine —
|
||
`vlog_refactor/src/{ports/mod.rs,imports.rs,extract/mod.rs,inline/mod.rs,
|
||
lib.rs}`, four **additive** `*_in` selectors, the text forms retained as
|
||
wrappers. Server — `fences.rs` (new, 33 lines), one `OnceLock` field in
|
||
`state.rs` and its two initializers, one private `…_at(doc, …)` helper each
|
||
in `ports.rs` / `imports.rs` / `extract.rs` / `inline_module.rs`,
|
||
`lint.rs::fixable` asking `fences::of`, one `mod` line in `main.rs`. Tests —
|
||
`vlog_refactor/tests/parsed_selectors.rs` (new), more of
|
||
`server/tests/code_action.rs`. **`fence.rs` untouched and the
|
||
shared-fence-filter contract not amended**: the fence answer is still
|
||
`protected_regions(&doc.text)`, only memoized. Topology edges *requested* in
|
||
the feature README.
|
||
- **Workload, corpus/input hashes, open files, cursor/range, rules, client
|
||
capabilities:** identical to P1a's, same three modified corpus files, corpus
|
||
verified unchanged after every phase.
|
||
- **Machine, compiler/profile, threads, load before/after, competing
|
||
activity:** same host and profile. Load 3.70–5.01 before each phase,
|
||
3.70–4.50 after — higher than P1a's band by about 1.0, which matters only
|
||
for the sub-millisecond rows and is stated rather than corrected for. One
|
||
`cargo build --release -p lucisv_server` before the first timed phase; no
|
||
cargo during timing.
|
||
- **Commands, cache reset/prime steps, trial ordering and fresh-session
|
||
count:** the same five phases in the same order, `--tries 3`, a separate
|
||
scratch `--storage` (`caches/p1b`) so no cache is shared with P1a.
|
||
- **Raw evidence path, explicit units, full sample arrays:**
|
||
`~/.cache/lucisv-perf/take5-p1/results-p1b.jsonl` (60 rows, schema 2),
|
||
`logs-p1b/`, `runs-p1b.txt`.
|
||
- **Reference first / repeat median / range; candidate first / repeat median /
|
||
range:** in the Before/after table above; arrays in the JSONL.
|
||
- **Work counts: reads, parses, analyzed/selected/watched/edited files and
|
||
bytes:** asserted by count in `server::tests::code_action` —
|
||
a repeated all-family `codeAction` at a no-offer cursor: **0** parses; an
|
||
`only: []` request: **0**; extract+inline at an *offering* cursor: **0**;
|
||
the first request after a `didChange`: **≤2** (the document's own parse plus
|
||
the fence answer). The ports family at an offering cursor still parses
|
||
(`the_port_offer_still_reaches_the_engine_and_that_is_what_p1c_is_for`) —
|
||
that is the engine plan, and the test exists so it cannot grow unnoticed.
|
||
- **Result/status/count/fingerprint comparisons, warnings and refusal
|
||
checks:** 60 rows, all `status: ok`; **every result count identical to the
|
||
REF and to P1a** (pinmux 0 under all seven filters, `aes` 1, `aes_reg_top`
|
||
2, eager `prim_flop_2sync` 2). Offer *titles* recorded in the `codeaction`
|
||
rows are unchanged. No refusal, no warning, corpus unchanged.
|
||
- **Idle RSS / peak RSS / cache size / guard outcomes:** not re-measured (see
|
||
P1a). The one new allocation is one `Vec<Region>` per open buffer that ever
|
||
needed a fence answer. **Zero guard kills** in all five runs.
|
||
- **Target achieved or missed; paired improvement and variability:**
|
||
- Pinmux no-offer comment, unchanged buffer: goal <16 ms — **missed at
|
||
24.02 ms** (−92.2% on REF). Remaining stage, measured, not inferred: the
|
||
lint pass. `only: []` is 0.053 ms and quickfix-only is 24.05 ms, so
|
||
**100%** of what is left is the configuration read plus `lint_with` over
|
||
a 42 192-line buffer.
|
||
- Ordinary repeated lazy offer, goal <5 ms — **met on `tb.sv`** (3.65 ms
|
||
on the `codeaction` cursor, 0.60 ms on the `offerkinds` one), **missed on
|
||
`aes`** (7.76 ms).
|
||
- `aes_reg_top` offer, goal <10 ms — **missed at 21.83 ms** (−6.3%).
|
||
Remaining stage, measured: the ports family alone is **21.15 ms** of it
|
||
and every other family together is under 0.6 ms, so it is entirely the
|
||
`port_actions` plan the offer computes and discards — **P1c**.
|
||
- Queued definition: 309.40 → **24.61 ms** (−92.0%), goal <16 ms missed by
|
||
the leader's own lint residue.
|
||
- First-after-edit, tracked separately: pinmux 368.32 → **133.86 ms**
|
||
(−63.7% against P1a).
|
||
- **Correctness tests and logs:** `cargo fmt --all -- --check` clean,
|
||
`cargo clippy --all-targets` clean (one `needless_borrow` the change
|
||
introduced was fixed, no `#[allow]` added), `cargo test --workspace` green
|
||
— 51 suites, `vlog_formatter`'s snapshot/idempotency suite included — all
|
||
under `tools/guard.sh -m 8 -t 1800`, zero kills. New: 7 engine parity tests
|
||
that compare `X_in` against `X` at **every byte offset** of five fixtures
|
||
(clean, non-parsing, CRLF, non-BMP, non-ANSI, empty), and 12 server tests
|
||
covering the counters, the fence memo across `didChange` in both directions,
|
||
a waiver, a `lucisv.toml` written between requests, an index refresh, an
|
||
`untitled:` buffer, CRLF + astral positions, a non-parsing buffer, and a
|
||
large buffer answering its command from its text.
|
||
- **Interpretation, remaining bottleneck, tradeoffs, rejected alternatives:**
|
||
the offer path no longer parses anything it already has: on the generated
|
||
file a single refactoring family went from 58.6–59.7 ms to 0.06–0.14 ms, and
|
||
the all-family answer from 309.6 to 24.0 ms. Two named residues remain, and
|
||
neither is guesswork: **the lint pass** (24.0 ms, the whole of the pinmux
|
||
row) and **the discarded ports plan** (21.2 ms, the whole of the
|
||
`aes_reg_top` row — P1c).
|
||
**Lint-result reuse was considered and not done.** The condition the brief
|
||
set is met — lint is 100% of the pinmux row for a client that wants quick
|
||
fixes — but the memo is a differently-shaped change: its key must span the
|
||
document revision (free, it lives on the `Document`), the tab width, the
|
||
effective rule set, the merged rule options, the line width, the *contents*
|
||
of every external waiver file, and the workspace index generation — and that
|
||
last one is not reachable from `fixable`'s signature at all, since
|
||
`generation` lives on `Server` and not on `Workspace`. Wiring it means
|
||
threading a generation through the code-action path and hashing four
|
||
independent configuration surfaces, whose failure mode is a **stale fix
|
||
offer** — the class of bug this repository's fourth invariant is about. It
|
||
deserves its own item with its own attack tests (one per key component),
|
||
beside the P1c ruling, rather than a tail on this lane. The number to
|
||
decide with: **24.0 ms**, of which `only: []` proves 0.05 ms is transport;
|
||
and the *first* request after every keystroke pays it regardless of any
|
||
memo. It may also be cheaper to ask which rules cost 24 ms on a 1.3 MB
|
||
generated buffer than to cache their answer.
|
||
Other rejected alternatives: giving the fence answer a parsed-input API
|
||
(would amend the shared-fence-filter contract, which this lane may not do);
|
||
making the large-file path read `doc.tree` (its tree is the *empty* file's,
|
||
so offers would silently disappear — today's behaviour is preserved instead
|
||
and pinned by a test, with the question left to the lead).
|
||
- **Decision: retain / revise / reject / defer; next stage justified by
|
||
evidence:** **retain.** P1c is justified by 21.15 of 21.83 ms at the
|
||
`aes_reg_top` cursor; a lint-reuse item is justified by 24.0 of 24.0 ms at
|
||
the pinmux cursor. Both are lead rulings, not this lane's.
|
||
- **QA result and lead review link:** pending —
|
||
`docs/features/perf5-p1/README.md`.
|
||
|
||
## Experiment record — P1c-2026-09-07 (stage P1c)
|
||
|
||
- **Experiment ID / stage / date / owner:** `P1c-2026-09-07` / P1c (TODO §60.1,
|
||
plan §P1c) / 2026-09-07, America/Chicago / dev agent (Opus).
|
||
- **Hypothesis and exact expected work reduction:** the lazy code-action offer
|
||
computes four *verified* port refactoring plans and one verified
|
||
organize-imports edit and discards every edit. Replacing them with engine-owned
|
||
predicates that ask only the plan-time questions should remove four
|
||
`WorkspaceIndex::build`s from the ports offer (measured at 3.89 ms each over
|
||
the two files at the `aes_reg_top` cursor) and one `check::verify_splice` from
|
||
the imports offer, leaving one parse of the declaring file and one index over
|
||
the imported packages respectively. Expected: `aes_reg_top` below 10 ms, `aes`
|
||
below 5 ms, the organize-imports offer below 5 ms, **and every offered title,
|
||
count and shape identical**.
|
||
- **Reference commit, candidate commit or diff hash, binary hashes:** reference
|
||
is §P1b's own record (server `540b8b7e…`) for the `offerkinds`, `codeaction`
|
||
and `offerqueue` rows, and §P0's REF (server `27e0a0df…`) for the `refactor`
|
||
rows, which P1a/P1b did not run. Candidate: the P1c working tree over the
|
||
§P1b tree, built as server sha256
|
||
`33a6888af3f2bc9b3b2d1fb2844f3d93f9f5950839446866838244f913d56cf1`, CLI
|
||
`3f7bfd25cdbd16eeb5c16504c9b18181dddc1a26877447688f71b570234108cb`
|
||
(release, `--locked`), verified before and after the timed run.
|
||
- **Files changed / API contracts amended / topology references:**
|
||
`crates/vlog_refactor/src/ports/offer.rs` (**new**, 282 production lines),
|
||
`ports/{mod,remove,propagate,expand,ansi}.rs` (helpers made `pub(super)` and
|
||
given parsed-input twins; no behaviour change), `imports.rs` (`planned`
|
||
extracted from `organize`; `organize_offer`, `organize_offer_in`), `lib.rs`
|
||
(four new re-exports plus `PortOffer` / `PortOfferKind`);
|
||
`crates/lucisv_server/src/{ports.rs,imports.rs}` (`offered`, `counts_at`);
|
||
tests `crates/vlog_refactor/tests/{port_offers,import_offers}.rs` (**new**),
|
||
`crates/lucisv_server/src/server/tests/code_action.rs`, and one import line in
|
||
`server/tests/mod.rs`. **No `topo.md` edit** — two additive edges are
|
||
requested in `docs/features/perf5-p1/README.md`'s Handshakes. **`tools/perf`
|
||
untouched**: every cell comes from a phase that already existed. No verifier,
|
||
no `check/`, no `state.rs`, no `fence.rs`.
|
||
- **Workload, corpus/input hashes, open files, cursor/range, rules, client
|
||
capabilities:** OpenTitan `0098135264`, the same three pre-existing modified
|
||
files, `git status --porcelain` identical before and after all four phases.
|
||
Cursors are `tools/perf/sites.py`'s, resolved from file text at run time.
|
||
Lazy client (`resolveSupport`) in every offer row, warm workspace scope,
|
||
scratch `--storage` per label.
|
||
- **Machine, compiler/profile, threads, load before/after, competing activity:**
|
||
M1 Max, macOS 27.0 `26A5425a`, release+LTO, default worker count. Load
|
||
recorded before and after every phase: **3.81–4.90**. The release build was
|
||
finished and `ps` checked clear of `cargo`/`rustc` before the first phase; the
|
||
load was allowed to settle below 4.5 before timing began.
|
||
- **Commands, cache reset/prime steps, trial ordering and fresh-session count:**
|
||
four guarded `bench.py <phase>` runs — `offerkinds`, `codeaction`, `refactor`,
|
||
`offerqueue` — each `--tries 3` through `tools/guard.sh -m 8 -t 1800`, with
|
||
the corpus checked and the load recorded between each. No fresh-process rows
|
||
in this set; `offerqueue`'s three pipelines are in one session, as always.
|
||
- **Raw evidence path, explicit units, full sample arrays:**
|
||
`~/.cache/lucisv-perf/take5-p1c/` — `results-p1c.jsonl` (schema 2, 65 rows),
|
||
`runs-p1c.txt` (per-phase command, exit, load before/after, corpus check),
|
||
`logs-p1c/`. Latency is `ms` and nothing else.
|
||
- **Reference first / repeat median / range; candidate first / repeat median /
|
||
range:** in the Before/after table above, and in `results-p1c.jsonl`.
|
||
Headline pairs, repeat medians: `aes_reg_top` lazy **21.83 → 5.46**, its
|
||
ports family **21.15 → 3.27**, all families **21.79 → 4.70**; `aes` lazy
|
||
**7.76 → 1.74**; fan-out 42 / 67 / 128 lazy **6.79 → 0.77**, **6.90 → 1.78**,
|
||
**7.36 → 1.38**; the port-actions offer at `aes_wrap.sv` 78:2 **24.84 (REF) →
|
||
1.19**; the organize-imports offer at `aes_sbox_canright_masked.sv` 42:2
|
||
**15.39 (REF) → 4.88**.
|
||
- **Work counts: reads, parses, analyzed/selected/watched/edited files and
|
||
bytes:** counted in tests, not on the wire. A **repeated ports offer at an
|
||
offering cursor performs 1 parse** — the instantiated module's declaring file
|
||
— where §P1b's own test could only assert "> 0"; a **repeated
|
||
organize-imports offer performs 3**, one `Scope::build` over the buffer and
|
||
the two packages it imports; at a cursor the gate refuses, **0**. The source
|
||
set is unchanged: `offer_sources` and `imports::sources` were not touched, so
|
||
the offer still reads the buffer plus one or two declaration files.
|
||
- **Result/status/count/fingerprint comparisons, warnings and refusal checks:**
|
||
every row of `offerkinds`, `codeaction` and `offerqueue` compared
|
||
field-by-field with §P1b's record on `result_count`, `titles`, `shapes`,
|
||
`status`, `fingerprint`, `edits`, `files`, `created` — **50 rows, 0
|
||
differences**. Every comparable row compared with the §P0 REF — **65 rows, 0
|
||
differences**. The three edit-bearing resolves carry the REF's own
|
||
fingerprints byte for byte: connect-missing-ports `4b534a16bca7…`, expand
|
||
`.*` `8f3a26dd147b…`, organize-imports `0ee027e37d07…`.
|
||
- **Idle RSS / peak RSS / cache size / guard outcomes:** memory not
|
||
re-measured (P4a's phase); the only new retention is the predicate's own
|
||
short-lived parse of one declaring file, dropped when the request ends.
|
||
**Zero guard kills** across the four timed phases, the release build and all
|
||
three `cargo` gates.
|
||
- **Target achieved or missed; paired improvement and variability:** **all
|
||
three met.** `aes_reg_top` < 10 ms → **5.46**; `aes` < 5 ms → **1.74**; the
|
||
organize-imports offer < 5 ms → **4.88**. Variability: the three repeats of
|
||
each headline row sit within ±10% of their median except the
|
||
connect-missing-ports resolve, whose try 2 (209.85 ms) is an outlier against
|
||
165.15 / 169.13 — a row §P1c does not touch, whose fingerprint is unchanged.
|
||
- **Correctness tests and logs:** `crates/vlog_refactor/tests/port_offers.rs`
|
||
(10 tests) compares the offered menu with `port_actions`' menu — the titles
|
||
themselves, in order — at **every byte offset** of eight fixtures; a
|
||
fixture's every-offset run is what proves it rather than a chosen cursor.
|
||
`import_offers.rs` (9 tests) compares `organize_offer` with
|
||
`organize_counts` — the counts *and* the refusal sentence — at every byte
|
||
offset of seven. Both include CRLF, a buffer that does not parse, a
|
||
duplicate declaration, nested and package-nested modules, positional and
|
||
`bind` and `.*` shapes, an unknown package and an already-tidy run. **Zero
|
||
differences.** In the server: the two parse-count assertions above, and
|
||
`an_offer_the_fan_out_refuses_says_so_on_resolve_rather_than_crashing`, which
|
||
offers a removal the *fan-out* refuses and gets the engine's sentence
|
||
("lucisv: the action is no longer available.") from `codeAction/resolve`, not
|
||
a panic. Gates: `cargo fmt --all -- --check` clean, guarded
|
||
`cargo clippy --all-targets` clean, guarded `cargo test --workspace`
|
||
**4215 passed / 0 failed**.
|
||
- **Interpretation, remaining bottleneck, tradeoffs, rejected alternatives:**
|
||
the offer's cost was never the refactoring — at the `aes_reg_top` cursor all
|
||
four planners refuse at *plan* time — it was the four `Scope::build`s they
|
||
each did before refusing. Removing the index from the ports predicate leaves
|
||
**one parse of the declaring file**, which is 2.16–2.43 ms of the remaining
|
||
3.27 at that cursor and is the named residue: a memo per index generation
|
||
would remove it and was out of this lane's scope. The imports predicate keeps
|
||
its index because `import_usage` genuinely needs the packages' exports; its
|
||
residue is the buffer's own share of that index, ~0.8 ms, which needs
|
||
`vlog_semantic` to expose a `FileFacts` built from an existing analysis (a
|
||
handshake request, filed). **Rejected alternatives:** (a) sharing one
|
||
`Scope` across the four planners — simpler, but 3.89 ms floor at
|
||
`aes_reg_top`, which misses the `aes` target; (b) resolving declarations
|
||
through the *server's* workspace index — faster still, but it loses the
|
||
offer on a module declared only in an unsaved buffer, which today's offer
|
||
makes; (c) skipping the propagation's append loop and counting missing ports
|
||
instead — one less loop, but the title counts *edits* and a connection
|
||
written after a `//` comment costs two, so the promised count would have
|
||
become wrong.
|
||
- **The one widening, stated plainly:** the predicates do not run
|
||
`check::verify_splice` or `ports::confirm`, both of which run after the plan.
|
||
An offer they would have refused is now made and declined on the click. That
|
||
is the lazy offer's existing contract (`lazy-code-action` README: "the offer
|
||
may be optimistic; the resolve is exact"), it is confined to a menu, and the
|
||
every-offset parity suites find **no cursor on their fixtures** where it
|
||
changes the answer. `resolve` and `execute` still verify everything they
|
||
always did; **CLAUDE.md invariant 4 is not engaged — the verifier was not
|
||
widened, and no verification was removed from any path that produces an
|
||
edit.**
|
||
- **Decision: retain.** The two open items behind it are the lead's, not this
|
||
lane's: the lint-result memo (24 ms, the whole of the pinmux row, already
|
||
deferred to loop 3) and the declaring-file parse memo named above.
|
||
- **QA result and lead review link:** QA pending;
|
||
`docs/features/perf5-p1/README.md` QA log, heading
|
||
"2026-09-07 — QA, P1c".
|
||
|
||
## Experiment record — P2a-2026-09-07 (stage P2a)
|
||
|
||
- **Experiment ID / stage / date / owner:** `P2a-2026-09-07` / P2a (TODO §60.2)
|
||
/ 2026-09-07, America/Chicago / dev agent (Opus).
|
||
- **Hypothesis and exact expected work reduction:** none — §P2a changes no
|
||
decision. The hypothesis is about the *instrument*: that a per-stage wall
|
||
time and a per-stage `vlog_parser::stats::parses()` delta, plus the rung each
|
||
selected file came in on, are enough to say where the tail rename's 780 ms
|
||
goes, and that adding them moves no measured row.
|
||
- **Reference commit, candidate commit or diff hash, binary hashes:** trunk
|
||
`dafa4f0` plus the §60.2 working tree; release server
|
||
`bf584aa0daf6909ca4a5fab57d9b2c1ff9619132a9df4d686f58bce292003dde`, CLI
|
||
`3f7bfd25cdbd16eeb5c16504c9b18181dddc1a26877447688f71b570234108cb`.
|
||
- **Files changed / API contracts amended / topology references:**
|
||
`vlog_refactor/src/{trace.rs (new), rename/mod.rs, rename/tests.rs,
|
||
check/mod.rs, lib.rs}`; `lucisv_server/src/{rename_trace.rs (new), rename.rs,
|
||
state.rs, perf.rs, main.rs, server/dispatch.rs}`;
|
||
`tools/perf/{phases_p2.py (new), bench.py, sites.py}`;
|
||
`docs/features/perf5-p2/README.md` (new). Additive contracts:
|
||
`vlog_refactor::rename_traced` + `RenameTrace`/`VerifyTrace`/`Stage`;
|
||
`Workspace::rename_sources_traced`. **No `topo.md` edge edited** — the four
|
||
requests are in the feature README's Handshakes. `check::verify` gained a
|
||
trace parameter and **no check changed**.
|
||
- **Workload, corpus/input hashes, open files, cursor/range, rules, client
|
||
capabilities:** OpenTitan `0098135264`, the same three pre-existing modified
|
||
files, unchanged after every phase. Eight renames, positions resolved from
|
||
file text by `tools/perf/sites.py`: `state_q` at `entropy_src_main_sm.sv`
|
||
41:19 with `entropy_src_core.sv` open; `aes` at `tb.sv` 44:2;
|
||
`cipher_alert` at its declaration in `aes_core.sv`; `clk_i` at its
|
||
declaration in `entropy_src_main_sm.sv`; `state_q → state_d` (conflict);
|
||
`cipher_alert → clk_i` (a new name many external uses spell);
|
||
`rstmgr_por` at its instantiation in `rstmgr.sv` (declared in four files);
|
||
and a cursor on a `tb.sv` comment (no symbol). Lazy client
|
||
(`resolveSupport`), warm workspace scope, scratch index caches, servers run
|
||
with `--verbose`.
|
||
- **Machine, compiler/profile, threads, load before/after, competing
|
||
activity:** M1 Max, macOS 27.0 `26A5425a`, release + LTO, default worker
|
||
count. Load 3.90 → 3.92 recorded before and after every phase. No build
|
||
during any timed phase.
|
||
- **Commands, cache reset/prime steps, trial ordering and fresh-session
|
||
count:** six guarded `bench.py` phases (`renametrace tailrename rename
|
||
blockers refactor execute`, `--tries 3`, so four requests per row), each
|
||
through `tools/guard.sh -m 8 -t 1800`. Every `renametrace` row is its own
|
||
fresh session with its own scratch `--storage`; `blockers` is three fresh
|
||
leaders. Corpus checked after every phase.
|
||
- **Raw evidence path, explicit units, full sample arrays:**
|
||
`~/.cache/lucisv-perf/take5-p2/results-p2a.jsonl` (schema 2) and
|
||
`runs-p2a.jsonl` (per-phase command, exit, load before/after, corpus check).
|
||
Latency is `ms`, memory `peak_rss_kib`; every trace field is a row field
|
||
under `trace_` and is repeated verbatim in `note`.
|
||
- **Reference first / repeat median / range; candidate first / repeat median /
|
||
range:** tail rename REF 813.44 / **780.45** / 778.77–782.13 against P2a
|
||
817.45 / **784.19** / 782.21–789.49; `aes` rename REF 167.60 / **141.30** /
|
||
140.46–142.13 against 168.44 / **140.15** / 140.15–141.31. Every other
|
||
re-taken row is in the Before/after table.
|
||
- **Work counts: reads, parses, analyzed/selected/watched/edited files and
|
||
bytes:** the point of the stage. Tail rename **238 selected / 4 554 326 bytes
|
||
/ 106 watched / 1 919 528 bytes / 2 edited / 717 whole-file parses**
|
||
(238 index + 1 locate + 134 occurrence walk + 238 rebuild + 106 after);
|
||
`aes` 13 / 400 051 / 12 / 398 160 / 9 / 51; unique internal 4 / 68 475 / 1 /
|
||
1 / 10; `clk_i` **3 976 / 35 813 310 / 1 200 / 19 257 967 / 2 / 10 399**;
|
||
conflict 242 / 4 570 234 / 111 / 2 / 638; `cipher_alert → clk_i` 3 976 /
|
||
1 200 / 1 / 9 229; `rstmgr_por` 3 976 / 0 / 0 / 3 976; no symbol 3 976 / 0 /
|
||
0 / 3 976. Rungs for the tail: request 1, declaration 95, reference 122,
|
||
instantiation 19, macro 0, speller 0, open 1.
|
||
- **Result/status/count/fingerprint comparisons, warnings and refusal checks:**
|
||
thirteen edit-bearing rows fingerprinted; the six that have a §P0 REF are
|
||
**byte-identical** to it. Three rows are `refused` with the engine's own
|
||
sentences; one is `capture` (the extraction's declined `applyEdit`).
|
||
- **Idle RSS / peak RSS / cache size / guard outcomes:** peak RSS per rename
|
||
590 / 582 / 570 / **1 864** / 647 / 1 809 / 922 / 914 MiB. **Zero guard
|
||
kills.** Store not re-measured (unchanged codec).
|
||
- **Target achieved or missed; paired improvement and variability:** §P2a's
|
||
target is that the instrument answers the question and costs nothing. Both
|
||
hold: the breakdown above is the answer, and the six re-taken REF rows agree
|
||
within +0.5 % / −3.0 %.
|
||
- **Correctness tests and logs:** guarded `cargo test --workspace` **4 215
|
||
passed / 0 failed** (identical to §P1c's count — §P2a's own tests were added
|
||
with §P2b), `cargo clippy --all-targets` clean, `cargo fmt --all -- --check`
|
||
clean, `python3 -m py_compile tools/perf/*.py` clean.
|
||
`git -C ~/repo/opentitan status --porcelain` the same three files after every
|
||
phase.
|
||
- **Interpretation, remaining bottleneck, tradeoffs, rejected alternatives:**
|
||
**73 % of the tail rename is whole-file parsing, and two thirds of that
|
||
parsing is repeated work.** `Scope::build` and `rebuilt_index` are the same
|
||
`WorkspaceIndex::build` over the same 238 texts, of which two differ; the
|
||
occurrence walk re-parses 134 files the build already parsed; the after-pass
|
||
re-parses 106 files the before-pass already analysed. `warnings` (83.6 ms)
|
||
runs **zero** parses and is a token scan, so §P2b/§P2c cannot reach it. The
|
||
selection is 13.4 ms and is not the story — but the *size* of what it selects
|
||
(238 files for a two-file edit) is what will be left when the duplication is
|
||
gone. Rejected: returning the trace inside the `Ok` value, which would lose
|
||
it on exactly the refusal rows the plan asks for.
|
||
- **Decision:** retain. §P2b/§P2c justified by the two 228 ms stages being one
|
||
another.
|
||
- **QA result and lead review link:** pending.
|
||
|
||
## Experiment record — P2b-2026-09-07 (stage P2b)
|
||
|
||
- **Experiment ID / stage / date / owner:** `P2b-2026-09-07` / P2b / 2026-09-07
|
||
/ dev agent (Opus).
|
||
- **Hypothesis and exact expected work reduction:** building the index already
|
||
parses and analyses every in-scope file; keeping those analyses instead of
|
||
dropping them should remove **every parse after the index build except the
|
||
after-side's** — the tail rename's 134 occurrence-walk parses and its 1
|
||
`locate` parse, ~135 of 717 — with identical answers, because what is kept is
|
||
the analysis the on-demand path would have recomputed.
|
||
- **Reference commit, candidate commit or diff hash, binary hashes:** the §P2a
|
||
working tree plus the §P2b diff; release server
|
||
`e555e6c79d8d63ffd65e25e48e13e4633d0a2361306f358043e88903607269c5`.
|
||
- **Files changed / API contracts amended / topology references:**
|
||
`vlog_semantic/src/workspace/record.rs` (**additive `FileFacts::analyzed`**;
|
||
`facts_of` becomes its `.0`; no codec change, `FACTS_FORMAT` untouched);
|
||
`vlog_refactor/src/{scope.rs, rename/mod.rs}`;
|
||
`vlog_semantic/tests/workspace.rs`. `Scope::build`'s behaviour, cost and
|
||
memory are unchanged for every caller but the rename.
|
||
- **Workload, corpus/input hashes, open files, cursor/range, rules, client
|
||
capabilities:** identical to §P2a's, same phases, same sites.
|
||
- **Machine, compiler/profile, threads, load before/after, competing
|
||
activity:** same host and profile; load 5.04 → 3.26 across the six phases,
|
||
recorded per phase. No build during a timed phase.
|
||
- **Commands, cache reset/prime steps, trial ordering and fresh-session
|
||
count:** identical to §P2a's, `--tries 3`.
|
||
- **Raw evidence path, explicit units, full sample arrays:**
|
||
`~/.cache/lucisv-perf/take5-p2/results-p2b.jsonl`, `runs-p2b.jsonl`.
|
||
- **Reference first / repeat median / range; candidate first / repeat median /
|
||
range:** tail rename REF **780.45** against **674.68** (706.50 first,
|
||
673.57–676.19); `aes` REF **141.30** against **123.08** (142.71 first,
|
||
122.59–123.11).
|
||
- **Work counts:** tail rename **717 → 582 parses** (index 238, locate **0**,
|
||
occurrence walk **0**, rebuild 238, after 106); `aes` 51 → 38; `clk_i`
|
||
10 399 → 9 150; conflict 638 → 498. Selected/watched/edited counts and bytes
|
||
unchanged on every row — **nothing was narrowed**.
|
||
- **Result/status/count/fingerprint comparisons, warnings and refusal checks:**
|
||
all thirteen fingerprints identical to §P2a's and to the §P0 REF's; the three
|
||
refusals carry the same sentences.
|
||
- **Idle RSS / peak RSS / cache size / guard outcomes:** peak RSS 610 / 577 /
|
||
579 / **1 840** / 639 / 1 695 / 901 / 905 MiB — the two heaviest rows
|
||
*lower* than §P2a's, none higher by more than 20 MiB. **Zero guard kills.**
|
||
- **Target achieved or missed; paired improvement and variability:** the
|
||
hypothesis's exact reduction was met (135 parses, the predicted set) and is
|
||
worth **−13.6 %** on the tail rename and **−12.9 %** on `aes` against the
|
||
REF. §P2's own targets are judged at §P2c.
|
||
- **Correctness tests and logs:** guarded `cargo test --workspace` **4 225
|
||
passed / 0 failed** (+10: two `rename_trace` unit tests, two trace tests, four
|
||
`scope::tests`, two `vlog_semantic` equality tests); clippy and fmt clean.
|
||
The load-bearing ones are
|
||
`analyzed_gives_the_record_of_gives_and_the_analysis_a_caller_would_compute`,
|
||
`an_index_from_analyzed_facts_is_the_index_a_build_gives` and
|
||
`a_retained_analysis_is_the_one_the_on_demand_path_would_compute`.
|
||
- **Interpretation, remaining bottleneck, tradeoffs, rejected alternatives:**
|
||
after §P2b the tail rename's remaining duplication is entirely on the *after*
|
||
side: `rebuilt_index` (238 parses, 228 ms) and the after-prints (106 parses,
|
||
72 ms). **Rejected: retaining every file's analysis unconditionally** — §P2a
|
||
measured ~0.8 MiB of `Semantics` per file, so the 3 976-file fallback would
|
||
have peaked near 3.9 GiB against 1 864 MiB. **Rejected: rebuilding the record
|
||
with `FileFacts::from_analysis`** — it needs the token slice the parser
|
||
consumes, so every file's tokens would have to be cloned to feed it.
|
||
- **Decision:** retain; §P2c is the rest of the same finding.
|
||
- **QA result and lead review link:** pending.
|
||
|
||
## Experiment record — P2c-2026-09-07 (stage P2c)
|
||
|
||
- **Experiment ID / stage / date / owner:** `P2c-2026-09-07` / P2c / 2026-09-07
|
||
/ dev agent (Opus).
|
||
- **Hypothesis and exact expected work reduction:** the after-index is the
|
||
before-index with a handful of records replaced, and an unedited watched
|
||
file's after-print is its existing analysis re-resolved. Expected reduction:
|
||
the tail rename's 238 rebuild parses and 106 after parses, leaving
|
||
**`K + E` = 240**, with every check comparing exactly what it compared
|
||
before.
|
||
- **Reference commit, candidate commit or diff hash, binary hashes:** the §P2b
|
||
working tree plus the §P2c diff; release server
|
||
`1601b13a9bacda47095cb23580e475ac8f33a171f446875484439ec67d58eb31`
|
||
(re-verified byte-identical after the rejected `update_facts` probe was
|
||
reverted).
|
||
- **Files changed / API contracts amended / topology references:**
|
||
`vlog_refactor/src/check/after.rs` (**new**, 39 production lines),
|
||
`check/mod.rs` (427 → **405** production lines), `scope.rs`
|
||
(`Scope::against`, `Scope::sources` deleted), `rename/tests.rs`. No public
|
||
API changed; `WorkspaceIndex::absorb`'s existing contract
|
||
(`docs/topo.md` §3, "absorb must equal one build over the resulting record
|
||
set") is the one this stage stands on and now pins from a second crate.
|
||
- **Workload, corpus/input hashes, open files, cursor/range, rules, client
|
||
capabilities:** identical to §P2a's and §P2b's.
|
||
- **Machine, compiler/profile, threads, load before/after, competing
|
||
activity:** same host and profile; load 5.15 → 3.26 across the six phases.
|
||
No build during a timed phase.
|
||
- **Commands, cache reset/prime steps, trial ordering and fresh-session
|
||
count:** identical, `--tries 3`. One extra guarded `renametrace` run for the
|
||
rejected `update_facts` variant, on its own label and its own binary, before
|
||
the reverted binary was rebuilt and re-hashed.
|
||
- **Raw evidence path, explicit units, full sample arrays:**
|
||
`~/.cache/lucisv-perf/take5-p2/results-p2c.jsonl`, `runs-p2c.jsonl`, and
|
||
`results-probe-updatefacts.jsonl` for the rejected variant.
|
||
- **Reference first / repeat median / range; candidate first / repeat median /
|
||
range:** tail rename REF 813.44 / **780.45** / 778.77–782.13 against
|
||
451.54 / **419.86** / 418.61–421.27; `aes` REF 167.60 / **141.30** /
|
||
140.46–142.13 against 126.13 / **106.31** / 105.95–107.15.
|
||
- **Work counts:** tail rename **717 → 240 = K + E** (238 index + 2 for the
|
||
edited files' one new analysis each; locate, occurrence walk, before-prints
|
||
and after-prints all **0**); `aes` 51 → **22 = 13 + 9**; `clk_i`
|
||
10 399 → **3 977**; conflict 638 → **244**. Selected, watched and edited
|
||
counts and bytes are unchanged from §P2a on every row.
|
||
- **Result/status/count/fingerprint comparisons, warnings and refusal checks:**
|
||
all thirteen fingerprints byte-identical to §P2a's, §P2b's and the §P0 REF's;
|
||
the three refusals carry the same sentences and the same empty-edit
|
||
fingerprint `96f32d4243b1…`.
|
||
- **Idle RSS / peak RSS / cache size / guard outcomes:** peak RSS 593 / 585 /
|
||
579 / **1 830** / 641 / **1 590** / 927 / 918 MiB — the two heaviest rows
|
||
34 and 219 MiB *below* §P2a's. **Zero guard kills** across all nineteen
|
||
timed phases of the lane.
|
||
- **Target achieved or missed; paired improvement and variability:**
|
||
- tail rename ≥ 2× faster: **MISSED**, at **1.86×** (−46.2 %, 419.86 against
|
||
780.45; 2× needed 390.2). Repeat spread 418.61–421.27, so the miss is not
|
||
noise. **The measured remaining stage is `Scope::build`** — one parse of
|
||
each of the **238 selected** files, **225.1 ms of the 419.9 (54 %)** — with
|
||
`warnings`' token scan second at 83.3 ms (20 %) and the whole verification
|
||
third at 73.0 ms (17 %). There is **no duplicated parsing left**; the next
|
||
lever is the size of the selected set, which is §P2d.
|
||
- stretch < 200 ms: not approached, for the same reason.
|
||
- `aes` rename not slower: **met, and 24.8 % faster.**
|
||
- edit/warning fingerprints identical: **met, on every row of every stage.**
|
||
- the queued definition follows: **met**, 161.33 → **121.85** (−24.5 %).
|
||
- collateral: the extract command **−39.3 %**, connect-missing-ports
|
||
**−20.3 %**, expand-wildcard **−23.6 %**, organize-imports resolve −10 %.
|
||
- **Correctness tests and logs:** guarded `cargo test --workspace` **4 231
|
||
passed / 0 failed** (+6 on §P2b: two after-index equality tests, the file-id
|
||
test, the `K + E` parse-budget test, and the two rename-level attack pairs;
|
||
the third attack pair is the file-id-shift print test).
|
||
`cargo clippy --all-targets` clean, no new `#[allow]`;
|
||
`cargo fmt --all -- --check` clean. Corpus unchanged after every phase.
|
||
- **Interpretation, remaining bottleneck, tradeoffs, rejected alternatives:**
|
||
the request-local scope now does exactly `K + E` whole-file parses, which is
|
||
the floor for a design that reads the selected files itself. **Rejected:
|
||
`WorkspaceIndex::update_facts` per edited record instead of one `absorb`** —
|
||
the restricted merge is *slower* than the whole one on every row measured
|
||
(tail rebuild stage 37.2 ms with `absorb` against 53.3; `aes` 23.4 against
|
||
40.2; `clk_i` 269.7 against 400.9), because it walks the same records and
|
||
pays a name-set lookup at every declaration. The parse saving is the same
|
||
either way. The two remaining stages are outside §P2b/§P2c's mandate: the
|
||
input's *size* (§P2d, gated on handshake 33) and `warnings`' token scan.
|
||
- **Decision:** retain. §P2d is now justified by a reprofile that says the
|
||
selected set is the only thing left — and is a separate lane.
|
||
- **QA result and lead review link:** pending.
|
||
|
||
## Experiment record — copy for every stage or rejected attempt
|
||
|
||
- Experiment ID / stage / date / owner:
|
||
- Hypothesis and exact expected work reduction:
|
||
- Reference commit, candidate commit or diff hash, binary hashes:
|
||
- Files changed / API contracts amended / topology references:
|
||
- Workload, corpus/input hashes, open files, cursor/range, rules, client capabilities:
|
||
- Machine, compiler/profile, threads, load before/after, competing activity:
|
||
- Commands, cache reset/prime steps, trial ordering and fresh-session count:
|
||
- Raw evidence path, explicit units, full sample arrays:
|
||
- Reference first / repeat median / range; candidate first / repeat median / range:
|
||
- Work counts: reads, parses, analyzed/selected/watched/edited files and bytes:
|
||
- Result/status/count/fingerprint comparisons, warnings and refusal checks:
|
||
- Idle RSS / peak RSS / cache size / guard outcomes:
|
||
- Target achieved or missed; paired improvement and variability:
|
||
- Correctness tests and logs:
|
||
- Interpretation, remaining bottleneck, tradeoffs, rejected alternatives:
|
||
- Decision: retain / revise / reject / defer; next stage justified by evidence:
|
||
- QA result and lead review link:
|