Skip to content

fix(agc): take the bank of PS4 2D PRT modes from the whole coordinates - #14248

Open
xXPBSXx wants to merge 3 commits into
boykopovar:mainfrom
xXPBSXx:fix-agc-gcn-prt-2d-whole-coordinates
Open

xXPBSXx wants to merge 3 commits into
boykopovar:mainfrom
xXPBSXx:fix-agc-gcn-prt-2d-whole-coordinates

Conversation

@xXPBSXx

@xXPBSXx xXPBSXx commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

What

The PS4 (GCN) tiling reduced x and y modulo the macro tile for all six PRT modes before it built the bank bits, so the bank never saw the macro tile index. AMD's addrlib does that only for the PRT modes without rotation: egbaddrlib.cpp L1775-L1780 reduces them under IsPrtNoRotationTileMode, and its mode flags mark PRT_TILED_THIN1 and PRT_TILED_THICK (not the 2D and 3D PRT modes). fpPS4 does the same for its two non-2D PRT array modes (ps4_tiling.pas L2812-L2816) and documents TiledThinPrt and TiledThickPrt (L79, L83) as able to alias several virtual pages to one physical page and the 2D and 3D PRT modes (L80, L84, L85) as not. In this code GB_TILE_MODE 11 and 16 are the thin PRT mode without rotation (kGcnDisplayPrt, kGcnThinPrt); the four modes 6, 7, 12 and 17 (kGcnDepthPrt256, kGcnDepthPrt1K, kGcnDisplay2DPrt, kGcnThin2DPrt; shadPS4 calls them Depth2DThinPrt256, Depth2DThinPrt1K, Display2DThinPrt and Thin2DThinPrt) are the 2D thin PRT mode and now take the bank from the whole coordinates. The pipe bits lie inside the macro tile in every mode, so only the bank changes. The detiler shader uses the same equation, so the GPU path follows.

Dissenting source: shadPS4 reduces all PRT modes (tiling.comp L392-L396), as this code did. Two sources against one; I follow addrlib and fpPS4 because addrlib is AMD's own address library and fpPS4 documents why the 2D modes do not alias. Which titles use modes 6, 7, 12 and 17 is not checked, and nothing was measured on a console. PS4 only (surfaces with gcnPitch); the call chain is the GB_TILE_MODE index -> GuestTextureResource.cpp mapping -> GcnTiling (TextureTiling.cpp) -> TextureDetiler and the tests.

Commits: (1) the tiling test's reference now reduces the coordinates only for GB_TILE_MODE 11 and 16, following the addrlib text above and not the production equation; on main it stops at the first mismatch, GB_TILE_MODE 6 at one byte per element (see Tested). (2) GcnTiling takes the macro-tile limit of the bank bits only for those two modes. (3) The debt file: of the two entries merged in #13691, "PS4 (GCN) tiling" stays true (it says the PRT pipe, and for modes 11 and 16 the bank, come from the coordinates inside the macro tile) and "PS4 (GCN) 2D PRT tiling" said the opposite of this change, so it now reads:

  • PS4 (GCN) 2D PRT tiling (libSceAgcDriver, PS4) - not checked on a console. GB_TILE_MODE 6, 7, 12 and 17 take the bank from the whole coordinates, as AMD's addrlib (Mesa 393bf0d1467c) and fpPS4 (04cefd43e6fd) do, which take it inside the macro tile only for modes 11 and 16, the ones fpPS4 documents as able to alias virtual pages to one physical page; shadPS4 takes it inside the macro tile for all six PRT modes.

The entry is 488 characters.

Overlap

Open PRs that change core/libs/prx/libSceAgcDriver/Graphics/src/TextureTiling.cpp, core/libs/prx/libSceAgcDriver/tests/TextureTiling.cpp or docs/dev/debt/libSceAgcDriver.md (file sets from git diff --name-only against each PR head's merge base, 1694 open pull requests as of 2026-11-01 00:37 UTC, main cc26ab4438): 149 touch at least one. One gives a new conflict with this change: #9674 rewrites the thick and layered surfaces entry next to the 2D PRT entry, so the conflict is in the debt file only (lines 107-113). #9674 also changes TextureTiling.cpp (it adds kGcnThick1D to the block-layout and mip-tail switches, to ThickBlockExtent, and a thick branch in GcnTiling), but not the PRT lines this change touches (prt, splitRotation, tx, ty; checked in its diff against its merge base); the source and test files merge cleanly, and whichever lands second needs a small rebase of the debt file. The other pull requests that touch the tiling files and already conflict with main (for example #9432 and #9891) give the same result with and without this change. Checked once more on 2026-11-01 at 03:50 UTC against main 01d65a198c: of the 22 pull requests opened since 00:30 UTC, #14243 and #14220 touch these files and merge the same with and without this change, and #9674 (head 8f4a2856a2) still conflicts with it in the debt file.

Tested

agc_driver_graphics_tests fails without the fix and passes with it. The failing run uses the test commit with TextureTiling.cpp from main and stops at the first mismatch: "PS4 tile mode 24 at 1 bytes: element 256,0 is at 65536, addrlib places it at 73728", where 24 is the value of TextureTileMode::kGcnDepthPrt256, GB_TILE_MODE 6; the test throws there, so it did not show modes 7, 12 and 17 separately. agc_driver_gcn_detile_tests, which compares the detiler shader with the CPU reference, passes on both GPUs of the test machine: NVIDIA GeForce RTX 4080 SUPER and AMD Radeon RX 6400 (GPU taken from the "Selected GPU" line of each log). Windows 10, MinGW Release build, ANYPS5_NO_SHADER_CACHE=1, APS5_NO_HOST_IMPORT=1, all runs on 2026-10-31 between 19:41 UTC and 19:44 UTC on the same tree as the three commits. tools/check_conventions.py --base f14ae07e29 passes. Based on main f14ae07e29, and it merges with main 01d65a198c without a conflict (checked 2026-11-01 03:50 UTC); merged together with #9674 (head 8f4a2856a2, updated 2026-11-01 02:12 UTC) it conflicts in the debt file only.

Checklist

AI-assisted (Claude Code).

🤖 Generated with Claude Code

xXPBSXx and others added 3 commits November 1, 2026 04:14
…addrlib does

The reference address of a PS4 PRT surface reduced x and y modulo the
macro tile for all six PRT modes, as the production equation does. In
AMD's addrlib the reduction applies only to the PRT modes flagged as
having no rotation, PRT_TILED_THIN1 and PRT_TILED_THICK; in this code
that is GB_TILE_MODE 11 and 16. The 2D PRT modes 6, 7, 12 and 17 keep
the whole coordinates. On main the tiling test stops at the first
mismatch, GB_TILE_MODE 6 at one byte per element.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The bank bits of a PS4 PRT surface ignored the macro tile index for all
six PRT modes. AMD's addrlib and fpPS4 do that only for GB_TILE_MODE 11
and 16; for the 2D PRT modes (6, 7, 12, 17) the bank comes from the
whole coordinates. The pipe bits lie inside the macro tile in every
mode, so only the bank changes. shadPS4 reduces all six and disagrees.
The detiler uses the same equation, so the GPU path follows.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…rdinates

The entry now matches GcnTiling after the change: addrlib and fpPS4 do
the same, shadPS4 still reduces all six PRT modes.

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

@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 — changes requested

The source change and independent test reference look internally consistent, but the PR does not yet show the repository-required AGC validation run or an author-agreed order with #9674.

What I ran

Reviewed head 9934f03567a9dd5bc4e5bc3e8ace9caf65b2bff8 against base 4a58bc29ad656ad7a54c1733b3b683e68b7ccf85. The no-build precheck reports clean independent merge previews against current main 8c91f25b3924a8419096aa368ce44043a5894558. No build or local C++/GPU test was run.

python3 tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 14248
git diff --name-status 01d65a198c0a73944c8043555337aac7731b1ba0 8c91f25b3924a8419096aa368ce44043a5894558 -- core/libs/prx/libSceAgcDriver/Graphics/src/TextureTiling.cpp core/libs/prx/libSceAgcDriver/tests/TextureTiling.cpp docs/dev/debt/libSceAgcDriver.md
gh pr view 9674 -R boykopovar/AnyPS5 --json state,headRefOid,baseRefName,updatedAt,mergeable
gh api repos/boykopovar/AnyPS5/issues/comments/6553080159 --jq '{user:.user.login,created_at,body}'

Results

Check Result
Diff check and conventions/template Passed in precheck.
Current-base merge preview Clean against current main 8c91f25b3924a8419096aa368ce44043a5894558; declared order-only dependency #9674 is present.
Source/test inspection The test reference reduces coordinates only for PRT modes 11 and 16; production does the same for bank bits. I found no source-level mismatch in the inspected lines.
Changes since reported test base No changes to the three touched paths between the PR's reported 01d65a... current-main check and this base. This does not supply the missing validation-layer/VUID evidence.
Author-reported tests agc_driver_graphics_tests reportedly fails with the main implementation and passes with this change; agc_driver_gcn_detile_tests reportedly passes on RTX 4080 SUPER and RX 6400. I did not run these tests, and the PR does not provide the required validation-layer marker/VUID comparison or reproducible command lines.
Hosted CI At refresh, checks were queued; the earlier conventions run was cancelled. No completed product test result was available.
Helper limitations ABI and test-quality helper subprocesses could not run because the isolated precheck checkout lacks the workspace-local helper scripts. This is not a PR failure.
Local build/tests Not run.
Raw precheck output
All conventions checks passed.
Head unchanged at completion: True
Base unchanged at completion: True
Conclusion: checks failed

The precheck's failure is from unavailable workspace-local ABI/test-quality helper scripts; its diff, conventions/template, and live mergeability checks passed.

Negative control

Assertion Change in control Result
Bank bits for the four 2D PRT modes use whole coordinates The author reports running the changed test with the main TextureTiling.cpp It reportedly fails first at GB_TILE_MODE 6; I did not independently run the control.

Findings

Blocking: The repository requires the same focused AGC tests on main and the change with ANYPS5_REQUIRE_VULKAN=1, ANYPS5_NO_SHADER_CACHE=1, and VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation, then checking both logs for the requested-layer warning and comparing VUIDs. The PR describes test outcomes but supplies neither the commands/raw logs nor evidence that this required validation setup was active. Please attach the paired focused outputs and confirm there is no new VUID on the change.

Blocking: The PR identifies an adjacent debt-file conflict with open #9674 and proposes #9674 first. #14248 declares that order, but the linked comment says it is a proposal and asks #9674's author to confirm; no agreement is recorded yet. The repository requires authors of overlapping PRs to agree on order and declare it. Please record the agreement (or the agreed alternate order) before treating the overlap as resolved.

Non-blocking: No implementation defect was established in this source pass. I did not approve because the required validation evidence and overlap agreement are missing.

Sources

Not verified

I did not build, run ctest, run Vulkan validation, inspect raw author test logs, or test on console hardware. The author-reported GPU tests are not independent results from this review.

To get this to a good state

Attach the required paired focused AGC test logs with validation-layer and VUID comparison, and record #9674's author's agreement on the declared landing order. I will rerun applicable checks on the updated head.

@github-actions

github-actions Bot commented Nov 1, 2026 •

Copy link
Copy Markdown

Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.

Pull request Conflicting files (lines on main) Same exports Same new files
PR 9891 docs/dev/debt/libSceAgcDriver.md L113-114

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 2434 docs/dev/debt/libSceAgcDriver.md
PR 5925 docs/dev/debt/libSceAgcDriver.md
PR 6186 docs/dev/debt/libSceAgcDriver.md
PR 6194 docs/dev/debt/libSceAgcDriver.md
PR 6223 docs/dev/debt/libSceAgcDriver.md
PR 6273 docs/dev/debt/libSceAgcDriver.md
PR 6280 core/libs/prx/libSceAgcDriver/Graphics/src/TextureTiling.cpp
docs/dev/debt/libSceAgcDriver.md
PR 6412 docs/dev/debt/libSceAgcDriver.md
PR 6481 docs/dev/debt/libSceAgcDriver.md
PR 6548 docs/dev/debt/libSceAgcDriver.md
PR 6804 docs/dev/debt/libSceAgcDriver.md
PR 6808 docs/dev/debt/libSceAgcDriver.md
PR 6987 docs/dev/debt/libSceAgcDriver.md
PR 6989 docs/dev/debt/libSceAgcDriver.md
PR 6995 docs/dev/debt/libSceAgcDriver.md
PR 7002 docs/dev/debt/libSceAgcDriver.md
PR 7085 core/libs/prx/libSceAgcDriver/Graphics/src/TextureTiling.cpp
core/libs/prx/libSceAgcDriver/tests/TextureTiling.cpp
docs/dev/debt/libSceAgcDriver.md
PR 7256 docs/dev/debt/libSceAgcDriver.md
PR 7449 docs/dev/debt/libSceAgcDriver.md
PR 7604 docs/dev/debt/libSceAgcDriver.md
PR 7642 docs/dev/debt/libSceAgcDriver.md
PR 7668 docs/dev/debt/libSceAgcDriver.md
PR 8592 docs/dev/debt/libSceAgcDriver.md
PR 8707 docs/dev/debt/libSceAgcDriver.md
PR 9020 docs/dev/debt/libSceAgcDriver.md
PR 9318 core/libs/prx/libSceAgcDriver/Graphics/src/TextureTiling.cpp
core/libs/prx/libSceAgcDriver/tests/TextureTiling.cpp
docs/dev/debt/libSceAgcDriver.md
PR 9335 docs/dev/debt/libSceAgcDriver.md
PR 9356 docs/dev/debt/libSceAgcDriver.md
PR 9387 docs/dev/debt/libSceAgcDriver.md
PR 9592 docs/dev/debt/libSceAgcDriver.md
PR 9672 docs/dev/debt/libSceAgcDriver.md
PR 9673 docs/dev/debt/libSceAgcDriver.md
PR 9675 docs/dev/debt/libSceAgcDriver.md
PR 9700 docs/dev/debt/libSceAgcDriver.md
PR 9748 docs/dev/debt/libSceAgcDriver.md
PR 9895 docs/dev/debt/libSceAgcDriver.md
PR 9898 docs/dev/debt/libSceAgcDriver.md
PR 9915 docs/dev/debt/libSceAgcDriver.md
PR 9950 docs/dev/debt/libSceAgcDriver.md
PR 10049 docs/dev/debt/libSceAgcDriver.md
PR 10193 docs/dev/debt/libSceAgcDriver.md
PR 10233 docs/dev/debt/libSceAgcDriver.md
PR 10256 docs/dev/debt/libSceAgcDriver.md
PR 10359 docs/dev/debt/libSceAgcDriver.md
PR 10743 docs/dev/debt/libSceAgcDriver.md
PR 11825 docs/dev/debt/libSceAgcDriver.md
PR 11998 docs/dev/debt/libSceAgcDriver.md
PR 12120 docs/dev/debt/libSceAgcDriver.md
PR 12565 docs/dev/debt/libSceAgcDriver.md
PR 12567 docs/dev/debt/libSceAgcDriver.md
PR 13599 docs/dev/debt/libSceAgcDriver.md
PR 13707 docs/dev/debt/libSceAgcDriver.md
PR 13863 docs/dev/debt/libSceAgcDriver.md
PR 13920 docs/dev/debt/libSceAgcDriver.md
PR 13928 docs/dev/debt/libSceAgcDriver.md
PR 13929 docs/dev/debt/libSceAgcDriver.md
PR 13963 docs/dev/debt/libSceAgcDriver.md
PR 13994 docs/dev/debt/libSceAgcDriver.md
PR 14005 docs/dev/debt/libSceAgcDriver.md
PR 14212 docs/dev/debt/libSceAgcDriver.md
PR 14302 docs/dev/debt/libSceAgcDriver.md
PR 14311 docs/dev/debt/libSceAgcDriver.md
PR 14344 docs/dev/debt/libSceAgcDriver.md
PR 14561 docs/dev/debt/libSceAgcDriver.md
PR 14621 docs/dev/debt/libSceAgcDriver.md
PR 14943 docs/dev/debt/libSceAgcDriver.md
PR 14944 docs/dev/debt/libSceAgcDriver.md
PR 14976 docs/dev/debt/libSceAgcDriver.md
PR 15059 core/libs/prx/libSceAgcDriver/Graphics/src/TextureTiling.cpp
core/libs/prx/libSceAgcDriver/tests/TextureTiling.cpp

@TechLevelZero

Copy link
Copy Markdown
Contributor

✅ NVIDIA GPU test: passed

PR head 9934f03 merged onto main b6bd6e7 · tested 2026-11-01 04:36 UTC · 31 min

GPU NVIDIA RTX 2000 Ada Generation, driver 595.99.02, Vulkan 1.4.329
Host Ubuntu 26.04.1 LTS, kernel 7.0.0-38-generic, container ubuntu:24.04
Logs build and test logs for this run
Build ✅ passed (Release, -DANYPS5_ENABLE_SPIRV_TOOLS=ON)
Tests ✅ 2,421 passed · 5 failed (0 new, 3 also fail on main, 2 unstable on main) · 44 skipped (ANYPS5_REQUIRE_VULKAN=1)
Test setup CPU-only tests without a GPU; GPU tests (and any CPU-only test that failed or skipped without one) once on the GPU with VK_LAYER_KHRONOS_validation and ANYPS5_NO_SHADER_CACHE=1; main ran the same way
Test selection 2,470 of 3,119 tests run: the ones this change can reach, chosen by tools/select_tests.py from main's build graph
Vulkan validation ✅ no new validation IDs vs main (929 tests run on the GPU)
Slow tests (>30 s, GPU tests timed with validation layers) ⚠️ agc_driver_pipeline_journal 49.5 s, ⚠️ agc_driver_lazy_resolved_abi_switch_set 31.9 s, ⚠️ agc_driver_graphics_maps_fallback 31.4 s
Unstable on main (2, these also failed in recent main runs on this machine; not counted against this PR)
agc_submit_progress: failed in 6 of the last 10 main runs
agc_submit_progress_no_timeline: failed in 8 of the last 10 main runs
Failing on main too (3, not counted against this PR)
agc_driver_image_table
guest_mmap_executable
guest_socket_options_multicast
Validation IDs already present on main (5 IDs in 480 tests)
VUID-VkDeviceCreateInfo-pNext-pNext (480 tests): agc_driver, agc_driver_address_passes, agc_driver_alias_copy_label, agc_driver_alpha_to_coverage, agc_driver_array_layer_target, agc_driver_bc_block_copy, agc_driver_bda_anchor_reads, agc_driver_bda_span_reads, and 472 more
VUID-vkCmdCopyImage-srcImage-01548 (7 tests): agc_driver_depth_clear_hle, agc_driver_depth_plane_buffer_memory, agc_driver_depth_plane_partial_store, agc_driver_depth_plane_sampling, agc_driver_depth_storage_dispatch, agc_driver_depth_surface_from_storage, agc_driver_dispatch_move_depth
VUID-vkCmdCopyImage-srcImage-01551 (7 tests): agc_driver_depth_clear_hle, agc_driver_depth_plane_buffer_memory, agc_driver_depth_plane_partial_store, agc_driver_depth_plane_sampling, agc_driver_depth_storage_dispatch, agc_driver_depth_surface_from_storage, agc_driver_dispatch_move_depth
VUID-VkPipelineColorBlendStateCreateInfo-pAttachments-00605 (1 test): agc_driver_prepared_exports
VUID-VkShaderModuleCreateInfo-pCode-08737 (1 test): agc_driver_image_sample_derivatives
Skipped (44)
agc_driver_bda_reads_shadowed_results: skipped, the device reports watched host memory written when it imports or reads it
agc_driver_bda_reads_shadowed_results_per_build: skipped, the device reports watched host memory written when it imports or reads it
agc_driver_sample_order_grid_reference: skipped, the device does not keep depth drawn at custom sample locations at those locations, even after a transition that names them: the composite of uniform renders holds the guest's depth in 0 of 3005 sloped samples, so no path can be compared with it bit for bit
agc_host_import_sparse: skipped, host imports are unavailable: /dev/udmabuf is not accessible
agc_import_settle_initial_dcc: skipped, the device has no deferred settle of host imports: imports under 1 MiB wait for one only on Windows
agc_unit_shadow_completion_store: skipped, the device reports watched host memory written when it imports or reads it
guest_http_uri_locale: 
guest_net_ctl: skipped, the host has no IPv4 address
guest_video_out_color_space: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_hdr: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_high_frame_rate: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_output_mode: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_resolution_status: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_wqhd_detection: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
video_out_flip_aftergpu: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_backtoback: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_controls: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_cpuflip: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_cpuflip_in_order: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_dcc: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_deferred: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_eop: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_eop_aftergpu: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_eop_main: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_fresh: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_f
Reproduce
git fetch origin 9934f03567a9dd5bc4e5bc3e8ace9caf65b2bff8 b6bd6e7bf7b97ad00b3315fd26c1d4e76497f452
git checkout b6bd6e7bf7b97ad00b3315fd26c1d4e76497f452 && git merge --no-ff 9934f03567a9dd5bc4e5bc3e8ace9caf65b2bff8
git submodule update --init --recursive
cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=ON -DANYPS5_ENABLE_SPIRV_TOOLS=ON
cmake --build build && cmake --build build --target libs
VK_DRIVER_FILES=/nonexistent/icd.json ctest --test-dir build -E '^(agc|shader|recompiler|videoout|video_out|guest_video_out|vulkan)|gpu' --timeout 120 --parallel 32 --output-on-failure
ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation \
  ctest --test-dir build -R '^(agc|shader|recompiler|videoout|video_out|guest_video_out|vulkan)|gpu' --timeout 120 --parallel 4 --output-on-failure
# failures are then re-run alone: --timeout 360 --parallel 2; new validation IDs: the test alone, twice, --parallel 1

Automated build and test on a contributor's NVIDIA machine; it does not replace upstream CI. A new comment is posted for each new push. Full logs.

@github-actions github-actions Bot added docs agc libSceAgc* labels Nov 1, 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.

Re-checked — changes requested

The paired NVIDIA validation report now covers the required GPU evidence, but the landing order with #9674 is still only proposed, not confirmed by both PR authors.

What I ran

Re-checked head 9934f03567a9dd5bc4e5bc3e8ace9caf65b2bff8 against PR base 4a58bc29ad656ad7a54c1733b3b683e68b7ccf85; current main was 6fe120d11ba3b92c56ade1bb783e211d5dc0949e. The current-base merge preview is clean, with the declared order-only dependency #9674 → #14248. Environment: Linux x86_64, Python 3.11.2, Git 2.39.5.

python3 tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 14248 --output-dir /tmp/anyps5-pr-precheck-14248-recheck
python3 tools/pr_stack_check.py 14248 --repo boykopovar/AnyPS5 --output-dir /tmp/anyps5-pr-stack-14248-final

Results

Check Result
Diff check and conventions/template Passed.
Current-main merge previews #9674 and #14248 each preview cleanly against current main; their declared order-only dependency is not yet included in #14248's head.
Hosted GPU validation The exact PR head was built and tested with an NVIDIA RTX 2000 Ada; the report says no new validation IDs versus its main baseline.
Hosted Windows / conventions / intake / labels / portability / eligibility / report Passed on this head. Linux and specialized jobs were skipped.
Local build and C++ tests Not run.
ABI/test-quality helper scripts Not executable in the detached precheck checkout because those workspace-only scripts are absent there; this is not a reported PR failure.
Unedited output excerpts
All conventions checks passed.
PR #9674: clean against current base; head 8f4a2856a25736615ffd051e9859d8ebf275d79d
PR #14248: clean against current base; head 9934f03567a9dd5bc4e5bc3e8ace9caf65b2bff8
Target branch tip: 6fe120d11ba3b92c56ade1bb783e211d5dc0949e
PR head `9934f03` merged onto main `b6bd6e7`
Build: passed (Release, -DANYPS5_ENABLE_SPIRV_TOOLS=ON)
Tests: 2,421 passed · 5 failed (0 new) · 44 skipped
Test setup: GPU tests ... with VK_LAYER_KHRONOS_validation and ANYPS5_NO_SHADER_CACHE=1; main ran the same way
Vulkan validation: no new validation IDs vs main

Findings

Blocking

The PR now declares Depends on: #9674 and proposes #9674 first, but the linked discussion still describes this as a proposal and asks #9674's author to confirm; no confirmation is recorded. CONTRIBUTING.md says authors of overlapping PRs should agree on order and declare it. Please record that agreement, or the agreed alternate order, before merge.

Non-blocking

None found in this re-check.

Sources

Not verified

I did not run the C++ tests locally or test on a console. Linux and specialized hosted jobs were skipped. The GPU report's logs are linked in the cited comment; I did not independently reproduce that run.

To get this to a good state

Please obtain or record #9674's author's agreement on the order already declared by #14248 (or update both PRs to the agreed alternative). I will re-check the live heads, overlap preview, and applicable checks after that update.

@RNK123

RNK123 commented Nov 1, 2026

Copy link
Copy Markdown

Supplemental RADV run: paired Vulkan validation and all affected PRT modes

This supplies a paired validation-layer run for the current head, plus an extended local GPU probe covering all four affected 2D PRT modes. No upstream code was added or changed for this report, apart from temporary test-only transplants for the controls.

Pins: main 9335acf79db550c772fbd102dd7cbc2e27df49b5; head 9934f03567a9dd5bc4e5bc3e8ace9caf65b2bff8; clean merged tree 282cd61112034ba1d75ce3b7d4e0b405d2c90e64. No other PRs or conflict resolutions.

Check Main + this head's CPU reference test only Head merged onto the same main Restored main + identical reference test
agc_driver_graphics Fails 3/3 at the expected bank-address mismatch Passes 3/3 Same expected failure, 1 run
agc_driver_gcn_detile Passes 3/3 Passes 3/3 Passes, 1 run
Extended real-GPU probe, 325 cases per run Passes 3/3 Passes 3/3 Passes, 1 run

The negative-control message is:

PS4 tile mode 24 at 1 bytes: element 256,0 is at 65536, addrlib places it at 73728

Here 24 is kGcnDepthPrt256 (GB_TILE_MODE 6), not GB_TILE_MODE 24. The restored control reproduces exactly the same mismatch. After removing the transplant, pristine main was rebuilt and both original CTests passed once more.

Additional GPU coverage: the existing GcnDetile.cpp loop covers kGcnThin2DPrt and kGcnDepthPrt256, but not the other two affected modes. The standalone probe is a copy of that test with only kGcnDepthPrt1K, kGcnDisplay2DPrt, and the unaffected kGcnThinPrt added to the loop, plus a descriptive success line. That gives 13 modes x element sizes {1,2,4,8,16} x array layers {0,1,2,3,5} = 325 cases per run, including all four affected modes and both non-rotated PRT modes. The source is unchanged across implementations; no Vulkan functions or capability bits are mocked or overridden.

Important interpretation: the GPU detile test prepares its input using production GcnTiling, so it tests shader/CPU consistency, not independent console truth. Green on main is expected and does not prove the old bank equation correct. The separate CPU reference test supplies the red/green comparison against the PR's addrlib-based reference, and stops at its first mismatch on main. No PS4 hardware or game was tested.

Validation: serial execution, ANYPS5_REQUIRE_VULKAN=1, ANYPS5_NO_SHADER_CACHE=1, VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation, VK_LOADER_DEBUG=layer, same VK_LAYER_PATH on both trees. No skips, VUIDs, Khronos validation errors/warnings, or sync hazards in any selected run. Loader output confirms the RX 9060 XT and actual Khronos insertion in each GPU CTest/probe process (14 GPU processes across the paired and reversed phases). agc_driver_graphics is CPU/mock coverage and creates no Vulkan instance; it is not counted as GPU execution. Neither side logs the missing-requested-layer message.

Hardware/toolchain: CachyOS Linux 7.3.1-1-cachyos, i5-12400F, AMD Radeon RX 9060 XT (1002:7590, RADV GFX1200), Mesa 26.2.5-arch3.1, Vulkan device API 1.4.354, GCC 16.2.1, Release, BUILD_TESTING=ON, ANYPS5_ENABLE_SPIRV_TOOLS=OFF, Khronos layer 1.4.363.

Environment caveat: both sides equally emit loader errors about the pre-existing implicit liblsfg-vk-layer.so missing vkGetInstanceProcAddr (layer skipped), plus RADV's non-conformance warning. These are not Khronos validation messages; the complete logs are not error/warning-free.

Reproduction, source identity, and extended probe

Use sibling folders AnyPS5/ and tester/. The negative control is pinned main with only core/libs/prx/libSceAgcDriver/tests/TextureTiling.cpp from this head; production Graphics/src/TextureTiling.cpp remains byte-identical to main. The change is the full head merged onto that same main. Rebuild the production library, both tests, and the standalone probe after each tree change.

cmake -S AnyPS5 -B AnyPS5/build-main -G Ninja -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=ON -DANYPS5_ENABLE_SPIRV_TOOLS=OFF
cmake --build AnyPS5/build-main --parallel 4 --target agc_driver_graphics_tests agc_driver_gcn_detile_tests
python3 tester/build_gcn_probe.py
export ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1
export VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation VK_LOADER_DEBUG=layer
for repeat in 1 2 3; do
  ctest --test-dir AnyPS5/build-main -R '^(agc_driver_graphics|agc_driver_gcn_detile)$' --parallel 1 --no-tests=error -V > "ctest-${repeat}.log" 2>&1
  ./tester/gcn_prt_probe > "probe-${repeat}.log" 2>&1
done

Set VK_LAYER_PATH to the installed layer's manifest directory if not in default loader paths. Preserve logs separately per tree and inspect validation messages, not just exit codes. The expected negative-control CTest exit status is 8, with only agc_driver_graphics failing; the GPU probe exits 0 on both implementations.

Copy core/libs/prx/libSceAgcDriver/tests/execution/GcnDetile.cpp from pinned main to tester/gcn_prt_probe.cpp, then apply only this diff:

--- GcnDetile.cpp
+++ gcn_prt_probe.cpp
@@ -79,14 +79,14 @@
             const auto context = AgcDriver::VulkanDeviceTestAccess::ContextOf(*device);
             TextureDetiler detiler(context);
             using enum TextureTileMode;
-            for (const auto mode : {kGcnThin1D, kGcnDisplay1D, kGcnDisplay2D, kGcnThin2D, kGcnDepth2D64, kGcnDepth2D256, kGcnDepth2D1K, kGcnDisplayPrt, kGcnThin2DPrt, kGcnDepthPrt256}) {
+            for (const auto mode : {kGcnThin1D, kGcnDisplay1D, kGcnDisplay2D, kGcnThin2D, kGcnDepth2D64, kGcnDepth2D256, kGcnDepth2D1K, kGcnDisplayPrt, kGcnThin2DPrt, kGcnDepthPrt256, kGcnDepthPrt1K, kGcnDisplay2DPrt, kGcnThinPrt}) {
                 for (std::uint32_t bytes = 1u; bytes <= 16u; bytes <<= 1u) {
                     for (const auto layer : {0u, 1u, 2u, 3u, 5u}) detile(context, detiler, mode, bytes, layer);
                 }
             }
         }
         device.reset();
-        std::puts("PS4 detile tests passed");
+        std::puts("PS4 detile tests passed: 13 modes x 5 element sizes x 5 array layers = 325 cases");
         return 0;
     } catch (const std::exception& error) {
         std::cerr << error.what() << '\n';

Build helper tester/build_gcn_probe.py (Linux/Ninja, production target flags and library):

import shlex
import subprocess
from pathlib import Path


def main():
    root = Path(__file__).resolve().parent.parent
    build = root / "AnyPS5/build-main"
    commands = subprocess.check_output(
        ["ninja", "-C", str(build), "-t", "commands", "agc_driver_gcn_detile_tests"], text=True).splitlines()
    template = next(shlex.split(command) for command in commands
                    if " -c " in command and command.endswith("/tests/execution/GcnDetile.cpp"))
    options = []
    arguments = iter(template[1:])
    for argument in arguments:
        if argument in {"-I", "-isystem", "-iquote", "-D"}:
            options.extend([argument, next(arguments)])
        elif argument.startswith(("-I", "-D")):
            options.append(argument)
    if not any(argument.startswith("-I") for argument in options):
        raise RuntimeError("production test include paths were not found")
    libraries = build / "core/libs/libs/unpatched"
    command = [
        "g++", "-std=c++20", "-O2", *options,
        "-I" + str(root / "AnyPS5/core/libs/prx/libSceAgcDriver/tests/execution"),
        str(root / "tester/gcn_prt_probe.cpp"), "-o", str(root / "tester/gcn_prt_probe"),
        f"-L{libraries}", f"-Wl,-rpath,{libraries}", f"-Wl,-rpath-link,{libraries}",
        "-l:libSceAgcDriver.prx",
    ]
    subprocess.run(command, cwd=build, check=True)
    print("Extended GCN probe rebuilt against the current production library.")


if __name__ == "__main__":
    main()

SHA-256, identical across all three phases:

TextureTiling.cpp  1e04a39ddc4a1d7a39bd6408c72f73ecdf81f944922fe4fd28f6a46885cda747
GcnDetile.cpp  f5c358f70f598c90ac0508ead0758c5bb380b0f2f00e7c84a21e362cc6fbbb82
gcn_prt_probe.cpp  2510efb3495081058d0a73829c9ebfb2ac3b89d9e967069d2165e8fb26630893

This is supplemental execution evidence, not approval. It does not resolve the separate #9674 landing-order discussion, establish console equivalence, or make game/performance claims.

AI-assisted hardware test run and report: yes (Codex).

@xXPBSXx

xXPBSXx commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor Author

Thanks for the re-check. The validation evidence for the current head is the hosted NVIDIA report and the RADV report in this thread: no new validation IDs versus main, and a paired validation-layer run that covers all four affected 2D PRT modes. The local runs behind the description are from 2026-10-31 between 19:41 UTC and 19:44 UTC (the CPU test fails on main and passes with the change; agc_driver_gcn_detile_tests passes on an RTX 4080 SUPER and an RX 6400).

The landing order with #9674 is still only proposed: the comment there (#9674 (comment)) was posted on 2026-11-01 at 03:52 UTC and has no answer yet. The two pull requests only touch adjacent lines of the debt file; the source and test files merge cleanly. If #9674's author wants another order, this pull request changes its Depends on line to match.

From this pull request's side the order is confirmed: #9674 lands first, #14248 declares Depends on: #9674 (landing order only; adjacent lines) and is rebased onto main afterwards. The conflict is in the debt file only, checked on 2026-11-01 at 03:15 UTC; no change to the source or test files is needed for either order. The author of #9674 has not answered the comment there yet; I follow that pull request and will swap the declaration if the author prefers the other order.

AI-assisted (Claude Code).

@xXPBSXx

xXPBSXx commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor Author

The landing order with #9674 is now answered by that pull request's author: either order works (2026-11-01, 17:04 UTC). The overlap is only the two adjacent entries of docs/dev/debt/libSceAgcDriver.md, TextureTiling.cpp and its test do not conflict, and whichever of the two lands first, the branch that is left merges main and keeps both entries (the author of #9674 said they will do that on their side). The Depends on: #9674 (landing order only; adjacent lines) line stays as a note about the adjacent lines; neither pull request needs to wait for the other.

AI-assisted (Claude Code).

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

This branch has not been deployed

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

Labels

agc libSceAgc* docs needs rebase Conflicts with main, rebase needed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants