WIP: storage: checkpoint SQLite WALs between saves (#1051) #1064

Closed
kayg wants to merge 14 commits from storage/wal-checkpoint-off-save-1051 into dev
Owner

Closes #1051. Includes the crash-test race fix tracked in #1060.

SQLite auto-checkpoints ran inside roughly 1.8% of saves. This change schedules checkpoints in quiet gaps between writes. The max and cold-store no-regression gates are not qualified; this PR remains in draft.

Implementation

  • History runs PASSIVE after 100 ms quiet once 100 commits accumulate, or after 1 s idle; after 10 s idle it tries TRUNCATE.
  • The history writer also checkpoints meta.db on a separate connection. The meta commit hook records count and time together. Its deadline must be quiet relative to both the actual meta commit and the latest history write, so an overdue meta checkpoint cannot follow a typing ACK into notes.save.
  • The journal retains its original blocking receiver. After 100 commands, one async task observes the commit count until it stays unchanged for 100 ms, then queues an internal checkpoint. The writer checks the count and empty queue again before doing I/O. A weak sender lets a closing store drain and exit.
  • Meta/history keep a 4096-page (16 MiB) auto-checkpoint backstop. index.db retains dev’s 1000-page backstop. An isolated same-code experiment found that increasing it to 4096 pages slowed continuous commits; lowering only that threshold improved commit p50 by 12.87% versus a +0.51% identical-binary control. Diagnostic.
  • journal_size_limit is 8 MiB. Held readers can prevent checkpoint progress, so thresholds are not hard WAL-size bounds. Sustained writes can still reach SQLite’s backstop.

Per job, policy work is constant: one journal counter increment or a short meta count/time mutex update. No extra OS thread is added; at most one quiet-check task is pending per journal.

Failure cases

Case Effect and recovery Coverage
Continuous writes without a quiet gap SQLite backstop still checkpoints continuous history stream bound
Reader holds an old snapshot PASSIVE can make partial progress; busy truncation retries later, with the ordinary write timeout restored busy truncate / timeout restoration
Late meta observation or recent typing ACK retain the commit timestamp and wait for both quiet deadlines delayed observation / recent ACK tests
Stale journal timer changed count or queued work causes rescheduling without I/O active commit-stream witness test
Store closes with a pending timer weak sender does not keep the writer alive; accepted writes drain shutdown / restore suite
Crash before checkpoint committed WAL frames remain recoverable crash-image recovery test
Upload cleanup removes a listed temp file ignore only NotFound for that temporary name; other errors still fail #1060 repetitions

Correctness on exact head 5dc6bf6fe

On dev-01 through ~/bin/slot nix develop:

  • cargo fmt --check: pass.
  • cargo clippy -j4 --workspace --all-targets -- -D warnings: pass.
  • cargo test -j4 --workspace --no-fail-fast -- --test-threads=4: 1745 passed, 0 failed, 22 ignored, 128 targets, dedicated tmpfs TMPDIR.
  • Both release binaries built and hashes matched after relay to perf-01.
  • Crash test: branch 1/10 failed, dev 1/30 failed with the same listing/metadata race. The narrow test fix passed 20/20. Evidence.
  • One first full run hit an auth-test HTTP 429/200 failure. The complete target then passed 10/10 on branch and 10/10 on dev; the fresh full workspace passed. Tracked in #1065. Gate logs.

Performance: not qualified

Measured against dev 4274dafb4. Each session used plain ~/bin/perf-turn wal1051, both shared-disk locks, hash-verified dev-01 binaries, ABAB with bracketing dev controls, and 20 observations per arm for single-observation startup metrics.

The primary session ran six interleaved 180 s soak arms per side, 5400 saves each, zero retries. Quantiles are medians of per-arm values; worst max is the maximum across all arms.

Primary save soak Dev ms Branch ms Delta
p50 21.081127 20.978183 -0.49%
p95 27.510864 26.854877 -2.38%
p99 37.293473 33.968437 -8.92%
median arm max 64.402611 73.612831 +14.30%
worst max 322.979750 715.105246 +121.41%

The first runner left a trace output path exported, overwriting the standalone branch trace’s raw save timestamps during later arms. That branch join is rejected as final evidence. The aggregate soak metrics remain valid; both sides had identical instrumentation. Full primary tables, controls and diagnostic artifact.

A corrected independent session repeated boot/open/list/cold-store checks and ran three fully traced 180 s arms per side, each with separate save/strace files and an immediate sync-overlap.py check.

Traced confirmation Dev ms Branch ms Delta
save p50 22.281373 21.857012 -1.90%
save p95 32.207544 28.442346 -11.69%
save p99 37.772926 32.651904 -13.56%
median arm max 82.126575 82.691526 +0.69%
worst max 86.568587 105.343872 +21.69%

Across 2700 traced saves per side, dev has 32 main-database sync overlaps, branch 0. Slow branch saves wait on ordinary note-file, directory and history-WAL syncs. No additional main-database checkpoint appears inside those save windows. Nevertheless, the branch max remains above the dev range, so the requested max improvement is not established.

The initial list-tail tilt did not repeat: all three list modes have lower p95/p99 in the confirmation. Open-api p99 is -2.76%, open-note p99 -4.20%, default-list p99 -4.62%, title-list p99 -9.09%, tag-list p99 -3.37%. The primary typing-ACK p99 is -2.98%. Journal commit p50 is flat at 0.026249→0.026189 ms (-0.23%; dev control -0.25%).

Cold-store qualification remains inconclusive. In confirmation, the 1M-row file-evicted open is 0.812381→17.617331 ms at p99, but identical-binary controls themselves differ +666.75% at p99 and +497.00% at p50. The primary session had the opposite tail direction. No cold-store no-regression claim is made.

Background checkpoint work also increases: total traced syncs 13845→14091 (+1.78%), with more frequent history/journal checkpoints. Regular note temp-file sync counts are unchanged; the additional main-database syncs stay outside explicit branch saves. This is a measured cost, not a flat-I/O claim.

All confirmation deltas, paired controls, per-arm values, per-file counts, six reproducible traces and source/hash artifact.

Status: correctness gates pass. Performance is not qualified for the required max/cold-store criteria. Both perf locks are released, all jobs have finished, and no merge has been attempted.

latest focused root-cause capture

head efe825f171a662e9dc719fb326f5cc217aa285f2 adds identical opt-in static phase telemetry on dev and branch. checkpoint policy is unchanged. corrected 3-per-side soak with dev controls retained all 6000 request spans; no save exceeded 100 ms on either side. branch has zero logged checkpoint/request overlaps and zero watched main-database sync overlaps, against 36 watched sync-call overlaps on dev. the earlier 715 ms outlier remains unexplained.

save metric dev ms branch ms delta
p50 22.524692 22.227885 -1.32%
p95 31.937030 29.152558 -8.72%
p99 37.761723 33.094738 -12.36%
median arm max 57.613915 69.854293 +21.25%
worst max 64.794413 85.971916 +32.68%

the max gate still fails. each branch arm maximum is outside the 250 ms checkpoint window. no checkpoint-yield change is justified by this evidence; stopping after the requested diagnostic round for orchestrator decision. complete per-arm and control tables, phase/fsync breakdowns, design note and raw retained capture.

on this diagnostic head, fmt and workspace/all-target clippy pass; targeted checkpoint/queue tests pass 17/17. the 1745-pass full workspace run was on production head 5dc6bf6fe0210c9821781d159ed9075322ee5dd2, before telemetry. no current-head Forgejo check statuses or reviews are recorded. both perf units are inactive and all locks released. PR remains draft and performance is unqualified.

Closes #1051. Includes the crash-test race fix tracked in #1060. SQLite auto-checkpoints ran inside roughly 1.8% of saves. This change schedules checkpoints in quiet gaps between writes. **The max and cold-store no-regression gates are not qualified; this PR remains in draft.** ## Implementation - History runs PASSIVE after 100 ms quiet once 100 commits accumulate, or after 1 s idle; after 10 s idle it tries TRUNCATE. - The history writer also checkpoints meta.db on a separate connection. The meta commit hook records count and time together. Its deadline must be quiet relative to both the actual meta commit and the latest history write, so an overdue meta checkpoint cannot follow a typing ACK into notes.save. - The journal retains its original blocking receiver. After 100 commands, one async task observes the commit count until it stays unchanged for 100 ms, then queues an internal checkpoint. The writer checks the count and empty queue again before doing I/O. A weak sender lets a closing store drain and exit. - Meta/history keep a 4096-page (16 MiB) auto-checkpoint backstop. **index.db retains dev’s 1000-page backstop.** An isolated same-code experiment found that increasing it to 4096 pages slowed continuous commits; lowering only that threshold improved commit p50 by 12.87% versus a +0.51% identical-binary control. [Diagnostic](https://git.kayg.org/kayg/calternal/pulls/1064#issuecomment-89903). - journal_size_limit is 8 MiB. Held readers can prevent checkpoint progress, so thresholds are not hard WAL-size bounds. Sustained writes can still reach SQLite’s backstop. Per job, policy work is constant: one journal counter increment or a short meta count/time mutex update. No extra OS thread is added; at most one quiet-check task is pending per journal. ## Failure cases | Case | Effect and recovery | Coverage | |---|---|---| | Continuous writes without a quiet gap | SQLite backstop still checkpoints | continuous history stream bound | | Reader holds an old snapshot | PASSIVE can make partial progress; busy truncation retries later, with the ordinary write timeout restored | busy truncate / timeout restoration | | Late meta observation or recent typing ACK | retain the commit timestamp and wait for both quiet deadlines | delayed observation / recent ACK tests | | Stale journal timer | changed count or queued work causes rescheduling without I/O | active commit-stream witness test | | Store closes with a pending timer | weak sender does not keep the writer alive; accepted writes drain | shutdown / restore suite | | Crash before checkpoint | committed WAL frames remain recoverable | crash-image recovery test | | Upload cleanup removes a listed temp file | ignore only NotFound for that temporary name; other errors still fail | #1060 repetitions | ## Correctness on exact head 5dc6bf6fe On dev-01 through `~/bin/slot nix develop`: - `cargo fmt --check`: pass. - `cargo clippy -j4 --workspace --all-targets -- -D warnings`: pass. - `cargo test -j4 --workspace --no-fail-fast -- --test-threads=4`: **1745 passed, 0 failed, 22 ignored**, 128 targets, dedicated tmpfs TMPDIR. - Both release binaries built and hashes matched after relay to perf-01. - Crash test: branch 1/10 failed, dev 1/30 failed with the same listing/metadata race. The narrow test fix passed 20/20. [Evidence](https://git.kayg.org/kayg/calternal/issues/1060#issuecomment-89774). - One first full run hit an auth-test HTTP 429/200 failure. The complete target then passed 10/10 on branch and 10/10 on dev; the fresh full workspace passed. Tracked in #1065. [Gate logs](https://git.kayg.org/kayg/calternal/pulls/1064#issuecomment-89929). ## Performance: not qualified Measured against dev `4274dafb4`. Each session used plain `~/bin/perf-turn wal1051`, both shared-disk locks, hash-verified dev-01 binaries, ABAB with bracketing dev controls, and 20 observations per arm for single-observation startup metrics. The primary session ran **six interleaved 180 s soak arms per side**, 5400 saves each, zero retries. Quantiles are medians of per-arm values; worst max is the maximum across all arms. | Primary save soak | Dev ms | Branch ms | Delta | |---|---:|---:|---:| | p50 | 21.081127 | 20.978183 | -0.49% | | p95 | 27.510864 | 26.854877 | -2.38% | | p99 | 37.293473 | 33.968437 | -8.92% | | median arm max | 64.402611 | 73.612831 | +14.30% | | worst max | 322.979750 | 715.105246 | +121.41% | The first runner left a trace output path exported, overwriting the standalone branch trace’s raw save timestamps during later arms. That branch join is rejected as final evidence. The aggregate soak metrics remain valid; both sides had identical instrumentation. [Full primary tables, controls and diagnostic artifact](https://git.kayg.org/kayg/calternal/pulls/1064#issuecomment-89991). A corrected independent session repeated boot/open/list/cold-store checks and ran **three fully traced 180 s arms per side**, each with separate save/strace files and an immediate `sync-overlap.py` check. | Traced confirmation | Dev ms | Branch ms | Delta | |---|---:|---:|---:| | save p50 | 22.281373 | 21.857012 | -1.90% | | save p95 | 32.207544 | 28.442346 | -11.69% | | save p99 | 37.772926 | 32.651904 | -13.56% | | median arm max | 82.126575 | 82.691526 | +0.69% | | worst max | 86.568587 | 105.343872 | +21.69% | Across 2700 traced saves per side, dev has **32 main-database sync overlaps**, branch **0**. Slow branch saves wait on ordinary note-file, directory and history-WAL syncs. No additional main-database checkpoint appears inside those save windows. Nevertheless, the branch max remains above the dev range, so the requested max improvement is not established. The initial list-tail tilt did not repeat: all three list modes have lower p95/p99 in the confirmation. Open-api p99 is -2.76%, open-note p99 -4.20%, default-list p99 -4.62%, title-list p99 -9.09%, tag-list p99 -3.37%. The primary typing-ACK p99 is -2.98%. Journal commit p50 is flat at 0.026249→0.026189 ms (-0.23%; dev control -0.25%). Cold-store qualification remains inconclusive. In confirmation, the 1M-row file-evicted open is 0.812381→17.617331 ms at p99, but identical-binary controls themselves differ +666.75% at p99 and +497.00% at p50. The primary session had the opposite tail direction. No cold-store no-regression claim is made. Background checkpoint work also increases: total traced syncs 13845→14091 (+1.78%), with more frequent history/journal checkpoints. Regular note temp-file sync counts are unchanged; the additional main-database syncs stay outside explicit branch saves. This is a measured cost, not a flat-I/O claim. [All confirmation deltas, paired controls, per-arm values, per-file counts, six reproducible traces and source/hash artifact](https://git.kayg.org/kayg/calternal/pulls/1064#issuecomment-90081). **Status:** correctness gates pass. Performance is not qualified for the required max/cold-store criteria. Both perf locks are released, all jobs have finished, and no merge has been attempted. ## latest focused root-cause capture head `efe825f171a662e9dc719fb326f5cc217aa285f2` adds identical opt-in static phase telemetry on dev and branch. checkpoint policy is unchanged. corrected 3-per-side soak with dev controls retained all 6000 request spans; no save exceeded 100 ms on either side. branch has zero logged checkpoint/request overlaps and zero watched main-database sync overlaps, against 36 watched sync-call overlaps on dev. the earlier 715 ms outlier remains unexplained. | save metric | dev ms | branch ms | delta | |---|---:|---:|---:| | p50 | 22.524692 | 22.227885 | -1.32% | | p95 | 31.937030 | 29.152558 | -8.72% | | p99 | 37.761723 | 33.094738 | -12.36% | | median arm max | 57.613915 | 69.854293 | +21.25% | | worst max | 64.794413 | 85.971916 | +32.68% | **the max gate still fails.** each branch arm maximum is outside the 250 ms checkpoint window. no checkpoint-yield change is justified by this evidence; stopping after the requested diagnostic round for orchestrator decision. [complete per-arm and control tables, phase/fsync breakdowns, design note and raw retained capture](https://git.kayg.org/kayg/calternal/pulls/1064#issuecomment-90240). on this diagnostic head, fmt and workspace/all-target clippy pass; targeted checkpoint/queue tests pass 17/17. the 1745-pass full workspace run was on production head `5dc6bf6fe0210c9821781d159ed9075322ee5dd2`, before telemetry. no current-head Forgejo check statuses or reviews are recorded. both perf units are inactive and all locks released. PR remains draft and performance is unqualified.
kayg added 14 commits 2026-11-10 16:29:53 +00:00
calternal_core::wal decides when a writer loop checkpoints its SQLite WAL
off the write path (#1051): after a quiet 100 ms once 100 commits piled
up, after an idle second for the rest, TRUNCATE after ten idle seconds,
then sleep. SQLite's own auto-checkpoint, which runs inside the commit
that crosses 1,000 pages, stays only as a 16 MiB backstop.

meta.db gets that backstop and counts its writer's commits with a commit
hook, so the Home's history writer can checkpoint it in quiet moments.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The history writer runs calternal_core::wal's policy between jobs: after a
quiet 100 ms once 100 commits piled up, after an idle second for the rest,
TRUNCATE after ten idle seconds, then it sleeps until the next job. It
does the same for the Home's meta.db on its own connection (a PASSIVE
checkpoint never blocks the list's writer), reading the list's commit
count from its commit hook. SQLite's auto-checkpoint stays only as a
16 MiB backstop. Before this, either store checkpointed inside the save
that crossed 1,000 pages (#1051).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The journal writer checkpoints after every 100 commits, once the reply is
out and nothing else is queued, instead of SQLite doing it inside the
commit that crossed 1,000 pages. Auto-checkpoint stays as a 16 MiB
backstop; journal_size_limit cuts the log file back past 8 MiB (#1051).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A commit only appends to the WAL; the main file changes only when a
checkpoint copies pages back. The tests stream writes with gaps shorter
than the quiet window and check the main file is untouched until the
stream stops: history, the note list (checkpointed by the history
writer) and the journal. Also: the WAL stays within the backstop under a
stream with no quiet moment, and a crash image taken before any
checkpoint keeps every committed write.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
test(storage): isolate checkpoint timing fixtures in temporary directories
Some checks failed
CI / server (pull_request) Has been cancelled
CI / rust (pull_request) Has been cancelled
CI / web (pull_request) Has been cancelled
Markdown extraction contract / markdown-native-contract (pull_request) Has been cancelled
Markdown extraction contract / markdown-editor-contract (pull_request) Has been cancelled
93ae82ba04
Author
Owner

Live qualification state (work is continuing):

  • Head: 93ae82ba04. The last commit only isolates test fixtures; production code matches 7ff88807e.
  • Rust gates at 7ff88807e: fmt, clippy, full workspace all pass (1745 passed, 0 failed, 22 ignored). Seven history checkpoint tests and 75 store tests pass. The test-only fixture change still needs its targeted rerun.
  • Failing performance gate: journal commit p50 +10.78% vs control +0.38%; source data and rejected traces are attached to #1051 comment 89816. No final readiness claim.
  • dev-01 train lock is train-1110c, owner PID 2642193. Our queued units are wal1051-cap-build-long2 and wal1051-r5-server-long. Logs: /home/claude/wal1051-run.crMA/cap-build.log and r5-server.log. Both use ~/bin/slot; neither has started compiling yet. No perf lock is held by this lane.
  • The isolated cap experiment is /home/claude/Developer/Worktrees/wal1051-cap.57Vg/tree (detached 7ff88807e, only core BACKSTOP_PAGES changed from 4096 to 1000); probe manifest is /home/claude/Developer/Worktrees/wal1051-cap.57Vg/probe/Cargo.toml, output /home/claude/Developer/Worktrees/wal1051-cap.57Vg/probe-cap1000. It does not change the PR branch. Compare that binary against the branch's ordinary probe-cand, not against a different implementation, to isolate the WAL-size effect.
  • Source binaries are under /home/claude/wal1051-build.sJl1/bin. probe-cand is the ordinary 4096-page 7ff88807e implementation; the queued server build will replace server-cand with the recent-history-ACK guard. Do not reuse the older staged server as the final guarded server.
  • On perf-01, /home/claude/wal1051-perf/cap-check has the runner/measurement scripts ready; stage/hash both experimental binaries before starting plain ~/bin/perf-turn wal1051. The measurement requires the normal perf-02 lock handshake too.
  • Control scratch is /tmp/wal1051-final.ZMCO; runner-final-template.py also corrects nearest-rank aggregation for single-observation first-token and first-page metrics. Final qualification still needs one fresh session with journal/startup/room ABAB and dev controls, boot plus open/list smoke, twelve interleaved 180 s soak arms (six per side), and a current-head traced pair. The fixed dev baseline is 4274dafb4. Current dev's subsequent commits do not change the Rust/Cargo paths involved here; a merge-tree check is clean.
Live qualification state (work is continuing): - Head: 93ae82ba043eada4b86dcc35faf939d59e3340d5. The last commit only isolates test fixtures; production code matches 7ff88807e. - Rust gates at 7ff88807e: fmt, clippy, full workspace all pass (1745 passed, 0 failed, 22 ignored). Seven history checkpoint tests and 75 store tests pass. The test-only fixture change still needs its targeted rerun. - Failing performance gate: journal commit p50 +10.78% vs control +0.38%; source data and rejected traces are attached to #1051 comment 89816. No final readiness claim. - dev-01 train lock is train-1110c, owner PID 2642193. Our queued units are wal1051-cap-build-long2 and wal1051-r5-server-long. Logs: /home/claude/wal1051-run.crMA/cap-build.log and r5-server.log. Both use ~/bin/slot; neither has started compiling yet. No perf lock is held by this lane. - The isolated cap experiment is /home/claude/Developer/Worktrees/wal1051-cap.57Vg/tree (detached 7ff88807e, only core BACKSTOP_PAGES changed from 4096 to 1000); probe manifest is /home/claude/Developer/Worktrees/wal1051-cap.57Vg/probe/Cargo.toml, output /home/claude/Developer/Worktrees/wal1051-cap.57Vg/probe-cap1000. It does not change the PR branch. Compare that binary against the branch's ordinary probe-cand, not against a different implementation, to isolate the WAL-size effect. - Source binaries are under /home/claude/wal1051-build.sJl1/bin. probe-cand is the ordinary 4096-page 7ff88807e implementation; the queued server build will replace server-cand with the recent-history-ACK guard. Do not reuse the older staged server as the final guarded server. - On perf-01, /home/claude/wal1051-perf/cap-check has the runner/measurement scripts ready; stage/hash both experimental binaries before starting plain ~/bin/perf-turn wal1051. The measurement requires the normal perf-02 lock handshake too. - Control scratch is /tmp/wal1051-final.ZMCO; runner-final-template.py also corrects nearest-rank aggregation for single-observation first-token and first-page metrics. Final qualification still needs one fresh session with journal/startup/room ABAB and dev controls, boot plus open/list smoke, twelve interleaved 180 s soak arms (six per side), and a current-head traced pair. The fixed dev baseline is 4274dafb4. Current dev's subsequent commits do not change the Rust/Cargo paths involved here; a merge-tree check is clean.
Author
Owner

isolated wal-size diagnostic completed in a plain perf-turn wal1051 turn with both shared-disk locks. ordinary 7ff88807e (4096-page backstop) versus the same code with only BACKSTOP_PAGES=1000; five ABAB cycles, bracketing identical-binary controls. neither side is dev, so this isolates the cause rather than serving as final qualification.

metric quantile 4096 pages ms 1000 pages ms delta control delta
commit p50 0.029856 0.026014 -12.87% +0.51%
commit p95 0.045430 0.039660 -12.70% +1.22%
commit p99 0.063159 0.059381 -5.98% +0.05%
catch-up p50 0.170645 0.167094 -2.08% -1.52%
catch-up p95 0.209353 0.202194 -3.42% +1.03%
catch-up p99 0.240912 0.229074 -4.91% -1.92%

decision: 5dc6bf6fe retains dev’s 1000-page index.db backstop while leaving meta/history at 4096 pages. quiet journal checkpoints remain. this avoids enlarging the WAL during continuous bulk commits; ordinary 200 ms save streams can still checkpoint between saves. a held reader may prevent progress at either threshold. this deliberately replaces the initial uniform 16 MiB design, supported by the isolated result above.

seven history checkpoint tests passed at 93ae82ba0. fresh full gates and both release binaries are now running on 5dc6bf6fe. final qualification remains pending, pr stays draft. both diagnostic perf locks are released.

isolated wal-size diagnostic completed in a plain `perf-turn wal1051` turn with both shared-disk locks. ordinary 7ff88807e (4096-page backstop) versus the same code with only BACKSTOP_PAGES=1000; five ABAB cycles, bracketing identical-binary controls. neither side is dev, so this isolates the cause rather than serving as final qualification. | metric | quantile | 4096 pages ms | 1000 pages ms | delta | control delta | |---|---|---:|---:|---:|---:| | commit | p50 | 0.029856 | 0.026014 | -12.87% | +0.51% | | commit | p95 | 0.045430 | 0.039660 | -12.70% | +1.22% | | commit | p99 | 0.063159 | 0.059381 | -5.98% | +0.05% | | catch-up | p50 | 0.170645 | 0.167094 | -2.08% | -1.52% | | catch-up | p95 | 0.209353 | 0.202194 | -3.42% | +1.03% | | catch-up | p99 | 0.240912 | 0.229074 | -4.91% | -1.92% | decision: 5dc6bf6fe retains dev’s 1000-page index.db backstop while leaving meta/history at 4096 pages. quiet journal checkpoints remain. this avoids enlarging the WAL during continuous bulk commits; ordinary 200 ms save streams can still checkpoint between saves. a held reader may prevent progress at either threshold. this deliberately replaces the initial uniform 16 MiB design, supported by the isolated result above. seven history checkpoint tests passed at 93ae82ba0. fresh full gates and both release binaries are now running on 5dc6bf6fe. final qualification remains pending, pr stays draft. both diagnostic perf locks are released.
Author
Owner

fresh correctness gates on exact head 5dc6bf6fe0, dev-01 through ~/bin/slot nix develop:

  • cargo fmt --check: pass.
  • cargo clippy -j4 --workspace --all-targets -- -D warnings: pass.
  • cargo test -j4 --workspace --no-fail-fast -- --test-threads=4: fresh rerun pass, 1745 passed, 0 failed, 22 ignored, 128 targets; dedicated tmpfs TMPDIR.
  • both optimized release binaries built successfully; hashes checked after relay to perf-01.

first full attempt had one auth test failure (HTTP429 versus200); complete target then passed ten times on branch and ten on dev. tracked in #1065; fresh full workspace passes. the earlier crash race is #1060, reproduced both sides and fixed with 20/20 repetitions.

current-head trace: dev has12 watched main-db syncs overlapping explicit saves, branch has0 in900 saves each. final matrix/12-arm soak is still running; no final performance claim yet. gate logs attached.

fresh correctness gates on exact head 5dc6bf6fe0210c9821781d159ed9075322ee5dd2, dev-01 through `~/bin/slot nix develop`: - `cargo fmt --check`: pass. - `cargo clippy -j4 --workspace --all-targets -- -D warnings`: pass. - `cargo test -j4 --workspace --no-fail-fast -- --test-threads=4`: fresh rerun pass, **1745 passed, 0 failed, 22 ignored**, 128 targets; dedicated tmpfs TMPDIR. - both optimized release binaries built successfully; hashes checked after relay to perf-01. first full attempt had one auth test failure (HTTP429 versus200); complete target then passed ten times on branch and ten on dev. tracked in #1065; fresh full workspace passes. the earlier crash race is #1060, reproduced both sides and fixed with 20/20 repetitions. current-head trace: dev has12 watched main-db syncs overlapping explicit saves, branch has0 in900 saves each. final matrix/12-arm soak is still running; no final performance claim yet. gate logs attached.
Author
Owner

twelve-arm soak completed at5dc6bf6fe: six arms per side, 5400 saves each, zero retries. median per-arm p50 21.0811→20.9782ms (-0.49%), p95 27.5109→26.8549ms (-2.38%), p99 37.2935→33.9684ms (-8.92%). max is not qualified: dev arm range63.97–322.98ms, branch46.08–715.11ms. slow bursts appeared in both sides late in the session; they are not accepted as noise without confirmation.

evidence correction: the first runner left P928_SOAK_TRACE exported after its standalone traced pair. later soak arms therefore reused that output path, overwriting the branch traced pair’s raw save timestamps. the overlap text had been calculated correctly before overwrite (dev12, branch0), but its branch join cannot now be reproduced from the raw files. do not treat that pair as final trace evidence. full soak JSON metrics remain intact and valid; both sides had identical instrumentation.

the corrected confirmation runner gives each soak arm separate save/strace files and checks each join immediately. it is queued through plain perf-turn wal1051 with three traced arms per side, plus repeated boot/open/list/cold-store checks. no perf locks held while waiting. pr stays draft.

twelve-arm soak completed at5dc6bf6fe: six arms per side, 5400 saves each, zero retries. median per-arm p50 21.0811→20.9782ms (-0.49%), p95 27.5109→26.8549ms (-2.38%), p99 37.2935→33.9684ms (-8.92%). max is not qualified: dev arm range63.97–322.98ms, branch46.08–715.11ms. slow bursts appeared in both sides late in the session; they are not accepted as noise without confirmation. evidence correction: the first runner left P928_SOAK_TRACE exported after its standalone traced pair. later soak arms therefore reused that output path, overwriting the branch traced pair’s raw save timestamps. the overlap text had been calculated correctly before overwrite (dev12, branch0), but its branch join cannot now be reproduced from the raw files. do not treat that pair as final trace evidence. full soak JSON metrics remain intact and valid; both sides had identical instrumentation. the corrected confirmation runner gives each soak arm separate save/strace files and checks each join immediately. it is queued through plain perf-turn wal1051 with three traced arms per side, plus repeated boot/open/list/cold-store checks. no perf locks held while waiting. pr stays draft.
Author
Owner

r6 complete measurement tables, exact head 5dc6bf6fe0210c9821781d159ed9075322ee5dd2 vs dev 4274dafb4. all values are ms. this session is not a passing qualification: the max exceeds the dev range, and list tails need confirmation. r7 is queued with separate raw traces for every soak arm.

soak metric dev median of 6 arms branch median of 6 arms delta
p50 21.081127 20.978183 -0.49%
p95 27.510864 26.854877 -2.38%
p99 37.293473 33.968437 -8.92%
max 64.402611 73.612831 +14.30%

each arm lasted180s,900saves,zero retries. max is judged against the dev range, not its median. dev63.97–322.98ms; branch46.08–715.11ms.

pair dev p50 branch p50 dev p95 branch p95 dev p99 branch p99 dev max branch max
1 21.129 20.937 27.180 28.269 35.713 32.841 64.153 49.288
2 21.068 21.035 28.301 26.791 36.900 33.184 64.330 64.094
3 21.030 20.961 29.658 26.667 39.694 34.273 63.969 46.082
4 21.150 21.127 26.772 27.996 38.190 33.664 73.106 83.131
5 21.094 20.995 27.842 26.919 37.687 36.750 64.475 345.813
6 20.957 20.880 25.870 25.708 36.393 34.560 322.980 715.105

matrix abab with bracketing dev-vs-dev controls:

metric quantile dev branch delta paired delta control delta control paired range
catch_up_page p50 0.164709 0.167468 +1.68% +0.21% -0.03% -11.03..+7.89%
catch_up_page p95 0.198792 0.197530 -0.63% +1.77% -1.26% -26.71..+15.78%
catch_up_page p99 0.225938 0.230292 +1.93% +4.25% +1.32% -31.77..+179.03%
commit p50 0.026249 0.026189 -0.23% -0.17% -0.25% -7.46..+3.75%
commit p95 0.040702 0.040942 +0.59% +1.41% +1.29% -20.22..+10.98%
commit p99 0.058701 0.061911 +5.47% +3.29% +5.70% -32.42..+22.92%
position_head p50 0.000040 0.000040 +0.00% +0.00% +0.00% +0.00..+0.00%
position_head p95 0.000041 0.000041 +0.00% +0.00% +0.00% +0.00..+0.00%
position_head p99 0.000041 0.000050 +21.95% +21.95% +0.00% +0.00..+21.95%
position_mid p50 0.000040 0.000040 +0.00% +0.00% +0.00% +0.00..+0.00%
position_mid p95 0.000041 0.000041 +0.00% +0.00% +0.00% -18.00..+0.00%
position_mid p99 0.000041 0.000041 +0.00% +0.00% +0.00% -18.00..+21.95%
startup_1m_file_evicted p50 0.686487 0.677267 -1.34% -6.65% +6.12% -92.75..+1070.44%
startup_1m_file_evicted p95 8.381758 2.141042 -74.46% -6.65% -66.57% -92.75..+1070.44%
startup_1m_file_evicted p99 12.575148 7.959021 -36.71% -6.65% -36.26% -92.75..+1070.44%
first_token_existing p50 1.139554 0.997579 -12.46% -12.95% -2.39% -59.31..+191.81%
first_token_existing p95 1.969285 1.480357 -24.83% -12.95% +1.40% -59.31..+191.81%
first_token_existing p99 10.956449 2.549177 -76.73% -12.95% +5.84% -59.31..+191.81%
first_token_fresh p50 60.473818 60.769959 +0.49% +1.25% +0.09% -33.53..+10.44%
first_token_fresh p95 62.255717 74.605646 +19.84% +1.25% -14.92% -33.53..+10.44%
first_token_fresh p99 63.788921 84.157501 +31.93% +1.25% -22.23% -33.53..+10.44%
notes_save p50 20.716735 21.168143 +2.18% +1.30% +1.06% -12.36..+7.66%
notes_save p95 28.246118 29.697423 +5.14% +0.81% +4.76% -17.55..+185.31%
notes_save p99 31.951955 32.905056 +2.98% +3.32% +17.99% -17.00..+124.60%
reconnect_ready p50 0.296276 0.290475 -1.96% +1.40% -0.44% -18.22..+14.62%
reconnect_ready p95 0.360517 0.378751 +5.06% +7.81% -1.60% -44.33..+20.91%
reconnect_ready p99 0.405506 0.417529 +2.96% +3.04% -8.45% -79.30..+71.37%
save_ack p50 7.031900 6.997989 -0.48% -0.37% -0.10% -4.61..+5.16%
save_ack p95 8.624416 8.683142 +0.68% +3.11% +0.41% -20.17..+11.28%
save_ack p99 11.268505 10.932163 -2.98% -2.63% -2.08% -36.55..+31.49%
startup_healthz p50 86.005259 84.826924 -1.37% -1.26% -2.51% -10.69..+4.91%
startup_healthz p95 92.711006 96.749086 +4.36% -1.26% -0.47% -10.69..+4.91%
startup_healthz p99 93.222088 104.816958 +12.44% -1.26% -0.73% -10.69..+4.91%
startup_healthz_existing p50 4.965282 5.006770 +0.84% -0.19% +0.97% -16.33..+17.97%
startup_healthz_existing p95 5.852524 6.714517 +14.73% -0.19% -0.29% -16.33..+17.97%
startup_healthz_existing p99 8.168822 7.057610 -13.60% -0.19% -3.88% -16.33..+17.97%
sync_round_trip p50 0.209448 0.214722 +2.52% +2.36% -1.04% -15.06..+20.46%
sync_round_trip p95 0.333446 0.338536 +1.53% +2.05% -1.62% -10.79..+10.01%
sync_round_trip p99 0.379768 0.385929 +1.62% +4.61% -1.69% -54.42..+23.29%

boot abab with bracketing dev-vs-dev controls:

metric quantile dev branch delta paired delta control delta control paired range
first_token_existing p50 0.727545 0.790990 +8.72% +6.35% +1.79% -24.94..+25.76%
first_token_existing p95 0.891763 0.965581 +8.28% +6.35% +7.88% -24.94..+25.76%
first_token_existing p99 0.907492 0.969929 +6.88% +6.35% +1.76% -24.94..+25.76%
first_token_fresh p50 61.023335 60.907841 -0.19% +0.92% +1.86% -63.64..+14.80%
first_token_fresh p95 65.540857 65.705665 +0.25% +0.92% +2.57% -63.64..+14.80%
first_token_fresh p99 70.053832 67.740395 -3.30% +0.92% -54.91% -63.64..+14.80%
startup_healthz p50 87.530595 88.492621 +1.10% +2.89% +1.47% -17.95..+201.10%
startup_healthz p95 100.679845 103.604161 +2.90% +2.89% +1.23% -17.95..+201.10%
startup_healthz p99 118.145050 104.648998 -11.42% +2.89% +127.11% -17.95..+201.10%
startup_healthz_existing p50 4.866089 4.889172 +0.47% +0.69% +1.30% -8.73..+30.38%
startup_healthz_existing p95 5.007543 5.287358 +5.59% +0.69% -1.97% -8.73..+30.38%
startup_healthz_existing p99 5.212127 5.476344 +5.07% +0.69% +18.03% -8.73..+30.38%

smoke abab with bracketing dev-vs-dev controls:

metric quantile dev branch delta paired delta control delta control paired range
home_first_page p50 5.293178 4.249812 -19.71% -25.53% +10.97% -67.77..+216.13%
home_first_page p95 10.899230 6.395814 -41.32% -25.53% +19.87% -67.77..+216.13%
home_first_page p99 13.130950 8.920880 -32.06% -25.53% +10.57% -67.77..+216.13%
list_page p50 0.573936 0.572679 -0.22% +0.47% -0.95% -9.65..+7.03%
list_page p95 0.725090 0.767960 +5.91% +6.17% -2.93% -24.21..+14.13%
list_page p99 0.842521 0.939777 +11.54% +2.58% -0.54% -30.49..+87.72%
list_tag p50 0.685871 0.694147 +1.21% +1.85% -0.95% -6.66..+13.93%
list_tag p95 0.746646 0.810846 +8.60% +11.50% -0.02% -53.25..+59.76%
list_tag p99 1.040141 1.125381 +8.20% +6.39% -5.82% -67.01..+57.29%
list_title p50 0.533791 0.533666 -0.02% +2.02% -0.58% -11.96..+9.80%
list_title p95 0.624856 0.673693 +7.82% +10.80% -0.94% -21.29..+41.55%
list_title p99 0.788614 0.907663 +15.10% +18.20% +3.59% -43.52..+214.77%
open_api p50 0.546485 0.538109 -1.53% -3.82% -0.89% -14.71..+14.88%
open_api p95 0.628208 0.615675 -2.00% -3.35% -2.54% -30.44..+31.82%
open_api p99 0.650551 0.643262 -1.12% -0.18% -3.54% -42.42..+40.43%
open_note p50 0.485530 0.499402 +2.86% +1.60% -2.56% -12.96..+10.32%
open_note p95 0.629296 0.628834 -0.07% -0.10% -2.86% -48.88..+323.94%
open_note p99 8.668022 8.349179 -3.68% -0.20% -0.77% -66.06..+31.28%
startup_smoke_file_evicted p50 7.065767 7.103668 +0.54% +0.68% -1.45% -30.15..+47.94%
startup_smoke_file_evicted p95 7.268415 7.565680 +4.09% +0.68% +14.48% -30.15..+47.94%
startup_smoke_file_evicted p99 7.437057 7.643809 +2.78% +0.68% +21.79% -30.15..+47.94%

startup, first-token and first-page tails use nearest-rank over20 independent observations per candidate arm. other rows use median per-run quantiles. the controls show wide variability; the upward list tails are being independently repeated.

artifact warning: r6 branch standalone trace timestamps were overwritten by the stale trace environment variable. its saved overlap text was calculated before overwrite, but the branch raw join cannot be reproduced. do not use that pair as final evidence. r7 fixes the path handling and traces every confirmation arm.

r6 complete measurement tables, exact head `5dc6bf6fe0210c9821781d159ed9075322ee5dd2` vs dev `4274dafb4`. all values are ms. this session is **not a passing qualification**: the max exceeds the dev range, and list tails need confirmation. r7 is queued with separate raw traces for every soak arm. | soak metric | dev median of 6 arms | branch median of 6 arms | delta | |---|---:|---:|---:| | p50 | 21.081127 | 20.978183 | -0.49% | | p95 | 27.510864 | 26.854877 | -2.38% | | p99 | 37.293473 | 33.968437 | -8.92% | | max | 64.402611 | 73.612831 | +14.30% | each arm lasted180s,900saves,zero retries. max is judged against the dev range, not its median. dev63.97–322.98ms; branch46.08–715.11ms. | pair | dev p50 | branch p50 | dev p95 | branch p95 | dev p99 | branch p99 | dev max | branch max | |---|---:|---:|---:|---:|---:|---:|---:|---:| | 1 | 21.129 | 20.937 | 27.180 | 28.269 | 35.713 | 32.841 | 64.153 | 49.288 | | 2 | 21.068 | 21.035 | 28.301 | 26.791 | 36.900 | 33.184 | 64.330 | 64.094 | | 3 | 21.030 | 20.961 | 29.658 | 26.667 | 39.694 | 34.273 | 63.969 | 46.082 | | 4 | 21.150 | 21.127 | 26.772 | 27.996 | 38.190 | 33.664 | 73.106 | 83.131 | | 5 | 21.094 | 20.995 | 27.842 | 26.919 | 37.687 | 36.750 | 64.475 | 345.813 | | 6 | 20.957 | 20.880 | 25.870 | 25.708 | 36.393 | 34.560 | 322.980 | 715.105 | matrix abab with bracketing dev-vs-dev controls: | metric | quantile | dev | branch | delta | paired delta | control delta | control paired range | |---|---|---:|---:|---:|---:|---:|---:| | catch_up_page | p50 | 0.164709 | 0.167468 | +1.68% | +0.21% | -0.03% | -11.03..+7.89% | | catch_up_page | p95 | 0.198792 | 0.197530 | -0.63% | +1.77% | -1.26% | -26.71..+15.78% | | catch_up_page | p99 | 0.225938 | 0.230292 | +1.93% | +4.25% | +1.32% | -31.77..+179.03% | | commit | p50 | 0.026249 | 0.026189 | -0.23% | -0.17% | -0.25% | -7.46..+3.75% | | commit | p95 | 0.040702 | 0.040942 | +0.59% | +1.41% | +1.29% | -20.22..+10.98% | | commit | p99 | 0.058701 | 0.061911 | +5.47% | +3.29% | +5.70% | -32.42..+22.92% | | position_head | p50 | 0.000040 | 0.000040 | +0.00% | +0.00% | +0.00% | +0.00..+0.00% | | position_head | p95 | 0.000041 | 0.000041 | +0.00% | +0.00% | +0.00% | +0.00..+0.00% | | position_head | p99 | 0.000041 | 0.000050 | +21.95% | +21.95% | +0.00% | +0.00..+21.95% | | position_mid | p50 | 0.000040 | 0.000040 | +0.00% | +0.00% | +0.00% | +0.00..+0.00% | | position_mid | p95 | 0.000041 | 0.000041 | +0.00% | +0.00% | +0.00% | -18.00..+0.00% | | position_mid | p99 | 0.000041 | 0.000041 | +0.00% | +0.00% | +0.00% | -18.00..+21.95% | | startup_1m_file_evicted | p50 | 0.686487 | 0.677267 | -1.34% | -6.65% | +6.12% | -92.75..+1070.44% | | startup_1m_file_evicted | p95 | 8.381758 | 2.141042 | -74.46% | -6.65% | -66.57% | -92.75..+1070.44% | | startup_1m_file_evicted | p99 | 12.575148 | 7.959021 | -36.71% | -6.65% | -36.26% | -92.75..+1070.44% | | first_token_existing | p50 | 1.139554 | 0.997579 | -12.46% | -12.95% | -2.39% | -59.31..+191.81% | | first_token_existing | p95 | 1.969285 | 1.480357 | -24.83% | -12.95% | +1.40% | -59.31..+191.81% | | first_token_existing | p99 | 10.956449 | 2.549177 | -76.73% | -12.95% | +5.84% | -59.31..+191.81% | | first_token_fresh | p50 | 60.473818 | 60.769959 | +0.49% | +1.25% | +0.09% | -33.53..+10.44% | | first_token_fresh | p95 | 62.255717 | 74.605646 | +19.84% | +1.25% | -14.92% | -33.53..+10.44% | | first_token_fresh | p99 | 63.788921 | 84.157501 | +31.93% | +1.25% | -22.23% | -33.53..+10.44% | | notes_save | p50 | 20.716735 | 21.168143 | +2.18% | +1.30% | +1.06% | -12.36..+7.66% | | notes_save | p95 | 28.246118 | 29.697423 | +5.14% | +0.81% | +4.76% | -17.55..+185.31% | | notes_save | p99 | 31.951955 | 32.905056 | +2.98% | +3.32% | +17.99% | -17.00..+124.60% | | reconnect_ready | p50 | 0.296276 | 0.290475 | -1.96% | +1.40% | -0.44% | -18.22..+14.62% | | reconnect_ready | p95 | 0.360517 | 0.378751 | +5.06% | +7.81% | -1.60% | -44.33..+20.91% | | reconnect_ready | p99 | 0.405506 | 0.417529 | +2.96% | +3.04% | -8.45% | -79.30..+71.37% | | save_ack | p50 | 7.031900 | 6.997989 | -0.48% | -0.37% | -0.10% | -4.61..+5.16% | | save_ack | p95 | 8.624416 | 8.683142 | +0.68% | +3.11% | +0.41% | -20.17..+11.28% | | save_ack | p99 | 11.268505 | 10.932163 | -2.98% | -2.63% | -2.08% | -36.55..+31.49% | | startup_healthz | p50 | 86.005259 | 84.826924 | -1.37% | -1.26% | -2.51% | -10.69..+4.91% | | startup_healthz | p95 | 92.711006 | 96.749086 | +4.36% | -1.26% | -0.47% | -10.69..+4.91% | | startup_healthz | p99 | 93.222088 | 104.816958 | +12.44% | -1.26% | -0.73% | -10.69..+4.91% | | startup_healthz_existing | p50 | 4.965282 | 5.006770 | +0.84% | -0.19% | +0.97% | -16.33..+17.97% | | startup_healthz_existing | p95 | 5.852524 | 6.714517 | +14.73% | -0.19% | -0.29% | -16.33..+17.97% | | startup_healthz_existing | p99 | 8.168822 | 7.057610 | -13.60% | -0.19% | -3.88% | -16.33..+17.97% | | sync_round_trip | p50 | 0.209448 | 0.214722 | +2.52% | +2.36% | -1.04% | -15.06..+20.46% | | sync_round_trip | p95 | 0.333446 | 0.338536 | +1.53% | +2.05% | -1.62% | -10.79..+10.01% | | sync_round_trip | p99 | 0.379768 | 0.385929 | +1.62% | +4.61% | -1.69% | -54.42..+23.29% | boot abab with bracketing dev-vs-dev controls: | metric | quantile | dev | branch | delta | paired delta | control delta | control paired range | |---|---|---:|---:|---:|---:|---:|---:| | first_token_existing | p50 | 0.727545 | 0.790990 | +8.72% | +6.35% | +1.79% | -24.94..+25.76% | | first_token_existing | p95 | 0.891763 | 0.965581 | +8.28% | +6.35% | +7.88% | -24.94..+25.76% | | first_token_existing | p99 | 0.907492 | 0.969929 | +6.88% | +6.35% | +1.76% | -24.94..+25.76% | | first_token_fresh | p50 | 61.023335 | 60.907841 | -0.19% | +0.92% | +1.86% | -63.64..+14.80% | | first_token_fresh | p95 | 65.540857 | 65.705665 | +0.25% | +0.92% | +2.57% | -63.64..+14.80% | | first_token_fresh | p99 | 70.053832 | 67.740395 | -3.30% | +0.92% | -54.91% | -63.64..+14.80% | | startup_healthz | p50 | 87.530595 | 88.492621 | +1.10% | +2.89% | +1.47% | -17.95..+201.10% | | startup_healthz | p95 | 100.679845 | 103.604161 | +2.90% | +2.89% | +1.23% | -17.95..+201.10% | | startup_healthz | p99 | 118.145050 | 104.648998 | -11.42% | +2.89% | +127.11% | -17.95..+201.10% | | startup_healthz_existing | p50 | 4.866089 | 4.889172 | +0.47% | +0.69% | +1.30% | -8.73..+30.38% | | startup_healthz_existing | p95 | 5.007543 | 5.287358 | +5.59% | +0.69% | -1.97% | -8.73..+30.38% | | startup_healthz_existing | p99 | 5.212127 | 5.476344 | +5.07% | +0.69% | +18.03% | -8.73..+30.38% | smoke abab with bracketing dev-vs-dev controls: | metric | quantile | dev | branch | delta | paired delta | control delta | control paired range | |---|---|---:|---:|---:|---:|---:|---:| | home_first_page | p50 | 5.293178 | 4.249812 | -19.71% | -25.53% | +10.97% | -67.77..+216.13% | | home_first_page | p95 | 10.899230 | 6.395814 | -41.32% | -25.53% | +19.87% | -67.77..+216.13% | | home_first_page | p99 | 13.130950 | 8.920880 | -32.06% | -25.53% | +10.57% | -67.77..+216.13% | | list_page | p50 | 0.573936 | 0.572679 | -0.22% | +0.47% | -0.95% | -9.65..+7.03% | | list_page | p95 | 0.725090 | 0.767960 | +5.91% | +6.17% | -2.93% | -24.21..+14.13% | | list_page | p99 | 0.842521 | 0.939777 | +11.54% | +2.58% | -0.54% | -30.49..+87.72% | | list_tag | p50 | 0.685871 | 0.694147 | +1.21% | +1.85% | -0.95% | -6.66..+13.93% | | list_tag | p95 | 0.746646 | 0.810846 | +8.60% | +11.50% | -0.02% | -53.25..+59.76% | | list_tag | p99 | 1.040141 | 1.125381 | +8.20% | +6.39% | -5.82% | -67.01..+57.29% | | list_title | p50 | 0.533791 | 0.533666 | -0.02% | +2.02% | -0.58% | -11.96..+9.80% | | list_title | p95 | 0.624856 | 0.673693 | +7.82% | +10.80% | -0.94% | -21.29..+41.55% | | list_title | p99 | 0.788614 | 0.907663 | +15.10% | +18.20% | +3.59% | -43.52..+214.77% | | open_api | p50 | 0.546485 | 0.538109 | -1.53% | -3.82% | -0.89% | -14.71..+14.88% | | open_api | p95 | 0.628208 | 0.615675 | -2.00% | -3.35% | -2.54% | -30.44..+31.82% | | open_api | p99 | 0.650551 | 0.643262 | -1.12% | -0.18% | -3.54% | -42.42..+40.43% | | open_note | p50 | 0.485530 | 0.499402 | +2.86% | +1.60% | -2.56% | -12.96..+10.32% | | open_note | p95 | 0.629296 | 0.628834 | -0.07% | -0.10% | -2.86% | -48.88..+323.94% | | open_note | p99 | 8.668022 | 8.349179 | -3.68% | -0.20% | -0.77% | -66.06..+31.28% | | startup_smoke_file_evicted | p50 | 7.065767 | 7.103668 | +0.54% | +0.68% | -1.45% | -30.15..+47.94% | | startup_smoke_file_evicted | p95 | 7.268415 | 7.565680 | +4.09% | +0.68% | +14.48% | -30.15..+47.94% | | startup_smoke_file_evicted | p99 | 7.437057 | 7.643809 | +2.78% | +0.68% | +21.79% | -30.15..+47.94% | startup, first-token and first-page tails use nearest-rank over20 independent observations per candidate arm. other rows use median per-run quantiles. the controls show wide variability; the upward list tails are being independently repeated. artifact warning: r6 branch standalone trace timestamps were overwritten by the stale trace environment variable. its saved overlap text was calculated before overwrite, but the branch raw join cannot be reproduced. do not use that pair as final evidence. r7 fixes the path handling and traces every confirmation arm.
Author
Owner

r7 confirmation completed on the same source/binaries and boot IDs as r6, through a fresh plain perf-turn wal1051 turn with both shared-disk locks. both locks are released. performance is not qualified; PR stays draft.

all three branch traces have zero main-database sync overlaps across 2700 explicit saves; dev has 32 overlaps (12/10/10). every trace has its own 900-line save file, so all joins are reproducible. the branch’s slowest saves contain ordinary temp-file, directory and history-WAL syncs, with no added main-database checkpoint inside those windows.

traced soak metric dev median of 3 arms, ms branch median of 3 arms, ms delta
p50 22.281373 21.857012 -1.90%
p95 32.207544 28.442346 -11.69%
p99 37.772926 32.651904 -13.56%
max 82.126575 82.691526 +0.69%
pair dev p99 ms branch p99 ms dev max ms branch max ms dev overlaps branch overlaps
1 37.773 32.652 82.127 82.692 12 0
2 37.482 32.069 67.594 59.929 10 0
3 40.419 69.357 86.569 105.344 10 0

all arms: 180 s,900 saves,zero retries. branch max range 59.93–105.34 ms is still above dev 67.59–86.57 ms. the last branch arm also has p99 69.36 ms. the primary twelve-arm median p99 improved 8.92%, but the requested max improvement has not been established.

the initial list-tail tilt did not repeat: all three list modes have lower p95/p99 here. cold-store results remain inconclusive: candidate 1M-store p99 is 17.617 ms versus dev 0.812 ms, while identical-binary controls themselves differ +666.75% at p99 and +497.00% at p50. r6 had the opposite cold-store tail direction. no cold-start no-regression claim is made.

boot abab with bracketing dev-vs-dev controls:

metric quantile dev ms branch ms delta paired delta control delta control paired range
first_token_existing p50 0.811096 0.760497 -6.24% -2.40% +4.50% -94.54..+148.85%
first_token_existing p95 1.162063 0.934697 -19.57% -2.40% +23.28% -94.54..+148.85%
first_token_existing p99 1.211676 1.127848 -6.92% -2.40% -86.68% -94.54..+148.85%
first_token_fresh p50 62.370143 61.628132 -1.19% -0.93% -0.67% -9.80..+34.49%
first_token_fresh p95 68.030400 73.862216 +8.57% -0.93% +4.76% -9.80..+34.49%
first_token_fresh p99 72.952481 79.386192 +8.82% -0.93% +17.50% -9.80..+34.49%
startup_healthz p50 86.326943 85.299959 -1.19% +1.01% -0.38% -21.62..+78.14%
startup_healthz p95 93.779819 103.288227 +10.14% +1.01% -8.64% -21.62..+78.14%
startup_healthz p99 100.414204 115.725487 +15.25% +1.01% +40.25% -21.62..+78.14%
startup_healthz_existing p50 4.893975 4.901158 +0.15% -0.08% +0.31% -14.43..+41.12%
startup_healthz_existing p95 5.158375 6.964180 +35.01% -0.08% +25.34% -14.43..+41.12%
startup_healthz_existing p99 6.015296 7.230510 +20.20% -0.08% +6.09% -14.43..+41.12%

smoke abab with bracketing dev-vs-dev controls:

metric quantile dev ms branch ms delta paired delta control delta control paired range
home_first_page p50 4.172556 4.163354 -0.22% +1.19% -7.46% -56.14..+78.91%
home_first_page p95 9.875878 5.849633 -40.77% +1.19% -5.58% -56.14..+78.91%
home_first_page p99 10.065691 5.891672 -41.47% +1.19% +2.32% -56.14..+78.91%
list_page p50 0.586507 0.583136 -0.57% -0.26% +0.56% -10.67..+16.66%
list_page p95 0.782183 0.773076 -1.16% -3.64% -1.43% -20.44..+27.14%
list_page p99 1.028333 0.980824 -4.62% -5.06% -3.02% -47.96..+69.43%
list_tag p50 0.693887 0.694068 +0.03% -1.32% +1.03% -13.25..+13.11%
list_tag p95 0.787618 0.768528 -2.42% -2.35% +2.19% -30.65..+24.39%
list_tag p99 1.137127 1.098855 -3.37% -4.65% -1.05% -44.14..+24.68%
list_title p50 0.540165 0.532626 -1.40% -0.83% +2.25% -12.53..+22.88%
list_title p95 0.653088 0.631671 -3.28% +2.97% +6.22% -47.51..+37.34%
list_title p99 0.869371 0.790309 -9.09% -3.99% +4.33% -56.08..+41.06%
open_api p50 0.568249 0.555119 -2.31% -1.01% +1.25% -19.38..+13.99%
open_api p95 0.638088 0.618232 -3.11% -3.68% +3.23% -80.21..+19.54%
open_api p99 0.674578 0.655987 -2.76% -1.16% +5.77% -85.59..+51.69%
open_note p50 0.499789 0.493894 -1.18% -0.76% +0.62% -16.17..+11.21%
open_note p95 0.611935 0.609179 -0.45% -0.58% +0.07% -77.12..+144.47%
open_note p99 8.695115 8.330025 -4.20% -3.01% +0.74% -13.05..+30.98%
startup_smoke_file_evicted p50 7.095147 7.109698 +0.21% +0.30% +0.58% -33.05..+40.83%
startup_smoke_file_evicted p95 9.447937 8.201640 -13.19% +0.30% +0.47% -33.05..+40.83%
startup_smoke_file_evicted p99 9.613833 9.384501 -2.39% +0.30% +0.25% -33.05..+40.83%

startup abab with bracketing dev-vs-dev controls:

metric quantile dev ms branch ms delta paired delta control delta control paired range
startup_1m_file_evicted p50 0.638159 0.713170 +11.75% +31.29% +497.00% -24.19..+2236.77%
startup_1m_file_evicted p95 0.751757 17.085094 +2172.69% +31.29% +949.87% -24.19..+2236.77%
startup_1m_file_evicted p99 0.812381 17.617331 +2068.60% +31.29% +666.75% -24.19..+2236.77%

per-file sync counts across all three traced arms per side:

file class dev syncs branch syncs
auth.db 9 9
auth.db-wal 9 9
dir/other 2745 2748
history.db 27 87
history.db-wal 8193 8313
index.db 12 36
index.db-wal 9 57
meta.db 39 36
meta.db-wal 60 54
secrets 30 30
tmpfile 2712 2712

total syncs 13845→14091 (+1.78%). more frequent quiet history/journal checkpoints add background work; regular note temp-file sync counts are unchanged. the extra main-database syncs all remain outside explicit branch saves. this is a measured cost, not a flat-I/O claim.

commands: python3 sync-overlap.py saves-N.jsonl strace-N.txt --watch 'notes/meta.db$|history.db$|index.db$' for N=0..5, with every server invoked through the repository strace-server.sh. both sides use the same static strace and identical secrets arguments. single-observation boot/open tails use 20 observations per arm; each matrix has its own controls.

the issue #260 backup01 Linux benchmark window overlapped late r6 measurements. it is a possible source of shared-host variability, not proof of the cause. r7 also contains ordinary sync bursts. no further code change is justified from these variable tails alone. raw scripts, hashes, per-save times, all six traces and overlap output are attached.

r7 confirmation completed on the same source/binaries and boot IDs as r6, through a fresh plain `perf-turn wal1051` turn with both shared-disk locks. both locks are released. **performance is not qualified; PR stays draft.** all three branch traces have zero main-database sync overlaps across 2700 explicit saves; dev has 32 overlaps (12/10/10). every trace has its own 900-line save file, so all joins are reproducible. the branch’s slowest saves contain ordinary temp-file, directory and history-WAL syncs, with no added main-database checkpoint inside those windows. | traced soak metric | dev median of 3 arms, ms | branch median of 3 arms, ms | delta | |---|---:|---:|---:| | p50 | 22.281373 | 21.857012 | -1.90% | | p95 | 32.207544 | 28.442346 | -11.69% | | p99 | 37.772926 | 32.651904 | -13.56% | | max | 82.126575 | 82.691526 | +0.69% | | pair | dev p99 ms | branch p99 ms | dev max ms | branch max ms | dev overlaps | branch overlaps | |---|---:|---:|---:|---:|---:|---:| | 1 | 37.773 | 32.652 | 82.127 | 82.692 | 12 | 0 | | 2 | 37.482 | 32.069 | 67.594 | 59.929 | 10 | 0 | | 3 | 40.419 | 69.357 | 86.569 | 105.344 | 10 | 0 | all arms: 180 s,900 saves,zero retries. branch max range 59.93–105.34 ms is still above dev 67.59–86.57 ms. the last branch arm also has p99 69.36 ms. the primary twelve-arm median p99 improved 8.92%, but the requested max improvement has not been established. the initial list-tail tilt did not repeat: all three list modes have lower p95/p99 here. cold-store results remain inconclusive: candidate 1M-store p99 is 17.617 ms versus dev 0.812 ms, while identical-binary controls themselves differ +666.75% at p99 and +497.00% at p50. r6 had the opposite cold-store tail direction. no cold-start no-regression claim is made. boot abab with bracketing dev-vs-dev controls: | metric | quantile | dev ms | branch ms | delta | paired delta | control delta | control paired range | |---|---|---:|---:|---:|---:|---:|---:| | first_token_existing | p50 | 0.811096 | 0.760497 | -6.24% | -2.40% | +4.50% | -94.54..+148.85% | | first_token_existing | p95 | 1.162063 | 0.934697 | -19.57% | -2.40% | +23.28% | -94.54..+148.85% | | first_token_existing | p99 | 1.211676 | 1.127848 | -6.92% | -2.40% | -86.68% | -94.54..+148.85% | | first_token_fresh | p50 | 62.370143 | 61.628132 | -1.19% | -0.93% | -0.67% | -9.80..+34.49% | | first_token_fresh | p95 | 68.030400 | 73.862216 | +8.57% | -0.93% | +4.76% | -9.80..+34.49% | | first_token_fresh | p99 | 72.952481 | 79.386192 | +8.82% | -0.93% | +17.50% | -9.80..+34.49% | | startup_healthz | p50 | 86.326943 | 85.299959 | -1.19% | +1.01% | -0.38% | -21.62..+78.14% | | startup_healthz | p95 | 93.779819 | 103.288227 | +10.14% | +1.01% | -8.64% | -21.62..+78.14% | | startup_healthz | p99 | 100.414204 | 115.725487 | +15.25% | +1.01% | +40.25% | -21.62..+78.14% | | startup_healthz_existing | p50 | 4.893975 | 4.901158 | +0.15% | -0.08% | +0.31% | -14.43..+41.12% | | startup_healthz_existing | p95 | 5.158375 | 6.964180 | +35.01% | -0.08% | +25.34% | -14.43..+41.12% | | startup_healthz_existing | p99 | 6.015296 | 7.230510 | +20.20% | -0.08% | +6.09% | -14.43..+41.12% | smoke abab with bracketing dev-vs-dev controls: | metric | quantile | dev ms | branch ms | delta | paired delta | control delta | control paired range | |---|---|---:|---:|---:|---:|---:|---:| | home_first_page | p50 | 4.172556 | 4.163354 | -0.22% | +1.19% | -7.46% | -56.14..+78.91% | | home_first_page | p95 | 9.875878 | 5.849633 | -40.77% | +1.19% | -5.58% | -56.14..+78.91% | | home_first_page | p99 | 10.065691 | 5.891672 | -41.47% | +1.19% | +2.32% | -56.14..+78.91% | | list_page | p50 | 0.586507 | 0.583136 | -0.57% | -0.26% | +0.56% | -10.67..+16.66% | | list_page | p95 | 0.782183 | 0.773076 | -1.16% | -3.64% | -1.43% | -20.44..+27.14% | | list_page | p99 | 1.028333 | 0.980824 | -4.62% | -5.06% | -3.02% | -47.96..+69.43% | | list_tag | p50 | 0.693887 | 0.694068 | +0.03% | -1.32% | +1.03% | -13.25..+13.11% | | list_tag | p95 | 0.787618 | 0.768528 | -2.42% | -2.35% | +2.19% | -30.65..+24.39% | | list_tag | p99 | 1.137127 | 1.098855 | -3.37% | -4.65% | -1.05% | -44.14..+24.68% | | list_title | p50 | 0.540165 | 0.532626 | -1.40% | -0.83% | +2.25% | -12.53..+22.88% | | list_title | p95 | 0.653088 | 0.631671 | -3.28% | +2.97% | +6.22% | -47.51..+37.34% | | list_title | p99 | 0.869371 | 0.790309 | -9.09% | -3.99% | +4.33% | -56.08..+41.06% | | open_api | p50 | 0.568249 | 0.555119 | -2.31% | -1.01% | +1.25% | -19.38..+13.99% | | open_api | p95 | 0.638088 | 0.618232 | -3.11% | -3.68% | +3.23% | -80.21..+19.54% | | open_api | p99 | 0.674578 | 0.655987 | -2.76% | -1.16% | +5.77% | -85.59..+51.69% | | open_note | p50 | 0.499789 | 0.493894 | -1.18% | -0.76% | +0.62% | -16.17..+11.21% | | open_note | p95 | 0.611935 | 0.609179 | -0.45% | -0.58% | +0.07% | -77.12..+144.47% | | open_note | p99 | 8.695115 | 8.330025 | -4.20% | -3.01% | +0.74% | -13.05..+30.98% | | startup_smoke_file_evicted | p50 | 7.095147 | 7.109698 | +0.21% | +0.30% | +0.58% | -33.05..+40.83% | | startup_smoke_file_evicted | p95 | 9.447937 | 8.201640 | -13.19% | +0.30% | +0.47% | -33.05..+40.83% | | startup_smoke_file_evicted | p99 | 9.613833 | 9.384501 | -2.39% | +0.30% | +0.25% | -33.05..+40.83% | startup abab with bracketing dev-vs-dev controls: | metric | quantile | dev ms | branch ms | delta | paired delta | control delta | control paired range | |---|---|---:|---:|---:|---:|---:|---:| | startup_1m_file_evicted | p50 | 0.638159 | 0.713170 | +11.75% | +31.29% | +497.00% | -24.19..+2236.77% | | startup_1m_file_evicted | p95 | 0.751757 | 17.085094 | +2172.69% | +31.29% | +949.87% | -24.19..+2236.77% | | startup_1m_file_evicted | p99 | 0.812381 | 17.617331 | +2068.60% | +31.29% | +666.75% | -24.19..+2236.77% | per-file sync counts across all three traced arms per side: | file class | dev syncs | branch syncs | |---|---:|---:| | auth.db | 9 | 9 | | auth.db-wal | 9 | 9 | | dir/other | 2745 | 2748 | | history.db | 27 | 87 | | history.db-wal | 8193 | 8313 | | index.db | 12 | 36 | | index.db-wal | 9 | 57 | | meta.db | 39 | 36 | | meta.db-wal | 60 | 54 | | secrets | 30 | 30 | | tmpfile | 2712 | 2712 | total syncs 13845→14091 (+1.78%). more frequent quiet history/journal checkpoints add background work; regular note temp-file sync counts are unchanged. the extra main-database syncs all remain outside explicit branch saves. this is a measured cost, not a flat-I/O claim. commands: `python3 sync-overlap.py saves-N.jsonl strace-N.txt --watch 'notes/meta.db$|history.db$|index.db$'` for N=0..5, with every server invoked through the repository `strace-server.sh`. both sides use the same static strace and identical secrets arguments. single-observation boot/open tails use 20 observations per arm; each matrix has its own controls. the issue #260 backup01 Linux benchmark window overlapped late r6 measurements. it is a possible source of shared-host variability, not proof of the cause. r7 also contains ordinary sync bursts. no further code change is justified from these variable tails alone. raw scripts, hashes, per-save times, all six traces and overlap output are attached.
Author
Owner

focused root-cause round requested by kayg: add identical opt-in static phase intervals to baseline and branch, then run three alternating 180 s soak arms per side under strace. join every client save over 100 ms with room/history queue residence, file preparation and placement, SQLite history/journal writes and commits, meta hook duration, and all background checkpoint intervals, including the latest completed checkpoint and its age. timings overlap and will be reported as nested intervals rather than summed. diagnostic logging is explicitly enabled on both sides; no checkpoint policy change until causality is supported. if the slow saves have another cause, post every breakdown plus a short design note and stop this round. performance remains unqualified; no merge.

focused root-cause round requested by kayg: add identical opt-in static phase intervals to baseline and branch, then run three alternating 180 s soak arms per side under strace. join every client save over 100 ms with room/history queue residence, file preparation and placement, SQLite history/journal writes and commits, meta hook duration, and all background checkpoint intervals, including the latest completed checkpoint and its age. timings overlap and will be reported as nested intervals rather than summed. diagnostic logging is explicitly enabled on both sides; no checkpoint policy change until causality is supported. if the slow saves have another cause, post every breakdown plus a short design note and stop this round. performance remains unqualified; no merge.
Author
Owner

focused root-cause round, first capture attempt: phase evidence incomplete, performance remains unqualified. both locks are released, both units are inactive. 3 interleaved 180 s arms per side, 2700 saves each, zero retries, plus two identical-dev 60 s controls. same boot IDs and baseline4274dafb4; diagnostic candidate efe825f171.

the save/strace files are valid and all separate. the disposable probe deletes its fixture itself before returning; the runner tried to copy phase logs afterward, so all phase logs were lost. this was my collector mistake. the phase-file assertion was incorrectly inside if root.exists(), allowing it to be skipped. live phase emission was verified, but retention was not. no queue/hook/checkpoint-duration attribution is claimed from this attempt.

save metric dev ms branch ms delta
p50 22.633550 22.617099 -0.07%
p95 32.573729 29.668294 -8.92%
p99 40.002260 34.689029 -13.28%
median arm max 107.997772 71.141574 -34.13%
worst max 115.874197 81.550954 -29.62%

dev has two request windows over 100 ms, branch zero. the earlier branch tail did not reproduce here, so there is no evidence justifying a checkpoint policy change. this attempt cannot supply the requested full phase breakdown.

capture correction: the strace server wrapper streams phase records into a per-arm file outside the fixture, drains the stream before exiting, and the runner unconditionally verifies at least one save-request phase per measured save. builds are complete; the same verified binaries are re-queued normally behind tiering/mail and the ports lane for the requested complete breakdown. no lock is held while waiting. checkpoint policy is unchanged.

instrumentation checks: cargo fmt --check; cargo clippy -j4 --workspace --all-targets -- -D warnings; cargo test -j4 -p calternal-core -p calternal-notes -p calternal-store checkpoint -- --test-threads=4; cargo test -j4 -p calternal-core room_queue -- --test-threads=4. all through dev-01 slot/Nix. targeted tests17 passed,0 failed. release builds both pass. prior full workspace1745/0/22 was on production head5dc6bf6fe, not rerun for this opt-in logging commit.

attached: every raw timestamp/syscall trace/control, runner and hashes, plus source patches and gate logs. phase absence is explicitly preserved; no logs have been reconstructed or invented.

focused root-cause round, first capture attempt: **phase evidence incomplete, performance remains unqualified**. both locks are released, both units are inactive. 3 interleaved 180 s arms per side, 2700 saves each, zero retries, plus two identical-dev 60 s controls. same boot IDs and baseline4274dafb4; diagnostic candidate efe825f171a662e9dc719fb326f5cc217aa285f2. the save/strace files are valid and all separate. the disposable probe deletes its fixture itself before returning; the runner tried to copy phase logs afterward, so all phase logs were lost. this was my collector mistake. the phase-file assertion was incorrectly inside `if root.exists()`, allowing it to be skipped. live phase emission was verified, but retention was not. no queue/hook/checkpoint-duration attribution is claimed from this attempt. | save metric | dev ms | branch ms | delta | |---|---:|---:|---:| | p50 | 22.633550 | 22.617099 | -0.07% | | p95 | 32.573729 | 29.668294 | -8.92% | | p99 | 40.002260 | 34.689029 | -13.28% | | median arm max | 107.997772 | 71.141574 | -34.13% | | worst max | 115.874197 | 81.550954 | -29.62% | dev has two request windows over 100 ms, branch zero. the earlier branch tail did not reproduce here, so there is no evidence justifying a checkpoint policy change. this attempt cannot supply the requested full phase breakdown. capture correction: the strace server wrapper streams phase records into a per-arm file outside the fixture, drains the stream before exiting, and the runner unconditionally verifies at least one save-request phase per measured save. builds are complete; the same verified binaries are re-queued normally behind tiering/mail and the ports lane for the requested complete breakdown. no lock is held while waiting. checkpoint policy is unchanged. instrumentation checks: `cargo fmt --check`; `cargo clippy -j4 --workspace --all-targets -- -D warnings`; `cargo test -j4 -p calternal-core -p calternal-notes -p calternal-store checkpoint -- --test-threads=4`; `cargo test -j4 -p calternal-core room_queue -- --test-threads=4`. all through dev-01 slot/Nix. targeted tests17 passed,0 failed. release builds both pass. prior full workspace1745/0/22 was on production head5dc6bf6fe, not rerun for this opt-in logging commit. attached: every raw timestamp/syscall trace/control, runner and hashes, plus source patches and gate logs. phase absence is explicitly preserved; no logs have been reconstructed or invented.
Author
Owner

corrected capture scheduling update, 03:34 IST: FIFO granted perf-01, but perf-02 remained held by a preceding session (timeout 5400s ... perf-lock sleep 5400, PID 176130 / flock 176135). no measurement started. i immediately stopped my perf-01 turn and perf-02 waiter; both are inactive. binaries and fail-closed phase collector are ready. no checkpoint policy change. waiting without holding either lock before re-queueing; no other session was stopped.

corrected capture scheduling update, 03:34 IST: FIFO granted perf-01, but perf-02 remained held by a preceding session (`timeout 5400s ... perf-lock sleep 5400`, PID 176130 / flock 176135). no measurement started. i immediately stopped my perf-01 turn and perf-02 waiter; both are inactive. binaries and fail-closed phase collector are ready. no checkpoint policy change. waiting without holding either lock before re-queueing; no other session was stopped.
Author
Owner

corrected focused root-cause capture completed, performance still fails the max gate; PR stays draft. head efe825f171a662e9dc719fb326f5cc217aa285f2, baseline 4274dafb46f03ca23fea1fb76929bb13716af64e with identical opt-in telemetry. no checkpoint policy change. no further measurement or speculative fix is planned in this round; handing the decision back to the orchestrator.

plain ~/bin/perf-turn wal1051, both shared-disk locks, immutable hash-verified binaries already built on dev-01. two 60 s identical-dev controls followed by ABABAB, three 180 s arms per side at 200 ms cadence. 2700 saves per side, zero retries. both units inactive; locks released at 04:03 IST on 11 november. the corrected collector streams phase records outside the disposable fixture, waits for the filter to drain, and unconditionally validates every completed arm. all 6000 measured request windows have matching retained request spans. this capture is separate from the first capture with lost phase files.

quantiles and median arm max below are medians across the three arms. worst max is the maximum across those arms.

save metric dev ms branch ms delta
p50 22.524692 22.227885 -1.32%
p95 31.937030 29.152558 -8.72%
p99 37.761723 33.094738 -12.36%
median arm max 57.613915 69.854293 +21.25%
worst max 64.794413 85.971916 +32.68%
order side saves p50 ms p95 ms p99 ms max ms
0 dev 900 22.496959 31.233831 36.372463 52.593109
1 branch 900 22.651135 29.097611 32.281389 85.971916
2 dev 900 22.545955 31.937030 38.216863 64.794413
3 branch 900 22.227885 29.152558 33.094738 69.854293
4 dev 900 22.524692 32.588246 37.761723 57.613915
5 branch 900 22.222153 31.314866 39.504455 55.316525
ctrl-a ctrl-a 300 24.814219 31.947616 40.033989 51.146366
ctrl-b ctrl-b 300 27.346585 34.433584 42.956545 81.276462

every save over 100 ms: dev 0/2700; branch 0/2700; controls 0/600. the requested >100 ms breakdown set is empty, not missing. the original 715 ms request has not been reproduced or explained. controls show substantial max variation themselves (51.146366 vs 81.276462 ms), which does not waive the no-regression gate.

checkpoint checks: 129 logged background checkpoint passes across the three branch arms; no branch request overlaps any of them. 130/2700 requests begin during or within 250 ms after a pass, but none exceeds 100 ms. each branch arm's maximum is outside that 250 ms window; the latest completed checkpoints precede them by 1471.672 / 3872.186 / 2266.751 ms. repository perf/vm/sync-overlap.py checks show dev 12/12/12 watched main-database sync calls overlapping saves, branch 0/0/0. these are sync-call counts, not save counts. the two dev controls each have three watched overlaps.

supplemental breakdown of each arm's maximum follows, so the retained phase evidence can still be reviewed despite the empty >100 ms set. these are raw request-only windows; reported probe maxima also include about 0.1 ms of bookkeeping. phase intervals nest and must not be added; fsync is the syscall interval union and overlaps phase work. zero meta hook is absent on dev and below 0.001 ms on these branch maxima. full JSON also includes history/journal commit, meta refresh, and each fsync's class/timing.

arm side save total ms room queue history queue file prepare file place journal await/write hook fsync union checkpoint overlap; last gap/duration ms
0 dev 93 52.472 0.007 0.021 13.397 7.208 0.696/0.518 0.000 49.890 0; none
1 branch 142 85.858 0.046 0.138 32.971 31.529 0.163/0.040 0.000 83.011 0; checkpoint.history 1471.672/7.045
2 dev 400 64.680 0.118 0.060 50.511 8.952 0.611/0.402 0.000 61.630 0; none
3 branch 290 69.671 0.008 0.053 9.986 7.393 2.886/0.120 0.000 19.847 0; checkpoint.history 3872.186/7.460
4 dev 93 57.481 0.006 0.026 15.547 7.136 0.643/0.429 0.000 55.062 0; none
5 branch 382 55.187 0.093 0.059 26.141 19.290 0.196/0.045 0.000 52.452 0; checkpoint.history 2266.751/9.332
ctrl-a ctrl-a 93 51.017 0.114 0.068 13.051 6.850 0.729/0.520 0.000 47.285 0; none
ctrl-b ctrl-b 228 81.152 0.036 0.063 17.243 37.284 0.517/0.350 0.000 76.681 0; none

phase intervals nest and overlap. fsync is the union of syscall wait intervals, not an additional cost. hook is absent on dev, shown as zero. raw JSON includes every SQLite commit interval and sync file class.

design note: this round does not support the proposed checkpoint-yield fix. the worst branch request is 85.858 ms, including 83.011 ms of fsync waits on the regular note temp file, directory, and history WAL, with no background checkpoint running or recently completed. the second branch arm's maximum has only 19.847 ms of fsync union and 17.964 ms in meta refresh, so ordinary I/O alone also does not explain every maximum. these observations do not establish the cause of the earlier 715 ms outlier. changing idle scheduling or claiming a page budget would be speculative; SQLite's PASSIVE checkpoint API itself has no native per-call page budget. leave policy unchanged, keep the PR unqualified, and let the orchestrator choose the next design after this third measurement round. open/list/typing/cold start were not rerun in this narrowly requested corrected capture; earlier cold-store qualification remains inconclusive.

checks: diagnostic head: cargo fmt --all -- --check passed; cargo clippy -j4 --workspace --all-targets -- -D warnings passed; cargo test -j4 -p calternal-core -p calternal-notes -p calternal-store checkpoint -- --test-threads=4 plus cargo test -j4 -p calternal-core room_queue -- --test-threads=4: 17 passed, zero failed. full workspace 1745 passed / zero failed / 22 ignored was on production head 5dc6bf6fe0210c9821781d159ed9075322ee5dd2, before telemetry; it was not rerun on the diagnostic head. the corrected collector's dev-01 functional check passed. no merge attempted.

attached evidence includes every raw save, retained phase file, syscall trace, immediate overlap check, source/hash metadata, runner/wrapper/filter and both analysis scripts, gate logs and the comparison chart. no seeded fixture or secret configuration is included.

corrected focused root-cause capture completed, **performance still fails the max gate; PR stays draft**. head `efe825f171a662e9dc719fb326f5cc217aa285f2`, baseline `4274dafb46f03ca23fea1fb76929bb13716af64e` with identical opt-in telemetry. no checkpoint policy change. no further measurement or speculative fix is planned in this round; handing the decision back to the orchestrator. plain `~/bin/perf-turn wal1051`, both shared-disk locks, immutable hash-verified binaries already built on dev-01. two 60 s identical-dev controls followed by ABABAB, three 180 s arms per side at 200 ms cadence. 2700 saves per side, zero retries. both units inactive; locks released at 04:03 IST on 11 november. the corrected collector streams phase records outside the disposable fixture, waits for the filter to drain, and unconditionally validates every completed arm. all 6000 measured request windows have matching retained request spans. this capture is separate from the [first capture with lost phase files](https://git.kayg.org/kayg/calternal/pulls/1064#issuecomment-90139). quantiles and median arm max below are medians across the three arms. worst max is the maximum across those arms. | save metric | dev ms | branch ms | delta | |---|---:|---:|---:| | p50 | 22.524692 | 22.227885 | -1.32% | | p95 | 31.937030 | 29.152558 | -8.72% | | p99 | 37.761723 | 33.094738 | -12.36% | | median arm max | 57.613915 | 69.854293 | +21.25% | | worst max | 64.794413 | 85.971916 | +32.68% | | order | side | saves | p50 ms | p95 ms | p99 ms | max ms | |---|---|---:|---:|---:|---:|---:| | 0 | dev | 900 | 22.496959 | 31.233831 | 36.372463 | 52.593109 | | 1 | branch | 900 | 22.651135 | 29.097611 | 32.281389 | 85.971916 | | 2 | dev | 900 | 22.545955 | 31.937030 | 38.216863 | 64.794413 | | 3 | branch | 900 | 22.227885 | 29.152558 | 33.094738 | 69.854293 | | 4 | dev | 900 | 22.524692 | 32.588246 | 37.761723 | 57.613915 | | 5 | branch | 900 | 22.222153 | 31.314866 | 39.504455 | 55.316525 | | ctrl-a | ctrl-a | 300 | 24.814219 | 31.947616 | 40.033989 | 51.146366 | | ctrl-b | ctrl-b | 300 | 27.346585 | 34.433584 | 42.956545 | 81.276462 | **every save over 100 ms:** dev 0/2700; branch 0/2700; controls 0/600. the requested >100 ms breakdown set is empty, not missing. the original 715 ms request has not been reproduced or explained. controls show substantial max variation themselves (51.146366 vs 81.276462 ms), which does not waive the no-regression gate. **checkpoint checks:** 129 logged background checkpoint passes across the three branch arms; no branch request overlaps any of them. 130/2700 requests begin during or within 250 ms after a pass, but none exceeds 100 ms. each branch arm's maximum is outside that 250 ms window; the latest completed checkpoints precede them by 1471.672 / 3872.186 / 2266.751 ms. repository `perf/vm/sync-overlap.py` checks show dev 12/12/12 watched main-database sync calls overlapping saves, branch 0/0/0. these are sync-call counts, not save counts. the two dev controls each have three watched overlaps. supplemental breakdown of each arm's maximum follows, so the retained phase evidence can still be reviewed despite the empty >100 ms set. these are raw request-only windows; reported probe maxima also include about 0.1 ms of bookkeeping. phase intervals nest and must not be added; fsync is the syscall interval union and overlaps phase work. zero meta hook is absent on dev and below 0.001 ms on these branch maxima. full JSON also includes history/journal commit, meta refresh, and each fsync's class/timing. | arm | side | save | total ms | room queue | history queue | file prepare | file place | journal await/write | hook | fsync union | checkpoint overlap; last gap/duration ms | |---|---|---:|---:|---:|---:|---:|---:|---:|---:|---:|---| | 0 | dev | 93 | 52.472 | 0.007 | 0.021 | 13.397 | 7.208 | 0.696/0.518 | 0.000 | 49.890 | 0; none | | 1 | branch | 142 | 85.858 | 0.046 | 0.138 | 32.971 | 31.529 | 0.163/0.040 | 0.000 | 83.011 | 0; checkpoint.history 1471.672/7.045 | | 2 | dev | 400 | 64.680 | 0.118 | 0.060 | 50.511 | 8.952 | 0.611/0.402 | 0.000 | 61.630 | 0; none | | 3 | branch | 290 | 69.671 | 0.008 | 0.053 | 9.986 | 7.393 | 2.886/0.120 | 0.000 | 19.847 | 0; checkpoint.history 3872.186/7.460 | | 4 | dev | 93 | 57.481 | 0.006 | 0.026 | 15.547 | 7.136 | 0.643/0.429 | 0.000 | 55.062 | 0; none | | 5 | branch | 382 | 55.187 | 0.093 | 0.059 | 26.141 | 19.290 | 0.196/0.045 | 0.000 | 52.452 | 0; checkpoint.history 2266.751/9.332 | | ctrl-a | ctrl-a | 93 | 51.017 | 0.114 | 0.068 | 13.051 | 6.850 | 0.729/0.520 | 0.000 | 47.285 | 0; none | | ctrl-b | ctrl-b | 228 | 81.152 | 0.036 | 0.063 | 17.243 | 37.284 | 0.517/0.350 | 0.000 | 76.681 | 0; none | phase intervals nest and overlap. fsync is the union of syscall wait intervals, not an additional cost. hook is absent on dev, shown as zero. raw JSON includes every SQLite commit interval and sync file class. **design note:** this round does not support the proposed checkpoint-yield fix. the worst branch request is 85.858 ms, including 83.011 ms of fsync waits on the regular note temp file, directory, and history WAL, with no background checkpoint running or recently completed. the second branch arm's maximum has only 19.847 ms of fsync union and 17.964 ms in meta refresh, so ordinary I/O alone also does not explain every maximum. these observations do not establish the cause of the earlier 715 ms outlier. changing idle scheduling or claiming a page budget would be speculative; SQLite's PASSIVE checkpoint API itself has no native per-call page budget. leave policy unchanged, keep the PR unqualified, and let the orchestrator choose the next design after this third measurement round. open/list/typing/cold start were not rerun in this narrowly requested corrected capture; earlier cold-store qualification remains inconclusive. **checks:** diagnostic head: `cargo fmt --all -- --check` passed; `cargo clippy -j4 --workspace --all-targets -- -D warnings` passed; `cargo test -j4 -p calternal-core -p calternal-notes -p calternal-store checkpoint -- --test-threads=4` plus `cargo test -j4 -p calternal-core room_queue -- --test-threads=4`: 17 passed, zero failed. full workspace 1745 passed / zero failed / 22 ignored was on production head `5dc6bf6fe0210c9821781d159ed9075322ee5dd2`, before telemetry; it was not rerun on the diagnostic head. the corrected collector's dev-01 functional check passed. no merge attempted. attached evidence includes every raw save, retained phase file, syscall trace, immediate overlap check, source/hash metadata, runner/wrapper/filter and both analysis scripts, gate logs and the comparison chart. no seeded fixture or secret configuration is included.
Author
Owner

Orchestrator decision (11-11, 04:20 IST): parked as a draft.

The tail improved: p95 −8.7% and p99 −12.4%, with no checkpoint overlap on the branch. But the max regressed after three measurement rounds: median arm max +21% and worst max +33%. The no-regressions rule blocks the merge, and the 3-round limit says to stop patching.

Next is a simpler design, for example moving only the index.db checkpoint off the save path and keeping dev's meta and history behaviour, with the same soak and max gate. That's planned after the morning review; no more perf turns on this branch tonight.

Orchestrator decision (11-11, 04:20 IST): **parked as a draft**. The tail improved: p95 −8.7% and p99 −12.4%, with no checkpoint overlap on the branch. But the max regressed after three measurement rounds: median arm max +21% and worst max +33%. The no-regressions rule blocks the merge, and the 3-round limit says to stop patching. Next is a simpler design, for example moving only the index.db checkpoint off the save path and keeping dev's meta and history behaviour, with the same soak and max gate. That's planned after the morning review; no more perf turns on this branch tonight.
Author
Owner

Superseded by #1080 (fix/1051-index-idle-checkpoint), the simpler index.db-only checkpoint design chosen in the 11-11 orchestrator decision above (this draft was parked after the max-latency gate failed). Head efe825f171a6 preserved at refs/archive/stale-2026-11-14/storage/wal-checkpoint-off-save-1051; closing. Housekeeping 14 Nov.

Superseded by #1080 (`fix/1051-index-idle-checkpoint`), the simpler index.db-only checkpoint design chosen in the 11-11 orchestrator decision above (this draft was parked after the max-latency gate failed). Head `efe825f171a6` preserved at `refs/archive/stale-2026-11-14/storage/wal-checkpoint-off-save-1051`; closing. Housekeeping 14 Nov.
kayg closed this pull request 2026-11-13 19:32:49 +00:00
Some checks failed
CI / server (pull_request) Has been cancelled
CI / rust (pull_request) Has been cancelled
CI / web (pull_request) Has been cancelled
Markdown extraction contract / markdown-native-contract (pull_request) Has been cancelled
Markdown extraction contract / markdown-editor-contract (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!1064
No description provided.