test: pin the two sampler-descriptor refusals #1766
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1773"
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 ChazY11 on 2026-11-24T18:20:42Z.
What
Two decoder profiles in
tools/pixel_aot.pyrefuse a field they cannot model:No check reached either raise. Replacing each with
passleft all three checks that cover this module green:Change
One function, called from
check_controls, that calls both with legal words first and then with one illegal field:and for the comparison profile, legal words (point filter with
TRUNC_COORD, which is the pair the translatoraccepts) then
mip = 3andword 2 bit 28, both of which must raise the mip-filter message.Tested
Two things I got wrong while writing it
Worth recording because they are the reason the assertions look the way they do:
word 1 = 0x1000is inside the permitted MIN_LOD field (0x00fff000), so the gather profile accepts it. Therefusal needs a bit outside that field; bit 11 does it.
TRUNC_COORDclear is refused by a later check ("point filtering requires TRUNC_COORD 1"), so the"legal" comparison words have to set word 0 bit 27. The case fails loudly if either assumption drifts.
Scope
One test file, no behaviour change.
check_controlsnow runs these two before the heavier task list; they costmicroseconds.
Notes
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-24T18:55:48Z.
Review: COMMENTED
Reviewed at commit
a5997c1e17c1dbae2346d021404d1f469cd0d883(tests/pixel_aot_check.py).Code Review
check_sampler_descriptor_refusals()is invoked fromcheck_controls()and pins both sampler-descriptor refusal profiles intools/pixel_aot.py:check_gather_sampler(): accepts the legal baseline(0x12, 0, 0x04500000, 0)and assertsValueError("Unsupported gather sampler...")on illegal word 0 (0x13), word 1 (0x800), and word 2 (0x04500001).comparison_sampler_state(): accepts the legal point-filter +TRUNC_COORD=1baseline and assertsValueError("Unsupported mip filter...")onmip=3and word 2 bit 28 (1 << 28).Verification
git diff --check origin/main...HEAD: pass/root/.local/share/x2w-rev-venv/bin/python -B tests/bidi_controls_check.py: pass (Checked 1302 tracked source, script and build/CI files: no bidirectional controls.)/root/.local/share/x2w-rev-venv/bin/python -B tests/pixel_aot_check.py: pass/root/.local/share/x2w-rev-venv/bin/python -B tests/form_coverage_check.py: pass (form coverage checks passed)--preset dev,ctest --preset dev -R '^(pixel_aot_gather_warp|pixel_aot_compare_sample_warp|rdna2_tools_check)$' --parallel 6 --no-tests=error --output-on-failure): 3/3 passed (6.91s:pixel_aot_compare_sample_warp6.44s,pixel_aot_gather_warp6.73s,rdna2_tools_check6.80s)/O2(--preset release,ctest --preset release -R '^(pixel_aot_gather_warp|pixel_aot_compare_sample_warp|rdna2_tools_check)$' --parallel 6 --no-tests=error --output-on-failure): 3/3 passed (6.94s:pixel_aot_compare_sample_warp6.29s,pixel_aot_gather_warp6.50s,rdna2_tools_check6.85s)tests/pixel_aot_check.pyok (9.5s),tests/form_coverage_check.pyok (18.0s)raise ValueError("Unsupported gather sampler...")withpassintools/pixel_aot.py:tests/pixel_aot_check.pyfailed withAssertionError: gather sampler (19, 0, 72351744, 0) was accepted(exit code 1).raise ValueError("Unsupported mip filter or word 2 bits 28-31")withpassintools/pixel_aot.py:tests/pixel_aot_check.pyfailed withAssertionError: comparison sampler (134217746, 0, 201326592, 0) was accepted(exit code 1).AI-assisted; commands listed were executed locally.
upstream-sync referenced this pull request2026-11-24 19:01:36 +00:00
Imported from R0Y00/Xbox2Windows. Originally posted by ChazY11 on 2026-11-24T18:23:06Z.
Same probe, applied to the rest of
tools/pixel_aot.py, so the next case does not have to rediscover it. Each refusal was replaced withpassand the two checks that cover this module were run:So the two refusals this PR pins are not the only unreached ones.
gather_offsetis the easy next one — it is a purefunction of one bit field:
gather_offset(None)and a value with a bit outside0x3f3fshould both raise, and a legal value should decode to thesigned pair. I can send that as its own PR once this one lands, rather than stacking a second change on the same file
while it is under review.
The other two — the multi-exit control-flow message and the record-name message — I am not attempting: both need a
malformed container or shader record, and I would be guessing at what the decoder can be fed rather than testing a
behaviour.