shader: keep lane reads and writes inside the guest wave #2135

Closed
github-bot wants to merge 2 commits from gh-pr/2135/head into gh-pr/2135/base
Owner

@⁠theantipopau on GitHub · 2026-11-06 07:33 UTC · original
theantipopau:fix/wave32-lane-transfers → main · +94 −24 · 6 files · 2 commits · closed without merging

A 32-lane guest wave runs in one half of a 64-lane host subgroup on AMD. Lane transfers used the
native subgroup lane, so the wave in the upper half read and wrote the lower wave's registers:

  • V_READLANE_B32, V_READFIRSTLANE_B32 and the DPP source lane passed the guest lane straight
    to OpGroupNonUniformShuffle, and ballot lookups picked their word from wave_size instead of
    from the caller's half, so the upper wave read the other wave's values.
  • V_WRITELANE_B32 compared its lane against the native lane, which never matches in the upper
    half, so the write was dropped there.
  • EliminateReadLane folded V_READLANE of a written lane to that lane's own value operand.
    Hardware broadcasts the value the selected lane wrote, so this is only equivalent when that
    value is wave-uniform; with a per-lane value every thread read its own register instead of the
    writer's.

Lane numbers are now relative to the guest wave, ballot words are selected by the caller's lanes,
and the fold is guarded by ValidateWaveUniformValue. The scalar capture pattern
(s_mov + v_writelane + v_readlane) still folds, which VectorReadlaneInactiveWrittenLane
continues to cover.

Testing on an RX 9070 XT (RADV, subgroup size 64), shader_recompiler_compute:

  • a new 64-thread wave32 case checks the writelane result in each lane, a readlane of an untouched
    register, and a readlane of the written lane; all three cover both halves of the subgroup
  • 996/996 cases pass and ctest reports 82/82

Existing 32-thread lane cases always landed in the lower half, which is why this stayed green
there. I could not test NVIDIA or Intel hardware.

**@⁠theantipopau** on GitHub · 2026-11-06 07:33 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/2135) `theantipopau:fix/wave32-lane-transfers` → `main` · +94 −24 · 6 files · 2 commits · closed without merging A 32-lane guest wave runs in one half of a 64-lane host subgroup on AMD. Lane transfers used the native subgroup lane, so the wave in the upper half read and wrote the lower wave's registers: * `V_READLANE_B32`, `V_READFIRSTLANE_B32` and the DPP source lane passed the guest lane straight to `OpGroupNonUniformShuffle`, and ballot lookups picked their word from `wave_size` instead of from the caller's half, so the upper wave read the other wave's values. * `V_WRITELANE_B32` compared its lane against the native lane, which never matches in the upper half, so the write was dropped there. * `EliminateReadLane` folded `V_READLANE` of a written lane to that lane's own value operand. Hardware broadcasts the value the selected lane wrote, so this is only equivalent when that value is wave-uniform; with a per-lane value every thread read its own register instead of the writer's. Lane numbers are now relative to the guest wave, ballot words are selected by the caller's lanes, and the fold is guarded by `ValidateWaveUniformValue`. The scalar capture pattern (`s_mov` + `v_writelane` + `v_readlane`) still folds, which `VectorReadlaneInactiveWrittenLane` continues to cover. Testing on an RX 9070 XT (RADV, subgroup size 64), `shader_recompiler_compute`: * a new 64-thread wave32 case checks the writelane result in each lane, a readlane of an untouched register, and a readlane of the written lane; all three cover both halves of the subgroup * 996/996 cases pass and `ctest` reports 82/82 Existing 32-thread lane cases always landed in the lower half, which is why this stayed green there. I could not test NVIDIA or Intel hardware.
V_READLANE, V_READFIRSTLANE and the DPP shuffle addressed native subgroup
lanes, so a 32-lane guest wave in the upper half of a 64-lane subgroup read
the other wave's values, and V_WRITELANE compared its lane against the
native lane, which never matched there. Ballot lookups now select the word
that covers the caller's lanes, and lane numbers are relative to the guest
wave. A 64-thread wave32 case covers both halves; existing cases only used
32 threads, so they always landed in the lower half.

🤖 Generated with Codebuff
Co-Authored-By: Codebuff <[email protected]>
EliminateReadLane replaced V_READLANE of a lane with the value operand of
the V_WRITELANE that produced it. Hardware broadcasts the value the selected
lane wrote, so forwarding every lane's own value is only equivalent when
that value is uniform across the wave; with a per-lane value each thread
read its own register instead of the writer's.

