Skip to content

confirm: probe in-flight outs once, not per parent - #266

Closed
rearden-grok[bot] wants to merge 1 commit into
masterfrom
confirm/load-inflight-outs
Closed

confirm: probe in-flight outs once, not per parent#266
rearden-grok[bot] wants to merge 1 commit into
masterfrom
confirm/load-inflight-outs

Conversation

@rearden-grok

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

Copy link
Copy Markdown
Contributor

Summary

Post-milestone IBD (~843k, ~8.3 blk/s) saturates the load OS thread, not scripts. A 5s window was load_thr busy/wait ≈ 4475/430ms; pin_hit% ≈ 19% (expected: fat blocks, 18 pipeline maps cover few heights). Load split was stamp pack ~2.1s + pin ~2.1s; stamp_sub batch= ~1.9s with only ~0.5s in the named nested timers.

Root cause: fill_missing_parent_ranges and pin adopt called InFlightView::get_out(id) per unique spent parent (~160k) × every in-flight layer (~15) → millions of HashMap probes. get_out assumed L and pack counts stay small; unique parents now dwarf pipeline CreatePins.

This PR:

  • Unions in-flight CreatePin keys once (out_ids / for_each_out, newest-first, each id once) and skips that way in fill_missing + pin adopt.
  • Names the former batch= gap on ibd: perf: fill= / idx= (spent/body range batches).

Not in this PR (follow-ups): overlap txout.body with stamp CPU; carry spent_range on published live_union; invert get_create_fk the same way; sequential fk index vs batch_pin_by_id; lookup head= probe (~3.5s on lookup_thr).

Does not flatten io_uring machines. Pins stay plan/batch only.

Test plan

  • cargo test -p rbitcoin-query out_ids_unions fill_missing_skips
  • cargo test -p rbitcoin-consensus pin_for_wire
  • cargo test -p rbitcoin-net format_info_and_debug_optional_subblocks
  • cargo fmt --all
  • Required Actions green (fmt, deny, clippy, ast-grep, test, windows, macos, multinode, coverage)
  • Next IBD: stamp_sub fill= should drop vs prior batch= gap; idx= shows remaining spent.idx cost

Made with Cursor

Post-milestone unique spent parents were walking every in-flight layer
via get_out in fill_missing and pin adopt. Union the CreatePin keys
instead. Name that wall fill=/idx= on ibd: perf.

Co-authored-by: Cursor <cursoragent@cursor.com>
@reardencode

Copy link
Copy Markdown
Owner

No thanks.

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