Skip to content

test(rccl): add host microtests for src/ras/diagnostics_env.cc - #12435

Merged
aduforest merged 8 commits into
developfrom
users/aduforest/ras-diagnostics-env-host-microtests
Oct 9, 2026
Merged

aduforest merged 8 commits into
developfrom
users/aduforest/ras-diagnostics-env-host-microtests

Conversation

@aduforest

@aduforest aduforest commented Sep 29, 2026 •

Copy link
Copy Markdown
Member

JIRA ID: AICOMRCCL-2460

What

Adds host-only microtests for src/ras/diagnostics_env.cc, covering environment collection, rank summaries, and error handling without changing production code.

The 32 enabled tests cover:

  • local NCCL environment collection and non-NCCL filtering;
  • empty, exact-capacity, and truncated payloads;
  • reporter and payload validation failures;
  • consistent, incomplete, mismatched, unset, and truncated rank summaries;
  • multiple communicators, malformed payloads, display truncation, and control-character sanitization;
  • stable rank grouping with repeated values and reporter-error propagation across every summary path;
  • multi-key ordering/deduplication and allocation failures in collection and summarization.

One additional disabled regression tracks the production reporting defect AICOMRCCL-2743.

How

ras-diagnostics-env-test.cc includes the hipified ras/diagnostics_env.cc directly in the existing rccl-UnitTestsMicro binary. It reuses the real shared diagnostics helpers and the communicator registry already supplied by the existing RAS microtests.

Coverage

Previously reported local coverage for this source file is listed below. Coverage was not regenerated for this review follow-up; the CI results below are historical.

  • Functions: 20/20 (100.00%)
  • Lines: 298/298 (100.00%)
  • Regions: 557/763 (73.00%)
  • Branches: 286/428 (66.82%)

Mutation Testing

The following results are preserved from the previously reported local mutation runs. Current-head mutation results have not been verified.

Previously reported targeted behavioral mutations: 13/13 killed.

The NCCL-prefix filter, exact-capacity boundary, value equality, covered-rank grouping, reporter-error propagation, key-length ordering and matching, key deduplication, truncated nonempty payload handling, full communicator identity, candidate-key sizing, and allocation-failure mutations were all caught by the suite.

Historical CI

Host unit tests (CPU-only) CI passed for commit 6a5dedc6b8be after merging develop and retaining both the RAS and tuning test registrations.

Check Result
RasDiagnosticsEnvMicrotest.* 25/25 passed in the shared binary
Full rccl-UnitTestsMicro 1468/1468 passed
Host unit tests (CPU-only) job Passed
Production source changes None; changes are confined to projects/rccl/test/

Review follow-up

  • Centralized environ save/override/restore in fakes/env_fakes.{h,cc}. During an enumeration override, SetMicroEnviron, SetMicroEnv, micro_getenv, and getenv agree; tests cover updates, absence, duplicates, malformed entries, and restoration.
  • Environment, common diagnostics, and RAS suites share mutex-protected communicator registry installation/reset, including sorted-state reset. Common diagnostic owned-communicator/reporter helpers are shared too.
  • Wrapped collector output in RAII, collapsed the allocation forwarders, removed internal allocation-layout assertions, and derive the failure-injection sweep from a successful baseline run.
  • Split reporter-error paths and negative-size validation into individually named tests; derive the displayed byte budget from RAS_DIAG_ENV_BYTES.

Deferred production finding

AICOMRCCL-2743, under AICOMRCCL-2397, tracks the environment reporters' omission of host/process hashes. Different communicator identities sharing commHash currently look identical in reports. Production grouping is not alleged broken.

DISABLED_Summarize_HashCollisionsReportFullCommIdentity specifies full IDs for consistent, mismatch, and mismatch-summary output. Explicitly enabling it reproduces all three expectation failures on current production. It remains disabled pending a separate production fix. The enabled multi-communicator test still checks grouping without requiring the shortened identity format.

Current local validation

  • 32/32 enabled environment tests, plus 23 common diagnostics tests and 71 RAS tests, passed 20 shuffled repetitions (126 tests per iteration). One production regression is disabled as described above.
  • Environment/common diagnostics and the environment fake use ASan + UBSan. The RAS translation unit uses ASan only, because an existing unrelated malformed-notification fixture loads enum value 99 and trips enum UBSan in ras.cc. Leak detection is disabled.
  • Changed translation units were rebuilt and linked against cached shared fake objects and GoogleTest. This is focused validation, not a fresh full host-binary build. Current-head full CI is pending; coverage and the historical 13-mutation set have not been rerun.

