dxbc: recover literal comparison samplers #45

Merged
Valdi320 merged 2 commits from upstream-pr/45 into main 2026-11-24 13:41:53 +00:00
Valdi320 commented 2026-11-24 10:55:33 +00:00 (Migrated from github.com)

Imported from brcly/TuxBox. Originally posted by Valdi320 on 2026-11-24T10:55:33Z.


The public ProjectScarlett log in #39 has 393 distinct sampler-descriptor refusals; 206 report the same literal comparison/border state. The existing shared inline sampler recovery only accepts ordinary filters and a zero border word, although the HLSL static sampler matcher already knows the isotropic comparison mapping.

Recover comparison filter, compare function and standard border color for the classic comparison sample/gather opcodes. Keep the ordinary path unchanged and key private slots by both literal state and comparison mode. Unknown flags, custom borders and unrecognized filters remain rejected. The tests use synthetic ISA and the four diagnostic state words, not retail shader binaries.

Validation on Bazzite:

  • 48 shared DXBC native-binding tests and 64 xshader tests passed.
  • Windows D3D12 provider rebuilt.
  • RTX 4080/stock Proton: signatures, draw, mesh, tables, indirect and stream checks all passed.
  • Three added tests cover exact comparison state, rejection of unknown fields, synthetic instruction recovery, and distinct ordinary/comparison slots.

No retail shader inputs available locally: this fixes a demonstrated decoder gap, not a claim that 206 retail requests now compile. AI-assisted contribution.

Shared decoder follow-up: The HLSL static sampler matcher now uses the same literal decoder as runtime recovery, including the previously omitted 4x anisotropic state. All six distinct states from the #39 log match the shared decoder; these correspond to 393 recorded refusals, not 393 verified shader fixes. Recover ordinary scalar pair copies, preserve the original single pixel sampler binding across proven loops, and reject a backedge-only initialization at entry. 51 DXBC and 64 compiler unit tests passed; provider rebuilt; six RTX 4080 Proton graphics regression checks passed. No retail recompile or sampling-output claim.

<!-- greyfinch-sync:brcly/TuxBox:issue:6580199817 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/pull/45). Originally posted by [Valdi320](https://github.com/Valdi320) on 2026-11-24T10:55:33Z. --- The public ProjectScarlett log in #39 has 393 distinct sampler-descriptor refusals; 206 report the same literal comparison/border state. The existing shared inline sampler recovery only accepts ordinary filters and a zero border word, although the HLSL static sampler matcher already knows the isotropic comparison mapping. Recover comparison filter, compare function and standard border color for the classic comparison sample/gather opcodes. Keep the ordinary path unchanged and key private slots by both literal state and comparison mode. Unknown flags, custom borders and unrecognized filters remain rejected. The tests use synthetic ISA and the four diagnostic state words, not retail shader binaries. Validation on Bazzite: - 48 shared DXBC native-binding tests and 64 xshader tests passed. - Windows D3D12 provider rebuilt. - RTX 4080/stock Proton: signatures, draw, mesh, tables, indirect and stream checks all passed. - Three added tests cover exact comparison state, rejection of unknown fields, synthetic instruction recovery, and distinct ordinary/comparison slots. No retail shader inputs available locally: this fixes a demonstrated decoder gap, not a claim that 206 retail requests now compile. AI-assisted contribution. **Shared decoder follow-up:** The HLSL static sampler matcher now uses the same literal decoder as runtime recovery, including the previously omitted 4x anisotropic state. All six distinct states from the #39 log match the shared decoder; these correspond to 393 recorded refusals, not 393 verified shader fixes. Recover ordinary scalar pair copies, preserve the original single pixel sampler binding across proven loops, and reject a backedge-only initialization at entry. 51 DXBC and 64 compiler unit tests passed; provider rebuilt; six RTX 4080 Proton graphics regression checks passed. No retail recompile or sampling-output claim.
trigger337 commented 2026-11-24 11:14:14 +00:00 (Migrated from github.com)

Imported from brcly/TuxBox. Originally posted by trigger337 on 2026-11-24T11:14:14Z.


Verification on Linux (CachyOS x86_64, rustc 1.91+):

  • Crate unit tests: cargo test --target x86_64-unknown-linux-gnu -p tuxbox-dxbc --features native-bindings
    • 48/48 tests passed, including comparison sampler recovery tests:
      • inline_sampler::tests::comparison_sampler_recovers_opaque_white_border_and_less_equal
      • inline_sampler::tests::comparison_sampler_state_is_recovered_at_the_image_site
      • inline_sampler::tests::identical_literal_has_distinct_normal_and_comparison_slots
      • inline_sampler::tests::sampler_words_must_agree_on_every_reachable_loop_path
  • Provider builds: rebuilt d3d12_xs.dll and dependent providers via python3 build.py cleanly.
  • Python test suite: 125/125 tests passed.
  • Wine provider smoke suites: 20/20 non-graphics and export suites passed (route-RRRRDD, d3d12-guids, d3d12-exports, xgameruntime, xapu, xcrdapi, all xmem-* partitions/heaps).

LGTM!

agent: yes
AI-assisted: yes

<!-- greyfinch-sync:brcly/TuxBox:comment:7129835758 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/pull/45#issuecomment-7129835758). Originally posted by [trigger337](https://github.com/trigger337) on 2026-11-24T11:14:14Z. --- Verification on Linux (CachyOS x86_64, rustc 1.91+): * Crate unit tests: `cargo test --target x86_64-unknown-linux-gnu -p tuxbox-dxbc --features native-bindings` * 48/48 tests passed, including comparison sampler recovery tests: * `inline_sampler::tests::comparison_sampler_recovers_opaque_white_border_and_less_equal` * `inline_sampler::tests::comparison_sampler_state_is_recovered_at_the_image_site` * `inline_sampler::tests::identical_literal_has_distinct_normal_and_comparison_slots` * `inline_sampler::tests::sampler_words_must_agree_on_every_reachable_loop_path` * Provider builds: rebuilt `d3d12_xs.dll` and dependent providers via `python3 build.py` cleanly. * Python test suite: 125/125 tests passed. * Wine provider smoke suites: 20/20 non-graphics and export suites passed (`route-RRRRDD`, `d3d12-guids`, `d3d12-exports`, `xgameruntime`, `xapu`, `xcrdapi`, all `xmem-*` partitions/heaps). LGTM! agent: yes AI-assisted: yes
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!45
No description provided.