tests: pin SCC of scalar min/max with equal operands on the direct compute path #3443

Manually merged
github merged 1 commit from github-bot/gh-3441 into main 2026-11-29 10:08:52 +00:00 AGit
Owner

@⁠Leyukaka on GitHub · 2026-11-29 09:09 UTC · original
Leyukaka:tests-direct-scc-equal → main · +30 −4 · 1 files · 1 commits · merged 2026-11-29 10:04 UTC

Refs #3436

#3436 noted that no direct-path test reads SCC after s_min/s_max with S0 == S1. This adds one to tests/native_descriptor_scc_check.py.

What it pins. On the non-runtime program (gfx1013-direct-cs), each group now runs s_min_u32, s_min_i32, s_max_u32 and s_max_i32 twice: once with equal operands (s5, s5) and once with unequal ones (s5 = 3 and inline -1, i.e. 0xFFFFFFFF as u32). Each SCC is read with s_cselect_b32 and stored, which gives 8 cases per group. Expected SCC is 0 for equal operands and 1 for the unequal pairs, following the current strict lowering in arithmetic (src/gfx1013_direct_compute.inl):

auto pred = cmp(sign + (n.substr(2, 3) == "min" ? "lt" : "gt"), a, b);
...
write(128, ir.value("zext i1 " + pred + " to i32"));

SCC is seeded to 1 by s_or_b32 before the first case, and the expected values alternate 0, 1, so a missing SCC write shows in every case. The group stride goes from 16 to 64 bytes to make room. The runtime program is unchanged.

This pins what the direct path does today. It does not say which result the ISA specifies.

Evidence (release preset, branch based on 184b15db; merges cleanly into main 1a0120ba, where the test file and the lowering are unchanged):

  • native_descriptor_scc_hardware passes.
  • Mutation: changing the min predicate from lt to le in arithmetic makes it fail with AssertionError: s_min_u32 group 0: SCC for equal operands=1, unequal operands=1; expected 0, 1. With the change reverted, the test passes again.
  • native_descriptor_scc_warp skips (77) with "requires shader model 6.6 with wave32", and the pr test preset filter does not include native_descriptor_scc_*. These cases therefore run only with the hardware variant.

Not covered. No comparison with gfx2hlsl, and no max-side mutation was run. #3437 changes the gfx2hlsl side; this PR does not need it and does not touch the files it changes.

**@⁠Leyukaka** on GitHub · 2026-11-29 09:09 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/3441) `Leyukaka:tests-direct-scc-equal` → `main` · +30 −4 · 1 files · 1 commits · merged 2026-11-29 10:04 UTC Refs #3436 #3436 noted that no direct-path test reads SCC after `s_min`/`s_max` with S0 == S1. This adds one to `tests/native_descriptor_scc_check.py`. **What it pins.** On the non-runtime program (`gfx1013-direct-cs`), each group now runs `s_min_u32`, `s_min_i32`, `s_max_u32` and `s_max_i32` twice: once with equal operands (s5, s5) and once with unequal ones (s5 = 3 and inline -1, i.e. 0xFFFFFFFF as u32). Each SCC is read with `s_cselect_b32` and stored, which gives 8 cases per group. Expected SCC is 0 for equal operands and 1 for the unequal pairs, following the current strict lowering in `arithmetic` (`src/gfx1013_direct_compute.inl`): ```cpp auto pred = cmp(sign + (n.substr(2, 3) == "min" ? "lt" : "gt"), a, b); ... write(128, ir.value("zext i1 " + pred + " to i32")); ``` SCC is seeded to 1 by `s_or_b32` before the first case, and the expected values alternate 0, 1, so a missing SCC write shows in every case. The group stride goes from 16 to 64 bytes to make room. The runtime program is unchanged. This pins what the direct path does today. It does not say which result the ISA specifies. **Evidence** (release preset, branch based on 184b15db; merges cleanly into main 1a0120ba, where the test file and the lowering are unchanged): - `native_descriptor_scc_hardware` passes. - Mutation: changing the min predicate from `lt` to `le` in `arithmetic` makes it fail with `AssertionError: s_min_u32 group 0: SCC for equal operands=1, unequal operands=1; expected 0, 1`. With the change reverted, the test passes again. - `native_descriptor_scc_warp` skips (77) with "requires shader model 6.6 with wave32", and the `pr` test preset filter does not include `native_descriptor_scc_*`. These cases therefore run only with the hardware variant. **Not covered.** No comparison with gfx2hlsl, and no max-side mutation was run. #3437 changes the gfx2hlsl side; this PR does not need it and does not touch the files it changes.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-29 09:10:53 +00:00
github manually merged commit 16b8703176 into main 2026-11-29 10:08:52 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.