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
pull from: upstream-pr/3199
merge into: R0Y00:main
R0Y00:main
R0Y00:codex/indirect-large-backed-views
R0Y00:codex/word3-preflight-check
R0Y00:codex/vertex-table-two-records
R0Y00:codex/live-index-alias
R0Y00:codex/copied-vertex-buffer-srv
R0Y00:codex/windows-stage-test-output
R0Y00:codex/preserve-live-srv-retirement
R0Y00:codex/share-render-target-tracking
R0Y00:codex/sgd5-negative-offset-fixture
R0Y00:coverage-dashboard
R0Y00:codex/mesh-loose-root
R0Y00:codex/mesh86-cache-padding
R0Y00:codex/xmem-scatter-preflight
R0Y00:codex/mesh-depth-ps
R0Y00:codex/indirect-dispatch-refresh
R0Y00:codex/compute-container-index
R0Y00:codex/startup-compute-formatted-load
R0Y00:codex/compute-indirect-producer
R0Y00:codex/compute-atomic-soffset
R0Y00:codex/mesh-dual-handoff
R0Y00:codex/startup-run-sh-watcher-control
R0Y00:codex/queue31-page-alias
R0Y00:codex/indexed-indirect-compute-root
R0Y00:codex/typed-buffer-view-metadata
R0Y00:codex/translated-indexed-address-alias
R0Y00:codex/fixed-mesh-create-result
R0Y00:codex/xmem-section-lease
R0Y00:codex/startup-slot86-mesh-cache
R0Y00:codex/restore-mesh-barrier-iteration
R0Y00:codex/translated-indirect-upload-index
R0Y00:codex/xapu-completion-opt-in
R0Y00:codex/translated-indexed-rect
R0Y00:codex/translated-indexed-indirect
R0Y00:codex/startup-mesh-lds-integration
R0Y00:codex/startup-console-ms24
R0Y00:codex/startup-slot57-mesh-request
R0Y00:codex/indirect-copy-provenance
R0Y00:codex/present-color-producer-trace
R0Y00:codex/compute-dispatch-binding-trace
R0Y00:codex/translated-indirect-table-buffers
R0Y00:codex/indirect-copy-provenance-base
R0Y00:codex/mix-half-literal-source
R0Y00:codex/translated-indirect-draw
R0Y00:codex/xmem-scatter-diagnostics
R0Y00:codex/slot148-recording-upload
R0Y00:codex/slot70-loading-art-verified
R0Y00:codex/command-list-upload-arena
R0Y00:codex/recover-failed-command-list
R0Y00:codex/startup-heap-timing-notes
R0Y00:codex/align-audio-input-timeline
R0Y00:codex/synthetic-depth-export-control
R0Y00:codex/startup-texture1d-on-windows
R0Y00:codex/1629-packed-position-fixture
R0Y00:codex/cpu-srv-refresh
R0Y00:codex/stream-root-srv-draw
R0Y00:codex/audio-mixer-timer
R0Y00:codex/startup-reload-published-shader
R0Y00:codex/priority-integrate-1284
R0Y00:codex/guest-sixteen-page-record
R0Y00:codex/aot-placed-dxr-batch
R0Y00:codex/guest-directory-selection
R0Y00:codex/gamesave-enumerate-read
R0Y00:codex/readme-archive-to-pixels
R0Y00:codex/pe-placed-view-draw
R0Y00:codex/archive-directory-gpu
R0Y00:codex/slot133-dxr-build
R0Y00:codex/materialize-placed-vertex-view
R0Y00:codex/dstorage-directory-offsets
R0Y00:codex/xg-nine-bc-copy
R0Y00:codex/xg-slot10-bc64-arrays
R0Y00:codex/dxr-guest-address-readback
R0Y00:codex/gpu-va-high-bits
R0Y00:codex/clarify-diagnostic-startup-scope
R0Y00:codex/xg-six-levels
R0Y00:codex/typed-derived-blend
R0Y00:codex/english-legal-text-progress
R0Y00:codex/address-bc-4ks
R0Y00:codex/dstorage-bounded-file-read
R0Y00:codex/wide-srv-offsets-menu
R0Y00:codex/startup-memory-srv
R0Y00:codex/bound-view-tail
R0Y00:codex/language-selector-readback
R0Y00:codex/setup-menu-progress
R0Y00:codex/cpu-plane-refresh
R0Y00:codex/startup-ubyte-vertex
R0Y00:codex/presenter-window-selection
R0Y00:codex/startup-uniform-buffer-lane
R0Y00:codex/intro-loop-timing
R0Y00:codex/static-clzero-loops
R0Y00:codex/document-rtx-intro
R0Y00:codex/startup-insertq
R0Y00:codex/nv12-startup-texture
R0Y00:codex/stream-stage-draw
R0Y00:codex/startup-null-uav-format
R0Y00:codex/startup-draw-capture
R0Y00:codex/shorten-windows-checks
R0Y00:codex/dstorage-rfc1950
R0Y00:codex/startup-dump-fence
R0Y00:codex/pr1135-review-base
R0Y00:codex/startup-stream-requests
R0Y00:codex/startup-chroma-view
R0Y00:codex/readme-graphics-pipeline-streams
R0Y00:codex/static-crt-free-tls
R0Y00:codex/arc-140t-rtx-5080-laptop-gpu-reports
R0Y00:codex/main-startup-progress-entry
R0Y00:codex/signed-dxil-catalogue
R0Y00:codex/reloc-free-preferred-base
R0Y00:codex/quad-dpp-bit-mask
R0Y00:codex/raw-srv-bounds
R0Y00:codex/rx9070-31044-hardware-report
R0Y00:codex/gpu-page-source-provenance
R0Y00:codex/runtime-placeholder-interior
R0Y00:codex/gpu-copy-queue-tile-order
R0Y00:codex/pe-pin-external-providers
R0Y00:codex/xmem-placeholder-reservations
R0Y00:codex/xmem-shared-physical-pages
R0Y00:codex/pe-package-startup
R0Y00:codex/xmem-tools-memory-query
R0Y00:codex/cpu-stack-output-import
R0Y00:codex/pe-load-security-cookie
R0Y00:codex/record-three-bvh-retests
R0Y00:codex/cpu-rbp-frame-anchor
R0Y00:codex/xmem-default-startup
R0Y00:codex/record-rtx-3050-ti-9597
R0Y00:codex/docs-readme-start-here
R0Y00:codex/check-compute-mad24-truncation
R0Y00:codex/docs-discord-community
R0Y00:codex/bound-rcx-branch-mutants
R0Y00:codex/rtx5060ti-bvh-62114
R0Y00:codex/837-neutral-readme-disclaimer
R0Y00:codex/record-rtx-3070-ti
R0Y00:codex/title-neutral-public-wording
R0Y00:codex/exe-shadow-frame-submissions
R0Y00:codex/exe-shadow-runtime-chain
R0Y00:codex/readme-polish
R0Y00:codex/gpu-coverage-nov23
R0Y00:codex/spirv-minlod
R0Y00:codex/shadow-shim-device
R0Y00:codex/exe-two-shadow-frames
R0Y00:codex/shim-dispatch-cleanup
R0Y00:codex/fix-spirv-cache-probe
R0Y00:codex/sampler-use
R0Y00:codex/ballot-bit-extract
R0Y00:codex/packed-fma-release
R0Y00:codex/cpu-packed-fma-o2
R0Y00:codex/publish-coverage-dashboard
R0Y00:codex/mesh-cbv-binding-order
R0Y00:codex/spirv-window-fixture
R0Y00:codex/ps-e32-float-uint
R0Y00:codex/ps-cbuffer-reads
R0Y00:codex/fixed-profile-rescan
R0Y00:codex/shim-compute-integration
R0Y00:codex/readme-visible-coverage
R0Y00:codex/readme-research-navigation
R0Y00:codex/integrate-pr-256
R0Y00:codex/indexed-mesh
R0Y00:codex/sampled-coverage
R0Y00:codex/first-ms
R0Y00:codex/dual-ps
R0Y00:codex/ps-attribute
R0Y00:codex/compute-first
R0Y00:codex/ps-export
R0Y00:codex/readme-research-status
R0Y00:codex/ps-layout
R0Y00:codex/blast-window
R0Y00:codex/chart-caption
R0Y00:codex/reviewer-roles
R0Y00:codex/blast-aot
R0Y00:codex/archive-program
R0Y00:codex/crc-stream-program
R0Y00:codex/exe-image-data-chain
R0Y00:codex/local-cpu-fixture-coverage
R0Y00:codex/exe-bound-frame-chain
R0Y00:codex/exe-mapped-comparison
R0Y00:codex/contribution-dependencies
R0Y00:codex/exe-entry-aot
R0Y00:codex/bink-frame-heap-integration
R0Y00:docs/hardware-seven-reports
R0Y00:codex/bink-custom-heap
R0Y00:codex/bink-heap-callers
R0Y00:codex/discussions-entry-points
R0Y00:codex/gpu-community-batch-64
R0Y00:codex/ffx-scratch-writers
R0Y00:codex/generic-project-documentation
R0Y00:codex/ffx-dispatch-rcas
R0Y00:codex/four-windows-gpu-reports
R0Y00:codex/title-neutral-project-wording
R0Y00:codex/community-coverage-provenance
R0Y00:codex/rcas-packed-texels
R0Y00:codex/community-gpu-retests
R0Y00:codex/community-build-and-gpu-reports
R0Y00:codex/ffx-provider-loop
R0Y00:codex/ffx-recurrent-views
R0Y00:codex/ffx-recurrent-resource
R0Y00:codex/amd-wave64-reports
R0Y00:codex/ffx-backend-slots
R0Y00:codex/upscaler-device-init
R0Y00:codex/ffx-context-lifecycle
R0Y00:codex/ffx-version-query
R0Y00:codex/ffx-provider-contract
R0Y00:codex/typed-object-callback
R0Y00:codex/cpu-ordinal-import
R0Y00:codex/chained-cpu-ranges
R0Y00:codex/cpu-import-call
R0Y00:codex/cpu-direct-call
R0Y00:codex/cpu-leaf-aot
R0Y00:codex/community-project-status
R0Y00:codex/script-state-path-replay
R0Y00:codex/script-state-evidence
R0Y00:codex/bc7-resident-tail
R0Y00:codex/bcpack-mip-tail
R0Y00:codex/bc7-texture-draw
R0Y00:codex/asset-ranges
R0Y00:codex/pixel-constants
R0Y00:codex/pixel-aot
R0Y00:codex/pre-exe-workloads
R0Y00:codex/root-signature-device-coverage
R0Y00:engineering/packed-bvh-leaves
R0Y00:engineering/bvh-build-and-update
R0Y00:engineering/intake-root-roundtrip
R0Y00:community/gpu-check-release
R0Y00:community/english-contributor-entry
No reviewers
Labels
Clear labels
No items
No labels
Milestone
Clear milestone
No items
No milestone
Assignees
Clear assignees
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
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3199"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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.hrepairs such a description on a copy and keeps every field the selected filter ignores. It runs at:CreateSampler(device slot 22); an unreadable description is refused instead of forwarded,decode_statics) and dynamic samplers (dynamic_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(titleCreateSamplercalls 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_hardwareskips (77) without a hardware adapter.startup_translated_sampler_bindingsandstartup_sampler_comparisonupdated: 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-> OKx86_64-w64-mingw32-g++ -std=c++20 -fsyntax-only -Isrc tests/startup_sampler_device.cpp-> OKx86_64-w64-mingw32-g++ -std=c++20 -fsyntax-only -Isrc -x c++ -include d3d12.h src/startup_stubs/plane_compositor.h-> OKcmake -S . -B <tmp> -G Ninja -DDXC_EXECUTABLE=/bin/true-> configure OKpython3 tests/bidi_controls_check.py-> passed771ba414, targetsd3d12_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: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)/O2): same regex -> 34/38 passed, same 4 skippedctest --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.
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:These complement the existing WARP runs.
AI-assisted; commands listed were executed locally.
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.
771ba41ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.
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
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".
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 24On 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 👍 / 👎.
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 24Valid, fixed in
122ddf3c4onup-sampler-sanitize.sampler_desc_check.hnow treats both0x55and0x54(anisotropic with a point mip filter, plus the reduction bits) as anisotropic. Both the filter-shape check and theMaxAnisotropyrange check use the same predicate, so a valid0x54sampler keeps its filter and its anisotropy.Test:
startup_sampler_desc_check.cpphas two new cases, an untouched0x54and0x154(minimum reduction) description, and a0x54sampler withMaxAnisotropy = 0that is clamped to 1 while the filter stays0x54.Gate on aws-1 with WARP (
x2w_pipe.py win2025 3199 --host aws-1 --regex startup_sampler --force, head122ddf3c): dev and release 17/17 passed. Mutant (the old== 0x55predicate), run after the main gate:startup_sampler_desc_checkfails in dev and release.AI-assisted; commands listed were executed locally.
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-28T22:08:01Z.
Merged current
maininto this branch (merge commit, no force push, no conflicts); head is now32754bec2. The anisotropic-filter finding was already fixed in122ddf3c4.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.
Imported from R0Y00/Xbox2Windows. Originally posted by Alexofbulgaria on 2026-11-29T05:15:48Z.
Windows Arc A770 validation at
32754becI built a clean, separate checkout of exact head
32754bec269122fecb55505b9d007fea35568a7b, Release, with MSVC 19.44.35230 and Windows SDK 10.0.26100.0. Windows26300.10075, Intel Arc A7708086:56a0, driver32.0.101.9175. WARP runtime10.0.26100.10068.startup_sampler_desc_checkstartup_sampler_device_hardware0x00000000startup_sampler_device_warp0x00000000Each 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, including0x54and0x154, and the invalid-0x54anisotropy 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 onlystartup_sampler_desc_checkandstartup_sampler_device, and ran each registered test withctest --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.
Imported from R0Y00/Xbox2Windows. Originally posted by pigalot on 2026-11-29T08:45:59Z.
Review: CHANGES_REQUESTED
Independently reviewed
32754becintegrated overmainae45c4ff(tree23db61ae). The trial merge is clean andgit diff --checkis clean.I traced
sanitize_sampler_commonagainst the D3D12 filter encoding and the documentedD3D12_SAMPLER_DESCranges, the slot 22 hook inview_slot, and the four call sites intranslated_sampler_bindings.handplane_compositor.h. I also ran a small standalone probe that callsID3D12Device::CreateSamplerdirectly, one description per process, to see what the runtime does with descriptions the sanitizer leaves alone.Blocking: a non-anisotropic filter with
MaxAnisotropyabove 16 still removes the device.sanitize_sampler_commonclampsMaxAnisotropyonly when the filter is anisotropic, on the reasoning that other filters ignore the field. The runtime validates it for every filter:Filter = MIN_MAG_MIP_LINEAR,MaxAnisotropy = 64, everything else valid:ID3D12Device::CreateSampler2: MaxAnisotropy must be in the range [0 to 16]. 64 specified., thenGetDeviceRemovedReason()=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).tests/startup_sampler_device.cpp,cases[6].MaxAnisotropy = 64;(case 6 is otherwise the valid linear description), makesstartup_sampler_device_warpandstartup_sampler_device_hardwarefail withdebug 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 > 16to 16 for every filter, keep the< 1repair for anisotropic filters only (the runtime accepts 0), and add the linear case to bothstartup_sampler_desc_checkandstartup_sampler_device.Non-blocking notes
(!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 as0x40or0x50(anisotropic bit without the full encoding) would pin it; the probe shows the runtime rejects0x40("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.CreateSampleraccepts 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 withMaxAnisotropy = 0,MinLOD > MaxLODand 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).0x54is kept, which is right whereAnisoFilterWithPointMipSupportedis set (it is on both adapters here). On a device without it the description is forwarded unchanged; I could not test such a device.create_sampler_snapshot_heapor its reserved fallback entry (see the surviving mutants).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_warpindevandrelease.dev:startup_sampler_desc_check,startup_sampler_comparison,startup_translated_sampler_bindings3/3 passed;startup_sampler_device_warppassed (debug errors=0 removed=0x00000000);startup_sampler_device_hardwarepassed 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.mainae45c4ff.args[0] = reinterpret_cast<u64>(&repaired_sampler);removed from slot 22,startup_sampler_device_warpfails withdebug errors=4 removed=0x887a0001andstartup_sampler_device_hardwarefails too. This matches the PR body.Mutants (
dev; each applied alone, sources restored,git diff --quietclean afterwards).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; NaNMinLODnot reset; NaNMaxLODnot 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 picksNEVER; address lower bound off; address upper bound 5 -> 6;AddressVunchecked;AddressWunchecked; border low clamp off; border high clamp off;MaxLOD = MinLOD;startup_sampler_comparison:decode_staticsnot sanitized;startup_translated_sampler_bindings:dynamic_samplernot sanitized;startup_sampler_device_warpand_hardware: slot 22 forwards the title description (the negative control above).(basic & ~0x15u)clause (note 1);sampler &&instead of!sampler ||):startup_sampler_device_hardwarestill passes, since no test passes null;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;(filter & ~0x1d5u)clause (note 1);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 ownX2W_D3D12_DEBUG=1).CI:
Build and test on Windowspassed on32754bec.This reply was AI-assisted.
Imported from R0Y00/Xbox2Windows. Originally posted by JohnConnorNPC on 2026-11-29T13:05:07Z.
Review of head
32754becagainstmain94b679e7. I read the source and ran trial merges only; I did not build or run anything.git merge-tree --write-tree origin/main 32754becexits 0.mainhas not touchedtranslated_sampler_bindings.horplane_compositor.hsince 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
MaxAnisotropyabove 16 still removes the device. That holds the merge, so I am not merging. I have nothing to add to it.SHOULD
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 thatsanitize_sampler*returns:sanitize_static_sampler(sampler);indecode_staticssanitize_sampler(result);indynamic_samplersanitize_sampler(sampler);calls increate_sampler_snapshot_heapAll 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
CLAMPor trilinear and leaves no trace. Onmainthe 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
view_slot. Both insert right afterif (default_view) args[desc_index] = 0;. With either one merged ontomain, the other conflicts insrc/startup_stubs/d3d12_xs_device.cpp(trial merges both ways). Whichever goes second needs a merge.AI-assisted.
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.
Imported from R0Y00/Xbox2Windows. Originally posted by Alexofbulgaria on 2026-11-30T23:54:39Z.
Updated Windows sampler checks at
fc7e538eTested clean PR head
fc7e538e8408af51b93dce618e461cc8c39937cdin Release with MSVC 14.44.35207 and Windows SDK 10.0.26100.0 on Windows build26300.10075.startup_sampler_desc_check8086:56a0), driver32.0.101.9175startup_sampler_device_hardware10.0.26100.10068startup_sampler_device_warpBoth 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.Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-12-03T03:35:17Z.
Review: COMMENTED
Independent re-review of
fc7e538e, trial-merged ontoaa70e516. The updated condition clampsMaxAnisotropy > 16for every filter and still leaves zero alone for non-anisotropic filters. The previously reported 0x54/0x154 preservation cases passed in the descriptor suite. MSVC Debugctest --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 removal0x887a0001. 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?View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.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.