🤖 Generated with Codebuff
Co-Authored-By: Codebuff <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 10:15:42 +00:00
github-bot closed this pull request 2026-11-26 10:15:42 +00:00
Author
Owner

@⁠coderabbitai[bot] on GitHub · 2026-11-06 07:38 UTC · original

Explain Change →

Walkthrough

The SPIR-V backend now maps wave32 lane operations to the caller’s native subgroup half. Shader info collection requests subgroup-local invocation IDs for DppMoveU32, ReadFirstLane, and ReadLane. ReadLane elimination now substitutes matched WriteLane values only when they are wave-uniform. A compute test checks lane writes and reads across two 32-lane waves.

Suggested reviewers: nmzik

Change: Bug fix

Merge Risk: Moderate · up to b77fb

On hosts with a 64-lane subgroup, DPP operations in the upper half of a 32-lane guest wave can return zero instead of the real source value, which gives wrong shader results. Fix the ballot range check before merging.

Pre-merge checks: Passed 4 · Inconclusive 1

Failed Failed checks: 1 inconclusive

Check name Status Explanation Resolution
Docstring Coverage Inconclusive Docstring coverage is 16.67% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documenta… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed

Check name Status Explanation
Title check Passed The title clearly describes the guest-wave lane read and write changes.
Description check Passed The description covers the lane mapping changes, the guarded optimization, and the tests.
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.
Full details: Docstring Coverage

Explanation

Docstring coverage is 16.67% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 6 functions across 5 files. (1 skipped: 1 too large.)

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

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

**@⁠coderabbitai[bot]** on GitHub · 2026-11-06 07:38 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/2135#issuecomment-6679808969) <!-- coderabbit-ai-generated:v1 --> <!-- 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/2135?scope=ghh_OusAJGA4HG8ljoOV0wJvVx8NmnZIjc2DdjmxOu0xZWA&amp;cs_source=review_comment"><picture><source media="(prefers-color-scheme: dark)" srcset="https://storage.googleapis.com/coderabbit_public_assets/review-stack-buttons-v1/explain-change-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://storage.googleapis.com/coderabbit_public_assets/review-stack-buttons-v1/explain-change.svg"><img src="https://storage.googleapis.com/coderabbit_public_assets/review-stack-buttons-v1/explain-change.svg" alt="Explain Change →" height="32"></picture></a> <!-- review_stack_entry_end --> <!-- walkthrough_start --> <details> <summary><strong>Walkthrough</strong></summary> <dl> <dd> <br> The SPIR-V backend now maps wave32 lane operations to the caller’s native subgroup half. Shader info collection requests subgroup-local invocation IDs for `DppMoveU32`, `ReadFirstLane`, and `ReadLane`. ReadLane elimination now substitutes matched `WriteLane` values only when they are wave-uniform. A compute test checks lane writes and reads across two 32-lane waves. **Suggested reviewers:** `nmzik` </dd> </dl> </details> <!-- walkthrough_end --> <!-- change_assessment_start --> <!-- change_assessment_commit:"b77fb9e155a54220443c50714a08742a75881efc" --> <!-- change_assessment_priority:{"version":1,"urgency":"p2","manual":false} --> **Change:** Bug fix <!-- change_assessment_end --> <details> <summary><strong>Merge Risk:</strong> <strong><picture><img src="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/risk-normal-16.svg" width="16" height="16" align="absmiddle" alt=""></picture> Moderate</strong> · up to <code>b77fb</code></summary> <dl> <dd> <br> <!-- final_review_risk_start --> <!-- final_review_risk_label **Merge Risk:** **🟡 Moderate** · up to `b77fb` --> <!-- final_review_risk_coverage:{"sourceCommitId":"b77fb9e155a54220443c50714a08742a75881efc","coveredCommitId":"b77fb9e155a54220443c50714a08742a75881efc","kind":"reviewed"} --> On hosts with a 64-lane subgroup, DPP operations in the upper half of a 32-lane guest wave can return zero instead of the real source value, which gives wrong shader results. Fix the ballot range check before merging. <!-- final_review_risk_end --> </dd> </dl> </details> <!-- pre_merge_checks_walkthrough_start --> <details> <summary><strong>Pre-merge checks: <sup><picture><img src="https://storage.googleapis.com/coderabbit_public_assets/pre-merge-checks-counter-passed-14-v2.svg" width="14" height="14" align="middle" alt="Passed" title="Passed"></picture></sup> 4 · <sup><picture><img src="https://storage.googleapis.com/coderabbit_public_assets/pre-merge-checks-counter-inconclusive-14-v2.svg" width="14" height="14" align="middle" alt="Inconclusive" title="Inconclusive"></picture></sup> 1</strong></summary> <dl> <dd> <br> <strong><sup><picture><img src="https://storage.googleapis.com/coderabbit_public_assets/pre-merge-checks-counter-failed-14-v2.svg" width="14" height="14" align="middle" alt="Failed" title="Failed"></picture></sup> Failed checks: 1 inconclusive</strong> | Check name | Status | Explanation | Resolution | | :---------------- | :--------------------------------------------------------------------------------------------------------: | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :--------------------------------------------------------------------------------- | | Docstring Coverage | ![Inconclusive](https://storage.googleapis.com/coderabbit_public_assets/pre-merge-checks-inconclusive.svg) | Docstring coverage is 16.67% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documenta… | Write docstrings for the functions missing them to satisfy the coverage threshold. | <details> <summary><strong><sup><picture><img src="https://storage.googleapis.com/coderabbit_public_assets/pre-merge-checks-counter-passed-14-v2.svg" width="14" height="14" align="middle" alt="Passed" title="Passed"></picture></sup> Passed checks: 4 passed</strong></summary> <dl> <dd> <br> | Check name | Status | Explanation | | :------------------------ | :--------------------------------------------------------------------------------------------: | :---------------------------------------------------------------------------------------- | | Title check | ![Passed](https://storage.googleapis.com/coderabbit_public_assets/pre-merge-checks-passed.svg) | The title clearly describes the guest-wave lane read and write changes. | | Description check | ![Passed](https://storage.googleapis.com/coderabbit_public_assets/pre-merge-checks-passed.svg) | The description covers the lane mapping changes, the guarded optimization, and the tests. | | Linked Issues check | ![Passed](https://storage.googleapis.com/coderabbit_public_assets/pre-merge-checks-passed.svg) | Check skipped because no linked issues were found for this pull request. | | Out of Scope Changes check | ![Passed](https://storage.googleapis.com/coderabbit_public_assets/pre-merge-checks-passed.svg) | Check skipped because no linked issues were found for this pull request. | </dd> </dl> </details> <details> <summary><strong>Full details: Docstring Coverage</strong></summary> <dl> <dd> <br> **Explanation** Docstring coverage is 16.67% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 6 functions across 5 files. (1 skipped: 1 too large.) **Resolution** Write docstrings for the functions missing them to satisfy the coverage threshold. </dd> </dl> </details> </dd> </dl> </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=2135)! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. <details> <summary><strong>Share</strong></summary> <dl> <dd> <br> - [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) </dd> </dl> </details> <!-- tips_end -->
@ -208,0 +196,4 @@
// emulated half both live in word one.
const auto word = EmitNative<spv::OpVectorExtractDynamic, IR::Type::U32>(
state, active_ballot,
Binary(state, spv::OpShiftRightLogical, TypeU32(state), lane, ConstantU32(state, 5)));
Author
Owner

@⁠coderabbitai[bot] on GitHub · 2026-11-06 07:38 UTC · original

Major · Functional Correctness · Quick win

Supported by static analysis

Script executed:

grep -n 'EmitBallotLaneActiveBool' -r src/graphics/shader/recompiler
sed -n '170,215p' src/graphics/shader/recompiler/backend/spirv/spirvEmitterHelpers.cpp

Repository: KytyPS5/KytyPS5

Length of output: 3037


Script executed:

rg -n -F -e 'EmitBallotLaneActiveBool' -e 'EmitSubgroupLaneActiveBool' -e 'EmitDppMoveU32' -e 'target.lane' -- src/graphics/shader/recompiler
sed -n '185,230p' src/graphics/shader/recompiler/backend/spirv/spirvEmitterHelpers.cpp
rg -n -C 45 -F -e 'EmitDppMoveU32' -e 'EmitBallotLaneActiveBool(state, ballot, target.lane)' -- src/graphics/shader/recompiler/backend/spirv/spirvEmitterFlow.cpp

Repository: KytyPS5/KytyPS5

Length of output: 8568


Script executed:

