Skip to content

test(agc): force a copied allocation in label ordering checks - #23479

Merged
oneandonlydean merged 1 commit into
boykopovar:mainfrom
JJenkx:test/agc-copied-writer-four-byte-alignment-20261119
Nov 27, 2026
Merged

oneandonlydean merged 1 commit into
boykopovar:mainfrom
JJenkx:test/agc-copied-writer-four-byte-alignment-20261119

Conversation

@JJenkx

@JJenkx JJenkx commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

What

The copied-writer label-order fixture uses a record at +0x1004 to obtain a copied buffer. On a device reporting four-byte storage-buffer alignment, the record binds in place and the fixture exits 77 before checking the copied writer's label ordering (including the unimported-label pass added by #7464).

Register only the interior of the copied block, leaving one byte unregistered at each end (GuestBlockOptions{.wholeAllocation = false}). That guest allocation cannot form an aligned host import, so it takes the CPU copy/write-back path. The direct control and label blocks use whole registered allocations, and unimportedLabels retains #7464's isolated three-block layout (GuestBlockOptions{.isolated = true}). The existing record offsets, shader, pending-completion counts, label visibility checks, unimported-label check, CPU-store-after-label check and stream ordering assertions are preserved. Removing the alignment-dependent early exit makes a missing copied writer fail its pending-count assertion.

Overlap review: #7464 has now merged; this rebased head (098f15e6c7) combines its isolated option with registration padding in GuestBlockOptions. Open PRs touching CopiedWriterLabelOrder.cpp — #10442 (early unimported labels), #13863 (opt-in async compute lane), #13920 (targeted storage waits by writer lane), and #20172 (MoltenVK host labels) — are independent changes; this patch does not incorporate their production behavior.

Tested

Linux 7.3.5-arch1-1, AMD Radeon RX 6650 XT (RADV NAVI23), RADV Mesa 26.3.1, GCC 16.2.1, Release, Khronos validation 1.4.363. Rebased head 098f15e6c74902bd1d074b59aacd627bb55241f7 on main 729981cb5a; this PR changes only CopiedWriterLabelOrder.cpp.

Same machine, GPU and validation environment for main (729981cb5a) and this PR (098f15e6c7): ANYPS5_REQUIRE_VULKAN=1, ANYPS5_NO_SHADER_CACHE=1, VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation, VK_LOADER_DEBUG=layer.

  • main (729981cb5a), default and drain modes (ctest -R '^agc_driver_copied_writer_label_order(_drain)?$' -V): 2 skipped (expected skip on 4-byte minStorageBufferOffsetAlignment), 2 validation-layer insertions, 0 missing-layer warnings, 0 VUID- errors.
  • This PR (098f15e6c7), default and drain modes (ctest -R '^agc_driver_copied_writer_label_order(_drain)?$' -V --repeat until-fail:3): 6 passed, 0 skipped, 0 failed (3 fresh processes per mode, all printing copied writer label order tests passed), 6 validation-layer insertions, 0 missing-layer warnings, 0 VUID- errors.
  • python3 tools/check_conventions.py --base origin/main passes. Clean merge-tree against origin/main 9a66a08b83.

