Files slice 1 r7: Home identity, joined index, reconcile (idle-time walk) #1117
Open
kayg
wants to merge 28 commits from
feat/files-s1-identity-r7 into dev
pull from: feat/files-s1-identity-r7
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: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:storage/wal-checkpoint-off-save-1051
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!1117
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/files-s1-identity-r7"
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?
Status (2026-11-14 11:20 UTC, head
934ef1c36, on dev796d80cba)openat2included); r6 did.home.page/home.page_title/searchp95.What this PR does
Files slice 1 gives ordinary Home files and folders stable IDs:
.calternal-idmarker inside each folder..calternal-file-ids/, bound to device and inode.These IDs live in the same append-only ID log as Notes (
scope: "home"lines; Notes lines keep their exact JSON). A quiet background walk, plus the Home-root watcher, keeps the joined index in step. There is no tier metadata in this slice, so it stays compatible with tiering v5.Why r6 failed, and the fix (r7)
r6 measured 111/288 comparisons over the dev-copy bound. A syscall profile on dev-01 (strace of fsync/openat/getdents/accept4 per server start, dev vs r6 vs r7) found these causes:
notes.listopens the Home throughstart_home, and search never touches the Notes Home. So in r6:.mdentries never counted toward the 512-entry yield. One folder of 100,000 notes was read in one burst.The fix:
EventRecorder::idle_for(defaultNone) exposes the engine's per-person runtime stamp, which every action already sets.start_homeandNotes::homemark the Home itself.has_open_room, which clones nothing under the rooms lock.syncfsper page makes them durable before that page's rows are published. That's Linux only; elsewhere each marker is still synced on write.The r7 profile on dev-01 (strace, hot-only, cold + 2 warm runs at 1k/10k/100k):
An idle probe at 100k (one request, then 90 s idle) gives the first walk's cost when it does run:
Plan (as built)
Sizes.
id + pathallocation plus about 60 bytes of metadata.Big-O.
Failure table.
syncfsinterrupted_home_scan_keeps_stale_rows_for_restart_reconcile, restart testsInterrupted; no stale rows are retirednotes_crash, restart reconcile testsrequests_hold_the_home_file_walk_until_quietdropping_notes_releases_the_home_file_scanrestart_reconcile_*testsGates
home-files-identity.spec.tson chromium-1440, chromium-390, webkit-1440 and webkit-390🤖 Generated with Claude Code
r7 functional gates: head
934ef1c36on dev-01 (all run through~/bin/slot, insidenix develop)cargo fmt --all -- --checkcargo clippy --workspace --all-targets --locked -j4 -- -D warningscargo test -p calternal --test notes_crash --locked -j4cargo test -p calternal-notes --lib home_files --locked -j4requests_hold_the_home_file_walk_until_quiet)cargo test -p calternal-notes --lib interrupted_home_scan_keeps_stale_rows_for_restart_reconcile --locked -j4cargo test --workspace --locked -j4 --no-fail-fast -- --test-threads=2cargo build --workspace --release --locked -j4calternalSHA-25609fdc5db8428182a499ece6b3e286bbf39fb2d83e87803ba92ba96e2dc2f0ade(the binary staged for perf r7)CALTERNAL_BIN=…/target/debug/calternal bunx playwright test e2e/home-files-identity.spec.ts --project=chromium-1440 --project=chromium-390 --project=webkit-1440 --project=webkit-390 --workers=1Profile (dev-01, strace
--seccomp-bpfof fsync/fdatasync/syncfs/openat/getdents64/accept4 per server start;calternal-perf --hot-only --runs 2 --cold-runs 1, 1k/10k/100k)796d80cba1609d3c54(rebased)508a33c96notes.listwas polled (it opens the Home throughstart_home)934ef1c36Inotify watches: 3 vs dev's 2. The extra one is the Home root.
Idle probe, 100k, one request then 90 s idle, first walk (markers absent):
In the warm pass, neither build walked within 90 s: the Home was still busy with its startup work, and the walk waits for that by design.
Profile correction (02:35 CET)
My first profile traced
openatbut notopenat2.Folderreads markers withopenat2(RESOLVE_BENEATH), so a walk that only read existing markers was invisible there.I re-ran the r6 and r7b profiles with
openat2andsyncfsadded to the filter: same harness, hot-only, cold + 2 warm runs, 1k/10k/100k on dev-01..calternal-id/.calternal-file-ids(read or write)934ef1c36The earlier conclusion stands, now verified for reads too: in r7 the walk never runs inside a measured server life.
Idle probe repeated with 300 s idle at 100k (first walk, writing markers):
The probe's "warm" pass didn't trace
openat2, so I'm not reporting a warm-walk time from it.Perf r7 verdict (r6 method): FAIL, 129/288
Session.
~/bin/perf-turn files-s1-r7on perf-01, with perf-02's lock held by a unit on perf-02 for the whole run. Measured 07:34–08:05 CET 14 Nov. Five paired rounds (dev, candidate-a, dev-copy, candidate-b) at 1k, 10k and 100k,--hot-only --runs 1 --cold-runs 1. All 20 arms exited 0.Binaries (sha256-checked on perf-01):
934ef1c3609fdc5db…f0ade796d80cba1160fe3e…4eac7ecalternal-perf)062dd8a7…cadbResult. Comparator
compare-files-s1.py, unchanged from r6 (20,000 resamples; candidate U95 ≤ dev-copy U95): 129/288 over the bound (1k 32/96, 10k 52/96, 100k 45/96). r6 was 111/288. Not READY.What this does and doesn't show:
search.prefixp99: 1.02 (U95 2.12), vs r6 2.17 (U95 4.43).search.queryp95: 0.99, vs r6 2.01.sync.save_ackp99: 0.97, vs r6 1.98.cold.disk_written: 1.0000, vs r6 1.0008 (no marker writes in the cold window any more).cold.startup(control 0.81), 10kshutdown(0.87), 100ksave_ackp99 (0.71).open.long_note,cold.*,shutdown,search.first_query) carry ten samples each.open.long_note1.40 (control 1.00)search.first_query1.13sync.durable_writep95 1.11cold.startup1.10 (control 0.83)search.prefixp99 1.14Next (decision taken, not merging). I've queued one A/A session with the identical layout and comparator: dev, dev-b, dev-copy, dev-b, all the same dev binary. It measures how many of the 288 comparisons this gate fails with no change at all.
Full r7 comparison table (r6 method)
Bootstrap resamples: 20000; paired rounds: 5; candidate/control ratio samples: 10/5.
Ratios normalize lower-is-better metrics as candidate/control; cold.notes_per_s is inverted.
Gate: candidate upper 95% bootstrap bound must be at or below the dev-copy control upper bound for every metric and quantile.
FAIL: 129 comparisons exceeded the dev-copy bound.
Position-balanced reading, r7 and r6
Perf r7 session is SUSPECT for timing (backup01 contention)
The r7 turn measured 06:34:49–07:05:10 UTC on 14 Nov. That is entirely inside infraternal #260's J618/J610 benchmark jobs on backup01, the host under perf-01 and perf-02 (about 06:15–07:30 UTC).
The dev/dev-copy control in the same session saw the same contention, but it can't make the comparison trustworthy: the drift was large (the control is far from 1 on several metrics, e.g. 100k
cold.startup0.81). So treat the 129/288 above and the position-balanced reading as void for the verdict.The r6-vs-r7 contrast on the 2× rows (100k search, 10k save_ack) still matches the syscall profile, which doesn't depend on timing.
Re-run, decided: I replaced the queued A/A ticket with one combined turn,
files-s1-r7-combo(about 62 min, under the 90-minute limit). Each round runs dev, candidate-a, dev-copy, candidate-b, then dev, dev-b, dev-copy, dev-b (dev-b is the dev binary). Five rounds at 1k/10k/100k. The r7 re-run and its no-change control share every round, so they see the same drift. Before reading results I'll check #260 for overlap.Perf r7 re-run + A/A control (combined turn): r6 method FAIL, and a no-change run fails it about equally
Session.
~/bin/perf-turn files-s1-r7-comboon perf-01, with perf-02's lock held by a unit for the whole run. Measured 10:02:06–11:03:56 UTC 14 Nov; all 40 arms exited 0.--hot-only --runs 1 --cold-runs 1.Overlap check against infraternal #260. J618/J610 had ended. J629 took backup01 at 11:01:28 UTC, so it overlaps only the last ~2.5 min: round 5's final block-2 arm (dev-b). That arm is marked suspect. The difference-in-differences reading below is also given without round 5; the conclusions don't change.
compare-files-s1.py, unchanged)The A/A row is the key fact. With the identical layout and comparator and no code change at all, 131 of 288 comparisons fail.
Difference-in-differences (same session, same slots). Per round, the candidate block is compared with the dev-b block. Each block's own dev and dev-copy arms correct for drift between the two blocks. Bootstrap over rounds, 95% intervals.
home.pagep95: 1.73–1.84home.page_titlep95/p99: 1.4–2.1search.prefixp95: 1.9–2.3search.queryp95: 1.36–1.57search.prefixandsearch.query: 0.82–0.90home.first_page: 0.76mem.idle: 0.94openat2, above). The only per-request addition is one relaxed atomic store instart_home.search.prefixandsearch.queryare no longer 2×, and 1kcold.disk_writtenis 0.996 [0.992, 0.999] (no marker writes in the cold window).What I recommend, for the orchestrator to decide; I'm not merging:
--runs 3per arm (three warm samples), ABAB ×5, and the gate "candidate U95 ≤ A/A U95" taken from an A/A block in the same turn, or the difference-in-differences above with ≥8 rounds. A turn like that is about 2 × 62 min, so split by size: 100k in one turn, 1k+10k in another.home.page/home.page_title/searchp95 cells survive that, I'll profile them directly. Nothing in this branch is known to touch them.r7 re-run, r6 method
Bootstrap resamples: 20000; paired rounds: 5; candidate/control ratio samples: 10/5.
Ratios normalize lower-is-better metrics as candidate/control; cold.notes_per_s is inverted.
Gate: candidate upper 95% bootstrap bound must be at or below the dev-copy control upper bound for every metric and quantile.
FAIL: 144 comparisons exceeded the dev-copy bound.
A/A (dev vs dev), r6 method
Bootstrap resamples: 20000; paired rounds: 5; candidate/control ratio samples: 10/5.
Ratios normalize lower-is-better metrics as candidate/control; cold.notes_per_s is inverted.
Gate: candidate upper 95% bootstrap bound must be at or below the dev-copy control upper bound for every metric and quantile.
FAIL: 131 comparisons exceeded the dev-copy bound.
Difference-in-differences, rounds 1–5 and 1–4
Validation on the existing 14 Nov data (new comparator, head
40760cd33)Data. I used the five fixed-order Files sessions still on perf-01. None was deleted.
files-s1-perf-c8688c-DE10q9: r1, r6. r5 is incomplete and was skipped.files-s1-perf-r7: r7a (logs), r7b (logs-r7b), A/A (logs-aa).Each session has 5 rounds of dev, cand-a, dev-copy, cand-b at 1k/10k/100k,
--runs 1.home.,cold.,startup.,shutdown,mem..These are only 5 rounds each (32 exact flips), so I lowered
--min-roundsto 5 here. That makes this test weak: the smallest possible p is 1/32. The order was also fixed, not random, so this is a sanity check and not a gate.Cells. The old 288 comparisons are 170 distinct cells. 99 were copies: single-sample metrics counted three times. 3 are constant counts.
search.queryp99 (max of 55) 1.055The null block passes in every session (5/5). The old comparator failed the same A/A data in 131/288 cells.
Pooled null (stronger check). All 25 dev-copy-vs-dev rounds as one A/A turn (10,000 random flips, 170 cells): 0 cells flagged.
paired-turn.shremoves the second.Resolution (from the same 25 null rounds; one-sided, 80% power, hot family of the full matrix):
sync.save_ack,search.queryandcold.startup(10k). +20% is needed on 10khome.pagep50 (per-round sd 0.19 in log).--runs 1, p95/p99 at 10k can't resolve anything under 1.5×. That's a harness limit (20 requests per run), not a comparator setting.Noise structure. Pairs of dev arms 1 to 7 slots apart have the same spread (10k
home.pagep50: 0.164 at distance 1, 0.149 at distance 7). The noise is per server run, not slow drift. So tighter interleaving buys nothing; more fresh-server runs (--runs 3) and more rounds do.#1117 on old data, under the new rule:
search.queryp99 (1.055) and, pooled with r7b, 10khome.pagep95 (1.63).~/bin/perf-turn sound-comparator, dev / dev2 / #1117934ef1c36,--runs 3, 80-min deadline, seed 1117).Comparator PR: #1130.
#1117 on the new comparator: fresh turn, no regression found; 27 cells are below the 10% resolution
Turn.
~/bin/perf-turn sound-comparatoron perf-01. The FIFO slot had no FRONT. A unit on hd01 held perf-02's lock for the whole turn.perf/vm/paired-turn.shat #113040760cd33, random order per round (seed 1117), 10 rounds, 80-min deadline.calternal-perf --hot-only --sizes 1k,10k,100k --runs 3 --cold-runs 1.1160fe3e…(dev796d80cba), cand09fdc5db…(#1117934ef1c36).Comparator.
python3 perf/compare.py layout.json --hot '*'(#113086e8d580b).start_homestamp runs on every request.home.pagep95: 0.99 (upper 95% bound 1.43)home.page_titlep95: 0.83 (bound 0.99)search.prefixp95: 0.98search.queryp95: 0.98 (bound 1.04)Verdict under the new rule: no regression found. Not yet READY: resolution.
cold.startup,startup.healthz,shutdown,home.first_page,search.first_query,open.long_note, with MDE 12–60%.home.page(14%/21%),home.page_title(11%/17%),open.note(11%/35%), 10kopen.api_get(17%),search.typo(24%), 100ksync.round_trip(12%).Next (decided):
--cold-runs 3, or a startup-only turn at 1k+10k). I'll run that as the second turn's design:--runs 3 --cold-runs 3, sizes split if needed to stay ≤ 90 min.Unresolved hot cells (ratio, upper 95%, MDE)
#1117: second turn and pooled verdict. No regression found; startup/shutdown single-shot cells still under-resolved
Turn 2.
~/bin/perf-turn sound-comparatoron perf-01, no FRONT. A unit on hd01 held perf-02's lock for the whole turn.paired-turn.sh --order mirrored --seed 11172 --warmup, each armcalternal-perf --hot-only --sizes 1k,10k,100k --runs 3 --cold-runs 3.Pooled turns 1+2.
compare.py t1/layout.json t2/layout.json --hot '*': 16 rounds, 65,536 exact flips, 172 cells, α = 5%. Each turn's null block is tested on its own.What the gate can't yet rule out. 21 hot cells have an MDE above 10%:
home.page/home.page_titlep50 at 11–13%.cold.startup×1.09, 1kshutdown×1.09, 10kopen.long_note×1.49 (MDE 42%), 10ksearch.first_query×1.15. #1117 does add work exactly there: a Home-root watcher at start, and joining the walk thread at shutdown. So a small startup/shutdown cost is plausible, and these numbers can't exclude it.--sizes 1k,10k --runs 10 --cold-runs 5 --hot-only, mirrored, with an inert arm. It runs after #894'stasks-benchre-run (my one ticket is queued). Until then, #1117 is not READY, for resolution only. Nothing is flagged.#1117 final perf verdict (#1130 method): no regression found; 11 single-shot cells still can't be certified below 10%
Turn 3, focused on startup.
~/bin/perf-turn sound-comparatoron perf-01, behind Notes Float, no FRONT. perf-02's lock was held by a unit on hd01.796d80cbac3e9a68f…796d80cba+ 600 never-run functionsae6d0a27…934ef1c368d7e280a…calternal-perf062dd8a7…(it has--hot-only).--hot-only --sizes 1k,10k --runs 9 --cold-runs 5, mirrored, warm-up on every arm.--hot-only, once on a fixture that was too small for--runs 10. The driver now catches both before or at the first arm (#1130502f0bb0a,58f5e534f).Pooled turns 1+2+3, the 1k and 10k cells that all three share:
compare.py t1 t2 ts --hot '*', 20 rounds, 10,000 flips, 115 cells.Cells the gate can't certify below 10%:
Verdict and decision:
cold.startup×1.075 (upper bound ×1.17), 1kshutdown×1.069 (upper ×1.16) and 10kopen.long_note×1.37 (MDE 34%).open.long_notewould need about 10 more turns. Resolving them is harness work: repeat the long-note open and server start/stop several times per run. I'm recording that as the open item for #1117.compare.py --only. I'm not merging.Side finding: the typing scenario's two-client text check failed 4 times in about 700 runs, at 10k, including on plain dev and on the inert arm. Filed as #1146; it's not #1117's.
#1117: three idle/load regressions found and fixed (head now
fe9293652); perf turn 2 is runningWhile making the single-shot cells measurable (#1149), I also checked what the #1130 turns can't see:
paired-turn.shruns--idle-secs 0, and every perf turn uses a separate--state. Production runs one/dataroot (deploy/cloud/calternal.container), so each person's app data (notes/,search/,attachments/,index.db*) sits inside the Home folder, next toNotes/. In that layout #1117 had three real costs. They're deterministic counts, measured on dev-01.1. An idle server walked its Home back to back forever (must-fix).
notes/ids.jsonleach pass. The new root watcher heard that write and queued the next walk.934ef1c36: 1,043 / 5,206 / 10,517, about 1.7 cores busymkdir, 21kopenat2, 655 writes).164b41c2c: when state shares the Home, the walk and the watcher skip the app-data top-level entries (home_files::APP_STATE_ENTRIES, documented next tostate_in_home). The same probe now gives 90 / 92 / 96, with an strace identical to dev's (10 writes).2. A connected client made the quiet wait poll every 250 ms.
wait_until_quietwoke 4×/s forever.calternal-perfidle scenario,idle.wakeups_per_s: dev 5.27,934ef1c3612.8.471af382d: one deadline timer (last request + 5 s). While only a connected client, open note, scan or job holds the walk back, it rechecks after 60 s, like the unload timer. Result: 5.27–5.30.3. The recursive Home-root watch heard every app-data write.
load.typing_wakeups_per_s: dev 63.3–64.1, fix-so-far 72–79 at 1k/10k.037c80500(home_files/watch_scope.rs): with state in the Home, each of the person's top-level folders is watched recursively. The root is watched by a names-only watcher (create/delete/rename; its kernel mask has noIN_MODIFY, so root-levelindex.db*writes never wake it). A folder that appears at the top later gets its own watch from a small background task.idle.threads21 → 22 (the second watcher's event thread, 0 wake-ups, no measurable RSS change), and only in the shared layout. A separate--statekeeps the single recursive root watch.Shared-layout harness runs, dev vs fix (
calternal-perf --sizes 1k,10k --runs 1 --cold-runs 1 --idle-secs 60 --storm-edits 500, two of each, dev-01; counts, not timing):934ef1c36idle.wakeups_per_sload.typing_wakeups_per_sidle.cpu_ticks(60 s)idle.threadsNew tests (
crates/notes/src/tests/home_files.rs,unload.rs):app_data_in_the_home_is_not_walked_and_an_idle_home_stays_idlefails on934ef1c36: the id log keeps growing.app_data_events_ask_for_a_walk_only_when_state_is_elsewherea_folder_made_at_the_home_root_after_startup_is_watchedquiet_in_counts_down_from_the_last_requestGates on
fe9293652(all through~/bin/slot, insidenix develop)cargo fmt --all -- --checkcargo clippy --workspace --all-targets --locked -j4 -- -D warningscargo test -p calternal-notes --lib home_files --locked -j4cargo test -p calternal --test notes_crash --locked -j4cargo test --workspace --locked -j4 --no-fail-fast -- --test-threads=2cargo build -j4 --release --locked -p calternal2b0908d1…bunx playwright test e2e/home-files-identity.spec.ts --project=chromium-1440/chromium-390 --workers=1--project=webkit-1440/webkit-390One gate note: on an earlier head,
room::save::…::independent_652_real_syncclient_joining_snapshot_is_not_savedfailed with "EOF while parsing". My script had run the workspace tests beforebun install, and that test spawns a JS sync client. It's not a code failure; withbun installfirst it passes, as above.Perf, single-shot cells, #1149 cycle harness: turn 1 is posted below; turn 2 on the final behaviour is running now. Not merging.
#1117 single-shot cells with the cycle harness (#1149): no regression; every startup/shutdown/long-note cell resolved
Method. #1130's comparator (
perf/compare.py --hot '*' --layout inert) andpaired-turn.sh, mirrored order with warm-up. Arms: dev, dev2 (a byte copy of dev), inert (dev + 600 never-run functions,perf/inert-patch.py --seed 1) and cand. All were built by me on dev-01, relayed through hd01 and sha256-checked on perf-01. Fixtures were my own (~/p1117c/data, made in the warm-up).Each arm ran
calternal-perf --sizes 1k,10k --runs 2 --cold-runs 8 --cycles 12: 24 server lives per size, each recording startup, first page, long-note open, first search and shutdown, plus 8 cold starts. I took~/bin/perf-turn p1117-cycleson perf-01 (no FRONT; I waited behind Notes Float and the daily train). A unit on hd01 held perf-02's lock for each whole turn.471af382d(ff4b0323…)4dfdfbd6f(aab31e87…)6e48665f2(189c0ac3…)271671e23(b19e2852…, 1 ms shutdown)796d80cba(f206c219…); inert ise0366be3….6e48665f2has the same server code as the headfe9293652. The two later commits change only a test helper and import formatting.503012c47was stopped in its warm-up and re-run on the next fix, so no measured round was lost.The cells left open last time, cand vs dev (ratio, one-sided upper 95 %, MDE at 80 % power):
cold.startupcycle.startupp50)startup.healthz×1.013, MDE 12.6 %)cycle.startupp50shutdown→cycle.shutdownp50shutdown→cycle.shutdownp50open.long_note→cycle.long_notep50cycle.long_note_filep50home.first_page→cycle.first_pagep50search.first_query→cycle.first_queryp50cycle.long_note_filecycle.long_note_file(the first open of the one long note, read from its file) has one sample per arm per round. Pooling turns 1+2 for this cell gives 36 rounds: 1.034, U 1.089, MDE 8.1 %, adj. p 0.999. The dev2-vs-dev null block moves this same cell by ×1.037, so this is dev's own noise. The pooled turns used two candidate builds; neither changes the file-open path.open.long_notelooked like ×1.37: at 10k there are 5 long notes, and warm runropens long noter mod 5. So runs 0–4 read the note from its file and later runs rebuild it from history, and one cell mixed two code paths. Cycle mode keeps them apart (cycle.long_note_filevscycle.long_note); both are flat.271671e23: the exit was checked every 20 ms.Verdict.
Open for the orchestrator / kayg:
idle.threads+1 (21 → 22) in the shared layout only: the names-only root watcher's thread. It has 0 wake-ups and no measurable memory. The alternative is a hand-rolled inotify fd on the tokio reactor: Linux-only and more code. I kept the thread.busy_for_files_scanand is unchanged by me; it now costs one check a minute instead of four a second.934ef1c36) don't cover the fixes. The new head was measured only on the 35 single-shot cells, plus the shared-layout idle/typing counts. If the orchestrator wants the full 172-cell family onfe9293652, that's one more turn.Head
fe9293652. Not merging.fe9293652full perf: interim results (turns A and B done, A2 queued)Arms. All built by me on dev-01 in one environment, relayed through hd01 and sha256-checked on perf-01:
796d80cba442c6812…796d80cba+inert-patch.py --seed 1 --functions 820077b51c0…fe92936522d786608…perf/p1117-final-harness75806caf2(#1117 perf crate + #1149)fa3cbf9f…--hot-only, p99 quantiles) plus #1149.--cycles Nadds N server lives after each warm run, so one arm covers the warm cells and the once-per-life cells.paired-turn.sh5660b886cwith a local--single-rootoption (proposed on #1130), mirrored order, warm-up on every arm.~/bin/perf-turn p1117-final(no FRONT). My own fixtures are in~/p1117f/data.Turn A: separate
--state(the gate layout), full family.--sizes 1k,10k,100k --runs 2 --cold-runs 1 -- --hot-only --cycles 4.cycle.*).compare.py layout.json --hot '*' --layout inert:100000: warm run 2: the two clients ended with different texton the inert arm (dev code), the known #1146.Turn B: single root (app data inside each Home, as in prod).
--single-root --sizes 1k,10k --runs 2 --cold-runs 2 -- --hot-only --cycles 6, 12 rounds (4,096 exact flips), 135 cells.sync.save_ackp50sync.round_tripp50sync.durable_writep50cycle.startupp50cycle.shutdownp50Two raw-value checks:
sync.save_ackp99 is ×1.20 but not significant (adj. p 0.9998, MDE 36 %). Two cand rounds spiked to 14.9 and 21.6 ms; the others are 6–12 ms, the same band as dev2 (5.8–11.2) and inert (6.8–12.4).search.catch_up(×3.26, MDE 4,700 %) is bimodal in every arm: 2 ms or 2.003 s, depending on whether search finished before the harness's first 2 s poll. That happened in 4/12 rounds for dev, 4 for dev2, 2 for inert and 6 for cand. This is a harness resolution issue, not a code effect.Wake-up counts on perf-01 itself (inside turn B, perf-02 held). One full warm run per arm and layout,
--sizes 1k,10k --runs 1 --cold-runs 1 --idle-secs 60 --storm-edits 500; counts, not timing:idle.wakeups_per_s1k / 10kload.typing_wakeups_per_s1k / 10kidle.cpu_ticks(60 s) 1k / 10kidle.threadsEverything is flat except the known +1 thread in the single-root layout: the names-only root watcher, which has 0 wake-ups.
Next: turn A2 (same as A, seed 11495), pooled with A for the full family. I'll post the final verdict after it. Not merging.
fe9293652final perf verdict: 0 flagged in every block, both layouts; idle/typing wake-ups flat on perf-01 in both layoutsTurn A2.
~/bin/perf-turn p1117-finalticket (no FRONT; queued behind Mail #1011, e1c and nf3c).Full family, separate
--state, turns A + A2 pooled.--hot-only) + 32cycle.*cells, at 1k/10k/100k.compare.py tA/layout.json tA2/layout.json --hot '*' --layout inerthome.first_page,search.first_query,startup.healthz,shutdown,cold.*) and 100k open/search p50s.cycle.startup0.989 (U 1.026, MDE 5.7 %)cycle.shutdown1.002 (U 1.032, 4.4 %)sync.save_ackp50 1.002 (U 1.022, 3.0 %)startup.healthz0.935 (U 0.984)search.first_query×1.18, is noise:cycle.first_query, is 0.972 (U 1.019, MDE 7.3 %).Prod-like single root (app data inside each Home; turn B, comment above):
Wake-up counts on perf-01, both layouts (comment above):
idle.wakeups_per_s,load.typing_wakeups_per_sandidle.cpu_ticksmatch dev. The only difference isidle.threads+1 in the single-root layout (the names-only root watcher, 0 wake-ups).Verdict: no regression found on any measured cell or count, in either layout. Head
fe9293652. Not merging; for the orchestrator.Two harness follow-ups (neither blocks #1117):
search.catch_upis quantised to the harness's 2 s poll.View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.