test: refuse image_sample_l with the wrong address count #1872
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1879"
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-24T20:00:56Z.
What
Second case from #1877.
image_sample_ltakes the coordinates and then the explicit level, so the address dwords are threefor a 2D image and four for a volume or a 2D array:
Replacing that
raisewithpassleftstartup_image_3d,startup_image_2d_array,startup_image_load_mipandstartup_image_sample_lgreen. The refusal is decided from the operands and the modifier list alone —self.pipeis onlytouched after it — so a bare stage reaches it:
Change
check_address_count()instartup_image_sample_l_check.py:[v1, v2]→image_sample_l with 2 address registers[v1, v2, v3, v4]→image_sample_l with 4 address registers[v1, v2, v3]→ must get past the guard (the bare stage then stops where it needs a pipeline)The third case is the control against a fixture that passes because the guard refuses everything.
Tested
Negative controls, each reverted:
The second one is the interesting one: it changes only the volume/array expectation, so the case is pinned to the exact
pair (3, 4) rather than to "some count".
Scope
One test file, one new function called from
controls(). Refs #1877; the non-constant sampler site from that issue is stillopen.
Notes
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-24T20:08:10Z.
Review: COMMENTED
Reviewed head
f8b39a5b633aba401bc60e247ec1ae905799e8f6. No P1/P2 findings.The new
check_address_countrunsStage.imageon a bare stage with a 2Dimage_sample_l. It asserts that 2 and 4 address registers are refused with the exact messageimage_sample_l with N address registers. It also checks that a legal count of 3 gets past that guard. This matches thelen(cs) != (4 if three else 3)check intools/startup/gfx2hlsl.py, which runs from the operands and modifiers alone, beforeself.pipeis used. The test is test-only, calls the code under test rather than a copy of its logic, and uses no outside material.controls()calls it first.Linux commands run in a clean worktree:
git diff --check origin/main...HEAD-> rc 0python -B tests/docs_links_check.py-> rc 0python -B tests/bidi_controls_check.py-> rc 0python -B tests/startup_image_sample_l_check.py-> rc 0Mutations in
tools/startup/gfx2hlsl.py(each reverted withgit checkout -- .;startup_image_sample_l_check.pyrun each time):Notes, not blocking:
AttributeErroronpiperather than the test's own "accepted N address registers" message. It is still a failure, and the message only matters for debugging.def controls()where two are conventional. This has no effect.This is a review comment only, not an approval.
AI-assisted; commands listed were executed locally.