Skip to content

fix(rdc): count the entries an rdcd reply carries in the RDC client - #14044

Open
adam360x wants to merge 1 commit into
developfrom
users/adam360x/rdc-client-replies
Open

adam360x wants to merge 1 commit into
developfrom
users/adam360x/rdc-client-replies

Conversation

@adam360x

@adam360x adam360x commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Stacked on #14041 as a draft: it shows only its own commit. When #14041 merges, this PR moves to develop, where RDC CI runs, and becomes ready for review.

Motivation

  • The standalone client took the job statistics' GPU and process counts and the policy count from the counts an rdcd reply states, not from the entries it carries. A reply that stated 16 GPUs, 64 processes and 32 policies but carried one of each gave rdc_job_get_stats() 15 stale GPU entries and 63 processes read past the reply, and rdc_policy_get() 31 policies read past it.
  • rdc_group_get_all_ids() and rdc_group_field_get_all_ids() rejected 64 IDs with RDC_ST_MAX_LIMIT, although rdcd holds up to 64 groups and 64 field groups, so rdci group -l failed once 64 groups existed.

Technical Details

  • The client counts the entries a reply carries, still rejects more than its arrays hold, and zeroes the job info first.
  • The two list calls reject only more than 64 IDs; rdc.h says so.

Issue Tracking

ISSUE ID : #14107

Part of a series of RDC fixes, which #14107 lists. No JIRA ticket.

Test Plan

rdc_client_replies_tests runs the client against a gRPC service that overstates its counts, each check in a child process. test_fake_gpu_client.py runs it from the tested prefix and lists 64 groups with rdci against rdcd and the fake amd-smi. All checks fail before this change.

Test Result

Fake-GPU suite: 108 passed, 24 skipped. tests/ci: 92 passed, 6 skipped.

Submission Checklist

The standalone client took the job statistics' GPU and process counts
and the policy count from the counts an rdcd reply states, not from
the entries it carries. A reply that stated 16 GPUs, 64 processes and
32 policies but carried one of each gave rdc_job_get_stats() 16 GPUs,
15 of them stale entries of the caller's struct, and 64 processes, the
last 63 read past the reply's processes, and rdc_policy_get() 32
policies, 31 of them read past the reply. The client now counts the
entries the reply carries, still rejects more than its arrays hold,
and zeroes the job info first. Its other list decoders already check
the entries a reply carries against the caller's array.

rdc_group_get_all_ids() and rdc_group_field_get_all_ids() rejected 64
ids with RDC_ST_MAX_LIMIT, although rdcd holds and lists up to 64
groups and 64 field groups, so rdci group -l failed with "The max
limit reached" once 64 groups existed. They now reject only more than
64 and then leave the count alone; rdc.h says so.

rdc_client_replies_tests runs the client against a gRPC service that
overstates its counts, on an abstract Unix socket, each check in a
child process. It links librdc_client for the generated service and
messages, so the process has one copy of them. test_fake_gpu_client.py
runs it from the tested prefix and lists 64 groups with rdci against
rdcd and the fake amd-smi. All checks fail before this change.

Signed-off-by: Adam360x <Adam.pryor@amd.com>
@adam360x

Copy link
Copy Markdown
Contributor Author

Reviewed manually, this is a good one that actually has some grpc testing harnesses etc.

@adam360x
adam360x marked this pull request as ready for review October 23, 2026 15:48
@adam360x
adam360x requested review from a team as code owners October 23, 2026 15:48
Base automatically changed from users/adam360x/rdc-fake-gpu-tests to develop November 5, 2026 16:51
@therock-pr-bot

therock-pr-bot Bot commented Nov 5, 2026

Copy link
Copy Markdown

✅ All Policy Checks Passed

Check Status Details
📝 PR Description ✅ Pass —
⛔ Forbidden Files ✅ Pass —
🧪 Unit Test ✅ Pass —
🚫 Draft PR 🔜 To Be Enabled —
🚩 Feature Flag 🔜 To Be Enabled —
📊 Code Coverage 🔜 To Be Enabled —

🎉 All policy checks passed!

📖 Need help? See the Policy FAQ for details on every check and how to fix failures.

🙋 Wish to Override Policy?

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant