[TENT] Add receiver-credit ledger model and protocol invariants#2860
[TENT] Add receiver-credit ledger model and protocol invariants#2860catyans wants to merge 4 commits into
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces the SenderCreditLedger class and associated data structures to manage receiver credits on the sender side, along with comprehensive unit tests. The feedback highlights opportunities to optimize the activate method by avoiding a redundant hash lookup when updating an existing entry, and notes the lack of a mechanism to clean up or deactivate stale sessions, which could lead to ledger capacity exhaustion over time.
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! |
|
CI follow-up: the failed-job rerun completed successfully.
The initial failures were runner infrastructure issues (disk exhaustion and sccache DNS/fail-fast), and neither reproduced. Workflow: https://github.com/kvcache-ai/Mooncake/actions/runs/29156606254 Keeping the PR in Draft while waiting for maintainer feedback on the protocol/scope boundary in #2849. |
Summary
Implements PR 1 of #2849: the private receiver-credit state model and deterministic protocol invariants.
This PR adds:
CreditKey,CreditResource,CreditCharge, and versionedReceiverCreditUpdateV1semantic types;Scope boundary
Intentionally excluded from this PR:
RequestAPI changes;The model is transport-neutral so the control path can be selected separately after maintainer feedback on #2849.
Invariants covered
Cluster validation
Validated from clean remote
git clone/fetchon the 4-node H20 lab; no local-to-remote file copy was used.ctest --repeat until-fail:1000passed.tent_runtimebuild passed.The four-node RDMA throughput/P99 matrix belongs to the benchmark-only #2859 and later dispatch-gating PR because this PR deliberately has no data-path integration.
Test plan
Related: #2849