Skip to content

rdisp: add support for moving LtHash off the critical path - #11527

Open
ptaffet-jump wants to merge 1 commit into
mainfrom
ptaffet/rdisp-lthash
Open

ptaffet-jump wants to merge 1 commit into
mainfrom
ptaffet/rdisp-lthash

Conversation

@ptaffet-jump

Copy link
Copy Markdown
Collaborator

No description provided.

Copilot AI balanced review requested due to automatic review settings September 15, 2026 20:50
@github-actions

github-actions Bot commented Sep 15, 2026

Copy link
Copy Markdown
 ┌─ ⚡ PERF · f86485d vs main@7c0e042 ─────────────────────────────────
 │ SUITE                               BASELINE          NEW         Δ
 │ replay tps, mainnet               29,279 tps   29,256 tps  ·  -0.08%
 │ bench tps, localnet              834,333 tps  832,168 tps  ·  -0.26%
 │ snapshot load, testnet               15.53 s      15.50 s  ·  -0.21%
!│ mem total, mainnet                164.38 GiB   165.38 GiB  ▲  +0.61%
-│ mem total, testnet                 95.38 GiB    96.38 GiB  ▲  +1.05%
 │ clean compile, firedancer        335.2 cpu·s  336.2 cpu·s  ·  +0.30%
 │ binary size, firedancer             68.43 MB     68.50 MB  ·  +0.10%
 ├─────────────────────────────────────────────────────────────────────
@@ 1 REGRESSION · 1 WARNING · 0 IMPROVED · 5 NOISE @@
 └─────────────────────────────────────────────────────────────────────
history · 2 pushes
 ┌─ HISTORY · Δ vs main, per push, newest first ─────────────────────────
 │ HEAD         TPS    BENCH     SNAP    MEM·M    MEM·T  COMPILE   BINARY
-│ f86485d   -0.08%   -0.26%   -0.21%   +0.61%   +1.05%   +0.30%   +0.10%
-│ e86ce2f   -0.25%   +0.04%   -0.24%   +0.61%   +1.05%   +3.34%   +0.10%
 └───────────────────────────────────────────────────────────────────────

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Pending-queue sizing, scratch initialization, aliasing, and test-input defects can cause incorrect or undefined behavior.

Get a fresh assessment by requesting another Copilot review.

Pull request overview

Adds LtHash pseudo-transactions to replay dispatching so account hashing can run outside the critical path.

Changes:

  • Tracks writable accounts and schedules LtHash pseudo-transactions.
  • Adds a per-lane priority queue and tests.
  • Updates dispatcher APIs, callers, memory sizing, and verification.
File summaries
File Description
src/discof/replay/fd_rdisp.c Implements LtHash tracking and pseudo-transaction scheduling.
src/discof/replay/fd_rdisp.h Exposes and documents the new APIs.
src/discof/replay/fd_rdisp_mq.h Adds the account priority queue.
src/discof/replay/test_rdisp.c Tests LtHash scheduling behavior.
src/discof/replay/test_rdisp_mq.c Tests priority-queue operations.
src/discof/replay/fd_sched.c Updates the scheduler call site.
src/discof/replay/fuzz_sched_rdisp.c Updates the fuzz mirror call site.
src/discof/replay/Local.mk Builds and runs the new test.
Review details

Suppressed comments (1)

src/discof/replay/test_rdisp_mq.c:23

  • This repeats the zero-based calculation from insertion, so the first pop also uses the contractually invalid account index 0. Compute the same one-based cyclic index here.
      ulong acct_idx = fd_ulong_if( outer+inner<=20UL, outer+inner, outer+inner-19UL );
  • Files reviewed: 8/8 changed files
  • Comments generated: 12
  • Review effort level: Balanced

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +202 to +206
struct fd_rdisp_ptxn {
/* These fields have the same meaning as in fd_rdisp_txn_t */
uint in_degree;
float score;
union {
Comment thread src/discof/replay/fd_rdisp.c
Comment thread src/discof/replay/fd_rdisp.c Outdated
Comment thread src/discof/replay/fd_rdisp_mq.h
/* Test the LtHash support */
FD_TEST( 0==fd_rdisp_add_block( disp, tag( 0UL ), 1UL ) );

ulong w[1];
hand, when adding a transaction, rdisp optionally populates a bitmask
indicating which writable accounts have not been marked as writable
in a transaction inserted since the most recent pseudo-transaction
was created for it. That's a little obtuse, but essenitally creating
Comment on lines +501 to +504
must be in the PENDING, READY, or DISPATCHED state, which means
txn_idx must have been returned from get_next_ready and must have
FD_RDISP_LTHASH_PSEUDO_TXN set. Note that this means once you call
complete_txn on a txn_idx, you cannot call this function on it any

IMPORTANT: if insert_block is staged, add_pseudo_txn must be called
until it returns 0 prior to inserting another block in the same
staging lane. You may also use fd_rdisp_add_all_psuedo_txn for this
Comment thread src/discof/replay/fd_rdisp_mq.h Outdated
char const * readonly, /* in [A-z] */
int serializing,
ulong * writers_bitset ) {
char categorized[3][2][128]; /* (signer, nonsigner, alt) x (writeble, readonly) x accts */
Copilot AI review requested due to automatic review settings September 21, 2026 20:52

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

Promotion can lose required LtHash work, the fuzz verifier buffer now overflows, and newly added tests contain deterministic failures.

Get a fresh assessment by requesting another Copilot review.

Review effort: Balanced
Findings: 3 High severity · 2 Medium severity · 4 Low severity

Open (9)
Resolved since last review (6)

Comment on lines +1126 to +1131
fd_rdisp_ptxn_t * ptxn = disp->ptxn_pool + EDGE_SPECIAL_IDX( ele->ptxn_idx );
ptxn->in_degree = IN_DEGREE_FREE;
ptxn_pool_ele_release( disp->ptxn_pool, ptxn );

ustlt_dlist_ele_remove ( block->ustlt_created, ele, disp->ustlt_pool );
ustlt_dlist_ele_push_tail( disp->ustlt_free, ele, disp->ustlt_pool );
for( ulong inner=1UL; inner<10UL; inner++ ) {
ulong acct_idx = fd_ulong_if( outer+inner<=20UL, outer+inner, outer+inner-19UL );
fd_rdisp_mq_insert( mq, acct_idx, 0UL, (float)inner );
FD_TEST( fd_rdisp_mq_cnt( mq, 0UL )==inner+1UL );
Comment on lines +590 to +592
with at least depth*(FD_RDISP_MAX_ACCT_PER_TXN+1)+2 elements that
will be clobbered (its contents at the time of the function call are
ignored). */

This branch has not been deployed

No deployments
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.

2 participants