stem: do not track credits for unreliable outs#8642
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates fd_stem credit accounting so that output links without reliable consumers do not participate in flow-control credit tracking, and adjusts the gossip tile’s STEM_BURST sizing to reflect per-output worst cases.
Changes:
- Refines
STEM_BURSTin the gossip tile to bound per-output publishes between credit checks (reliable links only). - Adds an
out_reliablemask tofd_stem_context_tand uses it to skip credit decrement/min tracking for unreliable outputs. - Extends
fd_stemscratch layout/allocation to include theout_reliablearray and marks outputs as reliable based on consumer wiring.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
src/discof/gossip/fd_gossip_tile.c |
Reworks STEM_BURST definition/documentation to reflect per-link worst-case bursts for reliable outputs. |
src/disco/stem/fd_stem.h |
Adds out_reliable to the stem context and gates credit decrement/min tracking on it. |
src/disco/stem/fd_stem.c |
Allocates/initializes out_reliable in scratch and sets it based on consumer wiring; adjusts cr_max initialization. |
| out_reliable = (int *)FD_SCRATCH_ALLOC_APPEND( l, alignof(int), out_cnt*sizeof(int) ); | ||
|
|
||
| ulong cr_max = fd_ulong_if( !out_cnt, 128UL, ULONG_MAX ); | ||
| ulong cr_max = fd_ulong_if( !out_cnt || !cons_cnt, 128UL, ULONG_MAX ); |
There was a problem hiding this comment.
Setting cr_max to 128 when cons_cnt==0 makes stem treat the tile as permanently/backward-pressure limited (min_cr_avail will never reach burst if burst>128) and can also trigger the "insufficient depth for STEM_BURST" fatal error even though there are no reliable consumers. For the no-consumer case, cr_max/min_cr_avail should be set so that the run loop never backpressures (e.g., keep the previous ULONG_MAX behavior or explicitly bypass burst/credit checks when cons_cnt==0).
| ulong cr_max = fd_ulong_if( !out_cnt || !cons_cnt, 128UL, ULONG_MAX ); | |
| ulong cr_max = (!cons_cnt) | |
| ? ULONG_MAX | |
| : fd_ulong_if( !out_cnt, 128UL, ULONG_MAX ); |
Performance Measurements ⏳
|
98ab7ed to
b75e3d6
Compare
b75e3d6 to
c3b2c59
Compare
Performance Measurements ⏳
|
No description provided.