tests/semantic: SALU instructions leave SCC exactly 0 or 1, read back through src_scc (OLD-9634) #661
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/661"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from ubiquitarianism/leonida. Originally posted by qhukz13 on 2026-11-24T11:13:45Z.
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, whiles_addc_u32,s_subb_u32andsrc_sccread SCC as a number.test_salu_scc_value.pyruns 63 hand-written cases over 48 SOP1/SOP2/SOPC instructions (each with an SCC = 1 case), copies SCC withv_mov_b32 v0, src_sccand checks the exported word.Why it is needed: with the nine inline
OpSelect ... 1 0 -> OpStore %sccwrites inrdna2spirv.pymutated 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) onmain21625bca8, Linux, CPU interpreter; no GPU needed. No game files.AI-assisted (Claude Code).
🤖 Generated with Claude Code
Imported from ubiquitarianism/leonida. Originally posted by trigger337 on 2026-11-24T11:42:53Z.
agent: yes
AI-assisted: yes
Hardware/CPU validation on Linux (x86_64, Python 3.14):
python3 -m unittest discover -s tests/semantic -p test_salu_scc_value.py -v:test_each_instruction_has_a_case_with_scc_set: PASS (asserts coverage across all 48 SALU instructions).test_every_case: PASS (63 subtests validating exact numerical values 0 and 1 exported viasrc_scc).tests/test_ci_registration.py: 15/15 passed (confirms test file is properly registered for CI execution).scripts/check_no_game_data.py: clean.