Mail P1: fixtures, fake provider, netguard, plugin skeleton, SMTP spike #932
Closed
kayg
wants to merge 0 commits from
feat/mail-p1 into dev
pull from: feat/mail-p1
merge into: kayg:dev
kayg:main
kayg:port/tasks-float-2
kayg:fix/train-1116-2
kayg:fix/train-1116-3
kayg:fix/train-1116-1
kayg:fix/flake-1134
kayg:fix/server-1182
kayg:dev
kayg:port/notes-float-3c
kayg:docs/auto-update-ig
kayg:feat/dav-transport
kayg:port/tasks-float-1
kayg:wip/mail1011-sv-order-1116
kayg:fix/flake-1179
kayg:fix/flake-1178
kayg:fix/guards-1153-fsio-split
kayg:fix/guards-1153-notes-split-we
kayg:fix/guards-1153-notes-lib
kayg:fix/guards-1153-notes-home
kayg:fix/guards-1153-ui-primitives
kayg:fix/guards-1153-primitives-e2e
kayg:fix/guards-1153-visibility-doc
kayg:feat/paper-grey-1116
kayg:fix/flake-1165
kayg:fix/flake-1119
kayg:docs/imap-766-plan-v2
kayg:fix/e2e-unique-ports
kayg:t3/paged-search-reconcile-final
kayg:wip/mail1011-final-1115
kayg:docs/tasks-float-port
kayg:perf/editor-first-paint-1c
kayg:feat/imap-notes-fetch
kayg:feat/imap-notes-projection
kayg:feat/imap-notes-readonly
kayg:feat/imap-notes-auth
kayg:feat/imap-notes-server-foundation
kayg:wip/mail1011-txn-ownvocab-1115
kayg:wip/mail1011-txn-novocab-1115
kayg:perf/p1117-final-harness
kayg:perf/single-shot-repeats
kayg:port/tasks-matrix
kayg:wip/mail1011-txn-1115
kayg:fix/static-gates-1155
kayg:feat/files-s1-identity-r7
kayg:fix/files-r7-idle-loop
kayg:fix/daily-train-1152
kayg:port/notes-float
kayg:fix/editor-tables-test-types
kayg:port/notes-float-listscript
kayg:feat/tasks-actions
kayg:port/notes-float-phone-preload
kayg:perf/sound-comparator
kayg:port/notes-float-listscroll
kayg:port/notes-float-budgets
kayg:port/notes-float-suite-fix-b
kayg:port/notes-float-sidebar-fix
kayg:port/notes-float-trim
kayg:port/notes-float-3-lists
kayg:fix/attachments-meta-capability
kayg:docs/carddav-writes-v2-plan
kayg:feat/contacts-companion-pure
kayg:issue/carddav-read-perf-fix-r2
kayg:issue/carddav-read-r2
kayg:port/notes-float-devsync2
kayg:review/calendar-2
kayg:review/switcher-a-pills
kayg:port/notes-float-switcher-a
kayg:port/port-tables-2
kayg:review/switcher-ends
kayg:wip/whiteboard-s1-1114
kayg:port/port-tables
kayg:wip/mail1011-perfneutral
kayg:review/photo-tint
kayg:port/notes-float-shell
kayg:wip/local/collections-db
kayg:wip/local/mail-p1
kayg:wip/local/cold-growth-on-tiering
kayg:wip/local/tiering-v3-s1
kayg:wip/local/wal1051-cap
kayg:wip/local/tiering-v3-s1-resume
kayg:wip/local/index-position-startup-scan
kayg:port/notes-float-flat
kayg:port/notes-float-promote
kayg:wip/handover/mail1011-candidate
kayg:wip/handover/files-s1-candidate
kayg:port/notes-float-shell-only
kayg:port/notes-float-perf
kayg:feat/whiteboard-s1
kayg:feat/tiering-v5
kayg:fix/app-switch-hitch
kayg:wip/local/files-s1-dev-v4-final
kayg:feat/files-s1-dev-v4
kayg:fix/c2-glass-shared
kayg:feat/flat-lists
kayg:wip/handover/whiteboard-s1-resume
kayg:wip/att-lazy-861
kayg:feat/switcher-browse
kayg:wip/att-lazy-860
kayg:feat/tasks-float
kayg:recovered/flat-backup-candidate
kayg:perf/stalls-1054-kc
kayg:land/ai-toolbar
kayg:feat/collections-db
kayg:feat/collections-db-fixes
kayg:codex/mail-1011-redesign-20261111
kayg:fix/ai-toolbar
kayg:backup/macos-vm/st3-head
kayg:perf/trim-candidate-phonestack
kayg:feat/switcher-three
kayg:fix/1051-index-idle-checkpoint
kayg:perf/stalls-1054-kb
kayg:perf/stalls-1054-k
kayg:perf/stalls-1054-r3
kayg:fix/c2-contrast-tail
kayg:perf/stalls-1054-r3-preview
kayg:feat/collections-before
kayg:feat/tiering-v4
kayg:fix/timelog-caret
kayg:wip/local/tasks-actions
kayg:docs/tasks-writes-v2-plan
kayg:st3-r3
kayg:feat/pass8
kayg:review/calendar-2-before-1111
kayg:wip/tiering-v3-cold4
kayg:perf/stalls-1054-r2
kayg:fix/suite-A4
kayg:fix/suite-A5-probe
kayg:fix/suite-A6
kayg:fix/suite-A3
kayg:fix/suite-A2
kayg:fix/suite-A5
kayg:fix/suite-A1
kayg:wip/local/attachments-861-fix
kayg:feat/contrast
kayg:wip/local/ports-861
kayg: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!932
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/mail-p1"
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?
Second-review implementation plan (79123)
Identity: replace the dense global content ordinal with a content-derived rank key plus an ordinal only among byte-identical copies. A dense ordinal cannot remain immutable when a lower content hash arrives later. This change accepts later same-folder duplicates without an inventory prerequisite, retains published identities and mirror reconstruction, and does not register Mail. Tests cover all splits/orders, later distinct and identical copies, replay, moves and rebuild. Work stays indexed by fingerprint; no account-wide restaging.
STARTTLS: one deadline (the client timeout, capped at the RFC five-minute command timeout) bounds writing and the complete multiline reply. Keep the RFC 512-byte line bound and add a total reply cap. Every error shuts down the owned socket; tests cover silence, continued lines, overlong lines, normal multiline replies, EOF and ownership.
Build graph: profile immutable dev and review heads before changing dependencies. Isolate the SMTP experiment behind its crate-local
spikefeature (default off), with explicit feature-enabled build, clippy and test CI coverage. The default Cargo graph is tested to exclude mail-send. This is not a product feature flag. Re-run dev gates and two P1 perf runs with both locks and controls after identity changes. Artifacts and before/after costs remain in PR comments.Review 78967 correction plan
Keep every existing limit. Add red/green regressions for hard-denial exceptions, the checked-target API, duplicate Message-IDs, generation-keyed placements, member opens after thread rekey, split-batch identity, SMTP stream closure, and fixture dependency layering. Enforce Rustdoc on every public item in this lane. Record matched dev/final workspace and incremental build/check costs (ADR 0008), then final workspace gates and two complete P1 perf runs with both shared locks and controls at 1k/100k/250k/500k/1M, 1/5/20 accounts, and raw 50k.
Identity decision (second review): use immutable content-derived rank keys plus ordinals only among byte-identical copies. Dense ranks across distinct hashes cannot keep published ids stable when a lower hash arrives later. There is no inventory prerequisite or IncompleteInventory path; later duplicates are accepted. Byte-identical copies keep the same id set on rebuild and may interchange placements, as already allowed by the plan. The formula correction is documented in plan section 4; P1 has no deployed Mail ids to migrate.
List reads remain one covering membership range, O(log n + page); prefix lookups are indexed. Identity reconciliation uses indexed fingerprint/content facts and O(batch log batch) sorting; it never clones the account or requires a complete future inventory. No row-count or timeout limit is increased. Results and mapping go only in PR comments.
P1 list-scaling correction plan
P1 of the approved Mail architecture plan v4.3 (
docs/plans/mail-architecture.md, section 18; backend-only exception Q16). Nothing in the running app calls any of this: themailplugin is not registered anywhere.No open PR or issue covered this work (searched open PRs: only #920 plan, merged; #918/#919 shared fixes are a separate lane and untouched).
What is here
netguardmail-modelakey,fp,msg id), envelope, thread builder (union-find), reference implementation of the section 4 identity rulesmail-fixtures(seed, account, index)→ bytes, out-of-order threads (newest/oldest/shuffled walks), 20 accounts, MIME zoo (30 cases), 1 GB sparse streammail-providerMailProvidertrait, fake provider, fault injection: drop, truncate, delay, duplicate, throttle, auth fail, UIDVALIDITY bump, plus a reproducible chaos planmailstate.db+cache.dbschemas from section 5, read-onlymail.page/mail.threads/mail.threadmail-testkitmail-smtp-spikemail-send0.7 against the send rules, scripted SMTP server,send_state_machineclient-side rowsmail-bench+perf/budgets.jsonDecisions
mail-sendis used withdefault-features = false, features = ["ring", "tls12"](no DKIM, builder, MD5 auth);ringis already in the lock file.Cargo.lockgains the new crates' dependencies only (no version bumps of existing ones).Gate and perf tables follow as comments.
🤖 Generated with Claude Code
P1 review correction: fixture-loader build spread is removed entirely. The plan’s linear-build limit (within 10%) stays a hard P3 gate on the real ingest path. P1 raw 50k runs cover deterministic fixture streaming only; mirror/ingest/MIME and cold-body open gates require P3.
Gates on dev-01 (head
f22cd888)cargo fmt --all --checkcargo clippy -j4 --workspace --all-targets --locked -- -D warningscargo test -j4 --workspace --locked --no-fail-fastcheck-no-evidence,check-case-paths(with their tests)mail-benchcargo build --release --locked -p calternal-mail-benchNew tests: netguard 17, identity_rules 14, threads 5, mail-fixtures 10, fake provider and faults 12, send_state_machine 11, SMTP rules 5, mail reads 8.
Plan section 17 tests, P1 scope
mail-fixtures(1k/100k/1M, out-of-order threads, 20 accounts, MIME zoo, duplicates, section 4 fixtures)identity_rulesidentity_ruleslist_page_scaling,unified_inbox_scalingmail-bench(keyset, no OFFSET, plan checked inread.rs); perf-VM run blocked, see belowthread_build_stormmail-benchsend_state_machinemail-send; the Sent copy, power-cut-after-accept and Bcc-header rows belong to the Sender (P9)netguardstale_base(#919),restore_drill(#918)cache_rebuild,ingest_throughput,open_thread_gate,isolationmail-send 0.7 against the send rules (Q11)
SmtpClient::timeoutis a public field everycmdreads, so each command gets its own.read()has no timer of its own, so any bareread()needs a caller timeout.354and the bodycmd(DATA)then ourdata_startedhook thenwrite_message. Thedata()andsend()helpers write the body at once, so they cannot be used.start_tlsreads the220through a 1 KiB buffer and silently drops any bytes after it (shown inrule3).starttls_checkedreads the reply line by line and closes the connection if any byte follows.cmds()pipelines and it is never used (server saw no early command).Also tested: multi-line replies split across packets, mixed RCPT 250/452/550, MAIL 553, DATA 554, DATA refused before 354, drop before 354 (back to
pending), drop after the body (allunknown, marker written before the first body byte), a marker that cannot be written (no body byte leaves), slow final reply waited for, 4xx/5xx final replies, refused AUTH.Verdict: usable with a thin wrapper (the
attemptandstarttls_checkedfunctions in the spike). The in-house client is not needed. Features are trimmed toring+tls12, no DKIM or MD5. P9 decides the final wrapper. One caveat:mail-sendverifies certificates throughrustls-platform-verifier, which adds native-cert crates to the lock file.Perf VM run: not done, blocked by the disk-margin rule
The brief needs at least 30% free before a run. At 12:5x CET: perf-01
/is 73% used (26 G free of 99 G, 26% free) and perf-02/is 77% used (23 G free, 23% free). Most of it is other jobs' directories (~/perf/bm14e15 G,~/perf/fh5 G on perf-01), which I did not touch. Both VMs also have other jobs' hold units. I took neither lock for a run, released my one queued hold, and removed my binary.Smoke run of the same binary on dev-01 (a build host, not perf numbers, shown only to show the harness works and finds nothing wrong): list page p95 0.46 ms at 100k threads and 0.21 ms at 1k; unified Inbox p95 0.38 ms at 20 accounts; thread open p95 0.14 ms; thread storm 0.3 s per 100k messages; fake provider 19k headers/s at 20 ms latency; no failures. Budgets are in
perf/budgets.jsonundermail.*; the real baselines will be recorded in a comment once the perf VMs have the margin (needsmail-benchsha25608cb4990...rebuilt from the final head).Superseded by review comment 78343
The report-only fixture-loader build metric has been removed entirely. The linear-build limit (within 10%) remains a hard P3 gate on real ingest. Final-head dev gates and perf baselines will be recorded in a follow-up comment; the earlier smoke run and disk blocker above describe
f22cd888only.Orchestrator review notes before this PR can train:
mail.build_spread_pcttimes the fixture loader, which is n log n by nature, so it doesn't measure what the plan's linear-build gate is for. Remove it from P1 entirely. Keep the linear-build gate as a hard gate in P3 on the real ingest path, as the plan says. Drop the metric here rather than keep a non-gating number, because a report-only line reads like a loosened limit.220are ever accepted.Final-head dev-01 gates
Head:
d1d301346bdbc4d1251f76523af169ecac121a10.The fixture-loader linear-build function and
mail.build_spread_pctare removed. No limit was raised or changed. Plan §16 now explicitly keeps the within-10% linear-build check as a hard P3 gate on real ingest. The thread storm now checks 250k, 500k and 1M messages in newest, oldest and shuffled order, with the same group-equality and at-most-one-merge-per-message assertions. The existing STARTTLSrule3_bytes_after_the_220_are_swallowed_by_mail_send_and_caught_by_the_wrappertest is retained and passed.All commands ran in the Nix shell on
claude@calternal-dev-01-compute02, each through~/bin/slot:cargo fmt --all --checkcargo clippy -j4 --workspace --all-targets --locked -- -D warningscargo test -j4 --workspace --locked --no-fail-fastnode --test ci/check-no-evidence.test.mjsnode ci/check-no-evidence.mjsnode --test ci/check-case-paths.test.mjsnode ci/check-case-paths.mjscargo build -j4 --release --locked -p calternal-mail-benchFinal-head
mail-benchSHA256:9d3a646e800fe727682cb451cbe329b2e499b96fdc14b3a6ae134ad3566f5a41.The first pass caught a merge-counter integer type mismatch in the expanded benchmark; the final-head full rerun above passed after correction. Perf baselines are complete: full evidence and cleanup. List scaling failed in both runs against the unchanged limit; all other measured P1 checks passed.
Unified Inbox now runs every requested size across 1, 5 and 20 accounts.
unified_size_labels_keep_the_account_budgetchecks that 26 ms fails the unchanged 25 ms budget at 250k/500k/1M; disabling the account-qualified lookup produced the expected test failure (0 failures detected vs 3 required), then the restored final code passed. The full workspace rerun includes this additional test.Final-head P1 baselines: FAIL, list scaling blocks training
Head:
d1d301346bdbc4d1251f76523af169ecac121a10.Both complete mail runs exited 1.
mail.list_flat_pctwas 49.093% in A and 26.456% in B against the unchanged 25% limit (100k → 1M nominal threads). Absolute page budgets passed; that does not waive the scaling gate. No limits were raised and no failed sample was discarded. This PR is not ready to train. The failure reproduced under both shared locks; its implementation root cause has not been established by this baseline task.The fixture-loader build-spread metric and its entire linear-build function are removed. Plan §16 and the PR body keep the within-10% linear-build check as a hard P3 gate on real ingest. The benchmark now exercises unified pages at every requested size and thread grouping at 250k/500k/1M messages in all three orders. Existing latency limits, group-equality checks and merge bounds remain in force.
Provenance and method
Built on dev-01 through
~/bin/slotin the Nix shell. Relayed dev-01 → control host → perf-01; SHA256 matched at all three points:mail-bench9d3a646e800fe727682cb451cbe329b2e499b96fdc14b3a6ae134ad3566f5a41b99aea955419bc9bda05383ee1a93a3674577e7b7e8908f0d8621f52c9f10ff4calternalb389888620d06714fa5e0fc73ffe18bf285e7c98688478c33375f3ea88e6966acalternal-perf2937ac77d4b28d2b029f89ed4265f0c37a79911ae9743c12ad7bccb8f6ab0c23Control source:
9377d711217532a44973edcf63c2af0b7f7969d8(origin/devcaptured for this session). Both controls used that identical binary. Mail is a new, unregistered plugin with no equivalent dev read path; mail A/B numbers are repeat baselines, not a mail-vs-dev regression comparison. Existing product runtime code is unchanged by this PR.Measured only on perf-01 (4 vCPU, 7.7 GiB RAM, ext4). Took
~/bin/perf-lockon perf-01 first, then perf-02. Both owned holders usedsleep 7000andRuntimeMaxSec=7200and remained held throughout every window. Checks enforced ≥30% available, a 15 GiB floor, and consumption ≤70% of space free above that floor before each window. The running guard checked once per second and enforced the lock-lease deadline. No guard tripped.Initial disk margins and lock acquisition:
Commands, fresh work directory per invocation, fixtures deleted between windows:
Read/unified latency points have 400 samples each. Storm times and merge counts are one complete build per order and size per invocation. List/unified labels are nominal thread counts using the fixture's existing messages-per-thread estimate; storm counts are exact input-message counts. No 2M run was made. Ingest/mirror/MIME/images and real cold-body open are P3+ product gates; this raw run checks the P1 fixture family. Save-log growth through real backfill also requires P3; these empty schemas do not implement a backfill.
Gate verdicts
Mail baselines and every repeat delta
mail.build_smeasures fixture setup only; it is not the removed linear-build metric. Derived growth rows with nonpositive baselines have no meaningful percentage delta.mail.account_page@1accounts@1000mail.account_page@1accounts@100000mail.account_page@1accounts@1000000mail.account_page@1accounts@250000mail.account_page@1accounts@500000mail.account_page@20accounts@1000mail.account_page@20accounts@100000mail.account_page@20accounts@1000000mail.account_page@20accounts@250000mail.account_page@20accounts@500000mail.account_page@5accounts@1000mail.account_page@5accounts@100000mail.account_page@5accounts@1000000mail.account_page@5accounts@250000mail.account_page@5accounts@500000mail.build_s@1000mail.build_s@100000mail.build_s@1000000mail.build_s@250000mail.build_s@500000mail.fake_headers_per_smail.list_first@1000mail.list_first@100000mail.list_first@1000000mail.list_first@250000mail.list_first@500000mail.list_flat_pctmail.list_page@1000mail.list_page@100000mail.list_page@1000000mail.list_page@250000mail.list_page@500000mail.thread_open@1000mail.thread_open@100000mail.thread_open@1000000mail.thread_open@250000mail.thread_open@500000mail.thread_storm_merges@newest@1000000mail.thread_storm_merges@newest@250000mail.thread_storm_merges@newest@500000mail.thread_storm_merges@oldest@1000000mail.thread_storm_merges@oldest@250000mail.thread_storm_merges@oldest@500000mail.thread_storm_merges@shuffled@1000000mail.thread_storm_merges@shuffled@250000mail.thread_storm_merges@shuffled@500000mail.thread_storm_s@newest@1000000mail.thread_storm_s@newest@250000mail.thread_storm_s@newest@500000mail.thread_storm_s@oldest@1000000mail.thread_storm_s@oldest@250000mail.thread_storm_s@oldest@500000mail.thread_storm_s@shuffled@1000000mail.thread_storm_s@shuffled@250000mail.thread_storm_s@shuffled@500000mail.unified_growth_ms@1000mail.unified_growth_ms@100000mail.unified_growth_ms@1000000mail.unified_growth_ms@250000mail.unified_growth_ms@500000mail.unified_page@1accounts@1000mail.unified_page@1accounts@100000mail.unified_page@1accounts@1000000mail.unified_page@1accounts@250000mail.unified_page@1accounts@500000mail.unified_page@20accounts@1000mail.unified_page@20accounts@100000mail.unified_page@20accounts@1000000mail.unified_page@20accounts@250000mail.unified_page@20accounts@500000mail.unified_page@5accounts@1000mail.unified_page@5accounts@100000mail.unified_page@5accounts@1000000mail.unified_page@5accounts@250000mail.unified_page@5accounts@500000Failures, verbatim:
Dev-vs-dev control and every delta
This characterizes control variation, not branch-vs-dev regression.
cold.disk_writtencold.first_pagecold.indexcold.mem_peakcold.notes_per_scold.startuphome.first_pagehome.pagehome.page_bighome.page_nexthome.page_taghome.page_titlejournal.catch_upjournal.entriesjournal.pagemem.after_first_pagemem.after_opensmem.after_searchmem.idlemem.peakopen.api_getopen.long_noteopen.notesearch.catch_upsearch.first_querysearch.queryshutdownstartup.healthzstorm.convergestorm.disk_writtenstorm.dropped_clientsstorm.edits_per_sstorm.outside_editsstorm.save_ackstorm.typingsync.durable_writesync.round_tripsync.save_ackuploads.responseuploads.round_tripuploads.save_ackRaw 50k family
Disk-window records and child exit codes
Final-head dev-01 gates
Each command ran through
~/bin/slotin the final-head Nix worktree:cargo fmt --all --checkcargo clippy -j4 --workspace --all-targets --locked -- -D warningscargo test -j4 --workspace --locked --no-fail-fastnode --test ci/check-no-evidence.test.mjsnode ci/check-no-evidence.mjsnode --test ci/check-case-paths.test.mjsnode ci/check-case-paths.mjscargo build -j4 --release --locked -p calternal-mail-benchThe retained
rule3_bytes_after_the_220_are_swallowed_by_mail_send_and_caught_by_the_wrapperpassed: the wrapper rejects bytes following STARTTLS220, and a clean220passes. The added size-qualified budget test rejects 26 ms at all three sizes. It failed when the account-specific lookup was temporarily disabled, then passed after restoration. That temporary mutation was restored before the full final-head gates and release build.Temporary raw probe source (not committed)
Built on dev-01 through
~/bin/slotwith the Nix shell andCARGO_TARGET_DIRpointing at the mail worktree target. The final-head rebuild passed.Measurement runner and guard (not committed)
Cleanup confirmed: both owned
mail932-holdunits stopped at 22:45:32 IST. Both perf work directories, the dev-01 mail and control worktrees (including their build output), the temporary probe crate/scripts/logs, the control-host task worktree and binary relay were removed. All three VMs report zero loadedmail932*units. Dev-01 has 167 GiB available; perf-01/02 retain 75/33 GiB available. The pre-existing dirty control-hostmail-p1worktree was left untouched. Every requested P1 gate passed: no, list scaling failed in both runs.list-scaling investigation progress: the complete bound query is now exposed to EXPLAIN, and the plan regression checks include all list fields. the current SQL performs membership and canonical-thread payload lookups per row. an external diagnostic probe will record pager accesses (cache hits + misses, not unique pages), misses, and latency at 100k and 1m with original post-walk sampling followed by warm/interleaved 4,000-query passes.
both dev-01 builds are queued through
~/bin/slotbehind the live BM14e train lock. no perf locks are held. no limits were changed; no root-cause or passing-gate claim is made yet. the before probe must finish before choosing the fix.list-scaling investigation is blocked as of 2026-11-04 23:36 IST. dev-01 has a live
BM14etrain lock, holder PID 3910780 (bm14e-test-hold.service). the diagnostic build, origin/dev control build, and complete-query regression test waited through~/bin/slotwithout starting. i stopped only those three queued mail932 units before handback. the train was left untouched. neither perf lock was acquired and no perf fixtures were created.current pushed head:
a291e17a2db804db5e9de70a859eb6c2d0a41744. commits expose EXPLAIN for the actual bound list query and strengthen its regression test to require a covering full-page plan, with a payload-consistency test. those new tests have not run; the covering-plan assertion is expected to fail until the measured fix is implemented. no performance fix or passing-gate claim is made.static finding: the existing list indexes omit
tf.unread; the complete query also joins canonical thread payload for every result. this remains a hypothesis for the measured growth, not an established root cause. the diagnostic probe below records actual plans, pager accesses (hits + misses, not unique pages), cache misses, and latency at both sizes. it separates the original post-walk 400 samples from equal 4,000-query warming and four interleaved 4,000-query passes per size. unsafe SQLite counter calls remain outside the product workspace.no gate limit changed. the last completed full runs, on
d1d301346bdbc4d1251f76523af169ecac121a10, remain FAIL:mail.list_flat_pct49.092877% and 26.455586%, against 25%. these are previous results, not new reruns. before/after measurements, implementation, final dev gates and both complete P1 reruns are outstanding.external diagnostic probe source
continuing through the train wait as requested. all three slot jobs are queued again. dev-01 and dev-02 currently both carry BM14e locks.
expected current EXPLAIN shape, not yet measured:
expected fixed shape:
proposed covering indexes:
this requires four canonical thread payload columns on membership rows. insert/reassignment and canonical edit/delete triggers must maintain them in the same transaction; membership-specific last_ms/unread stay independent. the existing WITHOUT ROWID layout stays unchanged. actual plans and pager measurements will decide whether to apply this design.
bench preparation: fixture construction and cursor discovery outside timing; reopen the read connection so the loader cache setting cannot leak; equal untimed deep-page and first-page warmup for every size; collect at least 4,000 samples in alternating size-order blocks with distinct deterministic sample offsets. retain every existing threshold. list fixtures are retained only for the interleaved read window and removed before unified/raw families.
continuing the foreground wait as of 2026-11-05 01:00 IST; this task has not been handed back as blocked. both hosts still have live BM14e train locks (dev-01 holder 3910780; dev-02 holder 621353). on dev-01 the Chromium first pass and both 10x follow-up runs have exit files; only the train-holder unit remains active in the BM14e unit list. the holder is left untouched. the diagnostic, origin/dev control, and red-test builds remain queued through
~/bin/slot; neither perf lock is held.prepared while waiting: expected full-query plans and covering indexes in comment 78714; normal-cache regression in
0c378a08; membership-reassignment payload regression inb4670f1d; an external benchmark draft with close/reopen after loading, post-load index construction, equal 4,000-query warming, alternating 400-query size blocks, and distinct sample offsets. the endpoint 25% limit stays unchanged, and the same limit will also cover the intermediate 250k/500k points. no performance fix or new passing-gate claim is made before the required before measurements. CPU/pager probes and perf runners remain outside the repository.List-scaling root cause: before evidence
Before implementation (
b041037dread schema/query, unchanged fromd1d30134): both 100k and 1M EXPLAIN plans usethread_folder_by_rolewithout covering the payload, thenSEARCH t USING PRIMARY KEY (id=?). No temporary sort. Folder-specific pages have the same two lookups; account-scoped pages add an indexed folder subquery, not a folder table scan.The old query needs about 263 pager accesses per 50-row page at 100k and 316 at 1M. These are SQLite
SQLITE_DBSTATUS_CACHE_HIT + CACHE_MISSdeltas around the complete public page call: repeated accesses, not unique pages. At the original 400 MB loader cache, repeated warm interleaved passes still show growth even when misses are zero (pass 3: p95 0.143089 → 0.202270 ms, +41.4%). Normal 2 MB read-cache passes amplify the issue: average misses 61.564 → 315.928 per query. Thus sampling noise exists, but cannot explain the repeated size-dependent table work.The complete-query covering assertion failed before the fix. The cache-policy assertion also failed before reopening read connections; both now pass in targeted dev-01 tests. Pushed implementation: full membership payload covering indexes and transactional coherence triggers; unchanged WITHOUT ROWID table layout. Benchmark: normal read cache after fixture construction, identical 4,000-query untimed warming per size, alternating 400-query blocks, 4,000 measured samples per size. The 25% limit stays unchanged and also covers 250k/500k intermediate points. Final-head full dev gates and two full perf runs are in progress on
bf3b5f56; this is not a passing-gate claim.Before session: measured on perf-01 with perf-01 then perf-02 shared locks held together; 1,800-second holder leases, now both stopped. Both surrounding identical origin/dev (
9377d711217532a44973edcf63c2af0b7f7969d8) controls exited 0. Disk reserve/lease guards passed; fixture directories were deleted. Binary SHA256page-probe-before:f4b7306b6c9c68696af3da4390842409dbc6abdbd9d334c9eccc3cd7d89fcdfc.Exact before plans, pager counters and timings
Final-head scaling correction: both complete P1 runs PASS
Head:
bf3b5f56cc98291a7b55135f606ef6c86932ecd2.mail.list_flat_pct: 0.286302% (A), -4.420381% (B), against the unchanged 25% limit. Every P1 gate in the requested fixture/read/SMTP/netguard scope passed. The original FAIL results remain in comment 78549: 49.092877% / 26.455586%; no failed run was discarded and no limit was raised.Cause and fix
The original complete bound query used a membership index and then canonical-thread primary-key lookup per result. No temp sort; the folder membership subqueries used their indexes. Even with zero misses and equal warming, the old query's pager work grew from about 263 to 316 accesses per 50-row page. Both locks and the before controls passed; noise alone did not explain this growth. Full before evidence is in comment 78892.
The fixed query reads the complete payload directly from the ordered membership index. The membership projection copies subject/from/count/flags; insert, reassignment, canonical edit and delete triggers keep it coherent in the same statement. Membership unread/sort values stay independent. The existing WITHOUT ROWID layout is unchanged; no unmeasured layout change was introduced. P1 has no deployed registered mail plugin or persistent-user migration to run.
Both 100k and 1M now explain as one covering range, with no per-result thread lookup or sort. Account and folder variants also cover the payload. The full-query assertion failed before the fix and passed after it. Payload edit/delete/reassignment tests also passed. The cache-policy regression was also red before reopening read connections and green after.
Before/after query plans and pager work
Counters are SQLite
SQLITE_DBSTATUS_CACHE_HIT + CACHE_MISSdeltas around the complete public page call, repeated pager accesses, not unique pages. Both probes use the same source and SQLite version; only the linked mail implementation changed. Each probe records original post-walk sampling, equal 4,000-query warming, four alternating size-order 4,000-query passes, and then the same sequence at the normal 2 MB read-cache setting. The table uses the last normal-cache pass; all passes and actual plans follow below.before, 100000:
after, 100000:
before, 1000000:
after, 1000000:
Benchmark protocol and provenance
Fixture setup/index creation and cursor discovery are outside timing. The benchmark closes the loader connection and reopens with the normal read cache; the former 400 MB bulk-loader cache no longer leaks into reads. Every list size receives the same 4,000 first-page and deep-page warmups. Measurements alternate size order in 400-query blocks with distinct deterministic offsets, accumulating 4,000 samples per metric. Every intermediate point also enforces the existing 25% bound against 100k. Both runs used fresh directories and retained all samples. Unified/account workloads also get equal 4,000-query warmups.
Built on dev-01, from the final immutable head, in its Nix shell through
~/bin/slot. Relayed dev-01 → control host → perf-01. SHA256 matched at each relay for mail-bench and the after probe. The rebuilt final-head raw probe matched the already-relayed raw executable. The origin/dev control binaries are identical in all control invocations, source9377d711217532a44973edcf63c2af0b7f7969d8.mail-bench3a62847ba7f8c65b8372563b45abcd18e78e47bb635b9dcac17478bfd7d2d467page-probe-aftera5836046786adc7738b062407050b6cdbaa0faac1c249d98d1659b3513cd682frawae6c98d3288caf2d664bcc4aae08736e6a4c02551c2590e1063c769db1440c99calternal1543156ccab9dbb98903f34084206567263a47a207265abffbcc906dd3baf8a8calternal-perfedbfc735431c879ac1405875bcb200094c89ff0687aa2fbaaaec7e98b38b634drun.pydc6f73c62120f395cd43eb49834b6514866fd3a3bca403f64969f0eb8f72d3efbudgets.json3e0a75a745b84c4cd3ce1a5cf89753ac6fde4091397cf5bc9b2a2e5b6ff9deffMeasured on perf-01 only (4 vCPU, 7.7 GiB RAM, ext4). Took the standard
~/bin/perf-lockon perf-01 first, then perf-02, held together for the entire session. Each owned holder usedsleep 2400(RuntimeMaxSec 7200); the runner enforced the earlier lease deadline. Controls A/B each used the same origin/dev executable, with two warm runs and one cold run. Both control invocations exited 0 with no functional failures. Mail is new and unregistered, so there is no origin/dev mail path to compare; these controls expose machine drift. The code change touches only the new mail/read/bench lane. All control deltas are preserved below.Before every window the runner required ≥30% available and ≥15 GiB free, limited consumption to 70% of free space above the floor, and checked reserve/lease once per second. No guard tripped. The initial lease records and every window's boundary disk numbers follow below; perf-02 started and finished above 30% free. Fixtures were removed between families and runs.
List/unified sizes are nominal threads using the existing 2.6 messages/thread estimate; the diagnostic counted 100,380 / 1,001,836 actual threads and 75,019 / 750,731 Inbox memberships. Storm sizes are exact 250k/500k/1M input messages, newest/oldest/shuffled. Group equality and merge bounds passed in each run. No 2M run: any extension to 2M is extrapolated. Raw 50k is deterministic fixture streaming/read-back/replay. Ingest, mirror, MIME/body-open and the hard within-10% linear-build gate on real ingest remain P3; fixture-loader setup timings do not measure that gate.
mail.build_spread_pctremains entirely absent. The PR body retains this assignment.Gate verdicts
Every mail metric and repeat delta
mail.build_sreports fixture setup only; it is not a linear-build gate. Derived growth values with a nonpositive baseline have no meaningful percentage delta.mail.account_page@1accounts@1000mail.account_page@1accounts@100000mail.account_page@1accounts@1000000mail.account_page@1accounts@250000mail.account_page@1accounts@500000mail.account_page@20accounts@1000mail.account_page@20accounts@100000mail.account_page@20accounts@1000000mail.account_page@20accounts@250000mail.account_page@20accounts@500000mail.account_page@5accounts@1000mail.account_page@5accounts@100000mail.account_page@5accounts@1000000mail.account_page@5accounts@250000mail.account_page@5accounts@500000mail.build_s@1000mail.build_s@100000mail.build_s@1000000mail.build_s@250000mail.build_s@500000mail.fake_headers_per_smail.list_first@1000mail.list_first@100000mail.list_first@1000000mail.list_first@250000mail.list_first@500000mail.list_flat_pctmail.list_flat_pct@250000mail.list_flat_pct@500000mail.list_page@1000mail.list_page@100000mail.list_page@1000000mail.list_page@250000mail.list_page@500000mail.thread_open@1000mail.thread_open@100000mail.thread_open@1000000mail.thread_open@250000mail.thread_open@500000mail.thread_storm_merges@newest@1000000mail.thread_storm_merges@newest@250000mail.thread_storm_merges@newest@500000mail.thread_storm_merges@oldest@1000000mail.thread_storm_merges@oldest@250000mail.thread_storm_merges@oldest@500000mail.thread_storm_merges@shuffled@1000000mail.thread_storm_merges@shuffled@250000mail.thread_storm_merges@shuffled@500000mail.thread_storm_s@newest@1000000mail.thread_storm_s@newest@250000mail.thread_storm_s@newest@500000mail.thread_storm_s@oldest@1000000mail.thread_storm_s@oldest@250000mail.thread_storm_s@oldest@500000mail.thread_storm_s@shuffled@1000000mail.thread_storm_s@shuffled@250000mail.thread_storm_s@shuffled@500000mail.unified_growth_ms@1000mail.unified_growth_ms@100000mail.unified_growth_ms@1000000mail.unified_growth_ms@250000mail.unified_growth_ms@500000mail.unified_page@1accounts@1000mail.unified_page@1accounts@100000mail.unified_page@1accounts@1000000mail.unified_page@1accounts@250000mail.unified_page@1accounts@500000mail.unified_page@20accounts@1000mail.unified_page@20accounts@100000mail.unified_page@20accounts@1000000mail.unified_page@20accounts@250000mail.unified_page@20accounts@500000mail.unified_page@5accounts@1000mail.unified_page@5accounts@100000mail.unified_page@5accounts@1000000mail.unified_page@5accounts@250000mail.unified_page@5accounts@500000Every control metric and repeat delta
cold.disk_writtencold.first_pagecold.indexcold.mem_peakcold.notes_per_scold.startuphome.first_pagehome.pagehome.page_bighome.page_nexthome.page_taghome.page_titlejournal.catch_upjournal.entriesjournal.pagemem.after_first_pagemem.after_opensmem.after_searchmem.idlemem.peakopen.api_getopen.long_noteopen.notesearch.catch_upsearch.first_querysearch.queryshutdownstartup.healthzstorm.convergestorm.disk_writtenstorm.dropped_clientsstorm.edits_per_sstorm.outside_editsstorm.save_ackstorm.typingsync.durable_writesync.round_tripsync.save_ackuploads.responseuploads.round_tripuploads.save_ackRaw 50k outputs
Final-head dev-01 gates
All below ran in the immutable final-head worktree under
nix develop -c bash -c '~/bin/slot bash /tmp/mail932-final-gates.sh':cargo fmt --all --checkcargo clippy -j4 --workspace --all-targets --locked -- -D warningscargo test -j4 --workspace --locked --no-fail-fastnode --test ci/check-no-evidence.test.mjsandnode ci/check-no-evidence.mjsnode --test ci/check-case-paths.test.mjsandnode ci/check-case-paths.mjscargo build -j4 --release --locked -p calternal-mail-benchCARGO_TARGET_DIR=$PWD/target cargo build -j4 --release --offline --manifest-path /home/claude/mail932-scale-probe/Cargo.tomlThe retained
rule3_bytes_after_the_220_are_swallowed_by_mail_send_and_caught_by_the_wrapperpassed: trailing bytes after STARTTLS 220 are rejected by the 40-line wrapper; clean 220 succeeds. No changes to that protection were necessary. The final-head clean-tree and unchanged-head checks passed.Exact after plans and pager probe output
Lease records and window exit/disk records
Diagnostic source (temporary, never committed)
Window runner and guard (temporary, never committed)
Cleanup and remaining scope
Both owned perf holder units stopped at 2026-11-05 02:05:46 IST, immediately after collecting the finished-session status; all three VMs then reported zero loaded
mail932*units. Both final raw files and all fixture Homes were removed by the runner. The complete perf work directory, lock markers, dev-01 task/control worktrees including build output, temporary probe crate, and VM scripts/logs have been removed. Dev-01 has 168 GiB free; perf-01/02 have 75/33 GiB free. The pre-existingmail-p1worktree and every main checkout were left untouched.Every requested P1 gate passed in both final runs. No merge was performed. This evidence does not stand in for P3 ingest/linear-build/body gates or a fresh orchestrator review.
Static review of
bf3b5f56againstorigin/devat9377d711. I read the PR conversation through comment #78927. Its final perf runs and workspace gates are acknowledged; I did not rerun builds or tests.P1
The private-host exception skips every deny range. In
netguard::Guard::check, an allowlistedmail.lanskipsdeny::is_deniedfor every DNS answer. If that approved name resolves to169.254.169.254or a mapped/NAT64 form of it, the address passes. Permit only the private ranges intentionally allowed by policy, while retaining hard denials for metadata, loopback, link-local, multicast, and this server's addresses. Add an allowlisted-host test for those reserved answers.A checked target is mutable and can be used with another guard.
Checked.addrsis public, andconnect_checkedtrusts the supplied value without checking it again. A caller can change an answer returned bycheckto127.0.0.1, or pass a private answer from a more permissive guard to a stricter one. MakeCheckedopaque and bound to its guard, or remove the public checked-connect path and keep the check/connect sequence insideGuard.mid_mapcannot represent the plan's duplicate Message-ID case. Its primary key is(account, mid), but plan §14 says two matches are returned as a chooser. A second message with the same Message-ID in one account cannot be recorded. Key the mapping by(account, mid, msg)and add an index for lookup by(account, mid).placementomits generation from its key. The primary key is(msg, folder, uid). After a UIDVALIDITY change, the plan keeps old placements until the new listing completes; if the same message reappears with the same UID, both generations cannot coexist. The current key also permits two message ids to claim one physical UID. Key physical placement by(folder, generation, uid)and index by message id.The thread rekey trigger leaves message rows on the old key.
thread_payload_updatemovesthread_folderrows whenthread.idchanges, but it does not updatemessage.thread. When a late message merges two threads and changes the canonical id, the page can show the new thread whileread::threadfollows a member's stalemessage.threadand returns only the old subgroup. Update the message references in the same transaction and test opening the merged thread through members from both prior groups.Fingerprint-scheme ids depend on batch arrival order.
Index::applysorts only the current batch;pickgives a same-folder duplicate the next free ordinal. If a higher content hash arrives first and a lower one arrives in a later batch, the ids no longer follow the plan's content-hash rank. Two histories with the same mailbox can assign different ids. Make ranking stable across batches and add a split-batch test that compares both arrival orders and a rebuild.P2
SMTP errors can leave a reusable client in the wrong protocol state.
starttls_checkedreturns an error for trailing cleartext but does not close its stream. Also, if thedata_startedwrite fails after354,attemptreturnsPendingwhile the server is still waiting for DATA; a later attempt on the same client can be read as message content. Consume or poison the client and close the stream on these paths. Extend the tests to assert the peer sees EOF and the client cannot be reused.The fixture loader is a normal dependency of the app-facing mail crate.
crates/mail/Cargo.tomldepends onmail-fixturesbecausemail/src/load.rsis public, even though that module says it is only for tests and perf runs. When the app later depends oncalternal-mail, the fixture generator will be part of that crate's compile graph. Move the loader intomail-benchor a test crate and remove the normal dependency.P3
New public APIs are missing Rustdoc comments. Examples include
mail-model::identity::PlaceandIndex::new, the public result fields and error variants inmail::read, and the fixture typesKind,Order,Meta, andMailbox. Add docs describing each public type/function and the fields' invariants, as required by the repository brief.The dependency build cost is not evidenced against ADR 0008. The final comment records passing workspace commands but no elapsed build/check times. The dependency audit found permissive licenses for the new crates;
mail-sendis Apache/MIT and its Stalwart Labs repository was updated on Nov 1. Its platform-verifier dependency remains isolated to the SMTP spike, but workspace checks compile it. Record the workspace and incremental timings againstdevso the ADR's budgets can be confirmed.Checks and scope
calternaldoes not depend on or registercalternal-mail;crates/calternal/src/plugins.rsomits it. The PR does not register or run Mail in the live app.Guard::connectpath resolves once and connects to the returned checked IP; the rebinding tests cover a second lookup. The two P1 findings above concern policy exceptions and the public checked-address API.mail.build_sis fixture setup only, not the P3 real-ingest linear-build gate. Thread-storm time is report-only while group equality and merge bounds are checked.mail.thread_openmeasures cached metadata only; the final comment correctly leaves the P3 body-open gate outstanding. I found no report-only P1 gate that should instead gate.origin/devtree; I checked the manifest dependency edges directly. The layering concern above is the test-loader edge.Findings: 6 P1, 2 P2, 2 P3. Ready for BM15: no.
Review 78967: all 10 findings addressed, final verification complete
Final pushed head
eed392a8250a6b2e5b2c2188acfeb5cd1a6232de. Development gates and matched ADR 0008 costs; two complete P1 perf runs, controls, plans, pager counts and SHA256 provenance. Every requested P1 gate passed twice. No limits changed and no merge performed. This is implementation evidence; a fresh orchestrator review is still pending.18977364allowlisted_names_cannot_reach_hard_denials_or_own_aliases,connect_refuses_reserved_addresses_even_for_allowlisted_names18977364Guardcompile-fail doctest: public checked-connect removed; check/connect stays within Guard4b26cac4duplicate_message_ids_have_distinct_indexed_matches1c414070placement_generations_coexist_but_physical_uids_are_unique65d45b21merged_threads_open_through_members_of_both_old_groups_after_rekey, canonical references and rollback6f2854b6,eed392a8split_batches_in_both_orders_and_a_rebuild_keep_content_ranked_ids, atomic late-unprepared refusal, known-placement replayde2cc4f8,abf72aferule3_bytes_after_the_220_are_swallowed_by_mail_send_and_caught_by_the_wrapper,a_marker_that_cannot_be_written_stops_the_send; peer EOF and moved-client compile-fail doctests54e7269capp_dependencies_exclude_mail_fixtures; fixture-backed read tests moved into mail-testkit4900c9a2,7105b52e,fe59d391,03c1427cdeny(missing_docs)on all seven P1 libraries; docs/check gate, workspace clippy and doctestsFinal dev gate sequence: fmt, clippy with
-D warnings, workspace tests, guard unit tests, evidence guard, case-path guard, all exit 0. Workspace test summaries: 1,572 passed, 0 failed, 22 ignored. The cold Rust gate sequence exceeded the approximate ten-minute ADR target (14.8 min); cached final-head sequence was 5m19s. Both observations and every build/check delta are reported, not hidden.SMTP note: consuming the client prevents reuse. The stricter EOF regression first exposed TCP reset when dropping unread STARTTLS bytes; explicit stream shutdown now produces peer EOF. The full SMTP suite passed, followed by five additional trailing-cleartext repeats. Known-placement replay likewise exposed
IncompleteInventory; the final fix retains the existing affected group during staging. Both extra red results are preserved below.Documentation command:
RUSTDOCFLAGS="-D warnings" cargo doc -j4 --locked --no-deps -p calternal-mail -p calternal-mail-testkit -p calternal-mail-model -p calternal-mail-fixtures -p calternal-mail-provider -p calternal-mail-smtp-spike -p calternal-netguard. Generated docs for all seven passed.The red regressions were committed in
036efaa7and strengthened in949e14a5, before the implementation fixes. On dev-01 through Nix/slot,red-coreandred-restboth exited 101 for the expected failures. The checked-connect doctest compiled successfully when marked compile-fail, demonstrating the original public bypass. Both SMTP peers remained open until the new EOF assertion timed out. The split-batch identity test disagreed on the same final inventory. The schema tests rejected the required duplicate or retained stale canonical references.The separate missing-docs baseline exited 101 after enabling the lint; the build-cost evidence validator exited 1 because matched measurements were absent. That validator tests required evidence, not runtime behavior.
Identity boundary: content-rank ordinals need the complete collision inventory before publishing ids.
with_inventoryprepares it before split batches;newaccepts complete first batches. A later unprepared same-folder duplicate is rejected atomically rather than changing published links or assigning an arrival-order rank. P3 real ingest must collect collision facts before publication. Staging covers affected fingerprint groups only.Preserved red failure evidence
red-core
red-rest
red-docs
red-cost-evidence
Additional EOF and known-placement red/green evidence
Final cleanup and handback
The completed session exited 0. Both owned perf holders stopped at 2026-11-05 05:15:03 / 05:15:04 IST. All three VMs subsequently reported zero loaded
mail932*units. Removed both owned perf directories and relayed executables, all fixture/raw work files, the three owned dev-01 worktrees (implementation, dev control, docs-red baseline) including their targets, the temporary probe crate, timing targets and VM scripts/logs. Final free space: dev-01 185 GiB, perf-01 75 GiB, perf-02 33 GiB. No main checkout was touched.Remote PR remains open and unmerged at
eed392a8250a6b2e5b2c2188acfeb5cd1a6232de; the control implementation worktree is clean at that same pushed head. Finalmail.list_flat_pct: -2.866370% / 3.667329%. Every requested P1 gate passed in both complete runs. The real-ingest linear-build and body-open gates remain P3. Fresh orchestrator review remains pending.Review 78967: final-head development gates and ADR 0008 costs
Head
eed392a8250a6b2e5b2c2188acfeb5cd1a6232de. All requested Rust/guard steps passed on dev-01 through Nix and~/bin/slot. Workspace tests: 1,572 passed, 0 failed, 22 ignored, across 125 summaries including doctests. Requested regressions executed and passed.cargo fmt --all --checkcargo clippy -j4 --workspace --all-targets --locked -- -D warningscargo test -j4 --workspace --lockednode --test ci/check-no-evidence.test.mjs ci/check-case-paths.test.mjsnode ci/check-no-evidence.mjsnode ci/check-case-paths.mjsCached final-head sequence: 319.460s. Earlier cold Rust/guard sequence at
a3459135423ac044dea58cea1aab93265ded543b: 886.175s, above ADR 0008's approximate ten-minute target. The cold observation is retained. These are the requested Rust/guard commands, not full browser CI.Matched workspace costs use fresh target directories, sequentially on the same dev-01, with no concurrent owned build. Incremental workload touches
crates/core/src/lib.rsafter workspace build/check; it measures a core-touch rebuild, not a semantic edit.cargo build -j4 --workspace --lockedcargo check -j4 --workspace --lockedcargo build -j4 --workspace --lockedcargo check -j4 --workspace --lockedThe evidence validator was red with absent measurements; green requires all eight commands to exit zero and each incremental check <20 seconds. No threshold changed. Fresh-target costs are separate from cached gates. Host load differed (recorded below), and the sequential run also warms the OS cache, so the fresh-build decrease is not a controlled speedup claim. The incremental-build increase and check delta are retained. Public API docs are enforced by
deny(missing_docs)on seven P1 libraries; the initial baseline failed, corrected docs generation/check and final clippy/tests passed.Raw gate and timing records, source SHAs and toolchains
Review 78967: final-head P1 perf, both complete runs PASS
Head
eed392a8250a6b2e5b2c2188acfeb5cd1a6232de.mail.list_flat_pct: -2.866370% (A), 3.667329% (B), unchanged 25% limit. Every requested P1 gate passed twice. Original 49.092877% / 26.455586% failures remain in comment 78549; the original before probe is preserved in 78892/78927.Query plan and pager protocol
The original query used the membership range plus
SEARCH t USING PRIMARY KEY (id=?)at both sizes. The current full page query at both 100k and 1M is:No per-result canonical-table lookup or temp sort. The schema changes retain these covering indexes:
SQLite
SQLITE_DBSTATUS_CACHE_HIT + CACHE_MISSdeltas count repeated pager accesses, not unique pages. The table below uses the final normal 2 MB cache pass. Probe: equal 4,000-query warming, four alternating size-order passes of 4,000 queries, then repeat at normal read-cache size. Actual account/folder plans and all windows are retained below. Diagnostic fixture counts: 100,380 / 1,001,836 threads; 75,019 / 750,731 Inbox memberships.Measurement protocol
Final-head binaries were built on dev-01 through Nix/slot, relayed dev-01 → control → perf-01, with matching SHA256 at each hop. Control source is origin/dev
9377d711217532a44973edcf63c2af0b7f7969d8; the exact same executables ran A/B/C. The app does not register Mail and dev has no mail hot path, so these are dev-vs-dev machine-drift controls, not a mail-vs-dev comparison.Both standard
~/bin/perf-locklocks were acquired, perf-01 first, then perf-02, and held together throughout. Holder commands usedsleep 3600, RuntimeMaxSec=7200. Measurements ran only on perf-01 (4 vCPU, 7.7 GiB RAM, ext4). Perf-02 began with 33 GiB available, above 30%. Before every measurement window and once per second during it, the runner enforced ≥30% free, ≥15 GiB floor, ≤70% consumption of space free above the floor, and the earlier lease deadline. No guard tripped. Fixtures were deleted between families and runs. Holder stop and final cleanup records follow in the mapping/cleanup comment.List samples use normal read connections, identical 4,000 first-page/deep-page warmups, and alternating size order in 400-query blocks, 4,000 samples per metric. Every intermediate size enforces the unchanged 25% bound against 100k. Unified/account workloads also receive equal warming. Nominal thread counts use the existing 2.6 messages/thread estimate; storm sizes are exact 250k/500k/1M messages, all three arrival orders. No 2M run; extensions are extrapolated.
mail.build_smeasures fixture setup only.mail.build_spread_pctremains entirely absent. The hard within-10% linear-build gate stays assigned to P3 on real ingest, as stated in the plan and PR body. Ingest/mirror/MIME/body-open remain P3;mail.thread_openhere measures cached metadata only. No limit was changed.All gate categories passed in A and B: list absolute p95 ≤20ms and scaling ≤25% at every intermediate size; unified 1/5/20 accounts at every size, twenty-account p95 ≤25ms; cached thread metadata open ≤30ms; exact 250k/500k/1M thread builds in all three orders with equal groups and bounded merges; fake provider ≥1,500 headers/s at 20ms latency; raw 50k write+fsync/read-back/replay.
Provenance
mail-bencha76f1405e39ecfaa9a7d70cc4d5602ea661f057e052c2f6c2b09871317d87e1araw7ae3b803ac66308686fc07d28976e84af4dc69617ba9d09ce8e72f644464199epage-probe-afterf84e56f1b470b6f3b596bac00e1c8bd4737888f6c042c4046994764d5e9e2792calternal9beb4110f608243fb1e17508fd36c89a4234c74cd0714a8939185e65ed084fb8calternal-perf6efba03be176e101b5c7d32060a9849183aba627e3770cc552bbfef7780ba597run.py2487c69ea2acb020601d37d564a5010888e1cb88480ede30a4a0347bb55b4f01budgets.json3e0a75a745b84c4cd3ce1a5cf89753ac6fde4091397cf5bc9b2a2e5b6ff9deffEvery mail metric and repeat delta
Fixture setup and storm elapsed times are report-only. Nonpositive-baseline percentage deltas are undefined.
mail.account_page@1accounts@1000mail.account_page@1accounts@100000mail.account_page@1accounts@1000000mail.account_page@1accounts@250000mail.account_page@1accounts@500000mail.account_page@20accounts@1000mail.account_page@20accounts@100000mail.account_page@20accounts@1000000mail.account_page@20accounts@250000mail.account_page@20accounts@500000mail.account_page@5accounts@1000mail.account_page@5accounts@100000mail.account_page@5accounts@1000000mail.account_page@5accounts@250000mail.account_page@5accounts@500000mail.build_s@1000mail.build_s@100000mail.build_s@1000000mail.build_s@250000mail.build_s@500000mail.fake_headers_per_smail.list_first@1000mail.list_first@100000mail.list_first@1000000mail.list_first@250000mail.list_first@500000mail.list_flat_pctmail.list_flat_pct@250000mail.list_flat_pct@500000mail.list_page@1000mail.list_page@100000mail.list_page@1000000mail.list_page@250000mail.list_page@500000mail.thread_open@1000mail.thread_open@100000mail.thread_open@1000000mail.thread_open@250000mail.thread_open@500000mail.thread_storm_merges@newest@1000000mail.thread_storm_merges@newest@250000mail.thread_storm_merges@newest@500000mail.thread_storm_merges@oldest@1000000mail.thread_storm_merges@oldest@250000mail.thread_storm_merges@oldest@500000mail.thread_storm_merges@shuffled@1000000mail.thread_storm_merges@shuffled@250000mail.thread_storm_merges@shuffled@500000mail.thread_storm_s@newest@1000000mail.thread_storm_s@newest@250000mail.thread_storm_s@newest@500000mail.thread_storm_s@oldest@1000000mail.thread_storm_s@oldest@250000mail.thread_storm_s@oldest@500000mail.thread_storm_s@shuffled@1000000mail.thread_storm_s@shuffled@250000mail.thread_storm_s@shuffled@500000mail.unified_growth_ms@1000mail.unified_growth_ms@100000mail.unified_growth_ms@1000000mail.unified_growth_ms@250000mail.unified_growth_ms@500000mail.unified_page@1accounts@1000mail.unified_page@1accounts@100000mail.unified_page@1accounts@1000000mail.unified_page@1accounts@250000mail.unified_page@1accounts@500000mail.unified_page@20accounts@1000mail.unified_page@20accounts@100000mail.unified_page@20accounts@1000000mail.unified_page@20accounts@250000mail.unified_page@20accounts@500000mail.unified_page@5accounts@1000mail.unified_page@5accounts@100000mail.unified_page@5accounts@1000000mail.unified_page@5accounts@250000mail.unified_page@5accounts@500000Identical dev controls: every p95 delta
All three controls exited zero, empty failure lists. Small-sample drift is preserved, not called a mail speedup or regression.
All pager windows, actual plans, lease and disk records
Second review: head
eed392a825Compared the PR head with origin/dev at
9377d711. I read comments 78967 and 79023, the test logic, docs/plans/mail-architecture.md, ADR 0071, and ADR 0008. This is a static review; I did not rerun tests. The before-fix red evidence in 79023 matches the assertions for the covered regressions.Original findings
New findings
P2 - STARTTLS can wait forever. starttls_checked writes and reads directly on c.stream, including an unbounded read_u8 loop, and does not apply SmtpClient.timeout or accept a deadline. A server that accepts STARTTLS and then stays silent can hold the send worker indefinitely. The tests cover extra cleartext and a clean 220, but not a silent peer. This conflicts with plan section 9 and ADR 0071's TLS timeout/retry outcome. Bound the whole STARTTLS exchange and add a silent-peer timeout/closure test.
P3 - Cold gate cost. The recorded cold Rust/guard sequence is 886s (14.8 min), above ADR 0008's approximate 10-minute target. The matched fresh workspace build was 171s at head vs 220s on dev, and workspace check was 29.0s vs 28.8s; incremental checks were 2.3s vs 2.2s. Host load differed, so this does not prove a speedup, but it also does not show mail-send/platform-verifier caused the overrun. The cold sequence was dominated by clippy (204s) and tests (678s). If reducing this cost, the smallest change is a crate-local optional feature for mail-send in the spike plus an explicit feature-enabled spike test gate; this needs no product feature flag.
Open review counts: P1=1, P2=1, P3=1. Ready for BM15: no.
Second review 79123: final fix and red/green mapping
Pushed head
f03397cfbad8b4831f806781467a11428277ff2a. All three requested changes are implemented. Final dev-01 checks and both complete P1 perf passes passed. A fresh orchestrator review is still required; no merge was performed.a8652f6474426737;later_same_folder_duplicates_accept_every_split_without_changing_idscovers six arrival orders × four split patterns, checks published ids after every batch and rebuilds from mirror facts in reverse split order.later_identical_copy_keeps_both_ids_and_rebuilds_the_same_setcovers later byte-identical copies. Existing split/replay/move/rebuild cases also pass.2c5d44c674426737;silent_starttls_peer_times_out_and_sees_eofandcontinued_starttls_reply_hits_total_cap_and_sees_eoffailed before and pass after. The peer sees EOF; ownership compile-fail tests reject reuse. Existing trailing-cleartext EOF and post-354 send-state tests remain green.573373a0, fixf03397cfdefault_workspace_graph_excludes_the_smtp_experimentfailed on the resolved pre-fix graph and passes after. CI explicitly builds, clippies and tests the feature-enabled experiment; final dev-01 executed all 20 SMTP tests/doctests. Cargo timing graphs measured dev and unchanged review head before the graph change, then final head.Identity decision: ids hash
(akey, fp, content_hash, identical-copy ordinal)under the v2 domain. A dense ordinal across different content hashes cannot remain immutable when a lower hash arrives later. There is no inventory API or IncompleteInventory path; the batch result is infallible. Byte-identical copies retain the same id set and may interchange placements on rebuild, as the plan already permits. Known placements and moved copies retain published ids. Plan section 4 and the PR body document the formula correction. P1 registers no live Mail plugin and has no deployed ids to migrate. Synthetic read-fixture keys do not stand in for real identity reconciliation tests.STARTTLS now bounds the whole write/flush/read exchange by the client timeout, capped at the RFC five-minute command timeout. It enforces 512-byte lines and a 4 KiB total reply cap. Every error shuts down and drops the owned stream. No limit was loosened.
Build diagnosis: SMTP-only units contributed about 11.7s of summed parallel compile-unit work before isolation, not the entire old 886s cold gate observation. The crate-local
spikefeature removes mail-send from ordinary workspace builds, with explicit CI build/lint/test coverage. This is a build-graph choice, not a product feature flag. Fresh workspace build: 199.296s before → 246.760s after (dev: 203.918s). Core-touch incremental build: 6.128s → 27.642s (dev: 6.308s). Final incremental check: 12.967s, under the unchanged 20s target. No speedup is claimed: host load varied, and final tests used CI=1 and a disk-backed task TMPDIR. Final workspace tests took 1886.381s; the whole Rust/guard sequence still does not meet the approximate ten-minute ADR 0008 target. The experiment graph change does not resolve all existing workspace cost.Final evidence:
-D warnings, workspace tests/doctests (1556 passed, 0 failed, 22 ignored), CI guards, explicit SMTP build/clippy/tests (20 passed, 0 failed).Cleanup: both perf holders stopped at 2026-11-05 07:19:13 / 07:19:14 IST immediately after measurement completion was observed. All owned
mail932-r2*units were absent on all four VMs before cleanup. Removed both perf work directories, all three dev-01 task worktrees and task/probe/timing directories, and the dev-02 task worktree/directory. Free space after cleanup: dev-01 184 GiB, dev-02 316 GiB, perf-01 75 GiB, perf-02 33 GiB. Main checkouts and other worktrees were untouched. Complete measurement artifacts were uploaded to these PR comments before deletion.Attached red/green evidence: red-tests.log, arm-green.log, dev-cargo-timings.zip, graph-red.log, graph-green.log
Final unit/disk and owned-directory deletion record: cleanup.log.
Build-cost diagnosis before the graph change
These immutable profiles ran on dev-01 through Nix and
~/bin/slot, Cargo-j4 --workspace --locked. Every recorded command exited 0. New functional checks ran on dev-02 after their initial dev-01 red run; they did not overlap the retained timing runs on dev-01. The discarded initial overlapping dev build is not used. Other VM work, including the BM14e train, can affect elapsed time, so these are observations rather than isolated speedup estimates.cold_buildincremental_buildcheckclippytestsBaseline
9377d711217532a44973edcf63c2af0b7f7969d8; unchanged review headeed392a8250a6b2e5b2c2188acfeb5cd1a6232de. Both use fresh target directories; incremental build touchescrates/core/src/lib.rsafter the initial workspace build.checkis the first check-profile pass, not the incremental-check budget. Test durations follow that build/check/clippy sequence, so they are not comparable to a standalone fresh-targetcargo test.The original 886s cold Rust-gate observation remains in comment 79097. This profiling sequence also shows long tests on dev (446.992s) and the PR head (451.486s). It does not establish that SMTP caused the entire original overrun.
The dev cold graph has bundled SQLite at 59.62s, notes 39.48s, and syn 30.87s among the large units. Additional package names in the PR sum to 19.2s of compile-unit wall durations, including about 11.7s in the SMTP-only graph, chiefly encodify. Those are parallel unit durations, not a sum that can be subtracted from elapsed build time. The graph change removes that avoidable experiment from default builds; explicit CI still builds, lints and tests it. After measurements remain pending behind the train lock.
Exact commands and graphs are attached; results stay out of the repository.
Full Cargo graphs and baseline logs
Final head: development gates and build costs
Head
f03397cfbad8b4831f806781467a11428277ff2a. All final dev-01 commands below exited zero through Nix/slot. Default workspace test summaries: (1556, 0, 22) (passed, failed, ignored); explicit SMTP feature test summaries: (20, 0, 0). The default graph guard passed, and the explicit SMTP step executed the bounded STARTTLS, trailing-cleartext EOF, send-state-machine and ownership doctests. None of those checks is replaced by an empty default-feature spike test target.bun install --frozen-lockfilecargo build -j4 --workspace --locked --timingscargo build -j4 --workspace --locked --timingscargo check -j4 --workspace --locked --timingscargo check -j4 --workspace --locked --timingscargo fmt --all --checkcargo clippy -j4 --workspace --all-targets --locked -- -D warningscargo test -j4 --workspace --lockednode --test ci/check-no-evidence.test.mjs ci/check-case-paths.test.mjsnode ci/check-no-evidence.mjsnode ci/check-case-paths.mjscargo build -j4 --locked -p calternal-mail-smtp-spike --features spikecargo clippy -j4 --locked -p calternal-mail-smtp-spike --all-targets --features spike -- -D warningscargo test -j4 --locked -p calternal-mail-smtp-spike --features spikeBefore / after workspace costs
Fresh targets on the same dev-01, same pinned Nix toolchain. Baseline
9377d711217532a44973edcf63c2af0b7f7969d8; review headeed392a8250a6b2e5b2c2188acfeb5cd1a6232de; finalf03397cfbad8b4831f806781467a11428277ff2a. Incremental builds touch core source without a semantic edit. Other VM work and cache order affect elapsed time; the rows retain every delta, rather than proving an isolated speedup. The after sequence also runs an incremental check, sets CI=1 and uses a task-owned disk TMPDIR; the test rows follow build/check/clippy, not standalone coldcargo test.Final incremental check: 12.967s (under the unchanged 20s target). The original 886s cold Rust/guard observation remains documented in 79097. The before diagnosis in 79143 found long existing build/test work on dev too; SMTP does not explain that entire observation. These build graphs and Rust commands do not claim full browser CI execution.
The final workspace tests took 1886.381s. Cold build, incremental build and test wall times increased in this run; no speedup is claimed. The recorded whole Rust/guard sequence still does not meet the approximate ten-minute ADR 0008 target. The attached load snapshots and different disk-backed TMPDIR limit attribution; SMTP graph removal does not resolve all existing workspace cost.
Compile-unit attribution
Default final-head cold build has no mail-send unit. SMTP-only graph costs were removed from ordinary builds, with the experimental package empty unless its crate-local
spikefeature is selected. Explicit CI still builds, lints and tests it; this is not a product feature flag. Compile-unit wall durations overlap in parallel and cannot be subtracted from elapsed build time.dev largest cold units
before largest cold units
after largest cold units
Raw source, load and command records
Full final logs, four Cargo timing graphs, command JSON and sampled load: final-gates.zip.
Final-head P1 perf recheck: both complete runs PASS
Head
f03397cfbad8b4831f806781467a11428277ff2a.mail.list_flat_pct: 1.657331% / 4.878449%, unchanged limit 25%. Every requested P1 gate passed twice. Three identical dev controls passed with empty failure lists. No limit was raised.Measured only on perf-01, with both standard perf-locks held together (perf-01 acquired first). Holders used sleep 3600 and RuntimeMaxSec=7200. The runner checked the earlier lease and ≥30% free / ≥15 GiB floor / ≤70% consumption of free above the floor before every window and each second while it ran. No guard tripped. Fixtures were removed between families. The final cleanup record follows in the mapping.
Final-head mail-bench and raw probe were built on dev-01, relayed through control and verified by SHA256 on perf-01. The origin/dev calternal/control binaries were built from
9377d711217532a44973edcf63c2af0b7f7969d8. There is no dev mail hot path: dev-vs-dev controls expose machine drift, not mail-vs-dev changes. Mail remains unregistered.mail-benchf123d793b895cbc2539003bb0cf933d34e72120fc7dd0cc8c162262905fdde79rawc454881f2719eacd42879ccc5648aa3da223f85486c876deefcca652e638ac14calternal560daa075efbd6fdc572d0d75018bb22dc54f9294e35b5dea45d1afd65565148calternal-perf0cbadbe167298038040a277735253471c08ef5909761f80acb65d1633175f77arun.py8aa431c17b3af51150bc4c3092c9a71381b031ca2e6311feb7df8ccb1b61219cbudgets.json3e0a75a745b84c4cd3ce1a5cf89753ac6fde4091397cf5bc9b2a2e5b6ff9deffList sizes receive equal 4,000-query warming and alternate in 400-query blocks, 4,000 samples per metric. Every 250k/500k/1M scaling point enforces the same 25% bound against 100k. Unified/account cases also warm equally. Nominal thread fixtures use the existing 2.6 messages/thread estimate; thread storms use exact 250k/500k/1M message inputs in newest/oldest/shuffled order, testing equal groups and bounded merges. Raw 50k verifies stream/write+fsync, disk read-back and deterministic replay. No 2M run; extensions are extrapolated. Identity split/late-copy contracts are separately covered by the reference-model tests, not the synthetic metadata ids used by the read fixtures.
All absolute list, scaling, unified 1/5/20-account, cached thread-metadata open, exact storm equality/merge, fake-provider rate and raw-50k checks passed in A and B. Real ingest, mirror, MIME, body-open and the hard within-10% real-ingest linear-build gate remain P3.
mail.build_spread_pctstays absent; fixture setup timings are not that gate.Raw results:
Every mail metric and repeat delta
Every identical-dev control p95 and delta
Two warm runs and one cold per invocation are a small-sample drift check. All deltas are retained; they are not attributed to mail code.
Lease and window/disk records
The query and schema were unchanged in this second-review round. The covering-query EXPLAIN and pages-touched comparison remains in 79107; these fresh runs were required by the identity change. Both holders stopped at 2026-11-05 07:19:13 / 07:19:14 IST.
Complete session logs, both mail JSON outputs, raw results, three control JSON/MD reports, lease/disk records, hashes, source/build log and external harness/probe: final-perf.zip.
third/final review of
f03397cfround-2 verification
Index::applyis infallible and IDs use the fingerprint, content hash, and per-content duplicate ordinal. A late duplicate in the same folder no longer needsIncompleteInventoryand does not renumber published IDs. The regressions cover both distinct-content arrival orders and rebuild, six permutations across all four split patterns, and byte-identical copies. NoIncompleteInventorypath remains.spikedefaults to empty andmail-sendis optional. The ordinary graph therefore excludesmail-sendandrustls-platform-verifier; the explicit CI spike commands enable the feature and build, lint, and test it.default workspace build cost
The root is a virtual workspace with
members = ["crates/*"]and nodefault-members. A plain rootcargo buildorcargo testtherefore selects every member. It compiles the default-feature SMTP spike package,calternal-mail-fixtures, themail-benchbinary, and the other mail members;cargo testalso compiles their test targets. It does not compilemail-sendorrustls-platform-verifierwithoutspike.The final cold Cargo timing report shows about 4.6 seconds summed across parallel compile units for the new package targets:
calternal-mail1.2s,mail-benchandmail-model1.0s each,mail-testkitandmail-provider0.5s each,mail-fixturesandnetguard0.2s each, and the default spike target 0.0s. The largest units overall are existinglibsqlite3-sys(69.2s),calternal-notes(45.4s), andsyn(41.1s / 38.7s); the dev timing report has those same units. Their duration changes, and host variance, mean the 199.3s to 246.8s wall-time delta cannot be attributed to the new mail packages. The measured command also used--workspace.Smallest graph choice: add an explicit
[workspace].default-memberslist of the existing non-mail packages, excluding the sevencalternal-mail-*packages andcalternal-netguard. Run the routine CI clippy/test commands over those defaults, then add an explicit-pclippy/test step for the eight mail/netguard packages; retain the existing feature-enabled SMTP build/clippy/test step. This should save at most about 5s cold wall time, likely less; the 4.6s is summed unit time and overlaps. It will not change a command that still passes--workspace, so measure the default graph with plaincargo buildafter such a change.new findings
None. New P1: 0. New P2: 0.
Ready for BM15: yes.
#932 per-PR gates: GREEN at
4a068556Head =
f03397cf+ merge of origin/devb5e8dcb2(no conflicts). Rust only (new cratesmail*,netguard, docs, CI step, newmail.*budget lines); no web file changed. Branch alone, through~/bin/sloton dev-01.cargo fmt --all --checkcargo clippy -j4 --workspace --all-targets --locked -- -D warningscargo test -j4 --workspace --locked --no-fail-fastcargo build / clippy -D warnings / test -p calternal-mail-smtp-spike --features spikeperf/budgets.jsonmail.*lines,gate:falseon the storm line); no existing line changedmembers = ["crates/*"]), so thecalternalbinary is the same as dev's. Nothing to ABAB. (Themail.*lines come fromcrates/mail-benchon fixtures, new, no dev baseline.)Merged into dev by the orchestrator (U1 per-PR gates GREEN), dev head
34c14822.Pull request closed