#1585

Tests: skip ps_vcmpx_forms on narrow fragment subgroups (TEST-205)

OpenLuanFreitaswants to merge intofrom

Summary

  • TEST-205: skip ps_vcmpx_forms on devices whose subgroup range has min under 32 (Intel UHD 770 class), where vk_harness cannot pin fragment and the 32-lane v_cmpx EXEC packing is not comparable — same root cause #1318 handled for ps_bitmask_perm.
  • Shared vcmpx_forms_narrow_skip in check.py / run_gpu_tests.py; unit tests cover skip vs judge on 8..32 / 32..32 / missing width.
  • Claimed in #1548.

Test plan

  • python -I -m unittest discover -s tests -p test_run_gpu_pixel_checks.py -v
  • python -I -m unittest discover -s tests -p test_shader_checks.py -v
  • Negative control: without the skip, Intel 8..32 + bad words is a 4096/4096 differ (false failure class); with skip it returns Skip
  • Optional: on an Intel GPU with subgroup 8..32, confirm ps_vcmpx_forms is SKIP rather than FAIL; on NVIDIA 32..32 it still judges

AI-assisted. No game files. Dual-tested (author + reviewer/negative control). GPU for optional confirm: Intel UHD 770 / any 8..32 fragment device.

Activity

4
Jolymmiles1h ago

I don't think a subgroup-width skip is the right fix here. The words show that the cause is NaN comparisons, not lane masks.

Decoded with the bit layout in the .asm header (bit 4k+i of word w = op k on pair i):

Intel UHD 770 (the numbers posted on #1374):

  • word 0, bit 16: ngt(NaN, 1.0) got 0, want 1
  • word 0, bit 20: nle(NaN, 1.0) got 0, want 1
  • word 1, bit 2: eq(NaN, NaN) got 1, want 0
  • word 1, bit 10: le(NaN, NaN) got 1, want 0
  • word 1, bit 22: nle(NaN, NaN) got 0, want 1

Apple M3 Max, MoltenVK 1.4.2 (macOS 27.3, main at 99f99890), got 0xf05e8e16, want 0xf05e8a12 in word 1:

  • word 1, bit 2: eq(NaN, NaN) got 1, want 0
  • word 1, bit 10: le(NaN, NaN) got 1, want 0

Every mismatching bit has a NaN operand. All non-NaN bits match, and so does word 3, the EXEC/VCC word (0x15550000 is the expected value, not a half lane mask). Both drivers treat the floats as never NaN: x == x folds to true, and !(a > b) becomes a <= b.

On the Mac I checked it both ways:

  • MVK_CONFIG_FAST_MATH_ENABLED=0: ps_vcmpx_forms passes, 4096/4096 exact. With =1 or =2 it fails as above. This is what #1512 sets for the test tools.
  • #664's translator change (SignedZeroInfNanPreserve 32, applied on 99f99890) with MoltenVK's default fast math: it passes, 4096/4096 exact.

The guard here also skips on MoltenVK, which reports a 4..32 subgroup range. On a Mac it would turn a real translator/driver NaN problem into a SKIP. I'd keep the test judging and let #664 (and #1512 for MoltenVK) fix it. Could you check ps_vcmpx_forms on the UHD 770 with #664 applied?

Tested on Apple M3 Max, macOS 27.3, MoltenVK 1.4.2 (Homebrew), no game files. AI-assisted.

LuanFreitas1h ago

You're right — thanks for the bit-level decode. Word 3 matching 0x15550000 rules out the #1318 lane-mask story; every bad bit has a NaN operand, so this is the fast-math / NaN-preserve case (#664 / #1512), not a narrow fragment subgroup.

Closing this skip: it would hide real failures (including on MoltenVK's 4..32 range). #1512 is already on main; I'll leave judging to #664 for the translator side.

AI-assisted.

LuanFreitas1h ago

Closing: misdiagnosed as #1318-class skip; root cause is NaN compares (see @Jolymmiles). Yield to #664 / #1512.