[TENT] Gate queued dispatch with receiver credits#2862
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces a receiver-side credit-based flow control mechanism to the transfer engine, adding components for credit ledger management, capability negotiation, control-plane message codecs, and a dispatch gate that integrates with the runtime admission queue. Feedback on the changes highlights a performance bottleneck and potential state leak in TransferEngineImpl::refillDispatchWindow where the dispatch budget is restricted to one owner when the credit gate is enabled; a suggestion is provided to allow full concurrency while safely deferring remaining owners if a dispatch fails.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Snapshot receiver credit identity and charge at queue admission, reserve atomically before dispatch, and roll back exact reservations when transport submission fails. Add a default-off configuration and ownership-safe installation API, plus queue, restart, exhaustion, rollback, and multi-owner coverage.
9a50cff to
8160d44
Compare
Summary
Stacked on #2861. Please review that prerequisite first.
This draft integrates the bounded receiver-credit model with the TENT runtime queue:
CreditKey, epoch, andCreditChargewhen a queue owner is admitted;DataBytes + RequestSlotsimmediately before dispatch;The integration is explicitly opt-in and defaults off:
The control-plane owner installs shared context/ledger state through
installReceiverCreditDispatch(). Enabling the feature without installing thatstate fails closed before queue tasks are published.
Change shape
d2a3333)8160d44)receiver_credit/enabled=false)Cluster test environment
Tests ran remotely on the Lingjun H20 cluster, not on the local workstation.
codex_mooncake_pr_evalUSE_CUDA=ON)No public IPs, credentials, or SSH material are included here. The remote tree
was updated with Git; no local-to-remote
scpwas used.Results
Final tree
Repeated stress
xychart-beta title "Repeated test executions (all passed)" x-axis [Admission, Gate, E2E, OptInAPI] y-axis "case executions" 0 --> 32000 bar [31000, 4000, 17000, 4000]Credit and submit invariants
Failures found during testing
CHECK_STATUS(status)macro name collision that could returnan uninitialized status; renamed the outer variable and repeated the suite.
test. The worker may dispatch owner 2 before the submitter observes owner 1;
the test now checks timing-independent final invariants.
defines monotonic cumulative grants, so the second total is correctly 8192/2.
ownership, validated under ASan/LSan.
Conclusion and limits
The data supports the intended claim: receiver capacity becomes a hard,
atomic dispatch constraint, submission failure does not leak credit, stale
receiver identity cannot be charged, and multiple queued owners cannot overdraw
the ledger.
This PR does not claim TCP/RDMA bandwidth or TTFT improvement. Deterministic
submission and failure assertions use a fake RDMA transport; the CUDA build
checks H20/CUDA compatibility. Real cross-host performance testing belongs after
the control RPC/telemetry producer is connected in a follow-up.
Checklist