Fix block identity admission, cached typing and long-note Undo #758
Open
kayg
wants to merge 4 commits from
proto/block-identity-v7d into dev
pull from: proto/block-identity-v7d
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: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!758
Loading…
Reference in a new issue
No description provided.
Delete branch "proto/block-identity-v7d"
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?
Offline edits can survive a deleted native text range, target the old location of a moved block, or write Unicode into a neighbor. Admission now retires orphaned inserts into history, follows native character provenance across note moves, and converts byte and UTF-16 positions at the Yrs boundary. Undo and Redo preserve native ownership across independent deletions, joined rows and moved copies.
The format module owns quoted fences, setext headings, CR/CRLF normalization, marker placement and metadata range partitioning. Cached typing covers caret, backtick, tilde, pipe, newline and Enter. Long-note bootstrap batches admission refresh, and immediate mapped-split Undo restores the affected causal owner group while deferring map serialization to save/sync. Joined owners share endpoint resolution and span serialization. Cached byte positions are invalidated by native note deltas. Intervening edits or deliveries use ordinary history.
Validation on the build host passed formatting, Clippy with warnings denied, all block-ID release tests including non-ignored load scaling and Undo/Redo comparison tests, 200000 VERIFY3 sessions, 300000 VERIFY4 sessions, 300000 VERIFY5 sessions, and a 960-second fuzz campaign with no panic or timeout. The three independent harnesses retain their oracles and invariants. All seven key classes pass the unchanged 1 ms added-p95 bound at 10000 lines and 500 links; Enter adds 0.935 ms. These are build host, not a perf VM number. Final perf-VM measurement remains with the coordinator.
Refs #671; supersedes draft #745. Complete gate output, commands, scaling table and fuzz corpus: #671 (comment)
Starting long-note performance investigation on proto/block-identity-v7d at
fdfe99766a(perf-test-03). I will measure load, sync and first delimiter conversion independently, fix the measured cause, and run the required gates. No merge or deployment.Initial release measurements on perf-test-03 under perf-run.sh, with the benchmark shape scaled at one link per 20 lines:
The 4000-line measurement is still running. Sync dominates and grows much faster than quadratic. I added temporary timing spans around admission, marker stripping, reindexing and reconciliation to identify the exact cause. The existing typing benchmark has not been changed.
Completed baseline scaling (release, perf-run.sh).
Sync has an empirical power exponent of 3.71 over all sizes, 4.34 over 1000–4000 lines. Load is roughly quadratic; first conversion becomes roughly cubic as retained native history grows.
No perf executable is installed, so I profiled an unoptimized debug build using temporary timing spans. At 1000 lines, sync took 1056.9 ms: reconcile 345.4 ms, strip_markers 301.4 ms, marker_spans 227.5 ms, reindex 89.6 ms, candidate cloning 59.5 ms. Reconcile includes 176.1 ms writing patches, 106.1 ms resolving owners and 61.1 ms resolving boundaries.
Exact cause: Server::receive strips every known marker on every packet, then reconcile inserts them again. With skip_gc enabled this retains a quadratic number of deleted marker items. Yrs StickyIndex::get_offset walks left through those items, and TextRef::get_string walks all items. The byte-oriented Note::sticky_index and text::offset wrappers copy a full note on each marker lookup, multiplying the cost. Device::load also refreshes projection and reindexes after every row and import claim.
The new non-ignored 2000-line regression test failed on the original implementation: load+sync took 7.966486236s, budget 100ms. I am fixing marker churn and redundant boundary work while retaining the existing typing bounds and harnesses.
The fix now combines two changes: marker retirement preserves intervals still recognized by the format, and fresh append-only imports share one admission refresh after verifying their ordinary Create/Import packet sequence, complete source and native owner envelopes. Other sequences use individual admission. Bootstrap appends reuse the existing insertion rules without reparsing the preceding row.
Release scaling after the fix, on perf-test-03 under perf-run.sh:
The same benchmark shape is used before and after: first n/20 rows linked, remaining tail fenced as in cached_keys.rs. Through 4000 lines, load is approximately linear and sync is mildly superlinear; the remaining one-time owner/index work grows with owner count. The 10000-line setup is under the requested 200 ms. The non-ignored 2000-line regression passes (100 ms release bound, 2 s debug bound). Added tests compare batched and individual admission and exercise restart, edits, delete and Undo. Full gates and the unchanged typing benchmark are still running.
Finding: Enter already uses cached native insertion, but Undo normalizes mapped metadata before the native undo and again during send, then reindexes and refreshes the whole note. map_refresh resolves every owner through text::offset, copying the note at each endpoint. It also replaces the changed map header, accumulating retained syntax tombstones. Initial release diagnostics (build host, not a perf VM number):
Implementing bounded Undo for an immediately preceding mapped cached split, invalidated by any intervening command, sync or pull. The existing history path remains the fallback. The specific task instruction to push only proto/block-identity-v7d takes precedence over the general new-branch rule; I will push only that branch and report the resulting remote SHA.
The bounded immediate mapped-split Undo path now restores causal owner intervals and updates only the affected owner group. It defers map serialization to save/sync, as cached typing already does. Intervening commands, attempted edits, sync and pull invalidate the receipt. Native Undo scope discovery now resolves the branch directly without copying note text.
First patched release diagnostics (build host, not a perf VM number):
The new comparison tests caught and corrected a member-order difference after repeated split/Undo/Redo. The optimized state now matches ordinary history, including member precedence. Both history tests pass; the non-ignored load budget and repeated Enter/Undo zero-materialization regression also pass. The unchanged 10000-line benchmark and full gates are next.
Second finding: the unchanged 240-cycle benchmark exposes another cost after fixing map churn. Each Undo leaves a joined native owner handle. cached_split then resolves identical native endpoints separately for every joined handle. Release build-host results: x/^/`/~/|/newline added p95 0.220/0.248/0.251/0.272/0.273/0.296 ms; Enter added p95 8.242 ms. These are build host, not a perf VM number.
I am sharing native endpoint resolution and serialized spans across joined members, writing the bindings in one transaction. All owner handles and causal semantics remain present. Both immediate Undo and cached typing use the same text-layer batch helper. The benchmark oracle and 1 ms bound remain unchanged.
All seven key classes now pass the unchanged 1 ms p95 assertion. This is a build host, not a perf VM number.
The final improvement caches byte positions with the observed note version and avoids duplicate split validation unless map conversion changed positions. Any native text delta invalidates the byte positions; validation then resolves the causal anchors. Targeted Undo/Redo, atomic fenced/table, Unicode, sync and repeated zero-materialization tests pass. The final full campaigns and a 960-second fuzz run have started in one sequential build-slot job. Performance acceptance on the perf VM remains with the coordinator.
Starting the remaining Enter and Undo scaling work on branch proto/block-identity-v7d, base
a842fbbbc7. I will run the requested correctness gates on the build host and label measurements as build host, not a perf VM number. The task-specific instructions require pushing only this branch; they take precedence over the generic new-branch instruction.Review finding:
a842fbbbalready contains the bounded immediate mapped-split Undo path and shared native interval writes. Ordinary Undo rebuilt the note map and resolved every owner; the immediate path restores only the split owner group and defers map serialization to save/sync. Joined members share endpoint resolution and span serialization. Projection byte positions are guarded by the observed native note version, so equal UTF-16-length edits with different UTF-8 widths invalidate cached bytes. Existing comparison tests check the optimized path against ordinary Undo through repeated Undo/Redo and sync, including Unicode, fences and tables. Fresh formatting and Clippy gates have passed; the release correctness campaigns are running. No further product change is justified until those results are available.Fresh measurements on
a842fbbbc7. These are build host, not a perf VM number.The unchanged 10,000-line, 500-link benchmark passes every key class, including the 240 split/Undo cycles. Verbatim output:
Formatting, Clippy with warnings denied, all block-ID tests including the non-ignored scaling tests, VERIFY3 (200000 sessions), VERIFY4 (300000 sessions), and VERIFY5 (300000 sessions) pass with zero failures. The remaining gate is the 960-second fuzz campaign, now started in the same build slot. No further product changes were needed after reviewing the saved fix.
Finished validation of the saved Enter and Undo fix on branch proto/block-identity-v7d. Head:
a842fbbbc7. No additional product changes were needed. The working tree is clean, and the branch push is verified in the attached push log.All requested build-host gates pass: formatting, Clippy with warnings denied, the complete block-ID release suite including non-ignored load scaling and unit tests, all three full independent harnesses with zero failures, all seven typing key classes, and fuzzing for 962 seconds without a panic or timeout.
These timings are build host, not a perf VM number. The coordinator still owns final perf-VM measurement.
Gate output follows verbatim; complete stdout and run commands are attached.
WIP: Fix block identity admission, cached typing and marker round tripsto Fix block identity admission, cached typing and long-note UndoPerf-VM measurement of v7d (head
a842fbbb), built on 6by32-compute01, run on perf-test-03 under perf-run.sh (coordinator, 29 Oct).cached_keys ten_thousand_lines_five_hundred_links_all_keys— FAIL (Enter):load_scaling enter_undo_scaling(perf VM, despite the fixed label):Load/sync and first conversion grow super-linearly (4k→10k lines: ×4.6 load, ×5.9 conversion). The build host (Apple core) is ~2× faster than the perf VM, so build-host results under-state cost.
🤖 Generated with Claude Code
Implemented the Enter and long-note setup fixes on
proto/block-identity-v7d, headb9397f9275f4cc3cc3d24a0c739ba9676ee599b4.The hot path now preserves untouched causal endpoints, writes the split endpoints once, and sends merged per-command native deltas instead of the whole historical delete set. Setup uses a bulk native-position index, rope byte/UTF-16 conversions, binary boundary searches, and one grouping pass over ID bindings. Map conversion preserves causal anchors, translates positions with prefix deltas, and applies all syntax patches with one forward native cursor.
All numbers below are build host (
10by32-02-std, arm64, shared), not perf-VM measurements. The coordinator owns perf-VM confirmation. Before cached-key values are the priora842fbbbbuild-host report on this PR; before scaling values are this session's unmodifieda842fbbbrun. After values are fresh on this head.a842fbbbbeforeThe non-ignored scaling regression compares 500 and 2,000 lines using medians of nine interleaved samples. Both load+sync and first conversion must stay within 5.5× for 4× the lines. The original implementation failed first conversion at 9.25×. The build-host key benchmark now explicitly checks ≤0.4 ms added p95 for Enter and ≤0.25 ms for every other key.
Correctness coverage: complete block-ID suite; VERIFY3 seeds 0–199999 (two disjoint 100000-run shards); VERIFY4 300000 runs plus authority checks; VERIFY5 seeds 0–299999 (two disjoint 150000-run shards); fuzz at least 15 minutes. No failures.
Gate output below is verbatim (campaigns are shown by shard).
Kept
target/for incremental rebuilds: 663M.Kept
fuzz/target/for incremental rebuilds: 424M.Perf VM re-measure — PASS (head
b9397f92; built on 6by32-compute01; run on perf-test-03 under perf-run.sh; coordinator, 30 Oct 00:40 IST).cached_keys ten_thousand_lines_five_hundred_links_all_keys: okenter_undo_scaling(perf VM):load_and_first_conversion_scale_near_linearly: ok — load+sync ratio 3.95, first conversion 3.37 (limit 5.5 for 4× lines).🤖 Generated with Claude Code
Independent review of
fdfe9976..b9397f92: fix first — one P2 editing defect. It also reproduces onfdfe9976; I found no confirmed correctness regression introduced by these performance commits.P2: empty owner becomes unjoinable after split → join → Undo → split. Load/sync
before ^first-id\nneighbor ^second-id\n```x\ncode\n```\n. Letsecondbe the neighbor block:empty = split(second, 0);join(empty, second);undo();split(second, 4);join(empty, second). The last join rejects visibly adjacent rows withjoin requires adjacent text in one note. The empty owner's endpoints collapse onto the following owner's start. Checkpoint reload does not repair it. This demonstrates a refused editing action; no text loss or ID theft was demonstrated. Two minimized tests fail on both reviewed head and baseline.Verification on 10by32-01-std arm64, heavy work through build-slot.sh, Cargo -j8:
--all-targets -- -D warnings): pass.Tests only: review/758-tests, commit 0f34e47f. No production fixes. Reproduce P2 with
cargo test --release -j8 -p calternal-block-ids --test review758_minimalthrough build-slot.sh.Detailed findings and logs:
/home/agent/codex-jobs/verify-758/findings.md.Fixed P2 from comment 69930 in
57724c04fc056847fa0870ab5e0b0470dfb96626; pushed onlyproto/block-identity-v7d. Used the clean existing worktree/home/agent/wt/ids-perf-2, starting atb9397f92, and fast-forwardedorigin/review/758-tests(0f34e47f) before implementation. All four reviewer test files are unchanged.The saved Unjoin span for an empty owner points at the separator deleted by Join. Native Yrs Undo recreates that separator under a fresh item ID. The old span works locally because Yrs follows its in-memory
redonelink, but that link is not encoded in updates or checkpoints. Publishing the old span therefore leaves its zero-width endpoints at the following owner's start in a copied/reloaded document. The next split triggers a map-refresh preview from an encoded update; the preview sees overlapping owners rather than a separator and refuses the visibly adjacent join. The bad item ID lives in the durableanchorsmap, so reload preserves the defect.Undo now resolves the restored endpoints after the native history step and binds each Unjoin owner to live native items before emitting its packet. This repairs the causal boundary rather than relaxing adjacency checks. Server allocation, ordered admission, ID ownership and receipt authority (B5) are unchanged.
The new property also found an inline-format history defect: Undo can recreate the first row's marker as syntax, and Redo of Join previously left that marker inside the reunited human row. Redo now removes that format-owned suffix outside native Undo, matching the original Join.
The merged unignored minimal reproductions are permanent regressions. Added
structural_history.rs: a literal row/owner oracle checks two devices before delivery, after authority delivery, and through device and server checkpoint reloads after every step. It probes every adjacent pair on durable copies, checks the joined owner partition, immutable ID-claim owners and link targets, and covers Unicode, empty rows, and note-start/end boundaries. The 32 seeds execute 6,160 actual steps (2,048 structural operations plus 4,112 Undo/Redo steps). A separate regression repeats inline Join/Undo/Redo across sync and reload.Gates (verbatim): fmt; clippy -D warnings; block-ids tests; the three harnesses at full size; fuzz ≥ 15 min; and the perf tests still pass on this build host.
All passed on 10by32-02-std arm64, build host. Every heavy command used
/usr/local/bin/build-slot.sh; Cargo used-j8. The release suite completed in segments: 225 tests passed, zero failed, five optional tests ignored by the normal suite. The cached-key benchmark and ignored load-scaling diagnostic were then run explicitly and passed; the optional reviewer soak/snapshot and VERIFY4 perf diagnostic remain ignored. No reviewer oracle or assertion was changed.Fmt:
cargo fmt --all -- --check(exit 0, no output).Clippy:
cargo clippy -j8 -p calternal-block-ids --all-targets -- -D warnings(exit 0).Full independent campaigns: VERIFY3 200,000 seeds, VERIFY4 300,000 seeds, VERIFY5 300,000 seeds. VERIFY3 used eight disjoint 25,000-seed shards over [758200000, 758400000); VERIFY5 used five disjoint 60,000-seed shards over [758500000, 758800000). Initial monolithic runs were deliberately stopped and replaced by these complete shards. VERIFY4 used [758400000, 758700000). Raw final summaries:
Fuzz:
CARGO_BUILD_JOBS=8 cargo +nightly fuzz run marker_import corpus/marker_import seeds/marker_import -- -max_total_time=930 -max_len=4096 -timeout=30 -rss_limit_mb=4096 -dict=marker_import.dict -seed=7581032fromfuzz/, exit 0. The 933 seconds exclude compilation. This target checks parser/import panic safety; the property above checks structural history semantics.Performance timings below are build host, not perf-VM measurements. Cached keys ran with
IDS_VERIFY7D_BUILD_HOST=10by32-02-std; both commands usedcargo test --release -j8 -p calternal-block-idsthrough the build slot:--test cached_keys ten_thousand_lines_five_hundred_links_all_keys -- --ignored --nocapture --test-threads=1--test load_scaling -- --include-ignored --nocapture --test-threads=1Evidence and exact commands:
/home/agent/codex-jobs/ids-fix-join/on the build host. No PR merge, deployment, or perf-test-* host access.Cleanup complete:
target/andfuzz/target/removed with Cargo clean; the recorded lease-heartbeat process and its sleep child are stopped. Operational caveat: the initial background heartbeat exited with its launching shell, leaving a lapse before it was restarted in a persistent session at 21:50 UTC.Independent verification, round 2, of
b9397f92..57724c04: fix first — two P2 defects remain. Both reproduce with the pre-fix production implementation too; I found no confirmed correctness regression introduced by this 31-line fix. The round-one minimal regressions now pass, and all four reviewer test files are unchanged.P2: concurrent Undo of the same Join leaves visible neighbors unjoinable after reload. A loads/syncs
alpha ^first-id\nbeta ^last-id; B opens that state. Both offlinejoin(first, second); sync A, sync B, pull A. Both independentlyundo()before exchanging those updates; sync A, restart the server from checkpoint, sync B, pull A. Reload A andjoin(first, second): it rejects withjoin requires adjacent text in one note. Visible rows arealpha,beta; disk isalpha ^first-id\n\nbeta ^last-id, with an extra separator and no visible owner for the intervening blank row. Reload preserves the refusal.P2: an older Join's Undo misorders visible blocks after nested split history. Load/sync
\ntext ^target-id, retaining originalemptyandtexthandles. Runjoin(empty, text);tail = split(empty, 4);split(empty, 0);join(empty, tail); Undo four times. Expected rows["", "text"]; actual["text", ""]. Disk retains the empty prefix. The wrong visible order survives device reload, sync, and a fresh device. No human-byte loss is claimed. Baseline also fails, with worse reload behavior.Tests only: review/758b-tests, commit 42aac955. Reproduce both with
/usr/local/bin/build-slot.sh cargo test --release -j8 -p calternal-block-ids --test review758b_minimal -- --nocaptureon that branch. The final two minimal tests fail unchanged against both baseline and head.The independent deep-history driver checked 2,905 actual operations across 24 fresh seeds (up to 400 steps each): 1,125 Undo, 232 Redo, 774 Split, 774 Join, including 583 start and 568 end splits. It compares literal text snapshots, checks live-owner partitions and immutable ID-claim ownership, probes every neighboring join on durable copies, and checks device/server restarts after each successful step. 22 seeds failed; two completed all 400 steps. Separate concurrent disjoint Undo/Redo and server-authoritative B5 collision tests passed.
Gates (verbatim): fmt, clippy -D warnings, block-ids tests, the 3 harnesses, fuzz ≥ 15 min with fresh seeds.
--all-targets -- -D warnings): pass.[760000000, 760200000), zero failures.[760300000, 760600000), zero failures, 179.960 seconds.[760700000, 761000000), zero failed runs/model failures/grammar failures. All shards exited 0.7582030, exit 0, no crash. This target checks parser/import panic safety; the new tests check history semantics.cached_keysran withIDS_VERIFY7D_BUILD_HOST=10by32-02-std; added p95 was 0.116–0.140 ms for typing and 0.286 ms for Enter; first delimiter conversion 1.469 ms.load_scaling --include-ignored: 4 passed; 4x-line ratios were 3.873 for load+sync and 3.627 for first conversion. These numbers are build host measurements.Heavy commands used
/usr/local/bin/build-slot.sh; Cargo used-j8(fuzz compilation:CARGO_BUILD_JOBS=8). No product fixes, merges, deploys, orperf-test-*access. Detailed findings, baseline/head logs, and gate logs:/home/agent/codex-jobs/verify-758b/findings.md.Design plan opened: #768 — Plan: Undo with block IDs (#671), targeting
proto/block-identity-v7dfrom57724c04.docs/plans/0671-undo.mdcompares all three options and chooses server-validated structural inverse operations with stable boundary receipts and one central normaliser; native Undo remains for human text. It defines the invariant checker, concurrent Undo/B5 behavior, O(edited region) work, preserved perf-VM bounds, shared checks in all three harnesses plus semantic fuzzing, existing reproducers, and five likely failures.Documentation only on
docs/undo-block-ids-planat2f1ac759636dedfb4679a1117f094b8725114cb8. Checked whitespace and three-page A4 layout at 11-point body text; no product tests or deployments. This is a design proposal for review, not a claim that the two remaining Undo defects are fixed.kayg referenced this pull request2026-11-05 23:21:11 +00:00
housekeeping #1009: rebased+green for the targeted gates below, left open for review.
rebased block identity prototype. long randomized qualification is separate from targeted cargo checks.
head:
a16a63c28c8dcac28686749ab5503481d865d447, based on devcd7f84432febfc63b788fbb9b9f9950452982d74; pushed with the original exact force-with-lease.Mac VM validation through Nix and the shared Mac lock/slot passed: frontend frozen install, check, lint, build, bundle gate and unit tests;
cargo fmt -p calternal-block-ids -- --check;cargo check -j4 --locked -p calternal-block-ids --all-targets;cargo clippy -j4 --locked -p calternal-block-ids --all-targets -- -D warnings;cargo test -j4 --locked -p calternal-block-ids --lib(35 tests). frontend inputs are unchanged since the initial frontend pass. commands and logs.this is prototype/package validation. the historical five-hour verify5 randomized qualification, fuzzing and performance qualification were not rerun; no merge or production-readiness claim. carriage-return/CRLF fuzz seeds intentionally retain their original line-ending bytes.
original-head patch inventory,
pr-758.md.Parked (14 Nov housekeeping, #1106 triage comment). dev has no
crates/block-ids. The perf VM failed Enter at +1.785 ms p95 (gate: 1 ms), and load/sync is superlinear (10k notes: 166 ms). Left open on purpose; confirm any fix on the perf VM, not the build host.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.