rg -n -F -e 'EmitDppTargetLane' -e 'EmitSubgroupLaneActiveBool' -e 'EmitGuest' -e 'wave_size' -- src/graphics/shader/recompiler/backend/spirv/spirvEmitterFlow.cpp src/graphics/shader/recompiler/backend/spirv/spirvEmitterMemory.cpp src/graphics/shader/recompiler/backend/spirv/spirvEmitterHelpers.cpp
sed -n '1,205p' src/graphics/shader/recompiler/backend/spirv/spirvEmitterFlow.cpp
sed -n '1,100p' src/graphics/shader/recompiler/backend/spirv/spirvEmitterMemory.cpp
git diff 9912f1af235cfeef804db9610cd7b18742926dc3 b77fb9e155a54220443c50714a08742a75881efc -- src/graphics/shader/recompiler/backend/spirv/spirvEmitterFlow.cpp src/graphics/shader/recompiler/backend/spirv/spirvEmitterHelpers.cpp src/graphics/shader/recompiler/backend/spirv/spirvEmitterMemory.cpp

Repository: KytyPS5/KytyPS5

Length of output: 20209


Script executed:

sed -n '1,150p' src/graphics/shader/recompiler/backend/spirv/spirvEmitterHelpers.cpp
rg -n -F -e 'ValueEmitContext::Shuffle' -e 'Shuffle(const IR::Inst' -e 'EmitDsMaskedLaneRead(' -e 'EmitSubgroupLocalInvocationId(' -- src/graphics/shader/recompiler/backend/spirv

Repository: KytyPS5/KytyPS5

Length of output: 9852


Script executed:

sed -n '475,555p' src/graphics/shader/recompiler/backend/spirv/spirvEmitterProgram.cpp
sed -n '1650,1775p' src/graphics/shader/recompiler/backend/spirv/spirvEmitterMemory.cpp
rg -n -F -e 'EmitDsSwizzleTargetLane' -e 'ValueEmitContext::Ballot' -e 'lane_half' -- src/graphics/shader/recompiler/backend/spirv/spirvEmitterMemory.cpp src/graphics/shader/recompiler/backend/spirv/spirvEmitterProgram.cpp

Repository: KytyPS5/KytyPS5

Length of output: 11214


Script executed:

rg -n -F -e 'EmitDsSwizzleTargetLane' -- src/graphics/shader/recompiler/backend/spirv
rg -n -C 35 -F 'EmitDsSwizzleTargetLane(' -- src/graphics/shader/recompiler/backend/spirv/spirvEmitterHelpers.cpp src/graphics/shader/recompiler/backend/spirv/spirvEmitterMemory.cpp

Repository: KytyPS5/KytyPS5

Length of output: 9454


Script executed:

sed -n '725,800p' src/graphics/shader/recompiler/backend/spirv/spirvEmitterMemoryHelpers.cpp

Repository: KytyPS5/KytyPS5

Length of output: 4448


Check the guest-relative lane in the range test.

For a wave32 in native lanes 32–63, EmitDppMoveU32 passes a physical source lane to the ballot check. The range test rejects that lane, so DPP can return zero for an active source when fetch_inactive is false.

Keep the physical lane for ballot-word selection. Use lane_low for the wave32 range check and retain lane for wave64.

Suggested fix

