Skip to content

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

Open
Thimo188 wants to merge 1 commit into
mainfrom
upstream-pr/27671
Open

Thimo188 wants to merge 1 commit into
mainfrom
upstream-pr/27671

Conversation

@Thimo188

@Thimo188 Thimo188 commented Dec 2, 2026 •

Copy link
Copy Markdown
Owner

Imported from boykopovar/AnyPS5#27671, originally opened by peacocksir.

Source commit: 3ea90053d0977e4c3168fb8876ba726e1f2baa37. The import branch preserves this fetched upstream PR snapshot. The description and validation below are copied from upstream; no new code changes or test runs were made for this import. Original reviews, discussions, and attachments remain at the linked upstream PR.


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. boykopovar#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 boykopovar#22665 fixed. I ran this branch's test with two local changes, one at a time:

  • fix(agc): sample S# filter mode 3 as a weighted average boykopovar/AnyPS5#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:

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 boykopovar#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
    • Graphics validation now handles devices that report minimum/maximum filtering as unsupported. The affected comparison is skipped when that specific limitation occurs, while other errors continue to be reported and the remaining image comparison still runs. This makes test results more robust across supported hardware capabilities without changing application functionality.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Dec 2, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

Changes: Image filter test

Layer / File(s) Summary
Mode-1 capture and comparison
core/libs/prx/libSceAgcDriver/tests/execution/ImageFilterModeThree.cpp
The mode-1 draw and capture handle the matching format-37 limitation by reporting a skip. Other errors propagate. The bilinear-versus-min image comparison runs only after a successful capture.

Suggested reviewers: jjenkx

Change: Other

Merge Risk: Minimal · up to 3ea90

This only changes a test so that it no longer fails on devices that lack min/max filtering support for this format. It does not affect production behavior, and there are no merge-blocking concerns.

Security architecture risk: Minimal · up to 3ea90

The test now continues to check filter mode 3 on Vulkan devices that lack the min/max filtering support needed by its control draw. Production sampler validation is unchanged.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Usage-based review receipt

  • Mode: Continue automatically
  • Reviewed files: 1
  • Waived: $0.25 (charged $0.00)
  • View usage details

Note

This review exceeded your plan’s limits and used usage-based reviews—free during trial, billed after paid activation unless disabled. Manage usage-based reviews.

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 2f09d8a5-f842-437d-9329-9fca9840c16c
Commits

Reviewing files that changed from the base of the PR and between 4131f51 and 3ea9005.

Files selected for processing: 1

  • core/libs/prx/libSceAgcDriver/tests/execution/ImageFilterModeThree.cpp

Limit details: You’ve used all 10 included reviews currently available.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants