startup: sanitize D3D12 sampler descriptions before they reach the desktop device #3199

Open
tedin7 wants to merge 6 commits from upstream-pr/3199 into main
tedin7 commented 2026-11-27 21:29:52 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-27T21:29:52Z.


Part of #870

What this unblocks: title and translated samplers no longer reach the desktop device with values D3D12 rejects, so real GPUs and the debug layer stop failing those draws.

Console sampler descriptions can carry values that D3D12 does not accept: an anisotropic filter with MaxAnisotropy 0 or above 16, MinLOD above MaxLOD, a MipLODBias outside [-16, 15.99], a comparison filter with no valid comparison function, address modes outside 1..5, or border colors outside [0, 1] (see "D3D12_SAMPLER_DESC (d3d12.h)" and "D3D12_STATIC_SAMPLER_DESC (d3d12.h)" on Microsoft Learn). WARP is lenient with several of these; the debug layer and hardware drivers are not.

The new header src/startup_stubs/sampler_desc_check.h repairs such a description on a copy and keeps every field the selected filter ignores. It runs at:

  • title CreateSampler (device slot 22); an unreadable description is refused instead of forwarded,
  • translated static samplers (decode_statics) and dynamic samplers (dynamic_sampler),
  • sampler snapshot heaps, including the reserved fallback entry,
  • the plane compositor's static sampler.

A reversed LOD pair takes MinLOD = MaxLOD: min(max(lod, MinLOD), MaxLOD) already yields MaxLOD for every lod, so the sampled result does not change. The decoder still reports both title fields unchanged.

Tests:

  • startup_sampler_desc_check (CPU): valid descriptions stay byte-identical; each invalid field is repaired and reported, for dynamic and static samplers.
  • startup_sampler_device_warp (title CreateSampler calls through the shim on a WARP device with the debug layer on; passes only with zero debug-layer errors and no device removal; without the new check at slot 22 the debug layer rejects MaxAnisotropy 64, MipLODBias 20 and AddressU 0 and removes the WARP device, see Verification). startup_sampler_device_hardware skips (77) without a hardware adapter.
  • startup_translated_sampler_bindings and startup_sampler_comparison updated: a reversed dynamic or static LOD pair now has MinLOD = MaxLOD; the first smpl fixture uses an ordered pair so both fields keep their decode check.

Verification:

  • x86_64-w64-mingw32-g++ -std=c++20 -fsyntax-only -Isrc tests/startup_sampler_desc_check.cpp -> OK
  • x86_64-w64-mingw32-g++ -std=c++20 -fsyntax-only -Isrc tests/startup_sampler_device.cpp -> OK
  • x86_64-w64-mingw32-g++ -std=c++20 -fsyntax-only -Isrc -x c++ -include d3d12.h src/startup_stubs/plane_compositor.h -> OK
  • cmake -S . -B <tmp> -G Ninja -DDXC_EXECUTABLE=/bin/true -> configure OK
  • python3 tests/bidi_controls_check.py -> passed
  • Win2025 (Build 26100, MSVC 14.44, D3D12 WARP) at 771ba414, targets d3d12_xs_device_obj d3d12_xs_shim d3d12x_device_check native_recording_check offscreen_check startup_sampler_comparison_check startup_sampler_desc_check startup_sampler_device startup_translated_sampler_bindings_check startup_present_composite_warp:
    • dev: ctest --preset dev -R 'sampler|^startup_present_composite_warp$|native_recording|binding_mips' -> 34/38 passed, 4 skipped (SPIR-V sampler tests matched by the regex, not built in this target set)
    • release (/O2): same regex -> 34/38 passed, same 4 skipped
    • fails before: the same head with only the slot 22 check reverted (tests kept), ctest --preset dev -R '^startup_sampler_device_warp$' -> 0/1 passed (debug errors=4 removed=0x887a0001)

Draft until an independent peer review and the Win2025 WARP gate pass.

Thanks to @Makto94 for the testing that found this.

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:5533324385 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3199). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-27T21:29:52Z. --- Part of #870 What this unblocks: title and translated samplers no longer reach the desktop device with values D3D12 rejects, so real GPUs and the debug layer stop failing those draws. Console sampler descriptions can carry values that D3D12 does not accept: an anisotropic filter with MaxAnisotropy 0 or above 16, MinLOD above MaxLOD, a MipLODBias outside [-16, 15.99], a comparison filter with no valid comparison function, address modes outside 1..5, or border colors outside [0, 1] (see "D3D12_SAMPLER_DESC (d3d12.h)" and "D3D12_STATIC_SAMPLER_DESC (d3d12.h)" on Microsoft Learn). WARP is lenient with several of these; the debug layer and hardware drivers are not. The new header `src/startup_stubs/sampler_desc_check.h` repairs such a description on a copy and keeps every field the selected filter ignores. It runs at: - title `CreateSampler` (device slot 22); an unreadable description is refused instead of forwarded, - translated static samplers (`decode_statics`) and dynamic samplers (`dynamic_sampler`), - sampler snapshot heaps, including the reserved fallback entry, - the plane compositor's static sampler. A reversed LOD pair takes MinLOD = MaxLOD: `min(max(lod, MinLOD), MaxLOD)` already yields MaxLOD for every lod, so the sampled result does not change. The decoder still reports both title fields unchanged. Tests: - `startup_sampler_desc_check` (CPU): valid descriptions stay byte-identical; each invalid field is repaired and reported, for dynamic and static samplers. - `startup_sampler_device_warp` (title `CreateSampler` calls through the shim on a WARP device with the debug layer on; passes only with zero debug-layer errors and no device removal; without the new check at slot 22 the debug layer rejects MaxAnisotropy 64, MipLODBias 20 and AddressU 0 and removes the WARP device, see Verification). `startup_sampler_device_hardware` skips (77) without a hardware adapter. - `startup_translated_sampler_bindings` and `startup_sampler_comparison` updated: a reversed dynamic or static LOD pair now has MinLOD = MaxLOD; the first smpl fixture uses an ordered pair so both fields keep their decode check. Verification: - `x86_64-w64-mingw32-g++ -std=c++20 -fsyntax-only -Isrc tests/startup_sampler_desc_check.cpp` -> OK - `x86_64-w64-mingw32-g++ -std=c++20 -fsyntax-only -Isrc tests/startup_sampler_device.cpp` -> OK - `x86_64-w64-mingw32-g++ -std=c++20 -fsyntax-only -Isrc -x c++ -include d3d12.h src/startup_stubs/plane_compositor.h` -> OK - `cmake -S . -B <tmp> -G Ninja -DDXC_EXECUTABLE=/bin/true` -> configure OK - `python3 tests/bidi_controls_check.py` -> passed - Win2025 (Build 26100, MSVC 14.44, D3D12 WARP) at `771ba414`, targets `d3d12_xs_device_obj d3d12_xs_shim d3d12x_device_check native_recording_check offscreen_check startup_sampler_comparison_check startup_sampler_desc_check startup_sampler_device startup_translated_sampler_bindings_check startup_present_composite_warp`: - dev: `ctest --preset dev -R 'sampler|^startup_present_composite_warp$|native_recording|binding_mips'` -> 34/38 passed, 4 skipped (SPIR-V sampler tests matched by the regex, not built in this target set) - release (`/O2`): same regex -> 34/38 passed, same 4 skipped - fails before: the same head with only the slot 22 check reverted (tests kept), `ctest --preset dev -R '^startup_sampler_device_warp$'` -> 0/1 passed (`debug errors=4 removed=0x887a0001`) Draft until an independent peer review and the Win2025 WARP gate pass. Thanks to @Makto94 for the testing that found this. AI-assisted; commands listed were executed locally.
tedin7 commented 2026-11-28 10:49:20 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-28T10:49:20Z.


Real-GPU verification (NVIDIA RTX 3070 Ti, driver 32.0.16.2101, Windows 11):

Tested at 771ba41 (current head). dev preset, ctest run one test at a time:

  • ctest on the touched block: 100% tests passed, 0 tests failed out of 38 (the 4 SPIR-V sampler tests spirv_sampler_views_, spirv_compare_sampler_ skipped as expected).
  • Mutant patch applied: 95% passed, 2 of 38 failed, exactly the expected ones: startup_sampler_device_warp, startup_sampler_device_hardware (the debug layer reports DXGI_ERROR_INVALID_CALL on the hardware leg).

These complement the existing WARP runs.

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7238144273 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3199#issuecomment-7238144273). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-28T10:49:20Z. --- Real-GPU verification (NVIDIA RTX 3070 Ti, driver 32.0.16.2101, Windows 11): Tested at 771ba41 (current head). dev preset, ctest run one test at a time: - ctest on the touched block: 100% tests passed, 0 tests failed out of 38 (the 4 SPIR-V sampler tests spirv_sampler_views_*, spirv_compare_sampler_* skipped as expected). - Mutant patch applied: 95% passed, 2 of 38 failed, exactly the expected ones: startup_sampler_device_warp, startup_sampler_device_hardware (the debug layer reports DXGI_ERROR_INVALID_CALL on the hardware leg). These complement the existing WARP runs. AI-assisted; commands listed were executed locally.
chatgpt-codex-connector[bot] commented 2026-11-28 10:49:35 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-28T10:49:35Z.


Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-28T10:53:17.966466Z 771ba41 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7238146854 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3199#issuecomment-7238146854). Originally posted by [chatgpt-codex-connector[bot]](https://github.com/apps/chatgpt-codex-connector) on 2026-11-28T10:49:35Z. --- <!-- codex-pull-request-review-summary --> <!-- codex-review-state:v1 {"code_review":{"commit_sha":"771ba4143a13085d913765e42db4f6c90575a2fc","has_any_findings":true,"has_unresolved_findings":true,"status":"completed"},"security_review":{"commit_sha":null,"has_any_findings":null,"has_unresolved_findings":null,"status":null}} --> <details> <summary><strong>Codex Review Summary</strong>: ✅ Completed</summary> This comment shows the latest Codex review activity on this pull request. | Review | Status | Commit | Review trigger | | --- | --- | --- | --- | | 📝 **Code Review** | ✅ **Completed** <relative-time datetime="2026-11-28T10:53:17.966466Z">2026-11-28T10:53:17.966466Z</relative-time> | `771ba41` | Draft marked ready | <details> <summary>ℹ️ About Codex in GitHub</summary> <br/> [Your team has set up Codex to review pull requests in this repo](https://chatgpt.com/codex/cloud/settings/general). Reviews are triggered when you - Open a pull request for review - Mark a draft as ready - Comment "@codex review" or "@codex security review". Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. </details> </details>
chatgpt-codex-connector[bot] commented 2026-11-28 10:53:15 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-28T10:53:15Z.

Review: COMMENTED


💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 771ba4143a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6097324882 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3199#pullrequestreview-6097324882). Originally posted by [chatgpt-codex-connector[bot]](https://github.com/apps/chatgpt-codex-connector) on 2026-11-28T10:53:15Z. **Review:** COMMENTED --- <!-- codex-review-receipt:v1 --> ### 💡 Codex Review Here are some automated review suggestions for this pull request. **Reviewed commit:** `771ba4143a` <details> <summary>ℹ️ About Codex in GitHub</summary> <br/> [Your team has set up Codex to review pull requests in this repo](https://chatgpt.com/codex/cloud/settings/general). Reviews are triggered when you - Open a pull request for review - Mark a draft as ready - Comment "@codex review". If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". </details>
chatgpt-codex-connector[bot] commented 2026-11-28 10:53:15 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-28T10:53:15Z.

Code review location: src/startup_stubs/sampler_desc_check.h; line 24

@@ -0,0 +1,64 @@
+#pragma once
+
+#include <d3d12.h>
+#include <algorithm>
+#include <cmath>
+#include <cstdint>
+
+namespace x2w_startup {
+enum SamplerRepair : unsigned {
+    sampler_filter = 1, sampler_anisotropy = 2, sampler_lod = 4, sampler_bias = 8,
+    sampler_comparison = 16, sampler_address = 32, sampler_border = 64
+};
+
+// D3D12_SAMPLER_DESC and D3D12_COMPARISON_FUNC: preserve fields that are
+// ignored by the selected filter. The filter encoding has three one-bit
+// basic filters, or the anisotropic encoding, plus two reduction bits.
+template<class Desc> inline unsigned sanitize_sampler_common(Desc& s)
+{
+    unsigned changed = 0;
+    unsigned filter = static_cast<unsigned>(s.Filter);
+    const unsigned basic = filter & ~0x180u;
+    if ((filter & ~0x1d5u) || (basic != 0x55u && (basic & ~0x15u))) {
+        filter = (filter & 0x180u) | 0x15u;
+        s.Filter = static_cast<D3D12_FILTER>(filter);

P2 Badge Preserve anisotropic filters with point mip sampling

On a device advertising AnisoFilterWithPointMipSupported, D3D12_FILTER_MIN_MAG_ANISOTROPIC_MIP_POINT (0x54) and its reduction variants are valid filters. This predicate rejects those encodings, so a valid sampler submitted through device slot 22 is now rewritten to 0x15 (or its reduction variant), removing anisotropy and replacing point mip selection with linear mip blending. Recognize both 0x54 and 0x55 as anisotropic base encodings, including in the subsequent anisotropy-range check, so sanitization preserves valid sampling behavior.

Useful? React with 👍 / 👎.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review-comment:4726650975 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3199#discussion_r4726650975). Originally posted by [chatgpt-codex-connector[bot]](https://github.com/apps/chatgpt-codex-connector) on 2026-11-28T10:53:15Z. **Code review location:** `src/startup_stubs/sampler_desc_check.h`; line 24 ~~~~diff @@ -0,0 +1,64 @@ +#pragma once + +#include <d3d12.h> +#include <algorithm> +#include <cmath> +#include <cstdint> + +namespace x2w_startup { +enum SamplerRepair : unsigned { + sampler_filter = 1, sampler_anisotropy = 2, sampler_lod = 4, sampler_bias = 8, + sampler_comparison = 16, sampler_address = 32, sampler_border = 64 +}; + +// D3D12_SAMPLER_DESC and D3D12_COMPARISON_FUNC: preserve fields that are +// ignored by the selected filter. The filter encoding has three one-bit +// basic filters, or the anisotropic encoding, plus two reduction bits. +template<class Desc> inline unsigned sanitize_sampler_common(Desc& s) +{ + unsigned changed = 0; + unsigned filter = static_cast<unsigned>(s.Filter); + const unsigned basic = filter & ~0x180u; + if ((filter & ~0x1d5u) || (basic != 0x55u && (basic & ~0x15u))) { + filter = (filter & 0x180u) | 0x15u; + s.Filter = static_cast<D3D12_FILTER>(filter); ~~~~ --- **<sub><sub>![P2 Badge](https://img.shields.io/badge/P2-yellow?style=flat)</sub></sub> Preserve anisotropic filters with point mip sampling** On a device advertising `AnisoFilterWithPointMipSupported`, `D3D12_FILTER_MIN_MAG_ANISOTROPIC_MIP_POINT` (0x54) and its reduction variants are valid filters. This predicate rejects those encodings, so a valid sampler submitted through device slot 22 is now rewritten to 0x15 (or its reduction variant), removing anisotropy and replacing point mip selection with linear mip blending. Recognize both 0x54 and 0x55 as anisotropic base encodings, including in the subsequent anisotropy-range check, so sanitization preserves valid sampling behavior. Useful? React with 👍 / 👎. <!-- codex-code-review-finding:v1 -->
tedin7 commented 2026-11-28 11:10:40 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-28T11:10:40Z.

Code review location: src/startup_stubs/sampler_desc_check.h; line 24

@@ -0,0 +1,64 @@
+#pragma once
+
+#include <d3d12.h>
+#include <algorithm>
+#include <cmath>
+#include <cstdint>
+
+namespace x2w_startup {
+enum SamplerRepair : unsigned {
+    sampler_filter = 1, sampler_anisotropy = 2, sampler_lod = 4, sampler_bias = 8,
+    sampler_comparison = 16, sampler_address = 32, sampler_border = 64
+};
+
+// D3D12_SAMPLER_DESC and D3D12_COMPARISON_FUNC: preserve fields that are
+// ignored by the selected filter. The filter encoding has three one-bit
+// basic filters, or the anisotropic encoding, plus two reduction bits.
+template<class Desc> inline unsigned sanitize_sampler_common(Desc& s)
+{
+    unsigned changed = 0;
+    unsigned filter = static_cast<unsigned>(s.Filter);
+    const unsigned basic = filter & ~0x180u;
+    if ((filter & ~0x1d5u) || (basic != 0x55u && (basic & ~0x15u))) {
+        filter = (filter & 0x180u) | 0x15u;
+        s.Filter = static_cast<D3D12_FILTER>(filter);

Valid, fixed in 122ddf3c4 on up-sampler-sanitize. sampler_desc_check.h now treats both 0x55 and 0x54 (anisotropic with a point mip filter, plus the reduction bits) as anisotropic. Both the filter-shape check and the MaxAnisotropy range check use the same predicate, so a valid 0x54 sampler keeps its filter and its anisotropy.

Test: startup_sampler_desc_check.cpp has two new cases, an untouched 0x54 and 0x154 (minimum reduction) description, and a 0x54 sampler with MaxAnisotropy = 0 that is clamped to 1 while the filter stays 0x54.

Gate on aws-1 with WARP (x2w_pipe.py win2025 3199 --host aws-1 --regex startup_sampler --force, head 122ddf3c): dev and release 17/17 passed. Mutant (the old == 0x55 predicate), run after the main gate: startup_sampler_desc_check fails in dev and release.

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review-comment:4726717162 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3199#discussion_r4726717162). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-28T11:10:40Z. **Code review location:** `src/startup_stubs/sampler_desc_check.h`; line 24 ~~~~diff @@ -0,0 +1,64 @@ +#pragma once + +#include <d3d12.h> +#include <algorithm> +#include <cmath> +#include <cstdint> + +namespace x2w_startup { +enum SamplerRepair : unsigned { + sampler_filter = 1, sampler_anisotropy = 2, sampler_lod = 4, sampler_bias = 8, + sampler_comparison = 16, sampler_address = 32, sampler_border = 64 +}; + +// D3D12_SAMPLER_DESC and D3D12_COMPARISON_FUNC: preserve fields that are +// ignored by the selected filter. The filter encoding has three one-bit +// basic filters, or the anisotropic encoding, plus two reduction bits. +template<class Desc> inline unsigned sanitize_sampler_common(Desc& s) +{ + unsigned changed = 0; + unsigned filter = static_cast<unsigned>(s.Filter); + const unsigned basic = filter & ~0x180u; + if ((filter & ~0x1d5u) || (basic != 0x55u && (basic & ~0x15u))) { + filter = (filter & 0x180u) | 0x15u; + s.Filter = static_cast<D3D12_FILTER>(filter); ~~~~ --- Valid, fixed in 122ddf3c4 on `up-sampler-sanitize`. `sampler_desc_check.h` now treats both `0x55` and `0x54` (anisotropic with a point mip filter, plus the reduction bits) as anisotropic. Both the filter-shape check and the `MaxAnisotropy` range check use the same predicate, so a valid `0x54` sampler keeps its filter and its anisotropy. Test: `startup_sampler_desc_check.cpp` has two new cases, an untouched `0x54` and `0x154` (minimum reduction) description, and a `0x54` sampler with `MaxAnisotropy = 0` that is clamped to 1 while the filter stays `0x54`. Gate on aws-1 with WARP (`x2w_pipe.py win2025 3199 --host aws-1 --regex startup_sampler --force`, head 122ddf3c): dev and release 17/17 passed. Mutant (the old `== 0x55` predicate), run after the main gate: `startup_sampler_desc_check` fails in dev and release. AI-assisted; commands listed were executed locally.
tedin7 commented 2026-11-28 22:08:01 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-28T22:08:01Z.


Merged current main into this branch (merge commit, no force push, no conflicts); head is now 32754bec2. The anisotropic-filter finding was already fixed in 122ddf3c4.

Verification (Windows Server 2025, D3D12 WARP, head 32754bec2): x2w_pipe.py win2025 3199 --regex '^startup_sampler_' -> 17/17 passed.

@MasterDomino ready for review and merge when you have time.

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7246519052 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3199#issuecomment-7246519052). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-28T22:08:01Z. --- Merged current `main` into this branch (merge commit, no force push, no conflicts); head is now `32754bec2`. The anisotropic-filter finding was already fixed in `122ddf3c4`. Verification (Windows Server 2025, D3D12 WARP, head `32754bec2`): `x2w_pipe.py win2025 3199 --regex '^startup_sampler_'` -> 17/17 passed. @MasterDomino ready for review and merge when you have time. AI-assisted; commands listed were executed locally.
Alexofbulgaria commented 2026-11-29 05:15:48 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by Alexofbulgaria on 2026-11-29T05:15:48Z.


Windows Arc A770 validation at 32754bec

I built a clean, separate checkout of exact head 32754bec269122fecb55505b9d007fea35568a7b, Release, with MSVC 19.44.35230 and Windows SDK 10.0.26100.0. Windows 26300.10075, Intel Arc A770 8086:56a0, driver 32.0.101.9175. WARP runtime 10.0.26100.10068.

Test Result
startup_sampler_desc_check Passed
startup_sampler_device_hardware Passed on the A770, debug errors=0, removed=0x00000000
startup_sampler_device_warp Passed on Microsoft WARP, debug errors=0, removed=0x00000000

Each ran once, serially, with zero skips. Both device logs explicitly show the D3D12 debug layer enabled and build=32754bec. The descriptor control verifies byte-identical valid anisotropic descriptions, including 0x54 and 0x154, and the invalid-0x54 anisotropy clamp. Warning counts were not measured; the device fixture counts corruption/errors. This checks descriptor preservation and sampler creation, without claiming rendered sampler-output coverage.

I configured with CMAKE_TRY_COMPILE_CONFIGURATION=Release, built only startup_sampler_desc_check and startup_sampler_device, and ran each registered test with ctest --test-dir <build> --no-tests=error -R '^<test>$' -j1 -V. Source remained clean. Raw logs, JUnit results, environment and binary hashes are preserved locally.

AI-assisted: yes.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7251148638 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3199#issuecomment-7251148638). Originally posted by [Alexofbulgaria](https://github.com/Alexofbulgaria) on 2026-11-29T05:15:48Z. --- ### Windows Arc A770 validation at `32754bec` I built a clean, separate checkout of exact head **`32754bec269122fecb55505b9d007fea35568a7b`**, Release, with MSVC 19.44.35230 and Windows SDK 10.0.26100.0. Windows `26300.10075`, Intel Arc A770 `8086:56a0`, driver `32.0.101.9175`. WARP runtime `10.0.26100.10068`. | Test | Result | | --- | --- | | `startup_sampler_desc_check` | Passed | | `startup_sampler_device_hardware` | Passed on the A770, debug errors=0, removed=`0x00000000` | | `startup_sampler_device_warp` | Passed on Microsoft WARP, debug errors=0, removed=`0x00000000` | Each ran once, serially, with **zero skips**. Both device logs explicitly show the D3D12 debug layer enabled and `build=32754bec`. The descriptor control verifies byte-identical valid anisotropic descriptions, including `0x54` and `0x154`, and the invalid-`0x54` anisotropy clamp. Warning counts were not measured; the device fixture counts corruption/errors. This checks descriptor preservation and sampler creation, without claiming rendered sampler-output coverage. I configured with `CMAKE_TRY_COMPILE_CONFIGURATION=Release`, built only `startup_sampler_desc_check` and `startup_sampler_device`, and ran each registered test with `ctest --test-dir <build> --no-tests=error -R '^<test>$' -j1 -V`. Source remained clean. Raw logs, JUnit results, environment and binary hashes are preserved locally. AI-assisted: yes.
pigalot commented 2026-11-29 08:45:59 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by pigalot on 2026-11-29T08:45:59Z.

Review: CHANGES_REQUESTED


Independently reviewed 32754bec integrated over main ae45c4ff (tree 23db61ae). The trial merge is clean and git diff --check is clean.

I traced sanitize_sampler_common against the D3D12 filter encoding and the documented D3D12_SAMPLER_DESC ranges, the slot 22 hook in view_slot, and the four call sites in translated_sampler_bindings.h and plane_compositor.h. I also ran a small standalone probe that calls ID3D12Device::CreateSampler directly, one description per process, to see what the runtime does with descriptions the sanitizer leaves alone.

Blocking: a non-anisotropic filter with MaxAnisotropy above 16 still removes the device.
sanitize_sampler_common clamps MaxAnisotropy only when the filter is anisotropic, on the reasoning that other filters ignore the field. The runtime validates it for every filter:

  • Probe, Filter = MIN_MAG_MIP_LINEAR, MaxAnisotropy = 64, everything else valid: ID3D12Device::CreateSampler2: MaxAnisotropy must be in the range [0 to 16]. 64 specified., then GetDeviceRemovedReason() = 0x887a0001. Same result on WARP and on the RTX 5090, with the debug layer on and with it off (off: no message, the device is still removed).
  • Through the shim at this head: adding one line to tests/startup_sampler_device.cpp, cases[6].MaxAnisotropy = 64; (case 6 is otherwise the valid linear description), makes startup_sampler_device_warp and startup_sampler_device_hardware fail with debug errors=2 removed=0x887a0001. The shim logs no repair for that case.

So a title or translated sampler can still reach the desktop device with a value D3D12 rejects, through the same field this PR handles. Suggested direction (I have not built it): clamp MaxAnisotropy > 16 to 16 for every filter, keep the < 1 repair for anisotropic filters only (the runtime accepts 0), and add the linear case to both startup_sampler_desc_check and startup_sampler_device.

Non-blocking notes

  1. Filter shape is half pinned. Removing the (!anisotropic(filter) && (basic & ~0x15u)) clause passes all three CPU tests: the two invalid filters in the tests (0x182, 0x82) are both caught by the other clause. A filter such as 0x40 or 0x50 (anisotropic bit without the full encoding) would pin it; the probe shows the runtime rejects 0x40 ("Filter unrecognized", device removed). With that clause in place the first clause, (filter & ~0x1d5u), is redundant: every value it catches is also caught by the second.
  2. Border colours. On WARP and the RTX 5090 with the debug layer on, CreateSampler accepts border components of 2.0, -1.0 and NaN with no message and no removal. The clamp to [0, 1] follows the documented range, but it is not needed to keep the device alive, and it changes the border value for a title that uses an out-of-range one with a float format. Worth a sentence in the header on why it is clamped, or dropping the clamp for finite values. The same probe shows the runtime also accepts anisotropic with MaxAnisotropy = 0, MinLOD > MaxLOD and a comparison filter with function 0; those repairs are harmless, but the device test cannot tell them apart from no repair (the negative control reports 4 errors: MaxAnisotropy 64, MipLODBias 20, AddressU 0, plus the removal).
  3. Filter 0x54 is kept, which is right where AnisoFilterWithPointMipSupported is set (it is on both adapters here). On a device without it the description is forwarded unchanged; I could not test such a device.
  4. Untested paths: no test passes a null or unreadable description to slot 22, and no test puts an out-of-range description through create_sampler_snapshot_heap or its reserved fallback entry (see the surviving mutants).
  5. The PR body still ends with "Draft until an independent peer review and the Win2025 WARP gate pass", and the first commit subject uses fix: rather than an area prefix; the PR title is fine.

Tests. Built startup_sampler_desc_check startup_sampler_device startup_sampler_comparison_check startup_translated_sampler_bindings_check d3d12_xs_shim offscreen_check d3d12x_device_check startup_present_composite_warp in dev and release.

  • dev: startup_sampler_desc_check, startup_sampler_comparison, startup_translated_sampler_bindings 3/3 passed; startup_sampler_device_warp passed (debug errors=0 removed=0x00000000); startup_sampler_device_hardware passed on the RTX 5090.
  • release (/O2): ctest --test-dir out/build/release --no-tests=error -j 1 -R '^(startup_sampler_desc_check|startup_sampler_comparison|startup_translated_sampler_bindings|startup_translated_sampler_bindings_shared_axis_control|startup_sampler_device_warp|startup_sampler_heap_warp|startup_sampler_heap_wrapped_warp|startup_sampler_lod_warp|startup_sampler_lod_dropped_warp|mesh_heap_sampler_draw_warp|startup_present_composite_warp|startup_sampler_x_warp|dynamic_sampler_index_warp|d3d12x_pso_static_sampler_warp)$' -> 14/14 passed, no skips; startup_sampler_device_hardware (-j 1) passed, debug errors=0 removed=0x00000000.
  • The two new tests are not registered on main ae45c4ff.
  • Negative control: with args[0] = reinterpret_cast<u64>(&repaired_sampler); removed from slot 22, startup_sampler_device_warp fails with debug errors=4 removed=0x887a0001 and startup_sampler_device_hardware fails too. This matches the PR body.

Mutants (dev; each applied alone, sources restored, git diff --quiet clean afterwards).

  • Killed, 24:
    • by startup_sampler_desc_check: anisotropic predicate back to == 0x55; filter repair drops the reduction bits; anisotropy upper bound 16 -> 32; anisotropy lower bound off; anisotropy clamp applied to every filter; NaN MinLOD not reset; NaN MaxLOD not reset; NaN bias not reset; bias minimum clamp off; bias maximum clamp off; comparison filter accepts function 0; non-comparison upper bound 8 -> 9; comparison repair picks NEVER; address lower bound off; address upper bound 5 -> 6; AddressV unchecked; AddressW unchecked; border low clamp off; border high clamp off;
    • by all three CPU tests: reversed LOD not repaired; reversed LOD takes MaxLOD = MinLOD;
    • by startup_sampler_comparison: decode_statics not sanitized;
    • by startup_translated_sampler_bindings: dynamic_sampler not sanitized;
    • by startup_sampler_device_warp and _hardware: slot 22 forwards the title description (the negative control above).
  • Surviving, 4:
    • filter check without the (basic & ~0x15u) clause (note 1);
    • slot 22 null check removed (sampler && instead of !sampler ||): startup_sampler_device_hardware still passes, since no test passes null;
    • snapshot heap entries not sanitized: the 8 WARP sampler tests (startup_sampler_device, startup_sampler_heap, startup_sampler_heap_wrapped, startup_sampler_lod, startup_sampler_lod_dropped, mesh_heap_sampler_draw, startup_sampler_x, dynamic_sampler_index) pass;
    • reserved fallback entry not sanitized: the same 8 pass.
  • Equivalent, 2:
    • filter check without the (filter & ~0x1d5u) clause (note 1);
    • compositor static sampler not sanitized: that description is a valid constant, so the call changes nothing.

Title run (prwatch job 24, head merged onto the baseline commit): flaky. It failed once and passed on the re-run (job 27), so it does not block on its own.

Environment: Windows 11 25H2 build 26200.9974; MSVC 19.52.37029; Python 3.12.10; NVIDIA GeForce RTX 5090, driver 32.0.16.1088; Microsoft Basic Render Driver (WARP); D3D12 debug layer on (X2W_TEST_DEBUG_LAYER=1, and the fixture's own X2W_D3D12_DEBUG=1).
CI: Build and test on Windows passed on 32754bec.

This reply was AI-assisted.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6102137508 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3199#pullrequestreview-6102137508). Originally posted by [pigalot](https://github.com/pigalot) on 2026-11-29T08:45:59Z. **Review:** CHANGES_REQUESTED --- Independently reviewed `32754bec` integrated over `main` `ae45c4ff` (tree `23db61ae`). The trial merge is clean and `git diff --check` is clean. I traced `sanitize_sampler_common` against the D3D12 filter encoding and the documented `D3D12_SAMPLER_DESC` ranges, the slot 22 hook in `view_slot`, and the four call sites in `translated_sampler_bindings.h` and `plane_compositor.h`. I also ran a small standalone probe that calls `ID3D12Device::CreateSampler` directly, one description per process, to see what the runtime does with descriptions the sanitizer leaves alone. **Blocking: a non-anisotropic filter with `MaxAnisotropy` above 16 still removes the device.** `sanitize_sampler_common` clamps `MaxAnisotropy` only when the filter is anisotropic, on the reasoning that other filters ignore the field. The runtime validates it for every filter: - Probe, `Filter = MIN_MAG_MIP_LINEAR`, `MaxAnisotropy = 64`, everything else valid: `ID3D12Device::CreateSampler2: MaxAnisotropy must be in the range [0 to 16]. 64 specified.`, then `GetDeviceRemovedReason()` = `0x887a0001`. Same result on WARP and on the RTX 5090, with the debug layer on and with it off (off: no message, the device is still removed). - Through the shim at this head: adding one line to `tests/startup_sampler_device.cpp`, `cases[6].MaxAnisotropy = 64;` (case 6 is otherwise the valid linear description), makes `startup_sampler_device_warp` and `startup_sampler_device_hardware` fail with `debug errors=2 removed=0x887a0001`. The shim logs no repair for that case. So a title or translated sampler can still reach the desktop device with a value D3D12 rejects, through the same field this PR handles. Suggested direction (I have not built it): clamp `MaxAnisotropy > 16` to 16 for every filter, keep the `< 1` repair for anisotropic filters only (the runtime accepts 0), and add the linear case to both `startup_sampler_desc_check` and `startup_sampler_device`. **Non-blocking notes** 1. Filter shape is half pinned. Removing the `(!anisotropic(filter) && (basic & ~0x15u))` clause passes all three CPU tests: the two invalid filters in the tests (`0x182`, `0x82`) are both caught by the other clause. A filter such as `0x40` or `0x50` (anisotropic bit without the full encoding) would pin it; the probe shows the runtime rejects `0x40` ("Filter unrecognized", device removed). With that clause in place the first clause, `(filter & ~0x1d5u)`, is redundant: every value it catches is also caught by the second. 2. Border colours. On WARP and the RTX 5090 with the debug layer on, `CreateSampler` accepts border components of 2.0, -1.0 and NaN with no message and no removal. The clamp to [0, 1] follows the documented range, but it is not needed to keep the device alive, and it changes the border value for a title that uses an out-of-range one with a float format. Worth a sentence in the header on why it is clamped, or dropping the clamp for finite values. The same probe shows the runtime also accepts anisotropic with `MaxAnisotropy = 0`, `MinLOD > MaxLOD` and a comparison filter with function 0; those repairs are harmless, but the device test cannot tell them apart from no repair (the negative control reports 4 errors: `MaxAnisotropy 64`, `MipLODBias 20`, `AddressU 0`, plus the removal). 3. Filter `0x54` is kept, which is right where `AnisoFilterWithPointMipSupported` is set (it is on both adapters here). On a device without it the description is forwarded unchanged; I could not test such a device. 4. Untested paths: no test passes a null or unreadable description to slot 22, and no test puts an out-of-range description through `create_sampler_snapshot_heap` or its reserved fallback entry (see the surviving mutants). 5. The PR body still ends with "Draft until an independent peer review and the Win2025 WARP gate pass", and the first commit subject uses `fix:` rather than an area prefix; the PR title is fine. **Tests.** Built `startup_sampler_desc_check startup_sampler_device startup_sampler_comparison_check startup_translated_sampler_bindings_check d3d12_xs_shim offscreen_check d3d12x_device_check startup_present_composite_warp` in `dev` and `release`. - `dev`: `startup_sampler_desc_check`, `startup_sampler_comparison`, `startup_translated_sampler_bindings` 3/3 passed; `startup_sampler_device_warp` passed (`debug errors=0 removed=0x00000000`); `startup_sampler_device_hardware` passed on the RTX 5090. - `release` (`/O2`): `ctest --test-dir out/build/release --no-tests=error -j 1 -R '^(startup_sampler_desc_check|startup_sampler_comparison|startup_translated_sampler_bindings|startup_translated_sampler_bindings_shared_axis_control|startup_sampler_device_warp|startup_sampler_heap_warp|startup_sampler_heap_wrapped_warp|startup_sampler_lod_warp|startup_sampler_lod_dropped_warp|mesh_heap_sampler_draw_warp|startup_present_composite_warp|startup_sampler_x_warp|dynamic_sampler_index_warp|d3d12x_pso_static_sampler_warp)$'` -> 14/14 passed, no skips; `startup_sampler_device_hardware` (`-j 1`) passed, `debug errors=0 removed=0x00000000`. - The two new tests are not registered on `main` `ae45c4ff`. - Negative control: with `args[0] = reinterpret_cast<u64>(&repaired_sampler);` removed from slot 22, `startup_sampler_device_warp` fails with `debug errors=4 removed=0x887a0001` and `startup_sampler_device_hardware` fails too. This matches the PR body. **Mutants** (`dev`; each applied alone, sources restored, `git diff --quiet` clean afterwards). - Killed, 24: - by `startup_sampler_desc_check`: anisotropic predicate back to `== 0x55`; filter repair drops the reduction bits; anisotropy upper bound 16 -> 32; anisotropy lower bound off; anisotropy clamp applied to every filter; NaN `MinLOD` not reset; NaN `MaxLOD` not reset; NaN bias not reset; bias minimum clamp off; bias maximum clamp off; comparison filter accepts function 0; non-comparison upper bound 8 -> 9; comparison repair picks `NEVER`; address lower bound off; address upper bound 5 -> 6; `AddressV` unchecked; `AddressW` unchecked; border low clamp off; border high clamp off; - by all three CPU tests: reversed LOD not repaired; reversed LOD takes `MaxLOD = MinLOD`; - by `startup_sampler_comparison`: `decode_statics` not sanitized; - by `startup_translated_sampler_bindings`: `dynamic_sampler` not sanitized; - by `startup_sampler_device_warp` and `_hardware`: slot 22 forwards the title description (the negative control above). - Surviving, 4: - filter check without the `(basic & ~0x15u)` clause (note 1); - slot 22 null check removed (`sampler &&` instead of `!sampler ||`): `startup_sampler_device_hardware` still passes, since no test passes null; - snapshot heap entries not sanitized: the 8 WARP sampler tests (`startup_sampler_device`, `startup_sampler_heap`, `startup_sampler_heap_wrapped`, `startup_sampler_lod`, `startup_sampler_lod_dropped`, `mesh_heap_sampler_draw`, `startup_sampler_x`, `dynamic_sampler_index`) pass; - reserved fallback entry not sanitized: the same 8 pass. - Equivalent, 2: - filter check without the `(filter & ~0x1d5u)` clause (note 1); - compositor static sampler not sanitized: that description is a valid constant, so the call changes nothing. Title run (prwatch job 24, head merged onto the baseline commit): flaky. It failed once and passed on the re-run (job 27), so it does not block on its own. Environment: Windows 11 25H2 build 26200.9974; MSVC 19.52.37029; Python 3.12.10; NVIDIA GeForce RTX 5090, driver 32.0.16.1088; Microsoft Basic Render Driver (WARP); D3D12 debug layer on (`X2W_TEST_DEBUG_LAYER=1`, and the fixture's own `X2W_D3D12_DEBUG=1`). CI: `Build and test on Windows` passed on `32754bec`. This reply was AI-assisted.
JohnConnorNPC commented 2026-11-29 13:05:07 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by JohnConnorNPC on 2026-11-29T13:05:07Z.


Review of head 32754bec against main 94b679e7. I read the source and ran trial merges only; I did not build or run anything. git merge-tree --write-tree origin/main 32754bec exits 0. main has not touched translated_sampler_bindings.h or plane_compositor.h since the branch's merge base.

Status: pigalot's change request on this head is still open, with no push or reply since. In that finding, a non-anisotropic filter with MaxAnisotropy above 16 still removes the device. That holds the merge, so I am not merging. I have nothing to add to it.

SHOULD

  1. Repairs on the translated paths are silent. Slot 22 logs each repaired field (x2w-d3d12 sampler repaired: %s). The other four call sites drop the mask that sanitize_sampler* returns:

    • sanitize_static_sampler(sampler); in decode_statics
    • sanitize_sampler(result); in dynamic_sampler
    • the two sanitize_sampler(sampler); calls in create_sampler_snapshot_heap

    All four run for translated draws on the default launcher path, with no switch. A sampler-word decode bug (an address mode or filter decoded wrong) now becomes CLAMP or trilinear and leaves no trace. On main the bad value at least reached the desktop device, where the debug layer or a device removal showed it. Could these sites count the repairs, or log the first few per field as slot 22 does, so a decode bug stays visible?

NIT

  1. This PR and #3200 change the same lines in view_slot. Both insert right after if (default_view) args[desc_index] = 0;. With either one merged onto main, the other conflicts in src/startup_stubs/d3d12_xs_device.cpp (trial merges both ways). Whichever goes second needs a merge.

AI-assisted.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7256277049 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3199#issuecomment-7256277049). Originally posted by [JohnConnorNPC](https://github.com/JohnConnorNPC) on 2026-11-29T13:05:07Z. --- Review of head `32754bec` against `main` `94b679e7`. I read the source and ran trial merges only; I did not build or run anything. `git merge-tree --write-tree origin/main 32754bec` exits 0. `main` has not touched `translated_sampler_bindings.h` or `plane_compositor.h` since the branch's merge base. Status: pigalot's change request on this head is still open, with no push or reply since. In that finding, a non-anisotropic filter with `MaxAnisotropy` above 16 still removes the device. That holds the merge, so I am not merging. I have nothing to add to it. **SHOULD** 1. **Repairs on the translated paths are silent.** Slot 22 logs each repaired field (`x2w-d3d12 sampler repaired: %s`). The other four call sites drop the mask that `sanitize_sampler*` returns: - `sanitize_static_sampler(sampler);` in `decode_statics` - `sanitize_sampler(result);` in `dynamic_sampler` - the two `sanitize_sampler(sampler);` calls in `create_sampler_snapshot_heap` All four run for translated draws on the default launcher path, with no switch. A sampler-word decode bug (an address mode or filter decoded wrong) now becomes `CLAMP` or trilinear and leaves no trace. On `main` the bad value at least reached the desktop device, where the debug layer or a device removal showed it. Could these sites count the repairs, or log the first few per field as slot 22 does, so a decode bug stays visible? **NIT** 2. This PR and #3200 change the same lines in `view_slot`. Both insert right after `if (default_view) args[desc_index] = 0;`. With either one merged onto `main`, the other conflicts in `src/startup_stubs/d3d12_xs_device.cpp` (trial merges both ways). Whichever goes second needs a merge. AI-assisted.
tedin7 commented 2026-11-30 13:58:58 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-30T13:58:58Z.


Fixed anisotropy handling, added repair logging, and added a regression test covering the anisotropy fix. Ready for CI and re-review.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7280655129 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3199#issuecomment-7280655129). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-30T13:58:58Z. --- Fixed anisotropy handling, added repair logging, and added a regression test covering the anisotropy fix. Ready for CI and re-review.
Alexofbulgaria commented 2026-11-30 23:54:39 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by Alexofbulgaria on 2026-11-30T23:54:39Z.


Updated Windows sampler checks at fc7e538e

Tested clean PR head fc7e538e8408af51b93dce618e461cc8c39937cd in Release with MSVC 14.44.35207 and Windows SDK 10.0.26100.0 on Windows build 26300.10075.

Backend Test Result
CPU startup_sampler_desc_check Pass, including the descriptor regression at this head
Intel Arc A770 (8086:56a0), driver 32.0.101.9175 startup_sampler_device_hardware Pass
Microsoft WARP 10.0.26100.10068 startup_sampler_device_warp Pass

Both D3D12 runs selected the intended adapter with the debug layer enabled, logged zero debug errors and reported device removal reason 0x00000000. Both logged sampler repairs, including anisotropy. Each test ran once with zero skips. These are descriptor and device sampler-creation checks. AI assisted with setup and reporting. The tests executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7295669957 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3199#issuecomment-7295669957). Originally posted by [Alexofbulgaria](https://github.com/Alexofbulgaria) on 2026-11-30T23:54:39Z. --- ### Updated Windows sampler checks at `fc7e538e` Tested clean PR head `fc7e538e8408af51b93dce618e461cc8c39937cd` in Release with MSVC 14.44.35207 and Windows SDK 10.0.26100.0 on Windows build `26300.10075`. | Backend | Test | Result | | --- | --- | --- | | CPU | `startup_sampler_desc_check` | Pass, including the descriptor regression at this head | | Intel Arc A770 (`8086:56a0`), driver `32.0.101.9175` | `startup_sampler_device_hardware` | Pass | | Microsoft WARP `10.0.26100.10068` | `startup_sampler_device_warp` | Pass | Both D3D12 runs selected the intended adapter with the debug layer enabled, logged zero debug errors and reported device removal reason `0x00000000`. Both logged sampler repairs, including anisotropy. Each test ran once with zero skips. These are descriptor and device sampler-creation checks. AI assisted with setup and reporting. The tests executed locally.
R0Y00 commented 2026-12-03 03:35:17 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-12-03T03:35:17Z.

Review: COMMENTED


Independent re-review of fc7e538e, trial-merged onto aa70e516. The updated condition clamps MaxAnisotropy > 16 for every filter and still leaves zero alone for non-anisotropic filters. The previously reported 0x54/0x154 preservation cases passed in the descriptor suite. MSVC Debug ctest --preset dev --no-tests=error -j 1 -V -R '^(startup_sampler_desc_check|startup_sampler_device_(warp|hardware)|startup_sampler_comparison|startup_translated_sampler_bindings)$' passed 5/5 with no skips. WARP 10.0.26100.9818 and RTX 4060 Laptop 32.0.16.1656 reported zero D3D12 debug errors and no device removal (Windows build 26300, debug layer enabled).

I restored only the old anisotropic-only predicate in sanitize_sampler_common, keeping the new linear case in the fixture. The CPU descriptor test failed, and both device tests reported two debug errors and removal 0x887a0001. After restoring the fix, all three tests passed again. This addresses the non-anisotropic device-removal case in the earlier review. @pigalot, could you re-review the current head when available?

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6163278337 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3199#pullrequestreview-6163278337). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-12-03T03:35:17Z. **Review:** COMMENTED --- Independent re-review of `fc7e538e`, trial-merged onto `aa70e516`. The updated condition clamps `MaxAnisotropy > 16` for every filter and still leaves zero alone for non-anisotropic filters. The previously reported 0x54/0x154 preservation cases passed in the descriptor suite. MSVC Debug `ctest --preset dev --no-tests=error -j 1 -V -R '^(startup_sampler_desc_check|startup_sampler_device_(warp|hardware)|startup_sampler_comparison|startup_translated_sampler_bindings)$'` passed 5/5 with no skips. WARP 10.0.26100.9818 and RTX 4060 Laptop 32.0.16.1656 reported zero D3D12 debug errors and no device removal (Windows build 26300, debug layer enabled). I restored only the old anisotropic-only predicate in `sanitize_sampler_common`, keeping the new linear case in the fixture. The CPU descriptor test failed, and both device tests reported two debug errors and removal `0x887a0001`. After restoring the fix, all three tests passed again. This addresses the non-anisotropic device-removal case in the earlier review. @pigalot, could you re-review the current head when available?
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/3199:upstream-pr/3199'
git switch 'upstream-pr/3199'

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