Prior head 4349fe5f26 (before the #7464 rebase) also received external reports on:

  • Apple M1 / MoltenVK on macOS 26.5 (comment, Romannachwievor): 3/3 pass on default mode.
  • NVIDIA GeForce RTX 2070 SUPER on Windows 11 26300 (comment, maskym): both modes passed with Khronos validation 1.4.366, no new failures/VUIDs.
  • NVIDIA GeForce RTX 4090 on Arch Linux (comment, domx4q): 3/3 focused tests passed with Khronos validation 1.4.363.1, 0 VUIDs.
  • NVIDIA GeForce RTX 3080 and AMD Radeon iGPU on Windows 11 (comment, kiwe147, combined 30-PR batch): both tests passed on both GPUs.

Those prior-head reports have not been re-run on 098f15e6c7.

Normal-build reproduction:

env 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_copied_writer_label_order(_drain)?$' -V --repeat until-fail: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: AMD Radeon RX 6650 XT, RADV Mesa 26.3.1, Arch Linux 7.3.5 (head 098f15e6c7); prior head 4349fe5f26 external reports: Apple M1 / MoltenVK on macOS 26.5, NVIDIA RTX 2070 SUPER on Windows 11 26300, NVIDIA RTX 4090 on Arch Linux 7.3.4, NVIDIA RTX 3080 + AMD Radeon iGPU on Windows 11
  • AI-assisted: yes

@Romannachwievor

Copy link
Copy Markdown
Contributor

Tested on an Apple M1 (macOS 26.5, Apple clang 21.0.0), x86_64 Release under Rosetta 2, Vulkan through MoltenVK (LunarG SDK 1.4.363.0). The tree was main 245210b07e with #17425 and #11049, which the macOS build needs. I applied this PR's diff (head 4349fe5f26) on top and rebuilt the test and libSceAgcDriver.prx.

agc_driver_copied_writer_label_order
without this PR pass, 3 of 3 runs
with this PR pass, 3 of 3 runs

On this device the fixture already reached its checks without this PR (it prints copied writer label order tests passed, no early exit 77), so this run shows no regression on a device that took the copied path before; it does not show the four-byte-alignment case the PR is about. I only ran this test.

AI-assisted: yes (Claude Code)

@github-actions github-actions Bot added the agc libSceAgc* label Nov 19, 2026

@MarcZX10 MarcZX10 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed — no blocking findings

The changed fixture code is sound on inspection; I did not run its tests, and the reported platform results were not independently verified.

What I ran

Read the prepared diff and the complete changed file at head 4349fe5f2605bfc5fa4e19a43606e3d8a5546703, plus the GuestAllocations API declarations. No build or test commands were run.

Results

Check Result Note
Diff and source review passed One changed file read
Build and tests not run Reported results not independently checked

Findings

Blocking

None.

Non-blocking

None.

Not verified

The fixture was not built or run here. The author-reported Linux and macOS results were not independently verified. files.json was unavailable through the reader; the manifest lists one changed file, and its full text was read. No excluded-file list was available.

To get this to a good state

Nothing is required.

@maskym

maskym commented Nov 19, 2026

Copy link
Copy Markdown
Contributor

Windows + NVIDIA result for head 4349fe5f26, merged alone into main e35c90cfe3 (the PR's Tested section names no Windows run).

Host: Windows 11 26300, Intel i7-12700K, NVIDIA GeForce RTX 2070 SUPER, WinLibs GCC 15.2.0 (x86_64-ucrt-posix-seh, r6), Release, BUILD_TESTING=ON, Ninja. main itself fails to compile one test on Windows at this commit (UploadCacheReadOnlyFlush.cpp:177, setenv; #19899 fixes it), so both trees were built with ninja -k 0.

Validation-layer protocol on main and on this PR (ANYPS5_REQUIRE_VULKAN=1, ANYPS5_NO_SHADER_CACHE=1, VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation 1.4.366, VK_LOADER_DEBUG=error,warn,layer, ctest -R '^(agc|guest_video_out|video_out|pad_sdl)' --parallel 4 -V):

Tree Passed Layer inserted was not found but was requested VUID- set
main 2054/2058 1858 0 none
this PR 2054/2058 1858 0 identical

agc_driver_upload_cache_read_only_flush is Not Run on both trees because of the main build break above. No new validation errors and no new failures. The failures on this PR's tree (agc_driver_stencil_plane_memory, agc_driver_store_over_untracked, agc_driver_msaa_dcc_unwatch) also fail on main here.

The tests this PR adds or changes (agc_driver_copied_writer_label_order, agc_driver_copied_writer_label_order_drain) pass in the full validation-layer run. Not run on a PS5.

AI-assisted: yes (Claude Code), the runs and the numbers above are from this machine.

@domx4q

domx4q commented Nov 19, 2026

Copy link
Copy Markdown
Contributor

Ran the copied-writer label-order fixture with the Khronos validation layer on Linux and an NVIDIA GPU; the existing runs here are RADV, MoltenVK and Windows + NVIDIA.

Setup: Arch Linux (kernel 7.3.4), GCC 16.2.1, Release, NVIDIA GeForce RTX 4090 (vendor 0x10de, device 0x2684, Ada), proprietary driver 620.70.06, Vulkan 1.4.357, Khronos validation layer 1.4.363.1. Head 4349fe5f26 merged onto main ded746ea12 with --no-ff, clean merge. Main baseline is a Release build of ded746ea12 on the same machine.

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_copied_writer_(label_order|label_order_drain|copy)$' -V
main ded746ea12 this PR
Result 3 of 3 passed 3 of 3 passed
Insert instance layer "VK_LAYER_KHRONOS_validation" 3 3
was not found but was requested by env var VK_INSTANCE_LAYERS 0 0
VUID- none none

The 4090 reports minStorageBufferOffsetAlignment 16, so the +0x1004 record already takes the copy path on main: agc_driver_copied_writer_label_order and _drain run to copied writer label order tests passed on both sides, with no skip. With this PR they still do, so the padded registration keeps the copied writer on a 16-byte-alignment device. agc_driver_copied_writer_copy (unchanged, same fixture family) passes on both sides. Test-only change, so there is no negative control.

No new VUID- errors; all focused tests pass on Ada.

AI-assisted: yes (Claude Code)

@github-actions

github-actions Bot commented Nov 20, 2026 •

Copy link
Copy Markdown

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 13863 core/libs/prx/libSceAgcDriver/tests/execution/CopiedWriterLabelOrder.cpp
PR 13920 core/libs/prx/libSceAgcDriver/tests/execution/CopiedWriterLabelOrder.cpp
PR 20172 core/libs/prx/libSceAgcDriver/tests/execution/CopiedWriterLabelOrder.cpp

@kiwe147

kiwe147 commented Nov 21, 2026

Copy link
Copy Markdown

Tested head 4349fe5f26, applied with git apply on main fd4aeed483 together with the other 29 PRs of one batch (#18156, #21208, #22013, #22795, #23226, #23385, #24324, #24533, #24582, #24690, #24693, #17553, #19619, #20085, #21081, #19682, #22123, #22529, #22572, #22662, #23787, #24568, #15330, #21249, #21630, #21713, #22040, #23490, #24394). All applied without conflicts and the whole tree built.

Setup: Windows 11 Pro 10.0.26200, Ryzen 7 9800X3D, WinLibs GCC 15.2.0 r7, Release, BUILD_TESTING=ON. GPUs: NVIDIA GeForce RTX 3080 (driver 621.24) and the AMD Radeon iGPU of the CPU (gfx1036, driver 32.0.21036.18). No validation layer. iGPU run: ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 ANYPS5_GPU="AMD Radeon", agc_/video tests only.

tests RTX 3080 iGPU
agc_driver_copied_writer_label_order, agc_driver_copied_writer_label_order_drain (2 tests, matched by name to the test file this PR changes) all pass all pass

Whole batch: the full ctest -j 12 (6540 tests) on the RTX 3080 has 5 failing tests; the 4 that also fail on main fd4aeed483 are agc_driver_stencil_plane_memory, agc_driver_msaa_dcc_unwatch, agc_storage_write_back_host_retile, and pr_overlap_names, which needs a newer Python than my 3.10. Intermittent in this run (pass when rerun alone, or known flaky): agc_driver_store_over_untracked. Traced to other PRs of the batch, each by reverting it and testing again: #17553 (guest_memory); none is in this PR's area. The 2143 agc_/video tests on the iGPU have 2 failing: agc_driver_stencil_plane_memory, agc_driver_store_over_untracked (agc_driver_stencil_plane_memory also fails on main).

This is one combined tree, not a run of this PR alone.

AI-assisted: yes (Claude Code)

@JJenkx
JJenkx force-pushed the test/agc-copied-writer-four-byte-alignment-20261119 branch from 4349fe5 to 098f15e Compare November 22, 2026 03:18
@JJenkx

JJenkx commented Nov 22, 2026

Copy link
Copy Markdown
Contributor Author

Rebased onto main 729981cb5a as 098f15e6c749 to resolve the conflict with merged #7464 (d74ab1fd88). GuestBlock now takes GuestBlockOptions so copied uses registration padding (.wholeAllocation = false) while unimportedLabels keeps #7464's isolated three-block layout (.isolated = true).

Re-verified on Arch Linux 7.3.5-arch1-1, AMD Radeon RX 6650 XT (RADV NAVI23, Mesa 26.3.1), GCC 16.2.1 Release, Khronos validation 1.4.363 (ANYPS5_REQUIRE_VULKAN=1, ANYPS5_NO_SHADER_CACHE=1, VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation, VK_LOADER_DEBUG=layer):

  • main 729981cb5a: 2 skipped (4-byte alignment skip on default and drain), 2 layer insertions, 0 missing-layer warnings, 0 VUID- errors.
  • 098f15e6c749 (--repeat until-fail:3): 6 passed, 0 skipped, 0 failed (including perf(agc): keep unimported label stores on the CPU #7464's unimported-label pass), 6 layer insertions, 0 missing-layer warnings, 0 VUID- errors.
  • tools/check_conventions.py --base origin/main: passed.

AI-assisted: yes

@github-actions github-actions Bot removed the needs rebase Conflicts with main, rebase needed label Nov 22, 2026

@MarcZX10 MarcZX10 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed — looks good

The changed test forces the copied allocation through the copy/write-back path by registering only its interior, and the inspected code supports the stated intent.

What I ran

Reviewed head 098f15e6c74902bd1d074b59aacd627bb55241f7. No test or build commands were run; the reported test results are author-supplied.

Results

Check Result Note
Changed-line review passed All 12 added lines inspected
Tests not run Results in description are author-reported
Build and conventions not run No local checks run

Findings

Blocking

None.

Non-blocking

None.

Not verified

No tests or build checks were run. The author reports six focused test passes on the reviewed head and successful convention checks, but these results were not independently verified. No changed files were excluded. Read: review/description.md, review/commits.md, review/manifest.json, review/diff.patch, review/README.md, and all 274 lines of core/libs/prx/libSceAgcDriver/tests/execution/CopiedWriterLabelOrder.cpp.

To get this to a good state

Nothing is required.

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.

7 participants