Skip to content

fix: harden btree cache and rope update paths#6

Open
zxch3n wants to merge 1 commit intomainfrom
codex/rope-correctness-perf
Open

fix: harden btree cache and rope update paths#6
zxch3n wants to merge 1 commit intomainfrom
codex/rope-correctness-perf

Conversation

@zxch3n
Copy link
Member

@zxch3n zxch3n commented Mar 6, 2026

Summary

  • harden B-tree cache propagation and root cache updates around structural insert/split paths
  • switch range traversal and sequential leaf navigation onto the leaf linked list fast path
  • implement Rope::update_in_place() and move the old ignored rope update tests into the active suite
  • add targeted regression coverage for cross-parent merge, partial drain drop, prefix-cache traversal, root-cache recomputation, and random rope differential edits

Validation

  • cargo test
  • cargo test --release
  • cargo test -- --ignored

Performance

Benchmark setup:

  • base: origin/main at 0ae02fa in a clean worktree
  • branch: codex/rope-correctness-perf at 2a7b89a
  • commands:
    • cargo bench --bench bench_ord -- --quick
    • cargo bench --bench bench_rope -- --quick

Quick benchmark snapshots on this machine were mixed and noisy, so this PR does not claim a statistically significant performance improvement:

Benchmark origin/main This branch Read
OrdTree 100K insert [108.88, 109.23, 110.64] ms [116.49, 126.16, 164.86] ms worse / noisier in this run
10K random insert/delete / Rope [490.58, 511.93, 517.27] us [865.05, 889.52, 895.63] us worse in this run
Automerge paper / Rope [14.096, 19.332, 20.641] ms [11.516, 11.592, 11.897] ms better in this run

Given the variance, the current takeaway is correctness hardening first; performance is still mixed and should be re-measured with a more stable benchmark setup before drawing conclusions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant