startup: check the translated sampler bindings #1473
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1480"
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 Asimmimx on 2026-11-24T12:40:59Z.
Change
Refs #1149. This adds a device-free check for
src/startup_stubs/translated_sampler_bindings.h, which the draw path ind3d12_draw.inluses. The header does four things:smpheapmanifest lines;The tests that reach it are
startup_sampler_heap_warp,_wrapped_warp,startup_image_3d_warp,startup_image_load_mip_warp,startup_image_2d_array_warpandstartup_inline_sampler_warp. Their draws sample wrap, clamp and border samplers along U, on one-texel-high or point-sampled textures, and read one channel. No test sends ansmpheapmanifest through the device wrapper, so the snapshot comparison has no end-to-end coverage. 14 of 16 single-point mutants left all six tests passing (table below).startup_translated_sampler_bindingsincludes only the header and checks hand-worked values. The D3D12 enum numbers are written out, and the GCN field positions areCLAMP_X/Y/Zat word 0 bits 0–8,MAX_ANISO_RATIOat 9–11, and the mag, min, Z and mip filters at word 2 bits 20–27. It covers:border_sampler,sampler_root_parameterand the constants;PAGE_NOACCESSpage;startup_translated_sampler_bindings_shared_axis_controlruns with--mutate shared-axis, which expects V and W to repeat U, and must fail (WILL_FAIL).The change is test, CMake and
docs/startup-runtime.mdonly. The CMake block follows thestartup_sampler_heapsources, apart from the other open #1149 PRs.Verification
Commit
93672b99(main) plus this change,devpreset (Debug), Windows 11 Pro build 26300.9974, MSVC 19.51.36260, Windows SDK 10.0.26100.0, WARP 10.0.26100.9818.The six existing WARP tests,
startup_image_load_mip_warpandstartup_image_2d_array_warpincluded, passed on the unmodified header.tests/docs_links_check.py,tests/bidi_controls_check.pyandgit diff --checkpassed.Mutation probe
I applied each mutation to the header alone, rebuilt
offscreen_checkandd3d12_xs_shim, ran the tests, then reverted. None of this is committed. "Existing" means the six WARP tests above.border_samplerwith border on U onlyfallbackentry other than 2047 acceptedsmpheapline acceptedNotes:
ReadProcessMemorycopied nothing of that record, so the zeroing could not be observed.create_sampler_snapshot_heapneed anID3D12Device, and the shim only logs them. They are a possible follow-up.Checklist
AI-assisted (Claude Code).
Imported from R0Y00/Xbox2Windows. Originally posted by ChazY11 on 2026-11-24T13:06:09Z.
Two of your sixteen mutants reproduced — both invisible to the six GPU tests
Independent reviewer, not the author. Reviewed
d043bd91; nothing pushed to the branch. Mutations were made locally insrc/startup_stubs/translated_sampler_bindings.h, rebuilt, reverted; working tree is clean.Environment: Windows 11 build 26300.9974, MSVC 14.44.35207, SDK 10.0.26100, DXC 1.8.2502.11.
Unmodified branch —
startup_translated_sampler_bindingsand the four GPU sampler tests all pass.Mutant A — snapshot equality stops comparing the words
Mutant B — mip filter decoded as linear for every value
Both mutants leave every GPU test green and only the new device-free check notices. That is the same shape you describe
for 14 of the 16 mutants, and it is the property that makes the check worth having in CI where no adapter exists.
I sampled two of the sixteen rather than all of them; if you want the full set confirmed, say so and I will run the rest.
One thing I want to keep
The
N FAILED in M casessummary is exactly the right level of detail: mutant A says 1 of 57, mutant B says 43 of 57, sothe size of the breakage is visible without opening the source. Please keep that line if the case list changes.
Verdict
Reviewed
d043bd91. Device-free, two new CMake lines and one test file, no change to the header it checks, and themutants it is meant to catch are caught. No objection from me.