Perf take 5 P1c (§60.1): offer predicates instead of throwaway edits — port_offers/organize_offer answer the lightbulb from the plan-time checks with the same titles and counts, the click still recomputes and verifies; aes_reg_top offer 21.8 → 5.5 ms, aes 7.8 → 1.7, organize-imports 15.4 → 4.9; the organize-imports offer contract documented as optimistic like every other lazy offer (lead ruling on QA's finding)
ci / checks (push) Successful in 1m6s
ci / corpus (push) Successful in 41s

This commit is contained in:
lucio committed 2026-09-07 17:35:24 -05:00
1 parent 6c1f863417
commit dafa4f0500
18 files changed
+2216 -131

No files matched your search

+171 -17
View File
@@ -1,6 +1,6 @@
# Performance implementation tracker — take 5
**Status: baseline measured; P0 done; P1a and P1b implemented and measured (2026-09-07, 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).
**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.
@@ -34,7 +34,7 @@ The order follows the plan. Later stages are conditional on the preceding measur
| 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 | — | **Ruled go (lead, 2026-09-07); next lane** | After P1b the `aes_reg_top` offer is 21.83 ms of which the ports family alone is **21.15**; `aes` 7.76. The four gates now cost ~0.06–0.14 ms each. Every remaining millisecond at an *offering* cursor is the engine plan the offer discards |
| 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 | — | Not started | — |
| P2b | Reuse per-file input analysis in request-local scope | P2a | — | Not started | — |
| P2c | Reuse unchanged after-facts/semantics; re-resolve external references | P2b | — | Not started | — |
@@ -63,22 +63,34 @@ 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 | REF vs baseline +4.1%. **P1a −16.6%, P1b −92.2%** on repeat medians | REF agrees. P1b is a 12.9× reduction with an identical (empty) answer. **Target <16 ms missed**: the remaining 24.0 ms is the lint pass — quickfix-only is 24.05 and `only: []` is 0.053 |
| 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**) | REF vs baseline +2.0%. **P1a −18.4%, P1b −92.0%** | The queued definition falls with its blocker, as the plan predicted. **Target <16 ms missed** by the same 24 ms of lint the leader pays |
| `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** | REF vs baseline **+27.9%** (outside tolerance, see the P0 entry). **P1a −9.9%, P1b −18.3%** | Target <5 ms **met**. The same file's `offerkinds` cursor, the cleaner row, went 1.54 → **0.60 ms** (−61.4%) |
| `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 | REF vs baseline −8.0%. **P1a −3.1%, P1b −5.0%** | **Target <5 ms missed.** The gate is now ~0.1 ms; what is left is the ports offer computing a plan whose edits it discards — **P1c** |
| `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 | REF vs baseline +1.0%. **P1a +1.3% (no change), P1b −6.3%** | **Target <10 ms missed.** Measured residue: the ports family alone is **21.15 ms** of the 21.83, and the other five families together under 0.6 ms — the whole row is the discarded ports plan, **P1c** |
| `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 | REF vs baseline +3.3%. **P1a −2.8%, P1b −5.8%** | Barely moved, as expected: §P1b removed this family's *gate* parse, not the engine plan behind it. This is the row **P1c** exists for |
| 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…` | −1.4% | Agrees; reference for P2, now with an edit fingerprint to compare against |
| 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…` | +1.2% | Agrees; reference for P2 |
| 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`) | inside the baseline range | Agrees |
| 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 | +0.4% | Agrees |
| 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 | +2.2% | Agrees |
| 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 | REF vs baseline +0.1%. **P1b −0.5%** | Unchanged, which is the guardrail: the eager path's cost is the module's fan-out and P1 did not touch it |
| 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** | REF vs baseline +0.4%; **P1c +1.6% on REF** | Agrees. The click path is untouched by §P1c and its 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** | REF vs baseline +2.2%; **P1c −2.3% on REF** | Agrees; no connection and no refusal moved |
| 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…` | new row | The gap the tracker's work-count table named is closed |
| 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 |
@@ -106,9 +118,9 @@ medians. Raw rows: `~/.cache/lucisv-perf/take5-p1/results-p1{a,b}.jsonl`.
| 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 |
| 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 |
| 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…` | — |
| Tail rename watched vs edited paths | Edited 2; watched unmeasured | Edited 2, confirmed by `files`; watched still unmeasured — P2a | — |
| Tail rename index / parse / analysis / resolution / verification stage times | Not measured | Not measured — P2a | — |
@@ -129,19 +141,19 @@ 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 |
| 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) |
| Topology handshake 33 | Transitive `wrap.u_S.x` refusal coverage before sharing/narrowing module sources | 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 | 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 |
| Refactor verification | Token identity, semantic identity, parse-diagnostic preservation, comments/attributes, span remapping | 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 | 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 | **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 | 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 | 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 |
| Documentation | Feature README, handshake updates in topo, accepted numbers in perf README; reserved lead Review untouched by dev | **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 |
| Lint/tests | Guarded affected tests then clippy/workspace tests at integration, no benchmark overlap | 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 | **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)
@@ -494,6 +506,148 @@ this stage; each says so rather than being left ambiguous.
- **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 — copy for every stage or rejected attempt
- Experiment ID / stage / date / owner: