prep: key ProjectScarlett's linked pairs by the pixel program's current DXIL #674

Open
gtb-sbe wants to merge 2 commits from upstream-pr/674 into main
gtb-sbe commented 2026-12-03 13:45:45 +00:00 (Migrated from github.com)

Imported from brcly/TuxBox. Originally posted by gtb-sbe on 2026-12-03T13:45:45Z.


Fixes #651.

Summary

The provider keys a linked pair by its pixel program's DXIL at the moment it records the request (shader_cache/compile.rs, linked). ProjectScarlett's prepare compiled each recorded .link request under that recorded key. Once the pixel program translates to different DXIL, with a new translator or another DXC, the provider asks for a key the prepare never filled, and a request recorded under a newer DXC than the one installed failed in DXV ("Validator version in metadata (1.10) is not supported"). On my machine that was 342 of 354 link requests after I went from nixpkgs' DXC 1.10 to the 1.9.2609 release.

As you asked in #651:

  • Each recorded pair is keyed by its pixel program's .cso in the current runtime cache, as chase_warmup.py already does, and staged again with that DXIL when the key differs. Link requests start after every other request, so the pixel program's translation exists by then.
  • A pair whose current translations no longer need a link is dropped. The check follows shader_cache::link_on_demand: a portable vertex or geometry producer, a portable pixel program, and a semantic that moves register, needs a component the producer didn't write, or changes component type (runtime_shaders.packing_mismatch, a port of tuxbox_dxbc::has_packing_mismatch). Without the producer's translation in the cache the pair is kept.
  • A recorded request with no current pixel translation to key it by, whose stored pixel.cso the validator rejects as newer than it supports ("Validator version in metadata ... is not supported"), counts as stale instead of failed. Any other rejection stays a failure.
  • stale and dropped show up in the summary line and the aggregate receipt only when they aren't zero, so other preparations print what they did before. docs/PROJECTSCARLETT.md describes the two counts.

Tested

  • The checks relevant to this change passed
  • Changed or new behaviour is covered by a Lanes scenario, or the reason it cannot be is stated below
  • Where the table calls for AMD and NVIDIA, they passed on both. Otherwise, say which vendor still needs to run them: NVIDIA still needs to run them.

No Lanes scenario: the change is in the ProjectScarlett prepare, which reads a title's shader pack and the provider's recorded link requests; Lanes doesn't record link requests. Unit tests cover it instead (below).

GPU, driver and backend: RX 9060 XT (1002:7590), RADV / Mesa 26.3.1, Proton Experimental

