xshader: find a scene the root numbers differently #534
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/534"
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-29T20:20:41Z.
For #382.
A root embedded in a request can number its ranges independently of the shader. A console walk looked its scene up by the root's number, missed it, and read the node buffer at offset 0, so every ray missed. It now uses the shader's own number.
Tested
A synthetic test that fails without the change, all translator unit tests (632),
python tuxbox.py check --no-gpu.Of 205 recorded walk requests (standalone,
--wave32-host): 14 gain their scene bases, 117 have identical HLSL and 74 are refused as before.All recorded requests (47,526 containers, compute also with
--wave32-host, and 1,908 linked pairs) onf482572a, HLSL and profile compared: 14 compute programs change (all ray-traced shadow walks, 10 with one scene and 4 with two), 0 newly refused, 0 newly accepted, every other stage 0. In each of the 14, the sequence of scene bases now equals that of a second recording with the same instructions and an unrenumbered root. All 14 compile with DXC 1.9.2609.5 and pass its dxv.Full
python tuxbox.py checkof38861d27(rebased ontoe5d2e913; one resolved conflict, HLSL of 1,598 random and the 14 named programs unchanged): RTX 5090 (10de:2b85, 620.70.10) 200 pass, 0 fail; AMD iGPU (1002:13c0, RADV) 199 pass, 0 fail. GE-Proton11-14.The runtime's
--stride-tableretry over the same requests (779 runs, 517 accepted on main): 0 newly accepted, 0 newly refused, 0 changed. Of the 74 refused walk requests, 4 are accepted with it, unchanged by this, so 70 stay refused as the runtime asks.Not run: the game, the programs on a GPU. The ray-query, nearest-hit and scene-join paths still look a scene up by the root's number (read, not seen in any accepted recording); 10 refused recordings with renumbered roots stop there.
The runtime doesn't yet match such a root's numbers when it looks for the scene, so this alone changes nothing visible. It's small and has no effect on the other programs surveyed.
Evidence: TuxBox check of
38861d27f1, no uncommitted changes, GPU 10de:2b85: 16 passed, 0 failed, 0 not runEvidence: TuxBox check of
38861d27f1, no uncommitted changes, GPU 1002:13c0: 16 passed, 0 failed, 0 not run🤖 Generated with Claude Code
Imported from brcly/TuxBox. Originally posted by brcly on 2026-11-30T04:12:18Z.
Heads-up: main just landed a large cleanup (up to
e5d2e913), so this PR needs a rebase.rustfmt.toml).unwrap(), lossyascasts and undocumentedunsafeoutside tests.cargo fmt --check, rustdoc with warnings denied, and Miri on the providers' unit tests.The least painful way is to format your branch first, so the rebase only shows real changes:
Then run
python tuxbox.py check --no-gpu, which now includes the format step.If clippy flags something new:
Fromfor widening,TryFromfor narrowing, and a mask for bit fields.unwrap(): use?, orexpectwith the reason it can't fail.unsafeblock: it needs a// SAFETY:comment.CONTRIBUTING's "Code checks" section lists the commands. Thanks!
Imported from brcly/TuxBox. Originally posted by brcly on 2026-11-30T10:00:33Z.
Thanks. The fix itself looks right: a walk should find its scene by the shader's own number, not the root's.
On our recorded corpus (46,664 requests, plain translation), this changes 28 outputs, with nothing gained or lost. That's the same kind of change as your 14 compute programs; the count differs because our request set and flags differ.
As you say, though, it changes nothing visible on its own:
Under our current rule, we merge a change when it has an effect someone can see or measure. So I'm holding this one until the runtime half is ready. Then please add it to that PR, or open them as a pair, so the 14 shadow walks can be shown finding their scene. If you also cover the ray-query, nearest-hit and scene-join paths you mention (or show they can't see a renumbered root), that would close the gap in one go.