test: refuse a comparison sample without one dim and dmask #1878
No reviewers
Labels
No labels
accessibility
awaiting author
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
priority: P0
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/R0Y00--Xbox2Windows!1878
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/1878/head"
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?
@ChazY11 on GitHub · 2026-11-24 19:59 UTC · original
ChazY11:test/image-compare-modifiers→main· +26 −0 · 1 files · 1 commits · merged 2026-11-24 20:08 UTCWhat
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
@tedin7 on GitHub · 2026-11-24 20:01 UTC · original · reviewed
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.