Expand description
B+tree insert path with copy-on-write splits.
See docs/format.md § B+tree write semantics. Every node touched
along the insert path is rewritten to a freshly-allocated page;
the displaced pages enter the freelist only after the new root is
staged in the pager’s WAL transaction buffer. The caller is
responsible for calling Pager::commit to make the insert
durable.
§Power-of-ten posture
- Rule 1. The walk root → leaf uses an explicit
heapless::Vec<_, MAX_BTREE_DEPTH>path stack. The bubble-up loop is awhile let Some(...)over that stack — no recursion. - Rule 2. Every loop is bounded: by the path length (≤
MAX_BTREE_DEPTH), bykey_count(a node’s slot count), or byLEAF_SLOT_CAP/INTERNAL_SLOT_CAP. - Rule 5.
validate_noderuns on every encoded node behind adebug_assert!; release builds surface invariant breaks asError::BTreeInvariantViolated.