pack, poh: use a dynamic microblock bound#9065
pack, poh: use a dynamic microblock bound#9065jherrera-jump merged 1 commit intofiredancer-io:mainfrom
Conversation
1a70176 to
73be6f8
Compare
There was a problem hiding this comment.
Pull request overview
This PR introduces a dynamically tightening upper bound on the total number of microblocks expected in a leader slot, computed by pack and forwarded along the microblock pipeline so PoH can reduce its remaining-microblock estimate as the slot elapses.
Changes:
- Add
max_microblocks_in_slotto microblock trailers and forward it from pack → (execle|bank) → PoH. - Implement dynamic microblock budgeting in
fd_pack_tilebased on elapsed slot wallclock time and enforce a monotonically decreasing bound. - Add PoH-side API to update/tighten
max_microblocks_per_slotusing the forwarded bound.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/disco/pack/fd_pack_tile.c | Computes/maintains a decreasing per-slot dynamic microblock cap and forwards it in the execle trailer. |
| src/disco/tiles.h | Extends microblock trailers with max_microblocks_in_slot for forwarding across tiles. |
| src/discof/execle/fd_execle_tile.c | Propagates the dynamic bound from pack trailer into the PoH-facing trailer. |
| src/discoh/bank/fd_bank_tile.c | Propagates the dynamic bound from pack trailer into the PoH-facing trailer (Frankendancer path). |
| src/discof/poh/fd_poh_tile.c | Consumes the forwarded bound on each microblock and calls the new PoH update API. |
| src/discof/poh/fd_poh.h | Declares fd_poh_update_max_microblocks. |
| src/discof/poh/fd_poh.c | Implements fd_poh_update_max_microblocks to adjust PoH’s microblock upper bound. |
73be6f8 to
673740c
Compare
673740c to
5af0479
Compare
| ctx->_bank = trailer->bank; | ||
| ctx->_pack_idx = trailer->pack_idx; | ||
| ctx->_txn_idx = trailer->pack_txn_idx; | ||
| ctx->_is_bundle = trailer->is_bundle; | ||
| ctx->_is_bundle = trailer->is_bundle; | ||
| ctx->_max_microblocks_in_slot = trailer->max_microblocks_in_slot; |
There was a problem hiding this comment.
In this assignment block, only the last two lines were realigned, leaving the earlier assignments (_bank, _pack_idx, _txn_idx) with different spacing. Consider aligning all of these related assignments consistently to keep the block readable and avoid future diffs that only change whitespace.
|
Reasonable but I don't think the math here is great, you probably want like a y = - x^1.5 or something curve on the pacing that hits 0 microblocks remaining right at end of slot? But you get the rapid decay closer to the end. Check with Philip might have good ideas. |
5af0479 to
8887aff
Compare
8887aff to
0d73137
Compare
0d73137 to
f211ccb
Compare
f211ccb to
7840a9b
Compare
7840a9b to
3371ecc
Compare
3371ecc to
8a78b9f
Compare
8a78b9f to
d3109ef
Compare
closes #8989
Problem
pack's slot_done message arrives at POH at 350ms after slot start. At this point POH still has to do ~130K hashes, which takes 4-5ms.
Solution
By reducing the microblock bound over the course of the slot (and eventually to 1/3 of the remaining budget at the end of the slot), we should be able to cut this down to ~1-2ms. 1/3 is probably a bit conservative and we could go lower but I think it's a good starting point.