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
pull from: storage/wal-checkpoint-off-save-1051
merge into: kayg:dev
kayg:main
kayg:port/tasks-float-2
kayg:fix/train-1116-2
kayg:fix/train-1116-3
kayg:fix/train-1116-1
kayg:fix/flake-1134
kayg:fix/server-1182
kayg:dev
kayg:port/notes-float-3c
kayg:docs/auto-update-ig
kayg:feat/dav-transport
kayg:port/tasks-float-1
kayg:wip/mail1011-sv-order-1116
kayg:fix/flake-1179
kayg:fix/flake-1178
kayg:fix/guards-1153-fsio-split
kayg:fix/guards-1153-notes-split-we
kayg:fix/guards-1153-notes-lib
kayg:fix/guards-1153-notes-home
kayg:fix/guards-1153-ui-primitives
kayg:fix/guards-1153-primitives-e2e
kayg:fix/guards-1153-visibility-doc
kayg:feat/paper-grey-1116
kayg:fix/flake-1165
kayg:fix/flake-1119
kayg:docs/imap-766-plan-v2
kayg:fix/e2e-unique-ports
kayg:t3/paged-search-reconcile-final
kayg:wip/mail1011-final-1115
kayg:docs/tasks-float-port
kayg:perf/editor-first-paint-1c
kayg:feat/imap-notes-fetch
kayg:feat/imap-notes-projection
kayg:feat/imap-notes-readonly
kayg:feat/imap-notes-auth
kayg:feat/imap-notes-server-foundation
kayg:wip/mail1011-txn-ownvocab-1115
kayg:wip/mail1011-txn-novocab-1115
kayg:perf/p1117-final-harness
kayg:perf/single-shot-repeats
kayg:port/tasks-matrix
kayg:wip/mail1011-txn-1115
kayg:fix/static-gates-1155
kayg:feat/files-s1-identity-r7
kayg:fix/files-r7-idle-loop
kayg:fix/daily-train-1152
kayg:port/notes-float
kayg:fix/editor-tables-test-types
kayg:port/notes-float-listscript
kayg:feat/tasks-actions
kayg:port/notes-float-phone-preload
kayg:perf/sound-comparator
kayg:port/notes-float-listscroll
kayg:port/notes-float-budgets
kayg:port/notes-float-suite-fix-b
kayg:port/notes-float-sidebar-fix
kayg:port/notes-float-trim
kayg:port/notes-float-3-lists
kayg:fix/attachments-meta-capability
kayg:docs/carddav-writes-v2-plan
kayg:feat/contacts-companion-pure
kayg:issue/carddav-read-perf-fix-r2
kayg:issue/carddav-read-r2
kayg:port/notes-float-devsync2
kayg:review/calendar-2
kayg:review/switcher-a-pills
kayg:port/notes-float-switcher-a
kayg:port/port-tables-2
kayg:review/switcher-ends
kayg:wip/whiteboard-s1-1114
kayg:port/port-tables
kayg:wip/mail1011-perfneutral
kayg:review/photo-tint
kayg:port/notes-float-shell
kayg:wip/local/collections-db
kayg:wip/local/mail-p1
kayg:wip/local/cold-growth-on-tiering
kayg:wip/local/tiering-v3-s1
kayg:wip/local/wal1051-cap
kayg:wip/local/tiering-v3-s1-resume
kayg:wip/local/index-position-startup-scan
kayg:port/notes-float-flat
kayg:port/notes-float-promote
kayg:wip/handover/mail1011-candidate
kayg:wip/handover/files-s1-candidate
kayg:port/notes-float-shell-only
kayg:port/notes-float-perf
kayg:feat/whiteboard-s1
kayg:feat/tiering-v5
kayg:fix/app-switch-hitch
kayg:wip/local/files-s1-dev-v4-final
kayg:feat/files-s1-dev-v4
kayg:fix/c2-glass-shared
kayg:feat/flat-lists
kayg:wip/handover/whiteboard-s1-resume
kayg:wip/att-lazy-861
kayg:feat/switcher-browse
kayg:wip/att-lazy-860
kayg:feat/tasks-float
kayg:recovered/flat-backup-candidate
kayg:perf/stalls-1054-kc
kayg:land/ai-toolbar
kayg:feat/collections-db
kayg:feat/collections-db-fixes
kayg:codex/mail-1011-redesign-20261111
kayg:fix/ai-toolbar
kayg:backup/macos-vm/st3-head
kayg:perf/trim-candidate-phonestack
kayg:feat/switcher-three
kayg:fix/1051-index-idle-checkpoint
kayg:perf/stalls-1054-kb
kayg:perf/stalls-1054-k
kayg:perf/stalls-1054-r3
kayg:fix/c2-contrast-tail
kayg:perf/stalls-1054-r3-preview
kayg:feat/collections-before
kayg:feat/tiering-v4
kayg:fix/timelog-caret
kayg:wip/local/tasks-actions
kayg:docs/tasks-writes-v2-plan
kayg:st3-r3
kayg:feat/pass8
kayg:review/calendar-2-before-1111
kayg:wip/tiering-v3-cold4
kayg:perf/stalls-1054-r2
kayg:fix/suite-A4
kayg:fix/suite-A5-probe
kayg:fix/suite-A6
kayg:fix/suite-A3
kayg:fix/suite-A2
kayg:fix/suite-A5
kayg:fix/suite-A1
kayg:wip/local/attachments-861-fix
kayg:feat/contrast
kayg:wip/local/ports-861
kayg:wip/local/mail-1011-reconcile-20261110
kayg:feat/style-sheet-fixes
kayg:feat/money-round
kayg:perf/stalls-1054
kayg:wip/tiering-v3-cold5
kayg:t3/mail-1011-liveness
kayg:feat/iphone-fixes
kayg:feat/notes-approve
kayg:wip/local/shrow-work
kayg:feat/files-s1-identity
kayg:feat/quickfix
kayg:wip/tiering-v3-cold
kayg:wip/local/shared-row-swipes
kayg:backup/macos-vm/pfx-B
kayg:backup/macos-vm/pfx-C
kayg:backup/macos-vm/pfx-D
kayg:feat/contrast-r1
kayg:feat/tiering-v3-s2-tags
kayg:feat/folder-drop
kayg:t3/photos-s1
kayg:feat/tiering-v3-s1-namespace
kayg:wip/local/photos-s1
kayg:t3/photos-plan-slice-one
kayg:recovered/backup/p1b-61505
kayg:t3/paged-search-reconcile
kayg:t3/smooth-pane-transitions
kayg:t3/index-position-startup-scan
kayg:fix/private-staging-759b-r2
kayg:backup/macos-vm/hk/hk1009/pr877
kayg:backup/macos-vm/hk/hk1009/pr878
kayg:docs/undo-block-ids-plan
kayg:fix/undo-768
kayg:backup/macos-vm/hk/hk1009/pr875
kayg:backup/macos-vm/hk/hk1009/pr904
kayg:proto/block-identity-v7d
kayg:backup/macos-vm/hk/hk1009/pr846
kayg:backup/macos-vm/hk/hk1009/pr860
kayg:backup/macos-vm/hk/hk1009/pr861
kayg:backup/macos-vm/hk/hk1009/pr849
kayg:backup/macos-vm/hk/hk1009/pr848
kayg:backup/macos-vm/hk/hk1009/pr853
kayg:backup/macos-vm/hk/hk1009/pr957
kayg:backup/macos-vm/hk/hk1009/pr893
kayg:backup/macos-vm/hk/hk1009/pr889
kayg:backup/macos-vm/hk/hk1009/pr902
kayg:docs/imap-notes-plan
kayg:docs/quota-plan-2
kayg:fix/parallel-test-flakes
kayg:docs/calendar-backend-v2-plan
kayg:feat/calendar-ical-converter
kayg:backup/macos-vm/hk/hk1009/pr808
kayg:docs/contacts-import-v2-plan
kayg:issue/610-pm-midnight
kayg:feat/calendar-v2-s1-containment
kayg:backup/macos-vm/hk/hk1009/pr854
kayg:backup/macos-vm/hk/hk1009/pr845
kayg:backup/macos-vm/hk/hk1009/pr917
kayg:docs/dav-recorder-v2-plan
kayg:plan/previews-865
kayg:plan/save-log-durable-entry
kayg:backup/macos-vm/hk/hk1009/pr934
kayg:fix/e2e-data-on-ram
kayg:backup/macos-vm/hk/hk1009/pr888
kayg:feat/appwindow3
kayg:feat/appwindow2
kayg:feat/appwindow
kayg:feat/money-p1
kayg:feat/keys-sheet
kayg:review/calendar-2-themes
kayg:feat/smooth-cursor
kayg:fix/float-style
kayg:review/calendar-2-float
kayg:release/2026-11-06-hotfix
kayg:archive/port/rows-drop-code
kayg:archive/port/rows-actions
kayg:archive/port/rows
kayg:scratch/tasks-894-ui-gates
kayg:review/calendar-2-night-wip
kayg:recovered/flaky/toast-reduced
kayg:release/2026-11-05
kayg:archive/flaky/rows-drop-fixed
kayg:archive/flaky/rows-actions
kayg:archive/flaky/rows
kayg:sim/bm15-final
kayg:sim/bm15-bis-932
kayg:sim/bm15-bis-909
kayg:sim/bm15
kayg:sim/bm15-bis-887
kayg:perf/tiering-option-b
kayg:fix/sw-lazy-precache
kayg:archive/plan/save-log-durable-entry
kayg:mock/money-fix2
kayg:archive/fix/e2e-data-on-ram
kayg:mock/appearance-all
kayg:mock/pill-press
kayg:mock/pill-press-mac
kayg:backup/macos-vm/appearance-after
kayg:mock/auto-swipes
kayg:mock/mail-actions
kayg:backup/macos-vm/mock/mail-actions
kayg:mock/money-static
kayg:archive/review/standards-917
kayg:perf/tiering-761-fix
kayg:mock/type-audit
kayg:mock/third-pane
kayg:feat/contacts-import-v2-s1
kayg:perf/executor-hot-path
kayg:archive/port/hidden-blocks
kayg:archive/port/devices
kayg:scratch/executor-on-894
kayg:scratch/executor-spans2
kayg:scratch/executor-spans
kayg:archive/port/rows-drop
kayg:feat/tiering-761-d-scale
kayg:feat/tiering-761-c-index
kayg:feat/tiering-761-b-reader
kayg:archive/review/sharing-pr3-review-9fec3d1f
kayg:perf/ports-lazy-budgets
kayg:feat/tiering-761-a-migration
kayg:archive/review/sharing-pr3-review
kayg:archive/review/sharing-pr3-review-code
kayg:archive/plan/previews-865
kayg:archive/port/port-attachments-3
kayg:archive/port/contacts-merge
kayg:fix/motion-audit-859
kayg:fix/motion-audit-859-mac
kayg:archive/port/port-pickers
kayg:archive/port/port-tables-2
kayg:archive/port/port-tables
kayg:recovered/local/sharing-s1-pr2-room-snapshot-candidate
kayg:archive/fix/parallel-test-flakes-code-minipc01
kayg:docs/imap-766-readonly-slice
kayg:feat/dav-recorder-v3
kayg:research/788-diagnosis
kayg:archive/fix/parallel-test-flakes
kayg:archive/perf/pr792-cold-index-edit
kayg:docs/sharing-slice-1
kayg:recovered/feat/dav-recorder-v2
kayg:recovered/feat/dav-recorder-v2-edd7bbb
kayg:spike/imap-766-s0-cases
kayg:archive/fix/undo-768
kayg:recovered/feat/dav-recorder
kayg:recovered/feat/dav-recorder-901acd4
kayg:feat/contacts-import
kayg:perf/cold-growth-on-764
kayg:perf/cold-growth-on-tiering
kayg:recovered/feat/tasks-set-status
kayg:feat/tasks-move-reorder
kayg:feat/tasks-delete-promote-duplicate
kayg:feat/carddav-writes
kayg:perf/quota-on-tiering
kayg:perf/quota-simple
kayg:perf/cold-growth-on-quota-stack
kayg:recovered/perf/cold-growth-on-tiering
kayg:feat/calendar-identity
kayg:feat/calendar-event-parser
kayg:feat/calendar-props-maps
kayg:port/glass-when-ring
kayg:recovered/feat/tiering-761-s1-wip-8132a84
kayg:recovered/feat/tiering-761-s1-wip-9da4094
kayg:recovered/feat/tiering-761-s1-wip-724512c
kayg:recovered/feat/tiering-761-s1-wip-66e667e
kayg:recovered/feat/tiering-761-s1
kayg:wip/6by32-01-tier-761-s1-pause-20261030
kayg:spike/imap-766-s0
kayg:wip/6by32-02-calternal-pause-20261030
kayg:wip/8by64-01-review-688-pause-20261030
kayg:wip/6by32-01-verify-744-pause-20261030
kayg:wip/6by32-01-verify-742-pause-20261030
kayg:fix/private-staging-759b
kayg:wip/6by32-01-review-748-pause-20261030
kayg:wip/6by32-01-review-733c-pause-20261030
kayg:wip/6by32-01-review-733b-pause-20261030
kayg:review/calendar-month
kayg:wip/local/bm15-trash
kayg:plan/759b-staging
kayg:review/767b-tests
kayg:review/preview-2026-10-29
kayg:docs/tiering-731-plan
kayg:wip/c6b02-review-733d
kayg:wip/c6b02-bm1-full-a
kayg:docs/deploy-plan
kayg:fix/storage-owner-liveness-642
kayg:fix/storage-fix-7
kayg:feat/tiering-731
kayg:wip/tiering-731-first-attempt
kayg:perf/idle-honest-2
kayg:fix/storage-private-tmp-642-dev
kayg:fix/storage-exact-file-quarantine-642
kayg:perf/one-flush-save
kayg:review/calendar-static
kayg:review/indexing-ring
kayg:review/when-field-2
kayg:proto/block-identity-2-review
kayg:proto/block-identity-review
kayg:review/when-field
kayg:issue/tasks-create-ids
kayg:issue/tasks-create
kayg:review/combined
kayg:review/task-polish
kayg:review/top-buttons
kayg:review/q1-q5
kayg:archive/integ325-293
kayg:archive/integ325-ci
kayg:issue/calendar-adr
kayg:archive/old/train/2026-10-23bk2
kayg:archive/old/train/2026-10-23bk
kayg:issue/469-mockup-9a
kayg:issue/smart-tasks-mockup
kayg:issue/469-menus
kayg:issue/652-signout-flake
kayg:issue/652-history-fix7
kayg:issue/652-history-fix6
kayg:archive/old/issue/spring-check-perf
kayg:issue/spring-check-perf
kayg:issue/659-rename-fast
kayg:archive/old/train/2026-10-21ar
kayg:issue/search-hardening-3
kayg:issue/652-history-fix5
kayg:issue/660-port-sheets-glass
kayg:issue/652-history-fix4
kayg:issue/652-history-fix3
kayg:issue/652-history-fix2
kayg:issue/652-history-flake
kayg:train/2026-10-21an
kayg:issue/settings-admin-port
kayg:issue/search-port
kayg:train/2026-10-20am
kayg:issue/storage-split-fix2
kayg:issue/storage-split
kayg:archive/old/issue/folder-ids-fix
kayg:train/2026-10-20al
kayg:archive/old/issue/folder-ids
kayg:train/2026-10-20ak
kayg:issue/tables-mockup
kayg:train/2026-10-19aj
kayg:train/2026-10-19ai
kayg:issue/469-merge-fixes
kayg:issue/sidebar-band
kayg:archive/old/issue/608-settings-spec
kayg:train/2026-10-19ah
kayg:issue/swipe-offscreen
kayg:train/2026-10-19ag
kayg:archive/old/issue/590-nlp-adr
kayg:archive/old/issue/587-event-after-write-2
kayg:train/2026-10-19af
kayg:archive/old/issue/587-event-after-write
kayg:issue/469-pill-room-c
kayg:issue/469-pill-room
kayg:train/2026-10-19ae
kayg:issue/469-narrow-handle
kayg:issue/397-ios-swipe-2
kayg:issue/469-desk-fixes
kayg:archive/old/issue/auto-update-adr
kayg:issue/469-filter-gap
kayg:issue/469-port-1b
kayg:issue/442-opacity-flake
kayg:issue/327-web-fast-3
kayg:archive/old/issue/469-port-1
kayg:issue/469-port-1
kayg:issue/327-web-fast-2
kayg:archive/old/issue/327-web-fast
kayg:archive/old/issue/425-stt-bench-vq1
kayg:archive/old/issue/445-no-bleed
kayg:archive/old/issue/400-swipe-mockup-2
kayg:issue/426-client-review
kayg:issue/426-client-2
kayg:issue/426-client
kayg:archive/old/issue/476-safe-area-lab
kayg:archive/old/issue/445-top-light
kayg:issue/471-blocks-mockup
kayg:archive/old/issue/448-links-app-2
kayg:archive/old/issue/448-links-app
kayg:archive/old/issue/398-cold-links
kayg:issue/434-442-small-2
kayg:issue/434-442-small
kayg:archive/old/issue/398-unload
kayg:archive/old/issue/445-bottom-band
kayg:issue/445-bottom-band
kayg:issue/351-rem-3
kayg:issue/351-rem-2
kayg:issue/351-rem
kayg:archive/old/issue/327-first-note
kayg:issue/395-width-phone
kayg:archive/old/issue/327-typing
kayg:issue/396-ios-edges
kayg:issue/397-ios-swipe
kayg:archive/old/issue/327-notes-index
kayg:issue/345-347-contrast-empty-2
kayg:archive/old/issue/44-arenas
kayg:issue/44-arenas
kayg:archive/integ325
kayg:archive/old/issue/327-perf-harness
kayg:archive/old/issue/44-thp
kayg:issue/44-thp
kayg:archive/old/issue/285-sticky-pills
kayg:archive/old/issue/44-trim-3
kayg:issue/44-trim-3
kayg:archive/old/issue/165-cards
kayg:archive/old/issue/165-picker-2
kayg:archive/old/issue/212-multi-select
No reviewers
Labels
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
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
Loading…
Reference in a new issue
No description provided.
Delete branch "storage/wal-checkpoint-off-save-1051"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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
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
Correctness on exact head
5dc6bf6feOn 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.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.
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.pycheck.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
efe825f171a662e9dc719fb326f5cc217aa285f2adds 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.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.Live qualification state (work is continuing):
93ae82ba04. The last commit only isolates test fixtures; production code matches7ff88807e.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.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.7ff88807eimplementation; 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.4274dafb4. Current dev's subsequent commits do not change the Rust/Cargo paths involved here; a merge-tree check is clean.isolated wal-size diagnostic completed in a plain
perf-turn wal1051turn with both shared-disk locks. ordinary7ff88807e(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.decision:
5dc6bf6feretains 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 on5dc6bf6fe. final qualification remains pending, pr stays draft. both diagnostic perf locks are released.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.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.
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.
r6 complete measurement tables, exact head
5dc6bf6fe0210c9821781d159ed9075322ee5dd2vs dev4274dafb4. 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.each arm lasted180s,900saves,zero retries. max is judged against the dev range, not its median. dev63.97–322.98ms; branch46.08–715.11ms.
matrix abab with bracketing dev-vs-dev controls:
boot abab with bracketing dev-vs-dev controls:
smoke abab with bracketing dev-vs-dev controls:
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.
r7 confirmation completed on the same source/binaries and boot IDs as r6, through a fresh plain
perf-turn wal1051turn 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.
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:
smoke abab with bracketing dev-vs-dev controls:
startup abab with bracketing dev-vs-dev controls:
per-file sync counts across all three traced arms per side:
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 repositorystrace-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.
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, 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.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.
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 focused root-cause capture completed, performance still fails the max gate; PR stays draft. head
efe825f171a662e9dc719fb326f5cc217aa285f2, baseline4274dafb46f03ca23fea1fb76929bb13716af64ewith 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.
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.pychecks 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.
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 -- --checkpassed;cargo clippy -j4 --workspace --all-targets -- -D warningspassed;cargo test -j4 -p calternal-core -p calternal-notes -p calternal-store checkpoint -- --test-threads=4pluscargo 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 head5dc6bf6fe0210c9821781d159ed9075322ee5dd2, 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.
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.
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). Headefe825f171a6preserved atrefs/archive/stale-2026-11-14/storage/wal-checkpoint-off-save-1051; closing. Housekeeping 14 Nov.Pull request closed