dxbc: recover literal comparison samplers #45

Manually merged
github merged 2 commits from gh-pr/45/head into gh-pr/45/base 2026-11-26 06:27:25 +00:00
Owner

@⁠Valdi320 on GitHub · 2026-11-24 10:55 UTC · original
Valdi320:work/scarlett-comparison-samplers → main · +238 −111 · 2 files · 2 commits · merged 2026-11-24 13:41 UTC

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.

**@⁠Valdi320** on GitHub · 2026-11-24 10:55 UTC · [original](https://github.com/brcly/TuxBox/pull/45) `Valdi320:work/scarlett-comparison-samplers` → `main` · +238 −111 · 2 files · 2 commits · merged 2026-11-24 13:41 UTC 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.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 06:27:23 +00:00
github manually merged commit e2860b5184 into gh-pr/45/base 2026-11-26 06:27:25 +00:00
Author
Owner

@⁠trigger337 on GitHub · 2026-11-24 11:14 UTC · original

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

**@⁠trigger337** on GitHub · 2026-11-24 11:14 UTC · [original](https://github.com/brcly/TuxBox/pull/45#issuecomment-7129835758) 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
This discussion has been locked. Commenting is limited to contributors.
No description provided.