Files
lucisv/docs/perf/take5-tracking.md
T

141 lines
13 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Performance implementation tracker — take 5
**Status: baseline measured; implementation has not started.** 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 | — |
| Source modifications | None to implementation; analysis/evidence docs only | — |
| Server SHA-256 | `27e0a0df5b77102ec79c23279da64e722bffd440c604ad6d03ff66c2f6398ad3` | — |
| CLI SHA-256 | `894054128495b764bb966e7b923e08267e57aea83fdc611fad4b4ed7a66b51e3` | — |
| Build | release, locked dependencies, workspace LTO enabled | — |
| Corpus | OpenTitan `00981352642fb65ef2b6c47143a0f6bb31fd4a97` | — |
| Modified corpus inputs | Three existing files, listed/hashed in `metadata.json` | — |
| Host / OS | M1 Max; macOS 27.0 `26A5425a` | — |
| Date / zone | 2026-09-07, America/Chicago | — |
| Load, standard phases | 1-minute samples 2.92–4.59 | — |
| Guard | 8 GiB / 1800 s; zero kills in retained runs | — |
| Harness | `tools/perf` at baseline HEAD, supplementary probes in evidence README | — |
| Warmth / scope / capabilities | Warm workspace, lazy client unless metric says otherwise | — |
| Raw evidence | `take5-baseline/*.jsonl`, `metadata.json` | — |
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 | — | — | Not started | — |
| P1a | Gate lint/fence/config by requested kinds; avoid fence work without fixes | P0 | — | Not started | — |
| P1b | Shared parsed selectors; revision-bound fence reuse; invalidate any additional cache correctly | P1a | — | Not started | — |
| P1c | Engine-owned lightweight ports/import offers | Reprofile P1b | — | Not started | — |
| 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 | — |
| P2d | Exact-name postings; source-set narrowing only with whole-scope proof | Reprofile P2c; topology 33 for shared module selector | — | Not started | — |
| 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.
| 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 | — | — | — |
| Pinmux comment, `only: []` | 78.88 / 79.43–81.62 ms; 0 actions | Return near transport floor; no lint/parse | — | — | — |
| Pinmux comment, quickfix only | 79.54 / 79.73–80.06 ms; 0 actions | Avoid repeated lint/fence work safely | — | — | — |
| Pinmux comment → queued definition (`offer-queue`) | 300.66–304.11 ms follower, 3 pipelines | Repeated follower <16 ms if no other blocker | — | — | — |
| `tb.sv` comment, lazy (`codeaction`) | 6.15 / 3.22–3.50 ms; 0 actions | Repeated <5 ms; no added parse | — | — | — |
| `aes` lazy offer (`codeaction`) | 12.39 / 8.15–9.11 ms; 1 action | Repeated <5 ms | — | — | — |
| `aes_reg_top` lazy offer (`codeaction`) | 32.81 / 22.45–25.09 ms; 2 actions | Repeated <10 ms | — | — | — |
| `aes_reg_top` ports-only offer (`offer-breakdown`) | 21.72 / 21.55–21.78 ms; 0 port actions | Remove throwaway edit computation | — | — | — |
| `state_q` tail rename (`tailrename`) | 821.59 / 789.50–809.83 ms; 2 files | At least 2× faster; stretch <200 ms | — | — | — |
| Ordinary `aes` rename (`rename`) | 168.67 / 139.34–140.35 ms; 9 files | No regression; exact edit/warning parity | — | — | — |
| Definition behind ordinary rename (`blockers`) | 145.99–168.79 ms, 3 pipelines | Falls with rename work | — | — | — |
| Connect missing ports resolve (`refactor`) | 170.77 / 164.79–165.82 ms; 1 file | Measure collateral benefit; exact edit parity | — | — | — |
| Expand wildcard resolve (`refactor`) | 73.02 / 70.35–70.73 ms; 1 file, 32 connections | No lost connections/refusals | — | — | — |
| Eager 128-fan-out offer (`codeaction`) | 518.32 / 495.60–499.69 ms | Compatibility/perf guardrail; not first priority | — | — | — |
| Cold workspace scan (`scan`, 3 fresh sessions) | 2830.30–2853.06 ms; mean 2843.00 | Investigation goal <2300 ms | — | — | — |
| Warm workspace scan (`scan`, 3 fresh sessions) | 1322.24–1344.03 ms; mean 1332.41 | Investigation goal <1000 ms | — | — | — |
| Cold idle RSS (`rss`, 3 fresh sessions) | 528.0–530.9 MiB | Investigate ≥15% reduction; counts unchanged | — | — | — |
| Warm idle RSS (`rss`, 3 fresh sessions) | 566.4–573.8 MiB | Investigate ≥15% reduction; measure peak too | — | — | — |
| Index store allocated size (`rss`, `du -sk`) | 44.34 MiB | Record codec/version and contents | — | — | — |
| Pinmux open → definition (`didopen`, 3 fresh sessions) | 128.13–129.96 ms | Preserve §46 benefit | — | — | — |
| `tb.sv` dirty-buffer folding barrier (`flush`) | 1.05 / 0.65–0.72 ms | No material regression | — | — | — |
| Diagnostics publication (`diagnostics`) | 158.02 / 155.95–157.62 ms | Preserve debounce/burst coalescing | — | — | — |
| Unblocked definition (`nav`) | 0.365 / 0.048–0.084 ms; 1 location | Transport-sensitive regression control | — | — | — |
| Transport floor (`baseline`) | 0.240 / 0.066–0.070 ms | Record contemporaneous noise | — | — | — |
| CLI default, hw/ip | 0.59 / 0.40–0.40 s; 445 findings | First trial outlier; compare paired repeats | — | — | — |
| CLI all-style, hw/ip | 0.58 / 0.56–0.58 s; mean 0.573 s; 7751 findings | Retain all findings | — | — | — |
| 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 | — | — | — |
| CLI all-style peak RSS | 208.4 MiB max of 3 | No material memory increase | — | — | — |
| Format check independently cold, hw/ip | 0.67 / 0.59–0.68 s | 0 cache hits; unchanged outcomes | — | — | — |
| Format check warm, hw/ip | 0.69 / 0.61–0.63 s | 30 hits; unchanged outcomes | — | — | — |
## 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 | — | — |
| Lint/config/fence time separately | About 80 ms combined on generated file; unseparated | — | — |
| Selector time by family and file size | Filtered ablations preserved in raw data | — | — |
| Tail rename selected paths / input bytes / selection reasons | Not measured; **2 output files is not input count** | — | — |
| Tail rename watched vs edited paths | Edited 2; watched unmeasured | — | — |
| Tail rename index / parse / analysis / resolution / verification stage times | Not measured | — | — |
| Ordinary rename selected bytes / stages | Edited 9; other counts unmeasured | — | — |
| Ambiguous-use all-sources fallback frequency | Not measured | — | — |
| Per-file parses for CLI census and lint | Multiple paths confirmed; runtime counts unmeasured | — | — |
| CLI package-census vs unused-import body time | Combined 123 ms wall increment; stages unseparated | — | — |
| Startup discovery / hash / decode / merge / candidates / includes / compact | Only combined scan time measured | — | — |
| Peak server RSS during startup and refactoring | Idle RSS only; peak unmeasured | — | — |
| First useful response during scan; open buffers 1 / 10 / 100 | Not measured in this round | — | — |
| Actual inline/extract command time and applyEdit payload | Not measured; existing resolve rows invalid for this purpose | — | — |
| First offer after didChange vs repeated unchanged offer | Separate distribution needed | — | — |
## Correctness and integration gates
| Gate | Required evidence | Candidate result / log |
|---|---|---|
| Action parity | Titles/kinds/counts/commands/data or edits/refusals; empty/prefix filters; cursor and selection | — |
| Reuse freshness | didChange, unsaved overlays, config/options/tab width/waiver changes, index generation, closed files changed on disk | — |
| Fence parity | All aliases, class/statement fences, malformed source, raw scan backstop, insertions and multi-edit fixes | — |
| Refactor whole-scope parity | Exact edits, warnings, refusal sentences; old/new common names, unresolved and ambiguous uses | — |
| Topology handshake 33 | Transitive `wrap.u_S.x` refusal coverage before sharing/narrowing module sources | — |
| Refactor verification | Token identity, semantic identity, parse-diagnostic preservation, comments/attributes, span remapping | — |
| CLI output | Compare full findings/fixes/waivers/exit codes, not just counts; disabled-rule run stays attribution-only | — |
| Index parity | Fresh/incremental/absorbed fingerprints, unsaved wins, coherent partial publication, scope/filelist/rootless behavior | — |
| Persistence | Corrupt/truncated/old-format stores rebuild safely; interrupted writes; content hash retained | — |
| Resources | Guard outcomes, idle and peak memory, allocated/actual store size, stack-size requirement | — |
| Formatting | `cargo fmt --all -- --check`, appropriate formatter snapshot/idempotency and corpus gates | — |
| Lint/tests | Guarded affected tests then clippy/workspace tests at integration, no benchmark overlap | — |
| Documentation | Feature README, handshake updates in topo, accepted numbers in perf README; reserved lead Review untouched by dev | — |
## 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: