xshader: select what a mesh program's skipped block writes #459
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/459"
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-11-29T08:53:58Z.
On hold: the control in #458 doesn't support the explanation below. Please don't merge on it.
Summary
A forward branch of a translated mesh program that votes across its group is
if (tb_skip < T) { ... }. On an RTX 5090 (620.70.10) the first lanes of the group then get wrong values in registers the block sets, although no lane skips it. This is #458.With this change such a block is not a block:
tb_skipand loop conditions;ifare handled the same way;It runs on the text after
select_writes, in mesh programs that use the lane votes, on every host.control_flow.rsis not touched.Tested
Translated programs against their compute forms, all vertex counts up to the limit, every export:
The last three had bindless resources stubbed. As compute the new output equals the old on lavapipe for the first three.
Survey of 47,367 recorded requests, main (
75453953) and this change:DXC 1.8.2505.1, 600 of the changed programs at random and the 10 largest, 0 errors, the same number of barriers:
Checks:
python tuxbox.py check --no-gpupassed at2b5bc898. Fulltuxbox.py checkat2b5bc898: RTX 5090 (620.70.10) 181 pass, 0 fail; AMD iGPU (RADV) 180 pass, 0 fail, guest-present-4k-splash skipped. Held as a draft: the control below doesn't support the explanation, and no game run has been done.translated-meshhas new casesskip-16,skip-64,skip-112. They don't fail withmain's emitter: 41 live-value counts, translated with and without the change, were all right on the 5090, so the cases are correctness tests, not regression tests. No Lanes scenario: a title mesh shader is not part of Lanes; the check covers it on the GPU.Two of the unit tests fail with the pass off.
Not measured
0x70were 5 of 10 with the original and 0 of 10 with that shader swapped (one-sided Fisher p = 0.016).Risk
First-use compile time. In the tests each job is one process on a cold cache, so this is about the time of one pipeline plus start-up: program 4 took 7.9 s before and 11.5 s after on the 5090, 1.0 and 1.2 s on AMD; program 2 1.8 and 2.2 s; program 3 1.8 and 1.9 s; program 1 1.5 and 1.6 s. Of the changed programs 117 have at least 700 KB of HLSL before the change (program 4 has 753 KB), 846 at least 500 KB, and half are under 105 KB.
On lavapipe program 4 did not finish creating its pipeline in 240 s (7 s before). RADV and NVIDIA do not show that.
The DXIL in the store and every driver cache entry of the 13,852 programs changes, so they recompile once.
🤖 Generated with Claude Code
Imported from brcly/TuxBox. Originally posted by NickStallman on 2026-11-29T11:13:04Z.
The control I wanted before un-drafting this came out against it: changes that keep the branches hide the fault in the reduced shaders as often as this does (details). I've put the PR on hold and rewritten its claims. Both full checks pass at
2b5bc898, so it isn't known to break anything, but it isn't an explained fix.Imported from brcly/TuxBox. Originally posted by NickStallman on 2026-11-29T13:17:00Z.
Closing this, and please don't use it. On an RTX 5090 (620.70.10) it makes programs wrong that are right today. Of two copies of one recorded mesh program (the same HLSL under two keys), base is right and this change's form is wrong in 906 lanes; the third program I compared (285bbd5c) goes the other way. The reason is the one in #458: the fault moves with the instruction stream, and selects are just another stream.
The eight game runs of mine that contained it (builds on
75453953andd2eb99ed) used that form of those programs, so what they ended on isn't evidence aboutmain. The results I posted about readback, #460, #462, #464, #465 and the copies are about CPU-side data or counts and don't depend on it, but any statement of mine about "how far a run got" from those builds should be read with that in mind.Superseded by a much smaller change (one xor of the lane number, in the programs that vote) with a population test: 48 of 147 unseen programs wrong as translated, 0 with the change. It will be a separate PR.
Pull request closed