Skip to content

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

Merged
JohnConnorNPC merged 1 commit into
R0Y00:mainfrom
Leyukaka:tests-direct-scc-equal
Nov 29, 2026
Merged

JohnConnorNPC merged 1 commit into
R0Y00:mainfrom
Leyukaka:tests-direct-scc-equal

Conversation

@Leyukaka

Copy link
Copy Markdown
Collaborator

Refs #3434

#3434 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 184b15d; merges cleanly into main 1a0120b, 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. #3435 changes the gfx2hlsl side; this PR does not need it and does not touch the files it changes.

@JohnConnorNPC
JohnConnorNPC merged commit 16b8703 into R0Y00:main Nov 29, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants