perf(agc): leave the unmapped levels below a T# minimum LOD without device memory #13646

Merged
hugodearaujo merged 6 commits from upstream-pr/13646 into main 2026-11-06 13:32:29 +00:00
hugodearaujo commented 2026-10-30 21:16:26 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by hugodearaujo on 2026-10-30T21:16:26Z.


What

A title that streams texture mips by mapping pages keeps a T# over the whole mip chain, sets MIN_LOD to the first level it has streamed in, and leaves the guest memory of the levels above it unmapped. The sampled texture is still made with every level, so the device allocates and uploads levels the GPU never reads and the guest never wrote.

Spider-Man 2 (PPSA03016 01.004.003) resolves a 22,528-record bindless T# heap in one compute dispatch (shader 0x11e2b3d500, image table 0 at 0x1197030000, 22,528 keys, not narrowed). Its 7,509 distinct textures span 15,394 MiB of mip chains, of which 1,052 MiB are committed guest memory; 6,259 of them have MIN_LOD > 0, and the levels above it are exactly the unmapped ones (13 exceptions). Making all of them took 15 GiB of device memory in about 10 s on a 16 GiB card (11.2 GiB device-local plus 4 GiB placed in host memory), and the run was stopped there.

The texture is now created as a sparse residency image when the device has sparseResidencyImage2D for its format. The image keeps its full extent and level count, and only the levels at and below the clamp get memory (the mip tail and the whole levels from floor(MIN_LOD) on). The levels above stay unbound, are not uploaded, and are never sampled, since the view keeps the T#'s MIN_LOD. Sampling, explicit LOD, the _cl clamp operand, size queries and image loads see the same image as before. This is a memory change: frame time is not expected to move.

  • UnmappedLevelsBelowMinLod counts the leading levels of a 2D or 2D-array T# (base level 0, not depth-compare, sRGB-expanded or created from a clear value) below floor(EffectiveMinLod) whose guest memory has no committed page in any layer. A committed byte, a guest mip-tail level or the view's last level stops it.
  • SparseLevelsSupported checks the device feature, VK_EXT_image_view_min_lod (so the view carries the clamp), the image format properties with the sparse flags, and vkGetPhysicalDeviceSparseImageFormatProperties. Otherwise, or with APS5_NO_SPARSE_TEXTURE_LEVELS, the texture is made whole as before. The detile, repack and copy loops start at the first resident level.
  • PlanSparseLevels turns the image's sparse memory requirements into binds: the color levels from the first resident one up to the mip tail, the color mip tail (one, or one per layer), and every metadata mip tail (one with VK_SPARSE_IMAGE_FORMAT_SINGLE_MIPTAIL_BIT, otherwise one per layer, each with VK_SPARSE_MEMORY_BIND_METADATA_BIT). Requirements with an aspect other than color and metadata, or without color, give no plan, and the texture is created again as a whole image.
  • BindSparseLevels allocates one block for the plan and binds it with vkQueueBindSparse, waiting on a fence, as resident heap mirrors do. Without a queue of its own the bind needs the GPU lock, so it is used only by a thread that holds it.
  • The device enables sparseResidencyImage2D with sparseBinding, and Context carries it and vkGetPhysicalDeviceSparseImageFormatProperties.

Tested

Arch Linux (kernel 7.2.11), AMD Radeon RX 9070 XT (RADV GFX1201, Mesa 26.2.6), Release. Head 6a3769c50f is this branch rebased onto main a4eca2a056 plus the cleared-texture fix; the results below up to the paired validation are from earlier heads, and the last paragraph of this section is the rerun on 6a3769c50f.

agc_driver_texture_sparse_levels (new):

  • Requirement handling, without a device: two layers of a 1024x1024 image with the color mip tail from level 3 bind levels 1 and 2 of each layer and one tail per layer; a single metadata mip tail adds one VK_SPARSE_MEMORY_BIND_METADATA_BIT bind, a per-layer one adds one per layer at the stride; levels past the tail bind the tail alone; a depth aspect, or requirements without color, give no plan.
  • It returns 77 (skipped, with the reason) when the device has no sparse residency for 2D BC1 images, so a pass means the sparse path ran. On RADV it prints what a sparse BC1 image reports: color only, no metadata.
  • A 2048x2048 BC1 texture with 8 levels and MIN_LOD 2.0, linear, with levels 0 and 1 in uncommitted pages, against the same texture with every level committed: image_sample_d_cl, image_sample_cl and the two offset variants on 32 threads give the level the hardware selects (max(LOD, clamp operand, MIN_LOD)) and the same results for both textures, and the sparse one holds 196,608 bytes against 2,818,048.
  • Streaming: level 1 is committed and filled afterwards. At MIN_LOD 2 the texture samples as before; with MIN_LOD lowered to 1 it samples as the fully committed texture at MIN_LOD 1, and holds 720,896 bytes (level 1 is bound now) against 2,818,048.
  • A cleared texture (main's fast-clear path): R8G8B8A8 2048x2048, 8 levels, MIN_LOD 2, levels 0 and 1 in uncommitted pages, must hold as many bytes as the same cleared texture at MIN_LOD 0, since vkCmdClearColorImage clears every level. With the old condition (no clear != nullptr) it fails: a cleared texture with levels 0 and 1 unmapped holds 1441792 bytes at MIN_LOD 2 and 22413312 at MIN_LOD 0.
  • With APS5_NO_SPARSE_TEXTURE_LEVELS=1 the sampling checks pass and the memory check fails: the texture with unmapped levels above its minimum LOD holds 2818048 bytes, the one with every level mapped 2818048.
sparse texture levels: a 2048x2048 BC1 image with 8 levels reports color: block 512x256, flags 0x0, mip tail from level 3, 65536 bytes at 0x0, stride 0x2b0000; sparse block 65536 bytes
sparse texture levels: MIN_LOD 2 holds 196608 bytes with levels 0 and 1 unmapped and 2818048 with every level mapped; MIN_LOD 1 after level 1 was mapped holds 720896 bytes, 2818048 with every level mapped
sparse texture levels tests passed

Paired validation, same machine and session, VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation ANYPS5_NO_SHADER_CACHE=1 ANYPS5_REQUIRE_VULKAN=1, ctest -V on main 809c7fa2df and on head 8029cae292 (this branch merged with that main): agc_driver_bc_block_copy, _bindless_images, _image_sample_bias_a16, _image_sample_lod_clamp, _image_sample_unnormalized, _image_table, _image_table_cache, _image_table_cache_bounds, _image_table_reuse and _sampled_cache_budget pass on both (100% tests passed out of 10), and with agc_driver_texture_sparse_levels on the head (100% tests passed out of 11). No "was not found but was requested" line and no VUID- line on either side. Layer insertion, from VK_LOADER_DEBUG=layer on each side:

[Vulkan Loader] INFO | LAYER:   Insert instance layer "VK_LAYER_KHRONOS_validation" (/home/…/vk-validation/root/usr/lib/libVkLayer_khronos_validation.so)

On head 6a3769c50f, same machine, same validation environment: agc_driver_texture_sparse_levels, agc_driver_sampled_clear_keys, agc_driver_idle_store_yields and the ten tests of the paired run above pass (100% tests passed out of 13), with no VUID- line and no "was not found but was requested" line. agc_driver_idle_store_yields alone: 8 of 8 runs pass on RADV. Lavapipe is not installed here, so I could not run it there; #14066 describes two races in that test's fixture that make it fail intermittently on main.

On head 17770dd69f (the review follow-up: SparseLevelsSupported also requires imageViewMinLod, and the repack loop starts at the first resident level), same machine and validation environment: agc_driver_texture_sparse_levels, agc_driver_sampled_clear_keys and agc_driver_image_sample_lod_clamp pass (100% tests passed out of 3), with no VUID- line, and the validation layer is inserted in all three. With APS5_NO_SPARSE_TEXTURE_LEVELS=1, agc_driver_texture_sparse_levels fails on the memory check again (2818048 bytes on both sides). No test covers a repacked format with skipped levels.

Performance

Spider-Man 2, with #9790 (24ff84dd34) on both sides for the earlier shader stop: main b8f0a6b202 + #9790 (4c68ffe73d) and this head 879779949a (the branch merged with that main) + #9790 (8a57e4064d), headless 1920x1080 output (the title renders 3840x2160), Cross every 30 s, warm shader caches (each build ran the scene once before its capture). The base build cannot reach a scene after the table dispatch, so the capture window is the logo sequence both reach, APS5_TRACE_SECONDS=55:10, where frame time is expected to be equal.

{"commit":"4c68ffe73d02","dirty":null,"env":{"APS5_PAD_INPUT_FILE":"<path>","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"55:10"},"gpu":"AMD Radeon RX 9070 XT (RADV GFX1201)","driver":"radv Mesa 26.2.6-arch1.1","os":"Linux 7.2.11-arch1-1","cpu":"AMD Ryzen 7 9800X3D 8-Core Processor","cpu_threads":8,"memory_mib":31192,"title_id":"PPSA03016","title":"Marvel's Spider-Man 2","content_version":"01.004.003","resolution":"3840x2160","window":{"spec":"seconds 55:10","first_present":644,"ms":10003.209},"presents":81,"frame_ms":{"p50":67.323,"p90":84.086,"p99":2299.720,"max":2299.720},"gpu_busy_ms_per_present":58.968,"worker_busy_pct":{"queue worker 0x0":30.400,"queue worker 0x20":28.949,"queue worker 0x28":0.166},"top_phases_ms_per_frame":{"Driver.Packet":71.982,"Driver.Present":39.798,"Driver.Present.render_fence_wait":39.596,"Vulkan.Retire":39.595,"Vulkan.Retire.wait":39.589,"VideoOut.Flip":39.347,"VideoOut.Flip.present":39.306,"Driver.Packet.dispatch":34.321},"trace_dropped":false,"trace":"aps5-trace-4c68ffe73d02-949919.json.gz"}
{"commit":"8a57e4064de8","dirty":null,"env":{"APS5_PAD_INPUT_FILE":"<path>","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"55:10"},"gpu":"AMD Radeon RX 9070 XT (RADV GFX1201)","driver":"radv Mesa 26.2.6-arch1.1","os":"Linux 7.2.11-arch1-1","cpu":"AMD Ryzen 7 9800X3D 8-Core Processor","cpu_threads":8,"memory_mib":31192,"title_id":"PPSA03016","title":"Marvel's Spider-Man 2","content_version":"01.004.003","resolution":"3840x2160","window":{"spec":"seconds 55:10","first_present":670,"ms":10121.355},"presents":106,"frame_ms":{"p50":66.710,"p90":106.425,"p99":423.713,"max":1676.132},"gpu_busy_ms_per_present":57.952,"worker_busy_pct":{"queue worker 0x0":33.395,"queue worker 0x20":31.624,"queue worker 0x28":0.209},"top_phases_ms_per_frame":{"Driver.Packet":60.733,"Driver.Present":39.539,"Driver.Present.render_fence_wait":39.342,"Vulkan.Retire":39.342,"Vulkan.Retire.wait":39.336,"VideoOut.Flip":39.205,"VideoOut.Flip.present":39.169,"Driver.Packet.dispatch":28.633},"trace_dropped":false,"trace":"aps5-trace-8a57e4064de8-1006991.json.gz"}

tools/trace_digest.py:

**seconds 55:10** from present 644: 81 presents, frame p50 67.3 / p90 84.1 / p99 2299.7 / max 2299.7 ms, GPU busy 59.0 ms per present   (main + #9790)
**seconds 55:10** from present 670: 106 presents, frame p50 66.7 / p90 106.4 / p99 423.7 / max 1676.1 ms, GPU busy 58.0 ms per present   (this head + #9790)

The p99 and max are the logo sequence's loading stalls (frames of 0.4 to 2.3 s in the window). Interval summaries of the warm-up runs (APS5_TRACE_SUMMARY_EVERY=10) give the same picture: frame p50 68.7 / 63.8 ms on main in the 53-63 s and 63-73 s intervals, 62.3 / 62.1 ms on the head in the 48-58 s and 58-72 s intervals.

Memory at the table dispatch (per-process drm-total-vram from fdinfo every 10 s, and the system's free VRAM/GTT from our memory guard):

build 190-200 s at the dispatch end
main + #9790 (warm-up run) 6,141 MiB at 191 s 16,351 MiB at 201 s; free VRAM 715 MiB, free GTT 3,036 MiB at 209 s stopped by the guard at 209 s
this head + #9790 (capture run) 4,912 MiB at 190 s 8,470 MiB at 200 s; free VRAM never below 5,617 MiB runs the dispatch, aborts at 211 s on the next shader refusal (ReadConstBuffer@pc=0x00009a2c)

The main + #9790 row is its warm-up run: its capture run stopped making progress at about 140 s, before the dispatch (VRAM flat at 2,694 MiB until the 280 s timeout, storage image 0xb27fc90000+0x870000: memory no longer registered; 1 pending ranges dropped among the last lines), after the capture window.

Trace files: main + #9790 (aps5-trace-4c68ffe73d02-949919), this head + #9790 (aps5-trace-8a57e4064de8-1006991).

Game runs on this head + #9790 in this session: the warm-up run aborted at 186 s on the same ReadConstBuffer@pc=0x00009a2c refusal (shader 0x11e2b47900), before the table dispatch (5,046 MiB of VRAM at 170 s, free VRAM never below 5,462 MiB); the capture run above. The stall in the main capture run is the one described for earlier heads, and it is not specific to this change: with these runs it has been seen in 1 of 17 runs with this change and 2 of 13 without it.

Checklist

  • Based on current main; no other open PR implements the same functions (#12746 drops top levels on request and is lossy; this keeps the image whole)
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • 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: PPSA03016 #10195: the VRAM collapse at the bindless table dispatch (with #9790 or #9969 for the earlier shader stop; it then stops on the next shader refusal)
  • GPUs tested: AMD Radeon RX 9070 XT, RADV Mesa 26.2.6, Arch Linux
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5091130473 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/13646). Originally posted by [hugodearaujo](https://github.com/hugodearaujo) on 2026-10-30T21:16:26Z. --- ### What A title that streams texture mips by mapping pages keeps a T# over the whole mip chain, sets `MIN_LOD` to the first level it has streamed in, and leaves the guest memory of the levels above it unmapped. The sampled texture is still made with every level, so the device allocates and uploads levels the GPU never reads and the guest never wrote. Spider-Man 2 (PPSA03016 01.004.003) resolves a 22,528-record bindless T# heap in one compute dispatch (shader `0x11e2b3d500`, image table 0 at `0x1197030000`, 22,528 keys, not narrowed). Its 7,509 distinct textures span 15,394 MiB of mip chains, of which 1,052 MiB are committed guest memory; 6,259 of them have `MIN_LOD > 0`, and the levels above it are exactly the unmapped ones (13 exceptions). Making all of them took 15 GiB of device memory in about 10 s on a 16 GiB card (11.2 GiB device-local plus 4 GiB placed in host memory), and the run was stopped there. The texture is now created as a sparse residency image when the device has `sparseResidencyImage2D` for its format. The image keeps its full extent and level count, and only the levels at and below the clamp get memory (the mip tail and the whole levels from `floor(MIN_LOD)` on). The levels above stay unbound, are not uploaded, and are never sampled, since the view keeps the T#'s `MIN_LOD`. Sampling, explicit LOD, the `_cl` clamp operand, size queries and image loads see the same image as before. This is a memory change: frame time is not expected to move. - `UnmappedLevelsBelowMinLod` counts the leading levels of a 2D or 2D-array T# (base level 0, not depth-compare, sRGB-expanded or created from a clear value) below `floor(EffectiveMinLod)` whose guest memory has no committed page in any layer. A committed byte, a guest mip-tail level or the view's last level stops it. - `SparseLevelsSupported` checks the device feature, `VK_EXT_image_view_min_lod` (so the view carries the clamp), the image format properties with the sparse flags, and `vkGetPhysicalDeviceSparseImageFormatProperties`. Otherwise, or with `APS5_NO_SPARSE_TEXTURE_LEVELS`, the texture is made whole as before. The detile, repack and copy loops start at the first resident level. - `PlanSparseLevels` turns the image's sparse memory requirements into binds: the color levels from the first resident one up to the mip tail, the color mip tail (one, or one per layer), and every metadata mip tail (one with `VK_SPARSE_IMAGE_FORMAT_SINGLE_MIPTAIL_BIT`, otherwise one per layer, each with `VK_SPARSE_MEMORY_BIND_METADATA_BIT`). Requirements with an aspect other than color and metadata, or without color, give no plan, and the texture is created again as a whole image. - `BindSparseLevels` allocates one block for the plan and binds it with `vkQueueBindSparse`, waiting on a fence, as resident heap mirrors do. Without a queue of its own the bind needs the GPU lock, so it is used only by a thread that holds it. - The device enables `sparseResidencyImage2D` with `sparseBinding`, and `Context` carries it and `vkGetPhysicalDeviceSparseImageFormatProperties`. ### Tested Arch Linux (kernel 7.2.11), AMD Radeon RX 9070 XT (RADV GFX1201, Mesa 26.2.6), Release. Head `6a3769c50f` is this branch rebased onto main `a4eca2a056` plus the cleared-texture fix; the results below up to the paired validation are from earlier heads, and the last paragraph of this section is the rerun on `6a3769c50f`. `agc_driver_texture_sparse_levels` (new): - Requirement handling, without a device: two layers of a 1024x1024 image with the color mip tail from level 3 bind levels 1 and 2 of each layer and one tail per layer; a single metadata mip tail adds one `VK_SPARSE_MEMORY_BIND_METADATA_BIT` bind, a per-layer one adds one per layer at the stride; levels past the tail bind the tail alone; a depth aspect, or requirements without color, give no plan. - It returns 77 (skipped, with the reason) when the device has no sparse residency for 2D BC1 images, so a pass means the sparse path ran. On RADV it prints what a sparse BC1 image reports: color only, no metadata. - A 2048x2048 BC1 texture with 8 levels and `MIN_LOD` 2.0, linear, with levels 0 and 1 in uncommitted pages, against the same texture with every level committed: `image_sample_d_cl`, `image_sample_cl` and the two offset variants on 32 threads give the level the hardware selects (`max(LOD, clamp operand, MIN_LOD)`) and the same results for both textures, and the sparse one holds 196,608 bytes against 2,818,048. - Streaming: level 1 is committed and filled afterwards. At `MIN_LOD` 2 the texture samples as before; with `MIN_LOD` lowered to 1 it samples as the fully committed texture at `MIN_LOD` 1, and holds 720,896 bytes (level 1 is bound now) against 2,818,048. - A cleared texture (main's fast-clear path): R8G8B8A8 2048x2048, 8 levels, `MIN_LOD` 2, levels 0 and 1 in uncommitted pages, must hold as many bytes as the same cleared texture at `MIN_LOD` 0, since `vkCmdClearColorImage` clears every level. With the old condition (no `clear != nullptr`) it fails: `a cleared texture with levels 0 and 1 unmapped holds 1441792 bytes at MIN_LOD 2 and 22413312 at MIN_LOD 0`. - With `APS5_NO_SPARSE_TEXTURE_LEVELS=1` the sampling checks pass and the memory check fails: `the texture with unmapped levels above its minimum LOD holds 2818048 bytes, the one with every level mapped 2818048`. ``` sparse texture levels: a 2048x2048 BC1 image with 8 levels reports color: block 512x256, flags 0x0, mip tail from level 3, 65536 bytes at 0x0, stride 0x2b0000; sparse block 65536 bytes sparse texture levels: MIN_LOD 2 holds 196608 bytes with levels 0 and 1 unmapped and 2818048 with every level mapped; MIN_LOD 1 after level 1 was mapped holds 720896 bytes, 2818048 with every level mapped sparse texture levels tests passed ``` Paired validation, same machine and session, `VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation ANYPS5_NO_SHADER_CACHE=1 ANYPS5_REQUIRE_VULKAN=1`, `ctest -V` on main `809c7fa2df` and on head `8029cae292` (this branch merged with that main): `agc_driver_bc_block_copy`, `_bindless_images`, `_image_sample_bias_a16`, `_image_sample_lod_clamp`, `_image_sample_unnormalized`, `_image_table`, `_image_table_cache`, `_image_table_cache_bounds`, `_image_table_reuse` and `_sampled_cache_budget` pass on both (`100% tests passed out of 10`), and with `agc_driver_texture_sparse_levels` on the head (`100% tests passed out of 11`). No "was not found but was requested" line and no `VUID-` line on either side. Layer insertion, from `VK_LOADER_DEBUG=layer` on each side: ``` [Vulkan Loader] INFO | LAYER: Insert instance layer "VK_LAYER_KHRONOS_validation" (/home/…/vk-validation/root/usr/lib/libVkLayer_khronos_validation.so) ``` On head `6a3769c50f`, same machine, same validation environment: `agc_driver_texture_sparse_levels`, `agc_driver_sampled_clear_keys`, `agc_driver_idle_store_yields` and the ten tests of the paired run above pass (`100% tests passed out of 13`), with no `VUID-` line and no "was not found but was requested" line. `agc_driver_idle_store_yields` alone: 8 of 8 runs pass on RADV. Lavapipe is not installed here, so I could not run it there; #14066 describes two races in that test's fixture that make it fail intermittently on `main`. On head `17770dd69f` (the review follow-up: `SparseLevelsSupported` also requires `imageViewMinLod`, and the repack loop starts at the first resident level), same machine and validation environment: `agc_driver_texture_sparse_levels`, `agc_driver_sampled_clear_keys` and `agc_driver_image_sample_lod_clamp` pass (`100% tests passed out of 3`), with no `VUID-` line, and the validation layer is inserted in all three. With `APS5_NO_SPARSE_TEXTURE_LEVELS=1`, `agc_driver_texture_sparse_levels` fails on the memory check again (`2818048` bytes on both sides). No test covers a repacked format with skipped levels. #### Performance Spider-Man 2, with #9790 (`24ff84dd34`) on both sides for the earlier shader stop: main `b8f0a6b202` + #9790 (`4c68ffe73d`) and this head `879779949a` (the branch merged with that main) + #9790 (`8a57e4064d`), headless 1920x1080 output (the title renders 3840x2160), Cross every 30 s, warm shader caches (each build ran the scene once before its capture). The base build cannot reach a scene after the table dispatch, so the capture window is the logo sequence both reach, `APS5_TRACE_SECONDS=55:10`, where frame time is expected to be equal. ```json {"commit":"4c68ffe73d02","dirty":null,"env":{"APS5_PAD_INPUT_FILE":"<path>","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"55:10"},"gpu":"AMD Radeon RX 9070 XT (RADV GFX1201)","driver":"radv Mesa 26.2.6-arch1.1","os":"Linux 7.2.11-arch1-1","cpu":"AMD Ryzen 7 9800X3D 8-Core Processor","cpu_threads":8,"memory_mib":31192,"title_id":"PPSA03016","title":"Marvel's Spider-Man 2","content_version":"01.004.003","resolution":"3840x2160","window":{"spec":"seconds 55:10","first_present":644,"ms":10003.209},"presents":81,"frame_ms":{"p50":67.323,"p90":84.086,"p99":2299.720,"max":2299.720},"gpu_busy_ms_per_present":58.968,"worker_busy_pct":{"queue worker 0x0":30.400,"queue worker 0x20":28.949,"queue worker 0x28":0.166},"top_phases_ms_per_frame":{"Driver.Packet":71.982,"Driver.Present":39.798,"Driver.Present.render_fence_wait":39.596,"Vulkan.Retire":39.595,"Vulkan.Retire.wait":39.589,"VideoOut.Flip":39.347,"VideoOut.Flip.present":39.306,"Driver.Packet.dispatch":34.321},"trace_dropped":false,"trace":"aps5-trace-4c68ffe73d02-949919.json.gz"} {"commit":"8a57e4064de8","dirty":null,"env":{"APS5_PAD_INPUT_FILE":"<path>","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"55:10"},"gpu":"AMD Radeon RX 9070 XT (RADV GFX1201)","driver":"radv Mesa 26.2.6-arch1.1","os":"Linux 7.2.11-arch1-1","cpu":"AMD Ryzen 7 9800X3D 8-Core Processor","cpu_threads":8,"memory_mib":31192,"title_id":"PPSA03016","title":"Marvel's Spider-Man 2","content_version":"01.004.003","resolution":"3840x2160","window":{"spec":"seconds 55:10","first_present":670,"ms":10121.355},"presents":106,"frame_ms":{"p50":66.710,"p90":106.425,"p99":423.713,"max":1676.132},"gpu_busy_ms_per_present":57.952,"worker_busy_pct":{"queue worker 0x0":33.395,"queue worker 0x20":31.624,"queue worker 0x28":0.209},"top_phases_ms_per_frame":{"Driver.Packet":60.733,"Driver.Present":39.539,"Driver.Present.render_fence_wait":39.342,"Vulkan.Retire":39.342,"Vulkan.Retire.wait":39.336,"VideoOut.Flip":39.205,"VideoOut.Flip.present":39.169,"Driver.Packet.dispatch":28.633},"trace_dropped":false,"trace":"aps5-trace-8a57e4064de8-1006991.json.gz"} ``` `tools/trace_digest.py`: ``` **seconds 55:10** from present 644: 81 presents, frame p50 67.3 / p90 84.1 / p99 2299.7 / max 2299.7 ms, GPU busy 59.0 ms per present (main + #9790) **seconds 55:10** from present 670: 106 presents, frame p50 66.7 / p90 106.4 / p99 423.7 / max 1676.1 ms, GPU busy 58.0 ms per present (this head + #9790) ``` The p99 and max are the logo sequence's loading stalls (frames of 0.4 to 2.3 s in the window). Interval summaries of the warm-up runs (`APS5_TRACE_SUMMARY_EVERY=10`) give the same picture: frame p50 68.7 / 63.8 ms on main in the 53-63 s and 63-73 s intervals, 62.3 / 62.1 ms on the head in the 48-58 s and 58-72 s intervals. Memory at the table dispatch (per-process `drm-total-vram` from fdinfo every 10 s, and the system's free VRAM/GTT from our memory guard): | build | 190-200 s | at the dispatch | end | |---|---|---|---| | main + #9790 (warm-up run) | 6,141 MiB at 191 s | 16,351 MiB at 201 s; free VRAM 715 MiB, free GTT 3,036 MiB at 209 s | stopped by the guard at 209 s | | this head + #9790 (capture run) | 4,912 MiB at 190 s | 8,470 MiB at 200 s; free VRAM never below 5,617 MiB | runs the dispatch, aborts at 211 s on the next shader refusal (`ReadConstBuffer@pc=0x00009a2c`) | The main + #9790 row is its warm-up run: its capture run stopped making progress at about 140 s, before the dispatch (VRAM flat at 2,694 MiB until the 280 s timeout, `storage image 0xb27fc90000+0x870000: memory no longer registered; 1 pending ranges dropped` among the last lines), after the capture window. Trace files: [main + #9790](https://github.com/hugodearaujo/AnyPS5/releases/download/pr-test-data-2026-11-02/pr13646-sm2-base-4c68ffe73d.json.gz) (`aps5-trace-4c68ffe73d02-949919`), [this head + #9790](https://github.com/hugodearaujo/AnyPS5/releases/download/pr-test-data-2026-11-02/pr13646-sm2-head-8a57e4064d.json.gz) (`aps5-trace-8a57e4064de8-1006991`). Game runs on this head + #9790 in this session: the warm-up run aborted at 186 s on the same `ReadConstBuffer@pc=0x00009a2c` refusal (shader `0x11e2b47900`), before the table dispatch (5,046 MiB of VRAM at 170 s, free VRAM never below 5,462 MiB); the capture run above. The stall in the main capture run is the one described for earlier heads, and it is not specific to this change: with these runs it has been seen in 1 of 17 runs with this change and 2 of 13 without it. ### Checklist - [x] Based on current `main`; no other open PR implements the same functions (#12746 drops top levels on request and is lossy; this keeps the image whole) - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] Fixes: none - [x] Unblocks: PPSA03016 #10195: the VRAM collapse at the bindless table dispatch (with #9790 or #9969 for the earlier shader stop; it then stops on the next shader refusal) - [x] GPUs tested: AMD Radeon RX 9070 XT, RADV Mesa 26.2.6, Arch Linux - [x] AI-assisted: yes
MarcZX10 commented 2026-10-30 21:51:42 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-30T21:51:42Z.

Review: CHANGES_REQUESTED


Reviewed — changes requested

The perf report still lacks the required matched capture summaries, and the paired AGC validation evidence does not identify results for this exact head.

What I ran

Reviewed head 7dfff6a6391bbc0826009e81e8cc8c455c137854 against PR base e584b5a7ebe7cad2a2fd7df44243352f623f957a; a merge preview against current main f1e340be4a6e67440f1d2b2574ede902140cbed4 was clean. Environment: Debian 12 x86-64, Python 3.11.2, GCC 12.2.0; no project build or C++ test was run locally.

python3 tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 13646
git diff --check e584b5a7ebe7cad2a2fd7df44243352f623f957a...7dfff6a6391bbc0826009e81e8cc8c455c137854
python3 tools/pr_test_quality.py --root /tmp/anyps5-review-13646 --json core/libs/prx/libSceAgcDriver/tests/execution/TextureSparseLevels.cpp
python3 tools/pr_stack_check.py 13646 --repo boykopovar/AnyPS5 --output-dir /tmp/anyps5-pr-precheck/boykopovar-AnyPS5-pr-13646-7dfff6a6391b/stack

Results

Check Result
Diff check Passed; no whitespace errors.
Conventions and PR template Passed.
Current-main merge preview Clean against f1e340be4a6e67440f1d2b2574ede902140cbed4; no declared dependency.
New-test registration heuristic Warned that the source was not found literally in CMake. Manual inspection confirmed the tests/execution/*.cpp glob includes it.
Hosted CI Eligibility, conventions, portability, intake, labels, report, and Windows passed; Linux and specialized jobs were skipped.
Performance report Still labeled perf numbers missing; the description contains no matched aps5-summary.jsonl pair, attached traces, or trace_digest.py output.
Paired Vulkan validation evidence The description lists a main SHA and says “this branch,” but does not identify the PR SHA tested or provide the exact-head logs. It explicitly says the game runs used earlier commit b0da41e81f; the latest head is 7dfff6a6391b.
Precheck wrapper Its isolated checkout lacks the workspace-only ABI and test-quality helpers. Diff, conventions, and mergeability checks passed; I ran the test-quality helper directly and verified its registration warning manually.
Unedited output from focused checks
All conventions checks passed.
{
  "findings": [
    {
      "path": "core/libs/prx/libSceAgcDriver/tests/execution/TextureSparseLevels.cpp",
      "line": 1,
      "kind": "possible-unregistered-cpp-test",
      "message": "Changed C++ test source path was not found literally in CMake files; inspect registration, generated source lists, and workflow coverage."
    }
  ],
  "negative_control_candidates": [],
  "limits": [
    "Heuristics can miss weak assertions and can flag valid tests; inspect every finding.",
    "A test that passes against base is not by itself proof that the PR test is inadequate.",
    "Negative controls are only candidates until the test actually runs against base and fails by assertion rather than import/setup error."
  ]
}

Findings

Blocking

  • Required performance report is missing. The title is perf(agc), and the repository requires a valid summary line for main and for the change from the same title, scene, and machine, plus both traces. The current description has memory-use measurements, but no aps5-summary.jsonl lines, trace attachments, or tools/trace_digest.py output; GitHub still applies perf numbers missing. Please attach the matched captures and digest output, with the changed capture built from the reviewed head.
  • AGC validation is not pinned to the reviewed head. Repository rules require the same focused tests on main and the change with the validation layer and required Vulkan environment, and comparison for new VUIDs. The description identifies main 21a556f567 and says the test passed “on this branch,” without naming the tested PR SHA or supplying the exact logs. It also says the game runs used b0da41e81f, not current head 7dfff6a6391b. Please provide the exact main and PR SHAs and paired logs for the current target and reviewed head, including the required environment, layer-insertion confirmation, and VUID comparison. If those results were not run on 7dfff6a6391b, rerun the focused suite there.

Non-blocking

The test-quality warning is a heuristic false positive: CMakeLists.txt uses a CONFIGURE_DEPENDS glob over tests/execution/*.cpp, so this test is discovered. I found no additional source-level blocker in the inspected test and sparse-binding paths.

Sources

Not verified

I did not build or run C++ tests locally, or run Linux, console, macOS, NVIDIA, or other GPU behavior. The reported RX 9070 XT results are author-provided; I did not independently reproduce the game or validation runs. Hosted Windows passed, but it does not supply the missing performance captures or exact-head hardware evidence.

To get this to a good state

Attach the required performance captures and exact-head paired Vulkan validation evidence, or rerun those checks on current main and 7dfff6a6391bbc0826009e81e8cc8c455c137854. I will rerun the same relevant no-build checks and reassess the evidence on the new head.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5719064360 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/13646#pullrequestreview-5719064360). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-30T21:51:42Z. **Review:** CHANGES_REQUESTED --- # Reviewed — changes requested The `perf` report still lacks the required matched capture summaries, and the paired AGC validation evidence does not identify results for this exact head. ## What I ran Reviewed head `7dfff6a6391bbc0826009e81e8cc8c455c137854` against PR base `e584b5a7ebe7cad2a2fd7df44243352f623f957a`; a merge preview against current `main` `f1e340be4a6e67440f1d2b2574ede902140cbed4` was clean. Environment: Debian 12 x86-64, Python 3.11.2, GCC 12.2.0; no project build or C++ test was run locally. ```sh python3 tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 13646 git diff --check e584b5a7ebe7cad2a2fd7df44243352f623f957a...7dfff6a6391bbc0826009e81e8cc8c455c137854 python3 tools/pr_test_quality.py --root /tmp/anyps5-review-13646 --json core/libs/prx/libSceAgcDriver/tests/execution/TextureSparseLevels.cpp python3 tools/pr_stack_check.py 13646 --repo boykopovar/AnyPS5 --output-dir /tmp/anyps5-pr-precheck/boykopovar-AnyPS5-pr-13646-7dfff6a6391b/stack ``` ## Results | Check | Result | |---|---| | Diff check | Passed; no whitespace errors. | | Conventions and PR template | Passed. | | Current-main merge preview | Clean against `f1e340be4a6e67440f1d2b2574ede902140cbed4`; no declared dependency. | | New-test registration heuristic | Warned that the source was not found literally in CMake. Manual inspection confirmed the `tests/execution/*.cpp` glob includes it. | | Hosted CI | Eligibility, conventions, portability, intake, labels, report, and Windows passed; Linux and specialized jobs were skipped. | | Performance report | Still labeled `perf numbers missing`; the description contains no matched `aps5-summary.jsonl` pair, attached traces, or `trace_digest.py` output. | | Paired Vulkan validation evidence | The description lists a main SHA and says “this branch,” but does not identify the PR SHA tested or provide the exact-head logs. It explicitly says the game runs used earlier commit `b0da41e81f`; the latest head is `7dfff6a6391b`. | | Precheck wrapper | Its isolated checkout lacks the workspace-only ABI and test-quality helpers. Diff, conventions, and mergeability checks passed; I ran the test-quality helper directly and verified its registration warning manually. | <details> <summary>Unedited output from focused checks</summary> ```text All conventions checks passed. ``` ```text { "findings": [ { "path": "core/libs/prx/libSceAgcDriver/tests/execution/TextureSparseLevels.cpp", "line": 1, "kind": "possible-unregistered-cpp-test", "message": "Changed C++ test source path was not found literally in CMake files; inspect registration, generated source lists, and workflow coverage." } ], "negative_control_candidates": [], "limits": [ "Heuristics can miss weak assertions and can flag valid tests; inspect every finding.", "A test that passes against base is not by itself proof that the PR test is inadequate.", "Negative controls are only candidates until the test actually runs against base and fails by assertion rather than import/setup error." ] } ``` </details> ## Findings ### Blocking - **Required performance report is missing.** The title is `perf(agc)`, and the repository requires a valid summary line for `main` and for the change from the same title, scene, and machine, plus both traces. The current description has memory-use measurements, but no `aps5-summary.jsonl` lines, trace attachments, or `tools/trace_digest.py` output; GitHub still applies `perf numbers missing`. Please attach the matched captures and digest output, with the changed capture built from the reviewed head. - **AGC validation is not pinned to the reviewed head.** Repository rules require the same focused tests on `main` and the change with the validation layer and required Vulkan environment, and comparison for new VUIDs. The description identifies main `21a556f567` and says the test passed “on this branch,” without naming the tested PR SHA or supplying the exact logs. It also says the game runs used `b0da41e81f`, not current head `7dfff6a6391b`. Please provide the exact `main` and PR SHAs and paired logs for the current target and reviewed head, including the required environment, layer-insertion confirmation, and VUID comparison. If those results were not run on `7dfff6a6391b`, rerun the focused suite there. ### Non-blocking The test-quality warning is a heuristic false positive: `CMakeLists.txt` uses a `CONFIGURE_DEPENDS` glob over `tests/execution/*.cpp`, so this test is discovered. I found no additional source-level blocker in the inspected test and sparse-binding paths. ## Sources - [Performance and AGC validation requirements at the PR base](https://github.com/boykopovar/AnyPS5/blob/e584b5a7ebe7cad2a2fd7df44243352f623f957a/CONTRIBUTING.md#L69-L70) - [Changed sparse binding and fallback checks at the reviewed head](https://github.com/boykopovar/AnyPS5/blob/7dfff6a6391bbc0826009e81e8cc8c455c137854/core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp#L355-L425) - [Sparse-level test at the reviewed head](https://github.com/boykopovar/AnyPS5/blob/7dfff6a6391bbc0826009e81e8cc8c455c137854/core/libs/prx/libSceAgcDriver/tests/execution/TextureSparseLevels.cpp) - [CMake execution-test source glob at the reviewed head](https://github.com/boykopovar/AnyPS5/blob/7dfff6a6391bbc0826009e81e8cc8c455c137854/core/libs/prx/libSceAgcDriver/CMakeLists.txt#L2440) ## Not verified I did not build or run C++ tests locally, or run Linux, console, macOS, NVIDIA, or other GPU behavior. The reported RX 9070 XT results are author-provided; I did not independently reproduce the game or validation runs. Hosted Windows passed, but it does not supply the missing performance captures or exact-head hardware evidence. ## To get this to a good state Attach the required performance captures and exact-head paired Vulkan validation evidence, or rerun those checks on current `main` and `7dfff6a6391bbc0826009e81e8cc8c455c137854`. I will rerun the same relevant no-build checks and reassess the evidence on the new head.
MarcZX10 commented 2026-10-31 08:05:50 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-31T08:05:50Z.

Review: CHANGES_REQUESTED


Re-checked — new head, changes requested

The update adds performance summaries and exact-head test results, but the traces are not attached and the paired validation uses an outdated main revision.

What I ran

Reviewed head 068304dd6fff9dcd3d7b8ee2379ec4535228322d against PR base e584b5a7ebe7cad2a2fd7df44243352f623f957a. The merge preview against current main e8c25dd3baa6e78531d5eee067fec5cbe8af3dcf is clean. Environment: Debian 12 x86_64, Python 3.11.2, GCC 12.2.0. I did not build or run GPU tests locally.

python3 tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 13646
python3 tools/pr_stack_check.py 13646 --repo boykopovar/AnyPS5 --output-dir /tmp/anyps5-pr-precheck/boykopovar-AnyPS5-pr-13646-068304dd6fff/stack
git diff --check e584b5a7ebe7cad2a2fd7df44243352f623f957a...068304dd6fff9dcd3d7b8ee2379ec4535228322d
git diff --name-only 21a556f567abd916c0cea306347866a6cd45aac6 e8c25dd3baa6e78531d5eee067fec5cbe8af3dcf -- core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp

Results

Check Result
Diff and conventions Passed
Merge preview Clean against current main
Author-reported paired Vulkan tests 10/10 on main 21a556f567; 11/11 on PR head 068304dd6f; no reported missing-layer or VUID lines
Author-reported performance report Both summary lines and digest output are present and describe the same machine and scene
Trace attachments Not present in the PR description; it lists two filenames without links or attached files
Test baseline freshness The report uses main 21a556f567; current main is e8c25dd3baa6e78531d5eee067fec5cbe8af3dcf. Main changed VulkanDevice.cpp between those revisions, and this PR also changes that file
Precheck helper availability ABI/test-quality helpers were missing from the isolated precheck checkout; this is a tooling limitation, not a source finding
Local build or GPU tests Not run
Unedited local check output
All conventions checks passed.
# PR stack check — fresh

Target: https://github.com/boykopovar/AnyPS5/pull/13646
Target branch tip: `e8c25dd3baa6e78531d5eee067fec5cbe8af3dcf`
All heads unchanged: **True**
Dependency order: #13646

## Individual merge previews

- PR #13646: **clean** against current base; head `068304dd6fff9dcd3d7b8ee2379ec4535228322d`; changed paths: none reported

## Dependency relationships

No declared PR dependencies were found in the target PR chain.
/usr/bin/python3: can't open file '/tmp/anyps5-pr-precheck/boykopovar-AnyPS5-pr-13646-068304dd6fff/head-068304dd6fff-afc68377/tools/pr_abi_audit.py': [Errno 2] No such file or directory
/usr/bin/python3: can't open file '/tmp/anyps5-pr-precheck/boykopovar-AnyPS5-pr-13646-068304dd6fff/head-068304dd6fff-afc68377/tools/pr_test_quality.py': [Errno 2] No such file or directory

Findings

Blocking

  1. The PR description names aps5-trace-e201f2641bfe-3022567.json.gz and aps5-trace-b01b0e895c6a-3449435.json.gz, but neither is linked or attached. The performance report form requires both trace files to be attached. Please attach them. Performance-report rule · Performance report form

  2. The paired validation run compares the PR head with main 21a556f567, while current main is e8c25dd3baa6e78531d5eee067fec5cbe8af3dcf. Because VulkanDevice.cpp changed between those revisions and is also changed by this PR, the old baseline does not verify the current-base behavior. Please rerun the same focused validation tests on current main and this exact PR head, with the required environment, layer confirmation, and VUID comparison. PR's changed file at reviewed head · current main file

Non-blocking

The static precheck could not run its ABI and test-quality helpers because those workspace-only scripts are not present in its isolated checkout. I found no additional blocker in the inspected sparse-level planning and streaming changes.

Sources

Not verified

I did not independently reproduce the author's GPU test or performance runs. The PR's hardware results are author-reported; hosted Windows passed, while Linux and specialized GPU jobs were skipped.

To get this to a good state

Attach both traces and rerun the paired focused validation tests against current main and head 068304dd6fff9dcd3d7b8ee2379ec4535228322d. I will rerun the same relevant checks on the new head.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5721923527 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/13646#pullrequestreview-5721923527). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-31T08:05:50Z. **Review:** CHANGES_REQUESTED --- # Re-checked — new head, changes requested The update adds performance summaries and exact-head test results, but the traces are not attached and the paired validation uses an outdated `main` revision. ## What I ran Reviewed head `068304dd6fff9dcd3d7b8ee2379ec4535228322d` against PR base `e584b5a7ebe7cad2a2fd7df44243352f623f957a`. The merge preview against current `main` `e8c25dd3baa6e78531d5eee067fec5cbe8af3dcf` is clean. Environment: Debian 12 x86_64, Python 3.11.2, GCC 12.2.0. I did not build or run GPU tests locally. ```sh python3 tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 13646 python3 tools/pr_stack_check.py 13646 --repo boykopovar/AnyPS5 --output-dir /tmp/anyps5-pr-precheck/boykopovar-AnyPS5-pr-13646-068304dd6fff/stack git diff --check e584b5a7ebe7cad2a2fd7df44243352f623f957a...068304dd6fff9dcd3d7b8ee2379ec4535228322d git diff --name-only 21a556f567abd916c0cea306347866a6cd45aac6 e8c25dd3baa6e78531d5eee067fec5cbe8af3dcf -- core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp ``` ## Results | Check | Result | |---|---| | Diff and conventions | Passed | | Merge preview | Clean against current `main` | | Author-reported paired Vulkan tests | 10/10 on main `21a556f567`; 11/11 on PR head `068304dd6f`; no reported missing-layer or VUID lines | | Author-reported performance report | Both summary lines and digest output are present and describe the same machine and scene | | Trace attachments | Not present in the PR description; it lists two filenames without links or attached files | | Test baseline freshness | The report uses main `21a556f567`; current main is `e8c25dd3baa6e78531d5eee067fec5cbe8af3dcf`. Main changed `VulkanDevice.cpp` between those revisions, and this PR also changes that file | | Precheck helper availability | ABI/test-quality helpers were missing from the isolated precheck checkout; this is a tooling limitation, not a source finding | | Local build or GPU tests | Not run | <details><summary>Unedited local check output</summary> ```text All conventions checks passed. ``` ```text # PR stack check — fresh Target: https://github.com/boykopovar/AnyPS5/pull/13646 Target branch tip: `e8c25dd3baa6e78531d5eee067fec5cbe8af3dcf` All heads unchanged: **True** Dependency order: #13646 ## Individual merge previews - PR #13646: **clean** against current base; head `068304dd6fff9dcd3d7b8ee2379ec4535228322d`; changed paths: none reported ## Dependency relationships No declared PR dependencies were found in the target PR chain. ``` ```text /usr/bin/python3: can't open file '/tmp/anyps5-pr-precheck/boykopovar-AnyPS5-pr-13646-068304dd6fff/head-068304dd6fff-afc68377/tools/pr_abi_audit.py': [Errno 2] No such file or directory /usr/bin/python3: can't open file '/tmp/anyps5-pr-precheck/boykopovar-AnyPS5-pr-13646-068304dd6fff/head-068304dd6fff-afc68377/tools/pr_test_quality.py': [Errno 2] No such file or directory ``` </details> ## Findings ### Blocking 1. The PR description names `aps5-trace-e201f2641bfe-3022567.json.gz` and `aps5-trace-b01b0e895c6a-3449435.json.gz`, but neither is linked or attached. The performance report form requires both trace files to be attached. Please attach them. [Performance-report rule](https://github.com/boykopovar/AnyPS5/blob/e8c25dd3baa6e78531d5eee067fec5cbe8af3dcf/CONTRIBUTING.md#L69-L70) · [Performance report form](https://github.com/boykopovar/AnyPS5/blob/e8c25dd3baa6e78531d5eee067fec5cbe8af3dcf/.github/ISSUE_TEMPLATE/performance.yml) 2. The paired validation run compares the PR head with `main` `21a556f567`, while current `main` is `e8c25dd3baa6e78531d5eee067fec5cbe8af3dcf`. Because `VulkanDevice.cpp` changed between those revisions and is also changed by this PR, the old baseline does not verify the current-base behavior. Please rerun the same focused validation tests on current `main` and this exact PR head, with the required environment, layer confirmation, and VUID comparison. [PR's changed file at reviewed head](https://github.com/boykopovar/AnyPS5/blob/068304dd6fff9dcd3d7b8ee2379ec4535228322d/core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp) · [current main file](https://github.com/boykopovar/AnyPS5/blob/e8c25dd3baa6e78531d5eee067fec5cbe8af3dcf/core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp) ### Non-blocking The static precheck could not run its ABI and test-quality helpers because those workspace-only scripts are not present in its isolated checkout. I found no additional blocker in the inspected sparse-level planning and streaming changes. ## Sources - [Performance and paired-validation requirements at current main](https://github.com/boykopovar/AnyPS5/blob/e8c25dd3baa6e78531d5eee067fec5cbe8af3dcf/CONTRIBUTING.md#L69-L70) - [Current main revision used for this re-check](https://github.com/boykopovar/AnyPS5/commit/e8c25dd3baa6e78531d5eee067fec5cbe8af3dcf) - [Main revision used in the author's report](https://github.com/boykopovar/AnyPS5/commit/21a556f567abd916c0cea306347866a6cd45aac6) ## Not verified I did not independently reproduce the author's GPU test or performance runs. The PR's hardware results are author-reported; hosted Windows passed, while Linux and specialized GPU jobs were skipped. ## To get this to a good state Attach both traces and rerun the paired focused validation tests against current `main` and head `068304dd6fff9dcd3d7b8ee2379ec4535228322d`. I will rerun the same relevant checks on the new head.
MarcZX10 commented 2026-10-31 12:25:02 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-31T12:25:02Z.

Review: CHANGES_REQUESTED


Re-checked — new head, changes requested

The trace report still compares head 068304dd6fff9dcd3d7b8ee2379ec4535228322d with main 21a556f567, while the submitted head is now 879779949a32e9cfff72307317893c9b1e121563 and live main is 60bdb061356db736928eee431cd8bd4c9ba68036; live main has since changed three paths touched by this PR.

What I ran

Reviewed the exact submitted head 879779949a32e9cfff72307317893c9b1e121563 against PR base b8f0a6b2025605b78eb70646bda79f458a577c82 and live main 60bdb061356db736928eee431cd8bd4c9ba68036. The current-main merge preview is clean (4a5fd54d0a0d250bdcf2c9abb2b687fca9d2b255). Environment: Linux x86-64, GCC 12.2.0, Python 3.11.2. I did not build or run GPU tests locally.

python3 tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 13646
git merge-tree --write-tree 60bdb061356db736928eee431cd8bd4c9ba68036 refs/reviews/pr-13646-current
git diff --check 60bdb061356db736928eee431cd8bd4c9ba68036...refs/reviews/pr-13646-current
python3 tools/check_conventions.py --base 60bdb061356db736928eee431cd8bd4c9ba68036 --head refs/reviews/pr-13646-current
gh pr view 13646 -R boykopovar/AnyPS5 --json headRefOid,statusCheckRollup

Results

Check Result
Diff check and conventions Passed; no whitespace errors; All conventions checks passed.
Current-main merge preview Clean; tree 4a5fd54d0a0d250bdcf2c9abb2b687fca9d2b255
Paired performance evidence The attached report is for earlier head 068304d and baseline 21a556; it does not cover the current submitted head and live main
Main changes since the reported baseline VulkanDevice.cpp, Texture.hpp, and Texture.cpp changed between 21a556f567 and current main; these paths overlap the PR’s implementation
Hosted checks Conventions, portability, labels, eligibility, and report passed; Windows was still running; Linux product and specialized jobs were skipped
GPU checks Author reports test runs on earlier head 068304d; no current-head run was independently performed here
Unedited local output
All conventions checks passed.

git diff --check produced no output and exited 0. git merge-tree --write-tree printed:

4a5fd54d0a0d250bdcf2c9abb2b687fca9d2b255

Negative control

Assertion Code change for control Result
The PR reduces memory versus the current main implementation Capture the same title/scene/machine on current main and this exact PR head Not verified; the attached pair uses earlier revisions.

Findings

Blocking

  • Performance evidence is stale for the reviewed revisions. Since the reported baseline 21a556f567, live main changed VulkanDevice.cpp, Texture.hpp, and Texture.cpp, all in the sparse-texture implementation area touched by this PR. The submitted head also advanced from 068304d to 8797799. Please provide paired aps5-summary.jsonl lines for live main 60bdb061356db736928eee431cd8bd4c9ba68036 and the current PR head, from the same title, scene, and machine; attach both traces and include tools/trace_digest.py output. Keep the report’s memory comparison, since frame-time improvement is not claimed.

Non-blocking

None.

Sources

Not verified

I did not run a local build, capture GPU traces, or rerun the tests. The current Windows product job was in progress; Linux product checks were skipped.

To get this to a good state

Provide the paired current-main/current-head trace evidence requested above. I will re-run the same static checks and review the report on the updated head.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5722699497 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/13646#pullrequestreview-5722699497). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-31T12:25:02Z. **Review:** CHANGES_REQUESTED --- # Re-checked — new head, changes requested The trace report still compares head `068304dd6fff9dcd3d7b8ee2379ec4535228322d` with `main` `21a556f567`, while the submitted head is now `879779949a32e9cfff72307317893c9b1e121563` and live `main` is `60bdb061356db736928eee431cd8bd4c9ba68036`; live `main` has since changed three paths touched by this PR. ## What I ran Reviewed the exact submitted head `879779949a32e9cfff72307317893c9b1e121563` against PR base `b8f0a6b2025605b78eb70646bda79f458a577c82` and live `main` `60bdb061356db736928eee431cd8bd4c9ba68036`. The current-main merge preview is clean (`4a5fd54d0a0d250bdcf2c9abb2b687fca9d2b255`). Environment: Linux x86-64, GCC 12.2.0, Python 3.11.2. I did not build or run GPU tests locally. ```sh python3 tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 13646 git merge-tree --write-tree 60bdb061356db736928eee431cd8bd4c9ba68036 refs/reviews/pr-13646-current git diff --check 60bdb061356db736928eee431cd8bd4c9ba68036...refs/reviews/pr-13646-current python3 tools/check_conventions.py --base 60bdb061356db736928eee431cd8bd4c9ba68036 --head refs/reviews/pr-13646-current gh pr view 13646 -R boykopovar/AnyPS5 --json headRefOid,statusCheckRollup ``` ## Results | Check | Result | |---|---| | Diff check and conventions | Passed; no whitespace errors; `All conventions checks passed.` | | Current-main merge preview | Clean; tree `4a5fd54d0a0d250bdcf2c9abb2b687fca9d2b255` | | Paired performance evidence | The attached report is for earlier head `068304d` and baseline `21a556`; it does not cover the current submitted head and live `main` | | Main changes since the reported baseline | `VulkanDevice.cpp`, `Texture.hpp`, and `Texture.cpp` changed between `21a556f567` and current `main`; these paths overlap the PR’s implementation | | Hosted checks | Conventions, portability, labels, eligibility, and report passed; Windows was still running; Linux product and specialized jobs were skipped | | GPU checks | Author reports test runs on earlier head `068304d`; no current-head run was independently performed here | <details><summary>Unedited local output</summary> ```text All conventions checks passed. ``` `git diff --check` produced no output and exited 0. `git merge-tree --write-tree` printed: ```text 4a5fd54d0a0d250bdcf2c9abb2b687fca9d2b255 ``` </details> ## Negative control | Assertion | Code change for control | Result | |---|---|---| | The PR reduces memory versus the current main implementation | Capture the same title/scene/machine on current main and this exact PR head | Not verified; the attached pair uses earlier revisions. | ## Findings ### Blocking - **Performance evidence is stale for the reviewed revisions.** Since the reported baseline `21a556f567`, live `main` changed `VulkanDevice.cpp`, `Texture.hpp`, and `Texture.cpp`, all in the sparse-texture implementation area touched by this PR. The submitted head also advanced from `068304d` to `8797799`. Please provide paired `aps5-summary.jsonl` lines for live `main` `60bdb061356db736928eee431cd8bd4c9ba68036` and the current PR head, from the same title, scene, and machine; attach both traces and include `tools/trace_digest.py` output. Keep the report’s memory comparison, since frame-time improvement is not claimed. ### Non-blocking None. ## Sources - [Changes on `main` since the reported baseline](https://github.com/boykopovar/AnyPS5/compare/21a556f567...60bdb061356db736928eee431cd8bd4c9ba68036) - [Sparse texture implementation at the reviewed head](https://github.com/boykopovar/AnyPS5/tree/879779949a32e9cfff72307317893c9b1e121563/core/libs/prx/libSceAgcDriver) ## Not verified I did not run a local build, capture GPU traces, or rerun the tests. The current Windows product job was in progress; Linux product checks were skipped. ## To get this to a good state Provide the paired current-main/current-head trace evidence requested above. I will re-run the same static checks and review the report on the updated head.
adriadam10 commented 2026-10-31 12:50:34 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-31T12:50:34Z.

Review: CHANGES_REQUESTED


Checked the level selection, the sparse bind plan with metadata tails and the skipped uploads for unbound levels. One point before this can go in:

  • Texture.cpp:501: a texture created with a clear value (the constructor parameter that landed on main after this branch started) still goes through UnmappedLevelsBelowMinLod, so it can be created as a sparse image. vkCmdClearColorImage at Texture.cpp:574 then clears every level, and the levels above MIN_LOD have no memory bound on the sparse path. A cleared texture has no guest memory to skip, so it should be made whole: depthCompare || srgbExpand || clear != nullptr ? 0u : UnmappedLevelsBelowMinLod(...). A test case with a clear value and MIN_LOD > 0 would pin it.
  • The branch has two Merge main ... commits (8029cae292, 879779949a); a rebase onto main drops them. It conflicts only in the Texture constructor signature, where both the clear parameter and the new helpers stay.

Our rebase with the fix above built, but agc_driver_idle_store_yields failed on lavapipe in two runs and passed 16/16 on RADV and 48/48 under load, with and without APS5_NO_SPARSE_TEXTURE_LEVELS, so I could not tie it to this change. Please check it on the rebased head.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5722770157 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/13646#pullrequestreview-5722770157). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-31T12:50:34Z. **Review:** CHANGES_REQUESTED --- Checked the level selection, the sparse bind plan with metadata tails and the skipped uploads for unbound levels. One point before this can go in: - `Texture.cpp:501`: a texture created with a `clear` value (the constructor parameter that landed on `main` after this branch started) still goes through `UnmappedLevelsBelowMinLod`, so it can be created as a sparse image. `vkCmdClearColorImage` at `Texture.cpp:574` then clears every level, and the levels above `MIN_LOD` have no memory bound on the sparse path. A cleared texture has no guest memory to skip, so it should be made whole: `depthCompare || srgbExpand || clear != nullptr ? 0u : UnmappedLevelsBelowMinLod(...)`. A test case with a clear value and `MIN_LOD` > 0 would pin it. - The branch has two `Merge main ...` commits (`8029cae292`, `879779949a`); a rebase onto `main` drops them. It conflicts only in the `Texture` constructor signature, where both the `clear` parameter and the new helpers stay. Our rebase with the fix above built, but `agc_driver_idle_store_yields` failed on lavapipe in two runs and passed 16/16 on RADV and 48/48 under load, with and without `APS5_NO_SPARSE_TEXTURE_LEVELS`, so I could not tie it to this change. Please check it on the rebased head.
MarcZX10 commented 2026-10-31 18:32:01 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-31T18:32:01Z.

Review: DISMISSED


Re-checked — new head, changes requested

The sparse-image guard still permits a cleared texture with MIN_LOD above zero, although the clear path writes every mip level and the sparse path leaves upper levels unbound.

What I ran

Reviewed submitted head 879779949a32e9cfff72307317893c9b1e121563 against PR base b8f0a6b2025605b78eb70646bda79f458a577c82; the independent merge preview against current main ca073ec3ad0d766ea9f4658e418a5c977001a353 was clean. Environment: Linux x86-64, Python 3.11.2, GCC 12.2.0.

python3 tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 13646 --output-dir /tmp/anyps5-13646-rereview
gh api 'repos/boykopovar/AnyPS5/contents/core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp?ref=879779949a32e9cfff72307317893c9b1e121563'
gh api 'repos/boykopovar/AnyPS5/contents/core/libs/prx/libSceAgcDriver/tests/execution/TextureSparseLevels.cpp?ref=879779949a32e9cfff72307317893c9b1e121563'

Results

Check Result
Diff check Passed.
Conventions and PR template Passed.
Merge preview against current main Clean.
ABI audit and test-quality helper Could not run: those workspace-only scripts are absent from the isolated PR snapshot.
Local C++ tests/build Not run; this review pass does not build.
Hosted checks The PR's Windows job passed; Linux product and specialized GPU jobs were skipped at the latest snapshot.
Author-reported GPU evidence Adria reports a rebase build; agc_driver_idle_store_yields failed twice on lavapipe and passed on RADV. The comment does not identify that rebased tree as this submitted head.
Unedited local check output
All conventions checks passed.

git diff --check exited 0 with no output. The stack report says the individual preview against ca073ec3ad0d766ea9f4658e418a5c977001a353 was clean.

Negative control

Assertion Change to code under test Result
A cleared texture with MIN_LOD > 0 avoids clearing unbound mip levels Force the sparse path for a cleared texture Not run; no exact-head build or GPU test was run here.

Findings

Blocking

At Texture.cpp, unmapped is computed without considering clear, so a cleared texture may set skip and create a sparse image. The clear branch then passes a range covering every mip level to vkCmdClearColorImage at the same head. With MIN_LOD > 0, the sparse plan leaves the skipped levels unbound, yet the clear covers them. Please make cleared textures use the whole-image path (for example, include clear != nullptr in the condition that disables unmapped) and add a regression case with a clear value and MIN_LOD > 0.

Non-blocking

None.

Sources

Not verified

I did not build or run the C++ tests, Vulkan validation, GPU captures, or console behavior. I did not reproduce the reported lavapipe failure or RADV passes. The helper failures are tooling limitations caused by scripts absent from the isolated PR snapshot.

To get this to a good state

Disable sparse mip omission for cleared textures and add the clear != nullptr plus MIN_LOD > 0 regression. Please rerun the affected focused test on the exact rebased head, including the lavapipe case that failed in Adria's report. I will rerun the same no-build checks and review the new head.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5724315411 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/13646#pullrequestreview-5724315411). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-31T18:32:01Z. **Review:** DISMISSED --- # Re-checked — new head, changes requested The sparse-image guard still permits a cleared texture with `MIN_LOD` above zero, although the clear path writes every mip level and the sparse path leaves upper levels unbound. ## What I ran Reviewed submitted head `879779949a32e9cfff72307317893c9b1e121563` against PR base `b8f0a6b2025605b78eb70646bda79f458a577c82`; the independent merge preview against current `main` `ca073ec3ad0d766ea9f4658e418a5c977001a353` was clean. Environment: Linux x86-64, Python 3.11.2, GCC 12.2.0. ```sh python3 tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 13646 --output-dir /tmp/anyps5-13646-rereview gh api 'repos/boykopovar/AnyPS5/contents/core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp?ref=879779949a32e9cfff72307317893c9b1e121563' gh api 'repos/boykopovar/AnyPS5/contents/core/libs/prx/libSceAgcDriver/tests/execution/TextureSparseLevels.cpp?ref=879779949a32e9cfff72307317893c9b1e121563' ``` ## Results | Check | Result | |---|---| | Diff check | Passed. | | Conventions and PR template | Passed. | | Merge preview against current `main` | Clean. | | ABI audit and test-quality helper | Could not run: those workspace-only scripts are absent from the isolated PR snapshot. | | Local C++ tests/build | Not run; this review pass does not build. | | Hosted checks | The PR's Windows job passed; Linux product and specialized GPU jobs were skipped at the latest snapshot. | | Author-reported GPU evidence | Adria reports a rebase build; `agc_driver_idle_store_yields` failed twice on lavapipe and passed on RADV. The comment does not identify that rebased tree as this submitted head. | <details><summary>Unedited local check output</summary> ```text All conventions checks passed. ``` `git diff --check` exited 0 with no output. The stack report says the individual preview against `ca073ec3ad0d766ea9f4658e418a5c977001a353` was clean. </details> ## Negative control | Assertion | Change to code under test | Result | |---|---|---| | A cleared texture with `MIN_LOD > 0` avoids clearing unbound mip levels | Force the sparse path for a cleared texture | Not run; no exact-head build or GPU test was run here. | ## Findings ### Blocking At [`Texture.cpp`](https://github.com/boykopovar/AnyPS5/blob/879779949a32e9cfff72307317893c9b1e121563/core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp#L501), `unmapped` is computed without considering `clear`, so a cleared texture may set `skip` and create a sparse image. The clear branch then passes a range covering every mip level to `vkCmdClearColorImage` at [the same head](https://github.com/boykopovar/AnyPS5/blob/879779949a32e9cfff72307317893c9b1e121563/core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp#L552-L574). With `MIN_LOD > 0`, the sparse plan leaves the skipped levels unbound, yet the clear covers them. Please make cleared textures use the whole-image path (for example, include `clear != nullptr` in the condition that disables `unmapped`) and add a regression case with a clear value and `MIN_LOD > 0`. ### Non-blocking None. ## Sources - [Sparse guard and all-level clear path at the submitted head](https://github.com/boykopovar/AnyPS5/blob/879779949a32e9cfff72307317893c9b1e121563/core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp#L501-L574) - [Sparse-level test at the submitted head; it has no clear-value case](https://github.com/boykopovar/AnyPS5/blob/879779949a32e9cfff72307317893c9b1e121563/core/libs/prx/libSceAgcDriver/tests/execution/TextureSparseLevels.cpp) - [Current-main clear path](https://github.com/boykopovar/AnyPS5/blob/ca073ec3ad0d766ea9f4658e418a5c977001a353/core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp#L409-L431) - [Adria's review comment and reported lavapipe/RADV runs](https://github.com/boykopovar/AnyPS5/pull/13646#pullrequestreview-5722770157) ## Not verified I did not build or run the C++ tests, Vulkan validation, GPU captures, or console behavior. I did not reproduce the reported lavapipe failure or RADV passes. The helper failures are tooling limitations caused by scripts absent from the isolated PR snapshot. ## To get this to a good state Disable sparse mip omission for cleared textures and add the `clear != nullptr` plus `MIN_LOD > 0` regression. Please rerun the affected focused test on the exact rebased head, including the lavapipe case that failed in Adria's report. I will rerun the same no-build checks and review the new head.
XairRrR commented 2026-11-03 09:09:37 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by XairRrR on 2026-11-03T09:09:37Z.

Review: COMMENTED


Reviewed — comments

The PR merges cleanly, builds, and passes the conventions check, the tests and the validation comparison here. The sparse-plan cases that need no device fail when I break the metadata bind. I found nothing blocking. I'm leaving a comment instead of an approval because lavapipe skips the sparse device path, so I could not run it on this machine.

What I ran

Head 6a3769c50f13b44639b1c00d6b07c165f181f515, merged with --no-ff into main 4f41f4c375f5abb487dbd184fbc150f31994d762 (merged tree 427e56d1861b6f8bfc639d29b0434adab4620e8e), in a clean worktree. Machine: Debian 13 VM, 32 vCPU (2× Xeon Gold 6136), GCC 14.2.0, Release, Ninja. Vulkan was lavapipe (Mesa 26.1.6, LLVM 19); there was no GPU.

git diff --check 4f41f4c375f5abb487dbd184fbc150f31994d762...6a3769c50f13b44639b1c00d6b07c165f181f515
python3 tools/check_conventions.py --base 4f41f4c375f5abb487dbd184fbc150f31994d762
VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation ANYPS5_NO_SHADER_CACHE=1 ANYPS5_REQUIRE_VULKAN=1 VK_LOADER_DEBUG=error,warn,layer \
  ctest --test-dir build -V -R "agc_driver_(texture_sparse_levels|sampled_clear_keys|image_sample_lod_clamp)$"
VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation ANYPS5_NO_SHADER_CACHE=1 ANYPS5_REQUIRE_VULKAN=1 \
  ctest --test-dir build -V -R "^agc_driver_native_depth_uniform_planes$"   # merged tree, then with the PR's production files taken from main
ninja -C build -j32 -l32 agc_driver_native_multisample_depth_tests agc_driver_texture_sparse_levels_tests
ctest --test-dir build --output-on-failure -R "^agc_driver_texture_sparse_levels$"   # with the mutation below, then restored
git status --porcelain

Results

Check Result
git diff --check Clean
check_conventions.py All conventions checks passed.
Configure, build, libs (script) OK
Selected tests (script) 2,175 run, 2,053 passed, 115 skipped (all expected according to check_skips.py). No new failures and no timeouts. The 7 known failures also fail on main. agc_driver_alpha_to_coverage_sample_mask_export passed on rerun.
agc_driver_texture_sparse_levels (lavapipe, validation layer) Skipped (77): the device has no BC texture compression or VK_EXT_image_view_min_lod. The device-free CheckPlans() runs before this skip and passed.
agc_driver_sampled_clear_keys (validation layer) Passed, with no VUID- lines
agc_driver_image_sample_lod_clamp Skipped: lavapipe has no VK_EXT_image_view_min_lod
Validation layer loaded Yes. Insert instance layer "VK_LAYER_KHRONOS_validation" and Inserted device layer appear in every log. No "was not found but was requested" line.
Script validation comparison: new VUID-vkCmdDispatch-groupCountX-00386 in agc_driver_native_depth_uniform_planes Comes from main, not this PR (details below)
The new VUID comes from main

The script's validation baseline is d1ae628bc2. That revision does not have the agc_driver_native_depth_uniform_planes test, which was added to main later.

  • On the merged tree the test passes and reports 8 VUID-vkCmdDispatch-groupCountX-00386.
  • I then took VulkanDevice.cpp, Context.hpp, Texture.hpp and Texture.cpp from main 4f41f4c375 and rebuilt agc_driver_native_multisample_depth_tests. The result was identical: 8 VUID-vkCmdDispatch-groupCountX-00386, and the test passed.

The PR's change does not cause this VUID, so I don't count it as a finding.

Negative control

The new test calls PlanSparseLevels, which does not exist on main, so the test can't be built against main's driver. Because lavapipe skips the device part, I ran a mutation control on the part that does run:

  • Mutation: in PlanSparseLevels, the metadata mip-tail binds got flag 0 instead of VK_SPARSE_MEMORY_BIND_METADATA_BIT. I rebuilt and ran the test.
  • Result: it failed with sparse level plan: the metadata bind does not carry VK_SPARSE_MEMORY_BIND_METADATA_BIT at the metadata tail.
  • Restore: I put back the merged Texture.cpp and rebuilt. The test skipped (77) again, and git status --porcelain was empty.

The negative control for the device path (APS5_NO_SPARSE_TEXTURE_LEVELS=1 makes the memory check fail) comes from the author on RADV and from jacknieland on a GTX 1650. I could not reproduce it here.

Earlier findings

  • The cleared-texture finding from adriadam10 and MarcZX10 is resolved. Texture.cpp:533 now excludes clear != nullptr, and the test has a regression case for it. I could not run that case here: it sits after the lavapipe skip.
  • The metadata finding and the skip-code finding from oneandonlydean are resolved. PlanSparseLevels binds single and per-layer metadata tails with VK_SPARSE_MEMORY_BIND_METADATA_BIT and refuses other aspects. The test returns 77 when sparse BC1 is not supported. The mutation above shows the plan cases check the metadata flag.
  • The perf evidence is now complete: two summary lines with different commits, the trace_digest.py output, and linked traces. The captures are from the pre-rebase head 879779949a. The only later production change is the cleared-texture exclusion, which leaves more textures whole, so the memory numbers are an upper bound on the savings. I'm not treating this as blocking.

Findings

Blocking

None.

Non-blocking

  1. The sparse path does not require VK_EXT_image_view_min_lod.
    • Where: core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp:378-382 (SparseLevelsSupported).
    • What happens: on a device that applies MIN_LOD in the shader instead (shaderImageMinLod), the view still covers level 0. SpirvImageEmitter.cpp:1666-1684 clamps sample operations, including explicit LOD. Anything that reaches a level without going through that clamp would read the unbound levels, for example a fetch with an explicit mip. Before this PR those levels held data uploaded from unmapped guest pages; now they are non-resident memory, which is undefined unless residencyNonResidentStrict is set.
    • Why it matters: the description says the levels above the clamp "are never sampled, since the view keeps the T#'s MIN_LOD". That holds only when the view actually carries the clamp.
    • Suggested fix: add context.imageViewMinLod to the conditions in SparseLevelsSupported. Every device the PR reports results for has the extension, so this guarantees the claim by construction and costs nothing there.
  2. Repack work still runs for skipped levels.
    • Where: Texture.cpp:677, the repacked-format loop, which still runs from level 0.
    • What happens: it repacks the linear data of the skipped levels, which are never copied into the image. The result is correct, but the work is wasted.
    • Suggested fix: start the loop at skip, the same as the detile loop at 668 and the copy loop at 719.

Not verified

  • The sparse device path itself: binding, level upload, sampling equivalence, the streaming case and the cleared-texture case. Lavapipe has no VK_EXT_image_view_min_lod, so the test skips before any of it runs. What I know about this path comes from the author (RADV RX 9070 XT, on this head), jacknieland (GTX 1650 on Windows, on 879779949a) and the NVIDIA CI comment for this head (RTX 2000 Ada, no new validation IDs compared with main).
  • Paired lavapipe validation of the new test: I could not compare main and the change for agc_driver_texture_sparse_levels meaningfully, for the same reason.
  • The 30 s test limit on CI: the test skips on lavapipe, so I could not measure it there.
  • Title results: I did not reproduce the Spider-Man 2 memory or frame-time numbers. No title was run.

To get this to a good state

  • Consider requiring imageViewMinLod in SparseLevelsSupported so that no access can reach the unbound levels.
  • Optionally start the repack loop at skip.
  • A maintainer with a GPU that exposes sparse BC1 residency should confirm the device path. On every CI lavapipe run this test only checks the plan math.
<!-- greyfinch-sync:boykopovar/AnyPS5:review:5749520348 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/13646#pullrequestreview-5749520348). Originally posted by [XairRrR](https://github.com/XairRrR) on 2026-11-03T09:09:37Z. **Review:** COMMENTED --- # Reviewed — comments The PR merges cleanly, builds, and passes the conventions check, the tests and the validation comparison here. The sparse-plan cases that need no device fail when I break the metadata bind. I found nothing blocking. I'm leaving a comment instead of an approval because lavapipe skips the sparse device path, so I could not run it on this machine. ## What I ran Head `6a3769c50f13b44639b1c00d6b07c165f181f515`, merged with `--no-ff` into `main` `4f41f4c375f5abb487dbd184fbc150f31994d762` (merged tree `427e56d1861b6f8bfc639d29b0434adab4620e8e`), in a clean worktree. Machine: Debian 13 VM, 32 vCPU (2× Xeon Gold 6136), GCC 14.2.0, Release, Ninja. Vulkan was lavapipe (Mesa 26.1.6, LLVM 19); there was no GPU. ```sh git diff --check 4f41f4c375f5abb487dbd184fbc150f31994d762...6a3769c50f13b44639b1c00d6b07c165f181f515 python3 tools/check_conventions.py --base 4f41f4c375f5abb487dbd184fbc150f31994d762 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation ANYPS5_NO_SHADER_CACHE=1 ANYPS5_REQUIRE_VULKAN=1 VK_LOADER_DEBUG=error,warn,layer \ ctest --test-dir build -V -R "agc_driver_(texture_sparse_levels|sampled_clear_keys|image_sample_lod_clamp)$" VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation ANYPS5_NO_SHADER_CACHE=1 ANYPS5_REQUIRE_VULKAN=1 \ ctest --test-dir build -V -R "^agc_driver_native_depth_uniform_planes$" # merged tree, then with the PR's production files taken from main ninja -C build -j32 -l32 agc_driver_native_multisample_depth_tests agc_driver_texture_sparse_levels_tests ctest --test-dir build --output-on-failure -R "^agc_driver_texture_sparse_levels$" # with the mutation below, then restored git status --porcelain ``` ## Results | Check | Result | |---|---| | `git diff --check` | Clean | | `check_conventions.py` | `All conventions checks passed.` | | Configure, build, `libs` (script) | OK | | Selected tests (script) | 2,175 run, 2,053 passed, 115 skipped (all expected according to `check_skips.py`). No new failures and no timeouts. The 7 known failures also fail on `main`. `agc_driver_alpha_to_coverage_sample_mask_export` passed on rerun. | | `agc_driver_texture_sparse_levels` (lavapipe, validation layer) | Skipped (77): `the device has no BC texture compression or VK_EXT_image_view_min_lod`. The device-free `CheckPlans()` runs before this skip and passed. | | `agc_driver_sampled_clear_keys` (validation layer) | Passed, with no `VUID-` lines | | `agc_driver_image_sample_lod_clamp` | Skipped: lavapipe has no `VK_EXT_image_view_min_lod` | | Validation layer loaded | Yes. `Insert instance layer "VK_LAYER_KHRONOS_validation"` and `Inserted device layer` appear in every log. No "was not found but was requested" line. | | Script validation comparison: new `VUID-vkCmdDispatch-groupCountX-00386` in `agc_driver_native_depth_uniform_planes` | Comes from `main`, not this PR (details below) | <details><summary>The new VUID comes from main</summary> The script's validation baseline is `d1ae628bc2`. That revision does not have the `agc_driver_native_depth_uniform_planes` test, which was added to `main` later. - On the merged tree the test passes and reports `8 VUID-vkCmdDispatch-groupCountX-00386`. - I then took `VulkanDevice.cpp`, `Context.hpp`, `Texture.hpp` and `Texture.cpp` from `main` `4f41f4c375` and rebuilt `agc_driver_native_multisample_depth_tests`. The result was identical: `8 VUID-vkCmdDispatch-groupCountX-00386`, and the test passed. The PR's change does not cause this VUID, so I don't count it as a finding. </details> ## Negative control The new test calls `PlanSparseLevels`, which does not exist on `main`, so the test can't be built against `main`'s driver. Because lavapipe skips the device part, I ran a mutation control on the part that does run: - **Mutation:** in `PlanSparseLevels`, the metadata mip-tail binds got flag `0` instead of `VK_SPARSE_MEMORY_BIND_METADATA_BIT`. I rebuilt and ran the test. - **Result:** it failed with `sparse level plan: the metadata bind does not carry VK_SPARSE_MEMORY_BIND_METADATA_BIT at the metadata tail`. - **Restore:** I put back the merged `Texture.cpp` and rebuilt. The test skipped (77) again, and `git status --porcelain` was empty. The negative control for the device path (`APS5_NO_SPARSE_TEXTURE_LEVELS=1` makes the memory check fail) comes from the author on RADV and from jacknieland on a GTX 1650. I could not reproduce it here. ## Earlier findings - The cleared-texture finding from adriadam10 and MarcZX10 is resolved. `Texture.cpp:533` now excludes `clear != nullptr`, and the test has a regression case for it. I could not run that case here: it sits after the lavapipe skip. - The metadata finding and the skip-code finding from oneandonlydean are resolved. `PlanSparseLevels` binds single and per-layer metadata tails with `VK_SPARSE_MEMORY_BIND_METADATA_BIT` and refuses other aspects. The test returns 77 when sparse BC1 is not supported. The mutation above shows the plan cases check the metadata flag. - The `perf` evidence is now complete: two summary lines with different commits, the `trace_digest.py` output, and linked traces. The captures are from the pre-rebase head `879779949a`. The only later production change is the cleared-texture exclusion, which leaves more textures whole, so the memory numbers are an upper bound on the savings. I'm not treating this as blocking. ## Findings ### Blocking None. ### Non-blocking 1. **The sparse path does not require `VK_EXT_image_view_min_lod`.** - **Where:** `core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp:378-382` (`SparseLevelsSupported`). - **What happens:** on a device that applies MIN_LOD in the shader instead (`shaderImageMinLod`), the view still covers level 0. `SpirvImageEmitter.cpp:1666-1684` clamps sample operations, including explicit LOD. Anything that reaches a level without going through that clamp would read the unbound levels, for example a fetch with an explicit mip. Before this PR those levels held data uploaded from unmapped guest pages; now they are non-resident memory, which is undefined unless `residencyNonResidentStrict` is set. - **Why it matters:** the description says the levels above the clamp "are never sampled, since the view keeps the T#'s `MIN_LOD`". That holds only when the view actually carries the clamp. - **Suggested fix:** add `context.imageViewMinLod` to the conditions in `SparseLevelsSupported`. Every device the PR reports results for has the extension, so this guarantees the claim by construction and costs nothing there. 2. **Repack work still runs for skipped levels.** - **Where:** `Texture.cpp:677`, the repacked-format loop, which still runs from level 0. - **What happens:** it repacks the linear data of the skipped levels, which are never copied into the image. The result is correct, but the work is wasted. - **Suggested fix:** start the loop at `skip`, the same as the detile loop at 668 and the copy loop at 719. ## Not verified - **The sparse device path itself:** binding, level upload, sampling equivalence, the streaming case and the cleared-texture case. Lavapipe has no `VK_EXT_image_view_min_lod`, so the test skips before any of it runs. What I know about this path comes from the author (RADV RX 9070 XT, on this head), jacknieland (GTX 1650 on Windows, on `879779949a`) and the NVIDIA CI comment for this head (RTX 2000 Ada, no new validation IDs compared with `main`). - **Paired lavapipe validation of the new test:** I could not compare `main` and the change for `agc_driver_texture_sparse_levels` meaningfully, for the same reason. - **The 30 s test limit on CI:** the test skips on lavapipe, so I could not measure it there. - **Title results:** I did not reproduce the Spider-Man 2 memory or frame-time numbers. No title was run. ## To get this to a good state - Consider requiring `imageViewMinLod` in `SparseLevelsSupported` so that no access can reach the unbound levels. - Optionally start the repack loop at `skip`. - A maintainer with a GPU that exposes sparse BC1 residency should confirm the device path. On every CI lavapipe run this test only checks the plan math. <!-- anyps5-bots job=3029 head=6a3769c50f13b44639b1c00d6b07c165f181f515 -->
XairRrR commented 2026-11-03 10:22:11 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by XairRrR on 2026-11-03T10:22:11Z.

Review: APPROVED


Re-checked — approved

Commit 17770dd69f adds two things. SparseLevelsSupported now requires imageViewMinLod, and the repack loop starts at skip. Both of my earlier non-blocking findings are resolved, and the checks and the focused tests pass here.

What changed since my last review

  • Commits: one new commit, 17770dd69f. The four earlier commits are unchanged (the range-diff shows them as =). It changes two lines of core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp:
    • line 378: !context.imageViewMinLod is added to the early return in SparseLevelsSupported;
    • line 677: the IsRepackedTextureFormat loop now starts at skip.
  • Description: updated with a head 17770dd69f run. It also says that no test covers a repacked format with skipped levels.
  • Author reply: the author answered my previous review (2026-11-03T10:10Z), covered below.

What I ran

Head 17770dd69feb7a32677d8dbd5cb95ae12a2827b9, merged with --no-ff into main 4f41f4c375f5abb487dbd184fbc150f31994d762 (merged tree 552e399cb6568801446ae3b7c1cce013d7b34752), in a clean worktree.

Machine: Debian 13 VM, 32 vCPU (2× Xeon Gold 6136), GCC 14.2.0, Release, Ninja. Vulkan was lavapipe (Mesa 26.1.6, LLVM 19); there was no GPU.

git diff 6a3769c50f13b44639b1c00d6b07c165f181f515 17770dd69feb7a32677d8dbd5cb95ae12a2827b9
git diff --check 4f41f4c375f5abb487dbd184fbc150f31994d762...17770dd69feb7a32677d8dbd5cb95ae12a2827b9
python3 tools/check_conventions.py --base 4f41f4c375f5abb487dbd184fbc150f31994d762
VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation ANYPS5_NO_SHADER_CACHE=1 ANYPS5_REQUIRE_VULKAN=1 VK_LOADER_DEBUG=error,warn,layer \
  ctest --test-dir build -V -R "agc_driver_(texture_sparse_levels|sampled_clear_keys|image_sample_lod_clamp)$"
git status --porcelain
Check Result
git diff --check Clean
check_conventions.py All conventions checks passed.
Configure, build, libs (script) OK
Selected tests (script) 2,175 run, 2,053 passed, 115 skipped (all expected according to check_skips.py). No new failures and no timeouts. The 7 known failures also fail on main. agc_driver_alpha_to_coverage_sample_mask_export passed on rerun.
Focused tests, validation layer 100% tests passed, 0 tests failed out of 3. 0 VUID- lines. The layer was inserted in all 3 logs, with no "was not found but was requested" line.
agc_driver_texture_sparse_levels Skipped (77) on lavapipe: the device has no BC texture compression or VK_EXT_image_view_min_lod. The device-free plan checks run before the skip.
agc_driver_image_sample_lod_clamp Skipped: the device has no VK_EXT_image_view_min_lod, and graphics pipeline libraries keep T# minimum LODs out of the shader
Script validation comparison Lists the same VUID-vkCmdDispatch-groupCountX-00386 in agc_driver_native_depth_uniform_planes as last time. Last time I traced it to main by restoring the PR's production files from main. This push changes only Texture.cpp, so that result still holds.

Negative control

This push does not change the test. Lavapipe has no VK_EXT_image_view_min_lod, so on this machine the test skips before the device path, and neither new condition can run here. The mutation control on the plan checks from my previous review still applies: PlanSparseLevels has not changed since. The negative control for the device path on this head is author-reported: on RADV, with APS5_NO_SPARSE_TEXTURE_LEVELS=1, the memory check fails with 2818048 bytes on both sides. git status --porcelain was empty after the run.

Previous findings

  1. The sparse path does not require VK_EXT_image_view_min_lod. Resolved. Texture.cpp:378 now returns false when !context.imageViewMinLod.
    • The author says this changes nothing on current devices. Their reasons: ChainMinLod already requires the extension for a non-zero EffectiveMinLod, the base-level views without the clamp are only used for unnormalized sampling, and ShaderResources.cpp refuses that sampling when MIN_LOD is non-zero. That is plausible. The skip message of agc_driver_image_sample_lod_clamp here also shows that, without the extension, the T# minimum LOD stays out of the shader.
    • Either way, the guarantee now sits next to the code that depends on it.
  2. Repack work still runs for skipped levels. Resolved. Texture.cpp:677 starts at skip, like the detile loop (668) and the copy loop (719).
    • The layerRows path still copies level 0 from mips[0] (707-716). It cannot have skip > 0: layerRows is only set for 1D arrays, and UnmappedLevelsBelowMinLod returns 0 for anything other than 2D and 2D arrays.
    • No test covers this loop with skipped levels, as the description says. The change only removes work on levels whose results are never copied into the image.

New findings

Blocking

None.

Non-blocking

None.

Not verified

  • The sparse device path itself: binding, upload from the first resident level, sampling equivalence, the streaming case and the cleared-texture case. Lavapipe skips the test before any of it runs. What I know about this path comes from:
    • the author, on RADV RX 9070 XT with this head;
    • jacknieland, on a GTX 1650 under Windows with 879779949a;
    • the NVIDIA CI comment for 6a3769c50f.
  • A paired lavapipe validation comparison of the new test: it is not meaningful, for the same reason.
  • Repacked formats with skip > 0: no test covers them on any device.
  • Title results: I did not reproduce the Spider-Man 2 memory numbers, and no title was run.
<!-- greyfinch-sync:boykopovar/AnyPS5:review:5750482227 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/13646#pullrequestreview-5750482227). Originally posted by [XairRrR](https://github.com/XairRrR) on 2026-11-03T10:22:11Z. **Review:** APPROVED --- # Re-checked — approved Commit `17770dd69f` adds two things. `SparseLevelsSupported` now requires `imageViewMinLod`, and the repack loop starts at `skip`. Both of my earlier non-blocking findings are resolved, and the checks and the focused tests pass here. ## What changed since my last review - **Commits:** one new commit, `17770dd69f`. The four earlier commits are unchanged (the range-diff shows them as `=`). It changes two lines of `core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp`: - line 378: `!context.imageViewMinLod` is added to the early return in `SparseLevelsSupported`; - line 677: the `IsRepackedTextureFormat` loop now starts at `skip`. - **Description:** updated with a head `17770dd69f` run. It also says that no test covers a repacked format with skipped levels. - **Author reply:** the author answered my previous review (2026-11-03T10:10Z), covered below. ## What I ran Head `17770dd69feb7a32677d8dbd5cb95ae12a2827b9`, merged with `--no-ff` into `main` `4f41f4c375f5abb487dbd184fbc150f31994d762` (merged tree `552e399cb6568801446ae3b7c1cce013d7b34752`), in a clean worktree. Machine: Debian 13 VM, 32 vCPU (2× Xeon Gold 6136), GCC 14.2.0, Release, Ninja. Vulkan was lavapipe (Mesa 26.1.6, LLVM 19); there was no GPU. ```sh git diff 6a3769c50f13b44639b1c00d6b07c165f181f515 17770dd69feb7a32677d8dbd5cb95ae12a2827b9 git diff --check 4f41f4c375f5abb487dbd184fbc150f31994d762...17770dd69feb7a32677d8dbd5cb95ae12a2827b9 python3 tools/check_conventions.py --base 4f41f4c375f5abb487dbd184fbc150f31994d762 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation ANYPS5_NO_SHADER_CACHE=1 ANYPS5_REQUIRE_VULKAN=1 VK_LOADER_DEBUG=error,warn,layer \ ctest --test-dir build -V -R "agc_driver_(texture_sparse_levels|sampled_clear_keys|image_sample_lod_clamp)$" git status --porcelain ``` | Check | Result | |---|---| | `git diff --check` | Clean | | `check_conventions.py` | `All conventions checks passed.` | | Configure, build, `libs` (script) | OK | | Selected tests (script) | 2,175 run, 2,053 passed, 115 skipped (all expected according to `check_skips.py`). No new failures and no timeouts. The 7 known failures also fail on `main`. `agc_driver_alpha_to_coverage_sample_mask_export` passed on rerun. | | Focused tests, validation layer | `100% tests passed, 0 tests failed out of 3`. 0 `VUID-` lines. The layer was inserted in all 3 logs, with no "was not found but was requested" line. | | `agc_driver_texture_sparse_levels` | Skipped (77) on lavapipe: `the device has no BC texture compression or VK_EXT_image_view_min_lod`. The device-free plan checks run before the skip. | | `agc_driver_image_sample_lod_clamp` | Skipped: `the device has no VK_EXT_image_view_min_lod, and graphics pipeline libraries keep T# minimum LODs out of the shader` | | Script validation comparison | Lists the same `VUID-vkCmdDispatch-groupCountX-00386` in `agc_driver_native_depth_uniform_planes` as last time. Last time I traced it to `main` by restoring the PR's production files from `main`. This push changes only `Texture.cpp`, so that result still holds. | ## Negative control This push does not change the test. Lavapipe has no `VK_EXT_image_view_min_lod`, so on this machine the test skips before the device path, and neither new condition can run here. The mutation control on the plan checks from my previous review still applies: `PlanSparseLevels` has not changed since. The negative control for the device path on this head is author-reported: on RADV, with `APS5_NO_SPARSE_TEXTURE_LEVELS=1`, the memory check fails with `2818048` bytes on both sides. `git status --porcelain` was empty after the run. ## Previous findings 1. **The sparse path does not require `VK_EXT_image_view_min_lod`. Resolved.** `Texture.cpp:378` now returns false when `!context.imageViewMinLod`. - The author says this changes nothing on current devices. Their reasons: `ChainMinLod` already requires the extension for a non-zero `EffectiveMinLod`, the base-level views without the clamp are only used for unnormalized sampling, and `ShaderResources.cpp` refuses that sampling when `MIN_LOD` is non-zero. That is plausible. The skip message of `agc_driver_image_sample_lod_clamp` here also shows that, without the extension, the T# minimum LOD stays out of the shader. - Either way, the guarantee now sits next to the code that depends on it. 2. **Repack work still runs for skipped levels. Resolved.** `Texture.cpp:677` starts at `skip`, like the detile loop (668) and the copy loop (719). - The `layerRows` path still copies level 0 from `mips[0]` (707-716). It cannot have `skip > 0`: `layerRows` is only set for 1D arrays, and `UnmappedLevelsBelowMinLod` returns 0 for anything other than 2D and 2D arrays. - No test covers this loop with skipped levels, as the description says. The change only removes work on levels whose results are never copied into the image. ## New findings ### Blocking None. ### Non-blocking None. ## Not verified - **The sparse device path itself:** binding, upload from the first resident level, sampling equivalence, the streaming case and the cleared-texture case. Lavapipe skips the test before any of it runs. What I know about this path comes from: - the author, on RADV RX 9070 XT with this head; - jacknieland, on a GTX 1650 under Windows with `879779949a`; - the NVIDIA CI comment for `6a3769c50f`. - **A paired lavapipe validation comparison of the new test:** it is not meaningful, for the same reason. - **Repacked formats with `skip > 0`:** no test covers them on any device. - **Title results:** I did not reproduce the Spider-Man 2 memory numbers, and no title was run. <!-- anyps5-bots job=3272 head=17770dd69feb7a32677d8dbd5cb95ae12a2827b9 -->
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5!13646
No description provided.