@aduforest

Copy link
Copy Markdown
Member Author

@argus review

@aduforest
aduforest requested review from a team September 29, 2026 02:31
@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

Bottom line: Worth settling before approval: no test goes above 2 ranks, so the covered[] rank grouping is unpinned, and no test installs a failing emit, so every reporter-error path stays untaken.

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

@aduforest
aduforest force-pushed the users/aduforest/ras-diagnostics-env-host-microtests branch from 09e80bb to dc2bdaa Compare September 29, 2026 07:50
@aduforest

Copy link
Copy Markdown
Member Author

@argus re-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

Bottom line: Worth settling before approval: no Summarize test feeds two distinct env keys, leaving the key dedup and comparator in diagnostics_env.cc unpinned; the allocation-failure seam from the last round is also still open.

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

@aduforest
aduforest force-pushed the users/aduforest/ras-diagnostics-env-host-microtests branch from dc2bdaa to aead397 Compare September 29, 2026 18:02
@aduforest

Copy link
Copy Markdown
Member Author

@argus re-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

Bottom line: Worth settling before approval: the new two-key test uses NCCL_Z/NCCL_A, which share no prefix, so the key-prefix handling at diagnostics_env.cc:51 and :82 is still unpinned.

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

Comment thread projects/rccl/test/host/CMakeLists.txt Resolved
@aduforest
aduforest force-pushed the users/aduforest/ras-diagnostics-env-host-microtests branch from aead397 to 069e797 Compare September 30, 2026 00:36

@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

Bottom line: Worth settling before approval: no test feeds a multi-rank comm whose env is consistent, so deleting the value compare at diagnostics_env.cc:277 leaves all 24 tests green.

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

@aduforest
aduforest force-pushed the users/aduforest/ras-diagnostics-env-host-microtests branch from 069e797 to 991a70a Compare September 30, 2026 05:32
@aduforest

Copy link
Copy Markdown
Member Author

@argus re-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

Bottom line: Nothing new worth raising; still open from earlier: ras-diagnostics-env-test.cc:339 and 6 more. Worth clearing before approval.

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

@aduforest

Copy link
Copy Markdown
Member Author

@argus review

@amd-argus

amd-argus Bot commented Sep 30, 2026

Copy link
Copy Markdown
Contributor

@aduforest the current head (991a70a0) already has a review from me above; nothing has changed since then for me to look at again. Push a change and I'll pick it up, or ask again once you have.

@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

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 September 30, 2026 20:20

@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

Bottom line: Worth settling before approval: the suite's only multi-comm case has empty env payloads, so no test ever compares keys for a comm after the first.

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

@aduforest

Copy link
Copy Markdown
Member Author

@argus re-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

Bottom line: LGTM.

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

@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

Bottom line: Nothing new worth raising; still open from earlier: ras-diagnostics-env-test.cc:501. Worth clearing before approval.

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

@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

Bottom line: LGTM.

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

@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

Bottom line: LGTM.

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

@JeniferC99

Copy link
Copy Markdown
Collaborator

Cancelling the remaining gfx950 jobs on this run so the TheRock submodule bump PRs can be prioritized on the gfx950 queue.

This change does not target gfx950, and gfx950 was the only work still outstanding. Jobs that already finished are unchanged. Re-run failed jobs if you need gfx950 results before merge.

@aduforest aduforest added the Blocked by CI Waiting for CI to pass before reviews or merging label Oct 7, 2026

@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

Bottom line: LGTM.

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

@aduforest
aduforest merged commit 40d322b into develop Oct 9, 2026
94 of 106 checks passed
@aduforest
aduforest deleted the users/aduforest/ras-diagnostics-env-host-microtests branch October 9, 2026 07:18
@systems-assistant

Copy link
Copy Markdown
Contributor

TheRock Submodule Bump Activity

Newest first

anujshuk-amd pushed a commit that referenced this pull request Oct 12, 2026
JIRA ID: AICOMRCCL-2460

## What

Adds host-only microtests for `src/ras/diagnostics_env.cc`, covering
environment collection, rank summaries, and error handling without
changing production code.

The 32 enabled tests cover:

- local NCCL environment collection and non-NCCL filtering;
- empty, exact-capacity, and truncated payloads;
- reporter and payload validation failures;
- consistent, incomplete, mismatched, unset, and truncated rank
summaries;
- multiple communicators, malformed payloads, display truncation, and
control-character sanitization;
- stable rank grouping with repeated values and reporter-error
propagation across every summary path;
- multi-key ordering/deduplication and allocation failures in collection
and summarization.

One additional disabled regression tracks the production reporting
defect AICOMRCCL-2743.

## How

`ras-diagnostics-env-test.cc` includes the hipified
`ras/diagnostics_env.cc` directly in the existing `rccl-UnitTestsMicro`
binary. It reuses the real shared diagnostics helpers and the
communicator registry already supplied by the existing RAS microtests.

## Coverage

Previously reported local coverage for this source file is listed below.
Coverage was not regenerated for this review follow-up; the CI results
below are historical.

- Functions: 20/20 (100.00%)
- Lines: 298/298 (100.00%)
- Regions: 557/763 (73.00%)
- Branches: 286/428 (66.82%)

## Mutation Testing

The following results are preserved from the previously reported local
mutation runs. Current-head mutation results have not been verified.

Previously reported targeted behavioral mutations: 13/13 killed.

The NCCL-prefix filter, exact-capacity boundary, value equality,
covered-rank grouping, reporter-error propagation, key-length ordering
and matching, key deduplication, truncated nonempty payload handling,
full communicator identity, candidate-key sizing, and allocation-failure
mutations were all caught by the suite.

## Historical CI

[Host unit tests (CPU-only)
CI](https://github.com/ROCm/rocm-systems/actions/runs/36798053397/job/110165926508)
passed for commit `6a5dedc6b8be` after merging develop and retaining
both the RAS and tuning test registrations.

| Check | Result |
| --- | --- |
| `RasDiagnosticsEnvMicrotest.*` | 25/25 passed in the shared binary |
| Full `rccl-UnitTestsMicro` | 1468/1468 passed |
| Host unit tests (CPU-only) job | Passed |
| Production source changes | None; changes are confined to
`projects/rccl/test/` |


## Review follow-up

- Centralized `environ` save/override/restore in
`fakes/env_fakes.{h,cc}`. During an enumeration override,
`SetMicroEnviron`, `SetMicroEnv`, `micro_getenv`, and `getenv` agree;
tests cover updates, absence, duplicates, malformed entries, and
restoration.
- Environment, common diagnostics, and RAS suites share mutex-protected
communicator registry installation/reset, including sorted-state reset.
Common diagnostic owned-communicator/reporter helpers are shared too.
- Wrapped collector output in RAII, collapsed the allocation forwarders,
removed internal allocation-layout assertions, and derive the
failure-injection sweep from a successful baseline run.
- Split reporter-error paths and negative-size validation into
individually named tests; derive the displayed byte budget from
`RAS_DIAG_ENV_BYTES`.

## Deferred production finding

**AICOMRCCL-2743**, under **AICOMRCCL-2397**, tracks the environment
reporters' omission of host/process hashes. Different communicator
identities sharing `commHash` currently look identical in reports.
Production grouping is not alleged broken.

`DISABLED_Summarize_HashCollisionsReportFullCommIdentity` specifies full
IDs for consistent, mismatch, and mismatch-summary output. Explicitly
enabling it reproduces all three expectation failures on current
production. It remains disabled pending a separate production fix. The
enabled multi-communicator test still checks grouping without requiring
the shortened identity format.

## Current local validation

- **32/32 enabled environment tests**, plus **23 common diagnostics
tests and 71 RAS tests**, passed **20 shuffled repetitions** (126 tests
per iteration). One production regression is disabled as described
above.
- Environment/common diagnostics and the environment fake use **ASan +
UBSan**. The RAS translation unit uses **ASan only**, because an
existing unrelated malformed-notification fixture loads enum value 99
and trips enum UBSan in `ras.cc`. Leak detection is disabled.
- Changed translation units were rebuilt and linked against cached
shared fake objects and GoogleTest. This is focused validation, not a
fresh full host-binary build. Current-head full CI is pending; coverage
and the historical 13-mutation set have not been rerun.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Blocked by CI Waiting for CI to pass before reviews or merging organization: ROCm project: rccl

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants