tests: run the saveexec mask cases in a populated subgroup #876

Manually merged
github merged 1 commit from gh-pr/876/head into gh-pr/876/base 2026-11-26 09:35:47 +00:00
Owner

@⁠theantipopau on GitHub · 2026-09-27 22:06 UTC · original
theantipopau:wave-subgroup → main · +28 −15 · 1 files · 1 commits · merged 2026-09-28 21:42 UTC

Summary

ScalarOrn2SaveexecUsesSourceOrNotExec and ScalarSaveExecOps both read a full
64-bit EXEC mask, but neither can pass as dispatched.

ShaderComputeInputInfo::threads_num defaults to {0, 0, 0}, and the emitter
turns that into ExecutionModeLocalSize 1 1 1:

uint32_t local_x = state.requirements.compute_derivatives ? 2u : 1u;
...
local_x = cs->threads_num[0] != 0u ? cs->threads_num[0] : local_x;

Combined with the default dispatch_x = dispatch_y = dispatch_z = 1, the host
runs one invocation. The recompiler emulates EXEC with
OpGroupNonUniformBallot at ScopeSubgroup, and a ballot only reports
active invocations, so with a single invocation every result collapses to
lane 0:

expected [0x0000000c, 0x80000000, 0xfffffff3, 0x7fffffff, 0x00000001]
actual   [0x00000000, 0x00000000, 0x00000001, 0x00000000, 0x00000001]

ScalarOrn2SaveexecUsesSourceOrNotExec needs no change to its expectations —
it writes EXEC explicitly (SGPR 126/127 are EXEC_LO/EXEC_HI) and asserts the
resulting full mask. It simply needs a populated subgroup.

ScalarSaveExecOps is not self-consistent as written. Its first four dwords
(1, 0, 1, 0) are the entry EXEC of a single-invocation dispatch, while the
nine dwords after them only hold for a 64-lane wave. It cannot have been
recorded in one run.

After

Both cases dispatch 64x1x1 and pass:

[compute] ScalarSaveExecOps                ok
[compute] ScalarOrn2SaveexecUsesSourceOrNotExec ok
[compute] ScalarOrn2SaveexecB32Wave32      ok
[compute] ScalarOrn2SaveexecB32Wave64      ok

ScalarSaveExecOps is dispatched at a full wave, so the two saved EXEC pairs
become the 0xffffffff/0xffffffff a full wave actually enters with. Verified
against a full-suite run: 418 cases pass, 6 fail — the 6 are unchanged from
before this patch, and the two saveexec cases drop out of the failure set.

Scope

This is deliberately limited to the two cases. A global default of 64 was tried
and is wrong: it takes the suite from 6 failures to 50, because most cases
assume a single invocation for their stores and LDS layout. The 1x1x1 default
is load-bearing; these two cases are the exceptions.

Note on verification

shader_recompiler_compute_tests aborts during VulkanHarness construction on
a GPU without the full production rasterization feature set, so the suite could
not be run to reach these cases at all. That is fixed separately in #875. The
before/after numbers above were produced with that change applied locally.

