Skip to content

[rocjitsu] Remove exceptions from runtime test fixtures - #14957

Merged
IanWood1 merged 3 commits into
developfrom
users/IanWood1/rocjitsu-device-fixture-errors
Nov 5, 2026
Merged

IanWood1 merged 3 commits into
developfrom
users/IanWood1/rocjitsu-device-fixture-errors

Conversation

@IanWood1

@IanWood1 IanWood1 commented Nov 3, 2026 •

Copy link
Copy Markdown
Member

Motivation

Remove setup exceptions from SDMA and runtime test fixtures.

Technical Details

Move fallible queue and synthetic-instruction setup out of constructors and check wave and memory-access results before use. Stop dependent test work after setup failure, preserve queue/address-space cleanup, and release earlier waves when workgroup setup fails. A focused regression covers partial-wave cleanup; intentional callback exception injection remains.

Fixture construction overlaps #14611; preserve its checked CU initialization when integrating.

Validated with the RelWithDebInfo wrapper build, 611 passing focused runtime/SDMA and AQL/SoC tests (22 architecture-gated skips), and changed-file pre-commit hooks. Full-suite, corpus, and sanitizer validation were not run.

Issue Tracking

Part of #10239.

Move fallible queue and synthetic-instruction setup out of constructors,
check wave and memory access helpers, and stop dependent test work on
failure. Preserve partial-init cleanup and intentional exception injection.

Signed-off-by: Ian Wood <ianwood@u.northwestern.edu>
@therock-pr-bot

therock-pr-bot Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

✅ All Checks Passed — Ready for Review

Check Status Details
📝 PR Description ✅ Pass —
⛔ Forbidden Files ✅ Pass —
🧪 Unit Test ✅ Pass PR does not contain code files — Unit Test auto-passed
🔎 pre-commit ✅ Pass —
🚫 Draft PR 🔜 To Be Enabled —
🚩 Feature Flag 🔜 To Be Enabled —
📊 Code Coverage 🔜 To Be Enabled —
🤖 therock-pr-bot ✅ Pass —

🎉 All checks passed! This PR is ready for review.

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

🙋 Wish to Override Policy?

@therock-pr-bot

therock-pr-bot Bot commented Nov 3, 2026

Copy link
Copy Markdown

🎉 All checks passed! This PR is ready for review.

Keep fatal-failure guards at consuming test calls. Tail calls to queue
registration need no additional wrapper because no dependent work follows.

Signed-off-by: Ian Wood <ianwood@u.northwestern.edu>
@IanWood1
IanWood1 marked this pull request as ready for review November 4, 2026 04:58
@IanWood1
IanWood1 requested review from a team and atgutier as code owners November 4, 2026 04:58
Copilot AI balanced review requested due to automatic review settings November 4, 2026 04:58

Copilot AI 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.

🟢 Approval recommended

No active review issues remain for the changes replacing setup exceptions with explicit failure checks.

No open issues 🎉

What changed in this PR

This PR reduces exception use in rocjitsu’s runtime and SDMA test fixtures, supporting #10239 by replacing setup exceptions with explicit failure checks.

Changes:

  • Move fallible queue and synthetic-instruction setup out of constructors into checked initialization methods.
  • Check wave allocation and memory-access results before use, stopping dependent test work on failure.
  • Preserve queue and address-space cleanup, and add a regression test for partial-workgroup wave cleanup.
File Description
emulation/​rocjitsu/​tests/​sdma_queue_scheduler_test.cpp Move address-space registration into checked SetUp().
emulation/​rocjitsu/​tests/​perfsim_plugin_test.cpp Check synthetic-instruction initialization and wave allocation.
emulation/​rocjitsu/​tests/​memory_wait_scoreboard_test.cpp Replace instruction setup exceptions with checked initialization.
emulation/​rocjitsu/​tests/​ds_gws_test.cpp Return workgroup setup failures and test partial-wave cleanup.
emulation/​rocjitsu/​tests/​cpu_dispatch_pool_test.cpp Return and check plugin installation failure without throwing.
emulation/​rocjitsu/​tests/​cdna5_sdma_test.cpp Add checked queue initialization and memory access while preserving cleanup.

Review effort: Balanced

@kuhar kuhar left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should stop the test when wave allocation fails in DispatchPoolFixture (emulation/rocjitsu/tests/cpu_dispatch_pool_test.cpp:85). The constructor's EXPECT_NE records the failure and still appends the null pointer. Forcing that allocation to fail in ZeroThreadsFallsBackToCallingThread produced the assertion and then a segfault at line 404. Moving allocation into a checked initializer would let each caller stop before it uses the fixture, alongside the CU check from #14611.

Nit: Could we group "util/result.h" with the other quoted project headers in emulation/rocjitsu/tests/ds_gws_test.cpp:40 and emulation/rocjitsu/tests/cdna5_sdma_test.cpp:11 wherever it is still needed? Both files already have a project include block, and this would keep the GWS test's three util dependencies together.

Stop fixture consumers after failed CU or wave setup. Preserve reserved
wave rollback, scope stderr capture, and check SDMA snapshot and access
preconditions without duplicating synthetic-instruction initialization.

Signed-off-by: Ian Wood <ianwood@u.northwestern.edu>

@kuhar kuhar left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@IanWood1
IanWood1 merged commit 5cc3d04 into develop Nov 5, 2026
68 checks passed
@IanWood1
IanWood1 deleted the users/IanWood1/rocjitsu-device-fixture-errors branch November 5, 2026 20:32
@github-actions

github-actions Bot commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

rocjitsu post-commit fuzz passed

The 32-worker multiplexer campaigns for commit 5cc3d046c55d completed without recording a crash or hang.

  • ASan+UBSan (6-minute): 601,254 input executions (1,706.05 inputs/s)
  • TSan (6-minute): 511,371 input executions (1,464.66 inputs/s)

View the workflow run.

@systems-assistant

Copy link
Copy Markdown
Contributor

TheRock Submodule Bump Activity

Newest first

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.

3 participants