test: refuse a comparison sample without one dim and dmask #1871
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1878"
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-24T19:59:52Z.
What
First case from #1877.
image_comparerefuses a comparison sample whose modifier list does not carry exactly onedim:andone
dmask::Replacing that
raisewithpassleftstartup_image_3d,startup_image_2d_array,startup_image_load_mipandstartup_image_sample_lgreen, so nothing exercised it.Change
A device-free case in
startup_image_2d_array_check.py's controls:The three bad lists cover "no dim", "no dmask" and "two dims". The last block is the control that stops the case from passing
because the guard raises on everything.
Tested
Negative controls, each reverted:
The second control matters: it keeps the equality of "exactly one" under test, not merely "at least one".
Scope
One test file, one new function called from
controls(). Refs #1877; the other two sites in that issue (thesample_laddress-register count and the non-constant sampler) are untouched.
Notes
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-24T20:01:34Z.
Review: COMMENTED
Reviewed head
0c32ee1642. Test-only change: one new check,check_compare_modifiers, intests/startup_image_2d_array_check.py, wired intocontrols().What it pins:
Stage.image_compareintools/startup/gfx2hlsl.pymust refuse animage_sample_cwith no dmask, no dim, or a repeated dim, using the exact messageimage_sample_c without exactly one dim and dmask. A legal modifier list is also checked to reach a different failure, so the guard is not just raising for everything. This is real refusal logic, not wording or a duplicate of an existing check.Commands run locally (Linux, head
0c32ee1642):git diff --check origin/main...HEAD: clean, rc=0python -B tests/docs_links_check.py: rc=0 (18 files, 376 links)python -B tests/bidi_controls_check.py: rc=0 (1326 files)python -B tests/startup_image_2d_array_check.py: rc=0Mutations on
tools/startup/gfx2hlsl.py(each reverted withgit checkout -- ., tree clean after):if len(dims) != 1 or len(masks) != 1:withif False:. The check exits rc=1 (the missing dmask now reachesmasks[0]and fails with IndexError).if len(dims) > 1 or len(masks) > 1:(allows zero). The check exits rc=1 for the same reason.Minor, non-blocking: the new function is followed by one blank line before
def mip_words, where the rest of the file uses two. The last block swallows AttributeError by design and only asserts the message is not the guard message.No blocking findings.
AI-assisted; commands listed were executed locally.