**@⁠theantipopau** on GitHub · 2026-09-27 22:06 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/876) `theantipopau:wave-subgroup` → `main` · +28 −15 · 1 files · 1 commits · merged 2026-09-28 21:42 UTC ## Summary `ScalarOrn2SaveexecUsesSourceOrNotExec` and `ScalarSaveExecOps` both read a full 64-bit EXEC mask, but neither can pass as dispatched. `ShaderComputeInputInfo::threads_num` defaults to `{0, 0, 0}`, and the emitter turns that into `ExecutionModeLocalSize 1 1 1`: ```cpp uint32_t local_x = state.requirements.compute_derivatives ? 2u : 1u; ... local_x = cs->threads_num[0] != 0u ? cs->threads_num[0] : local_x; ``` Combined with the default `dispatch_x = dispatch_y = dispatch_z = 1`, the host runs **one invocation**. The recompiler emulates EXEC with `OpGroupNonUniformBallot` at `ScopeSubgroup`, and a ballot only reports *active* invocations, so with a single invocation every result collapses to lane 0: ``` expected [0x0000000c, 0x80000000, 0xfffffff3, 0x7fffffff, 0x00000001] actual [0x00000000, 0x00000000, 0x00000001, 0x00000000, 0x00000001] ``` `ScalarOrn2SaveexecUsesSourceOrNotExec` needs no change to its expectations — it writes EXEC explicitly (SGPR 126/127 are `EXEC_LO`/`EXEC_HI`) and asserts the resulting full mask. It simply needs a populated subgroup. `ScalarSaveExecOps` is not self-consistent as written. Its first four dwords (`1, 0, 1, 0`) are the entry EXEC of a *single-invocation* dispatch, while the nine dwords after them only hold for a *64-lane* wave. It cannot have been recorded in one run. ## After Both cases dispatch `64x1x1` and pass: ``` [compute] ScalarSaveExecOps ok [compute] ScalarOrn2SaveexecUsesSourceOrNotExec ok [compute] ScalarOrn2SaveexecB32Wave32 ok [compute] ScalarOrn2SaveexecB32Wave64 ok ``` `ScalarSaveExecOps` is dispatched at a full wave, so the two saved EXEC pairs become the `0xffffffff/0xffffffff` a full wave actually enters with. Verified against a full-suite run: 418 cases pass, 6 fail — the 6 are unchanged from before this patch, and the two saveexec cases drop out of the failure set. ## Scope This is deliberately limited to the two cases. A global default of 64 was tried and is wrong: it takes the suite from 6 failures to 50, because most cases assume a single invocation for their stores and LDS layout. The 1x1x1 default is load-bearing; these two cases are the exceptions. ## Note on verification `shader_recompiler_compute_tests` aborts during `VulkanHarness` construction on a GPU without the full production rasterization feature set, so the suite could not be run to reach these cases at all. That is fixed separately in #875. The before/after numbers above were produced with that change applied locally.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 09:35:46 +00:00
github manually merged commit e9a623a88a into gh-pr/876/base 2026-11-26 09:35:47 +00:00
Author
Owner

@⁠coderabbitai[bot] on GitHub · 2026-09-27 22:09 UTC · original · edited 2026-09-28 20:34 UTC

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

Important

Review skipped

Review was skipped as selected files did not have any reviewable changes.

⚙️ Run configuration

Configuration used: Repository: KytyPS5/KytyPS5/.coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: ae932d74-b0e5-4644-ae15-1941bf369811

📥 Commits

Reviewing files that changed from the base of the PR and between 6e11612fadebacce585f7fcffc8a7c815124dc90 and e9a623a88a.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository: KytyPS5/KytyPS5/.coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: 4cf66d22-b565-4cb4-89a8-0a2402681dc0

📥 Commits

Reviewing files that changed from the base of the PR and between 9ec7ffb0de445704f83b271fe4acac3991ccd89e and 6e11612fadebacce585f7fcffc8a7c815124dc90.

📒 Files selected for processing (1)
  • tests/ShaderRecompilerComputeTests.cpp

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 6 remain after this review.


📝 Walkthrough

Walkthrough

The two scalar execution-mask tests now assign their TestCase fields individually and use 64-thread dispatches with compute info enabled. ScalarSaveExecOps now expects both saved EXEC pairs to be all ones. The opcodes and the expected values in ScalarOrn2SaveexecUsesSourceOrNotExec remain unchanged.

Suggested reviewers: nmzik

Priority: ⬇️ Low

Change: Other

Merge Risk: ⚪ Minimal · up to 6e116

The updated tests configure a full-wave dispatch, and no merge-blocking issue is established.

Architecture Summary

Architecture risk: 🔵 Low · up to 6e116

The change affects 1 system.

Changed systems: tests

