shader: probe native gfx1030 2D gather clamps #2750

Open
github-bot wants to merge 1 commit from github-bot/gh-2750 into main AGit
Owner

@⁠stan495 on GitHub · 2026-11-26 05:44 UTC · original
stan495:codex/gfx1030-mimg-gather-clamp-probe-refresh → main · +271 −0 · 2 files · 1 commits · draft

Behavior

Generate source-built native gfx1030 probes for image_gather4_cl, image_gather4_b_cl, image_gather4_c_cl, image_gather4_c_b_cl, and the four signed-offset forms. The external graphics runner draws them with the three-level RGBA32F texture and native pixel ABI from #1643, which is already on main. This patch does not depend on the Vulkan bias runner.

A native image_get_lod draw checks implicit LOD 1 and twelve explicit-LOD draws pin mip layout and gather tap order. The sixteen instruction trials distinguish an upper or lower clamp, either bound before bias, and an ignored clamp. The readback classifier requires one model to explain all trials after the controls match. This is an integer-mip probe, not support for fractional thresholds or alternate views. No AOT lowering or semantic coverage is added.

Verification

Tested clean 82bb3631973008a5c96cf2e18b8ca81b0b4ec8b8, based on 651577a07f1d7122b21bf6f0010ee0903272b14c.

python3 -B tests/pixel_gather_clamp_probe.py --binary llvm-mc-15 llvm-objcopy-15 libLLVM-15.so.1
python3 -B tests/pixel_gather_bias_probe.py --binary llvm-mc-15 llvm-objcopy-15 libLLVM-15.so.1
python3 -B tests/pixel_gather_check.py --binary llvm-mc-15 llvm-objcopy-15 libLLVM-15.so.1
python3 -B tests/pixel_compare_gather_check.py --binary llvm-mc-15 llvm-objcopy-15 libLLVM-15.so.1
python3 -B tests/docs_links_check.py
python3 -B tests/bidi_controls_check.py
git diff --check HEAD^ HEAD

Ubuntu LLVM 15.0.7 assembled, extracted and disassembled all 29 clamp programs and matched exact instruction bytes for the eight clamp mnemonics. The adjacent checks passed: 24 existing bias shaders, 24 ordinary LLVM/archive CLI cases, six comparison LLVM/archive CLI forms, docs links, bidi controls and diff checks.

The classifier accepted all five synthetic model signatures, with 16 synthetic trial files and 13 synthetic controls per signature. For each signature, the synthetic control files use the emitted *.expected.rgba32f bytes; the trial files copy the expected mip bytes named by the manifest's model prediction. Replacing the mip-1 control with mip 2 returned 1 at image_gather4-explicit-mip1, pixel (0,0), tap 0: expected 4625, actual 8705. Mixing trials from two models also returned 1 (no unique clamp interpretation across all draws, candidates=[]). These are CPU-model readbacks, not native execution.

python3 -B tests/pixel_gather_clamp_probe.py --classify out/native-gather-clamp-readbacks

For hardware reproduction, draw the 29 shaders listed in out/gfx1030-gather-clamp-probe/manifest.json with a native gfx1030 graphics runner before running the classifier. Save all tightly packed RGBA32F readbacks and record the adapter, driver and runtime. Ordinary biased gather's Vulkan extension does not provide this path for clamp or comparison gather, so no Vulkan draw is claimed here. Native readbacks are pending. These standalone probes are not CTest cases and add no passing FORM_COVERAGE_RECORD entries.

Local merge simulation against 1ec01d7037d30fbdc383d48dceb43ad8c48e0f0b passed independently and with the Vulkan bias probe in either order. The merged tree was not used for the execution results above.

**@⁠stan495** on GitHub · 2026-11-26 05:44 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/2750) `stan495:codex/gfx1030-mimg-gather-clamp-probe-refresh` → `main` · +271 −0 · 2 files · 1 commits · draft ## Behavior Generate source-built native gfx1030 probes for `image_gather4_cl`, `image_gather4_b_cl`, `image_gather4_c_cl`, `image_gather4_c_b_cl`, and the four signed-offset forms. The external graphics runner draws them with the three-level RGBA32F texture and native pixel ABI from #1643, which is already on `main`. This patch does not depend on the Vulkan bias runner. A native `image_get_lod` draw checks implicit LOD 1 and twelve explicit-LOD draws pin mip layout and gather tap order. The sixteen instruction trials distinguish an upper or lower clamp, either bound before bias, and an ignored clamp. The readback classifier requires one model to explain all trials after the controls match. This is an integer-mip probe, not support for fractional thresholds or alternate views. No AOT lowering or semantic coverage is added. ## Verification Tested clean `82bb3631973008a5c96cf2e18b8ca81b0b4ec8b8`, based on `651577a07f1d7122b21bf6f0010ee0903272b14c`. ```sh python3 -B tests/pixel_gather_clamp_probe.py --binary llvm-mc-15 llvm-objcopy-15 libLLVM-15.so.1 python3 -B tests/pixel_gather_bias_probe.py --binary llvm-mc-15 llvm-objcopy-15 libLLVM-15.so.1 python3 -B tests/pixel_gather_check.py --binary llvm-mc-15 llvm-objcopy-15 libLLVM-15.so.1 python3 -B tests/pixel_compare_gather_check.py --binary llvm-mc-15 llvm-objcopy-15 libLLVM-15.so.1 python3 -B tests/docs_links_check.py python3 -B tests/bidi_controls_check.py git diff --check HEAD^ HEAD ``` Ubuntu LLVM 15.0.7 assembled, extracted and disassembled all 29 clamp programs and matched exact instruction bytes for the eight clamp mnemonics. The adjacent checks passed: 24 existing bias shaders, 24 ordinary LLVM/archive CLI cases, six comparison LLVM/archive CLI forms, docs links, bidi controls and diff checks. The classifier accepted all five synthetic model signatures, with 16 synthetic trial files and 13 synthetic controls per signature. For each signature, the synthetic control files use the emitted `*.expected.rgba32f` bytes; the trial files copy the expected mip bytes named by the manifest's model prediction. Replacing the mip-1 control with mip 2 returned 1 at `image_gather4-explicit-mip1`, pixel `(0,0)`, tap 0: expected `4625`, actual `8705`. Mixing trials from two models also returned 1 (`no unique clamp interpretation across all draws, candidates=[]`). These are CPU-model readbacks, not native execution. ```sh python3 -B tests/pixel_gather_clamp_probe.py --classify out/native-gather-clamp-readbacks ``` For hardware reproduction, draw the 29 shaders listed in `out/gfx1030-gather-clamp-probe/manifest.json` with a native gfx1030 graphics runner before running the classifier. Save all tightly packed RGBA32F readbacks and record the adapter, driver and runtime. Ordinary biased gather's Vulkan extension does not provide this path for clamp or comparison gather, so no Vulkan draw is claimed here. Native readbacks are pending. These standalone probes are not CTest cases and add no passing `FORM_COVERAGE_RECORD` entries. Local merge simulation against `1ec01d7037d30fbdc383d48dceb43ad8c48e0f0b` passed independently and with the Vulkan bias probe in either order. The merged tree was not used for the execution results above.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-27 01:19:59 +00:00
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/2750/head:github-bot/gh-2750'
git switch 'github-bot/gh-2750'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-2750'
git switch 'github-bot/gh-2750'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-2750'
git switch 'github-bot/gh-2750'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-2750'
git switch 'main'
git merge --squash 'github-bot/gh-2750'
git switch 'main'
git merge --ff-only 'github-bot/gh-2750'
git switch 'main'
git merge 'github-bot/gh-2750'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.