Storage: SQLite WAL auto-checkpoints run inside saves (meta.db every 100th save, history, journal) #1051

Open
opened 2026-11-10 05:11:52 +00:00 by kayg · 19 comments
Owner

What

SQLite's WAL auto-checkpoint runs inside saves, on dev. meta.db, history.db and the journal's index.db all keep SQLite's default wal_autocheckpoint (1,000 pages, about 4 MB). So whichever write crosses that size also pays for the checkpoint: a WAL fdatasync plus a database-file fdatasync, in the middle of someone's save. Only search (crates/search/src/index.rs) sets wal_autocheckpoint = 0 with a background PASSIVE checkpoint. #298 moved history commit tails off the hot path but left these auto-checkpoints in place.

Found during the #928 soak diagnosis (comment 89399 there). It is the same on dev and on #928.

Evidence

The perf-01 FIFO turn of 2026-11-10 04:43–05:01 UTC had four interleaved 180 s save-soak arms: dev A, #928 candidate, dev B, candidate. Each arm types into one note and calls notes.save every 200 ms (900 saves). The server ran under perf/vm/strace-server.sh (seccomp-filtered strace: fsync, fdatasync, openat, with file names; #1050). A main-database sync is a checkpoint writing its WAL back. This table places each one against the save windows:

Database Checkpoints per arm Inside a save Where Save it hit
notes/meta.db (synchronous=NORMAL) 13 9 notes.save 93, 193, 293 … 893: every 100th save, in all four arms 29–59 ms vs a median of about 22 ms; for example save 93: 59.4 / 50.3 / 48.0 / 52.0 ms
notes/history.db (synchronous=FULL) 9 6 the typing save (edit sent until its history ACK) before saves 149, 298, 448, 596, plus notes.save 743, 892 (dev B: all 6 in typing saves) typing ACK 11–29 ms; notes.save 29–38 ms
index.db (journal) 4 1 notes.save 471/472 36–40 ms

The other checkpoints in each row ran at startup, outside any save. Each in-save checkpoint costs its WAL fdatasync (4–18 ms for meta) plus the database-file fdatasync (3–10 ms) on top of the save's own four syncs. That's about 16 in-save checkpoints per 900 saves (~1.8%), more than the 1% that sets p99, so at this cadence they largely are the notes_save p99 and part of the save_ack tail.

Raw data is attached below: every save's start, end and typing-ACK times with WAL sizes, and the strace of each arm. Re-run with python3 checkpoints.py saves-<arm>.jsonl strace-<arm>.txt or perf/vm/sync-overlap.py … --watch 'notes/meta.db$' (exits 1 on these).

Proposal

Move checkpoints off the save path, the way search already does:

  1. Open meta.db, history.db and the journal store with PRAGMA wal_autocheckpoint = 0, so no write ever checkpoints.
  2. A per-Home background checkpointer runs PRAGMA wal_checkpoint(PASSIVE) from its own connection:
    • on idle, 1 s after the last write;
    • on size, when the WAL passes a cap, so a Home that never goes idle still checkpoints off the save path;
    • with TRUNCATE when fully idle, as meta.rs::checkpoint already does at close.
  3. Keep journal_size_limit (8 MB on meta) so a truncated WAL doesn't stay large.

Expected effect: about 16 fewer sync pairs inside saves per 900 saves at this cadence. notes_save p99 and the save_ack tail should drop by roughly the checkpoint cost (about 10–25 ms on those saves); p50 is unchanged. Measure with the #1050 method: ≥3 interleaved arms per side, plus the sync-overlap check showing 0 checkpoint syncs inside saves.

Risks:

  • WAL growth. A long reader can stop a PASSIVE checkpoint from finishing, so the WAL grows until it does. That's bounded by the size trigger plus journal_size_limit; add a test that the WAL stays under the cap under a held reader.
  • Disk contention. The checkpoint's syncs still share the disk with saves, just not inside one. Schedule after a save ends, as #928's witness flush does.
  • Durability. None lost. In WAL mode a commit is durable once its WAL frame is synced (history: synchronous=FULL); checkpoints only move pages into the main file. Crash recovery replays a longer WAL, bounded by the cap.
  • Reads. With a larger WAL, readers search a bigger WAL index; under the 4–8 MB cap this is negligible, but measure home.* and open.* against the budgets.

Not part of #928; that PR's numbers don't depend on this.

## What SQLite's WAL auto-checkpoint runs **inside saves**, on dev. `meta.db`, `history.db` and the journal's `index.db` all keep SQLite's default `wal_autocheckpoint` (1,000 pages, about 4 MB). So whichever write crosses that size also pays for the checkpoint: a WAL `fdatasync` plus a database-file `fdatasync`, in the middle of someone's save. Only search (`crates/search/src/index.rs`) sets `wal_autocheckpoint = 0` with a background `PASSIVE` checkpoint. #298 moved history *commit* tails off the hot path but left these auto-checkpoints in place. Found during the #928 soak diagnosis (comment 89399 there). It is the same on dev and on #928. ## Evidence The perf-01 FIFO turn of 2026-11-10 04:43–05:01 UTC had four interleaved 180 s save-soak arms: dev A, #928 candidate, dev B, candidate. Each arm types into one note and calls `notes.save` every 200 ms (900 saves). The server ran under `perf/vm/strace-server.sh` (seccomp-filtered strace: fsync, fdatasync, openat, with file names; #1050). A main-database sync is a checkpoint writing its WAL back. This table places each one against the save windows: | Database | Checkpoints per arm | Inside a save | Where | Save it hit | |---|---:|---:|---|---| | `notes/meta.db` (`synchronous=NORMAL`) | 13 | **9** | `notes.save` 93, 193, 293 … 893: **every 100th save**, in all four arms | 29–59 ms vs a median of about 22 ms; for example save 93: 59.4 / 50.3 / 48.0 / 52.0 ms | | `notes/history.db` (`synchronous=FULL`) | 9 | **6** | the typing save (edit sent until its history ACK) before saves 149, 298, 448, 596, plus `notes.save` 743, 892 (dev B: all 6 in typing saves) | typing ACK 11–29 ms; `notes.save` 29–38 ms | | `index.db` (journal) | 4 | **1** | `notes.save` 471/472 | 36–40 ms | The other checkpoints in each row ran at startup, outside any save. Each in-save checkpoint costs its WAL `fdatasync` (4–18 ms for meta) plus the database-file `fdatasync` (3–10 ms) on top of the save's own four syncs. That's **about 16 in-save checkpoints per 900 saves (~1.8%)**, more than the 1% that sets p99, so at this cadence they largely *are* the `notes_save` p99 and part of the `save_ack` tail. Raw data is attached below: every save's start, end and typing-ACK times with WAL sizes, and the strace of each arm. Re-run with `python3 checkpoints.py saves-<arm>.jsonl strace-<arm>.txt` or `perf/vm/sync-overlap.py … --watch 'notes/meta.db$'` (exits 1 on these). ## Proposal Move checkpoints off the save path, the way search already does: 1. Open `meta.db`, `history.db` and the journal store with `PRAGMA wal_autocheckpoint = 0`, so no write ever checkpoints. 2. A per-Home background checkpointer runs `PRAGMA wal_checkpoint(PASSIVE)` from its own connection: - **on idle**, 1 s after the last write; - **on size**, when the WAL passes a cap, so a Home that never goes idle still checkpoints off the save path; - with `TRUNCATE` when fully idle, as `meta.rs::checkpoint` already does at close. 3. Keep `journal_size_limit` (8 MB on meta) so a truncated WAL doesn't stay large. **Expected effect:** about 16 fewer sync pairs inside saves per 900 saves at this cadence. `notes_save` p99 and the `save_ack` tail should drop by roughly the checkpoint cost (about 10–25 ms on those saves); p50 is unchanged. Measure with the #1050 method: ≥3 interleaved arms per side, plus the sync-overlap check showing 0 checkpoint syncs inside saves. **Risks:** - **WAL growth.** A long reader can stop a `PASSIVE` checkpoint from finishing, so the WAL grows until it does. That's bounded by the size trigger plus `journal_size_limit`; add a test that the WAL stays under the cap under a held reader. - **Disk contention.** The checkpoint's syncs still share the disk with saves, just not inside one. Schedule after a save ends, as #928's witness flush does. - **Durability.** None lost. In WAL mode a commit is durable once its WAL frame is synced (history: `synchronous=FULL`); checkpoints only move pages into the main file. Crash recovery replays a longer WAL, bounded by the cap. - **Reads.** With a larger WAL, readers search a bigger WAL index; under the 4–8 MB cap this is negligible, but measure `home.*` and `open.*` against the budgets. Not part of #928; that PR's numbers don't depend on this.
Author
Owner

Raw evidence for the table above (four soak arms, per-save logs and strace): p928-soak-diagnostic-20261110.tar.gz (697612 bytes). Contents: out/saves-*.jsonl, out/strace-*.txt, out/summary-*.json, and the analyze.py, checkpoints.py and sync-overlap.py scripts used.

Raw evidence for the table above (four soak arms, per-save logs and strace): [p928-soak-diagnostic-20261110.tar.gz](https://git.kayg.org/attachments/324b4d62-2ab8-4b88-b542-8ad10f6a926c) (697612 bytes). Contents: `out/saves-*.jsonl`, `out/strace-*.txt`, `out/summary-*.json`, and the `analyze.py`, `checkpoints.py` and `sync-overlap.py` scripts used.
Author
Owner

Handoff to Codex (Claude stopped on its usage limit)

Branch storage/wal-checkpoint-off-save-1051, head 898d7f865, rebased onto dev 4274dafb4 (rusqlite 0.41). No PR yet. No perf locks or tickets are held.

Done

  • calternal_core::wal is a pure checkpoint policy: PASSIVE after 100 ms quiet once ≥100 commits, PASSIVE after 1 s idle, TRUNCATE after 10 s idle. Auto-checkpoint is raised to a 4,096-page (16 MiB) backstop rather than 0, because meta.db has no writer loop to wake during a cold scan. journal_size_limit is 8 MiB.
  • history.db: the writer thread runs the policy between jobs. It also checkpoints the Home's meta.db (Sibling) on its own connection. meta.db counts commits with commit_hook; rusqlite 0.41 needs &mut there, fixed in 46469500c.
  • index.db: the store writer runs PASSIVE after every 100 commits when its queue is empty (no timer; it waits on an async channel).
  • Tests: core policy (5), history/checkpoint_tests.rs (5), store the_journal_checkpoints_after_enough_commits_never_inside_one.
  • Gates on dev-01 at 898d7f865:
    • fmt, clippy -D warnings, and the new tests pass.
    • The workspace run had one failure, calternal --test attachments_crash::kill_nine_mid_upload_leaves_nothing_half_written: NotFound at attachments_crash.rs:129, where a file disappears between the test's own read_dir and metadata. It looks like a test race unrelated to SQLite, but it has not been rerun.
  • Release binaries are built on dev-01 in ~/wal1051-build.sJl1/bin (server/probe for dev and branch, with SHA256SUMS). The probe crate needed rusqlite = "0.41".

Left

  1. Rerun the failing test with --repeat-each-style loops (×10) on the branch and on dev. If it's flaky on both, open a stability issue; if it only fails on the branch, investigate.

  2. Measure by the #1050 method (docs/perf/comparing.md), in one plain ~/bin/perf-turn turn (perf-01 lock, then perf-02):

    • journal / startup / room ABAB with dev-vs-dev control pairs (save_ack, notes_save p50/p95/p99, plus commit and catch_up because the store writer changed);
    • six interleaved 180 s save-soak arms (dev ×3, branch ×3), judging the branch max against the dev range;
    • one traced pair through perf/vm/strace-server.sh, then perf/vm/sync-overlap.py saves.jsonl strace.txt --watch 'notes/meta.db$|history.db$|index.db$'.

    Expected: 0 main-database syncs inside saves (dev showed about 16 per 900 saves), with notes_save p99 and the save_ack tail lower and p50 flat. Nothing may regress.

  3. Open the PR to dev. A drafted description (design, sizes, failure table, tests) is at /tmp/p928tk.RrRE/pr1051.md on the control host code. Put the evidence in the PR.

Runner and scripts used for #928/#1050 measurements: perf-01 ~/p928-tk/runner.py (phases matrix, soak = six arms, startup, boot) and ~/p928-tk/diag/ (diag-soak.sh traced pair, strace-static). They are not yet updated for these binaries; stage the new bin/ and hashes first.

## Handoff to Codex (Claude stopped on its usage limit) Branch `storage/wal-checkpoint-off-save-1051`, head `898d7f865`, rebased onto dev `4274dafb4` (rusqlite 0.41). No PR yet. No perf locks or tickets are held. ### Done - **`calternal_core::wal`** is a pure checkpoint policy: `PASSIVE` after 100 ms quiet once ≥100 commits, `PASSIVE` after 1 s idle, `TRUNCATE` after 10 s idle. Auto-checkpoint is raised to a 4,096-page (16 MiB) backstop rather than 0, because `meta.db` has no writer loop to wake during a cold scan. `journal_size_limit` is 8 MiB. - **`history.db`:** the writer thread runs the policy between jobs. It also checkpoints the Home's `meta.db` (`Sibling`) on its own connection. `meta.db` counts commits with `commit_hook`; rusqlite 0.41 needs `&mut` there, fixed in `46469500c`. - **`index.db`:** the store writer runs `PASSIVE` after every 100 commits when its queue is empty (no timer; it waits on an async channel). - **Tests:** core policy (5), `history/checkpoint_tests.rs` (5), store `the_journal_checkpoints_after_enough_commits_never_inside_one`. - **Gates on dev-01 at `898d7f865`:** - fmt, clippy `-D warnings`, and the new tests pass. - The workspace run had one failure, `calternal --test attachments_crash::kill_nine_mid_upload_leaves_nothing_half_written`: `NotFound` at `attachments_crash.rs:129`, where a file disappears between the test's own `read_dir` and `metadata`. It looks like a test race unrelated to SQLite, but it has not been rerun. - **Release binaries are built** on dev-01 in `~/wal1051-build.sJl1/bin` (server/probe for dev and branch, with `SHA256SUMS`). The probe crate needed `rusqlite = "0.41"`. ### Left 1. Rerun the failing test with `--repeat-each`-style loops (×10) on the branch and on dev. If it's flaky on both, open a stability issue; if it only fails on the branch, investigate. 2. Measure by the #1050 method (`docs/perf/comparing.md`), in one plain `~/bin/perf-turn` turn (perf-01 lock, then perf-02): - journal / startup / room ABAB with dev-vs-dev control pairs (`save_ack`, `notes_save` p50/p95/p99, plus `commit` and `catch_up` because the store writer changed); - six interleaved 180 s save-soak arms (dev ×3, branch ×3), judging the branch max against the dev range; - one traced pair through `perf/vm/strace-server.sh`, then `perf/vm/sync-overlap.py saves.jsonl strace.txt --watch 'notes/meta.db$|history.db$|index.db$'`. **Expected:** 0 main-database syncs inside saves (dev showed about 16 per 900 saves), with `notes_save` p99 and the `save_ack` tail lower and p50 flat. Nothing may regress. 3. Open the PR to dev. A drafted description (design, sizes, failure table, tests) is at `/tmp/p928tk.RrRE/pr1051.md` on the control host `code`. Put the evidence in the PR. Runner and scripts used for #928/#1050 measurements: perf-01 `~/p928-tk/runner.py` (phases `matrix`, `soak` = six arms, `startup`, `boot`) and `~/p928-tk/diag/` (`diag-soak.sh` traced pair, `strace-static`). They are not yet updated for these binaries; stage the new `bin/` and hashes first.
Author
Owner

Qualification resumed from comment 89593. Attachment crash repetitions: branch 898d7f865 failed 1/10, dev 4274dafb4 passed its first 10; expanded dev diagnostics reproduced the identical NotFound at run 15 (1/30 overall). Filed #1060 and pushed test-only fix da8e35728: scan metadata once and ignore vanished .calternal-tmp-* entries only. Real-file errors still fail. Final fmt/clippy, 20 fixed repetitions, and workspace rerun are queued on dev-01.

The staged 898d7f865/dev release binaries match the original SHA256SUMS. Test-only commit da8e35728 does not change those binaries. Measurement is running in one plain ~/bin/perf-turn wal1051 … turn with perf-02 held too: controls and ABAB journal/startup/room, cold boot, list/open smoke probes built on dev-01, twelve interleaved 180 s soak arms (six per side), then a traced pair with the repository strace wrapper and sync-overlap checker. No measurements run on the control host.

Qualification resumed from comment 89593. Attachment crash repetitions: branch 898d7f865 failed 1/10, dev 4274dafb4 passed its first 10; expanded dev diagnostics reproduced the identical NotFound at run 15 (1/30 overall). Filed #1060 and pushed test-only fix da8e35728: scan metadata once and ignore vanished .calternal-tmp-* entries only. Real-file errors still fail. Final fmt/clippy, 20 fixed repetitions, and workspace rerun are queued on dev-01. The staged 898d7f865/dev release binaries match the original SHA256SUMS. Test-only commit da8e35728 does not change those binaries. Measurement is running in one plain `~/bin/perf-turn wal1051 …` turn with perf-02 held too: controls and ABAB journal/startup/room, cold boot, list/open smoke probes built on dev-01, twelve interleaved 180 s soak arms (six per side), then a traced pair with the repository strace wrapper and sync-overlap checker. No measurements run on the control host.
Author
Owner

The first session was stopped and both perf locks released after partial results identified an immediate journal-checkpoint tail (commit p99 0.065→0.188 ms) and a runner configuration mismatch: the reused #928 runner passed --secrets only to the branch server. Those startup/room results are rejected as unequal configuration.

Added a stronger store regression test: the main index.db must stay untouched across an active stream beyond 100 commits. It fails on the handoff implementation and passes after 591284889, which uses the shared quiet/idle policy for the store writer too. fmt passes. Rebuilding on dev-01 before a fresh plain FIFO turn, with identical --secrets arguments on both sides and tracing first.

Workspace results so far: initial rerun at 898d7f865 passed; the next full run (after only the temporary-file test fix) failed six calternal-notes tests with pending/unable-to-open-database errors. Logs retained; the next full run uses a fresh disk-backed TMPDIR and four test threads. 20/20 fixed attachment crash repetitions and clippy passed.

The first session was stopped and both perf locks released after partial results identified an immediate journal-checkpoint tail (commit p99 0.065→0.188 ms) and a runner configuration mismatch: the reused #928 runner passed --secrets only to the branch server. Those startup/room results are rejected as unequal configuration. Added a stronger store regression test: the main index.db must stay untouched across an active stream beyond 100 commits. It fails on the handoff implementation and passes after 591284889, which uses the shared quiet/idle policy for the store writer too. fmt passes. Rebuilding on dev-01 before a fresh plain FIFO turn, with identical --secrets arguments on both sides and tracing first. Workspace results so far: initial rerun at 898d7f865 passed; the next full run (after only the temporary-file test fix) failed six calternal-notes tests with pending/unable-to-open-database errors. Logs retained; the next full run uses a fresh disk-backed TMPDIR and four test threads. 20/20 fixed attachment crash repetitions and clippy passed.
Author
Owner

The corrected-configuration traced pair at 591284889 found dev 12 and branch 7 main-db syncs overlapping explicit saves; all seven branch overlaps were meta.db at roughly every 101st save. Root cause: SiblingWal::observe timestamped observation, not the meta commit, delaying its 100 ms quiet window into the next save. b8e599e5b records count/time together in the commit hook and preserves the original deadline. A deterministic delayed-observation test failed before the fix and passes after it.

The same session showed journal commit p50 +12.2% (0.02663→0.02989 ms, dev control +1.3%) from entering Tokio timer machinery per empty-queue commit; p99 was -6.1%. 86209c68b now registers a standard thread waker with the existing channel and parks until work or the quiet deadline, avoiding per-commit async timers. Truncation uses zero busy timeout and restores the normal 5 s write timeout; a held-reader test verifies retry and timeout restoration. All 75 store tests and the six history checkpoint tests pass. fmt passes on 86209c68b. Rebuilding before a fresh FIFO session; both perf locks remain released during this work.

The corrected-configuration traced pair at 591284889 found dev 12 and branch 7 main-db syncs overlapping explicit saves; all seven branch overlaps were meta.db at roughly every 101st save. Root cause: SiblingWal::observe timestamped observation, not the meta commit, delaying its 100 ms quiet window into the next save. b8e599e5b records count/time together in the commit hook and preserves the original deadline. A deterministic delayed-observation test failed before the fix and passes after it. The same session showed journal commit p50 +12.2% (0.02663→0.02989 ms, dev control +1.3%) from entering Tokio timer machinery per empty-queue commit; p99 was -6.1%. 86209c68b now registers a standard thread waker with the existing channel and parks until work or the quiet deadline, avoiding per-commit async timers. Truncation uses zero busy timeout and restores the normal 5 s write timeout; a held-reader test verifies retry and timeout restoration. All 75 store tests and the six history checkpoint tests pass. fmt passes on 86209c68b. Rebuilding before a fresh FIFO session; both perf locks remain released during this work.
Author
Owner

Further trace qualification at 86209c68b found that an overdue meta checkpoint can run just after a typing ACK, before that caller writes meta in its explicit save. d9a1f96e9 now requires a quiet history writer as well as the meta policy deadline. Its deterministic overdue-meta/recent-ACK case and all seven history checkpoint tests pass.

Journal p50 remained about +12% with a parked timed receive, so 7ff88807e restores the original blocking_recv for ordinary jobs. After 100 commits, one async task observes the count until quiet and queues an internal checkpoint message. The writer checks the observed count and empty queue before any I/O, rescheduling stale messages. Normal commits no longer enter a timed receive. fmt and all 75 store tests pass; full workspace/clippy are running. A journal-only FIFO check is queued behind shared-row and tiering before final measurements. No perf lock is held by this lane while waiting or building.

Further trace qualification at 86209c68b found that an overdue meta checkpoint can run just after a typing ACK, before that caller writes meta in its explicit save. d9a1f96e9 now requires a quiet history writer as well as the meta policy deadline. Its deterministic overdue-meta/recent-ACK case and all seven history checkpoint tests pass. Journal p50 remained about +12% with a parked timed receive, so 7ff88807e restores the original blocking_recv for ordinary jobs. After 100 commits, one async task observes the count until quiet and queues an internal checkpoint message. The writer checks the observed count and empty queue before any I/O, rescheduling stale messages. Normal commits no longer enter a timed receive. fmt and all 75 store tests pass; full workspace/clippy are running. A journal-only FIFO check is queued behind shared-row and tiering before final measurements. No perf lock is held by this lane while waiting or building.
Author
Owner

Rust gates are now green on 7ff88807e: cargo fmt --check, cargo clippy -j4 --workspace --all-targets -- -D warnings, and cargo test -j4 --workspace --no-fail-fast -- --test-threads=4, all through ~/bin/slot and nix develop on dev-01. Workspace used a dedicated /tmp/wal1051-tests.* TMPDIR. Exact script markers: FMT_R5=0, CLIPPY_R5=0, WORKSPACE_R5=0.

The journal-only check remains a failing performance gate: commit p50 0.026404→0.029250 ms (+10.78%; paired +11.59%; dev control +0.38%, control pair range -2.81% to +7.80%); p95 +5.56%, p99 -5.49%. The timed-receive explanations did not account for this, so no success claim is made. An isolated diagnostic changes only BACKSTOP_PAGES from 4096 to 1000 to test the WAL-size hypothesis. It and the final server rebuild are waiting behind train-1110c on dev-01. All perf locks are released.

Rust gates are now green on 7ff88807e: `cargo fmt --check`, `cargo clippy -j4 --workspace --all-targets -- -D warnings`, and `cargo test -j4 --workspace --no-fail-fast -- --test-threads=4`, all through ~/bin/slot and nix develop on dev-01. Workspace used a dedicated /tmp/wal1051-tests.* TMPDIR. Exact script markers: FMT_R5=0, CLIPPY_R5=0, WORKSPACE_R5=0. The journal-only check remains a failing performance gate: commit p50 0.026404→0.029250 ms (+10.78%; paired +11.59%; dev control +0.38%, control pair range -2.81% to +7.80%); p95 +5.56%, p99 -5.49%. The timed-receive explanations did not account for this, so no success claim is made. An isolated diagnostic changes only BACKSTOP_PAGES from 4096 to 1000 to test the WAL-size hypothesis. It and the final server rebuild are waiting behind train-1110c on dev-01. All perf locks are released.
Author
Owner

Attached: pre-final diagnostic evidence, including per-save traces, sync-overlap output, journal controls/ABAB results, runners and binary hashes. These are rejected qualification attempts, not a passing performance report.

r2-partial: 591284889, before original meta timestamps. r3-artifacts: 86209c68b, before the recent-history-ACK guard. journal-artifacts: 7ff88807e, showing that restoring blocking_recv did not eliminate the +10.78% commit p50 difference. The production-equivalent head 93ae82ba0 additionally isolates the test fixtures; its production code is unchanged from 7ff88807e. The latest full Rust gates passed at 7ff88807e (1745 passed, 0 failed, 22 ignored).

Next diagnostic compares the same implementation with only the backstop changed from 4096 to 1000 pages. It and the final server build are still queued behind dev-01 train-1110c; no perf locks are held by this lane.

Attached: pre-final diagnostic evidence, including per-save traces, sync-overlap output, journal controls/ABAB results, runners and binary hashes. These are rejected qualification attempts, not a passing performance report. `r2-partial`: 591284889, before original meta timestamps. `r3-artifacts`: 86209c68b, before the recent-history-ACK guard. `journal-artifacts`: 7ff88807e, showing that restoring blocking_recv did not eliminate the +10.78% commit p50 difference. The production-equivalent head 93ae82ba0 additionally isolates the test fixtures; its production code is unchanged from 7ff88807e. The latest full Rust gates passed at 7ff88807e (1745 passed, 0 failed, 22 ignored). Next diagnostic compares the same implementation with only the backstop changed from 4096 to 1000 pages. It and the final server build are still queued behind dev-01 train-1110c; no perf locks are held by this lane.
Author
Owner

index-only implementation plan (new branch from current origin/dev). meta.db and history.db remain unchanged. no merge and no delegates.

index writer: quiet PASSIVE after at least 100 writer commands and 100 ms without a queued write (chosen to fit between the corrected soak’s 200 ms saves); native 1000-page auto-checkpoint remains the emergency inline backstop. idle admission budget is 1000 WAL pages, not a claim of partial checkpoints: SQLite PASSIVE cannot stop after N pages. journal_size_limit bounds retained allocation after WAL restart, not active WAL growth. above 16 MiB the next writer command first attempts TRUNCATE without waiting (zero busy timeout, original timeout restored), and returns retryable NotSavedYet before starting a new transaction if a reader still prevents WAL reuse. PASSIVE completion does not prove reuse is possible. the bound allows one transaction of overshoot; existing API batch size is unchanged.

failure effect detection recovery test
process dies during a checkpoint main DB may contain only some checkpointed pages; WAL stays authoritative reopen and integrity_check SQLite WAL recovery; no journal sequence or receipt lost child killed while real checkpoint writes pages, reopen and validate rows
sustained write storm quiet timer defers, native 1000-page inline backstop runs WAL samples and page count WAL reuse after completed checkpoint continuous commits cross 1000 pages
pinned reader / starvation PASSIVE may make partial progress, WAL grows above 16 MiB preflight attempts nonblocking TRUNCATE refuse new journal transactions with retryable error until reader releases; allow one transaction overshoot held snapshot, cap refusal, rollback reader, retry
checkpoint I/O failure existing committed data retained, no false successful checkpoint claim logged SQLite error next dirty quiet interval retries; ordinary write errors still propagate checkpoint lock contention and retry
new write during timer stale checkpoint message must not run first writer generation and queue recheck re-arm quiet timer deterministic policy plus writer tests

cost: O(1) metadata admission per queued write, one weak timer per dirty writer, O(WAL pages) PASSIVE only within admission budget or emergency path. tests/builds only dev-01 via slot/Nix. perf reproduces corrected collector: identical-dev controls then ABABAB, 3 x 900 saves per side, per-arm quantiles/MAX, list p50/p95, database-specific overlap, WAL timeline. any MAX regression triggers retained slowest-20 phase analysis, no speculative patch. every measured metric must qualify before ready PR; otherwise draft.

index-only implementation plan (new branch from current origin/dev). meta.db and history.db remain unchanged. no merge and no delegates. index writer: quiet PASSIVE after at least 100 writer commands and 100 ms without a queued write (chosen to fit between the corrected soak’s 200 ms saves); native 1000-page auto-checkpoint remains the emergency inline backstop. idle admission budget is 1000 WAL pages, not a claim of partial checkpoints: SQLite PASSIVE cannot stop after N pages. journal_size_limit bounds retained allocation after WAL restart, not active WAL growth. above 16 MiB the next writer command first attempts TRUNCATE without waiting (zero busy timeout, original timeout restored), and returns retryable NotSavedYet before starting a new transaction if a reader still prevents WAL reuse. PASSIVE completion does not prove reuse is possible. the bound allows one transaction of overshoot; existing API batch size is unchanged. | failure | effect | detection | recovery | test | |---|---|---|---|---| | process dies during a checkpoint | main DB may contain only some checkpointed pages; WAL stays authoritative | reopen and integrity_check | SQLite WAL recovery; no journal sequence or receipt lost | child killed while real checkpoint writes pages, reopen and validate rows | | sustained write storm | quiet timer defers, native 1000-page inline backstop runs | WAL samples and page count | WAL reuse after completed checkpoint | continuous commits cross 1000 pages | | pinned reader / starvation | PASSIVE may make partial progress, WAL grows | above 16 MiB preflight attempts nonblocking TRUNCATE | refuse new journal transactions with retryable error until reader releases; allow one transaction overshoot | held snapshot, cap refusal, rollback reader, retry | | checkpoint I/O failure | existing committed data retained, no false successful checkpoint claim | logged SQLite error | next dirty quiet interval retries; ordinary write errors still propagate | checkpoint lock contention and retry | | new write during timer | stale checkpoint message must not run first | writer generation and queue recheck | re-arm quiet timer | deterministic policy plus writer tests | cost: O(1) metadata admission per queued write, one weak timer per dirty writer, O(WAL pages) PASSIVE only within admission budget or emergency path. tests/builds only dev-01 via slot/Nix. perf reproduces corrected collector: identical-dev controls then ABABAB, 3 x 900 saves per side, per-arm quantiles/MAX, list p50/p95, database-specific overlap, WAL timeline. any MAX regression triggers retained slowest-20 phase analysis, no speculative patch. every measured metric must qualify before ready PR; otherwise draft.
Author
Owner

pre-measurement cost review: retain #1064’s index-only 100-command minimum before scheduling the 100 ms quiet timer. this amortizes checkpoint sync pairs rather than adding one after every individual save. native 1000-page emergency backstop, idle page admission budget and pinned-reader size refusal remain as planned. draft #1080, current head 5a203fa05; tests queued behind existing dev-01 slot jobs, no performance qualification or held perf locks.

pre-measurement cost review: retain #1064’s index-only 100-command minimum before scheduling the 100 ms quiet timer. this amortizes checkpoint sync pairs rather than adding one after every individual save. native 1000-page emergency backstop, idle page admission budget and pinned-reader size refusal remain as planned. draft #1080, current head 5a203fa05; tests queued behind existing dev-01 slot jobs, no performance qualification or held perf locks.
Author
Owner

size-backstop correction from source review, before any measurement: PASSIVE can fully backfill a WAL while an active reader still prevents reset. above 16 MiB the writer now attempts nonblocking TRUNCATE, restores its original busy timeout on every path, and rejects the next transaction if reuse is still blocked. idle passes remain PASSIVE, and SQLite retains its native 1000-page inline backstop. the retained allocation limit follows the actual page size, so small-page databases do not permanently exceed the idle admission budget. new tests cover fully backfilled reader pins and 1024-byte page reuse. crash coverage now exercises the actual emergency checkpoint after a durable journal+receipt commit, with a reader pin preventing the native backstop from consuming the crash target first. draft #1080 head 557f4b02e. all Rust checks and perf remain pending behind train-1111b; no perf locks held.

size-backstop correction from source review, before any measurement: PASSIVE can fully backfill a WAL while an active reader still prevents reset. above 16 MiB the writer now attempts nonblocking TRUNCATE, restores its original busy timeout on every path, and rejects the next transaction if reuse is still blocked. idle passes remain PASSIVE, and SQLite retains its native 1000-page inline backstop. the retained allocation limit follows the actual page size, so small-page databases do not permanently exceed the idle admission budget. new tests cover fully backfilled reader pins and 1024-byte page reuse. crash coverage now exercises the actual emergency checkpoint after a durable journal+receipt commit, with a reader pin preventing the native backstop from consuming the crash target first. draft #1080 head 557f4b02e. all Rust checks and perf remain pending behind train-1111b; no perf locks held.
Author
Owner

The reused corrected-soak probe had a remaining observer-cost bug: it read WAL sizes and wrote its JSONL trace after the response, then stopped the timer used for notes_save_ms. Both fresh probes now stop that timer immediately at the response, before WAL enumeration. The syscall/phase window already ended there. Workload is unchanged: 200 ms cadence, 900 saves per 180-second arm, ABABAB with identical-dev controls. This is a measurement correction, not a production optimization; older numbers will not be pooled with this run.

Builds and regression tests are still queued behind the daily train. Collector completeness is checked on the build VM before requesting the perf turn. No new performance result is claimed.

The reused corrected-soak probe had a remaining observer-cost bug: it read WAL sizes and wrote its JSONL trace after the response, then stopped the timer used for `notes_save_ms`. Both fresh probes now stop that timer immediately at the response, before WAL enumeration. The syscall/phase window already ended there. Workload is unchanged: 200 ms cadence, 900 saves per 180-second arm, ABABAB with identical-dev controls. This is a measurement correction, not a production optimization; older numbers will not be pooled with this run. Builds and regression tests are still queued behind the daily train. Collector completeness is checked on the build VM before requesting the perf turn. No new performance result is claimed.
Author
Owner

functional validation on dev-02 (aarch64), under ~/bin/slot nix develop, head 82ecc5a1e:

  • unchanged dev plus the two new journal behavior tests: both fail for the intended missing behavior (idle checkpoint never occurs; a pinned WAL above the cap accepts another write).
  • cargo fmt --all -- --check: pass.
  • node ci/check-file-docs.mjs: pass.
  • node ci/check-layers.mjs: pass.
  • cargo test -j4 -p calternal-store -- --test-threads=4: 83 passed, including the real child-process crash while checkpoint main-file writes were observed, integrity check, payload and receipt recovery.
  • node ci/check-size-budgets.mjs: fails identically on dev and candidate. Unchanged files: NoteList.svelte 569 vs ceiling 567, fsio/src/lib.rs 576 vs 551, notes/src/home.rs 905 vs 902. No ceiling raised and no unrelated code changed.

The first candidate compile exposed unsupported u64 rusqlite conversions; 82ecc5a1e fixes only those SQL integer boundaries. The successful store run uses that fix. The temporary build target and Nix scratch were removed by the job's EXIT trap. x86 workspace/clippy/release and both diagnostic binaries are still queued behind the daily train. Perf gates remain pending, no locks held, PR #1080 remains draft.

raw commands and validation logs

cargo clippy -j4 -p calternal-store --all-targets -- -D warnings also passed on the same head under dev-02 slot/Nix. raw clippy command and log.

functional validation on dev-02 (aarch64), under `~/bin/slot nix develop`, head `82ecc5a1e`: - unchanged dev plus the two new journal behavior tests: both fail for the intended missing behavior (idle checkpoint never occurs; a pinned WAL above the cap accepts another write). - `cargo fmt --all -- --check`: pass. - `node ci/check-file-docs.mjs`: pass. - `node ci/check-layers.mjs`: pass. - `cargo test -j4 -p calternal-store -- --test-threads=4`: **83 passed**, including the real child-process crash while checkpoint main-file writes were observed, integrity check, payload and receipt recovery. - `node ci/check-size-budgets.mjs`: **fails identically on dev and candidate**. Unchanged files: NoteList.svelte 569 vs ceiling 567, fsio/src/lib.rs 576 vs 551, notes/src/home.rs 905 vs 902. No ceiling raised and no unrelated code changed. The first candidate compile exposed unsupported u64 rusqlite conversions; `82ecc5a1e` fixes only those SQL integer boundaries. The successful store run uses that fix. The temporary build target and Nix scratch were removed by the job's EXIT trap. x86 workspace/clippy/release and both diagnostic binaries are still queued behind the daily train. Perf gates remain pending, no locks held, PR #1080 remains draft. [raw commands and validation logs](https://git.kayg.org/attachments/add0cb39-a51f-4a7b-af8c-0be3efad4642) `cargo clippy -j4 -p calternal-store --all-targets -- -D warnings` also passed on the same head under dev-02 slot/Nix. [raw clippy command and log](https://git.kayg.org/attachments/68549936-78ff-4bb2-9507-51fe0c895a5a).
Author
Owner

measurement gates declared before the new perf run:

  • Save p50/p95/p99: compare medians of the three arm quantiles. Report every arm and every adjacent A/B delta. Check MAX both as the median of per-arm maxima and as the worst maximum; any adjacent candidate MAX beyond the dev/control allowance also blocks qualification.
  • For the soak, the allowance for each statistic is the absolute relative difference between the two identical-dev control arms. The MAX control allowance applies to both MAX comparisons. No fixed millisecond budget or “under 100 ms” exception.
  • Journal and list/open/startup checks use their interleaved dev/dev controls. Allowance is the median absolute paired control delta for that statistic; compare median arm quantiles, with nearest-rank across the independent startup observations for startup tails. Raw pairs and control spread remain visible.
  • Main-database checkpoint sync overlaps are separated by index/meta/history, excluding their ordinary WAL durability syncs. Compare overlap rates per save to dev and the control difference; index-only scope does not claim zero meta/history overlaps.
  • WAL allocation is sampled after each response, outside the save timer. Report the time series and peak for each DB/arm. Peak size must stay at or below dev within the identical-dev size difference, alongside the functional hard-cap/pinned-reader tests.
  • A failed MAX gate triggers slowest-20-per-arm phase attribution (fsync, checkpoint, SQLite lock/busy wait, index update and queue time), including saves below 100 ms. Nested spans are never added together. No speculative production patch follows a MAX failure.

The workload remains the corrected #1064 soak: two 60-second identical-dev controls, then ABABAB with 900 saves in each 180-second arm, 5,400 comparison saves total. One current-epoch turn, both perf locks, binaries staged and hash-checked first. All results remain pending.

measurement gates declared before the new perf run: - Save p50/p95/p99: compare medians of the three arm quantiles. Report every arm and every adjacent A/B delta. Check MAX both as the median of per-arm maxima and as the worst maximum; any adjacent candidate MAX beyond the dev/control allowance also blocks qualification. - For the soak, the allowance for each statistic is the absolute relative difference between the two identical-dev control arms. The MAX control allowance applies to both MAX comparisons. No fixed millisecond budget or “under 100 ms” exception. - Journal and list/open/startup checks use their interleaved dev/dev controls. Allowance is the median absolute paired control delta for that statistic; compare median arm quantiles, with nearest-rank across the independent startup observations for startup tails. Raw pairs and control spread remain visible. - Main-database checkpoint sync overlaps are separated by index/meta/history, excluding their ordinary WAL durability syncs. Compare overlap rates per save to dev and the control difference; index-only scope does not claim zero meta/history overlaps. - WAL allocation is sampled after each response, outside the save timer. Report the time series and peak for each DB/arm. Peak size must stay at or below dev within the identical-dev size difference, alongside the functional hard-cap/pinned-reader tests. - A failed MAX gate triggers slowest-20-per-arm phase attribution (fsync, checkpoint, SQLite lock/busy wait, index update and queue time), including saves below 100 ms. Nested spans are never added together. No speculative production patch follows a MAX failure. The workload remains the corrected #1064 soak: two 60-second identical-dev controls, then ABABAB with 900 saves in each 180-second arm, 5,400 comparison saves total. One current-epoch turn, both perf locks, binaries staged and hash-checked first. All results remain pending.
Author
Owner

head 82ecc5a1e95c6febe2eb8241c69db800ac791a00, baseline 437f9ec8923b3d380506f48a77eb11493ef66fb0. overall performance gate: FAIL; #1080 remains draft, #1064 unchanged.

Same-turn corrected workload: 3 alternating 900-save arms per side (5,400 comparison saves) plus two 300-save identical-dev controls, 40 continuous-journal observations, and 80 controlled list/open/startup observations. Binary hashes, boot IDs, raw traces, every WAL sample, probe sources, instrumentation patches and the predeclared gate policy are retained. Both own hold units were released before final analysis.

Save MAX gates pass: median per-arm MAX 69.884 → 61.731 ms (−11.67%); worst MAX 125.594 → 77.871 ms (−38.00%). The dev/dev MAX allowance is 30.41%; all adjacent MAX pairs pass within it. The two higher adjacent candidate maxima were still attributed in the attached slowest-20 evidence.

Five declared metrics fail:

metric dev candidate delta control allowance
journal commit p50 0.026309 ms 0.028714 ms +9.14% 1.77%
journal commit p95 0.040742 ms 0.044809 ms +9.98% 8.01%
cold first-page p95 9.037906 ms 13.875221 ms +53.52% 19.51%
cold first-page p99 9.750781 ms 15.739423 ms +61.42% 19.51%
history main-DB sync overlaps 0 / 2700 saves 6 / 2700 saves +6 0

Index main-DB sync overlaps fall 3 → 0; meta stays 27 → 27; history rises 0 → 6. Total main-DB overlaps therefore rise 30 → 33. Meta/history production code is unchanged; the observed history overlap miss is still a failed gate. Index peak WAL allocation falls 4,120,032 → 931,152 bytes; meta/history peaks are equal. Full size-over-time samples are in the archive. No budget raised, no sub-ms miss waived, and no speculative policy patch.

Functional state so far: all 83 store tests, including crash recovery, pass on both build VMs. Workspace clippy passes with -D warnings. The fresh x86 workspace test/release job is still running; final result will be appended. File-size lint fails identically on unchanged dev and candidate as already recorded. An invalid shared debug-cache result was discarded; current x86 tests use a fresh target and include all 83 cases.

measurement gates, predeclared in #1051 comment 91768. positive deltas above the measured control allowance fail. static/workspace gate state is reported separately.

save arms:

arm side saves save p50 p95 p99 MAX (ms) retries
ctrl-a dev control 300 24.689 33.331 43.783 165.972 0
ctrl-b dev control 300 25.484 35.095 45.522 115.499 0
0 dev 900 23.665 33.156 42.071 125.594 0
1 candidate 900 23.646 33.999 41.430 61.731 0
2 dev 900 24.139 32.749 42.029 69.884 0
3 candidate 900 23.874 33.831 41.837 77.871 0
4 dev 900 23.693 32.216 43.513 60.272 0
5 candidate 900 24.088 34.242 43.156 60.698 0

gate table:

metric dev candidate delta dev/dev allowance gate
save p50 23.6933 23.8738 +0.762% 3.222% pass
save p95 32.7495 33.9994 +3.817% 5.292% pass
save p99 42.0711 41.8367 -0.557% 3.973% pass
save median arm MAX 69.8839 61.7306 -11.667% 30.411% pass
save worst MAX 125.594 77.8714 -37.997% 30.411% pass
save paired MAX 1 125.594 61.7306 -50.849% 30.411% pass
save paired MAX 2 69.8839 77.8714 +11.430% 30.411% pass
save paired MAX 3 60.2717 60.6977 +0.707% 30.411% pass
save retries 0 0 +0.000 count 0.000 count pass
journal catch_up_page p50 0.171231 0.17364 +1.407% 4.994% pass
journal catch_up_page p95 0.207694 0.214487 +3.271% 11.505% pass
journal catch_up_page p99 0.244979 0.251677 +2.734% 12.762% pass
journal commit p50 0.026309 0.0287135 +9.139% 1.767% FAIL
journal commit p95 0.0407415 0.0448095 +9.985% 8.008% FAIL
journal commit p99 0.0654275 0.068718 +5.029% 12.995% pass
journal position_head p50 4e-05 4e-05 +0.000% 0.000% pass
journal position_head p95 4.1e-05 4.1e-05 +0.000% 0.000% pass
journal position_head p99 4.1e-05 4.1e-05 +0.000% 9.000% pass
journal position_mid p50 4e-05 4e-05 +0.000% 0.000% pass
journal position_mid p95 4.1e-05 4.1e-05 +0.000% 0.000% pass
journal position_mid p99 4.55e-05 4.1e-05 -9.890% 0.000% pass
smoke home_first_page p50 5.92322 5.61557 -5.194% 19.505% pass
smoke home_first_page p95 9.03791 13.8752 +53.523% 19.505% FAIL
smoke home_first_page p99 9.75078 15.7394 +61.417% 19.505% FAIL
smoke list_page p50 0.576631 0.59493 +3.174% 5.568% pass
smoke list_page p95 0.765254 0.771626 +0.833% 11.738% pass
smoke list_page p99 0.946263 0.992905 +4.929% 17.125% pass
smoke list_tag p50 0.698719 0.694836 -0.556% 3.301% pass
smoke list_tag p95 0.758521 0.762844 +0.570% 9.580% pass
smoke list_tag p99 1.08075 1.05859 -2.050% 5.865% pass
smoke list_title p50 0.550932 0.542641 -1.505% 4.352% pass
smoke list_title p95 0.632851 0.653615 +3.281% 8.080% pass
smoke list_title p99 0.888094 0.966161 +8.790% 14.109% pass
smoke open_api p50 0.594904 0.575228 -3.308% 5.252% pass
smoke open_api p95 0.730564 0.659266 -9.759% 7.036% pass
smoke open_api p99 0.800334 0.676122 -15.520% 10.713% pass
smoke open_note p50 0.553613 0.546153 -1.348% 4.505% pass
smoke open_note p95 0.659351 0.644062 -2.319% 10.053% pass
smoke open_note p99 8.6863 8.68669 +0.004% 5.506% pass
smoke startup_smoke_file_evicted p50 7.07783 7.11976 +0.592% 1.558% pass
smoke startup_smoke_file_evicted p95 9.26519 7.57596 -18.232% 1.558% pass
smoke startup_smoke_file_evicted p99 9.63489 9.34312 -3.028% 1.558% pass
index peak WAL 4.12003e+06 931152 -3188880.000 bytes 0.000 bytes pass
index checkpoint sync overlaps/1000 saves 1.11111 0 -1.111 count/1000 0.000 count/1000 pass
meta peak WAL 4.12827e+06 4.12827e+06 +0.000 bytes 0.000 bytes pass
meta checkpoint sync overlaps/1000 saves 10 10 +0.000 count/1000 0.000 count/1000 pass
history peak WAL 4.14475e+06 4.14475e+06 +0.000 bytes 0.000 bytes pass
history checkpoint sync overlaps/1000 saves 0 2.22222 +2.222 count/1000 0.000 count/1000 FAIL

WAL peaks and main-database checkpoint sync overlaps (ordinary WAL durability syncs excluded):

arm side index peak bytes meta peak bytes history peak bytes index overlaps meta overlaps history overlaps
ctrl-a control 2653312 4128272 4132392 0 3 0
ctrl-b control 2653312 4128272 4132392 0 3 0
0 dev 4120032 4128272 4144752 1 9 0
1 candidate 931152 4128272 4144752 0 9 2
2 dev 4120032 4128272 4144752 1 9 0
3 candidate 931152 4128272 4144752 0 9 2
4 dev 4120032 4128272 4144752 1 9 0
5 candidate 931152 4128272 4144752 0 9 2

Nested phase and fsync intervals are attributed separately in slowest20-per-arm.json/.md. Raw WAL samples are in wal-timeline.csv. No measurement from #1064 is pooled here.

MAX attribution, including the two candidate arm maxima that exceed their adjacent dev arm within the declared control spread:

arm / save total ms fsync interval union ms journal write ms traced SQLite busy wait ms index checkpoint overlap last index checkpoint
dev 0 / 175 125.593 121.958 0.339 0 none no explicit idle checkpoint on dev
candidate 1 / 625 61.731 30.385 0.802 0 none 5.261 s earlier
dev 2 / 133 69.884 65.397 0.334 0 none no explicit idle checkpoint on dev
candidate 3 / 282 77.871 74.967 0.383 0 none 16.680 s earlier
dev 4 / 93 60.271 55.704 0.411 0 none no explicit idle checkpoint on dev
candidate 5 / 293 60.698 55.977 0.340 0 none 18.861 s earlier

The candidate maximum in arm 3 is 11.43% above its adjacent dev maximum, within the predeclared 30.41% MAX control allowance. Its measured delay is filesystem durability: temporary-note fsync 40.394 ms, directory fsync 22.879 ms, and history-WAL flushes 28.760/11.694 ms, which overlap. The union covers 74.967 of 77.871 ms (96.3%). Index write is 0.383 ms; no traced SQLite busy-handler sleep or blocking file-lock wait, and no index checkpoint overlaps the request. These timings identify where the save stalled; they do not establish the host-level reason for those flush latencies or exclude indirect storage effects.

The last candidate arm's maximum is 0.71% above its adjacent dev arm, also within control bounds. It includes 35.395 ms of meta refresh, with meta-WAL fsync 29.388 ms and main meta DB fsync 4.689 ms. That is the unchanged native meta checkpoint policy. The worst dev save instead spends 111.809 ms in temporary-note fsync.

No median-arm or worst-MAX regression was observed. MAX controls vary by 30.41%, so the raw reductions are observations, not proof that the policy caused all of them. All 20 slowest saves per arm, including the controls and saves below 100 ms, are retained in slowest20-per-arm.json/.md. Spans nest; do not add phase totals or individual overlapping flush durations. Lock timings cover traced SQLite file locks and busy-handler sleeps, not every possible runtime/mutex delay.

Remaining failures are not waived: continuous-journal commit p50/p95, cold first-page p95/p99, and six history checkpoint sync overlaps versus zero on dev. The per-command WAL-size metadata preflight is a plausible contributor to the journal cost, but these measurements do not isolate it. The cause of the cold first-page tail regression remains unresolved. No production policy patch followed these failures.

raw measurements, full analysis, WAL CSV, probe sources, diagnostic patches and comparison chart (SHA-256 43fba64d9efe45ed41f730a1d4f48025061d65001e2a7fe6fe786c2a76e13738).

head `82ecc5a1e95c6febe2eb8241c69db800ac791a00`, baseline `437f9ec8923b3d380506f48a77eb11493ef66fb0`. **overall performance gate: FAIL; #1080 remains draft, #1064 unchanged.** Same-turn corrected workload: 3 alternating 900-save arms per side (5,400 comparison saves) plus two 300-save identical-dev controls, 40 continuous-journal observations, and 80 controlled list/open/startup observations. Binary hashes, boot IDs, raw traces, every WAL sample, probe sources, instrumentation patches and the predeclared gate policy are retained. Both own hold units were released before final analysis. Save MAX gates pass: median per-arm MAX 69.884 → 61.731 ms (−11.67%); worst MAX 125.594 → 77.871 ms (−38.00%). The dev/dev MAX allowance is 30.41%; all adjacent MAX pairs pass within it. The two higher adjacent candidate maxima were still attributed in the attached slowest-20 evidence. Five declared metrics fail: | metric | dev | candidate | delta | control allowance | |---|---:|---:|---:|---:| | journal commit p50 | 0.026309 ms | 0.028714 ms | +9.14% | 1.77% | | journal commit p95 | 0.040742 ms | 0.044809 ms | +9.98% | 8.01% | | cold first-page p95 | 9.037906 ms | 13.875221 ms | +53.52% | 19.51% | | cold first-page p99 | 9.750781 ms | 15.739423 ms | +61.42% | 19.51% | | history main-DB sync overlaps | 0 / 2700 saves | 6 / 2700 saves | +6 | 0 | Index main-DB sync overlaps fall 3 → 0; meta stays 27 → 27; history rises 0 → 6. Total main-DB overlaps therefore rise 30 → 33. Meta/history production code is unchanged; the observed history overlap miss is still a failed gate. Index peak WAL allocation falls 4,120,032 → 931,152 bytes; meta/history peaks are equal. Full size-over-time samples are in the archive. No budget raised, no sub-ms miss waived, and no speculative policy patch. Functional state so far: all 83 store tests, including crash recovery, pass on both build VMs. Workspace clippy passes with `-D warnings`. The fresh x86 workspace test/release job is still running; final result will be appended. File-size lint fails identically on unchanged dev and candidate as already recorded. An invalid shared debug-cache result was discarded; current x86 tests use a fresh target and include all 83 cases. measurement gates, predeclared in #1051 comment 91768. positive deltas above the measured control allowance fail. static/workspace gate state is reported separately. save arms: | arm | side | saves | save p50 | p95 | p99 | MAX (ms) | retries | |---|---|---:|---:|---:|---:|---:|---:| | ctrl-a | dev control | 300 | 24.689 | 33.331 | 43.783 | 165.972 | 0 | | ctrl-b | dev control | 300 | 25.484 | 35.095 | 45.522 | 115.499 | 0 | | 0 | dev | 900 | 23.665 | 33.156 | 42.071 | 125.594 | 0 | | 1 | candidate | 900 | 23.646 | 33.999 | 41.430 | 61.731 | 0 | | 2 | dev | 900 | 24.139 | 32.749 | 42.029 | 69.884 | 0 | | 3 | candidate | 900 | 23.874 | 33.831 | 41.837 | 77.871 | 0 | | 4 | dev | 900 | 23.693 | 32.216 | 43.513 | 60.272 | 0 | | 5 | candidate | 900 | 24.088 | 34.242 | 43.156 | 60.698 | 0 | gate table: | metric | dev | candidate | delta | dev/dev allowance | gate | |---|---:|---:|---:|---:|---| | save p50 | 23.6933 | 23.8738 | +0.762% | 3.222% | pass | | save p95 | 32.7495 | 33.9994 | +3.817% | 5.292% | pass | | save p99 | 42.0711 | 41.8367 | -0.557% | 3.973% | pass | | save median arm MAX | 69.8839 | 61.7306 | -11.667% | 30.411% | pass | | save worst MAX | 125.594 | 77.8714 | -37.997% | 30.411% | pass | | save paired MAX 1 | 125.594 | 61.7306 | -50.849% | 30.411% | pass | | save paired MAX 2 | 69.8839 | 77.8714 | +11.430% | 30.411% | pass | | save paired MAX 3 | 60.2717 | 60.6977 | +0.707% | 30.411% | pass | | save retries | 0 | 0 | +0.000 count | 0.000 count | pass | | journal catch_up_page p50 | 0.171231 | 0.17364 | +1.407% | 4.994% | pass | | journal catch_up_page p95 | 0.207694 | 0.214487 | +3.271% | 11.505% | pass | | journal catch_up_page p99 | 0.244979 | 0.251677 | +2.734% | 12.762% | pass | | journal commit p50 | 0.026309 | 0.0287135 | +9.139% | 1.767% | FAIL | | journal commit p95 | 0.0407415 | 0.0448095 | +9.985% | 8.008% | FAIL | | journal commit p99 | 0.0654275 | 0.068718 | +5.029% | 12.995% | pass | | journal position_head p50 | 4e-05 | 4e-05 | +0.000% | 0.000% | pass | | journal position_head p95 | 4.1e-05 | 4.1e-05 | +0.000% | 0.000% | pass | | journal position_head p99 | 4.1e-05 | 4.1e-05 | +0.000% | 9.000% | pass | | journal position_mid p50 | 4e-05 | 4e-05 | +0.000% | 0.000% | pass | | journal position_mid p95 | 4.1e-05 | 4.1e-05 | +0.000% | 0.000% | pass | | journal position_mid p99 | 4.55e-05 | 4.1e-05 | -9.890% | 0.000% | pass | | smoke home_first_page p50 | 5.92322 | 5.61557 | -5.194% | 19.505% | pass | | smoke home_first_page p95 | 9.03791 | 13.8752 | +53.523% | 19.505% | FAIL | | smoke home_first_page p99 | 9.75078 | 15.7394 | +61.417% | 19.505% | FAIL | | smoke list_page p50 | 0.576631 | 0.59493 | +3.174% | 5.568% | pass | | smoke list_page p95 | 0.765254 | 0.771626 | +0.833% | 11.738% | pass | | smoke list_page p99 | 0.946263 | 0.992905 | +4.929% | 17.125% | pass | | smoke list_tag p50 | 0.698719 | 0.694836 | -0.556% | 3.301% | pass | | smoke list_tag p95 | 0.758521 | 0.762844 | +0.570% | 9.580% | pass | | smoke list_tag p99 | 1.08075 | 1.05859 | -2.050% | 5.865% | pass | | smoke list_title p50 | 0.550932 | 0.542641 | -1.505% | 4.352% | pass | | smoke list_title p95 | 0.632851 | 0.653615 | +3.281% | 8.080% | pass | | smoke list_title p99 | 0.888094 | 0.966161 | +8.790% | 14.109% | pass | | smoke open_api p50 | 0.594904 | 0.575228 | -3.308% | 5.252% | pass | | smoke open_api p95 | 0.730564 | 0.659266 | -9.759% | 7.036% | pass | | smoke open_api p99 | 0.800334 | 0.676122 | -15.520% | 10.713% | pass | | smoke open_note p50 | 0.553613 | 0.546153 | -1.348% | 4.505% | pass | | smoke open_note p95 | 0.659351 | 0.644062 | -2.319% | 10.053% | pass | | smoke open_note p99 | 8.6863 | 8.68669 | +0.004% | 5.506% | pass | | smoke startup_smoke_file_evicted p50 | 7.07783 | 7.11976 | +0.592% | 1.558% | pass | | smoke startup_smoke_file_evicted p95 | 9.26519 | 7.57596 | -18.232% | 1.558% | pass | | smoke startup_smoke_file_evicted p99 | 9.63489 | 9.34312 | -3.028% | 1.558% | pass | | index peak WAL | 4.12003e+06 | 931152 | -3188880.000 bytes | 0.000 bytes | pass | | index checkpoint sync overlaps/1000 saves | 1.11111 | 0 | -1.111 count/1000 | 0.000 count/1000 | pass | | meta peak WAL | 4.12827e+06 | 4.12827e+06 | +0.000 bytes | 0.000 bytes | pass | | meta checkpoint sync overlaps/1000 saves | 10 | 10 | +0.000 count/1000 | 0.000 count/1000 | pass | | history peak WAL | 4.14475e+06 | 4.14475e+06 | +0.000 bytes | 0.000 bytes | pass | | history checkpoint sync overlaps/1000 saves | 0 | 2.22222 | +2.222 count/1000 | 0.000 count/1000 | FAIL | WAL peaks and main-database checkpoint sync overlaps (ordinary WAL durability syncs excluded): | arm | side | index peak bytes | meta peak bytes | history peak bytes | index overlaps | meta overlaps | history overlaps | |---|---|---:|---:|---:|---:|---:|---:| | ctrl-a | control | 2653312 | 4128272 | 4132392 | 0 | 3 | 0 | | ctrl-b | control | 2653312 | 4128272 | 4132392 | 0 | 3 | 0 | | 0 | dev | 4120032 | 4128272 | 4144752 | 1 | 9 | 0 | | 1 | candidate | 931152 | 4128272 | 4144752 | 0 | 9 | 2 | | 2 | dev | 4120032 | 4128272 | 4144752 | 1 | 9 | 0 | | 3 | candidate | 931152 | 4128272 | 4144752 | 0 | 9 | 2 | | 4 | dev | 4120032 | 4128272 | 4144752 | 1 | 9 | 0 | | 5 | candidate | 931152 | 4128272 | 4144752 | 0 | 9 | 2 | Nested phase and fsync intervals are attributed separately in slowest20-per-arm.json/.md. Raw WAL samples are in wal-timeline.csv. No measurement from #1064 is pooled here. MAX attribution, including the two candidate arm maxima that exceed their adjacent dev arm within the declared control spread: | arm / save | total ms | fsync interval union ms | journal write ms | traced SQLite busy wait ms | index checkpoint overlap | last index checkpoint | |---|---:|---:|---:|---:|---|---| | dev 0 / 175 | 125.593 | 121.958 | 0.339 | 0 | none | no explicit idle checkpoint on dev | | candidate 1 / 625 | 61.731 | 30.385 | 0.802 | 0 | none | 5.261 s earlier | | dev 2 / 133 | 69.884 | 65.397 | 0.334 | 0 | none | no explicit idle checkpoint on dev | | candidate 3 / 282 | 77.871 | 74.967 | 0.383 | 0 | none | 16.680 s earlier | | dev 4 / 93 | 60.271 | 55.704 | 0.411 | 0 | none | no explicit idle checkpoint on dev | | candidate 5 / 293 | 60.698 | 55.977 | 0.340 | 0 | none | 18.861 s earlier | The candidate maximum in arm 3 is 11.43% above its adjacent dev maximum, within the predeclared 30.41% MAX control allowance. Its measured delay is filesystem durability: temporary-note fsync 40.394 ms, directory fsync 22.879 ms, and history-WAL flushes 28.760/11.694 ms, which overlap. The union covers 74.967 of 77.871 ms (96.3%). Index write is 0.383 ms; no traced SQLite busy-handler sleep or blocking file-lock wait, and no index checkpoint overlaps the request. These timings identify where the save stalled; they do not establish the host-level reason for those flush latencies or exclude indirect storage effects. The last candidate arm's maximum is 0.71% above its adjacent dev arm, also within control bounds. It includes 35.395 ms of meta refresh, with meta-WAL fsync 29.388 ms and main meta DB fsync 4.689 ms. That is the unchanged native meta checkpoint policy. The worst dev save instead spends 111.809 ms in temporary-note fsync. No median-arm or worst-MAX regression was observed. MAX controls vary by 30.41%, so the raw reductions are observations, not proof that the policy caused all of them. All 20 slowest saves per arm, including the controls and saves below 100 ms, are retained in slowest20-per-arm.json/.md. Spans nest; do not add phase totals or individual overlapping flush durations. Lock timings cover traced SQLite file locks and busy-handler sleeps, not every possible runtime/mutex delay. Remaining failures are not waived: continuous-journal commit p50/p95, cold first-page p95/p99, and six history checkpoint sync overlaps versus zero on dev. The per-command WAL-size metadata preflight is a plausible contributor to the journal cost, but these measurements do not isolate it. The cause of the cold first-page tail regression remains unresolved. No production policy patch followed these failures. [raw measurements, full analysis, WAL CSV, probe sources, diagnostic patches and comparison chart](https://git.kayg.org/attachments/0ae8b05d-c421-4323-a6eb-852c55f52cc5) (SHA-256 `43fba64d9efe45ed41f730a1d4f48025061d65001e2a7fe6fe786c2a76e13738`).
Author
Owner

final x86 functional validation, head 82ecc5a1e95c6febe2eb8241c69db800ac791a00, completed 00:18 IST on 12 november. all build/test commands ran on dev-01 through ~/bin/slot nix develop, with a fresh isolated target and -j4.

command result
cargo fmt --all -- --check pass
node ci/check-file-docs.mjs pass
node ci/check-layers.mjs pass, 35 manifests
cargo test -j4 -p calternal-store -- --test-threads=4 83 passed, zero failed; checkpoint child-process crash included
cargo clippy -j4 --workspace --all-targets -- -D warnings pass
cargo test -j4 --workspace -- --test-threads=4 1,741 passed, zero failed, 22 ignored
cargo build -j4 --release --bin calternal pass
node ci/check-size-budgets.mjs fails identically on dev/candidate in three unchanged files

The 22 ignored cases are retained by name in the evidence; these include perf/stress/internet cases and a child helper. They were not run by the workspace command. The controlled perf workload and its failures remain recorded separately in the full gate report.

Baseline size failures: NoteList.svelte 569/567, fsio/src/lib.rs 576/551, notes/src/home.rs 905/902. No ceilings raised. Dev plus the two new behavior tests fails as intended; both pass on the candidate. The first shared-target verification attempt used a stale dev executable and is explicitly discarded, with its log retained for audit; all candidate claims above use the fresh target.

The job exited 0, its temporary target/Nix scratch were removed, the collector fixture was removed, and no own index1051 build services remain active. The build VM worktree is clean. Both perf holds were already released.

Overall outcome is unchanged: performance gate FAIL, #1080 remains draft; #1064 unchanged. No speculative production patch after the misses. No merge.

raw commands, logs, ignored-case list and cleanup proof, SHA-256 dd91ef61c847a83fe10bae257684a0a1a8c362e960eabfe8ab1f1954b3c83921.

final x86 functional validation, head `82ecc5a1e95c6febe2eb8241c69db800ac791a00`, completed 00:18 IST on 12 november. all build/test commands ran on dev-01 through `~/bin/slot nix develop`, with a fresh isolated target and `-j4`. | command | result | |---|---| | `cargo fmt --all -- --check` | pass | | `node ci/check-file-docs.mjs` | pass | | `node ci/check-layers.mjs` | pass, 35 manifests | | `cargo test -j4 -p calternal-store -- --test-threads=4` | 83 passed, zero failed; checkpoint child-process crash included | | `cargo clippy -j4 --workspace --all-targets -- -D warnings` | pass | | `cargo test -j4 --workspace -- --test-threads=4` | 1,741 passed, zero failed, 22 ignored | | `cargo build -j4 --release --bin calternal` | pass | | `node ci/check-size-budgets.mjs` | fails identically on dev/candidate in three unchanged files | The 22 ignored cases are retained by name in the evidence; these include perf/stress/internet cases and a child helper. They were not run by the workspace command. The controlled perf workload and its failures remain recorded separately in [the full gate report](https://git.kayg.org/kayg/calternal/issues/1051#issuecomment-91879). Baseline size failures: NoteList.svelte 569/567, fsio/src/lib.rs 576/551, notes/src/home.rs 905/902. No ceilings raised. Dev plus the two new behavior tests fails as intended; both pass on the candidate. The first shared-target verification attempt used a stale dev executable and is explicitly discarded, with its log retained for audit; all candidate claims above use the fresh target. The job exited 0, its temporary target/Nix scratch were removed, the collector fixture was removed, and no own index1051 build services remain active. The build VM worktree is clean. Both perf holds were already released. Overall outcome is unchanged: **performance gate FAIL, #1080 remains draft; #1064 unchanged**. No speculative production patch after the misses. No merge. [raw commands, logs, ignored-case list and cleanup proof](https://git.kayg.org/attachments/f98c08df-a91d-4c8f-8363-1b86b9c6bcd6), SHA-256 `dd91ef61c847a83fe10bae257684a0a1a8c362e960eabfe8ab1f1954b3c83921`.
Author
Owner

round 2 of the index-only design: testing the orchestrator’s disk-contention hypothesis before any production patch. correlate explicit background index checkpoint start/end against the cold first-page request, direct journal API commits, SQL journal/history commits, and the six history main-DB sync overlaps. inspect the slowest cold invocations and slowest 20 commits, retaining all intervals and nearest-checkpoint distances.

Existing candidate soak traces contain 27 explicit background index checkpoints across the three arms. Initial correlation finds no overlap with any SQL journal/history commit. Cold/direct-journal phase logs were not retained in round 1, so collect a diagnostic-only controlled run with timestamps and the same fixtures. Diagnostic logging can perturb durations; no new performance gate or causal improvement claim will be based on those times. Retain the unchanged round-1 gate result.

Only if the traces support the contention hypothesis will production scheduling change. Otherwise report disproval/limitations and stop as requested. No delegates, no merge.

round 2 of the index-only design: testing the orchestrator’s disk-contention hypothesis before any production patch. correlate explicit background index checkpoint start/end against the cold first-page request, direct journal API commits, SQL journal/history commits, and the six history main-DB sync overlaps. inspect the slowest cold invocations and slowest 20 commits, retaining all intervals and nearest-checkpoint distances. Existing candidate soak traces contain 27 explicit background index checkpoints across the three arms. Initial correlation finds no overlap with any SQL journal/history commit. Cold/direct-journal phase logs were not retained in round 1, so collect a diagnostic-only controlled run with timestamps and the same fixtures. Diagnostic logging can perturb durations; no new performance gate or causal improvement claim will be based on those times. Retain the unchanged round-1 gate result. Only if the traces support the contention hypothesis will production scheduling change. Otherwise report disproval/limitations and stop as requested. No delegates, no merge.
Author
Owner

round 2 of the index-only design, unchanged production head 82ecc5a1e95c6febe2eb8241c69db800ac791a00: the concurrent background-checkpoint hypothesis is disproved for the traced workload. stopping without a production patch, as requested. #1080 stays draft; the five round-1 perf failures remain blockers. no qualification soak was rerun after this disproval.

correlation candidate coverage overlapping background index checkpoints
fresh cold first-page requests 20 invocations 0; no background checkpoint anywhere in those invocations
fresh measured journal API commits 40,000 commits, 10 invocations 0
retained soak SQL journal commits 2,703 across three arms 0
retained soak SQL history commits 8,121 across three arms 0
retained soak save requests 2,700 0

The retained soak has 27 explicit background PASSIVE checkpoint intervals. Every start/end was joined with request and commit windows; the evidence includes all intervals, not just the slowest. The slowest 20 SQL journal and history commits are retained both per arm and globally, with nearest-checkpoint timestamps/distances. Across each arm’s slowest 20, the closest gaps are 53.658 ms (journal) and 124.673 ms (history); the global slowest-20 journal set’s closest gap is 62.023 ms. The fresh run retains the slowest 20 journal API commits per invocation and across all candidate invocations, plus every cold invocation.

The only background checkpoint in the fresh diagnostics is in journal-4-3-cand: start 1794426291868453, end 1794426291883945 Unix µs. The final measured API commit ended at 1794426291767287, 101.166 ms earlier. It cannot account for those preceding measured commits. Other fresh candidate journal invocations contain no background checkpoint.

The six history main-DB fsyncs that overlapped save requests in round 1 are separate from index checkpoint work:

arm / save history sync start → end (Unix µs) nearest index checkpoint start → end (Unix µs) separation
1 / 743 1794418400425152 → 1794418400437113 1794418391551714 → 1794418391566151 checkpoint ended 8,859.001 ms earlier
1 / 892 1794418430236785 → 1794418430244885 1794418431540638 → 1794418431555414 checkpoint starts 1,295.753 ms later
3 / 743 1794418761471053 → 1794418761482145 1794418752581619 → 1794418752595509 checkpoint ended 8,875.544 ms earlier
3 / 892 1794418791279621 → 1794418791286539 1794418792585314 → 1794418792599291 checkpoint starts 1,298.775 ms later
5 / 743 1794419122469171 → 1794419122480658 1794419113579187 → 1794419113594356 checkpoint ended 8,874.815 ms earlier
5 / 892 1794419152285140 → 1794419152293139 1794419153586840 → 1794419153600235 checkpoint starts 1,293.701 ms later

Protocol: both original server binaries match round 1’s SHA-256 hashes. Diagnostic probes add request/API timestamps and a tracing subscriber for the direct journal path; no production checkpoint policy changes. Probe sources and lockfiles are retained. Build command: ~/bin/slot nix develop on dev-01, then cargo build -j4 --release --offline --features candidate --manifest-path <own-probe>/Cargo.toml for each side. Both succeed. Same fixtures, 40 journal observations and 80 cold/list observations, bracketed dev/dev + ABAB order (candidate 10 journal/20 cold; dev including controls 30 journal/60 cold). All 120 invocations exit successfully and all expected windows are present. Phase coverage is positive on the candidate; the retained soak and the single fresh checkpoint also confirm checkpoint logging works.

The original cold and direct-journal invocations did not retain phase logs, so their precise historical tail events cannot be reconstructed. The fresh diagnostics fill that coverage gap; diagnostic logging changes timing and these durations are not replacement perf gates. These traces rule out the proposed direct overlap for the captured workloads. They do not establish the causes of the five regressions or exclude longer-lived indirect storage effects. No cause is invented, and no warmup/shared-busy-gate/page-policy patch is made without supporting evidence.

FIFO grant 01:11:58 IST on 12 november; both-lock measurement go 01:13:08; completed by 01:20:10; both own units stopped/inactive by 01:20:24. Own PIDs/cgroups are gone. Both fresh perf roots and the fresh build scratch were removed after collection. No own jobs or holds remain. No delegates, no merge. #1064 unchanged.

The round-1 gate table and functional gates remain unchanged. The max-save win does not waive journal commit p50/p95, cold first-page p95/p99 or history overlap failures.

index1051-round2-analysis.tar.gz, SHA-256 77962f0b8100c38498416226c72134624cef9a8654de5682c45a725392137fd8.

raw-diagnostics.tar.gz, SHA-256 7744211b66a920d206a3e21a789cf77688e3af882db1bc9ae067d0cb2e7dcce2.

round 2 of the index-only design, unchanged production head `82ecc5a1e95c6febe2eb8241c69db800ac791a00`: **the concurrent background-checkpoint hypothesis is disproved for the traced workload. stopping without a production patch, as requested.** #1080 stays draft; the five round-1 perf failures remain blockers. no qualification soak was rerun after this disproval. | correlation | candidate coverage | overlapping background index checkpoints | |---|---:|---:| | fresh cold first-page requests | 20 invocations | 0; no background checkpoint anywhere in those invocations | | fresh measured journal API commits | 40,000 commits, 10 invocations | 0 | | retained soak SQL journal commits | 2,703 across three arms | 0 | | retained soak SQL history commits | 8,121 across three arms | 0 | | retained soak save requests | 2,700 | 0 | The retained soak has 27 explicit background PASSIVE checkpoint intervals. Every start/end was joined with request and commit windows; the evidence includes all intervals, not just the slowest. The slowest 20 SQL journal and history commits are retained both per arm and globally, with nearest-checkpoint timestamps/distances. Across each arm’s slowest 20, the closest gaps are 53.658 ms (journal) and 124.673 ms (history); the global slowest-20 journal set’s closest gap is 62.023 ms. The fresh run retains the slowest 20 journal API commits per invocation and across all candidate invocations, plus every cold invocation. The only background checkpoint in the fresh diagnostics is in `journal-4-3-cand`: start `1794426291868453`, end `1794426291883945` Unix µs. The final measured API commit ended at `1794426291767287`, **101.166 ms earlier**. It cannot account for those preceding measured commits. Other fresh candidate journal invocations contain no background checkpoint. The six history main-DB fsyncs that overlapped save requests in round 1 are separate from index checkpoint work: | arm / save | history sync start → end (Unix µs) | nearest index checkpoint start → end (Unix µs) | separation | |---|---|---|---| | 1 / 743 | 1794418400425152 → 1794418400437113 | 1794418391551714 → 1794418391566151 | checkpoint ended 8,859.001 ms earlier | | 1 / 892 | 1794418430236785 → 1794418430244885 | 1794418431540638 → 1794418431555414 | checkpoint starts 1,295.753 ms later | | 3 / 743 | 1794418761471053 → 1794418761482145 | 1794418752581619 → 1794418752595509 | checkpoint ended 8,875.544 ms earlier | | 3 / 892 | 1794418791279621 → 1794418791286539 | 1794418792585314 → 1794418792599291 | checkpoint starts 1,298.775 ms later | | 5 / 743 | 1794419122469171 → 1794419122480658 | 1794419113579187 → 1794419113594356 | checkpoint ended 8,874.815 ms earlier | | 5 / 892 | 1794419152285140 → 1794419152293139 | 1794419153586840 → 1794419153600235 | checkpoint starts 1,293.701 ms later | Protocol: both original server binaries match round 1’s SHA-256 hashes. Diagnostic probes add request/API timestamps and a tracing subscriber for the direct journal path; no production checkpoint policy changes. Probe sources and lockfiles are retained. Build command: `~/bin/slot nix develop` on dev-01, then `cargo build -j4 --release --offline --features candidate --manifest-path <own-probe>/Cargo.toml` for each side. Both succeed. Same fixtures, 40 journal observations and 80 cold/list observations, bracketed dev/dev + ABAB order (candidate 10 journal/20 cold; dev including controls 30 journal/60 cold). All 120 invocations exit successfully and all expected windows are present. Phase coverage is positive on the candidate; the retained soak and the single fresh checkpoint also confirm checkpoint logging works. The original cold and direct-journal invocations did not retain phase logs, so their precise historical tail events cannot be reconstructed. The fresh diagnostics fill that coverage gap; diagnostic logging changes timing and these durations are **not** replacement perf gates. These traces rule out the proposed direct overlap for the captured workloads. They do not establish the causes of the five regressions or exclude longer-lived indirect storage effects. No cause is invented, and no warmup/shared-busy-gate/page-policy patch is made without supporting evidence. FIFO grant 01:11:58 IST on 12 november; both-lock measurement go 01:13:08; completed by 01:20:10; both own units stopped/inactive by 01:20:24. Own PIDs/cgroups are gone. Both fresh perf roots and the fresh build scratch were removed after collection. No own jobs or holds remain. No delegates, no merge. #1064 unchanged. The [round-1 gate table](https://git.kayg.org/kayg/calternal/issues/1051#issuecomment-91879) and [functional gates](https://git.kayg.org/kayg/calternal/issues/1051#issuecomment-91963) remain unchanged. The max-save win does not waive journal commit p50/p95, cold first-page p95/p99 or history overlap failures. [index1051-round2-analysis.tar.gz](https://git.kayg.org/attachments/657c5636-5ace-4af9-8715-797ee8962c5e), SHA-256 `77962f0b8100c38498416226c72134624cef9a8654de5682c45a725392137fd8`. [raw-diagnostics.tar.gz](https://git.kayg.org/attachments/d69f782d-9be5-483c-85e6-78c262141d65), SHA-256 `7744211b66a920d206a3e21a789cf77688e3af882db1bc9ae067d0cb2e7dcce2`.
Author
Owner

Parked (kayg 11-12): both designs (#1064, #1080) cut the worst save ~38% but regress cold first-page / journal commit for unexplained reasons. Revisit with a deeper profiling pass after the Notes Float release. Drafts #1064 and #1080 kept for reference.

Parked (kayg 11-12): both designs (#1064, #1080) cut the worst save ~38% but regress cold first-page / journal commit for unexplained reasons. Revisit with a deeper profiling pass after the Notes Float release. Drafts #1064 and #1080 kept for reference.
Sign in to join this conversation.
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#1051
No description provided.