[WIP] Reuse verified note metadata and covering tag counts (#686) #751

Closed
kayg wants to merge 1 commit from perf/open-note-cold into dev
Owner

Opening an unchanged indexed note reread and described its text, then rewrote its note, tag, link and plugin metadata. This reuses the indexed description after checking the saved bytes and matching id, path, scan stamp, title and file hash. Dirty, missing and stale descriptions still follow the existing plugin path. History persistence and save ordering stay unchanged.

Tag-only totals use the covering tag range and the existing plugin visibility interface. This reuses the independent count query from PR #727, commit 135a01a9, without its unrelated changes.

The derived list cache moves to schema 5 to store file hashes. Rebuilding an old cache now clears derived counts and links before refilling. Scanner text decoding calls the canonical text module so its description agrees with the live room, including repeated BOMs.

This is a partial result and must remain a draft. Tracks #686; its acceptance criteria are unmet.

100k p95, ms Before Run 1 Run 2 Run 3 Budget
open.note 47.764763 23.904924 34.379729 15.004543 15
home.page_tag 62.728232 5.657342 5.218831 5.322661 50

All three full candidate reports failed. Report 1 also exceeded cold.index; report 3 exceeded cold.startup. Existing idle CPU failures remain; idle RSS failed in reports 1 and 2. All reports have every metric, 17 successful cache drops and no scenario failures. Budgets and the report harness are unchanged.

A separate diagnostic with the real Rust harness and identical list/query/journal/open prelude measured file-read phase p95 at 23.28, 22.17, 29.57, 15.60 and 20.32 ms across five groups. The median is 22.17 ms, exceeding the open budget before the rest of the work. Actual read syscalls in the earlier trace took 20–22 ms. This locates the remaining measured tail; raw file-read controls varied, so it is not a universal hardware-floor claim. CPU sampling was denied by perf_event_paranoid=3. Temporary timing instrumentation is excluded from this commit.

Format, clippy with warnings denied, and locked workspace tests passed. Regression tests cover clean opens without metadata writes, preserved-mtime content changes, stale rows, save/reopen, canonical decoding, old-cache rebuilding, tag visibility, filtering, cursors and ordering. Read-only code review found a decoder mismatch; its regression test and correction are included.

Base: d83e54dbe5. Head: 7dadf737b5. Product and perf code at the base match the issue baseline 3d0c6e33.

All-metric comparison and full reports. Remaining tail evidence. Evidence archive contains reports, query plans, syscall counts, phase analysis, commands, hashes and test output. No evidence or generated artifacts are committed.

Gate output, retaining the tool's original rounding:

fmt exit=0
clippy exit=0
workspace exit=0

before server report exit=1
over target (not gated yet): 100000 notes: storm.disk_written p95 57.1 > 50
over budget: 100000 notes: home.page_tag p95 62.7 > 50
over budget: 100000 notes: idle.cpu_pct p95 0.60 > 0.1
over budget: 100000 notes: idle.rss p95 104 > 100
over budget: 100000 notes: open.note p95 47.8 > 15

after-1 server report exit=1
over target (not gated yet): 100000 notes: storm.disk_written p95 50.9 > 50
over budget: 100000 notes: cold.index p95 62.3 > 60
over budget: 100000 notes: idle.cpu_pct p95 0.63 > 0.1
over budget: 100000 notes: idle.rss p95 100 > 100
over budget: 100000 notes: open.note p95 23.9 > 15

after-2 server report exit=1
over budget: 100000 notes: idle.cpu_pct p95 0.63 > 0.1
over budget: 100000 notes: idle.rss p95 100 > 100
over budget: 100000 notes: open.note p95 34.4 > 15

after-3 server report exit=1
over target (not gated yet): 100000 notes: storm.disk_written p95 52.8 > 50
over budget: 100000 notes: cold.startup p95 580 > 500
over budget: 100000 notes: idle.cpu_pct p95 0.63 > 0.1
over budget: 100000 notes: open.note p95 15.0 > 15
Opening an unchanged indexed note reread and described its text, then rewrote its note, tag, link and plugin metadata. This reuses the indexed description after checking the saved bytes and matching id, path, scan stamp, title and file hash. Dirty, missing and stale descriptions still follow the existing plugin path. History persistence and save ordering stay unchanged. Tag-only totals use the covering tag range and the existing plugin visibility interface. This reuses the independent count query from PR #727, commit 135a01a9, without its unrelated changes. The derived list cache moves to schema 5 to store file hashes. Rebuilding an old cache now clears derived counts and links before refilling. Scanner text decoding calls the canonical text module so its description agrees with the live room, including repeated BOMs. This is a partial result and must remain a draft. Tracks #686; its acceptance criteria are unmet. | 100k p95, ms | Before | Run 1 | Run 2 | Run 3 | Budget | |---|---:|---:|---:|---:|---:| | open.note | 47.764763 | 23.904924 | 34.379729 | 15.004543 | 15 | | home.page_tag | 62.728232 | 5.657342 | 5.218831 | 5.322661 | 50 | All three full candidate reports failed. Report 1 also exceeded cold.index; report 3 exceeded cold.startup. Existing idle CPU failures remain; idle RSS failed in reports 1 and 2. All reports have every metric, 17 successful cache drops and no scenario failures. Budgets and the report harness are unchanged. A separate diagnostic with the real Rust harness and identical list/query/journal/open prelude measured file-read phase p95 at 23.28, 22.17, 29.57, 15.60 and 20.32 ms across five groups. The median is 22.17 ms, exceeding the open budget before the rest of the work. Actual read syscalls in the earlier trace took 20–22 ms. This locates the remaining measured tail; raw file-read controls varied, so it is not a universal hardware-floor claim. CPU sampling was denied by perf_event_paranoid=3. Temporary timing instrumentation is excluded from this commit. Format, clippy with warnings denied, and locked workspace tests passed. Regression tests cover clean opens without metadata writes, preserved-mtime content changes, stale rows, save/reopen, canonical decoding, old-cache rebuilding, tag visibility, filtering, cursors and ordering. Read-only code review found a decoder mismatch; its regression test and correction are included. Base: d83e54dbe571b625504001a8b6add90d44ca6161. Head: 7dadf737b548810df22b2616ecc0f8dd73bd1b04. Product and perf code at the base match the issue baseline 3d0c6e33. [All-metric comparison and full reports](https://git.kayg.org/kayg/calternal/issues/686#issuecomment-68467). [Remaining tail evidence](https://git.kayg.org/kayg/calternal/issues/686#issuecomment-68476). [Evidence archive](https://git.kayg.org/attachments/5097a06b-4e68-4b57-81e0-958c24109a86) contains reports, query plans, syscall counts, phase analysis, commands, hashes and test output. No evidence or generated artifacts are committed. Gate output, retaining the tool's original rounding: ``` fmt exit=0 clippy exit=0 workspace exit=0 before server report exit=1 over target (not gated yet): 100000 notes: storm.disk_written p95 57.1 > 50 over budget: 100000 notes: home.page_tag p95 62.7 > 50 over budget: 100000 notes: idle.cpu_pct p95 0.60 > 0.1 over budget: 100000 notes: idle.rss p95 104 > 100 over budget: 100000 notes: open.note p95 47.8 > 15 after-1 server report exit=1 over target (not gated yet): 100000 notes: storm.disk_written p95 50.9 > 50 over budget: 100000 notes: cold.index p95 62.3 > 60 over budget: 100000 notes: idle.cpu_pct p95 0.63 > 0.1 over budget: 100000 notes: idle.rss p95 100 > 100 over budget: 100000 notes: open.note p95 23.9 > 15 after-2 server report exit=1 over budget: 100000 notes: idle.cpu_pct p95 0.63 > 0.1 over budget: 100000 notes: idle.rss p95 100 > 100 over budget: 100000 notes: open.note p95 34.4 > 15 after-3 server report exit=1 over target (not gated yet): 100000 notes: storm.disk_written p95 52.8 > 50 over budget: 100000 notes: cold.startup p95 580 > 500 over budget: 100000 notes: idle.cpu_pct p95 0.63 > 0.1 over budget: 100000 notes: open.note p95 15.0 > 15 ```
perf(notes): reuse verified metadata on indexed opens
Some checks failed
CI / server (pull_request) Successful in 1m15s
CI / rust (pull_request) Successful in 18m7s
CI / web (pull_request) Has been cancelled
7dadf737b5
Author
Owner

Closing per #931: this PR belongs to the superseded ARM64 perf series.

Closing per #931: this PR belongs to the superseded ARM64 perf series.
kayg closed this pull request 2026-11-04 17:37:37 +00:00
Some checks failed
CI / server (pull_request) Successful in 1m15s
CI / rust (pull_request) Successful in 18m7s
CI / web (pull_request) Has been cancelled

Pull request closed

Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
kayg/calternal!751
No description provided.