Feature docs for the responsiveness round, and a perf record

Three new feature READMEs — change-debounce, port-detail-spans,
interactive-latency — each with the mandated sections, dev work logs,
QA findings and their dispositions, and the lead's review. Plus
`docs/perf/README.md`, the record of what was measured, on what, on
which machine, and with which command, so a later round can say
whether it made something faster or only different.

`topo.md` is added to the tree: the dependency topology the round was
planned against, with this round's new edges — the `detail_span` and
`symbols_named` handshake between the server and `vlog_semantic`, and
the facts-format edge to index persistence.

The perf record keeps its losses as well as its wins. A keystroke
followed by nothing now publishes at 164 ms rather than one
reanalysis, because it waits out the quiet period; a perf document
that only records improvements is not a perf document.

Co-Authored-By: Claude Opus 5 <[email protected]>
This commit is contained in:
lucioandClaude Opus 5 committed 2026-08-28 03:16:54 -07:00
1 parent 12d0bbad51
commit 574ab833e3
9 files changed
+2436 -11

No files matched your search

@@ -59,6 +59,11 @@ entirely whenever it could be the wrong line.
is the only thing that colours a hover card.
- Nothing is added to `Def`, to the facts file, or to `FACTS_FORMAT`; a cache
written before this round is still current after it.
**Superseded 2026-08-28 by `docs/features/port-detail-spans/README.md`**,
which adds `Def::detail_span`, writes it in every declaration record and
bumps `FACTS_FORMAT` 2 → 3, so a store written before *that* round is
discarded. This round's own promise held while it was this round's to
make; the index is text-free either way (a span is not text).
- The heading line `**label** — declared in `file:line`` is unchanged, so a
client (or a test) reading only that half sees exactly what it saw before.
@@ -119,6 +124,13 @@ The character cap counts `char`s and cuts on a boundary.
- Not done, deliberately: no facts/cache change, nothing in `vlog_semantic`,
no TODO.md edit (no existing checklist item covers this; §8's hover items
are all already checked, and inventing one is out of scope).
- [x] **2026-08-28**: one disk read per file per hover (`disk_view` memo);
QA finding 4 closed.
- [x] **2026-08-28**: `live_symbol` (and `nav::indexed_references`) look a
name up instead of scanning every symbol, with the first-match
tie-break pinned by test.
- [x] **2026-08-28**: a CRLF file's snippet no longer carries an interior
`\r` into the fence; QA finding 2 closed.
## Work log
@@ -164,6 +176,77 @@ The character cap counts `char`s and cuts on a boundary.
| `a_declaration_spanning_many_lines_is_cut_at_the_line_limit` | the line cap, via an open module whose `decl_span` is its body |
| `two_files_declaring_one_name_each_get_their_own_snippet` | ambiguous name: both headings, both snippets |
### 2026-08-28 — dev (performance: one disk read, one name lookup)
Parts A2 and A3 of the "Improve LSP performance + hover accuracy" round.
Behavior of every card is unchanged; both items are the same answer, reached
with less work. Numbers in `docs/perf/README.md`.
- **A2 — one read per file per hover.** A hover into a *closed* file used to
read that file and build a `LineIndex` over it twice: once in
`locate::line_number` for the `file:line` heading, once in
`declaration_snippet` for the fenced lines. This is QA's finding 4 below,
and it is now closed. `symbol_hover` holds a per-request memo — one
`(path, text, LineIndex)` in `disk_view` — that the heading and the snippet
both read, and `declaration_snippet` no longer touches the disk at all: it
is now the *open-buffer* path only, with the closed-file path inlined in
`symbol_hover` beside the heading it shares a read with. The
`spells_exactly` guard applies on both paths exactly as before. A card
naming one file twice (two declarations in one file) now pays for one read,
not two, which is why the memo is keyed by path rather than being a single
`Option` per candidate.
- Measured: 34 ms → 16.3 ms on QA's own 31.7 MB measurement, and 141 µs of
a 148 µs hover at 10 000 lines is that one read. See `docs/perf`.
- QA's measurement test was renamed
`hovering_into_a_large_closed_file_reads_it_twice` →
`..._reads_it_once`, since the doubling it was named for is gone. The QA
log below still names the old spelling; that section is QA's to amend.
- **A3 — `live_symbol` stops scanning every symbol.** Walking the whole
buffer's symbol table and calling `nav::indexed_def_for_symbol` (two index
lookups) on every symbol whose name happened to match — and reaching every
symbol whose name did not — became a name-keyed lookup:
`vlog_semantic::Semantics::symbols_named(name)`, two binary searches over a
side table of symbol ids sorted by name, built once during `analyze`. Only
same-named declarations are probed. A side table rather than a
`HashMap<String, Vec<SymbolId>>` so that `Semantics` — which is cloned per
document — does not carry a second copy of every name it already holds;
four bytes per symbol against a `String` per symbol.
- **The tie-break is preserved.** The map's lists are built by walking the
symbols in order, so `symbols_named` yields declaration order — the same
order, and the same first match, the old `symbols().iter().find(..)`
made. Pinned by `looking_a_name_up_answers_exactly_what_scanning_every_symbol_would`
in `crates/vlog_semantic/tests/semantics.rs`, which compares the two
answers directly and asserts the earlier declaration comes first. QA's
`duplicate_live_declarations_of_one_name_pick_the_first_one_silently`
(finding 3 below) still passes, unchanged.
- `nav.rs`'s `indexed_references` had the same scan-by-name for the
declaration's live span; it is the same swap and was made in the same
change, for the same reason.
- `vlog_refactor::ports.rs:1154` has a third one (`symbols().iter()
.position(|s| s.name == port && …)`). It is not a trivial swap — the
predicate carries a kind and a span test and the code wants the
*position* as a `SymbolId` — and it is in another crate, so it is left
alone and recorded here rather than done.
- Cost: four bytes per symbol. Measured saving on the lookup alone:
8.41 µs → 133 ns over a 5 001-symbol file (`docs/perf/README.md`).
### 2026-08-28 — dev (CRLF, closing QA finding 2)
- Finding 2 below — a CRLF file's multi-line snippet keeping an interior
`\r` inside the fence — is **fixed**, as part of `port-detail-spans`' PDS-4.
Every line a card shows now goes through `attached_lines`, which strips a
trailing `\r` as it composes each line; that covers both this feature's
snippet path and `local_text`'s in-file path, which QA named as having the
same property, because both reach it through `fenced_sections`. Display
text only: no buffer is written.
- QA's pinned regression test was named for the old behaviour
(`a_crlf_multiline_snippet_keeps_interior_carriage_returns`) and asserted
it; it is now `a_crlf_multiline_snippet_carries_no_carriage_returns` and
asserts the opposite, plus that the lines read as written. The QA log below
still names the old spelling; that section is QA's to amend.
- No other change to this feature. `spells_exactly`, the caps and the
disk/live split are untouched.
## QA log
### 2026-08-27 — QA
@@ -277,6 +360,12 @@ charter's "note it, don't redesign" rather than attempted.
`hovering_into_a_large_closed_file_reads_it_twice`, `hover.rs:1325`. Run
with `cargo test --release -p lucisv_server large_closed -- --ignored
--nocapture`.
- **Amended 2026-08-28 — QA.** Closed by A2 (`docs/perf/README.md`):
`symbol_hover`'s `disk_view` memo now shares one read + one `LineIndex`
between the heading and the snippet. Re-ran the same measurement (now
named `..._reads_it_once`): **17.0 ms**, against the documented
"34 ms → 16.3 ms" — matches within the run-to-run noise `docs/perf/
README.md` itself calls out. No longer an open finding.
**Verified, no finding** (angles from the charter that turned up nothing):
UTF-8 multi-byte content before a declaration, on the same file, does not