-	state.builder.AddFunction(spv::OpULessThan, TypeBool(state), in_range, lane,
+	state.builder.AddFunction(spv::OpULessThan, TypeBool(state), in_range,
+	                          state.program.wave_size == 32u ? lane_low : lane,
 	                          ConstantU32(state, state.program.wave_size));
**@⁠coderabbitai[bot]** on GitHub · 2026-11-06 07:38 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/2135#discussion_r4490116882) <!-- coderabbit-ai-generated:v1 --> **<picture><img src="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/major-16.svg" width="16" height="16" align="absmiddle" alt=""></picture> Major** · **Functional Correctness** · **Quick win** <details> <summary><picture><source media="(prefers-color-scheme: dark)" srcset="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/review-details-dark.svg"><img src="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/review-details.svg" width="16" height="16" align="absmiddle" alt=""></picture> Supported by static analysis</summary> <dl> <dd> <br> Script executed: ```bash grep -n 'EmitBallotLaneActiveBool' -r src/graphics/shader/recompiler sed -n '170,215p' src/graphics/shader/recompiler/backend/spirv/spirvEmitterHelpers.cpp ``` Repository: KytyPS5/KytyPS5 Length of output: 3037 --- Script executed: ```bash rg -n -F -e 'EmitBallotLaneActiveBool' -e 'EmitSubgroupLaneActiveBool' -e 'EmitDppMoveU32' -e 'target.lane' -- src/graphics/shader/recompiler sed -n '185,230p' src/graphics/shader/recompiler/backend/spirv/spirvEmitterHelpers.cpp rg -n -C 45 -F -e 'EmitDppMoveU32' -e 'EmitBallotLaneActiveBool(state, ballot, target.lane)' -- src/graphics/shader/recompiler/backend/spirv/spirvEmitterFlow.cpp ``` Repository: KytyPS5/KytyPS5 Length of output: 8568 --- Script executed: ```bash rg -n -F -e 'EmitDppTargetLane' -e 'EmitSubgroupLaneActiveBool' -e 'EmitGuest' -e 'wave_size' -- src/graphics/shader/recompiler/backend/spirv/spirvEmitterFlow.cpp src/graphics/shader/recompiler/backend/spirv/spirvEmitterMemory.cpp src/graphics/shader/recompiler/backend/spirv/spirvEmitterHelpers.cpp sed -n '1,205p' src/graphics/shader/recompiler/backend/spirv/spirvEmitterFlow.cpp sed -n '1,100p' src/graphics/shader/recompiler/backend/spirv/spirvEmitterMemory.cpp git diff 9912f1af235cfeef804db9610cd7b18742926dc3 b77fb9e155a54220443c50714a08742a75881efc -- src/graphics/shader/recompiler/backend/spirv/spirvEmitterFlow.cpp src/graphics/shader/recompiler/backend/spirv/spirvEmitterHelpers.cpp src/graphics/shader/recompiler/backend/spirv/spirvEmitterMemory.cpp ``` Repository: KytyPS5/KytyPS5 Length of output: 20209 --- Script executed: ```bash sed -n '1,150p' src/graphics/shader/recompiler/backend/spirv/spirvEmitterHelpers.cpp rg -n -F -e 'ValueEmitContext::Shuffle' -e 'Shuffle(const IR::Inst' -e 'EmitDsMaskedLaneRead(' -e 'EmitSubgroupLocalInvocationId(' -- src/graphics/shader/recompiler/backend/spirv ``` Repository: KytyPS5/KytyPS5 Length of output: 9852 --- Script executed: ```bash sed -n '475,555p' src/graphics/shader/recompiler/backend/spirv/spirvEmitterProgram.cpp sed -n '1650,1775p' src/graphics/shader/recompiler/backend/spirv/spirvEmitterMemory.cpp rg -n -F -e 'EmitDsSwizzleTargetLane' -e 'ValueEmitContext::Ballot' -e 'lane_half' -- src/graphics/shader/recompiler/backend/spirv/spirvEmitterMemory.cpp src/graphics/shader/recompiler/backend/spirv/spirvEmitterProgram.cpp ``` Repository: KytyPS5/KytyPS5 Length of output: 11214 --- Script executed: ```bash rg -n -F -e 'EmitDsSwizzleTargetLane' -- src/graphics/shader/recompiler/backend/spirv rg -n -C 35 -F 'EmitDsSwizzleTargetLane(' -- src/graphics/shader/recompiler/backend/spirv/spirvEmitterHelpers.cpp src/graphics/shader/recompiler/backend/spirv/spirvEmitterMemory.cpp ``` Repository: KytyPS5/KytyPS5 Length of output: 9454 --- Script executed: ```bash sed -n '725,800p' src/graphics/shader/recompiler/backend/spirv/spirvEmitterMemoryHelpers.cpp ``` Repository: KytyPS5/KytyPS5 Length of output: 4448 --- </dd> </dl> </details> **Check the guest-relative lane in the range test.** For a wave32 in native lanes 32–63, `EmitDppMoveU32` passes a physical source lane to the ballot check. The range test rejects that lane, so DPP can return zero for an active source when `fetch_inactive` is false. Keep the physical lane for ballot-word selection. Use `lane_low` for the wave32 range check and retain `lane` for wave64. <details> <summary>Suggested fix</summary> <dl> <dd> <br> ```diff - state.builder.AddFunction(spv::OpULessThan, TypeBool(state), in_range, lane, + state.builder.AddFunction(spv::OpULessThan, TypeBool(state), in_range, + state.program.wave_size == 32u ? lane_low : lane, ConstantU32(state, state.program.wave_size)); ``` </dd> </dl> </details> <!-- fingerprinting:phantom:medusa:beignet55 --> <!-- cr-indicator-types:potential_issue --> <!-- cr-comment:v1:ad01d5a2f43c6012cac14137 --> <!-- This is an auto-generated comment by CodeRabbit -->
Author
Owner

@⁠coderabbitai[bot] on GitHub · 2026-11-06 07:38 UTC · original · reviewed

Actionable comments posted: 1

Review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between b6cc1fff27 and b77fb9e155.

Files selected for processing: 6

  • src/graphics/shader/recompiler/backend/spirv/spirvEmitterFlow.cpp
  • src/graphics/shader/recompiler/backend/spirv/spirvEmitterHelpers.cpp
  • src/graphics/shader/recompiler/backend/spirv/spirvEmitterProgram.cpp
  • src/graphics/shader/recompiler/ir/passes/ReadLaneElimination.cpp
  • src/graphics/shader/recompiler/ir/passes/ShaderInfoCollection.cpp
  • tests/ShaderRecompilerComputeTests.cpp

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

**@⁠coderabbitai[bot]** on GitHub · 2026-11-06 07:38 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/2135#pullrequestreview-5797132768) · **reviewed** <!-- coderabbit-ai-generated:v1 --> **Actionable comments posted: 1** <h6> <details> <summary><picture><img src="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/info.svg" width="12" height="12" align="absmiddle" alt=""></picture> Review info</summary> <dl> <dd> <br> <details> <summary><picture><source media="(prefers-color-scheme: dark)" srcset="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/cog-dark.svg"><img src="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/cog.svg" width="16" height="16" align="absmiddle" alt=""></picture> Run configuration</summary> <dl> <dd> <br> - **Source mode**: Auto - **Repository**: [KytyPS5/KytyPS5](<https://github.com/KytyPS5/KytyPS5>) - **Branch**: [main](<https://github.com/KytyPS5/KytyPS5/tree/main>) - **File**: [.coderabbit.yaml](<https://github.com/KytyPS5/KytyPS5/blob/b6cc1fff27c8ee68c14f6eb99d719922335e1358/.coderabbit.yaml>) - **Commit**: [b6cc1ff](<https://github.com/KytyPS5/KytyPS5/commit/b6cc1fff27c8ee68c14f6eb99d719922335e1358>) - **Layers**: Repository YAML - **Review profile**: CHILL - **Plan**: Advanced - **Run ID**: `db09292b-8c02-422b-9390-1ef1dcb6b59d` </dd> </dl> </details> <details> <summary><picture><source media="(prefers-color-scheme: dark)" srcset="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/git-commit-horizontal-dark.svg"><img src="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/git-commit-horizontal.svg" width="16" height="16" align="absmiddle" alt=""></picture> Commits</summary> <dl> <dd> <br> Reviewing files that changed from the base of the PR and between b6cc1fff27c8ee68c14f6eb99d719922335e1358 and b77fb9e155a54220443c50714a08742a75881efc. </dd> </dl> </details> <details> <summary><picture><source media="(prefers-color-scheme: dark)" srcset="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/file-plus-corner-dark.svg"><img src="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/file-plus-corner.svg" width="16" height="16" align="absmiddle" alt=""></picture> Files selected for processing: 6</summary> <dl> <dd> <br> * `src/graphics/shader/recompiler/backend/spirv/spirvEmitterFlow.cpp` * `src/graphics/shader/recompiler/backend/spirv/spirvEmitterHelpers.cpp` * `src/graphics/shader/recompiler/backend/spirv/spirvEmitterProgram.cpp` * `src/graphics/shader/recompiler/ir/passes/ReadLaneElimination.cpp` * `src/graphics/shader/recompiler/ir/passes/ShaderInfoCollection.cpp` * `tests/ShaderRecompilerComputeTests.cpp` </dd> </dl> </details> **Included review availability:** This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review. </dd> </dl> </details> </h6> <!-- This is an auto-generated comment by CodeRabbit for review status --> <!-- coderabbit-review-publication v1 publication=bb321789-4274-4f04-ab2d-c3d61361fae2 attempt=58017dd6-d585-42d7-920d-e7cb5d4afeb4 batch=1/1 -->

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No description provided.