xshader: let a paired compare read the scalar its mask replaces #613
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/613"
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 brcly/TuxBox. Originally posted by NickStallman on 2026-12-01T08:44:21Z.
In the paired wave64 translation each lane's copy of an instruction gets a local for a mask it writes, starting at zero. When the mask's registers are also a source, as in
s[0:1] = s0 < v0, the local hid the scalar, so the compare read 0. The local now starts from the value the instruction reads.VCC had the opposite problem: every instruction that named it read its own lane's bit, though only a select, a carry-in and
v_div_fmasuse it as a mask. Elsewhere it is now a scalar value. An instruction that uses the same registers as a mask and a value, or EXEC as a value, is refused; none is recorded.Refs #533.
Affects programs translated in the paired form: 64-lane compute on hosts with 32-lane waves, and groups that fill part of a wave or exchange lanes in a loop on any host.
Measured
5,366 recorded compute requests of one title, main
717a74c4, translated for a 32-lane host: 314 change, 4,545 don't, 507 are refused before and after; 0 newly refused. 306 change with the first commit alone; 12 read VCC as a value. Without that host option 32 of the 314 change.All 314 compile and validate (DXC with the runtime's compute flags, dxv): 279 compiled, 35 identical copies. DXIL size +0.1%.
Tests: 9 unit tests, 6 of which fail on the parent; 18 mutations, all caught. The recorded host profiles don't change.
GPU check
paired-wave64: three programs (compare, carry, VCC), each in whole and part waves, 12 cases, against the console model; the model is checked against a closed form. It passes on both cards in the full checks below (140 programs). Controls on the RTX 5090: with the parent's translator the check fails on exactly the 12 new cases (12 of 140 programs); with only the first commit (mask sources, no VCC as a value) it fails on exactly the 4vcc_source*cases.In a title we traced, on a 32-lane host, an integration build with this and #611 put lit, textured surfaces on screen that were missing (one run; it carries other open PRs, so I don't claim it for this alone).
Full
python tuxbox.py checkoff7790ed2(GE-Proton11-15): RTX 5090 (10de:2b85, 620.70.10) 208 pass, 0 fail; AMD iGPU (1002:13c0, RADV) 207 pass, 0 fail.Evidence: TuxBox check of
f7790ed23f, no uncommitted changes, GPU 10de:2b85: 17 passed, 0 failed, 0 not runEvidence: TuxBox check of
f7790ed23f, no uncommitted changes, GPU 1002:13c0: 17 passed, 0 failed, 0 not runNot covered
v_div_scalewith a scalar mask destination is still refused in the paired form, as before.🤖 Generated with Claude Code