Architecture concerns
No architecture-level concerns identified.

Review details

Systems and components

  • observed — tests (service) was modified; 1 changed file maps to changed impact.

Before / after behavior

  • observed — Modified behavior in tests/ShaderRecompilerComputeTests.cpp: ScalarSaveExecOps now constructs and returns a TestCase through field assignments, replacing the aggregate return. Its expected saved EXEC pairs change from 1, 0 to 0xffffffff, 0xffffffff; it also sets the compute thread count to 64 and enables compute info.
  • observed — Modified behavior in tests/ShaderRecompilerComputeTests.cpp: ScalarOrn2SaveexecUsesSourceOrNotExec now constructs and returns a TestCase through field assignments, replacing the aggregate return. Its expected values and opcodes are retained, and compute info is enabled with a thread count of 64.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description check ✅ Passed The description clearly explains why the two tests require a 64x1x1 dispatch, documents the expected mask changes, and states the verification results and scope.
Title check ✅ Passed The title clearly identifies the two test cases' main change: running the saveexec mask cases in a populated subgroup.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

**@⁠coderabbitai[bot]** on GitHub · 2026-09-27 22:09 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/876#issuecomment-5860285323) · edited 2026-09-28 20:34 UTC <!-- This is an auto-generated comment: summarize by coderabbit.ai --> <!-- review_stack_entry_start --> <a href="https://app.coderabbit.ai/change-stack/KytyPS5/KytyPS5/pull/876?cs_source=review_comment"><img src="https://storage.googleapis.com/coderabbit_public_assets/review-stack-in-coderabbit-ui-dark.svg?v=2" alt="Review in Change Stack →" width="220" height="32"></a> Navigate logical layers of code changes, visualize relationships, and explore their blast radius. <!-- review_stack_entry_end --> <!-- This is an auto-generated comment: skip review by coderabbit.ai --> > [!IMPORTANT] > ## Review skipped > > Review was skipped as selected files did not have any reviewable changes. > > > > > > <details> > <summary>⚙️ Run configuration</summary> > > **Configuration used**: Repository: KytyPS5/KytyPS5/.coderabbit.yaml > > **Review profile**: CHILL > > **Plan**: Advanced > > **Run ID**: `ae932d74-b0e5-4644-ae15-1941bf369811` > > </details> > > <details> > <summary>📥 Commits</summary> > > Reviewing files that changed from the base of the PR and between 6e11612fadebacce585f7fcffc8a7c815124dc90 and e9a623a88ae07d7ade000563cf850548fa95d377. > > </details> > > You can disable this status message by setting the `reviews.review_status` to `false` in the CodeRabbit configuration file. > > Use the checkbox below for a quick retry: > - [ ] <!-- {"checkboxId":"e9bb8d72-00e8-4f67-9cb2-caf3b22574fe"} --> 🔍 Trigger review <!-- end of auto-generated comment: skip review by coderabbit.ai --> <!-- recent_review_start --> No actionable comments were generated in the recent review. 🎉 <details> <summary>ℹ️ Recent review info</summary> <details> <summary>⚙️ Run configuration</summary> **Configuration used**: Repository: KytyPS5/KytyPS5/.coderabbit.yaml **Review profile**: CHILL **Plan**: Advanced **Run ID**: `4cf66d22-b565-4cb4-89a8-0a2402681dc0` </details> <details> <summary>📥 Commits</summary> Reviewing files that changed from the base of the PR and between 9ec7ffb0de445704f83b271fe4acac3991ccd89e and 6e11612fadebacce585f7fcffc8a7c815124dc90. </details> <details> <summary>📒 Files selected for processing (1)</summary> * `tests/ShaderRecompilerComputeTests.cpp` </details> **Included review availability:** This review used your included allowance. Your plan provides up to 8 included reviews per hour; 6 remain after this review. </details> --- <!-- recent_review_end --> <!-- walkthrough_start --> <details> <summary>📝 Walkthrough</summary> ## Walkthrough The two scalar execution-mask tests now assign their `TestCase` fields individually and use 64-thread dispatches with compute info enabled. `ScalarSaveExecOps` now expects both saved EXEC pairs to be all ones. The opcodes and the expected values in `ScalarOrn2SaveexecUsesSourceOrNotExec` remain unchanged. **Suggested reviewers:** `nmzik` </details> <!-- walkthrough_end --> <!-- change_assessment_start --> **Priority:** ⬇️ Low <!-- change_assessment_commit:"6e11612fadebacce585f7fcffc8a7c815124dc90" --> **Change:** Other <!-- change_assessment_end --> <!-- final_review_risk_start --> **Merge Risk:** _⚪ Minimal_ · up to `6e116` <!-- final_review_risk_coverage:{"sourceCommitId":"6e11612fadebacce585f7fcffc8a7c815124dc90","coveredCommitId":"6e11612fadebacce585f7fcffc8a7c815124dc90","kind":"reviewed"} --> The updated tests configure a full-wave dispatch, and no merge-blocking issue is established. <!-- final_review_risk_end --> <!-- architecture_review_start --> ### Architecture Summary **Architecture risk:** _🔵 Low_ · up to `6e116` The change affects 1 system. **Changed systems:** `tests` **Architecture concerns** No architecture-level concerns identified. <details> <summary>Review details</summary> **Systems and components** - _observed_ — tests (service) was modified; 1 changed file maps to changed impact. **Before / after behavior** - _observed_ — Modified behavior in tests/ShaderRecompilerComputeTests.cpp: `ScalarSaveExecOps` now constructs and returns a `TestCase` through field assignments, replacing the aggregate return. Its expected saved EXEC pairs change from `1, 0` to `0xffffffff, 0xffffffff`; it also sets the compute thread count to 64 and enables compute info. - _observed_ — Modified behavior in tests/ShaderRecompilerComputeTests.cpp: `ScalarOrn2SaveexecUsesSourceOrNotExec` now constructs and returns a `TestCase` through field assignments, replacing the aggregate return. Its expected values and opcodes are retained, and compute info is enabled with a thread count of 64. </details> <!-- architecture_review_end --> <!-- pre_merge_checks_walkthrough_start --> <details> <summary>🚥 Pre-merge checks | ✅ 5</summary> <details> <summary>✅ Passed checks (5 passed)</summary> | Check name | Status | Explanation | | :------------------------: | :------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | Description check | ✅ Passed | The description clearly explains why the two tests require a 64x1x1 dispatch, documents the expected mask changes, and states the verification results and scope. | | Title check | ✅ Passed | The title clearly identifies the two test cases' main change: running the saveexec mask cases in a populated subgroup. | | Docstring Coverage | ✅ Passed | No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0… | | Linked Issues check | ✅ Passed | Check skipped because no linked issues were found for this pull request. | | Out of Scope Changes check | ✅ Passed | Check skipped because no linked issues were found for this pull request. | </details> </details> <!-- pre_merge_checks_walkthrough_end --> <!-- tips_start --> --- Thanks for using [CodeRabbit](https://coderabbit.ai?utm_source=oss&utm_medium=github&utm_campaign=KytyPS5/KytyPS5&utm_content=876)! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. <details> <summary>❤️ Share</summary> - [X](https://twitter.com/intent/tweet?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A&url=https%3A//coderabbit.ai) - [Mastodon](https://mastodon.social/share?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A%20https%3A%2F%2Fcoderabbit.ai) - [Reddit](https://www.reddit.com/submit?title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&text=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code.%20Check%20it%20out%3A%20https%3A//coderabbit.ai) - [LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fcoderabbit.ai&mini=true&title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&summary=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code) </details> <sub>Comment `@coderabbitai help` to get the list of available commands.</sub> <!-- tips_end -->
This discussion has been locked. Commenting is limited to contributors.
No description provided.