store: FdOnly sealed MPHF g (fuse8 stays in RAM) - #161
Merged
Conversation
added 5 commits
August 20, 2026 06:09
Sealed lookup copied the full u32 graph into a Box (~4.92 B/key, ~7 GiB at mainnet). Open now keeps the file and preads 4 KiB g-pages on index. Seal still builds g in RAM. Fuse8 stays resident.
Sealed lookup now gathers g[a,b,c] like open OA: unique pages, bounded in-flight buffers, KIND_MPHF_G CQEs. Fuse still skips misses in RAM so leftover waves do not touch g. SH MphfHead open is header-only too.
ibd: sizes now prints mphf_g= next to fuse8=. Heap is header-only; fuse8 remains the intentional ~1.5 GiB skip cache. Docs match.
Idx u32 stride-8 needs a 16 GiB soft / 32 GiB hard body span. Head rel is first_fk-relative, so fat Class A bodies must not seal extra OA/MPHF shards. Live roll stays 80% of slots; wipe-rebuild stays 2^bits. Drop insert_many force_roll and the head's idx soft-span wrappers.
Head tests no longer clear RBITCOIN_TX_IDX_SOFT_SPAN (different mutex than idx tests). Rebuild 2^bits is a thread-local pin with Drop restore, same shape as HeadScale::test_with. Rename live OA bits test to 25; SCHEMA / env-knobs / crash-recovery match FdOnly + count-only shards.
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.
Summary
Sealed BDZ
garrays are no longer copied into process heap onStore::open(~4.92 B/key, ~7 GiB at mainnet). Lookup streams unique 4 KiBgpages on the held uring session (KIND_MPHF_G), matching opentx.headOA page probes.Fuse8 fingerprints stay in RAM (~9 bits/key) so leftover misses still skip
gand.rel.ibd: sizesaddsmphf_g=(0 after open).tx.headshards by create count, not Class A body bytes. Live OA still rolls at 80% of slots; wipe-rebuild ranges are2^bits(default 2²⁶). Idx 16 GiB soft-span is unchanged..relstaysn×41-based relative tofirst_fkintx.head/meta.Rebuild seal bits is a thread-local test pin (Drop restore). Head tests no longer clear
RBITCOIN_TX_IDX_SOFT_SPAN.Plan
FdOnly sealed MPHF
g; keep fuse8 in RAM. Head shards by create count. No schema bump.Test
cargo test -p rbitcoin-store --libfiltersbdz_,tx_head_mphf,seal_mphf,scripthash_mphf,rebuild_head_direct,segmented_head,store::plan_head_rebuild_ranges_ignores_body_soft_span,fat_creates_do_not_roll_head_on_body_soft_span,tip_then_any_connected_in_cold_beats_unconnected_hotrebuild_seal_bits_override_is_thread_local,rebuild_seal_bits_override_restores_after_paniccargo test -p rbitcoin-net --lib format_sizesHost A/B after merge: tip-follow
anon=vsfile=(anon≈ fuse + L2 + baseline).