test(agc): cover clamp-half-border point sampling on real GPUs #22942

Open
tablefrogpillow wants to merge 1 commit from upstream-pr/22942 into main
tablefrogpillow commented 2026-11-18 14:09:20 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by tablefrogpillow on 2026-11-18T14:09:20Z.


What

Adds a real-GPU execution test, agc_driver_image_sample_clamp_half_border_point, for the S# clamp-mode-4 (clamp, half border) + point-filter sampling behaviour that #22753 fixes. #22753's own test drives the mapping through MockVulkan; this one samples past a texture edge on a real device and asserts the result is the last texel, not the border. A control case (clamp mode 6, full border) confirms the border path still reads the border, so the edge read is meaningful rather than an artefact.

The test fails on current main — the half-border case reads the opaque-white border (0x3f800000) — and passes with #22753 applied, where it reads the last texel (0x3e808081, the 0x40 UNORM value).

Tested

Built agc_driver_image_sample_clamp_half_border_point on #22753 head, ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1, Khronos validation layer 1.4.363 (confirmed Insert instance layer "VK_LAYER_KHRONOS_validation", no "was not found", 0 VUID-):

GPU arch result
RX Vega 56 (RADV VEGA10, gfx900) GCN5 pass
Ryzen 7000 iGPU (RADV RAPHAEL, gfx1036) RDNA2 pass
RX 7900 GRE (RADV NAVI31, gfx1100) RDNA3 pass, 0 VUID
lavapipe software pass

Before/after on NAVI31: on main the half-border case reads 0x3f800000 (white border) and the test fails; with #22753 applied it reads 0x3e808081 and passes. check_conventions.py --base origin/main passes.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: #22753
  • Fixes: none
  • Unblocks: none
  • GPUs tested: RX Vega 56 (RADV VEGA10 gfx900, Mesa 26.2.6, Linux); Ryzen 7000 iGPU (RADV RAPHAEL gfx1036, Linux); RX 7900 GRE (RADV NAVI31 gfx1100, Linux); lavapipe — Khronos validation 1.4.363
  • AI-assisted: yes

