Skip to content

test(agc): skip 2D MSAA resinfo fragment counts the device cannot render - #25334

Merged
oneandonlydean merged 1 commit into
boykopovar:mainfrom
peacocksir:test/resinfo-msaa-sample-skip
Nov 22, 2026
Merged

oneandonlydean merged 1 commit into
boykopovar:mainfrom
peacocksir:test/resinfo-msaa-sample-skip

Conversation

@peacocksir

Copy link
Copy Markdown
Contributor

What

agc_driver_image_resinfo_dimension fails on main on Mesa lavapipe, the Vulkan device of the Linux CI job: AGC graphics: the device cannot render color with the target's sample count. #19682 added 2D MSAA T#s with 2, 4 and 8 fragments to it, and binding one goes through MultisampleTarget.cpp, which requires the count in framebufferColorSampleCounts. lavapipe reports only SAMPLE_COUNT_1_BIT and SAMPLE_COUNT_4_BIT, so the 2-fragment case throws and the 4- and 8-fragment cases never run. main's own Linux job shows the same failure at ef7dc4452d (run 44949893769, job linux, runner anyps5-3-linux-2).

Each 2D MSAA case now catches exactly that message, the way ResolveTests in PackedFloatColorTarget.cpp does, and prints <n>-fragment 2D MSAA resinfo skipped, the device lacks <n>-sample color attachments (matched by DEVICE_LIMITATION in tools/check_skips.py). Any other exception is rethrown, and the remaining fragment counts still run. A device that supports all three counts runs exactly what main runs. No production code changes.

Tested

Ubuntu 24.04.4, kernel 6.8, GCC 13.3.0, Ninja, Release, BUILD_TESTING=ON. Head f7a60a3842 on main d3a7b0bcd8. GPU: Mesa lavapipe 25.2.8 (llvmpipe (LLVM 20.1.2, 256 bits), 8-lane subgroups), /dev/udmabuf available. Validation layer built from source, 1.4.335.

Focused run, main's test file and this branch's in the same build tree, 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_resinfo_dimension$' -V:

Result Output
main Failed AGC graphics: the device cannot render color with the target's sample count
this PR Passed 2-fragment 2D MSAA resinfo skipped, the device lacks 2-sample color attachments, 8-fragment ... 8-sample ..., image resinfo dimension tests passed

Both logs show Insert instance layer "VK_LAYER_KHRONOS_validation", neither shows was not found but was requested by env var VK_INSTANCE_LAYERS, and neither contains VUID-.

The 4-fragment case still runs on lavapipe and still checks #19682's fix: with #19682's two shader changes (ResourceMaterializer.cpp, SpirvImageEmitter.cpp) reverted locally, this branch fails with image_get_resinfo: the 2D MSAA query returned 8x8x0 levels 0, RDNA 2 returns 8x8x0 levels 1 after the 2-fragment skip line. That was checked at the first base, ef7dc4452d; since then main changed neither the test file, MultisampleTarget.cpp nor check_skips.py.

Full ctest --test-dir build --output-on-failure -j6 at the head above: 6550/6556 pass. The 6 failures are in other executables, which this change does not touch, and each also fails with main's code on this machine:

On an earlier full run at ef7dc4452d, agc_driver_frame_replay_rewind_copy failed once (no memory delta was read while 1 submissions waited for the CPU) and then passed 3 of 3 on its own.

python3 tools/check_conventions.py --base origin/main: all checks passed. tools/pr_overlap.py --branch could not compare #7085 and #22724, both of which conflict with main. I compared them by hand: both add mip-level cases to this file and neither touches the 2D MSAA loop.

Not tested: real GPUs (no Windows or NVIDIA, AMD or Intel run), macOS, titles. On a device that supports 2, 4 and 8 color samples, the new catch is never reached.

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 (llvmpipe, LLVM 20.1.2), Ubuntu 24.04, CPU Vulkan only
  • AI-assisted: yes

🤖 Generated with Claude Code

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

mihiii1337 commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

I independently reproduced this on Windows. I built the unmodified d3a7b0bcd8 fixture with #19682's shader changes on the existing e60b2f74ad native build. Windows lavapipe 26.2.6 (LLVM 23.1.4) failed all three baseline runs with the same sample-count error. On this newer lavapipe, 2× was unavailable and both 4× and 8× ran successfully after filtering. The physical RTX 4070 Laptop (621.01) and Intel Raptor Lake-S Mobile 8086:a78b (31.0.101.5081) still ran and passed at 2×, 4× and 8× in all three runs. Khronos validation 1.4.369 was active in all 18 baseline and candidate processes with zero diagnostics.

I tested the same fix as a capability check before entering Query. framebufferColorSampleCounts is the exact property the failing production check reads, so the fixture can avoid matching its exception text. Inside the MSAA loop, before creating the descriptor:

const auto samples = 1u << log2Fragments;
if ((device->graphicsContext().limits.framebufferColorSampleCounts & samples) == 0u) {
    std::printf("2D MSAA %ux unavailable (unsupported color sample count)\n", samples);
    continue;
}

The remaining cases still execute both dimension queries. This test-only approach retains #19682's shader behavior and can be used for the merge decision in #25333. AI-assisted: yes.

I also completed the same 18-run matrix on a fresh incremental build of the exact clean main checkout d3a7b0bcd8 and my test-only commit 8502014023. Results matched the initial check: lavapipe 0/3 → 3/3, RTX and Intel 3/3 on both sides, and zero validation diagnostics. Each successful MSAA marker follows both dimension checks.

I also built and tested the published heads here on Windows. Both #25334 f7a60a3842 and #25333 1592519f14 passed all nine focused runs (three each on lavapipe, RTX and Intel), with the validation layer active and zero diagnostics. This PR omitted only the unsupported 2× subcase on Windows lavapipe. The revert restores the original cube, 3D and array coverage. The tested capability-check alternative is available as commit 8502014023.

Hosted CI coverage for f7a60a3842: the green Windows PR job executed only patched_libraries. Its configure-time AGC allowlist excluded ImageResinfoDimension. The automatic Linux PR job was skipped. The focused runs above are the execution evidence for this fixture.

@peacocksir

Copy link
Copy Markdown
Contributor Author

Thanks for the Windows runs. #25333, oneandonlydean's revert of #19682, was opened a minute before this PR and fixes the same Linux failure by removing the 2D MSAA answer. This PR keeps #19682's shader change and skips only the sample counts the device cannot render. If the revert is the preferred route, I'll close this one.

On the capability check: catching the exact message follows ResolveTests in PackedFloatColorTarget.cpp, which tests the same production check. A skip printed from a pre-check would have to mirror framebufferColorSampleCounts in the test. I'm happy to switch to that if a maintainer prefers it.

@mihiii1337

Copy link
Copy Markdown
Contributor

I confirmed the exact PR head f7a60a3842 on Linux against its unchanged base d3a7b0bcd8. On the same Ubuntu 24.04 WSL2 environment with Mesa 25.2.8-0ubuntu0.24.04.5 and LLVM 20.1.2, the base failed 3/3 with the unsupported-sample-count error. This head passed 3/3. In every passing run the fixture reported skips for 2× and 8× and completed both 4× dimension checks. Vulkan validation 1.4.363 loaded in all six runs with zero validation diagnostics.

The maintainer-dispatched Linux job also ran and passed this exact PR fixture (0.26 s) merged into 851212fb98, using Mesa 25.2.8-0ubuntu0.24.04.4. That job's four remaining failures were the three allocation-budget tests tracked in #25359 and agc_driver_scattered_runs. The focused local runs above provide the individual sample-count evidence.

AI-assisted: yes.

@oneandonlydean
oneandonlydean merged commit e4ff0d7 into boykopovar:main Nov 22, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agc libSceAgc*

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants