shader: name the missing implicit mip level for gather4 #2727

Merged
RonLogic merged 2 commits from upstream-pr/2735 into main 2026-11-26 04:45:03 +00:00
RonLogic commented 2026-11-26 04:33:35 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by RonLogic on 2026-11-26T04:33:35Z.


Change

Refs #1802. Plain image_gather4 now reports that it requires the guest implicit mip level. That makes a missing mip-selection proof distinguishable from a generic unsupported opcode. Sending this form through the fixed-mip path could select the first mip of the bound view when the guest would select another mip.

The existing synthetic instruction test requires the new reason. The surrounding fixed-mip, explicit-LOD and comparison gather cases still exercise GPU readback.

Verification

Windows 26300.10075, MSVC x64 Release, SDK DXC 1.9.2602.17, commit 0998b82e based on 1226f02e.

cmake --build --preset release --target offscreen_check --parallel 4
$env:XBOX2WINDOWS_ADAPTER = 'RTX 4070'
ctest --preset release --no-tests=error -j 1 -R '^(startup_(image|compute)_gather|compute_store_aot_gfx1013_gather4_l)' --output-on-failure

14/14 passed, zero skips. The ten GPU runs covered in-box WARP (10.0.26100.10068) and RTX 4070 (32.0.16.2124). startup_gfx2hlsl_join_symbols_check.py, startup_tools_lint_check.py, docs_links_check.py, bidi_controls_check.py and git diff --check passed. Removing the new handler in memory makes the existing encoded gather fixture fail on the old generic message. git merge-tree --write-tree found no conflicts against 343dc04f.

I used Codex to prepare the change and ran the verification locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6619569853 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2735). Originally posted by [RonLogic](https://github.com/RonLogic) on 2026-11-26T04:33:35Z. --- ## Change Refs #1802. Plain `image_gather4` now reports that it requires the guest implicit mip level. That makes a missing mip-selection proof distinguishable from a generic unsupported opcode. Sending this form through the fixed-mip path could select the first mip of the bound view when the guest would select another mip. The existing synthetic instruction test requires the new reason. The surrounding fixed-mip, explicit-LOD and comparison gather cases still exercise GPU readback. ## Verification Windows `26300.10075`, MSVC x64 Release, SDK DXC `1.9.2602.17`, commit `0998b82e` based on `1226f02e`. ```powershell cmake --build --preset release --target offscreen_check --parallel 4 $env:XBOX2WINDOWS_ADAPTER = 'RTX 4070' ctest --preset release --no-tests=error -j 1 -R '^(startup_(image|compute)_gather|compute_store_aot_gfx1013_gather4_l)' --output-on-failure ``` 14/14 passed, zero skips. The ten GPU runs covered in-box WARP (`10.0.26100.10068`) and RTX 4070 (`32.0.16.2124`). `startup_gfx2hlsl_join_symbols_check.py`, `startup_tools_lint_check.py`, `docs_links_check.py`, `bidi_controls_check.py` and `git diff --check` passed. Removing the new handler in memory makes the existing encoded gather fixture fail on the old generic message. `git merge-tree --write-tree` found no conflicts against `343dc04f`. I used Codex to prepare the change and ran the verification locally.
upstream-sync closed this pull request 2026-11-26 05:02:21 +00:00
tedin7 commented 2026-11-26 05:02:21 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-26T04:42:06Z.

Review: COMMENTED


Review of head 0998b82e (comment only).

Scope: op_image_gather4 now raises Unsupported('image_gather4 requires the guest implicit mip level') instead of the generic unsupported-opcode message. No new lowering, so the plain gather still cannot reach the fixed-mip path. The doc note matches the code. The sibling gathers (_lz, _l, _c*, _b, _o) are untouched and keep their own refusal tests.

Commands run (worktree on this head):

  • git diff --check origin/main...HEAD -> clean
  • python3 tests/docs_links_check.py -> ok (524 links)
  • python3 tests/bidi_controls_check.py -> ok
  • python3 tests/startup_image_gather_lz_check.py -> passes
  • Mutation: delete op_image_gather4 -> the same test fails with AssertionError: image_gather4 (the new reason string is guarded).

No blocking findings. No GPU lowering changes here, so no readback test is needed for this slice.

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6068644671 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2735#pullrequestreview-6068644671). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-26T04:42:06Z. **Review:** COMMENTED --- Review of head 0998b82e (comment only). Scope: `op_image_gather4` now raises `Unsupported('image_gather4 requires the guest implicit mip level')` instead of the generic unsupported-opcode message. No new lowering, so the plain gather still cannot reach the fixed-mip path. The doc note matches the code. The sibling gathers (`_lz`, `_l`, `_c*`, `_b`, `_o`) are untouched and keep their own refusal tests. Commands run (worktree on this head): - `git diff --check origin/main...HEAD` -> clean - `python3 tests/docs_links_check.py` -> ok (524 links) - `python3 tests/bidi_controls_check.py` -> ok - `python3 tests/startup_image_gather_lz_check.py` -> passes - Mutation: delete `op_image_gather4` -> the same test fails with `AssertionError: image_gather4` (the new reason string is guarded). No blocking findings. No GPU lowering changes here, so no readback test is needed for this slice. AI-assisted; commands listed were executed locally.
R0Y00 commented 2026-11-26 05:02:21 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-26T04:44:52Z.

Review: APPROVED


The handler only names the missing guest implicit mip proof. I verified that the merge update leaves the translator and test unchanged. The encoded refusal and the fixed-mip GPU checks passed locally on WARP and RTX 4060 Laptop, including a wrong-mip difference at the first pixel. #1802 remains open for mip selection itself.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6068664570 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2735#pullrequestreview-6068664570). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-26T04:44:52Z. **Review:** APPROVED --- The handler only names the missing guest implicit mip proof. I verified that the merge update leaves the translator and test unchanged. The encoded refusal and the fixed-mip GPU checks passed locally on WARP and RTX 4060 Laptop, including a wrong-mip difference at the first pixel. #1802 remains open for mip selection itself.
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
R0Y00/Xbox2Windows!2727
No description provided.