WIP: Quota: simple whole-Home recount (replaces #754 counter) #764
Draft
kayg
wants to merge 19 commits from
perf/quota-simple into dev
pull from: perf/quota-simple
merge into: kayg:dev
kayg:main
kayg:feat/style-sheet-fixes
kayg:storage/wal-checkpoint-off-save-1051
kayg:t3/paged-search-reconcile-final
kayg:feat/pass8
kayg:review/calendar-2
kayg:fix/shared-row-swipes
kayg:feat/contrast
kayg:dev
kayg:feat/collections-db
kayg:fix/instant-keys-1056
kayg:feat/money-round
kayg:perf/stalls-1054
kayg:wip/tiering-v3-cold4
kayg:wip/tiering-v3-cold5
kayg:port/rows-actions
kayg:port/rows-drop
kayg:port/hidden-blocks
kayg:port/rows
kayg:port/port-tables
kayg:port/port-tables-2
kayg:t3/mail-1011-liveness
kayg:port/devices
kayg:port/port-attachments
kayg:port/port-attachments-2
kayg:port/port-attachments-3
kayg:docs/design-consistency
kayg:docs/engineering-standards
kayg:fix/rusqlite-0.41-rustsec-2026-0459
kayg:feat/iphone-fixes
kayg:shared/restore-and-stale-918-919
kayg:fix/phone-top-band-contrast
kayg:feat/notes-approve
kayg:perf/soak-max-gate
kayg:feat/files-s1-identity
kayg:fix/lifecycle-event-id
kayg:feat/quickfix
kayg:wip/tiering-v3-cold
kayg:perf/web-mockup-frame-fixes
kayg:port/contacts-merge
kayg:port/contacts-edit
kayg:test/shared-room-no-deleted-text
kayg:perf/first-paint-credits
kayg:fix/shared-history-after-grant
kayg:fix/phone-swipe-regressions
kayg:feat/contrast-r1
kayg:review/sharing-pr3-review
kayg:feat/tiering-v3-s2-tags
kayg:feat/folder-drop
kayg:fix/deskpills-lazy-share
kayg:feat/sharing-s1-pr3
kayg:tmp/money-round-before
kayg:fix/phone-pane-backdrop-roots
kayg:fix/palette-preload-chips
kayg:fix/invite-defaults
kayg:port/tasks-matrix
kayg:fix/restore-green-gates
kayg:fix/sharing-fast-path-hardening
kayg:t3/photos-s1
kayg:feat/tiering-v3-s1-namespace
kayg:notes-archive-hide
kayg:feat/tasks-actions
kayg:t3/photos-plan-slice-one
kayg:feat/whiteboard-s1
kayg:t3/paged-search-reconcile
kayg:t3/smooth-pane-transitions
kayg:t3/index-position-startup-scan
kayg:fix/private-staging-759b-r2
kayg:feat/dav-transport
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:docs/undo-block-ids-plan
kayg:fix/undo-768
kayg:proto/block-identity-v7d
kayg:issue/carddav-read-perf-fix-r2
kayg:issue/carddav-read-r2
kayg:docs/imap-766-plan-v2
kayg:docs/imap-notes-plan
kayg:docs/quota-plan-2
kayg:fix/parallel-test-flakes
kayg:feat/contacts-companion-pure
kayg:docs/calendar-backend-v2-plan
kayg:feat/calendar-ical-converter
kayg:docs/tasks-writes-v2-plan
kayg:docs/carddav-writes-v2-plan
kayg:docs/contacts-import-v2-plan
kayg:issue/610-pm-midnight
kayg:feat/calendar-v2-s1-containment
kayg:docs/dav-recorder-v2-plan
kayg:plan/previews-865
kayg:plan/save-log-durable-entry
kayg:fix/e2e-data-on-ram
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:release/2026-11-05
kayg:archive/feat/tiering-v3-s1-namespace
kayg:archive/flaky/rows-drop-fixed
kayg:archive/flaky/rows-actions
kayg:archive/feat/tiering-v3-reader
kayg:archive/feat/tiering-v3-roots
kayg:archive/flaky/rows
kayg:sim/bm15-final
kayg:sim/bm15-fix
kayg:sim/bm15-bis-932
kayg:sim/bm15-bis-909
kayg:sim/bm15
kayg:sim/bm15-bis-887
kayg:perf/tiering-option-b
kayg:port/style-3
kayg:port/style-2
kayg:port/style
kayg:fix/sw-lazy-precache
kayg:fix/vim-w-waits-for-save
kayg:fix/signout-test-races
kayg:fp-scratch/all
kayg:sim/bm15-first-paint
kayg:archive/bm15/rows-drop
kayg:archive/bm15/rows-actions
kayg:fix/palette-snippet-contrast
kayg:archive/bm15/rows
kayg:archive/bm15/hidden
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:archive/docs/design-consistency
kayg:mock/auto-swipes
kayg:mock/mail-actions
kayg:archive/feat/mail-p1
kayg:mock/money-static
kayg:archive/review/standards-917
kayg:archive/docs/engineering-standards
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:train/2026-11-03-bm14c
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:train/2026-11-03-bm14b
kayg:perf/ports-lazy-budgets
kayg:feat/tiering-761-a-migration
kayg:train/2026-11-03-bm14
kayg:train/2026-11-03-bm12
kayg:archive/review/sharing-pr3-review
kayg:archive/feat/sharing-s1-pr3
kayg:train/2026-11-03-bm11
kayg:archive/feat/imap-notes-fetch
kayg:train/2026-11-03-bm10
kayg:archive/review/sharing-pr3-review-code
kayg:archive/plan/previews-865
kayg:train/2026-11-02-bm9
kayg:archive/port/port-attachments-3
kayg:archive/port/contacts-merge
kayg:fix/motion-audit-859
kayg:train/2026-11-02-bm8
kayg:archive/scratch/bm8-prep
kayg:archive/port/port-pickers
kayg:archive/port/port-tables-2
kayg:archive/port/port-tables
kayg:archive/feat/sharing-s1-pr3-code
kayg:archive/scratch/bm7-fixed
kayg:train/2026-11-02-bm7
kayg:archive/fix/parallel-test-flakes-code-minipc01
kayg:train/2026-11-02-bm6
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:archive/docs/imap-766-plan-v2
kayg:feat/dav-recorder-v2
kayg:archive/docs/dav-recorder-v2-plan
kayg:spike/imap-766-s0-cases
kayg:archive/fix/undo-768
kayg:feat/dav-recorder
kayg:archive/docs/contacts-import-v2-plan
kayg:archive/feat/calendar-ical-converter
kayg:feat/contacts-import
kayg:perf/cold-growth-on-764
kayg:perf/cold-growth-on-tiering
kayg:archive/docs/tasks-writes-v2-plan
kayg:archive/docs/calendar-backend-v2-plan
kayg:archive/feat/contacts-companion-pure
kayg:feat/tasks-set-status
kayg:feat/tasks-move-reorder
kayg:archive/docs/carddav-writes-v2-plan
kayg:archive/feat/calendar-v2-s1-containment
kayg:feat/tasks-delete-promote-duplicate
kayg:archive/feat/dav-transport
kayg:archive/fix/carddav-rebuild-r1
kayg:archive/fix/carddav-retention-r1
kayg:feat/carddav-writes
kayg:perf/quota-on-tiering
kayg:perf/cold-growth-on-quota-stack
kayg:feat/calendar-identity
kayg:feat/calendar-event-parser
kayg:feat/calendar-props-maps
kayg:port/glass-when-ring
kayg:feat/tiering-761-s1
kayg:wip/10by32-01-impl-759b-scratch-20261030
kayg:wip/6by32-01-bm3-webkit-pause-20261030
kayg:wip/10by32-01-bm3-chromium-pause-20261030
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:wip/6by32-01-perf-idle-8-pause-20261030
kayg:wip/6by32-01-perf767-base-pause-20261030
kayg:wip/6by32-01-perf767b-767-pause-20261030
kayg:wip/6by32-01-perf767b-764-pause-20261030
kayg:wip/6by32-01-perf767-767-pause-20261030
kayg:wip/6by32-01-perf767-764-pause-20261030
kayg:wip/6by32-01-lists-b-pause-20261030
kayg:wip/6by32-01-ids-verify5-pause-20261030
kayg:wip/6by32-01-ids-verify4-pause-20261030
kayg:review/calendar-month
kayg:wip/10by32-02-undo-768-20261030
kayg:test/ids-verify3
kayg:wip/10by32-02-bm3-chromium-20261030
kayg:wip/10by32-01-review-753-20261030
kayg:wip/10by32-01-perf-idle-2-20261030
kayg:wip/10by32-01-bm2-webkit2-20261030
kayg:plan/759b-staging
kayg:train/2026-10-30-bm2
kayg:review/758b-tests
kayg:review/758-tests
kayg:review/764d-tests
kayg:review/767b-tests
kayg:review/preview-2026-10-29
kayg:review/767-tests
kayg:docs/tiering-731-plan
kayg:wip/c6b02-when2
kayg:wip/c6b02-tasks-create-fix5
kayg:wip/c6b02-settings-frost-mock
kayg:wip/c6b02-settings-frost-base
kayg:wip/c6b02-settings-frost
kayg:wip/c6b02-ring
kayg:wip/c6b02-review-733d
kayg:wip/c6b02-bm1-full-a
kayg:wip/compute02-when-field
kayg:wip/compute02-webkit-lists-repro
kayg:wip/compute02-train-bl2-dev
kayg:wip/compute02-dev-green-pw164
kayg:docs/deploy-plan
kayg:review/764c-tests
kayg:review/764b-tests
kayg:review/748g-tests
kayg:review/764-tests
kayg:review/759b-tests
kayg:fix/storage-owner-liveness-642
kayg:fix/storage-fix-7
kayg:wip/compute02-storage-fix-7
kayg:review/759-tests
kayg:feat/tiering-731
kayg:wip/tiering-731-first-attempt
kayg:wip/compute02-storage-fix-1
kayg:review/754g-tests
kayg:perf/idle-honest-2
kayg:review/754f-tests
kayg:review/754e-tests
kayg:review/755-tests
kayg:review/754d-tests
kayg:review/754c-tests
kayg:review/754b-tests
kayg:review/754-tests
kayg:fix/storage-private-tmp-642-dev
kayg:wip/compute02-verify-750
kayg:test/ids-verify5
kayg:test/ids-verify4
kayg:fix/storage-exact-file-quarantine-642
kayg:wip/compute02-verify-740
kayg:perf/one-flush-save
kayg:review/calendar-static
kayg:wip/compute02-verify-737
kayg:review/indexing-ring
kayg:review/when-field-2
kayg:wip/compute02-review-733
kayg:proto/block-identity-2-review
kayg:proto/block-identity-review
kayg:wip/c6b02-tc-design
kayg:review/when-field
kayg:issue/tasks-create-ids
kayg:issue/tasks-create
kayg:review/combined
kayg:wip/compute02-review-combined
kayg:review/task-polish
kayg:review/top-buttons
kayg:review/q1-q5
kayg:train/2026-10-26-bl2
kayg:archive/wt-398h
kayg:archive/train-bm-proptest-seed
kayg:archive/integ325-293
kayg:archive/integ325-ci
kayg:archive/client-auth-review-baseline
kayg:archive/wt-sim-4853
kayg:archive/wt-sim-4811
kayg:archive/wt-448m
kayg:archive/wt-398a-allocator
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:archive/old/issue/adrs-photos-files-tasks
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:archive/397-ios-swipe-2
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/445-top-light-2
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:archive/312-views-mockup
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/398-allocator
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!764
Loading…
Reference in a new issue
No description provided.
Delete branch "perf/quota-simple"
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?
Current stacked revision
Head:
75978ddb5ed30152a85fbb1d766a62d5c5a73113; target:dev.Stack: #761-A
feat/tiering-761-a-migration(5441212fd8b445fb80ff8ed640a4b33c17ae1d07) → #761-Bfeat/tiering-761-b-reader(58ffcc7182a8c7c1ff64ecc366d0e52ebe2eddf8) → #764. #767 stacks on this PR. This change needs A+B only; it is not based onfeat/tiering-761-s1and does not include C or D.Quota totals use
userdata;appdatais excluded. Startup fence markers are placed beside Homes so a recursive Home deletion cannot leave a marker behind.Verified gates
cargo fmt --all -- --check: pass.cargo clippy --workspace --all-targets -j4 -- -D warnings: pass.QUOTA_PROPERTY_CASES=50000 cargo test --workspace -j4: pass, exit 0.cargo test -p calternal-fsio -j4 fence_never_blocks_a_recursive_home_delete -- --nocapture: fails onrace-redwithDirectoryNotEmpty, passes on this head.CALTERNAL_INODE_REUSE_DIR=/home/claude cargo test -p calternal-fsio -j4 review_754d_reused_directory_inode_must_not_certify_a_replacement -- --nocapture: pass; ext4 recycled the directory inode and the replacement was charged./dev/shmdid not recycle it within the test's 10,000 attempts.Performance qualification
The original same-Home reproduction completed on
86f48a39with 100k notes andindex.dbinside the Home. Across three runs, medians were typing CPU 35.483%, idle CPU 0.000%, idle RSS 81.44 MB, and idle wakeups 0.000/s. This reproduces the high typing CPU when the Notes index database is under the Home.The replacement matrix used
perf/vm/typing-idle.sh(SHA25613c2e7bf6489663fcf99f21ddc010118d27e5a33e773c9f89be0a1ff113df90b) through~/bin/perf-lock, holding/var/lock/calternal-perf.lockonclaude@calternal-perf-02-backup01. It completed 13 samples before stopping inquota-4: the warm run's firstnotes.listpage was empty and markedincomplete: true. That failed run has no accepted metrics. The firstdev-quota-1sample is excluded because an external diagnostic file walk overlapped its idle interval; its validquota-1partner is excluded to keep the pair matched. Twelve completed samples remain usable, but the six-pair matrix is incomplete and no comparison is claimed. The #759b matrix currently holds the shared lock; continuation will wait for it.Supplied dev reference (
d83e54db, six runs): typing CPU 1.125%, idle CPU 0.647%, idle RSS 106.1 MB, wakeups 0.102/s. Budgets are typing CPU <=2%, idle CPU <=0.1%, RSS <=100 MB, and wakeups <=0.2/s.Measurement audit
#788 held
/var/lock/calternal-perf.lockfrom 19:26:10Z on perf-01 and 19:28:31Z on perf-02 until 22:28:36Z. Two original-path attempts using the old/tmp/perf.lockat 20:35:12Z and 20:39:41Z are excluded; they produced only fixture/startup output, not typing or idle metrics. No numeric results were discarded for this overlap. The valid same-Home reproduction started at 22:30:01Z, after release.The later r2 matrix did not overlap #788, but its loop repeated
quota-1; these five misattributed samples are excluded from the new medians (typing CPU %, idle CPU %, RSS MB, wakeups/s): dev-quota-1(1.150, 0.673, 131.98, 0.100), quota-1(0.467, 0.000, 81.68, 0.000), dev-cold-1(1.217, 0.550, 112.49, 0.073), cold-1(0.483, 0.000, 81.05, 0.000), and dev-quota-2(1.217, 0.723, 126.16, 0.123).No merge or deployment.
Historical description from earlier head follows.
Replace #754's scope and partial-repair counter with a debounced whole-Home recount. Recounts use directory fds, raw names and no-follow metadata. A single inotify reader flushes sentinel barriers before accepting a count or admitting an upload; inode watches cover outside hard-link writes and mountinfo changes invalidate counts. Hard links still charge each name. Startup stays asynchronous, and incomplete coverage is visible in Health and refuses uploads retryably.
The plan was committed first in
3f7eb017. Admission has one bounded deadline across the upload queue, recount, plugin providers and database queue. App publications add provisional bytes, confirmed by recount. The old scope, retry, directory-index and resolver-chain machinery and unused counter dependencies are removed.Validation: formatting, strict workspace clippy, fsio tests, 50,000 filesystem cases and 50,000 real Auth admission cases, and full workspace tests. Gate output is posted on #754 and #753. Reviewer behavioral checks were retained or ported; the full test inventory is in a PR comment and the issue inventory.
crates/fsio/src/usage* goes from 5,987 to 3,793 lines, including tests. Local dev-build warm recounts took 49.359 ms at 10k files and 522.726 ms at 100k, with about two syscalls per entry. These are not perf VM numbers. Initial 100k watch setup took 2,066.224 ms untraced, so first uploads may need a retry while the background count finishes. Initial 100k traces exceeded the 30-second recount deadline and were excluded. Measurement method and raw warm strace output.
Related: #754 and #753. No merge or deployment. This forge derives draft status from the WIP title prefix, used before the requested title.
Reviewer test inventory for the whole-Home replacement. Names below are no longer present at their old internal locations; each line states its replacement or the removed internal mechanism. Existing public mount integration tests remain unchanged from
a6b1fa14.754g was not merged into
a6b1fa14; its behavioral cases are explicitly carried forward in review_containment and lifecycle_tests. Its remaining internal-only cases are accounted for here:Other behavioral adaptations, listed rather than claimed unchanged:
a6b1fa14and does not claim byte-for-byte preservation from their earliest review branch.Local recount measurements on 6by32-compute02 — not a perf VM number.
Single dev-build samples, one Home, 17 logical bytes per file, one 10,000-entry folder or two 50,000-entry folders. All runs used one build slot. No cache drop and no cold-cache or server latency claim. Timing comes from untraced runs; syscall counts come from separate strace -f -c runs. Initial means a new counter installs its inode watches; warm means those watches already exist. Both counters reported exactly 170,000 / 1,700,000 bytes.
Entry denominators include the ordinary folder entries (10,001 and 100,002); all fixed probe and fence overhead remains in the syscall totals. Per-file values are 2.0123 and 2.00194. Warm walks have one fstatat and one statx per file, and no openat2 calls.
Comparison on
a6b1fa14with the same public recount probe and datasets: initial/warm untraced times were 172.820904/150.731700 ms at 10k and 1598.787518/1598.861014 ms at 100k. Its successful warm 10k trace had 120,264 calls (12.025197480 per entry). These single samples are not a statistical performance gate.Tracing the initial 100k count exceeded the 30-second recount deadline on both revisions. Those partial traces are not accepted counts and are not used for syscall-per-entry results. The new complete warm 100k trace succeeded in 8985.617739 ms under instrumentation; its untraced wall sample is the 522.725821 ms value above. Initial watch setup is slower than the old initial count in these samples; startup remains asynchronous and first uploads may return a bounded retryable result.
Warm 10000-file strace output, verbatim:
Warm 100000-file strace output, verbatim:
Independent verification of PR #764 at
798f1bbe: fix first.Tests-only branch:
review/764-tests, head49b67f9f. No product fixes, merges, deployments, or perf-test VM access.OnceLock<Option<Native>>permanently containsNone. Reproducer:cargo test -p calternal-fsio -j6 review_764_new_native_coverage_recovers_after_transient_fd_exhaustion -- --nocapture.cargo test -p calternal-fsio -j6 review_764_unchanged_unreadable_subtree_does_not_walk_every_second -- --nocapture.uploads.lock(user)before entering Auth's 1900ms timeout. This caller predates this PR but invalidates the claimed single bound over the upload queue. Reproducer:cargo test -p calternal-auth -j6 --test review_764 queued_http_storm -- --nocapture.cargo test -p calternal-fsio -j6 review_754d_reused_directory_inode -- --nocapture. This is a coverage gap, not a demonstrated quota bypass.Positive independent verification: 30 rename cases across descendant/Home/users levels and entry/exit checkpoints, inbound/outbound/cross-Home moves, parent replaced by symlink during walk, real inotify overflow (host queue capacity 1,048,576), queued file-watch retirement, 18 mid-walk bind/tmpfs/file mount cases in private namespaces plus unmount recovery, raw names/unreadable sparse hard-link aliases across Homes, SIGKILL inside recount with offline edits, and two real server processes enforcing exclusive ownership. No over-quota admission was observed. Concurrent HTTP publication admits exactly three files fitting a 500-byte allowance; next upload is HTTP 413/storage_quota/nonretryable. Unmeasurable counts map to HTTP 500/internal/retryable; receiver concurrency refusals map to retryable 429. The held-guard storm separately demonstrates the latency failure.
Both properties passed 50,000 cases with fresh seeds: filesystem
15411026587234305019(including real mount operations); Auth4622018493099982131(23,513 accepted, 26,487 quota-refused). The original code fixes its seeds; reviewer test code adds an environment seed override.Five-minute idle observation used retained schedule/last-walk/generation counters: 2,983 samples, zero new walks, zero Home deadlines, zero invalidations for a healthy unchanged Home. This does not erase the degraded-Home idle finding, and is not a CPU/RSS/perf-budget claim.
Gates: original head fmt, strict workspace clippy, full workspace pass (1,241 passed, 0 failed, 21 ignored; Tasks #757 test passed, no rerun required). Final reviewer tree fmt and strict workspace clippy pass. The reviewer suite intentionally keeps the four finding reproducers enabled; their failing results are not green gates. The complete workspace run with reviewer tests exited 101 only for the fsio library target (the three enabled fsio finding reproducers). Its Auth binary was built before the final queue reproducer was added; the final Auth reviewer integration suite was separately run and reports two passes and the expected HTTP-queue failure. Tasks again passed. Thus four distinct finding reproducers fail in the final tree; no unrelated gate failure was seen.
Deleted-reviewer-test audit: every missing original reviewer test function has a named disposition in comment 69530; no unexplained deletion found. However, removal of
review_754f_same_scope_deduplicates_and_quiet_failures_do_no_workloses the quiet-failure/backoff assertion, and the replacement checks only that some deadline exists. The plan's recovery row covers EACCES/fence recovery but misses native initialization recovery. The inode-reuse row remains unproven. Local complete plan-row audit and raw logs are in/home/agent/codex-jobs/verify-764/; no job artifacts are committed.(Posted by the coordinator; the verifier's Forgejo credential request timed out.)
🤖 Generated with Claude Code
Fixes pushed to
perf/quota-simpleat55622509ae. Reviewer branchreview/764-tests(49b67f9f) was fast-forwarded first. Five focused commits; no PR merge or deploy.st_inoequality within 10,000 attempts. This build host's btrfs allocator did not repeat the inode: it reports a clear physical-reuse skip and still asserts replacement accounting. If reuse occurs, the test asserts the reused replacement and a later mutation are charged; no claim that physical reuse was exercised here.docs/plans/0754-quota.mdfailure table. No prior fsio/Auth function names were removed. Reviewer failure-count, refusal, byte-total and recovery assertions remain. The old timer assertions were strengthened to require no idle timer, matching the decided zero-idle-work rule; the 2.2-second walk-count assertion remains.Gates (all heavy commands via
/usr/local/bin/build-slot.sh, Rust at-j6, on10by32-02-stdaarch64):cargo fmt --all -- --check: pass.cargo clippy -j6 --workspace --all-targets -- -D warnings: pass.cargo test -j6 -p calternal-fsio: pass, 117 library tests plus mount integrations; zero failures. Four manual/helper tests retain their ignore annotations; unreadable idle and real overflow were additionally run explicitly.cargo test -j6 -p calternal-auth --test review_764 -- --nocapture: pass; all four enabled reviewer/queue tests, zero failures.172964050764, pass (including namespace mount cases).272964050764, pass (23,560 admitted, 26,440 quota-refused).cargo test -j6 --workspace: pass, zero failures. Taskskill_9_during_field_writes_loses_nothing_acknowledgedpassed on the first run; no Tasks rerun or #763 merge was needed.One earlier standalone fsio run failed only at
beneath::tests::paths_that_climb_out_are_refusedduring fixtureremove_dir_allcleanup withNotFound. Its targeted rerun and the subsequent complete fsio gate passed without changing that test. The full workspace run also passed it.Five-minute unreadable-subtree trace on the committed implementation: 2,895 observations, zero walk deadlines, zero full-Home walks, zero invalidations, one retained Health entry. Both
usage-eventsandusage-recounthad zero additional CPU ticks over 300 seconds. Permissions were then restored and admission charged all 118 logical bytes with Health clear. This observes worker CPU at the host's tick resolution; the sampling test itself wakes separately.HTTP latency — build host, not perf VM. Debug build, warmed metadata and native coverage, sparse 17-byte logical files on
/tmptmpfs; one file externally rewritten before each simultaneous batch. Ten batches per cell, no cold-cache/perf-budget claim. These times include body staging, admission, placement and response. The existing receiver may return retryable 429 before accounting; both all-response and successful-publication distributions are shown so those quick refusals cannot hide upload latency. No perf-test VM was accessed.Separate held-publication batches hold a real Auth reservation on a healthy, measurable Home, so early measurement failure cannot bypass the queue regression. Every response was retryable 500 or receiver-limit 429, every request stayed below two seconds, and no file was published:
Local raw evidence and reproducible test output:
/home/agent/codex-jobs/quota-fix/(not committed). The permanent ignored latency probe isquota_http_latency_build_host; the permanent idle trace isunreadable_subtree_five_minute_idle_trace.(Posted by the coordinator; the job's Forgejo credential request timed out.)
Independent fix-round review of
55622509against798f1bbeanddocs/plans/0754-quota.md, on 10by32-02-std. Verdict: fix first.cargo test -j6 -p calternal-fsio fallback_admission_must_not_accept -- --ignored --nocapturethrough build-slot.sh, on the reviewer test branch below. Force native initialization to fail using an isolated child's RLIMIT_NOFILE, then restore its fd limit. During a real two-subtree scan, transfer bytes from the not-yet-counted subtree to the already-counted subtree. The Home is never empty, but admission returnsOk(()), counted bytes 0, final independent oracle 1009. This cannot be linearized at any instant during the walk.usage.rsacceptscomplete && ... self.native().is_none()and shares that unfenced success with joiners. A new walk per request does not establish freshness without a watcher/fence; missing native coverage must refuse retryably until recovery, unless another actual freshness mechanism is provided. The final test is opt-in/ignored so default gates do not mask their ordinary results with a known contract failure.SKIP physical inode reuseafter 10,000 attempts. The replacement assertions do not exercise reuse; relative to review/764-tests,assert!(reused)was weakened to an early return. This is a coverage gap, not a demonstrated bypass. A local ext4 loop filesystem cannot be mounted with this account's current privileges: zero effective capabilities, no passwordless sudo, root:disk 0660 loop devices, and ext4 mounting denied in a private user/mount namespace. No shared host block device was touched. Close the gap on a prepared inode-recycling filesystem and require actual equality there; do not cite this run as physical-reuse evidence.Verified independently:
HTTP measurements: build host, not perf VM, ten stale batches per cell. All responses and held-publication queue waits stay below 2 seconds. Receiver 429s are included in all-response quantiles; accepted-only quantiles are retained in the local log.
Reviewer preservation: compared test bodies at review/754-tests through 754g and review/764-tests against current code. Literal preservation is false: deleted internal scanner/index/scope tests have dispositions in comment 69530 and adapted Home-boundary cases. The quiet-failure assertion now requires no timer, consistent with zero idle CPU. HTTP/process assertions from review/764-tests are preserved. Physical-reuse anti-vacuity remains the P3 exception; independent tests restore partial-failure recovery and deletion with an open child descriptor rather than silently losing those assertions.
Gates: fmt check, workspace/all-target clippy
-D warnings, full workspace tests. Initial workspace invocation hit an Auth migration flake (schema_two_copy_keeps_real_credentials_sessions_and_recovery: rows 1 vs 2); isolated rerun and full subsequent runs passed. Tasks abrupt-stop tests passed; no Tasks flake rerun was necessary. The known fallback-contract reproducer fails as documented and is not included in default passing gates.Logs, full-precision measurements, test-body inventory/diffs, and incremental findings are under
/home/agent/codex-jobs/verify-764b/on this machine. No merge, deployment, or perf-test VM access.Reviewer tests pushed only to
review/764b-tests, commit4222b5eb. No production behavior changes; the Auth fd-exhaustion fixture adds a dev-only rustix dependency. Final fmt, clippy, and full workspace commands all exited 0.Round 2 implemented at
d0e6d6f60f688a8e1f71abbc54f28a558d471ab1onperf/quota-simple.Fetched first and incorporated
origin/review/764b-tests(4222b5eb) by fast-forward. Three small commits:241d48f0(verified admission),8bd896ea(physical inode reuse),d0e6d6f6(real Auth fallback property).P2 root cause: a complete but unfenced fallback walk returned success, and joiners were also allowed to accept it despite having no fresh counted generation. The unchanged adversarial reviewer reproducer failed before the fix with a zero count while Home was never empty; it now returns retryable WouldBlock (final oracle 1009, minimum during transfer 202). Fallback recounts remain provisional and never authorize admission until native coverage recovers. An optional
VerifiedCountowns its completed total and generation;fresh_bytesis the single Auth admission read and rejects absent/stale generations, including invalidation while providers run. Default display bytes cannot become admission bytes.P3: the inode test uses
CALTERNAL_INODE_REUSE_DIR, skipping clearly only when unset. With it set, failure to reuse is a failure. Inside the mutation checkpoint it verifies deletion of the old object, identical st_ino for the new directory, and absence of the old contents before checking quota behavior. On/srv/inode-reuse, actual directory inode 16 reuse passed; replacement bytes and the later write were both charged. Updated the plan failure table.Reviewer tests were retained. Explicit behavioral adaptations: the fsio 16-caller fallback test now requires WouldBlock while retaining its exactly-one-walk, exact display bytes, stale generation and polling assertions; the real HTTP test now requires retryable refusal and zero publications while retaining its concurrent requests, timing, accounting-reachability, Health and exact final bytes checks. The physical-reuse test replaces its unsuccessful-reuse early return with mandatory reuse assertions when configured. No reviewer test was deleted or relaxed; the non-linearizable-walk reproducer itself is unchanged and was run explicitly.
Final gates on 10by32-02-std, all exit 0 / zero test failures. Heavy commands used
/usr/local/bin/build-slot.sh, Cargo builds/tests-j6; filesystem/Auth and workspace gates usedCALTERNAL_INODE_REUSE_DIR=/srv/inode-reuse:cargo fmt --all -- --checkcargo clippy --workspace --all-targets -j6 -- -D warningscargo test -j6 -p calternal-fsio(reviewer tests included)cargo test -j6 -p calternal-auth, plus finalcargo test -j6 -p calternal-auth --lib quotaafter adding the Auth fallback propertycargo test -j6 -p calternal-fsio fallback_admission_must_not_accept -- --ignored --nocapture7641029,QUOTA_PROPERTY_CASES=50000: original fsio property and original Auth property both passed; new fallback recount property passed with 25,000 confirmed outside writes during scans; new real Auth fallback property passed 50,000 randomized Home/upload decisions, all retryably refused. The original Auth property exercised 23,534 admissions and 26,466 quota refusals.cargo test --workspace -j6Logs:
/home/agent/codex-jobs/fix-764-round2/(including red/green reproducer, inode proof, shipping fmt/clippy/Auth quota, final fsio/workspace, and all four 50,000-case property runs). Standard pre-existing ignored long/perf tests remain ignored; the contract reproducer was enabled explicitly. No perf VM work, performance claim, PR merge or deployment.Independent verification, round 3 — ship for
d0e6d6f60f688a8e1f71abbc54f28a558d471ab1. No remaining P1/P2/P3 findings from the requested admission-freshness audit. Reviewed55622509..d0e6d6f6, called counter/watcher/scanner/Auth/client code, plan 0754, and both prior review reports.The previous P2 is closed: its explicitly enabled non-linearizable fallback reproducer now returns retryable
WouldBlockwith provisional display=0, actual Home=1,009, and minimum observed Home=202. Admission readsfresh_bytes; never-counted/provisional totals cannot stand in for a completed fenced total. Concurrent joiners also refuse the unfenced outcome.Tests added independently on
review/764c-testsat9eddde38(tests only):8943029071and3829174059. Missing-native fallback, failed-watcher/recovered coverage, overflow, deletion/empty count/recreated Home, expired recount, delayed events, poisoned display total, display recount and startup/restart. Respectively 38,857 and 38,835 exact accepted reads against the independent filesystem oracle; every fallback/failed-watcher read refused. Deterministic runtime-failure simulation uses healthy=false plus production dirty-all transition, then restores the still-live reader; separate real missing-native initialization recovery is also asserted.Additional evidence:
9183674521: filesystem oracle, real Auth quota, fallback recount with 25,000 outside writes during scans, and real Auth fallback admission.CALTERNAL_INODE_REUSE_DIR=/srv/inode-reuseactually reusesst_ino=16; mandatory assertions verify deletion of the old object, equality of the reused inode, replacement charge=16 and later mutation charge=117. Also included in full workspace gate with the env set.Required gates all exit 0:
cargo fmt --all -- --check;cargo clippy --workspace --all-targets -j6 -- -D warnings;CALTERNAL_INODE_REUSE_DIR=/srv/inode-reuse cargo test --workspace -j6. Workspace log: 106 successful test-process results, zero failures (1,279 passing test reports including nested-child repetitions). No Tasks failure/rerun. Heavy work through/usr/local/bin/build-slot.shat-j6on10by32-02-std; no perf-test VMs, merges or deployments.Findings, exact reproducer commands and logs:
/home/agent/codex-jobs/verify-764c/on this host; full reportfindings.md. Nothing except tests committed/pushed.Perf-VM measurement (perf-test-02, x86_64 4c, uncached 4K disks, release builds; coordinator 29 Oct). dev =
d83e54db, #764 =d0e6d6f6.Idle (6 × 300 s windows per size)
Upload right after /healthz = 200 (1 KB)
Server log:
storage measurement is pending; retry the uploadsurfaced asinternal. Blocking: the pending/deadline case must be a proper retryable response, recounts should start at startup, and the cold 100k recount must get faster. Fix job quota-fix-3 is running.🤖 Generated with Claude Code
Implemented the startup-upload follow-up at
b6b971151aeb4d590daa578b8c0bc8f78cb96655onperf/quota-simple.storage_busy,retryable: true, andRetry-After: 1, using the existing API error envelope. This includes Auth prepare/admit and the shared HTTP measurement/placement wrapper used by attachments and backdrops. Contacts/import/action paths retain the same typed error. DAV upload and tus adapters are not implemented in this checkout.statx, skips non-chargeable knownd_typevalues, and reads 64 KiB directory batches through the pinned fd. Regular files still require metadata for size and file bind-mount exclusion. Inode pin/watch installation, event fences, generation revalidation and conservative admission remain intact. Subtree traversal remains serial. A warm-cache release probe of two independent 50k-file Homes sharing one Usage/watch registry took a median 265.6 ms serialized versus 538.4 ms with two simultaneous recounts (three runs each). This supports keeping one background walker on this host; uncached-disk behavior still needs the coordinator’s perf-VM measurement.storage_busyretries stay quiet for several seconds (up to six attempts/eight seconds of retry scheduling, capped two-second backoff). Existing other-error retry behavior is retained. Included the newerreview/764c-testscases; legacy reviewer expectations for 500/internal now assert 503/storage_busy instead. Regression teardown now drains worker-held references before deleting fixtures, preventing a fence-directory cleanup race; the affected coverage regression also passed ten consecutive repeat runs.Gates: fmt; clippy -D warnings; full workspace tests; the properties — PASS.
Commands use
/usr/local/bin/build-slot.sh; Rust builds/tests use-j8:cargo fmt --all -- --checkcargo clippy -j8 --workspace --all-targets -- -D warningsCALTERNAL_INODE_REUSE_DIR=/srv/inode-reuse cargo test -j8 --workspace --no-fail-fastQUOTA_PROPERTY_CASES=50000 cargo test -j8 -p calternal-fsio -p calternal-auth property -- --nocapture, plus the separately namedseeded_fallback_admission_never_uses_an_underestimateat 50,000 cases. All four properties pass; Auth quota decisions include 23,398 admissions and 26,602 quota refusals./srv/inode-reuse.Build host measurements — shared arm64
10by32-02-std, release probe, btrfs, 100 directories of 1 KiB files; median of three initial verified recounts (includes initial watch installation and verification):These are warm filesystem-cache / initially unmeasured counter results, not cold-cache timings.
/usr/local/sbin/perf-drop-cachesdoes not exist here and noninteractive sudo is unavailable, so I cannot provide a valid cold-cache measurement on this host. The coordinator should repeat cold measurements on the perf VM.The same 10k-file syscall probe (initial verification plus one subsequent recount) reduced
newfstatat30,300 -> 0,getdents641,216 -> 610, and total calls 114,646 -> 82,837. A steady regular-file pass now needs onestatx; a new file additionally needs its pinned open/fstat/inotify-watch/close.usage-timingis included as a release example for repeating the recount probe.Independent verification of
d0e6d6f6..b6b97115on 10by32-02-std (aarch64). Verdict: fix first.503 storage_busy/Retry-After: 1clients all schedule attempts at exactly 0/1000/2000/3000/5000/7000 ms: 96 requests in synchronized waves. Attempts/time are bounded and nonretryable errors stop immediately, but the requested anti-herd property is absent. The shorter prior loop already lacked jitter; the extended busy loop retains it. Independent deterministic reproducer:REVIEW_764D_REQUIRE_JITTER=1 node --experimental-strip-types --test apps/web/src/lib/upload-retry-review-764d.test.mjs(expected failure: all 16 schedule the same retry). Add bounded jitter while retaining Retry-After and attempt/time limits.reliability_round3.rs:592, recursive file count 1 vs 0. A diagnostic copy preserving the original assertions failed twice in 100 isolated runs; both counted paths were.calternal-tmp-quota-state/fence-*, not leaked upload files. The original blanket recursive count races the quota fence. Reproducer, repeat as needed:/usr/local/bin/build-slot.sh cargo test -j8 -p calternal-auth --test review_764d_cancel -- --ignored --nocapture. Synchronize counting or distinguish only these private fence markers while preserving real upload-cleanup assertions. Original tests were not edited; the added diagnostic is opt-in.Verified independently:
/healthzbefore its initial quota watch set completes. Both separate 300-second healthy/unreadable-Home observations show zero additional event/recount worker CPU ticks; unreadable Health retention and exact recovery pass. Build-host warm-cache / kernel-clock-tick evidence, no cold-cache perf claim.764430102907(filesystem oracle, real Auth quota, real Auth fallback),764430102911(mutating fallback),764430102919(mode switches). No stale/provisional approval found; 38,749 exact accepted mode-switch reads, all missing/failed-native fallback reads refused./srv/inode-reuseactually reuses directory inode 16, with mandatory replacement/later-write assertions. The explicitly enabled non-linearizable fallback reproducer passes by refusing the unfenced count.d0e6d6f6, so literal preservation against every old 754 snapshot is not claimed. Snapshot diffs and function inventory are saved.Required gates: fmt PASS; workspace/all-target clippy -D warnings PASS; full workspace tests PASS on the subsequent complete
--no-fail-fastrun. The first gate failure remains the P3 above, rather than being hidden by that green rerun. Added normal client checks pass; the opt-in jitter contract fails as documented. Heavy work used/usr/local/bin/build-slot.sh, Cargo-j8.Tests only:
review/764d-tests, commit 7025c29b. Findings, exact commands, reviewer diffs and logs:/home/agent/codex-jobs/verify-764d/findings.mdon this machine. No production edits, merges, deployments or perf-test machine access.Fixed P2/P3 from comment 69856 in
a506b739f001c85336ae8a234aadbfcd2d78e3f2onperf/quota-simple. First incorporated reviewer branchreview/764d-tests(7025c29b).Validation on
10by32-02-std(arm64), using/usr/local/bin/build-slot.shand Cargo-j8:cargo fmt --all --check: PASS.cargo clippy --workspace --all-targets -j8 -- -D warnings: PASS.CALTERNAL_INODE_REUSE_DIR=/srv/inode-reuse cargo test -j8 -p calternal-fsio -p calternal-auth --no-fail-fast: PASS, including the actual inode-reuse test.CALTERNAL_INODE_REUSE_DIR=/srv/inode-reuse cargo test --workspace -j8 --no-fail-fast: PASS.REVIEW_764D_REQUIRE_JITTER=1 node --experimental-strip-types --test apps/web/src/lib/*.test.mjs apps/web/scripts/test/*.test.mjs: 37/37 PASS, no skips.Evidence retained at
/home/agent/codex-jobs/quota-fix/(client-red.log,web-unit.log,clippy.log,quota-gate.log,workspace.log,cancel-stress-checked.log). Worktree is clean and itstarget/has been deleted. No PR merge, deployment, or perf-test machine access.Plan-first amendment: #769, targeting
perf/quota-simplefroma506b739. Onlydocs/plans/0754-quota.mdchanges.Validation: 1,828 amendment words; three A4 pages at 10.5 pt body / 9.5 pt tables, 14 mm margins; Forgejo GFM HTTP 200 with all 22 rows and both amendment tables;
git diff --checkand docs-only scope checks passed. New perf values are not claimed. No product code, build/test run or deployment.Head:
6c3f7f8a4f.Receipt accounting and bounded parallel cold enumeration are implemented, but this is not merge-ready. Default-layout database writes still cause Home recounts and fail the typing gate; state migration or a proven in-place database accounting protocol and final perf-VM qualification remain outstanding. The final-head workspace run also exposed an intermittent startup Home-deletion/fence race; its rerun results are recorded below.
Implementation head:
86f48a39bcace15c13dbcd812cb2e991552d1e17onperf/quota-simple.Plan amendment:
85f4c31c38becd61000c2efd4ae6dff416729892ondocs/quota-plan-2, quoted in #769 (comment) and merged into the implementation branch.Closed-image atomic writes, prepared note saves, streamed uploads and tracked batch file publications use pinned inode identities, watch incarnations, covered size observations, ordered fences and bounded cookie-paired receipts to commit signed byte deltas exactly once. Content notifications are never consumed as echoes. Unmatched events, outside replacement/link changes, overflow, watch loss and failed or canceled operations invalidate authority. Publication/accounting and provider transactions share an owned per-Home permit; the event reader never takes it. Recounts check both external generation and accounting sequence, and serialize their watch-set changes/final commit. Contacts provider errors refuse admission instead of contributing zero. Relative state roots are matched against SQLite's absolute filenames. Complete display-only recounts with an unhealthy listener may publish a provisional snapshot without clearing newer dirtiness or authorizing admission; accounting-sequence changes still reject old snapshots.
Cold enumeration retains fd-relative no-follow/mount checks and descriptor reuse, moves independent substantial directories to at most eight workers, and coalesces new-watch invalidations within each rejected scan attempt. d_type remains a hint; size, identity and mount metadata checks remain.
Added deterministic coverage for pre-watch growth/truncate/replacement, post-watch changes, outside grow/truncate/rename-over/hard links/equal-size writes/restored mtime, two prepared same/different-destination writes, delayed ordered delivery, recount/prune versus a newer delta, receipt overflow, cancel/reject/retirement, checked-provider failures and transitions, relative state roots, and a prepared save racing real Auth upload admission with positive recovery. Kernel order is preserved; userspace batching and concurrent operation scheduling are varied.
Reviewer tests and assertions are retained. One superseded product assertion was adapted:
app_publication_adds_known_bytes_without_authorizing_a_provisional_totalis nowcovered_app_publication_adds_exact_bytes_without_a_recount; a separate dirty/unmeasured test retains the refusal obligation.simple_tests.rsadds only a hook-presence helper so deterministic single-thread scanner hooks remain deterministic. No reviewer assertion was removed.Performance qualification remains blocked for the default layout: public in-place DB/WAL/SHM writes retain conservative Home invalidation. This change does not implement a state migration or a replacement physical-DB accounting protocol. Namespace/directory transitions without a complete receipt proof also retain conservative recounts. The full W01–W22 VM evidence checklist, including long-note/search/history variants, capacity/failure recovery, 1M/100-Home cases, flat folders, upload concurrency and both state layouts, remains required before product merge; unrun cells are missing evidence.
Required gates (verbatim): fmt; clippy -D warnings; full workspace tests; the properties. Formatting, clippy, and the properties passed on the head above; the full workspace suite passed on rerun with the intermittent failure below still unresolved. The first final-head workspace run failed unchanged reviewer test
one_low_priority_startup_worker_converges_after_home_creation_and_deletion_then_parksat its recursive Home deletion (DirectoryNotEmpty). The isolated test and full suite then passed on unchanged source. The background Home fence creation versus recursive deletion race is an observed intermittent failure, not a resolved issue; no reviewer assertion was changed or retried inside the test. All cargo build/test commands used/usr/local/bin/build-slot.sh,-j8where supported, andCALTERNAL_INODE_REUSE_DIR=/srv/inode-reuse.The five 50,000-case properties cover whole-Home accounting, real Auth admission, Auth fallback admission, filesystem fallback admission, and random mode switches. Auth admission had 23,513 admitted and 26,487 quota-refused cases. Fallback properties deliberately verify retryable refusal; the normal Auth property and save/upload race also require positive admission. Actual kernel overflow and the explicit non-linearizable fallback reproducer passed. An earlier combined runner stopped with signal 143 during mode switches. A rerun exposed a failed-listener display recount exhausting its retries while queued events advanced the dirty generation. The follow-up fix retains newer dirtiness and refuses admission while allowing a complete provisional display count only when the listener is unhealthy; healthy coverage gaps retain the existing retry behavior; a deterministic regression was added. Required gates were rerun on the final head. No success was inferred from the interrupted or failed run.
The existing five-minute clean-idle/deadline probe, clean usage-worker CPU probe, and unreadable-subtree idle/recovery probe each passed in a separate process. Existing ignored diagnostic/privileged tests remain marked as such; full workspace tests does not imply every ignored diagnostic ran.
Build host measurements: 10by32-02-std, arm64, shared host; release build on predecessor
88a61f3df8b8e04add12eb9e1be2ed4cc1287a75. The final follow-up changes only unhealthy-listener display recounts; these measurements were not repeated after that fix, so final-head VM measurements remain required. Each save loop runs 60 seconds, 300 edits and 60 explicit saves through real Notes + Engine. Notes file watcher and auto-rename are disabled, so these isolate the save path and do not qualify the full client/search/long-note W01/W02/W07/W09 scenario. Fixtures have 1 KiB files distributed across directories of 1,000 files, plus the note and app state. CPU is process user+system time as a percentage of one core; setup/shutdown are excluded.Every loop ended with verified bytes equal to an independent quiescent physical-file oracle. Coverage-cold starts from a fresh Usage counter and native watch coverage and includes all passes needed for a verified count. OS page cache was not dropped on this shared host; these are not cold-I/O or perf-VM measurements. The coordinator must remeasure on the perf VM. Default layout fails both the 2% CPU and zero-own-save-recount criteria. Split-state figures are isolated build-host evidence, not final VM acceptance.
Raw measurement log:
Explicit property/overflow evidence:
Idle logs:
W01–W22 qualification checklist on this head (all perf-VM cells remain missing):
Product merge remains blocked by default-layout accounting and missing VM qualification. No dev merge, deployment, or perf-test-* access was performed. Logs and benchmark sources remain at
/home/agent/codex-jobs/quota-owned; no logs were committed.Baseline on
origin/devd83e54db(= prod), perf-02, 100,000 notes, 6 repetitions (calternal-perf --sizes 100k --runs 1 --cold-runs 0 --idle-secs 300; each rep is a fresh server on the same indexed Home; method as in docs/perf/budgets.md). Run viaperf/vm/typing-idle.sh(PR #787).load.typing_cpu_pct(5 chars/s, 60 s, save check every 5, 1 watcher)load.typing_wakeups_per_sidle.cpu_pct(300 s)idle.wakeups_per_sidle.rssPer rep (idle % / typing %): 0.67/1.15, 0.53/1.22, 0.64/1.12, 0.65/1.12, 0.65/1.12, 0.65/1.13.
Noise: typing is tight (about 9 % spread, one outlier). Idle CPU is read in 10 ms ticks over 300 s (0.01 % per tick; 159-201 ticks), so 0.53 is the one low run and the rest sit at 0.64-0.67. Matches the coordinator's earlier perf-test-02 number (0.630 % / 107.3 MiB). Setup:
claude@calternal-perf-0{1,2}-backup01, AMD Ryzen 7 3700X guests (KVM), 4 vCPUs, 7.7 GiB, ext4 on a non-rotational virtual disk (uncached), no cpufreq interface (MHz constant at 3593; frequency cannot be observed). Binaries:origin/devd83e54db, release, built on dev-01 (sha256 ofcalternal2ac46c10...). Steal time 0.07-0.12 % per run. One measurement at a time viaflock /tmp/perf.lock.Raw files on perf-02:
~/perf/out-typing-dev/.quota/cold r4 retained results
Budgets: typing CPU <=2%; idle CPU <=0.1%; idle RSS <=100 MB; wakeups <=0.2/s. Six matched pairs per comparison required; matrix stopped at quota-4.
13 runs completed, one failed run (quota-4). Two completed samples are excluded from matched comparisons. Available accepted pairs: quota rounds 2–3 (2/6); cold rounds 1–3 (3/6). dev-quota-4 is valid but unpaired. No six-pair qualification or cold-growth gate is claimed. Remaining runs: quota-4 retry, dev-cold-4/cold-4, and every arm of rounds 5–6 (11 invocations total).
disposition, diagnosis and reproduction
The r4 script had already exited after quota-4; no quota r4 process or measurement lock remained to stop.
typing-idle.shwrites DONE andrc=0even when the driver records scenario failures (it does not pass--gate). The outer r4 script correctly rejects a nonemptysizes[0].failures; that check caught quota-4. Treating DONE or rc=0 alone as success would be a harness error.Exact failure: HTTP 200,
result={"incomplete":true,"items":[],"next":null,"total":0}. There was no quota refusal or failed HTTP status. The failed fixture's derivednotes/meta.dbhad zero notes, schema 4, statsnotes=0, andPRAGMA quick_checkreturnedok. The retained warm server log contains the development-mode warning, with no recorded scan/disk error. The first-page harness incrates/perf/src/scenarios/home.rsrejects any empty list immediately;server.rswaits only for/healthz. Notes explicitly allow a partial list before Home discovery completes (Notes::pageandthe_first_page_never_waits_for_the_home_to_open).incomplete:truealone is not evidence of a product defect.Functional reproduction on dev-01, using a copy of the exact failed quota-4 userdata and appdata and the existing quota binary (SHA256
9c055318e954f79d0309dc6c99637eff98df35fba06c506cb28167730a10078d), under~/bin/slot, with no build or perf claim:calternal serve --create --listen 127.0.0.1:<free-port> --dev-user 0192f0a0-0000-7000-8000-00000000f1f0 --data <copy>/runs/n100000/indexed --state <copy>/appdata/runs/n100000/indexed, withGLIBC_TUNABLES=glibc.malloc.arena_max=2./api/v1/actions/notes.listwith{"limit":50},Content-Type: application/jsonandX-Requested-With: calternal. At 0.021s: 0 total / 0 items / incomplete=true, reproducing the r4 assertion failure.Verdict: observed failure is a harness readiness/precondition failure on a rebuilding cache, not evidence of a persistent list failure under quota or cold growth. The source of the earlier derived-cache reset is not established.
MetaDb::open_withon the measured quota head silently removes/rebuilds the derived DB after any open error, so a storage/open problem is a possible cause; neither corruption, ENOSPC nor a quota-specific regression has been proved. Do not call this root cause closed: a separate clean rerun needs logs of the first open error and cache counts before/after cold-to-warm handoff. Keep a genuine complete-first-page warm-start gate if that is the intended product requirement; otherwise explicitly wait for readiness outside typing/idle measurement, with a deadline and preserved startup timing. Do not silently weaken that gate or count quota-4 as passed.Measured stack is #764
75978ddb5ed30152a85fbb1d766a62d5c5a73113and #7678b5b8cdc74385b3bcbf1540d1c612c075952ef06(the quota/cold-on-tiering work), using the common driver SHA2562e3656cd3255e5d6b590705e2c5ea521f8d1dd7642fcb26b7f3aa8eaad94e4fc, and typing script13c2e7bf6489663fcf99f21ddc010118d27e5a33e773c9f89be0a1ff113df90b. Successful retained candidate samples pass all four absolute typing/idle budgets. This is not a completed paired qualification and does not establish the cold-growth <=10% gate.Small JSON/MD reports, run logs, scripts and reproduction observations are retained on perf-02 at
~/perf-reports-kept/takeover-20261101/quota-r4/and on control at/home/kayg/perf-reports/takeover-20261101/. Seeded r4 work/Homes are removed after copying the diagnostic fixture; the dev-01 copy is removed after both exact child processes have exited. The previous r2 cleanup was left untouched until it finished; only then were seeded Markdown Homes inadvertently copied into its report directory removed, retaining its real top-level reports. No merge or deployment.Final cleanup verification
Both 759b units stopped; quota r4 had already exited. All takeover cleanup and reproduction processes have exited. Earlier r2 cleanup completed untouched. Final free: perf-01 root 51G, split Home 58G; perf-02 root 37G, split Home 97G. Shared locks are held by #792 qualification (159697 / 1325428), not the stopped jobs. Cleanup/fixture-copy I/O overlapped the first #792 samples; those samples need overlap exclusion. Retained observations do not establish why quota-4 cache was reset.
Perf-02 cleanup and fixture-copy overlap was approximately 17:13–17:22 IST on 1 November (11:43–11:52 UTC). The earlier r2 file walk also overlapped #792 startup until it completed. #792 first overlapping samples must not be treated as uncontended measurements. No #792 process was stopped.
paired requalification blocked by rebase conflict
Current PR head:
75978ddb5ed30152a85fbb1d766a62d5c5a73113(perf/quota-simple). Target checked: origin/dev55f35fcde3bc91ca3781055577b93e93819f6cd4.An isolated test branch ran
git rebase origin/dev. It stopped at step 2/64, applyingaef9715e(WIP fixes), with content conflicts indocs/storage.md:.calternal/settings.jsonversus the stacked userdata/appdata paths, prefs and additional task/contact state;storage splitprocedure.These describe storage behavior and recovery procedures, so I treated them as non-trivial and aborted the rebase, as requested. No conflict resolution, source edit, PR branch push or merge was performed. Both isolated worktrees returned clean to their original heads. Further conflicts beyond this first stop have not been assessed.
The r4 template on perf-02 was read; its partial retained results remain historical evidence, not a completed qualification. No builds or performance jobs were started, no performance locks were taken, and no seeded Homes or large artifacts were created. Both VMs remain available. Resume after the storage conflict is resolved by the implementation owner: fix the bounded readiness precondition, build on dev-01, relay and SHA256-check binaries, then run six fresh matched pairs per comparison split across perf-01/perf-02 under
~/bin/perf-lock.Verdict: qualification FAIL (blocked/unmeasured), not a measured product regression.
kayg referenced this pull request2026-11-05 23:21:11 +00:00
Housekeeping #1009 status: audited head
75978ddb5ed30152a85fbb1d766a62d5c5a73113against devcd7f84432feb.git cherry origin/dev <head>reports 64 unmatched commits and 0 equivalent patches. Separate stable patch-id indexing and key-file checks do not establish full landing. Absent from dev:apps/web/src/lib/upload-retry-jitter.test.mjs,apps/web/src/lib/upload-retry-review-764b.test.mjs,apps/web/src/lib/upload-retry-review-764c.test.mjs. Left unchanged as WIP, per kayg’s instruction; no rebase, close, tests, or merge. The #1009 audit records the unmatched commit list.View command line instructions
Manual merge helper
Use this merge commit message when completing the merge manually.
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.