Skip to content

store: FdOnly sealed MPHF g (fuse8 stays in RAM) - #161

Merged
reardencode merged 5 commits into
masterfrom
store/mphf-fdonly
Aug 20, 2026
Merged

store: FdOnly sealed MPHF g (fuse8 stays in RAM)#161
reardencode merged 5 commits into
masterfrom
store/mphf-fdonly

Conversation

@rearden-grok

@rearden-grok rearden-grok Bot commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Summary

Sealed BDZ g arrays are no longer copied into process heap on Store::open (~4.92 B/key, ~7 GiB at mainnet). Lookup streams unique 4 KiB g pages on the held uring session (KIND_MPHF_G), matching open tx.head OA page probes.

Fuse8 fingerprints stay in RAM (~9 bits/key) so leftover misses still skip g and .rel.

ibd: sizes adds mphf_g= (0 after open).

tx.head shards by create count, not Class A body bytes. Live OA still rolls at 80% of slots; wipe-rebuild ranges are 2^bits (default 2²⁶). Idx 16 GiB soft-span is unchanged. .rel stays n×4 1-based relative to first_fk in tx.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 --lib filters bdz_, 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_hot
  • rebuild_seal_bits_override_is_thread_local, rebuild_seal_bits_override_restores_after_panic
  • cargo test -p rbitcoin-net --lib format_sizes

Host A/B after merge: tip-follow anon= vs file= (anon ≈ fuse + L2 + baseline).

rbitcoin-bot 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.
@reardencode
reardencode merged commit 8c7e8ed into master Aug 20, 2026
13 checks passed
@rearden-grok
rearden-grok Bot deleted the store/mphf-fdonly branch August 20, 2026 16:42
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