xshader: find a scene the root numbers differently #534

Merged
NickStallman merged 1 commit from upstream-pr/534 into main 2026-12-02 21:30:44 +00:00
NickStallman commented 2026-11-29 20:20:41 +00:00 (Migrated from github.com)

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) on f482572a, 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 check of 38861d27 (rebased onto e5d2e913; 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-table retry 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 run
Evidence: TuxBox check of 38861d27f1, no uncommitted changes, GPU 1002:13c0: 16 passed, 0 failed, 0 not run

🤖 Generated with Claude Code

<!-- greyfinch-sync:brcly/TuxBox:issue:5554722127 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/pull/534). Originally posted by [NickStallman](https://github.com/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) on f482572a, 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 check` of 38861d27 (rebased onto e5d2e913; 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-table` retry 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 38861d27f144, no uncommitted changes, GPU 10de:2b85: 16 passed, 0 failed, 0 not run Evidence: TuxBox check of 38861d27f144, no uncommitted changes, GPU 1002:13c0: 16 passed, 0 failed, 0 not run 🤖 Generated with [Claude Code](https://claude.com/claude-code)
brcly commented 2026-11-30 04:12:18 +00:00 (Migrated from github.com)

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.

  • Formatting: the whole workspace is now formatted with rustfmt (see the new rustfmt.toml).
  • Lints: every crate denies unwrap(), lossy as casts and undocumented unsafe outside tests.
  • CI: it now also runs 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:

git fetch origin
git checkout origin/main -- rustfmt.toml
cargo fmt --all && git commit -am "rustfmt"
git rebase origin/main

Then run python tuxbox.py check --no-gpu, which now includes the format step.

If clippy flags something new:

  • A cast: use From for widening, TryFrom for narrowing, and a mask for bit fields.
  • An unwrap(): use ?, or expect with the reason it can't fail.
  • An unsafe block: it needs a // SAFETY: comment.

CONTRIBUTING's "Code checks" section lists the commands. Thanks!

<!-- greyfinch-sync:brcly/TuxBox:comment:7268562044 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/pull/534#issuecomment-7268562044). Originally posted by [brcly](https://github.com/brcly) on 2026-11-30T04:12:18Z. --- Heads-up: main just landed a large cleanup (up to e5d2e913), so this PR needs a rebase. - **Formatting:** the whole workspace is now formatted with rustfmt (see the new `rustfmt.toml`). - **Lints:** every crate denies `unwrap()`, lossy `as` casts and undocumented `unsafe` outside tests. - **CI:** it now also runs `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: ```sh git fetch origin git checkout origin/main -- rustfmt.toml cargo fmt --all && git commit -am "rustfmt" git rebase origin/main ``` Then run `python tuxbox.py check --no-gpu`, which now includes the format step. If clippy flags something new: - **A cast:** use `From` for widening, `TryFrom` for narrowing, and a mask for bit fields. - **An `unwrap()`:** use `?`, or `expect` with the reason it can't fail. - **An `unsafe` block:** it needs a `// SAFETY:` comment. CONTRIBUTING's "Code checks" section lists the commands. Thanks!
brcly commented 2026-11-30 10:00:33 +00:00 (Migrated from github.com)

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:

  • the runtime doesn't match a renumbered root when it looks for the scene, and
  • on main every console-format scene is still the empty one.

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.

<!-- greyfinch-sync:brcly/TuxBox:comment:7274984872 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/pull/534#issuecomment-7274984872). Originally posted by [brcly](https://github.com/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**: - the runtime doesn't match a renumbered root when it looks for the scene, and - on main every console-format scene is still the empty one. 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.
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!534
No description provided.