[PR #661] [MERGED] tests/semantic: SALU instructions leave SCC exactly 0 or 1, read back through src_scc (OLD-9634) #700

Closed
opened 2026-11-26 20:18:46 +01:00 by 4ld0 · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ubiquitarianism/leonida/pull/661
Author: @qhukz13
Created: 11/24/2026
Status: ✅ Merged
Merged: 11/24/2026
Merged by: @ubiquitarianism

Base: main ← Head: cont/salu-scc-value


📝 Commits (1)

  • 65e13e0 tests/semantic: SALU instructions leave SCC exactly 0 or 1, read back through src_scc

📊 Changes

1 file changed (+116 additions, -0 deletions)

View changed files

➕ tests/semantic/test_salu_scc_value.py (+116 -0)

📄 Description

Claimed in the coordination issue as: OLD-9634 (restoration of ItsNotRexed/Leonida#9634, closed unmerged when that repository went private)

SCC checks in the suite mostly go through s_cselect_b32 / s_cbranch_scc*, which only see zero vs non-zero, while s_addc_u32, s_subb_u32 and src_scc read SCC as a number. test_salu_scc_value.py runs 63 hand-written cases over 48 SOP1/SOP2/SOPC instructions (each with an SCC = 1 case), copies SCC with v_mov_b32 v0, src_scc and checks the exported word.

Why it is needed: with the nine inline OpSelect ... 1 0 -> OpStore %scc writes in rdna2spirv.py mutated to store 2, the existing suite passes and this file fails 10 instructions; with all 12 such writes mutated it fails 22 (measured on the original upstream base).

Test only, no translator change. Tested: python -m unittest discover -s tests/semantic -p test_salu_scc_value.py (OK) on main 21625bca8, Linux, CPU interpreter; no GPU needed. No game files.

AI-assisted (Claude Code).

🤖 Generated with Claude Code


🔄 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/661 **Author:** [@qhukz13](https://github.com/qhukz13) **Created:** 11/24/2026 **Status:** ✅ Merged **Merged:** 11/24/2026 **Merged by:** [@ubiquitarianism](https://github.com/ubiquitarianism) **Base:** `main` ← **Head:** `cont/salu-scc-value` --- ### 📝 Commits (1) - [`65e13e0`](https://github.com/ubiquitarianism/leonida/commit/65e13e0250b912f2f2360c6fcbd555853c77f403) tests/semantic: SALU instructions leave SCC exactly 0 or 1, read back through src_scc ### 📊 Changes **1 file changed** (+116 additions, -0 deletions) <details> <summary>View changed files</summary> ➕ `tests/semantic/test_salu_scc_value.py` (+116 -0) </details> ### 📄 Description Claimed in the coordination issue as: OLD-9634 (restoration of ItsNotRexed/Leonida#9634, closed unmerged when that repository went private) SCC checks in the suite mostly go through `s_cselect_b32` / `s_cbranch_scc*`, which only see zero vs non-zero, while `s_addc_u32`, `s_subb_u32` and `src_scc` read SCC as a number. `test_salu_scc_value.py` runs 63 hand-written cases over 48 SOP1/SOP2/SOPC instructions (each with an SCC = 1 case), copies SCC with `v_mov_b32 v0, src_scc` and checks the exported word. Why it is needed: with the nine inline `OpSelect ... 1 0 -> OpStore %scc` writes in `rdna2spirv.py` mutated to store 2, the existing suite passes and this file fails 10 instructions; with all 12 such writes mutated it fails 22 (measured on the original upstream base). Test only, no translator change. Tested: `python -m unittest discover -s tests/semantic -p test_salu_scc_value.py` (OK) on `main` 21625bca8, Linux, CPU interpreter; no GPU needed. No game files. AI-assisted (Claude Code). 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
4ld0 2026-11-26 20:18:46 +01:00
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#700
No description provided.