The Evidence: line tuxbox.py check prints last, one per card (it names the commit it tested; run it on this pull request's head):

Evidence: TuxBox check of e246b52220f2, no uncommitted changes, GPU 1002:7590: 15 passed, 2 failed, 0 not run

Commands run and their results:

python tuxbox.py check --changed 106120ca --backend proton --adapter 1002:7590 --proton <Proton Experimental> --prefix <scratch prefix> --windows-dxc <dir>
  ran the full check (the branch touches files the table doesn't list): 15 passed, 2 failed.
  Both are known on this machine without this branch (GuestWatch on every main here, alu since at least 9a19c767):
  - Python tests: only GuestWatch.test_a_guest_that_died_stops_the_sandbox_instead_of_waiting_out_the_timeout
    (NixOS: the dev shell's Python is a wrapper that re-execs, so the process name never matches)
  - Shader translator on the GPU: alu, 23 of 372 wrong, all signalling-NaN payloads through multiply-add
    (this card returns the quieted NaN, the check expects the console's or NVIDIA's)
  Lanes and fixtures on the GPU and the D3D12 regression controls passed.
python -m unittest tests.test_scarlett_prep: 19 tests, OK

New tests: a pair the provider would no longer link is dropped while a pair with a moved register is compiled under its current key; a recorded pair whose stored pixel DXIL is too new for the validator is stale, while one the validator rejects for another reason, or one that fails elsewhere, stays failed; the signature check's cases.

A real prepare on my machine (RX 9060 XT, GE-Proton11-15, DXC 1.9.2609 with the helper): before the change, 342 of 354 link requests failed. With this branch on 106120ca: 355 link requests, 14 dropped as no longer linked, 0 stale, 0 failed. Over all 53,655 requests, 44,094 compiled, 199 cached, 9,348 unsupported and 0 failed, in 2,553 s.

AI use

I made this branch with an AI coding agent (Claude Code, following AGENTS.md). It traced the stale keys to the provider's recording, wrote the change and the tests from your description in #651, and ran the unit tests, the checks and the real prepare above on my machine.

<!-- greyfinch-sync:brcly/TuxBox:issue:5627727687 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/pull/674). Originally posted by [gtb-sbe](https://github.com/gtb-sbe) on 2026-12-03T13:45:45Z. --- Fixes #651. ## Summary The provider keys a linked pair by its pixel program's DXIL at the moment it records the request (`shader_cache/compile.rs`, `linked`). ProjectScarlett's prepare compiled each recorded `.link` request under that recorded key. Once the pixel program translates to different DXIL, with a new translator or another DXC, the provider asks for a key the prepare never filled, and a request recorded under a newer DXC than the one installed failed in DXV ("Validator version in metadata (1.10) is not supported"). On my machine that was 342 of 354 link requests after I went from nixpkgs' DXC 1.10 to the 1.9.2609 release. As you asked in #651: - Each recorded pair is keyed by its pixel program's `.cso` in the current runtime cache, as `chase_warmup.py` already does, and staged again with that DXIL when the key differs. Link requests start after every other request, so the pixel program's translation exists by then. - A pair whose current translations no longer need a link is dropped. The check follows `shader_cache::link_on_demand`: a portable vertex or geometry producer, a portable pixel program, and a semantic that moves register, needs a component the producer didn't write, or changes component type (`runtime_shaders.packing_mismatch`, a port of `tuxbox_dxbc::has_packing_mismatch`). Without the producer's translation in the cache the pair is kept. - A recorded request with no current pixel translation to key it by, whose stored `pixel.cso` the validator rejects as newer than it supports ("Validator version in metadata ... is not supported"), counts as `stale` instead of `failed`. Any other rejection stays a failure. - `stale` and `dropped` show up in the summary line and the aggregate receipt only when they aren't zero, so other preparations print what they did before. `docs/PROJECTSCARLETT.md` describes the two counts. ## Tested - [ ] The checks relevant to this change passed - [x] Changed or new behaviour is covered by a Lanes scenario, or the reason it cannot be is stated below - [ ] Where the table calls for AMD and NVIDIA, they passed on both. Otherwise, say which vendor still needs to run them: NVIDIA still needs to run them. No Lanes scenario: the change is in the ProjectScarlett prepare, which reads a title's shader pack and the provider's recorded link requests; Lanes doesn't record link requests. Unit tests cover it instead (below). GPU, driver and backend: RX 9060 XT (`1002:7590`), RADV / Mesa 26.3.1, Proton Experimental The `Evidence:` line `tuxbox.py check` prints last, one per card (it names the commit it tested; run it on this pull request's head): ```text Evidence: TuxBox check of e246b52220f2, no uncommitted changes, GPU 1002:7590: 15 passed, 2 failed, 0 not run ``` Commands run and their results: ```text python tuxbox.py check --changed 106120ca --backend proton --adapter 1002:7590 --proton <Proton Experimental> --prefix <scratch prefix> --windows-dxc <dir> ran the full check (the branch touches files the table doesn't list): 15 passed, 2 failed. Both are known on this machine without this branch (GuestWatch on every main here, alu since at least 9a19c767): - Python tests: only GuestWatch.test_a_guest_that_died_stops_the_sandbox_instead_of_waiting_out_the_timeout (NixOS: the dev shell's Python is a wrapper that re-execs, so the process name never matches) - Shader translator on the GPU: alu, 23 of 372 wrong, all signalling-NaN payloads through multiply-add (this card returns the quieted NaN, the check expects the console's or NVIDIA's) Lanes and fixtures on the GPU and the D3D12 regression controls passed. python -m unittest tests.test_scarlett_prep: 19 tests, OK ``` New tests: a pair the provider would no longer link is dropped while a pair with a moved register is compiled under its current key; a recorded pair whose stored pixel DXIL is too new for the validator is stale, while one the validator rejects for another reason, or one that fails elsewhere, stays failed; the signature check's cases. A real prepare on my machine (RX 9060 XT, GE-Proton11-15, DXC 1.9.2609 with the helper): before the change, 342 of 354 link requests failed. With this branch on `106120ca`: 355 link requests, 14 dropped as no longer linked, 0 stale, 0 failed. Over all 53,655 requests, 44,094 compiled, 199 cached, 9,348 unsupported and 0 failed, in 2,553 s. ## AI use I made this branch with an AI coding agent (Claude Code, following `AGENTS.md`). It traced the stale keys to the provider's recording, wrote the change and the tests from your description in #651, and ran the unit tests, the checks and the real prepare above on my machine.
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/674:upstream-pr/674'
git switch 'upstream-pr/674'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/674'
git switch 'upstream-pr/674'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/674'
git switch 'upstream-pr/674'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/674'
git switch 'main'
git merge --squash 'upstream-pr/674'
git switch 'main'
git merge --ff-only 'upstream-pr/674'
git switch 'main'
git merge 'upstream-pr/674'
git push origin 'main'
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!674
No description provided.