Skip to content

test(agc): pin the library keys in the sample location grid case - #1469

Open
Thimo188 wants to merge 2 commits into
mainfrom
upstream-pr/27364
Open

Thimo188 wants to merge 2 commits into
mainfrom
upstream-pr/27364

Conversation

@Thimo188

@Thimo188 Thimo188 commented Dec 2, 2026 •

Copy link
Copy Markdown
Owner

Imported from boykopovar/AnyPS5#27364, originally opened by Plyxen.

Source commit: a1b09641670de093b155d79442b42ee2e2d53fd4. 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_sample_location_grid_fallback (sampleLocationGridFallbackTests in tests/Graphics.cpp) counts the sample locations each created pipeline takes and requires exactly one per pipeline. With pipeline libraries, that means only the fragment output library may take them.

That holds only for narrow library keys, the default. With APS5_WIDE_LIBRARY_KEYS set, libraryKeys keys the fragment shader library by the full multisample state, and PipelineLibrary.cpp builds that library with info.pMultisampleState, sample locations included, as docs/dev/ENVIRONMENT.md describes for the switch. The mock then records two pipeline uses, and the case fails on every run with the pipeline, its output library or its render pass did not take its sample locations once per pipeline, output library or attachment. The driver is doing what the switch says; the case reads the switch from the environment without setting it.

The case now runs under both settings, as pipelineLibraryDynamicDepthBiasTests and LibraryKeysNarrow.cpp already do. Each draw assigns RuntimeSwitch::WideLibraryKeys, expects two pipeline uses with libraries and wide keys and one otherwise, and the case resets the switch at the end. The existing grid and location checks run over every use, so they now also check that the fragment shader library built under wide keys takes the same locations as the output library.

Tested

Windows 11 Pro 10.0.26200, WinLibs GCC 15.2.0 r7, Release, main 63b2e14408. ANYPS5_REQUIRE_VULKAN=1, ANYPS5_NO_SHADER_CACHE=1, VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation (1.4.363) and VK_LOADER_DEBUG=layer, ctest --test-dir build -R '^agc_driver_sample_location_grid_fallback$' -V, 5 runs per row, with ANYPS5_GPU set to each GPU.

RTX 5080 Radeon gfx1036 iGPU
main passes 5 of 5 passes 5 of 5
main, APS5_WIDE_LIBRARY_KEYS=1 fails 5 of 5 fails 5 of 5
this PR passes 5 of 5 passes 5 of 5
this PR, APS5_WIDE_LIBRARY_KEYS=1 passes 5 of 5 passes 5 of 5

After boykopovar#19943's render pass change landed, I merged main 6f6f6c8e6b into the branch. The Require now keeps main's passSampleLocations.empty() and this PR's two pipeline uses under wide keys. Same setup, 3 runs per row (the case uses a mock device, so the GPU doesn't matter):

main 6f6f6c8e6b this PR merged with it
default passes 3 of 3 passes 3 of 3
APS5_WIDE_LIBRARY_KEYS=1 fails 3 of 3 passes 3 of 3

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: NVIDIA RTX 5080 (621.24) and AMD Radeon gfx1036 iGPU 1002:13c0 (Adrenalin 26.11.2, Vulkan driver 2.0.353), Windows 11; the case uses a mock Vulkan device
  • AI-assisted: yes

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Tests
    • Expanded graphics validation across pipeline and library configurations, with and without depth, and under different wide-key settings. Expected sample-location counts are now checked for each applicable combination.

Plyxen and others added 2 commits November 26, 2026 00:08
agc_driver_sample_location_grid_fallback counts the sample locations each
created pipeline takes and expects one per pipeline, so with pipeline
libraries only the fragment output library may take them. That holds only
for narrow library keys, the default. With APS5_WIDE_LIBRARY_KEYS set the
fragment shader library also takes the full multisample state, sample
locations included, as the switch intends, and the case fails on every
run with "the pipeline, its output library or its render pass did not
take its sample locations once per pipeline, output library or
attachment".

Run the case under both settings, as the other library key cases do,
expect two pipeline uses with libraries and wide keys, and reset the
switch at the end. The existing location checks then also cover the
fragment shader library's copy under wide keys.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ations-wide-keys

# Conflicts:
#	core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
@coderabbitai

coderabbitai Bot commented Dec 2, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

Changes: Sample-location fallback tests

Layer / File(s) Summary
Wide-key test coverage
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
The test runs the existing pipeline and sample-grid cases with wide keys enabled and disabled. It expects two pipeline sample-location records only for library builds with wide keys enabled; otherwise, it expects one. It continues to require no render-pass sample-location records and resets the switch after the test matrix.

Suggested reviewers: chitters2004, frankea

Change: Other

Merge Risk: Minimal · up to a1b09

This change only widens test coverage for sample-location fallback with wide library keys. It does not alter production behavior, and no merge-blocking risk was found.

Security architecture risk: Minimal · up to a1b09

The AgcDriver test now checks sample-location fallback with both narrow and wide library keys. The override stays inside the graphics test process and does not change how the shipped driver selects library keys.

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

Warning

Some tools did not complete. Review the errors below.

Cppcheck (2.22.0)

Cppcheck (2.22.0) exceeded its 180-second time budget. Findings from completed work are retained; remaining checks are incomplete.

core/libs/prx/libSceAgcDriver/tests/Graphics.cpp

Cppcheck interrupted; analysis of this file is incomplete

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: 89fbd956-8927-4f6a-9bda-9182eff453be
Commits

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

Files selected for processing: 1

  • core/libs/prx/libSceAgcDriver/tests/Graphics.cpp

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