startup: lower fixed-mip 2D comparison gathers in gfx2hlsl #2242
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2250"
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 ArnabSaga on 2026-11-25T07:46:46Z.
Lower gfx1013 image_gather4_c_lz for a bounded 2D pixel-shader profile with red DMASK and a constant comparison sampler.
Reuse the existing comparison-gather sampler validation and smpc bindings. Emit GatherCmp and write four consecutive destination VGPRs in gather order. Preserve the ordinary gather implementation and reject unsupported comparison-gather forms.
Add source-built encoded fixtures, independent CPU expectations, all eight comparison functions, view-relative mip tests, refusal controls and GPU sensitivity checks.
Verified with FXC ps_5_1 and DXC ps_6_0 on WARP and Intel Iris Xe: 92 positive draws, 32 expected sensitivity mismatches, 23,552 bitwise-equal channel comparisons, 21 selected CTest tests passing, and zero debug warnings or errors.
The verified texture contract is R32_FLOAT with reference and texels in [0,1]. No console or title-level execution claim.
AI assistance: developed with DeepSeek V4.1 Flash in OpenCode, with ChatGPT-assisted planning and acceptance review.
Refs #1802
Change
Describe the observable change and the task or milestone it advances, or the
independent problem it solves. Link related issues with
Refs #123orFixes #123. If the change touches a shared interface, name it and link anyoverlapping work or PR that must land first. For a documentation patch,
identify the contributor task the edit helps someone complete.
Verification
Give the commit or build, command and result. For GPU changes include the
adapter, backend, first mismatch if any, and capability skips. If you could not
run a check, say so and identify the missing prerequisite.
Evidence and follow-up
For new fixtures, describe their source or generation method and license.
Identify assumptions that affect the result and link any work another
contributor can pick up.
If this changes what contributors can run, link the updated README entry or
build step and the reproduction command. For a local-data result, identify the
part the public fixture verifies.
Checklist
If this change was AI-assisted, say so in the description. Recent contributions
follow this practice.
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T07:48:09Z.
Review: COMMENTED
Review of head
64287bc5ebc2d06a84250d14f6925d411c9a251d(comment only, not an approval).Summary: The lowering of
image_gather4_c_lzis correct on read: red-only dmask, 2D, constant comparison sampler, address order (reference, u, v) andGatherCmpwriting four consecutive VGPRs. It reusescheck_gather_sampler(..., comparison=True). One merge blocker below.P1
CONFLICTINGwithmain.git merge-tree --write-tree origin/main HEADreports a content conflict inCMakeLists.txt(the test registration block near thestartup_image_sample_c/startup_image_gather_lz_*entries). Please rebase. The Windows run for this head does not describe the merged tree.P2
## Change,## Verification) below the summary. The Windows results quoted (92 draws, 21 CTest tests, adapters) are not tied to a commit or command line as the template asks. Please fill them in with the exact commands and the rebased SHA.gh pr checksreports no checks for this branch, so there is no CI signal yet for the.github/workflows/windows.ymledit.Nits
tools/startup/gfx2hlsl.py(op_image_gather4_c_lz): thedst[2] > 255/addr[2] > 255checks are fine, but the comment "an alias between address and destination keeps the original operands" holds only becausetis assigned beforeset_v. A test with an aliased range (e.g.v[0:3]dest andv[0:2]address) would pin that. I did not see one in the new check.Commands executed locally in the worktree
git diff --stat origin/main...HEAD: 10 files, 854 insertions, 9 deletions.python3 -B tests/startup_image_gather_c_lz_check.py: passes, including its text and guard controls.python3 -B tests/startup_image_gather_lz_check.py: passes.python3 -B tests/startup_image_sample_c_check.py: passes (opcode edits to the refusal controls are consistent with the new lowering).python3 tests/docs_links_check.py: passes (18 files, 407 links).python3 tests/bidi_controls_check.py: passes (1488 files).git diff --check origin/main...HEAD: clean.uandvin the emittedGatherCmpcall. The check fails (assertion on the exact call text, exit 1).dmask:0x1guard. The check fails (comparison gather accepted a form expected to report 'requires red dmask 0x1').git checkout -- .after each mutation.AI-assisted; commands listed were executed locally.
Imported from R0Y00/Xbox2Windows. Originally posted by ArnabSaga on 2026-11-25T07:57:59Z.
Thanks for the detailed review and for independently running the
translation and mutation controls.
I'll rebase onto current main, preserve the upstream CMake registrations,
and rerun the verification matrix against the rebased commit.
I'll also complete the PR template with the exact verification commands and
commit SHA, keep the description neutral, and verify the aliased
destination/address register case.
I'll update the PR once the corrected candidate has been verified.
On Wed, Nov 25, 2026 at 1:48 PM tedin7 @.***> wrote:
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T08:21:21Z.
Review: COMMENTED
Re-review of head
060aaac43b0182fd062bb765970b2112db3d4ae2(comment only, not an approval).Previous findings
CMakeLists.txt): resolved.gh pr viewreportsMERGEABLE/CLEAN, andgit merge-tree --write-tree origin/main HEADreturns a tree with no conflict.gh pr checks: Linux Python checks, gfx1013 fixture assembly and Windows build+test all pass (the /O2 job and the chart publish step are skipped).tests/startup_image_gather_c_lz_check.pynow covers thev[0:3]/v[0:2]overlap and destinationv[252:255].## Change,## Verification,## Evidence and follow-up,## Checklist) below the summary. The verification line is not tied to a commit or command line. It also still names tooling products in the AI-assistance line. Please fill in the sections with the exact commands, results and the current head SHA, and keep the AI-assistance note neutral.New findings
CMakeLists.txt,tests/desktop_gpu.handtests/offscreen_check.cpp.Commands executed locally in the worktree
git diff --stat origin/main...HEAD: 10 files, 854 insertions, 9 deletions.python3 -B tests/startup_image_gather_c_lz_check.py: passes.python3 -B tests/startup_image_gather_lz_check.py: passes.python3 -B tests/startup_image_sample_c_check.py: passes.python3 tests/docs_links_check.py: passes (18 files, 428 links).python3 tests/bidi_controls_check.py: passes (1536 files).git diff --check origin/main...HEAD: clean.uandvin the emittedGatherCmpcall. The check exits 1.dmask:0x1guard. The check fails (comparison gather accepted a form expected to report 'requires red dmask 0x1').git checkout -- .after each mutation (git statusclean).AI-assisted; commands listed were executed locally.