[PR #1272] shader: omit native subgroup votes for dead scalar conditions #1304

Open
opened 2026-11-26 20:20:47 +01:00 by 4ld0 · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ubiquitarianism/leonida/pull/1272
Author: @Kadamitas
Created: 11/24/2026
Status: 🔄 Open

Base: main ← Head: perf/native-dead-scc-votes


📝 Commits (1)

  • e7e359f shader: skip native subgroup votes for dead SCC writes

📊 Changes

6 files changed (+33 additions, -9 deletions)

View changed files

📝 docs/design.md (+1 -0)
📝 tests/semantic/test_salu_b32_lane_masks.py (+22 -0)
📝 tests/semantic/test_wave64_emulate_opt.py (+3 -4)
📝 tests/semantic/test_wrexec_b32.py (+1 -0)
📝 tests/test_translate.py (+1 -1)
📝 tools/rdna2spirv.py (+5 -4)

📄 Description

Claimed in the coordination issue as: dead scalar condition votes

What and why

Use the existing scalar condition liveness analysis for native wave32 and wave64. When the shader overwrites the condition before another instruction reads it, omit the vote that would compute that condition. Preserve the mask result and keep the vote at control-flow joins where it remains live.

Tested

  • A hand-written control reduced one subgroup vote to zero. Lane outputs matched before and after. Both votes remained in a separate live branch-join control.
  • 675 translator tests passed before the latest-main rebase. On the final branch, 135 focused semantic and SPIR-V checks passed with one platform skip.
  • The WREXEC positive control explicitly consumes SCC so that it continues to verify vote emission when the value is live.
  • The broader run on the earlier base covered 6,169 tests in 470 files. WREXEC was the only failing file. Its two vote-emission assertions used a dead result. The updated WREXEC case passed on the final branch.
  • The design contract records the rule. Verification uses synthetic inputs and SPIR-V validation.

GPUs tested: n/a (translator and semantic tests)

AI-assisted: yes

  • One topic with synthetic inputs and no game data.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ubiquitarianism/leonida/pull/1272 **Author:** [@Kadamitas](https://github.com/Kadamitas) **Created:** 11/24/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `perf/native-dead-scc-votes` --- ### 📝 Commits (1) - [`e7e359f`](https://github.com/ubiquitarianism/leonida/commit/e7e359fa0302ac24f2787b36906530ecf89dc2b5) shader: skip native subgroup votes for dead SCC writes ### 📊 Changes **6 files changed** (+33 additions, -9 deletions) <details> <summary>View changed files</summary> 📝 `docs/design.md` (+1 -0) 📝 `tests/semantic/test_salu_b32_lane_masks.py` (+22 -0) 📝 `tests/semantic/test_wave64_emulate_opt.py` (+3 -4) 📝 `tests/semantic/test_wrexec_b32.py` (+1 -0) 📝 `tests/test_translate.py` (+1 -1) 📝 `tools/rdna2spirv.py` (+5 -4) </details> ### 📄 Description Claimed in the coordination issue as: [dead scalar condition votes](https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7144523872) ### What and why Use the existing scalar condition liveness analysis for native wave32 and wave64. When the shader overwrites the condition before another instruction reads it, omit the vote that would compute that condition. Preserve the mask result and keep the vote at control-flow joins where it remains live. ### Tested - A hand-written control reduced one subgroup vote to zero. Lane outputs matched before and after. Both votes remained in a separate live branch-join control. - 675 translator tests passed before the latest-main rebase. On the final branch, 135 focused semantic and SPIR-V checks passed with one platform skip. - The WREXEC positive control explicitly consumes SCC so that it continues to verify vote emission when the value is live. - The broader run on the earlier base covered 6,169 tests in 470 files. WREXEC was the only failing file. Its two vote-emission assertions used a dead result. The updated WREXEC case passed on the final branch. - The design contract records the rule. Verification uses synthetic inputs and SPIR-V validation. GPUs tested: n/a (translator and semantic tests) AI-assisted: yes - [x] One topic with synthetic inputs and no game data. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
starred/leonida#1304
No description provided.