test(agc): check filter mode 3 on devices without min/max filtering #27671

Open
peacocksir wants to merge 1 commit from upstream-pr/27671 into main
peacocksir commented 2026-11-26 22:12:39 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by peacocksir on 2026-11-26T22:12:39Z.


What

agc_driver_image_filter_mode_three fails on main on Mesa lavapipe, the Vulkan device of the Linux CI job: AGC graphics: a sampled texture whose format 37 does not support min/max filtering is sampled through a min or max reduction sampler with linear filtering. #22665 added the test. Before it compares filter mode 3 with filter mode 0, it draws once with a min sampler (filter mode 1) as a control, to show the draw filters between texels. That control draw needs VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_MINMAX_BIT on VK_FORMAT_R8G8B8A8_UNORM, which Sampler.cpp checks. lavapipe 25.2.8 lists that feature only for single-component color formats and depth formats, not for R8G8B8A8_UNORM (vulkaninfo --show-formats), so the test stops at the control and never reaches the mode 3 check.

The control draw now catches exactly that message, the same message ImageSampleReduction.cpp accepts for the same limit. It prints min sampler control skipped, the device lacks min/max filtering of 8_8_8_8 UNORM and then runs the mode 3 comparison as before. Any other exception from the control draw fails the test, and the mode 3 draw is outside the catch. A device with min/max filtering on that format runs exactly what main runs. No production code changes.

Without min/max filtering, the test can no longer show that the draw filters between texels, so identical but meaningless output from modes 0 and 3 would pass there. On such a device main fails before reaching any check, so this PR loses no coverage there.

Tested

Ubuntu 24.04, kernel 6.8, GCC 13.3.0, Ninja, Release, BUILD_TESTING=ON. Head 3ea90053d0 on main 00b15fcbb0. GPU: Mesa lavapipe 25.2.8 (llvmpipe (LLVM 20.1.2, 256 bits)), /dev/udmabuf available. Validation layer built from source, 1.4.335.

Focused runs, main's test file and this branch's in the same build tree, 3 runs each, with ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation VK_LOADER_DEBUG=layer ctest --test-dir build -R '^agc_driver_image_filter_mode_three$' -V:

Result Output
main Failed 3/3 ... format 37 does not support min/max filtering is sampled through a min or max reduction sampler with linear filtering
this PR Passed 3/3 min sampler control skipped, the device lacks min/max filtering of 8_8_8_8 UNORM, filter mode 3 tests passed

Every log shows Insert instance layer "VK_LAYER_KHRONOS_validation", none shows was not found but was requested by env var VK_INSTANCE_LAYERS, and none contains VUID-.

The mode 3 check still runs on lavapipe and still catches the bug #22665 fixed. I ran this branch's test with two local changes, one at a time:

  • #22665's production changes (GuestSamplerResource.cpp, ResourceMaterializer.cpp) reverted: fails 3/3 with AGC graphics: guest sampler descriptor uses an unknown reduction filter mode 3, after the skip line.
  • mode 3 mapped to VK_SAMPLER_REDUCTION_MODE_MIN_EXT in toVkReductionMode, with the materializeBlendingReductions call removed: fails 1/1 (on the previous base 7164924690) with the min/max filtering error, now at the mode 3 draw.

Full ctest --test-dir build --output-on-failure -j6 on this branch: 7059/7064 pass. The 5 failures are in other test executables, built from files this PR does not touch:

  • agc_driver_image_d16_load: also new on main since #22750; a 16_FLOAT signaling NaN comes back quieted on lavapipe. Not addressed here.
  • agc_driver_scattered_runs: Mesa before 26 (#21649).
  • guest_json_copy_failure (SIGSEGV), guest_libressl3_object_header (timeout) and nkwebkit_wtf (abort): on the previous base 7164924690 these failed the same way with main's test file in the same build tree.

main's own Linux CI job fails the same way: run 45802485224, on 37c33ad6b0, reports 99% tests passed, 1 tests failed out of 7016, the one failure being agc_driver_image_filter_mode_three with the format 37 error above.

python3 tools/check_conventions.py --base origin/main: all checks passed. python3 tools/pr_overlap.py --branch: no overlap with open pull requests.

Not tested: any real GPU or console. On a device with min/max filtering of R8G8B8A8_UNORM, the new catch is never reached and the test runs what main runs.

Open #27452 also changes filter mode 3 handling (DescriptorBindingBuilder.cpp and the sampler tests in GuestSamplerResource.cpp). It does not touch this test file, and the two PRs do not depend on each other.

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 and the licence notice of code adapted from upstream (see AGENTS.md)
  • 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: Mesa lavapipe 25.2.8 (Linux)
  • AI-assisted: yes

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Tests
    • The image-filter test now skips the min-filter comparison when the filter mode is unsupported, while continuing to fail on unexpected errors.
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5517856037 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/27671). Originally posted by [peacocksir](https://github.com/peacocksir) on 2026-11-26T22:12:39Z. --- ### What `agc_driver_image_filter_mode_three` fails on `main` on Mesa lavapipe, the Vulkan device of the Linux CI job: `AGC graphics: a sampled texture whose format 37 does not support min/max filtering is sampled through a min or max reduction sampler with linear filtering`. #22665 added the test. Before it compares filter mode 3 with filter mode 0, it draws once with a min sampler (filter mode 1) as a control, to show the draw filters between texels. That control draw needs `VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_MINMAX_BIT` on `VK_FORMAT_R8G8B8A8_UNORM`, which `Sampler.cpp` checks. lavapipe 25.2.8 lists that feature only for single-component color formats and depth formats, not for `R8G8B8A8_UNORM` (`vulkaninfo --show-formats`), so the test stops at the control and never reaches the mode 3 check. The control draw now catches exactly that message, the same message `ImageSampleReduction.cpp` accepts for the same limit. It prints `min sampler control skipped, the device lacks min/max filtering of 8_8_8_8 UNORM` and then runs the mode 3 comparison as before. Any other exception from the control draw fails the test, and the mode 3 draw is outside the catch. A device with min/max filtering on that format runs exactly what `main` runs. No production code changes. Without min/max filtering, the test can no longer show that the draw filters between texels, so identical but meaningless output from modes 0 and 3 would pass there. On such a device `main` fails before reaching any check, so this PR loses no coverage there. ### Tested <!-- OS, title or homebrew, what was checked. "Not tested" is a valid answer. A performance change: the summary lines of main and of this PR from the same machine and scene, with the traces attached, captured as the Performance report issue form describes. --> Ubuntu 24.04, kernel 6.8, GCC 13.3.0, Ninja, Release, `BUILD_TESTING=ON`. Head `3ea90053d0` on `main` `00b15fcbb0`. GPU: Mesa lavapipe 25.2.8 (`llvmpipe (LLVM 20.1.2, 256 bits)`), `/dev/udmabuf` available. Validation layer built from source, 1.4.335. Focused runs, `main`'s test file and this branch's in the same build tree, 3 runs each, with `ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation VK_LOADER_DEBUG=layer ctest --test-dir build -R '^agc_driver_image_filter_mode_three$' -V`: | | Result | Output | |---|---|---| | `main` | Failed 3/3 | `... format 37 does not support min/max filtering is sampled through a min or max reduction sampler with linear filtering` | | this PR | Passed 3/3 | `min sampler control skipped, the device lacks min/max filtering of 8_8_8_8 UNORM`, `filter mode 3 tests passed` | Every log shows `Insert instance layer "VK_LAYER_KHRONOS_validation"`, none shows `was not found but was requested by env var VK_INSTANCE_LAYERS`, and none contains `VUID-`. The mode 3 check still runs on lavapipe and still catches the bug #22665 fixed. I ran this branch's test with two local changes, one at a time: - #22665's production changes (`GuestSamplerResource.cpp`, `ResourceMaterializer.cpp`) reverted: fails 3/3 with `AGC graphics: guest sampler descriptor uses an unknown reduction filter mode 3`, after the skip line. - mode 3 mapped to `VK_SAMPLER_REDUCTION_MODE_MIN_EXT` in `toVkReductionMode`, with the `materializeBlendingReductions` call removed: fails 1/1 (on the previous base `7164924690`) with the min/max filtering error, now at the mode 3 draw. Full `ctest --test-dir build --output-on-failure -j6` on this branch: 7059/7064 pass. The 5 failures are in other test executables, built from files this PR does not touch: - `agc_driver_image_d16_load`: also new on `main` since #22750; a 16_FLOAT signaling NaN comes back quieted on lavapipe. Not addressed here. - `agc_driver_scattered_runs`: Mesa before 26 (#21649). - `guest_json_copy_failure` (SIGSEGV), `guest_libressl3_object_header` (timeout) and `nkwebkit_wtf` (abort): on the previous base `7164924690` these failed the same way with `main`'s test file in the same build tree. `main`'s own Linux CI job fails the same way: [run 45802485224](https://github.com/boykopovar/AnyPS5/actions/runs/45802485224), on `37c33ad6b0`, reports `99% tests passed, 1 tests failed out of 7016`, the one failure being `agc_driver_image_filter_mode_three` with the format 37 error above. `python3 tools/check_conventions.py --base origin/main`: all checks passed. `python3 tools/pr_overlap.py --branch`: no overlap with open pull requests. Not tested: any real GPU or console. On a device with min/max filtering of `R8G8B8A8_UNORM`, the new catch is never reached and the test runs what `main` runs. Open #27452 also changes filter mode 3 handling (`DescriptorBindingBuilder.cpp` and the sampler tests in `GuestSamplerResource.cpp`). It does not touch this test file, and the two PRs do not depend on each other. ### 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 - [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) and the licence notice of code adapted from upstream (see AGENTS.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: Mesa lavapipe 25.2.8 (Linux) - [x] AI-assisted: yes 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> <!-- coderabbit-ai-generated:v1 --> ## Summary by CodeRabbit * **Tests** * The image-filter test now skips the min-filter comparison when the filter mode is unsupported, while continuing to fail on unexpected errors. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
MarcZX10 commented 2026-11-26 22:48:24 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-26T22:48:24Z.

Review: COMMENTED


Reviewed — no blocking findings

The change appears consistent with its stated goal, but I could not independently run the reported checks in this review environment.

What I ran

Reviewed head 3ea90053d0977e4c3168fb8876ba726e1f2baa37. Read the PR description, commit list, manifest, diff, and the full changed test file. No commands or tests were run. The description reports Linux lavapipe test runs; those are author-reported results.

Results

Check Result Note
Changed file review passed One changed file read in full
Focused and full test runs not run Results supplied by author
Console or real GPU behavior not run Not tested by author

Findings

Blocking

None.

Non-blocking

None.

Not verified

The author reports that the focused test passed three times on lavapipe and that the full suite passed 7059/7064 tests; I did not reproduce those results. No other files were changed or excluded from the review. The changed test file was read in full.

To get this to a good state

Nothing is required. The reported tests are useful evidence, but were not independently run here.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:6081243416 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/27671#pullrequestreview-6081243416). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-26T22:48:24Z. **Review:** COMMENTED --- # Reviewed — no blocking findings The change appears consistent with its stated goal, but I could not independently run the reported checks in this review environment. ## What I ran Reviewed head `3ea90053d0977e4c3168fb8876ba726e1f2baa37`. Read the PR description, commit list, manifest, diff, and the full changed test file. No commands or tests were run. The description reports Linux lavapipe test runs; those are author-reported results. ## Results | Check | Result | Note | |---|---|---| | Changed file review | passed | One changed file read in full | | Focused and full test runs | not run | Results supplied by author | | Console or real GPU behavior | not run | Not tested by author | ## Findings ### Blocking None. ### Non-blocking None. ## Not verified The author reports that the focused test passed three times on lavapipe and that the full suite passed 7059/7064 tests; I did not reproduce those results. No other files were changed or excluded from the review. The changed test file was read in full. ## To get this to a good state Nothing is required. The reported tests are useful evidence, but were not independently run here.
ligmaSec commented 2026-12-03 13:45:51 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by ligmaSec on 2026-12-03T13:45:51Z.

Review: COMMENTED


The scalar-buffer-base CTest passed on both builds on Linux Mesa lavapipe with Khronos validation 1.4.369. The filter-mode-3 test failed on main when it reached the unsupported min/max sampler. The change passed, with that sampler control explicitly skipped. Both logs show validation insertion with zero missing-layer diagnostics or VUIDs.

AI-assisted: yes.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:6170994748 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/27671#pullrequestreview-6170994748). Originally posted by [ligmaSec](https://github.com/ligmaSec) on 2026-12-03T13:45:51Z. **Review:** COMMENTED --- The scalar-buffer-base CTest passed on both builds on Linux Mesa lavapipe with Khronos validation 1.4.369. The filter-mode-3 test failed on main when it reached the unsupported min/max sampler. The change passed, with that sampler control explicitly skipped. Both logs show validation insertion with zero missing-layer diagnostics or VUIDs. 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/27671:upstream-pr/27671'
git switch 'upstream-pr/27671'

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