test(agc): skip the emulated color compare clamp cases without MinLod #7058

Merged
seradavid merged 1 commit from upstream-pr/7058 into main 2026-10-17 11:24:41 +00:00
seradavid commented 2026-10-17 09:28:59 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by seradavid on 2026-10-17T09:28:59Z.


What

agc_driver_emulated_color_compare fails on a device without shaderResourceMinLod instead of skipping the cases that need it.

The offset cases compile OffsetCode, an image_sample_cb_cl_o. The emitter reaches the LOD clamp of that instruction only through the device's shaderResourceMinLod and refuses the shader without it (the gate #388 left in place), so every one of those cases failed, at the first of them, point, wrap with negative offsets. ImageSampleLodClamp and ImageSampleBiasA16 already skip what a device without the feature cannot run.

The test now reads CapabilityMinLod once and skips only the cases that compile OffsetCode: point, wrap with negative offsets, the three offsets, bias and LOD clamp cases, and the cached bilinear case with offsets. Every other case still runs, including the Reject for the native R32 float offset case, which is refused before the emitter and needs no guard. A closing note names the cases that were skipped.

Found on llvmpipe (Mesa 25.0.7, Debian 13 under WSL2); lavapipe reports the feature from Mesa 25.2.8, so CI runs all of the cases and the guard changes nothing there.

The skip is conservative: the guarded cases themselves pass on the same device when the emitter's capability check is moved to the branch that actually emits the MinLod image operand (the compute stage takes the explicit-LOD path, where the clamp is folded with FMax and no MinLod operand is emitted). That gate, not the color comparison emulation, is what asks for the feature; relaxing it is a separate question and is not part of this change.

#907 rewrites this test file and keeps the same offset cases, so the guard is needed after it too. That PR and this one overlap on those lines, and whichever lands second rebases; this change does not build on it.

Tested

Debian 13 under WSL2 (6.18.54.1-microsoft-standard-WSL2), GCC 14.2.0, Release, BUILD_TESTING=ON, lavapipe (llvmpipe), on both sides of the feature:

  • Mesa 25.0.7 (no shaderResourceMinLod): agc_driver_emulated_color_compare and its _srgb_decode variant failed before the change at point, wrap with negative offsets and pass after it, with the note that the offset and LOD clamp cases were skipped. Full ctest -j 8: 1339 tests, 0 failed, 63 skipped, 23 s.
  • Mesa 26.1.6 (mesa-vulkan-drivers 26.1.6-1~bpo13+1, installed from trixie-backports): both tests pass without the note, so the guarded cases run, and agc_driver_image_sample_lod_clamp passes instead of skipping. Full ctest -j 8: 1339 tests, 0 failed, 59 skipped (five tests that skip without the feature now run; agc_driver_f64_fma_subnormals skips on 26.1.6 where it passes on 25.0.7, on its documented f64 denormal path, unrelated to this change).

The image_sample and gather tests pass on both.

Not tested: a title; a GPU whose driver is not lavapipe. CI's lavapipe has the feature, so the guarded cases keep their coverage there.

Checklist

  • Based on current main; no other open PR implements the same functions (#907 rewrites this test file and overlaps the offset-case lines changed here, but does not add a capability guard; the guard is still needed after it)
  • 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: none
  • Fixes: none
  • Unblocks: none
  • GPUs tested: lavapipe (llvmpipe) on Linux (WSL2), Mesa 25.0.7 and Mesa 26.1.6 (26.1.6-1~bpo13+1)
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4898953632 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7058). Originally posted by [seradavid](https://github.com/seradavid) on 2026-10-17T09:28:59Z. --- ### What `agc_driver_emulated_color_compare` fails on a device without `shaderResourceMinLod` instead of skipping the cases that need it. The offset cases compile `OffsetCode`, an `image_sample_cb_cl_o`. The emitter reaches the LOD clamp of that instruction only through the device's `shaderResourceMinLod` and refuses the shader without it (the gate #388 left in place), so every one of those cases failed, at the first of them, `point, wrap with negative offsets`. `ImageSampleLodClamp` and `ImageSampleBiasA16` already skip what a device without the feature cannot run. The test now reads `CapabilityMinLod` once and skips only the cases that compile `OffsetCode`: `point, wrap with negative offsets`, the three `offsets, bias and LOD clamp` cases, and the cached bilinear case with offsets. Every other case still runs, including the `Reject` for the native R32 float offset case, which is refused before the emitter and needs no guard. A closing note names the cases that were skipped. Found on llvmpipe (Mesa 25.0.7, Debian 13 under WSL2); lavapipe reports the feature from Mesa 25.2.8, so CI runs all of the cases and the guard changes nothing there. The skip is conservative: the guarded cases themselves pass on the same device when the emitter's capability check is moved to the branch that actually emits the `MinLod` image operand (the compute stage takes the explicit-LOD path, where the clamp is folded with `FMax` and no `MinLod` operand is emitted). That gate, not the color comparison emulation, is what asks for the feature; relaxing it is a separate question and is not part of this change. #907 rewrites this test file and keeps the same offset cases, so the guard is needed after it too. That PR and this one overlap on those lines, and whichever lands second rebases; this change does not build on it. ### Tested Debian 13 under WSL2 (`6.18.54.1-microsoft-standard-WSL2`), GCC 14.2.0, Release, `BUILD_TESTING=ON`, lavapipe (llvmpipe), on both sides of the feature: - Mesa 25.0.7 (no `shaderResourceMinLod`): `agc_driver_emulated_color_compare` and its `_srgb_decode` variant failed before the change at `point, wrap with negative offsets` and pass after it, with the note that the offset and LOD clamp cases were skipped. Full `ctest -j 8`: 1339 tests, 0 failed, 63 skipped, 23 s. - Mesa 26.1.6 (`mesa-vulkan-drivers` 26.1.6-1~bpo13+1, installed from `trixie-backports`): both tests pass without the note, so the guarded cases run, and `agc_driver_image_sample_lod_clamp` passes instead of skipping. Full `ctest -j 8`: 1339 tests, 0 failed, 59 skipped (five tests that skip without the feature now run; `agc_driver_f64_fma_subnormals` skips on 26.1.6 where it passes on 25.0.7, on its documented f64 denormal path, unrelated to this change). The `image_sample` and gather tests pass on both. Not tested: a title; a GPU whose driver is not lavapipe. CI's lavapipe has the feature, so the guarded cases keep their coverage there. ### Checklist <!-- Rules behind each item: https://github.com/boykopovar/AnyPS5/blob/main/CONTRIBUTING.md --> - [x] Based on current `main`; no other open PR implements the same functions (#907 rewrites this test file and overlaps the offset-case lines changed here, but does not add a capability guard; the guard is still needed after it) - [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: none - [x] Fixes: none - [x] Unblocks: none - [x] GPUs tested: lavapipe (llvmpipe) on Linux (WSL2), Mesa 25.0.7 and Mesa 26.1.6 (26.1.6-1~bpo13+1) - [x] AI-assisted: yes
github-actions[bot] commented 2026-10-17 09:38:01 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-17T09:38:01Z.


Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.

Pull request Shared files not compared
PR 907 core/libs/prx/libSceAgcDriver/tests/execution/EmulatedColorCompare.cpp
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6232376896 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7058#issuecomment-6232376896). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-17T09:38:01Z. --- <!-- pr-overlap --> Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap. | Pull request | Shared files not compared | |---|---| | [PR 907](https://www.github.com/boykopovar/AnyPS5/pull/907) | `core/libs/prx/libSceAgcDriver/tests/execution/EmulatedColorCompare.cpp` |
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!7058
No description provided.