tools: check float compares and v_cmpx over whole waves with a partly active EXEC #348

Merged
NickStallman merged 5 commits from upstream-pr/348 into main 2026-11-28 00:43:11 +00:00
NickStallman commented 2026-11-28 00:38:15 +00:00 (Migrated from github.com)

Imported from brcly/TuxBox. Originally posted by NickStallman on 2026-11-28T00:38:15Z.


What

A GPU check for the float compares: all 16 predicates of v_cmp_*_f32 and v_cmpx_*_f32, and v_cmp[x]_class_f32, for T2 (#333) and T3 (#334). Each result is read the way a whole wave reads it. That means some lanes are inactive on entry, programs run in wave32, wave64 and the paired form a 32-lane host uses, and a v_cmpx result is read from EXEC, from a write after it, and from a branch on an empty EXEC.

  • Reference: the RDNA 2 ISA definitions. LG is ordered; NEQ and the N forms are true on NaN; ±0 compare equal; fp32 denormals are flushed unless s_denorm_mode keeps them; class reads the raw bits.
  • Forms: VOPC and VOP3, abs/neg modifiers, inline and literal constants, a scalar source, and the denormal mode that keeps inputs. These are the forms the recorded ProjectScarlett shaders use. They use no SDWA.
  • Expected failures: two faults of the translation are expected. Each is modelled word for word, so the check passes today and fails when either stops showing:
    1. A wave32 VOP3 compare into s24 also zeroes s25. A compare's destination is one register in wave32.
    2. In the 32- and 64-lane translations, the skip behind s_cbranch_execz after a v_cmpx is decided per lane. A scalar written inside the block then reaches only the lanes still in EXEC, while on the console it reaches the whole wave. The paired translation gets this right.

It depends on #347, the first-lane ballot. Without it the RTX 5090 loses the device partway through, as described there.

Results

The two cards differ from the model only in the two expected faults:

Card Cases Differ, all expected Native wave64 cases
AMD Raphael iGPU (RADV, Mesa 26.0.8) 1,254 559 run
RTX 5090 (620.70.10) 874 415 native wave64 not run (32-lane host)

I checked the expected-failure model offline against both receipts. It predicts exactly which cases fail, and the first wrong word of every failing output: 2,491 on AMD and 1,503 on NVIDIA. No passing case is predicted to fail. These runs predate the expected-failure table, so the check still needs a rerun on both cards in its current form.

  • Python tests: passed, including tests/test_float_compares_reference.py.
  • CPU stages: all 114 programs assemble, translate, compile and validate.

🤖 Generated with Claude Code

<!-- greyfinch-sync:brcly/TuxBox:issue:5535000167 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/pull/348). Originally posted by [NickStallman](https://github.com/NickStallman) on 2026-11-28T00:38:15Z. --- ## What A GPU check for the float compares: all 16 predicates of `v_cmp_*_f32` and `v_cmpx_*_f32`, and `v_cmp[x]_class_f32`, for T2 (#333) and T3 (#334). Each result is read the way a whole wave reads it. That means some lanes are inactive on entry, programs run in wave32, wave64 and the paired form a 32-lane host uses, and a `v_cmpx` result is read from EXEC, from a write after it, and from a branch on an empty EXEC. - **Reference:** the RDNA 2 ISA definitions. LG is ordered; NEQ and the N forms are true on NaN; ±0 compare equal; fp32 denormals are flushed unless `s_denorm_mode` keeps them; class reads the raw bits. - **Forms:** VOPC and VOP3, abs/neg modifiers, inline and literal constants, a scalar source, and the denormal mode that keeps inputs. These are the forms the recorded ProjectScarlett shaders use. They use no SDWA. - **Expected failures:** two faults of the translation are expected. Each is modelled word for word, so the check passes today and fails when either stops showing: 1. A wave32 VOP3 compare into `s24` also zeroes `s25`. A compare's destination is one register in wave32. 2. In the 32- and 64-lane translations, the skip behind `s_cbranch_execz` after a `v_cmpx` is decided per lane. A scalar written inside the block then reaches only the lanes still in EXEC, while on the console it reaches the whole wave. The paired translation gets this right. It depends on #347, the first-lane ballot. Without it the RTX 5090 loses the device partway through, as described there. ## Results The two cards differ from the model only in the two expected faults: | Card | Cases | Differ, all expected | Native wave64 cases | |---|---|---|---| | AMD Raphael iGPU (RADV, Mesa 26.0.8) | 1,254 | 559 | run | | RTX 5090 (620.70.10) | 874 | 415 | native wave64 not run (32-lane host) | I checked the expected-failure model offline against both receipts. It predicts exactly which cases fail, and the first wrong word of every failing output: 2,491 on AMD and 1,503 on NVIDIA. No passing case is predicted to fail. These runs predate the expected-failure table, so the check still needs a rerun on both cards in its current form. - Python tests: passed, including `tests/test_float_compares_reference.py`. - CPU stages: all 114 programs assemble, translate, compile and validate. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Sign in to join this conversation.
No reviewers
No labels
No milestone
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.

Reference
brcly/TuxBox!348
No description provided.