gfx2hlsl: three image-path refusals are not reached by any check #1877
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#1877
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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:58 UTC · original
Three refusals in the image path of
tools/startup/gfx2hlsl.pyare unreachable from every check that exists, so a change to them is invisible.How I know
For each site I replaced the
raisewithpassand ran the four image checks plus the model checks:passlen(dims) != 1 or len(masks) != 1len(cs) != (4 if three else 3)inimage_sample_lwords is None— sampler is not a constant runCompare a control that is covered,
image dimension %sat line 781: replacing it turnsimage_3d,image_2d_arrayandimage_sample_lred. So the harness sees these files; the three above are simply not exercised.What a fixture would need
image_sample/image_loadword whose modifier list has twodim:entries or none. The checks build theirwords from a known-good encoding and flip flag bits, so a zeroed or doubled dim field is a small extension of that pattern.
image_sample_lwith the wrong number of address registers — the fixture already has a legalsample_lcase toshrink or extend by one register.
through a sampler heaprefusal two lines above it is covered bystartup_sampler_heap_check, so the difference between thetwo branches can presumably be shown in the same fixture.
Why it matters
These three are the "the file you gave me is not what I can lower" boundary. If one of them silently stopped firing, a
malformed pipeline would reach the emitter and produce HLSL that means something else instead of a named
Unsupported, whichis the failure mode the refusals exist to prevent.
Scope
Testing only. No behaviour change proposed here; splitting it into three one-case PRs is fine, or one PR with three cases.
@ChazY11 on GitHub · 2026-11-24 20:02 UTC · original
All three sites now have a case; splitting them across PRs so each one is a single behaviour:
without exactly one dim and dmaskimage_sample_l with N address registerswith a sampler that is not constantEach was verified the same way: replace the
raisewithpass, confirm the new case turns red, then revert. Two extramutations per case keep the equality of the conditions under test (
!= 1→< 1,(4 if three else 3)→5 if three,any→all), and all of those also fail.The issue can be closed once the three are merged; nothing else in the image path came up uncovered in the same sweep.
@ChazY11 on GitHub · 2026-11-24 20:15 UTC · original
All three are on
mainnow: #1878 (without exactly one dim and dmask), #1879 (image_sample_laddress count) and #1880(sampler that is not constant). Each was verified by replacing the
raisewithpassand confirming the new case turns red,plus a second mutation per case that changes the equality of the condition (
!= 1→< 1,(4 if three else 3)→5 if three,any→all) — all of those fail too.Nothing else in the image path came up uncovered in the same sweep, so this can be closed.
@R0Y00 on GitHub · 2026-11-24 20:32 UTC · original
Completed by #1878, #1879 and #1880. The three independent controls cover the comparison sample modifiers, explicit LOD operand count, and unresolved sampler. The author verified that suppressing each refusal makes the corresponding test fail.