🤖 Generated with Claude Code

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5377563799 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/22942). Originally posted by [tablefrogpillow](https://github.com/tablefrogpillow) on 2026-11-18T14:09:20Z. --- ### What Adds a real-GPU execution test, `agc_driver_image_sample_clamp_half_border_point`, for the S# clamp-mode-4 (clamp, half border) + point-filter sampling behaviour that #22753 fixes. #22753's own test drives the mapping through `MockVulkan`; this one samples past a texture edge on a real device and asserts the result is the last texel, not the border. A control case (clamp mode 6, full border) confirms the border path still reads the border, so the edge read is meaningful rather than an artefact. The test fails on current `main` — the half-border case reads the opaque-white border (`0x3f800000`) — and passes with #22753 applied, where it reads the last texel (`0x3e808081`, the 0x40 UNORM value). ### Tested Built `agc_driver_image_sample_clamp_half_border_point` on #22753 head, `ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1`, Khronos validation layer 1.4.363 (confirmed `Insert instance layer "VK_LAYER_KHRONOS_validation"`, no "was not found", 0 `VUID-`): | GPU | arch | result | | --- | --- | --- | | RX Vega 56 (RADV VEGA10, gfx900) | GCN5 | pass | | Ryzen 7000 iGPU (RADV RAPHAEL, gfx1036) | RDNA2 | pass | | RX 7900 GRE (RADV NAVI31, gfx1100) | RDNA3 | pass, 0 VUID | | lavapipe | software | pass | Before/after on NAVI31: on `main` the half-border case reads `0x3f800000` (white border) and the test fails; with #22753 applied it reads `0x3e808081` and passes. `check_conventions.py --base origin/main` passes. ### Checklist - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: #22753 - [x] Fixes: none - [x] Unblocks: none - [x] GPUs tested: RX Vega 56 (RADV VEGA10 gfx900, Mesa 26.2.6, Linux); Ryzen 7000 iGPU (RADV RAPHAEL gfx1036, Linux); RX 7900 GRE (RADV NAVI31 gfx1100, Linux); lavapipe — Khronos validation 1.4.363 - [x] AI-assisted: yes 🤖 Generated with [Claude Code](https://claude.com/claude-code)
MarcZX10 commented 2026-11-23 05:06:22 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-23T05:06:22Z.

Review: APPROVED


Reviewed — looks good

The complete changed file supports the described real-GPU clamp-half-border regression check; its reported hardware runs are author-supplied and were not rerun here.

What I ran

Reviewed head 1eb497d163bb263c23442bfe5a951638f8ca7878 using the pinned repository reader repo_read.py. No build or test commands were run. I read description.md, commits.md, manifest.json, diff.patch, review/README.md, the full changed file, and ImageSampleBorderColor.cpp for comparison. files.json was not available; the review listing showed one changed file and no excluded changed files.

Results

Check Result Note
Changed source review passed All 111 added lines read
Build and execution not run Hardware results in description only
House-rule files not applicable Rules supplied in prompt

Findings

Blocking

None.

Non-blocking

None.

Not verified

Compilation and execution on any GPU were not verified in this review. The author reports successful runs on Vega 56, Ryzen 7000 iGPU, RX 7900 GRE, and lavapipe; these are not independently confirmed here. No files were excluded according to the review listing.

To get this to a good state

Nothing is required.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:6016810178 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/22942#pullrequestreview-6016810178). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-23T05:06:22Z. **Review:** APPROVED --- # Reviewed — looks good The complete changed file supports the described real-GPU clamp-half-border regression check; its reported hardware runs are author-supplied and were not rerun here. ## What I ran Reviewed head `1eb497d163bb263c23442bfe5a951638f8ca7878` using the pinned repository reader `repo_read.py`. No build or test commands were run. I read `description.md`, `commits.md`, `manifest.json`, `diff.patch`, `review/README.md`, the full changed file, and `ImageSampleBorderColor.cpp` for comparison. `files.json` was not available; the review listing showed one changed file and no excluded changed files. ## Results | Check | Result | Note | |---|---|---| | Changed source review | passed | All 111 added lines read | | Build and execution | not run | Hardware results in description only | | House-rule files | not applicable | Rules supplied in prompt | ## Findings ### Blocking None. ### Non-blocking None. ## Not verified Compilation and execution on any GPU were not verified in this review. The author reports successful runs on Vega 56, Ryzen 7000 iGPU, RX 7900 GRE, and lavapipe; these are not independently confirmed here. No files were excluded according to the review listing. ## To get this to a good state Nothing is required.
ligmaSec commented 2026-12-03 22:00:56 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by ligmaSec on 2026-12-03T22:00:56Z.

Review: COMMENTED


The full-border control samples the same coordinate, so the two readbacks distinguish the last texel from the border color. The fixture intentionally fails on current main and requires #22753. Please merge or schedule it with that implementation, or keep the fixture with the fixing PR. I queued the same added test on the baseline and the combined change so the expected failure remains visible.

AI-assisted: yes.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:6179363116 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/22942#pullrequestreview-6179363116). Originally posted by [ligmaSec](https://github.com/ligmaSec) on 2026-12-03T22:00:56Z. **Review:** COMMENTED --- The full-border control samples the same coordinate, so the two readbacks distinguish the last texel from the border color. The fixture intentionally fails on current `main` and requires #22753. Please merge or schedule it with that implementation, or keep the fixture with the fixing PR. I queued the same added test on the baseline and the combined change so the expected failure remains visible. AI-assisted: yes.
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/22942:upstream-pr/22942'
git switch 'upstream-pr/22942'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/22942'
git switch 'upstream-pr/22942'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/22942'
git switch 'upstream-pr/22942'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/22942'
git switch 'main'
git merge --squash 'upstream-pr/22942'
git switch 'main'
git merge --ff-only 'upstream-pr/22942'
git switch 'main'
git merge 'upstream-pr/22942'
git push origin 'main'
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
boykopovar/AnyPS5!22942
No description provided.