Repository navigation
core: compute TriePosition::page_id from path bytes directly - #992
Open
citizen-stig wants to merge 1 commit into
Open
citizen-stig wants to merge 1 commit into
citizen-stig wants to merge 1 commit into
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
citizen-stig
marked this pull request as ready for review
November 18, 2026 16:24
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
TriePosition::page_idbuilds the page path directly from the position's path bytes: one 6-bit child index per full page, read from a big-endianu16window. Before, it walked from the root withChildPageIndex::newandPageId::child_page_idonce per page. A new test compares it with the old walk for depths 1–256 on four bit patterns.Why
page_idis called on the seek and page-walker paths for every key.Benchmarks
finishinto_overlayIt doesn't need any open PR. On master + #979 + #987:
finish66.12 ± 0.23 → 65.75 ± 0.38 ms (−0.6%). Together with #991, #993 and #994 it gives −7.1% on master.finish_bench: an isolatedSession::finishbenchmark with the user-namespace access profile of a Sovereign SDK node (benchtop/src/bin/finish_bench.rs@ 3469d5c, not part of this PR). 50k–145kReadThenWriteaccesses per slot (68% updates with the prior value, 32% inserts), 36-byte values,BinaryHasher<Sha256>, rollback on, tree growing from 5.35M leaves, 10 warm-up + 20 measured slots from a restored seed DB.commit_concurrency8 on all 16 CPUs of an AMD Ryzen 7 7700 (8 cores). Mean of 8 runs. Master is6ee36d3. This PR, the three other small-commit PRs, and the same four on master + #979 + #987 were measured in one batch, with order rotated each round. Every run ends at the same root. Linuxcargo test --workspaceandcargo test -p nomt-core --features borsh,serdepass on this branch.🤖 Generated with Claude Code