Skip to content

test(rccl): add host microtests for the GIN host proxy - #13596

Open
aduforest wants to merge 3 commits into
developfrom
users/aduforest/aicomrccl-2807-gin-host-proxy-host-microtests
Open

aduforest wants to merge 3 commits into
developfrom
users/aduforest/aicomrccl-2807-gin-host-proxy-host-microtests

Conversation

@aduforest

@aduforest aduforest commented Oct 15, 2026 •

Copy link
Copy Markdown
Member

JIRA ID: AICOMRCCL-2807

What

Host-only microtests for src/gin/gin_host_proxy.cc and the versioned GPU-context writers in src/gin/proxy_gpucontext/ (gpucontext{,_v1,_v2}.cc), in a new rccl-UnitTestsMicroGinHostProxy binary (64 tests).
Overlaps rahulvaidya20's #13221 (same file name, same unit); will reconcile with it.

How

  • gin-host-proxy-test.cc #includes the four hipified units and seams the RMA plugin, device allocations, hipMemset and the DMA-BUF export in the TU; GFDs are posted straight into the host-side queues.
  • Pins 4 production bugs as observed, not fixed:
    • ncclGinProxyRegMrSym: when both DMA-BUF registrations fail, it returns before closing the second exported fd.
    • ncclGinProxyCreateContext: accepts backendVersion 0, fails in the GPU-context writer, and releases nothing it created.
    • A non-power-of-two maxRecvs gives a queue the index mask cannot wrap.
    • ncclGinProxyDestroyContext never frees the signal-offsets buffer.

Coverage

Lines: gin_host_proxy.cc 476/476, gpucontext.cc 33/33, gpucontext_v1.cc 10/10, gpucontext_v2.cc 13/13.

Mutation Testing

57/57 killed: 53 in gin_host_proxy.cc, 4 in the GPU-context writers.

Test Plan

Standalone build: rccl-UnitTestsMicroGinHostProxy 64/64; --gtest_shuffle --gtest_repeat=20 is clean.

Cover src/gin/gin_host_proxy.cc (the GIN proxy backend over an RMA
plugin: listen/connect, symmetric MR registration with the DMA-BUF
retry, context create/destroy, GFD polling, submission and completion)
and the versioned GPU-context writers in src/gin/proxy_gpucontext/, in
a new rccl-UnitTestsMicroGinHostProxy binary.

Pins as observed: the second DMA-BUF fd leaks when both registrations
are rejected, backendVersion 0 fails only after every buffer and the
RMA context are created (and leaks them), a non-power-of-two maxRecvs
gives a non-power-of-two queue, and destroy never frees the
signal-offsets buffer.

Co-Authored-By: Claude <noreply@anthropic.com>
@aduforest

Copy link
Copy Markdown
Member Author

@argus review

@therock-pr-bot

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?

@amd-argus amd-argus Bot 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.

ARGUS

Findings

5 more finding(s), not posted inline
  • projects/rccl/test/host/gin-host-proxy-test.cc:858 (Low) ginCtx_ left dangling after mid-test destroyContext; a failing Create then makes TearDown destroy it twice
  • projects/rccl/test/host/gin-host-proxy-test.cc:49 (Low) Outer for loops without braces around a nested if or a wrapped body (lines 49, 1114, 1295)
  • projects/rccl/test/host/gin-host-proxy-test.cc:906 (Low) Create_LogsWhenGdrCopyIsUnavailable proves its no-GDR half only through log text
  • projects/rccl/test/host/gin-host-proxy-test.cc:808 (Nit) WriteCombined assertion pins a host_flags argument that gdrwrap.h allocMemCPUAccessible ignores
  • projects/rccl/test/host/gin-host-proxy-test.cc:989 (Nit) Pinned-bug tests use '// Observed:' instead of the repo's 'LATENT BUG (file:line)' convention

This PR changes 1,552 lines across 7 files. A change this size is hard to review
well, for a person and for this bot alike: reviewers lose the thread, defects hide in the
volume, and the feedback arrives too late to be cheap to act on. Splitting it into a
stacked pull request
gives each piece a reviewable diff and keeps the history. This review covers the whole change
regardless.

Bottom line: Looks approval ready.

Comment @argus review to re-run, or @argus re-review after pushing.

Null ginCtx_ after every mid-test destroy, brace the nested loops, check
the counters pointer the GPU gets with and without GDRCopy, drop the
host_flags assertions allocMemCPUAccessible ignores on HIP, and use the
LATENT BUG (file:line) convention for the pinned bugs.

Co-Authored-By: Claude <noreply@anthropic.com>
@aduforest

Copy link
Copy Markdown
Member Author

Addressed in 53517f8 (all five, rebuilt, 64/64 and clean × 20 shuffled):

  • :858 dangling ginCtx_: every mid-test destroy now goes through a Destroy() helper that nulls ginCtx_, so a failing Create can't make TearDown destroy twice.
  • Loop braces: added on the three nested/wrapped loops.
  • GDR half: Create_GdrCopyChoosesTheCountersMappingTheGpuSees now also checks the counters pointer published in the GPU context (host pointer without GDRCopy, the device mapping with it), not just the log line.
  • WriteCombined: dropped the host_flags assertions; only forceHost (which the HIP path honours) is still checked.
  • Pinned bugs now use LATENT BUG (gin_host_proxy.cc:line).

@argus review

@amd-argus amd-argus Bot 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.

ARGUS

This PR changes 1,558 lines across 7 files. A change this size is hard to review
well, for a person and for this bot alike: reviewers lose the thread, defects hide in the
volume, and the feedback arrives too late to be cheap to act on. Splitting it into a
stacked pull request
gives each piece a reviewable diff and keeps the history. This review covers the whole change
regardless.

Bottom line: LGTM.

Comment @argus review to re-run, or @argus re-review after pushing.

@aduforest
aduforest marked this pull request as ready for review October 15, 2026 22:28
@aduforest
aduforest requested review from a team October 15, 2026 22:28
…comrccl-2807-gin-host-proxy-host-microtests

# Conflicts:
#	projects/rccl/test/host/MICROTEST_README.md
#	projects/rccl/test/host/run_host_tests.sh
#	projects/rccl/tools/scripts/test_runner/configs/ci-precheckin.json
#	projects/rccl/tools/scripts/test_runner/lib/test_executor.py
@aduforest

Copy link
Copy Markdown
Member Author

@argus review

@amd-argus amd-argus Bot 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.

ARGUS

This PR changes 1,558 lines across 7 files. A change this size is hard to review
well, for a person and for this bot alike: reviewers lose the thread, defects hide in the
volume, and the feedback arrives too late to be cheap to act on. Splitting it into a
stacked pull request
gives each piece a reviewable diff and keeps the history. This review covers the whole change
regardless.

Bottom line: LGTM.

Comment @argus review to re-run, or @argus re-review after pushing.

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