fix(agc): build a partially committed sampled 3D view from its committed slices #10064

Merged
EagleBearerYS merged 24 commits from upstream-pr/10064 into main 2026-11-11 06:55:05 +00:00
EagleBearerYS commented 2026-10-23 07:47:14 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by EagleBearerYS on 2026-10-23T07:47:14Z.


What

Ghost of Tsushima Director's Cut (PPSA02225) binds this sampled view about 9 minutes in, during its opening (milescoviello, Linux, RTX 4070 Ti, first comment):

[gpu] sampled view 0x1564050000 (320x1280 format 71, dimension 4, tile 7, slices 0..899) covers 4781 MiB
[gpu] view 0x1564050000 of 4781 MiB lies in the guest allocation 0x1500000000..0x1598600000 (2438 MiB, ...): 157 of its 900 slices fit in the range
  • The run ends at the cap: while the view is built, the host heap grows by about 3 GB in 2 s, and the run ends at the 20 GiB memory cap (563-572 s, twice).
  • This view is the one stop: with a local cut that kept only the 157 slices, the title went on to its intro cinematic (second comment).
  • Why that cut isn't a fix: a shallower volume moves every normalized r sample.

Why it costs that much: main already defines the texels past the committed range. ReadCommitted reads uncommitted pages as zeros. But it materializes the zeros at full size, and holds them three times on the way into the image:

  • a snapshot of the whole surface;
  • a host-visible staging buffer;
  • tiled and linear device buffers.

For this view that's about 9.3 GiB of host memory.

The change: a sampled k3D view whose range isn't wholly committed keeps its full extent, and only the slabs with committed memory go through the upload.

  • Eligibility: no storage-image source, Uncompressed keys and no DCC, no depth comparison, no sRGB expansion. Everything else takes main's path unchanged.
  • The slab list: committedSlabs splits the surface into its guest slabs. That's one slice in the per-slice Z/R 64KB_X branch or a linear volume, and blockDepth slices in a thick one.
    • It keeps every slab with at least one committed page, chosen by commitment, not by the allocation.
    • When every slab has one, main's path runs.
  • The snapshot packs only those slabs, one ReadCommitted per run of adjacent slabs. Uncommitted pages inside an uploaded slab still read as zeros.
  • The upload:
    • Staging, tiled and linear buffers cover only the uploaded slabs. Each slab is detiled from its packed offset, with its real slice index as the swizzle input.
    • Skipped layers get zeros copied from one vkCmdFillBuffer-zeroed device buffer with vkCmdCopyBufferToImage. That isn't a clear, so block-compressed formats take the same path.
  • The cache entry keeps the slab set and the view's committed ranges. A hit needs the same set, so a commit or decommit that changes which slabs are uploaded always rebuilds. It also needs every page that was committed when the snapshot was taken to be committed still, so a page decommitted inside a kept slab rebuilds and reads zeros. The compare and the write generation cover the uploaded bytes, newly committed pages included.
  • A log line next to covers … MiB, rate-limited the same way, says how many slabs were uploaded and how many zero-filled.
  • Unchanged:
    • arrays and cubes, which #9318 bounds;
    • storage-image sources, depth copy, sRGB expansion and DCC.
  • Cost: one DescribeCommitted walk per lookup of an eligible k3D view (above), before the cache lookup, so hits pay it too, wholly committed views included. There's none when the lookup already holds the view's committed ranges.
    • For this view, if only the 157 slices are committed, the host side drops from about 9.3 GiB to about 1.6 GiB, twice the uploaded bytes.
    • The full-extent image itself is the same as main's.

#9318: this sits in the snapshot and upload path, not in #9318's view bound, so the two compose, and #9318 needs no k3D case. If BoundArrayWindow ever trimmed k3D views, it would run first and change the texels (a shallower volume).

Tested

Not tested: Ghost of Tsushima Director's Cut with this fix. milescoviello has it on test/ghost-9742-9717-3d (bc32434751), the base they ran plus this commit (offer). That branch passes ^agc_driver_partially on Linux (run). On Windows, its older base fails to build a test that main has since fixed. This PR's own Windows build is the run below.

New modes of tests/execution/PartiallyResidentSnapshot.cpp (agc_driver_partially_<mode>, lavapipe):

  • Memory. Every volume is 64 deep, and each committed slab has its own pattern. The bytes read count the snapshot's guest reads; the bytes kept count what the upload holds (staging, tiled, linear and zeros):

    mode surface committed bytes read (main / this PR) bytes kept (main / this PR)
    committed-volume R_X, RGBA16F, 64x64, one 64 KiB slab per slice slices 0-21, plus 16 KiB of slice 22 4,194,304 / 1,507,328 12,582,912 / 4,587,520
    committed-volume-thick S_X thick, 4 slabs of 16 slices slab 0, plus half of slab 1 2,097,152 / 1,048,576 not reached on main / 3,178,496
    committed-volume-linear linear, 32 KiB slices 23, the last one half 2,097,152 / 753,664 not reached on main / 2,293,760
    committed-volume-compare as committed-volume 3 slabs (a 192 KiB snapshot, kept for comparison) 4,194,304 / 196,608 not reached on main / 655,360
    committed-volume-whole (control) as committed-volume all 64 4,194,304 / the same 12,582,912 / the same
    committed-array (control) a 2D array of 64 layers 23, the last one partial 4,194,304 / the same 12,582,912 / the same
  • Rebuilds (committed-volume):

    • a repeat lookup reads nothing;
    • committing slice 30 rebuilds and reads 24 slices;
    • decommitting slice 5 rebuilds and reads 23;
    • committing the rest of slice 22 rebuilds;
    • each repeat after those keeps the view.
  • Compares (committed-volume-compare): newly committed zero pages compare equal and keep the view, and a CPU write rebuilds it.

  • Texels (guest compute shaders sampling at slice centres, with z = 0, 5, 21, 22, 23, 30, 40 and 63, point-filtered):

    • Fully committed slabs read their pattern, and uncommitted slabs read zero. The partial slab reads its pattern or zero, and both occur.
    • An FNV-1a hash of every result word is identical on main and with this PR in every mode:
      • R_X, before and after commit changes;
      • BC1 at 256x256x64, where zero blocks read (0, 0, 0, 1) on both trees;
      • thick, linear, and two mip levels;
      • both controls.
    • The hashes are also identical with APS5_NO_TEXTURE_CACHE=1.
  • Red/green ×10 (the same test binary against each tree's libSceAgcDriver):

    • Red: on main, committed-volume, -thick, -linear and -compare fail 10/10 with "read N bytes of guest memory at its first use, expected M".
    • Green: the controls and every sampling mode pass on both trees, and with this PR all 15 modes pass 10/10. That run called the test binary's 15 modes directly. ctest registered 13 of them until 83c9480ec0 added the mipmapped and BC1 cases.
  • Existing tests: agc_driver_partially_resident_snapshot, …_pending_stores and agc_driver_large_tracked_snapshot still pass.

  • GitHub's runners (run 39907685337, on this head, main 0db47b263d; ^agc_driver_partially|^agc_driver_large_tracked|^agc_driver_image_sample|^agc_driver_texture):

    • Linux: red with main's implementation: on its one run, agc_driver_partially_committed_volume, …_thick, …_linear and …_compare fail and the other 23 of the 27 tests pass. Green with this PR: all 27 pass ×10, none skipped.
    • Windows: builds; the 27 tests skip there, since the runner has no Vulkan device.
    • The libc and libkernel suites pass on both, run with APS5_SKIP_TIMING_TESTS=1.
  • Validation layer (run 39913316066, Khronos 1.3.275 on Linux, this head; agc_driver_guest_memory_lifetime_copy, agc_driver_large_tracked_snapshot and ^agc_driver_partially): no new VUID.

    • The only VUID on either tree is VUID-VkDeviceCreateInfo-pNext-pNext, at device creation. It comes from an sType (1000574000) newer than the layer, and main's tree shows it too.
    • main's tree doesn't have this PR's new tests, so its arm passes; the red is the run above.
  • On a cloud Linux machine:

    • the texture, sample, snapshot, volume, tiling and image sets pass 141/141 (3 skipped for device features);
    • CI's Linux job mirrored: 1873/1877. The failures are the machine's four IPv6 network tests.
  • Windows: MinGW syntax checks of Texture.cpp, ShaderResources.cpp and the test show 0 errors.

  • check_conventions.py: passes. No comment lines are added.

  • AMD Radeon 860M on Linux (RADV, Mesa 26.2.5, Fedora 44), by @Lander0606 (comment): cd60c6916f against its parent 0db47b263d, the partially, snapshot and dcc_keys tests, three runs each with and without the Khronos layer. The base passes 8 of 8 and this PR 21 of 21 in every run. The seven -samples modes sample on the 860M with no skips, and the bytes read and kept match the table above. Under the layer neither side logs a VUID- line.

  • Windows on real GPUs, by @BKlaasWerkman (comment): cd60c6916f merged into main 938812df14 (clean), Windows 11 Pro, WinLibs GCC 15.2.0, Release, ANYPS5_NO_SHADER_CACHE=1, with the Khronos validation layer (1.4.363) loaded. The 1,278 tests tools/select_tests.py picks for the PR's files, compared test by test with a full run of that main on the same GPU:

    • NVIDIA GeForce RTX 3060 Ti (617.42): 1,271 pass, 4 skip, 3 fail, the same 3 as main (the agc_driver_sample_order trio, #9056). No VUID- message is added or removed.
    • Intel Arc Graphics (Meteor Lake, 101.9150): 1,250 pass, 26 skip, 2 fail, the same 2 as main (#10126, #8604). No VUID- message is added or removed. agc_driver_alias_copy_label, which is intermittent on that device (#10199), failed in the main run and passed with this PR.
    • All 13 new agc_driver_partially_committed_* tests pass on both GPUs, none skipped, the seven -samples modes, _volume_compare and _volume_thick among them.
  • Windows on an AMD Radeon RX 9070 XT, by @BunnyFl (review): 1de16256af merged onto main, Windows 11, WinLibs GCC 15.2.0, Release, all 20 agc_driver_partially_* tests.

    • 19 pass, none skipped. With main's Texture.cpp, ShaderResources.cpp and Texture.hpp, 8 of them fail (_committed_volume, _thick and _linear among them).
    • agc_driver_partially_committed_volume_page_samples failed 3 runs of 3 in its own setup, with "cannot release part of a host allocation". d66d426203 below answers it.
    • His re-review of d66d426203 (review, approved), merged onto main, with ANYPS5_REQUIRE_VULKAN=1, the same 20 tests: 19 pass, the page case skips with its new message, 0 fail. With main's Texture.hpp, ShaderResources.cpp and Texture.cpp restored, 7 fail (_committed_volume, _thick, _linear, _compare, _mips, _bc and _empty).
  • 4a90a1a1d0, two merges of main (4be3da2c6f, then 990f45e17d). Two ShaderResources.cpp conflicts, each kept both sides:

    • #7800 (merged) wraps the sampled texture's creation in a createTexture lambda that holds sampledCacheReclaimable. This PR's packed upload goes through it: createTexture(*context.detiler, resource, components, entry.bytes, depthCompare, packedSlabs(entry.slabs)).
    • #8026 (merged) recycles snapshot buffers through a spare pool matched by size. A partly committed 3D view's snapshot holds only its committed slabs, so the pool is matched by that size, snapshotBytes(slabs, bytes), which is bytes whenever the view has no slabs.
    • On GitHub's runners (run), the partially resident, snapshot, DCC key and sampled-cache tests: on Linux, 27 of 27 pass 10 runs in a row; on Windows, 3 of 29 pass 10 runs in a row and 26 skip without a Vulkan device; none fail. The libc and libkernel suites pass on both, run with APS5_SKIP_TIMING_TESTS=1, which relaxes precise_wait's median bounds on GitHub's hosted runners.
  • After thuanquang's review: 3871b5eb66, 0fbea36bcc, c36790ee5e and 83c9480ec0 (review):

    • 0fbea36bcc, fix(agc): a cached slab view is no longer returned after a page inside a kept slab is decommitted (the cache entry change above). The new agc_driver_partially_committed_volume_page_samples commits slabs 21 and 22, samples, decommits one 4 KiB page of slab 22, and samples again. Red with the fix's ShaderResources.cpp hunk reverted: "sample of level 0 slice 22 (thread 96) reads (23.000000, 712.000000, 1.000000, 1.000000), expected the zeros of its decommitted page". Green with it.
    • 3871b5eb66, test(agc): each element of the pattern encodes its position in the slab, and the -samples checks compare each texel with the same samples of a fully committed copy, which takes the full-size path. With the slab path's packed offset shifted by 0x100 in a local build, 5 of the 7 -samples cases fail (the other 2 don't take the slab path), where the earlier pattern passed all 7. An error shared by both paths, such as one in the common detile offset, still passes: these tests compare the two paths, and there's no CPU tiling oracle.
    • c36790ee5e, test(agc): agc_driver_partially_committed_volume_empty and _empty_samples cover a volume with no committed slab. It takes the slab path with an empty slab list ("uploads the 0 of its 64 slabs"), reads 0 of its 4194304 guest bytes, and samples zeros.
    • 83c9480ec0, test(agc): agc_driver_partially_committed_volume_mips and _volume_bc are registered with ctest. The BC1 case's own device now enables BC texture compression when it has it, and skips otherwise.
    • Each commit passes its own tests at that commit: 15, 16, 18 and 20 ^agc_driver_partially_ tests on lavapipe, on a Linux machine with CI's flags.
    • On GitHub's runners (run, ^agc_driver_partially_): Linux: with main's implementation of these files, agc_driver_partially_committed_volume_page_samples fails, and with this PR 20 run, 20 pass ×10, 0 skip, 0 fail. Windows: 20 run, 0 pass, 20 skip (no Vulkan device), 0 fail. The libc and libkernel suites pass on both, run with APS5_SKIP_TIMING_TESTS=1, which relaxes precise_wait's median bounds on GitHub's hosted runners.
    • 6dd0c32a58, docs(debt): the debt entry now gives the view's guest range (4781 MiB, tiled and padded) where it said the image takes 4.7 GiB.
  • 52826ee075, a merge of main 2fade7ef4e. One conflict, in the includes of tests/execution/PartiallyResidentSnapshot.cpp: main (#9159) added <algorithm> and <span> there, which this PR also adds, so the merge keeps one of each and this PR no longer adds them. The PR's other added and removed lines are unchanged. On GitHub's runners (run), ^agc_driver_partially_ and agc_driver_large_tracked_snapshot:

    • Linux: with this PR, 21 run, 21 pass, 0 skip, 0 fail, 10 times in a row. With main's implementation of the changed files, 7 of the 21 fail, each on the guest bytes a partly committed volume reads at first use (for example, "the partially committed volume read 4194304 bytes of guest memory at its first use, expected 1507328 of its 4194304").
    • Windows: 21 run, 0 pass, 21 skip (no Vulkan device), 0 fail.
    • The libc and libkernel suites pass on both (143 and 205 tests on Linux, 170 and 221 on Windows), run with APS5_SKIP_TIMING_TESTS=1, which relaxes precise_wait's median bounds on GitHub's hosted runners.
  • 7cecc95f5e, a merge of main 0a148be963 (run). #12862 moved libSceAgcDriver's test registrations into tests/cmake/; the conflict in CMakeLists.txt is resolved with tools/agc_test_split.py resolve, which moves this PR's registrations into tests/cmake/agc_driver_partially_resident_snapshot_tests.cmake (+8 lines). Nothing else conflicted, and apart from the move this PR's diff is unchanged. With -DBUILD_TESTING=ON, ctest -N gives 3123 tests: main's 3105 plus its 18 tests, each listed once. The tests of this PR's verify set pass 10 runs in a row. Linux: 22 run, 22 pass, 0 skip, 0 fail. Windows: 22 run, 0 pass, 22 skip (no Vulkan device), 0 fail. Suites: libc and libkernel pass on Linux (199 and 308) and on Windows (226 and 330). The suites ran with APS5_SKIP_TIMING_TESTS=1, which relaxes precise_wait's median bounds on GitHub's hosted runners.

Overlap (tools/pr_overlap.py --branch against main 5255264b15; this branch merges cleanly with main):

  • Code in the same upload path, merge order only (this PR goes second and adapts to each when it merges):
    • #9431 (PS4 GCN command buffers) has merged. It changed the detile loop in Texture's constructor that this PR changes: each layer's guest offset now comes from GuestOffset(layer, mip), which stores a PS4 surface with several layers and mip levels level by level (levelMajor). The merge e15613356d keeps both: a full snapshot detiles from GuestOffset, as main does, and a packed slab from its offset in the snapshot. A level-major surface has no per-layer slabs, so a partially committed snapshot of one is refused, as main refuses its other unsupported level-major paths. #9842 is stacked on #9431, and its overlap with this PR is #9431's lines.
    • #7800 (idle image reclaim during cache creation) and #8026 (sampled snapshot buffer reuse) have merged; the merges above adapt this PR to both.
  • Test registration only, merge order only: #6249 (CMakeLists.txt). #9253 has merged.
  • #10773 and #9884 (one upload scratch per batch; dropped snapshots read straight into their staging buffer) changed the same upload in Texture's constructor, and #9884 also Texture.hpp and cachedTexture in ShaderResources.cpp. Both have merged first, as agreed for #10845 (comment), and the merges cceb0e89fc and 99be522b4c adapt this PR to them: a dropped packed-slab snapshot is read slab by slab into #9884's staging buffer (see 99be522b4c below).
  • #7085 (guest mip levels as storage images) touches the same Texture.cpp lines and is much larger. Its author agreed that this one goes first (comment). Since then, #7085 no longer waits for this PR (comment) and has dropped it from its Depends on. git merge-tree of #7085's 46b62eee09 onto 99be522b4c conflicts in two Texture.cpp hunks. After the snapshot size check, #7085's note for mip levels past the image's chain and this PR's two packed-slab checks are adjacent additions. In the upload's transfer barrier and copy regions, this PR's layerRegions lambda takes #7085's geometry.imageLevels in the barrier and in its level loop. If #7085 lands first, this PR takes that conflict in its next merge of main.
  • #12246 (B-Howell; sampled 1D arrays past maxImageArrayLayers as rows of a 2D image) adds a layerRows parameter to the same Texture constructor and cachedTexture calls, and its row copies to the same upload. It goes first, merge order only (B-Howell proposed the places in this comment; we offered #12246 first in reply), and this PR takes the merge. git merge-tree of the two heads, each merged onto main 2199ee0d47, conflicts in Texture.hpp, ShaderResources.cpp and Texture.cpp, each time one PR's addition next to the other's. The merge keeps both parameters, the packed slabs stay gated on 3D views, and the row mode is only for sampled 1D arrays.
  • #9318, #9533, #9742 and #9717: clean.
  • 849b8418e2, a merge of main e05ba6feeb (run). main's #7618 adds its swept write-only staging entry at the end of the debt file, where this PR adds its partially committed 3D textures entry; the merge keeps both, and nothing else conflicted. The tests whose names contain partially or snapshot, and the agc_driver_sample_order tests, pass 10 runs in a row. Linux: 31 run, 29 pass, 2 skip (agc_driver_sample_order_grid_reference, agc_driver_sample_order_recipe_depth_locations), 0 fail; the before arm fails seven of the agc_driver_partially_committed_ tests. Windows: 34 run, 4 pass, 30 skip (no Vulkan device), 0 fail. Suites: libc and libkernel pass on Linux (144 and 207) and on Windows (171 and 223). The suites ran with APS5_SKIP_TIMING_TESTS=1, which relaxes precise_wait's median bounds on GitHub's hosted runners.
  • 131bc657ca, a merge of main 0cd07dc4ab (run). main's agc_driver_copy_surface_bytes properties and its no-alias test sit next to this PR's committed-volume test loop in libSceAgcDriver/CMakeLists.txt; the merge keeps both, and nothing else conflicted. This PR's changed lines are the same. The partially resident and committed-volume tests with agc_driver_large_tracked_snapshot, agc_driver_alias_copy_label, agc_driver_copy_surface_bytes and agc_driver_sample_order, 24 tests: on Linux, with main's implementation of the changed files, 7 fail (agc_driver_partially_committed_volume and its _bc, _compare, _empty, _linear, _mips and _thick variants); with this PR all 24 pass 10 runs in a row, 0 skip. Windows: 24 run, 0 pass, 24 skip (no Vulkan device), 0 fail, on both trees. Suites: libc and libkernel pass on Linux (166 and 264) and on Windows (194 and 286). The suites ran with APS5_SKIP_TIMING_TESTS=1, which relaxes precise_wait's median bounds on GitHub's hosted runners.
  • 2ffbae8eb6, a merge of main 3a2b919816 (run). JJenkx's #8930 adds its WriteChanged entry at the end of docs/dev/debt/libSceAgcDriver.md, where this PR adds its partially committed 3D textures entry. The merge keeps both, main's first, and nothing else conflicted. This PR's changed lines are the same. The tests are the partially resident and committed-volume ones with agc_driver_large_tracked_snapshot, agc_driver_alias_copy_label, agc_driver_copy_surface_bytes and agc_driver_sample_order, 24 in all:
    • on Linux, all 24 pass 10 runs in a row: 24 run, 24 pass, 0 skip, 0 fail;
    • on Windows all 24 skip, with no Vulkan device: 24 run, 0 pass, 24 skip, 0 fail.
    • The libc and libkernel suites run 191 and 291 tests on Linux and 220 and 314 on Windows, with 0 failed. The suites ran with APS5_SKIP_TIMING_TESTS=1, which relaxes precise_wait's median bounds on GitHub's hosted runners.
  • e15613356d, a merge of main f7e84c4cf1 after #9431 merged (×10 run, ^agc sweep). The one conflict was the detile loop in Texture's constructor (see Overlap). The resolution keeps this PR's loop over the uploaded slabs, detiles a full snapshot from geometry.GuestOffset(slot.layer, mip) as main does and a packed slab from its offset in the snapshot, and adds a Require that refuses a partially committed snapshot of a level-major surface. This PR's other changed lines are the same.
    • ^agc_driver_partially_, agc_driver_copy_surface_bytes_no_alias and agc_driver_large_tracked_snapshot, 22 tests: on Linux all 22 pass 10 runs in a row (22 run, 22 pass, 0 skip, 0 fail), and the before arm with main's implementation of the changed files fails; on Windows all 22 skip, with no Vulkan device: 22 run, 0 pass, 22 skip, 0 fail.
    • Every ^agc test, once: Linux 1,138 run, 1,065 pass, 73 skip, 0 fail; Windows 1,167 run, 337 pass, 830 skip, 0 fail.
    • The libc and libkernel suites run 191 and 291 tests on Linux and 220 and 314 on Windows, with 0 failed. The suites ran with APS5_SKIP_TIMING_TESTS=1, which relaxes precise_wait's median bounds on GitHub's hosted runners.
  • 9e2c796766, a merge of main 6d56eb813c (run), which brings thuanquang's #11740.
    • The conflict: ShaderResources.cpp, where #11740 adds PendingLookup and its lookup function at the place this PR adds committedSlabs. The merge keeps both functions, one after the other.
    • This PR's added and removed lines are unchanged.
    • ×10: ^agc_driver_partially_, agc_driver_copy_surface_bytes_no_alias and agc_driver_large_tracked_snapshot, 22 tests.
      • Linux: 22 run, 22 pass, 0 skip, 0 fail, 10 runs in a row.
      • Windows: 22 run, 0 pass, 22 skip (no Vulkan device), 0 fail.
      • The libc and libkernel suites run 194 and 294 tests on Linux and 224 and 318 on Windows, with 0 failed. The suites ran with APS5_SKIP_TIMING_TESTS=1, which relaxes precise_wait's median bounds on GitHub's hosted runners.
  • 299171ba86, a merge of main c0fb4a6aad, which brings mrfelek's #13373 (run).
    • The conflict: docs/dev/debt/libSceAgcDriver.md only, where #13373's "Adaptive staging" bullet sits where this PR adds "Partially committed 3D textures". The merge keeps both, main's first, as this PR's earlier merges did. This PR's own diff is unchanged.
    • ×10: agc_driver_partially_resident_snapshot, agc_driver_partially_resident_pending_stores, agc_driver_large_tracked_snapshot and every ^agc_driver_partially_committed_ test.
      • Linux: 21 run, 21 pass, 0 skip, 0 fail.
      • Windows: 21 run, 0 pass, 21 skip (no Vulkan device), 0 fail.
      • The libc and libkernel suites run 199 and 307 tests on Linux and 226 and 329 on Windows, with 0 failed. The suites ran with APS5_SKIP_TIMING_TESTS=1, which relaxes precise_wait's median bounds on GitHub's hosted runners.
    • On a cloud Linux machine (lavapipe): ctest -R '^(agc|shader)' 1,099 passed, 0 failed, 75 skipped.
  • 099305bfc1, a merge of main f5b82ff453, which brings JJenkx's #13648 (sampled textures with fast-cleared DCC keys are cleared on the GPU) (run, validation run).
    • The conflicts: Texture.hpp, Texture.cpp and ShaderResources.cpp, where both PRs change the Texture constructor, its snapshot check and cachedTexture. Three hand edits beyond keeping both sides:
      • Texture.hpp:62 and Texture.cpp:341: #13648's clear is the seventh parameter and this PR's packedSlabs the eighth, so main's two clear callers are unchanged. This PR's two callers, ShaderResources.cpp:1024 and :1144, pass nullptr for clear.
      • Texture.cpp:368: a new check, "a cleared texture takes no snapshot, so it has no committed slabs".
        • The size check composes the two: a cleared texture takes an empty snapshot, one with committed slabs takes one layerBytes slab per packed index, and any other takes the whole surface.
      • ShaderResources.cpp:1095-1099: main's cache entry for a cleared texture, sized with this PR's snapshotSize instead of bytes.
    • Why the two never meet: a texture is built from committed slabs only with uncompressed DCC keys and no DCC address, and SampledClearColor clears only with fast-cleared keys. Both read the same keys.
    • What changes for a partially committed 3D view: one with fast-cleared DCC keys now takes #13648's GPU clear, where before it took the whole-surface snapshot. This PR's slab path never took DCC views.
    • This PR's own changed lines are the same apart from these edits.
    • ×10 on the tests above and agc_driver_sampled_clear_keys:
      • Linux: 22 run, 22 pass, 0 skip, 0 fail.
      • Windows: 22 run, 0 pass, 22 skip (no Vulkan device), 0 fail.
    • Validation, main f5b82ff453 against this head, the same tests, on GitHub's Linux runner (layer 1.3.275):
      • they pass on both arms;
      • the loader inserted the layer 4 times on main and 22 with this head, and neither log has was not found;
      • both report only VUID-VkDeviceCreateInfo-pNext-pNext, so the merge adds none.
    • On a cloud Linux machine (lavapipe): the 21 tests pass 10 of 10, and agc_driver_sampled_clear_keys 10 of 10. ctest -R '^agc': 1,168 passed, 0 failed, 75 skipped.
  • cceb0e89fc, a merge of main 88e804b0a7. main now has fma-rc's #10773, which reuses one tiled and one linear upload scratch per recorded batch. The merge keeps both in this PR's committed-slices upload in Texture.cpp.
    • Staging is built only when a slice uploads, sized to the snapshot.
    • With a recorder, the tiled and linear buffers come from #10773's scratch (UploadScratchBuffer); without one, they're new DeviceBuffers, as before.
    • The zero buffer stays, and the barrier waits on VK_PIPELINE_STAGE_HOST_BIT | Recorder::UploadScratchReuseStages.
    • This PR's diff over main is otherwise unchanged.
    • ×10 (run): the partially committed and partially resident tests, with agc_driver_large_tracked_snapshot, agc_driver_sampled_clear_keys and agc_recorder_upload_scratch. Linux: 23 run, 23 pass, 0 skip, 0 fail. Windows: 23 run, 0 pass, 23 skip (no Vulkan device), 0 fail, so Windows only shows that it builds. Suites: libc and libkernel pass on Linux (210 and 310) and on Windows (237 and 331). The suites ran with APS5_SKIP_TIMING_TESTS=1, which relaxes precise_wait's median bounds on GitHub's hosted runners.
    • Every agc test, once (run): Linux: 1,236 run, 1,158 pass, 77 skip, 1 fail. Windows: 1,272 run, 379 pass, 893 skip (no Vulkan device), 0 fail. The one failure is agc_driver_pipeline_journal's 120-second timeout, which main 88e804b0a7's own run of every test hits too (run).
  • 1de16256af, a merge of main 4f64f81ef7, which brings B-Howell's #12246 (1D array layer rows), the PR this one's Depends on line put first. Both PRs change Texture's constructor and its upload, and the merge keeps both.
    • The constructor takes (…, depthCompare, layerRows, clear, packedSlabs): #12246's layerRows stays where it added it, after depthCompare, and this PR's packedSlabs stays last, after clear. main's two call sites pass layerRows, and this PR's pass layerRows, nullptr, packedSlabs(…).
    • The upload builds #12246's row regions first, then this PR's regions for each uploaded slice only when the texture isn't laid out as rows, then its zero-slice regions. toTransferDst takes #12246's range (one layer for rows, the full range otherwise), and the barrier stays this PR's.
    • The two paths never meet: rows need a k1DArray, and packed slabs come only from committedSlabs, which returns none unless the view is k3D. The zero fill and its barrier exist only with packed slabs, so they never meet the one-layer range.
    • This PR's diff over main is otherwise unchanged.
    • ×10 (run): the partially committed and partially resident tests, the sample, image-sample and texture tests, and agc_recorder_upload_scratch. Linux: 48 run, 46 pass, 2 skip (agc_driver_sample_order_grid_reference, agc_driver_sample_order_recipe_depth_locations), 0 fail. Windows: 48 run, 2 pass, 46 skip (no Vulkan device), 0 fail, so Windows mostly shows that it builds. Suites: libc and libkernel pass on Linux (217 and 318) and on Windows (244 and 339). The suites ran with APS5_SKIP_TIMING_TESTS=1, which relaxes precise_wait's median bounds on GitHub's hosted runners.
    • Every agc test, once (run): Linux: 1,258 run, 1,179 pass, 78 skip, 1 fail. Windows: 1,294 run, 388 pass, 906 skip (no Vulkan device), 0 fail. The one failure is agc_driver_pipeline_journal's 120-second timeout, which main 88e804b0a7's own run of every test hits too (run). #12246's agc_driver_image_array_rows_past_layer_limit and the six 1D-array image tests pass on Linux.
  • d66d426203, test(agc), after BunnyFl's review. The page case decommits one 4 KiB page inside a committed slab. On Windows, a host allocation is 64 KiB granular, and WindowsMappings::reset refuses to release part of one.
    • The case now skips on Windows (code 77), before it opens a device, with that reason.
    • A new debt entry, "Decommitted page in a committed slab", records that the case runs on Linux only.
    • The 3D textures entry names its title by ID only, as the debt files do.
    • ×10 (run), the tests of 1de16256af's run:
      • Linux: 48 run, 46 pass, 2 skip (agc_driver_sample_order_grid_reference, agc_driver_sample_order_recipe_depth_locations), 0 fail. The page case passes all 10.
      • Windows: 48 run, 2 pass, 46 skip, 0 fail. The page case skips with its new reason, and the other 45 skips have no Vulkan device.
      • Suites: libc and libkernel pass on Linux (217 and 318) and on Windows (244 and 339). The suites ran with APS5_SKIP_TIMING_TESTS=1, which relaxes precise_wait's median bounds on GitHub's hosted runners.
  • 1d41692ec6, a merge of main 06a9092274, which brings SuarezPM's #14943 (draw names in device-lost fault reports).
    • The conflict: Texture.cpp, in the constructor's snapshot checks, where #14943 notes each texture in its LiveResourceRing and this PR checks the snapshot's size against its committed slabs. The merge keeps #14943's Note line, then this PR's slabBytes line and its two snapshot checks, whose size check already covers main's (Texture.cpp:410-413 on that merge). This PR's diff over main is otherwise unchanged.
    • ×10 (run): the partially committed and partially resident tests, the sample and image-sample tests, agc_driver_large_tracked_snapshot, agc_driver_sampled_clear_keys and agc_recorder_upload_scratch. The merge's first ×10 (run) and validation run (run) left out the 18 agc_driver_partially_committed_* cases, so these runs replace them.
      • Linux: 51 run, 48 pass, 3 skip (agc_driver_image_sample_lod_clamp, agc_driver_sample_order_grid_reference, agc_driver_sample_order_recipe_depth_locations), 0 fail. The 18 committed cases pass all 10, the page case included.
      • Windows: 51 run, 2 pass, 49 skip, 0 fail. The page case skips with its Windows reason, and the other skips have no Vulkan device.
      • Suites: libc and libkernel pass on Linux (324 and 342) and on Windows (355 and 369). The suites ran with APS5_SKIP_TIMING_TESTS=1, which relaxes precise_wait's median bounds on GitHub's hosted runners.
    • Validation (run), main 06a9092274 against this head, the same tests, on GitHub's Linux runner:
      • they pass on both arms;
      • the loader inserted the layer 32 times on main and 50 with this head;
      • both report only VUID-VkDeviceCreateInfo-pNext-pNext, so the merge adds none.
  • 407189c96e, a merge of main 1ff0fe98aa, which brings hugodearaujo's #13646 (the unmapped levels below a T# minimum LOD get no device memory).
    • The conflicts: four regions of Texture.cpp. #13646 starts each layer's detile, repack and copy loops at skip, its count of unmapped levels below the T# minimum LOD, and this PR loops over its uploaded slices instead of every layer. The merge keeps this PR's loops and starts them at skip:
      • #13646's sparse helpers (Texture.cpp:377-454) stay above the constructor (:493), which keeps this PR's packedSlabs parameter.
      • The detile and repack loops over uploaded start at skip (Texture.cpp:713 and :722).
      • layerRegions starts at skip (Texture.cpp:758-759), both for the uploaded slices (:785) and for the zero slices (:790).
    • Why the zero slices share it: skip (Texture.cpp:572-573) is nonzero only for a 2D or 2D-array view at base level 0 that isn't thick (:378). Zero slices come only from packed slabs, which committedSlabs builds only for a k3D view (ShaderResources.cpp:821), so skip is 0 wherever there are zero slices. Without packed slabs, uploaded holds every layer at main's offsets (Texture.cpp:544-547), so #13646's textures take the same levels and layers as on main.
    • This PR's diff over main is otherwise unchanged. It merges cleanly with main 4c03784113.
    • ×10 (run), the tests of 1d41692ec6's run:
      • Linux: 51 run, 48 pass, 3 skip (the same three), 0 fail. The 18 committed cases pass all 10.
      • Windows: 51 run, 2 pass, 49 skip, 0 fail.
      • Suites: libc and libkernel pass on Linux (325 and 342) and on Windows (356 and 369). The suites ran with APS5_SKIP_TIMING_TESTS=1, which relaxes precise_wait's median bounds on GitHub's hosted runners.
    • Validation (run), main 1ff0fe98aa against this head, the same tests, on GitHub's Linux runner:
      • they pass on both arms;
      • the loader inserted the layer 32 times on main and 50 with this head, and neither log has was not found;
      • both report only VUID-VkDeviceCreateInfo-pNext-pNext, so the merge adds none.
    • Every agc test, once (run): Linux: 1,371 run, 1,283 pass, 87 skip, 1 fail. Windows: 1,411 run, 421 pass, 990 skip, 0 fail. The one failure is agc_driver_pipeline_journal's 120-second timeout, which main 1ff0fe98aa's own run of every test hits too (run; Linux: 1,353 run, 1,265 pass, 87 skip, 1 fail; Windows: 1,393 run, 421 pass, 972 skip, 0 fail).
    • Not run on GitHub's runners: these loops from a nonzero skip. #13646's agc_driver_texture_sparse_levels skips on both arms there. It needs BC texture compression, VK_EXT_image_view_min_lod and sparse residency for 2D BC1 images, which the Linux runner's lavapipe doesn't all offer, and the Windows runner has no Vulkan device. Amoenus has since run it, with 99be522b4c merged into main, on two GPUs that have them (below).
  • aea05465be, a merge of main 090f57166a (×10).
    • The conflicts: two hunks in Texture.cpp's constructor, against akkadbakkad89's #16294, which samples guest 8_24_UNORM depth as D24_UNORM_S8_UINT and adds depthToFloat and barrierAspect. The repack loop keeps this PR's per-slot offsets and takes #16294's depthToFloat argument, and the transfer barrier takes #16294's barrierAspect range with this PR's barrier list. This PR's own lines are unchanged, and #15438's barrier range in StorageTexture::upload merged without a conflict.
    • ×10: the tests of 407189c96e's run, with #16294's ^agc_driver_image_depth24. Linux: 53 run, 49 pass, 3 skip (the same three), 1 fail; the 18 committed cases pass all 10, and agc_driver_image_depth24_float passes 10 of 10. The one failure, agc_driver_image_depth24 ("image_load of 8_24_UNORM reads the wrong depth for format 141: 0x3effe004 for texel 0x007ff001") also fails on main 090f57166a's own tree (run), and adriadam10's #16807 has since fixed it on main. Windows: 53 run, 2 pass, 51 skip, 0 fail. The libc and libkernel suites run 327 and 344 tests on Linux and 358 and 371 on Windows, with 0 failed. The suites ran with APS5_SKIP_TIMING_TESTS=1, which relaxes precise_wait's median bounds on GitHub's hosted runners.
  • 99be522b4c, a merge of main b1f8766e5f, which brings thuanquang's #9884 (a dropped sampled snapshot is read straight into its upload staging buffer) (×10, validation run, ^agc sweep).
    • The conflicts: Texture.hpp, Texture.cpp and ShaderResources.cpp. #9884 adds a Texture constructor that takes the staging buffer, and its cachedTexture drops a large snapshot and reads it into that buffer. The merge keeps #9884's flow and changes these of its lines:
      • Texture.hpp and Texture.cpp: #9884's staging constructor, and the private delegate that both public constructors forward to, take this PR's packedSlabs last. A partially committed snapshot that is dropped is then read slab by slab into the staging buffer.
      • Texture.cpp: the snapshot size check, and the upload's tiled buffer (UploadScratchBuffer), Keep, DeviceBuffer and copy, use the staging buffer's size when there is one (snapshotSize), since the snapshot span is then empty. The snapshot is copied into a new staging buffer only when there is none and a slice uploads (staging == nullptr && !uploaded.empty()).
      • ShaderResources.cpp: cachedTexture sizes #9884's drop test, staging buffer, spare snapshot and snapshot vector by this PR's packed snapshot size (snapshotBytes(slabs, bytes)) instead of bytes, reads through this PR's readSnapshot, and passes packedSlabs on both createTexture calls.
    • The combined path is traced on GitHub's Linux runner (run), on a verify-only branch with two temporary log lines: 20 packed-slab textures dropped their snapshot and read it into the staging buffer. The first is in agc_driver_partially_committed_volume: 23 slabs of 64 KiB, 1,507,328 bytes, over the 256 KiB drop threshold. The cases that take the path are agc_driver_partially_committed_volume and its _thick, _linear, _mips, _bc, _samples, _bc_samples, _thick_samples, _linear_samples and _mips_samples variants. 8 textures, of 196,608 bytes or less, kept their snapshot, in the _compare, _page_samples, _empty and _empty_samples variants.
    • This PR's diff over main is otherwise unchanged. It merges cleanly with main 389c568e31.
    • ×10: the tests of aea05465be's run, with agc_snapshot_read_into_staging (#9884's test), agc_sampled_cache_device_selection and the four ^agc_driver_recover_ tests, 59 in all.
      • Linux: 59 run, 56 pass, 3 skip (the same three, which skip on main's tree too), 0 fail. agc_snapshot_read_into_staging and the 18 committed cases pass all 10.
      • Windows: 59 run, 3 pass, 56 skip, 0 fail. The page case skips with its Windows reason, and the other skips have no Vulkan device, so Windows mostly shows that it builds.
      • The libc and libkernel suites run 357 and 349 tests on Linux, with 0 failed. On Windows they run 387 and 376: libc has 0 failed, and libkernel's two failures, guest_kernel_resident_fmem_export and its _patched variant, fail on main's tree too (validation run). The suites ran with APS5_SKIP_TIMING_TESTS=1, which relaxes precise_wait's median bounds on GitHub's hosted runners.
    • Validation, main b1f8766e5f against this head, the same tests, on GitHub's Linux runner:
      • they pass on both arms;
      • the loader inserted the layer 39 times on main and 57 with this head, and neither log has was not found;
      • both report only VUID-VkDeviceCreateInfo-pNext-pNext, so the merge adds none.
    • Every agc test, once: Linux: 1,551 run, 1,458 pass, 93 skip, 0 fail. Windows: 1,594 run, 474 pass, 1,120 skip, 0 fail.
  • agc_driver_texture_sparse_levels on two GPUs with sparse residency, by @Amoenus (comment, report and logs): 99be522b4c merged into main f01683380f, and that main on its own, three runs of each on each GPU. Windows 11 Enterprise (26200), GCC 15.2 UCRT, Release, with the Khronos validation layer (1.4.363) loaded.
    • NVIDIA GeForce RTX 5080 (32.0.16.2101) and AMD Radeon Graphics 1002:13c0 (32.0.21045.16010): 12 of 12 runs pass, 0 skip: 3 with main and 3 with this PR on each GPU. None of the logs has a VUID- or SYNC-HAZARD line.
    • The sparse path runs, not the skip: on both GPUs, every run reports a 2048x2048 BC1 image with 8 levels, its mip tail from level 3, and the bytes the image holds at minimum LOD 2 and 1. So this PR's detile, repack and copy loops have run from a nonzero skip (see 407189c96e above).
    • This covers that test only. The agc_driver_partially_* tests weren't part of this run.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • 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; #6249, #9431, #9842, #9884, #10773 and #12246 have merged
  • Fixes: none (related: #9318)
  • Unblocks: PPSA02225 #4461 (past the 20 GiB cap at the 320x1280x900 sampled view, once a game run confirms it)
  • GPUs tested: Mesa llvmpipe, Ubuntu 24.04, on a cloud Linux machine and GitHub's Linux runner; AMD Radeon 860M (RADV, Mesa 26.2.5), Linux (Lander0606); NVIDIA GeForce RTX 3060 Ti (617.42) and Intel Arc Graphics (Meteor Lake, 101.9150), Windows 11, with the validation layer (BKlaasWerkman); AMD Radeon RX 9070 XT, Windows 11 (BunnyFl); NVIDIA GeForce RTX 5080 and AMD Radeon Graphics 1002:13c0, Windows 11, with the validation layer, agc_driver_texture_sparse_levels only (Amoenus)
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4979574600 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/10064). Originally posted by [EagleBearerYS](https://github.com/EagleBearerYS) on 2026-10-23T07:47:14Z. --- ### What Ghost of Tsushima Director's Cut (PPSA02225) binds this sampled view about 9 minutes in, during its opening (milescoviello, Linux, RTX 4070 Ti, [first comment](https://github.com/boykopovar/AnyPS5/pull/9318#issuecomment-6353408402)): ``` [gpu] sampled view 0x1564050000 (320x1280 format 71, dimension 4, tile 7, slices 0..899) covers 4781 MiB [gpu] view 0x1564050000 of 4781 MiB lies in the guest allocation 0x1500000000..0x1598600000 (2438 MiB, ...): 157 of its 900 slices fit in the range ``` - **The run ends at the cap:** while the view is built, the host heap grows by about 3 GB in 2 s, and the run ends at the 20 GiB memory cap (563-572 s, twice). - **This view is the one stop:** with a local cut that kept only the 157 slices, the title went on to its intro cinematic ([second comment](https://github.com/boykopovar/AnyPS5/pull/9318#issuecomment-6353966706)). - **Why that cut isn't a fix:** a shallower volume moves every normalized `r` sample. **Why it costs that much:** `main` already defines the texels past the committed range. `ReadCommitted` reads uncommitted pages as zeros. But it materializes the zeros at full size, and holds them three times on the way into the image: - a snapshot of the whole surface; - a host-visible staging buffer; - tiled and linear device buffers. For this view that's about 9.3 GiB of host memory. **The change:** a sampled k3D view whose range isn't wholly committed keeps its full extent, and only the slabs with committed memory go through the upload. - **Eligibility:** no storage-image source, `Uncompressed` keys and no DCC, no depth comparison, no sRGB expansion. Everything else takes `main`'s path unchanged. - **The slab list:** `committedSlabs` splits the surface into its guest slabs. That's one slice in the per-slice Z/R 64KB_X branch or a linear volume, and `blockDepth` slices in a thick one. - It keeps every slab with at least one committed page, chosen by commitment, not by the allocation. - When every slab has one, `main`'s path runs. - **The snapshot** packs only those slabs, one `ReadCommitted` per run of adjacent slabs. Uncommitted pages inside an uploaded slab still read as zeros. - **The upload:** - Staging, tiled and linear buffers cover only the uploaded slabs. Each slab is detiled from its packed offset, with its real slice index as the swizzle input. - Skipped layers get zeros copied from one `vkCmdFillBuffer`-zeroed device buffer with `vkCmdCopyBufferToImage`. That isn't a clear, so block-compressed formats take the same path. - **The cache entry** keeps the slab set and the view's committed ranges. A hit needs the same set, so a commit or decommit that changes which slabs are uploaded always rebuilds. It also needs every page that was committed when the snapshot was taken to be committed still, so a page decommitted inside a kept slab rebuilds and reads zeros. The compare and the write generation cover the uploaded bytes, newly committed pages included. - **A log line** next to `covers … MiB`, rate-limited the same way, says how many slabs were uploaded and how many zero-filled. - **Unchanged:** - arrays and cubes, which #9318 bounds; - storage-image sources, depth copy, sRGB expansion and DCC. - **Cost:** one `DescribeCommitted` walk per lookup of an eligible k3D view (above), before the cache lookup, so hits pay it too, wholly committed views included. There's none when the lookup already holds the view's committed ranges. - For this view, if only the 157 slices are committed, the host side drops from about 9.3 GiB to about 1.6 GiB, twice the uploaded bytes. - The full-extent image itself is the same as `main`'s. **#9318:** this sits in the snapshot and upload path, not in #9318's view bound, so the two compose, and #9318 needs no k3D case. If `BoundArrayWindow` ever trimmed k3D views, it would run first and change the texels (a shallower volume). ### Tested **Not tested: Ghost of Tsushima Director's Cut with this fix.** milescoviello has it on [`test/ghost-9742-9717-3d`](https://github.com/EagleBearerYS/AnyPS5/tree/test/ghost-9742-9717-3d) (bc32434751), the base they ran plus this commit ([offer](https://github.com/boykopovar/AnyPS5/pull/9318#issuecomment-6356553748)). That branch passes `^agc_driver_partially` on Linux ([run](https://github.com/EagleBearerYS/AnyPS5/actions/runs/39884555663)). On Windows, its older base fails to build a test that `main` has since fixed. This PR's own Windows build is the run below. **New modes of `tests/execution/PartiallyResidentSnapshot.cpp`** (`agc_driver_partially_<mode>`, lavapipe): - **Memory.** Every volume is 64 deep, and each committed slab has its own pattern. The bytes read count the snapshot's guest reads; the bytes kept count what the upload holds (staging, tiled, linear and zeros): | mode | surface | committed | bytes read (`main` / this PR) | bytes kept (`main` / this PR) | |---|---|---|---|---| | `committed-volume` | R_X, RGBA16F, 64x64, one 64 KiB slab per slice | slices 0-21, plus 16 KiB of slice 22 | 4,194,304 / 1,507,328 | 12,582,912 / 4,587,520 | | `committed-volume-thick` | S_X thick, 4 slabs of 16 slices | slab 0, plus half of slab 1 | 2,097,152 / 1,048,576 | not reached on `main` / 3,178,496 | | `committed-volume-linear` | linear, 32 KiB slices | 23, the last one half | 2,097,152 / 753,664 | not reached on `main` / 2,293,760 | | `committed-volume-compare` | as `committed-volume` | 3 slabs (a 192 KiB snapshot, kept for comparison) | 4,194,304 / 196,608 | not reached on `main` / 655,360 | | `committed-volume-whole` (control) | as `committed-volume` | all 64 | 4,194,304 / the same | 12,582,912 / the same | | `committed-array` (control) | a 2D array of 64 layers | 23, the last one partial | 4,194,304 / the same | 12,582,912 / the same | - **Rebuilds** (`committed-volume`): - a repeat lookup reads nothing; - committing slice 30 rebuilds and reads 24 slices; - decommitting slice 5 rebuilds and reads 23; - committing the rest of slice 22 rebuilds; - each repeat after those keeps the view. - **Compares** (`committed-volume-compare`): newly committed zero pages compare equal and keep the view, and a CPU write rebuilds it. - **Texels** (guest compute shaders sampling at slice centres, with z = 0, 5, 21, 22, 23, 30, 40 and 63, point-filtered): - Fully committed slabs read their pattern, and uncommitted slabs read zero. The partial slab reads its pattern or zero, and both occur. - An FNV-1a hash of every result word is **identical on `main` and with this PR** in every mode: - R_X, before and after commit changes; - BC1 at 256x256x64, where zero blocks read (0, 0, 0, 1) on both trees; - thick, linear, and two mip levels; - both controls. - The hashes are also identical with `APS5_NO_TEXTURE_CACHE=1`. - **Red/green ×10** (the same test binary against each tree's `libSceAgcDriver`): - **Red:** on `main`, `committed-volume`, `-thick`, `-linear` and `-compare` fail 10/10 with "read N bytes of guest memory at its first use, expected M". - **Green:** the controls and every sampling mode pass on both trees, and with this PR all 15 modes pass 10/10. That run called the test binary's 15 modes directly. ctest registered 13 of them until 83c9480ec0 added the mipmapped and BC1 cases. - **Existing tests:** `agc_driver_partially_resident_snapshot`, `…_pending_stores` and `agc_driver_large_tracked_snapshot` still pass. - **GitHub's runners** ([run 39907685337](https://github.com/EagleBearerYS/AnyPS5/actions/runs/39907685337), on this head, `main` 0db47b263d; `^agc_driver_partially|^agc_driver_large_tracked|^agc_driver_image_sample|^agc_driver_texture`): - **Linux:** red with `main`'s implementation: on its one run, `agc_driver_partially_committed_volume`, `…_thick`, `…_linear` and `…_compare` fail and the other 23 of the 27 tests pass. Green with this PR: all 27 pass ×10, none skipped. - **Windows:** builds; the 27 tests skip there, since the runner has no Vulkan device. - The libc and libkernel suites pass on both, run with `APS5_SKIP_TIMING_TESTS=1`. - **Validation layer** ([run 39913316066](https://github.com/EagleBearerYS/AnyPS5/actions/runs/39913316066), Khronos 1.3.275 on Linux, this head; `agc_driver_guest_memory_lifetime_copy`, `agc_driver_large_tracked_snapshot` and `^agc_driver_partially`): no new VUID. - The only VUID on either tree is `VUID-VkDeviceCreateInfo-pNext-pNext`, at device creation. It comes from an sType (1000574000) newer than the layer, and `main`'s tree shows it too. - `main`'s tree doesn't have this PR's new tests, so its arm passes; the red is the run above. - **On a cloud Linux machine:** - the texture, sample, snapshot, volume, tiling and image sets pass 141/141 (3 skipped for device features); - CI's Linux job mirrored: 1873/1877. The failures are the machine's four IPv6 network tests. - **Windows:** MinGW syntax checks of `Texture.cpp`, `ShaderResources.cpp` and the test show 0 errors. - **`check_conventions.py`:** passes. No comment lines are added. - **AMD Radeon 860M on Linux** (RADV, Mesa 26.2.5, Fedora 44), by @Lander0606 ([comment](https://github.com/boykopovar/AnyPS5/pull/10064#issuecomment-6364013797)): cd60c6916f against its parent 0db47b263d, the `partially`, `snapshot` and `dcc_keys` tests, three runs each with and without the Khronos layer. The base passes 8 of 8 and this PR 21 of 21 in every run. The seven `-samples` modes sample on the 860M with no skips, and the bytes read and kept match the table above. Under the layer neither side logs a `VUID-` line. - **Windows on real GPUs, by @BKlaasWerkman** ([comment](https://github.com/boykopovar/AnyPS5/pull/10064#issuecomment-6366855535)): cd60c6916f merged into `main` 938812df14 (clean), Windows 11 Pro, WinLibs GCC 15.2.0, Release, `ANYPS5_NO_SHADER_CACHE=1`, with the Khronos validation layer (1.4.363) loaded. The 1,278 tests `tools/select_tests.py` picks for the PR's files, compared test by test with a full run of that `main` on the same GPU: - **NVIDIA GeForce RTX 3060 Ti (617.42):** 1,271 pass, 4 skip, 3 fail, the same 3 as `main` (the `agc_driver_sample_order` trio, #9056). No `VUID-` message is added or removed. - **Intel Arc Graphics (Meteor Lake, 101.9150):** 1,250 pass, 26 skip, 2 fail, the same 2 as `main` (#10126, #8604). No `VUID-` message is added or removed. `agc_driver_alias_copy_label`, which is intermittent on that device (#10199), failed in the `main` run and passed with this PR. - All 13 new `agc_driver_partially_committed_*` tests pass on both GPUs, none skipped, the seven `-samples` modes, `_volume_compare` and `_volume_thick` among them. - **Windows on an AMD Radeon RX 9070 XT, by @BunnyFl** ([review](https://github.com/boykopovar/AnyPS5/pull/10064#pullrequestreview-5744702581)): 1de16256af merged onto `main`, Windows 11, WinLibs GCC 15.2.0, Release, all 20 `agc_driver_partially_*` tests. - 19 pass, none skipped. With `main`'s `Texture.cpp`, `ShaderResources.cpp` and `Texture.hpp`, 8 of them fail (`_committed_volume`, `_thick` and `_linear` among them). - `agc_driver_partially_committed_volume_page_samples` failed 3 runs of 3 in its own setup, with "cannot release part of a host allocation". d66d426203 below answers it. - **His re-review of d66d426203** ([review](https://github.com/boykopovar/AnyPS5/pull/10064#pullrequestreview-5746021059), approved), merged onto `main`, with `ANYPS5_REQUIRE_VULKAN=1`, the same 20 tests: 19 pass, the page case skips with its new message, 0 fail. With `main`'s `Texture.hpp`, `ShaderResources.cpp` and `Texture.cpp` restored, 7 fail (`_committed_volume`, `_thick`, `_linear`, `_compare`, `_mips`, `_bc` and `_empty`). - **4a90a1a1d0, two merges of `main` (4be3da2c6f, then 990f45e17d).** Two `ShaderResources.cpp` conflicts, each kept both sides: - #7800 (merged) wraps the sampled texture's creation in a `createTexture` lambda that holds `sampledCacheReclaimable`. This PR's packed upload goes through it: `createTexture(*context.detiler, resource, components, entry.bytes, depthCompare, packedSlabs(entry.slabs))`. - #8026 (merged) recycles snapshot buffers through a spare pool matched by size. A partly committed 3D view's snapshot holds only its committed slabs, so the pool is matched by that size, `snapshotBytes(slabs, bytes)`, which is `bytes` whenever the view has no slabs. - On GitHub's runners ([run](https://github.com/EagleBearerYS/AnyPS5/actions/runs/39988315269)), the partially resident, snapshot, DCC key and sampled-cache tests: on Linux, 27 of 27 pass 10 runs in a row; on Windows, 3 of 29 pass 10 runs in a row and 26 skip without a Vulkan device; none fail. The libc and libkernel suites pass on both, run with `APS5_SKIP_TIMING_TESTS=1`, which relaxes `precise_wait`'s median bounds on GitHub's hosted runners. - **After thuanquang's review: 3871b5eb66, 0fbea36bcc, c36790ee5e and 83c9480ec0** ([review](https://github.com/boykopovar/AnyPS5/pull/10064#pullrequestreview-5637462241)): - **0fbea36bcc, `fix(agc)`:** a cached slab view is no longer returned after a page inside a kept slab is decommitted (the cache entry change above). The new `agc_driver_partially_committed_volume_page_samples` commits slabs 21 and 22, samples, decommits one 4 KiB page of slab 22, and samples again. **Red** with the fix's `ShaderResources.cpp` hunk reverted: "sample of level 0 slice 22 (thread 96) reads (23.000000, 712.000000, 1.000000, 1.000000), expected the zeros of its decommitted page". Green with it. - **3871b5eb66, `test(agc)`:** each element of the pattern encodes its position in the slab, and the `-samples` checks compare each texel with the same samples of a fully committed copy, which takes the full-size path. With the slab path's packed offset shifted by 0x100 in a local build, 5 of the 7 `-samples` cases fail (the other 2 don't take the slab path), where the earlier pattern passed all 7. An error shared by both paths, such as one in the common detile offset, still passes: these tests compare the two paths, and there's no CPU tiling oracle. - **c36790ee5e, `test(agc)`:** `agc_driver_partially_committed_volume_empty` and `_empty_samples` cover a volume with no committed slab. It takes the slab path with an empty slab list ("uploads the 0 of its 64 slabs"), reads 0 of its 4194304 guest bytes, and samples zeros. - **83c9480ec0, `test(agc)`:** `agc_driver_partially_committed_volume_mips` and `_volume_bc` are registered with ctest. The BC1 case's own device now enables BC texture compression when it has it, and skips otherwise. - Each commit passes its own tests at that commit: 15, 16, 18 and 20 `^agc_driver_partially_` tests on lavapipe, on a Linux machine with CI's flags. - **On GitHub's runners** ([run](https://github.com/EagleBearerYS/AnyPS5/actions/runs/40083247463), `^agc_driver_partially_`): Linux: with `main`'s implementation of these files, `agc_driver_partially_committed_volume_page_samples` fails, and with this PR 20 run, 20 pass ×10, 0 skip, 0 fail. Windows: 20 run, 0 pass, 20 skip (no Vulkan device), 0 fail. The libc and libkernel suites pass on both, run with `APS5_SKIP_TIMING_TESTS=1`, which relaxes `precise_wait`'s median bounds on GitHub's hosted runners. - **6dd0c32a58, `docs(debt)`:** the debt entry now gives the view's guest range (4781 MiB, tiled and padded) where it said the image takes 4.7 GiB. - **52826ee075, a merge of `main` 2fade7ef4e.** One conflict, in the includes of `tests/execution/PartiallyResidentSnapshot.cpp`: `main` (#9159) added `<algorithm>` and `<span>` there, which this PR also adds, so the merge keeps one of each and this PR no longer adds them. The PR's other added and removed lines are unchanged. On GitHub's runners ([run](https://github.com/EagleBearerYS/AnyPS5/actions/runs/40122383850)), `^agc_driver_partially_` and `agc_driver_large_tracked_snapshot`: - **Linux:** with this PR, 21 run, 21 pass, 0 skip, 0 fail, 10 times in a row. With `main`'s implementation of the changed files, 7 of the 21 fail, each on the guest bytes a partly committed volume reads at first use (for example, "the partially committed volume read 4194304 bytes of guest memory at its first use, expected 1507328 of its 4194304"). - **Windows:** 21 run, 0 pass, 21 skip (no Vulkan device), 0 fail. - The libc and libkernel suites pass on both (143 and 205 tests on Linux, 170 and 221 on Windows), run with `APS5_SKIP_TIMING_TESTS=1`, which relaxes `precise_wait`'s median bounds on GitHub's hosted runners. - **7cecc95f5e, a merge of `main` 0a148be963** ([run](https://github.com/EagleBearerYS/AnyPS5/actions/runs/41264769665)). #12862 moved `libSceAgcDriver`'s test registrations into `tests/cmake/`; the conflict in `CMakeLists.txt` is resolved with `tools/agc_test_split.py resolve`, which moves this PR's registrations into `tests/cmake/agc_driver_partially_resident_snapshot_tests.cmake` (+8 lines). Nothing else conflicted, and apart from the move this PR's diff is unchanged. With `-DBUILD_TESTING=ON`, `ctest -N` gives 3123 tests: `main`'s 3105 plus its 18 tests, each listed once. The tests of this PR's verify set pass 10 runs in a row. Linux: 22 run, 22 pass, 0 skip, 0 fail. Windows: 22 run, 0 pass, 22 skip (no Vulkan device), 0 fail. Suites: libc and libkernel pass on Linux (199 and 308) and on Windows (226 and 330). The suites ran with `APS5_SKIP_TIMING_TESTS=1`, which relaxes `precise_wait`'s median bounds on GitHub's hosted runners. **Overlap** (`tools/pr_overlap.py --branch` against `main` 5255264b15; this branch merges cleanly with `main`): - **Code in the same upload path, merge order only** (this PR goes second and adapts to each when it merges): - #9431 (PS4 GCN command buffers) has merged. It changed the detile loop in `Texture`'s constructor that this PR changes: each layer's guest offset now comes from `GuestOffset(layer, mip)`, which stores a PS4 surface with several layers and mip levels level by level (`levelMajor`). The merge e15613356d keeps both: a full snapshot detiles from `GuestOffset`, as `main` does, and a packed slab from its offset in the snapshot. A level-major surface has no per-layer slabs, so a partially committed snapshot of one is refused, as `main` refuses its other unsupported level-major paths. #9842 is stacked on #9431, and its overlap with this PR is #9431's lines. - #7800 (idle image reclaim during cache creation) and #8026 (sampled snapshot buffer reuse) have merged; the merges above adapt this PR to both. - **Test registration only, merge order only:** #6249 (`CMakeLists.txt`). #9253 has merged. - **#10773 and #9884** (one upload scratch per batch; dropped snapshots read straight into their staging buffer) changed the same upload in `Texture`'s constructor, and #9884 also `Texture.hpp` and `cachedTexture` in `ShaderResources.cpp`. Both have merged first, as agreed for #10845 ([comment](https://github.com/boykopovar/AnyPS5/pull/10064#issuecomment-6393526480)), and the merges cceb0e89fc and 99be522b4c adapt this PR to them: a dropped packed-slab snapshot is read slab by slab into #9884's staging buffer (see 99be522b4c below). - **#7085** (guest mip levels as storage images) touches the same `Texture.cpp` lines and is much larger. Its author agreed that this one goes first ([comment](https://github.com/boykopovar/AnyPS5/pull/7085#issuecomment-6360085198)). Since then, #7085 no longer waits for this PR ([comment](https://github.com/boykopovar/AnyPS5/pull/7085#issuecomment-6784765821)) and has dropped it from its Depends on. `git merge-tree` of #7085's 46b62eee09 onto 99be522b4c conflicts in two `Texture.cpp` hunks. After the snapshot size check, #7085's note for mip levels past the image's chain and this PR's two packed-slab checks are adjacent additions. In the upload's transfer barrier and copy regions, this PR's `layerRegions` lambda takes #7085's `geometry.imageLevels` in the barrier and in its level loop. If #7085 lands first, this PR takes that conflict in its next merge of `main`. - **#12246** (B-Howell; sampled 1D arrays past `maxImageArrayLayers` as rows of a 2D image) adds a `layerRows` parameter to the same `Texture` constructor and `cachedTexture` calls, and its row copies to the same upload. It goes first, merge order only (B-Howell proposed the places in [this comment](https://github.com/boykopovar/AnyPS5/pull/12246#issuecomment-6475865833); we offered #12246 first in reply), and this PR takes the merge. `git merge-tree` of the two heads, each merged onto `main` 2199ee0d47, conflicts in `Texture.hpp`, `ShaderResources.cpp` and `Texture.cpp`, each time one PR's addition next to the other's. The merge keeps both parameters, the packed slabs stay gated on 3D views, and the row mode is only for sampled 1D arrays. - **#9318, #9533, #9742 and #9717:** clean. - **849b8418e2, a merge of `main` e05ba6feeb** ([run](https://github.com/EagleBearerYS/AnyPS5/actions/runs/40201187394)). `main`'s #7618 adds its swept write-only staging entry at the end of the debt file, where this PR adds its partially committed 3D textures entry; the merge keeps both, and nothing else conflicted. The tests whose names contain `partially` or `snapshot`, and the `agc_driver_sample_order` tests, pass 10 runs in a row. Linux: 31 run, 29 pass, 2 skip (`agc_driver_sample_order_grid_reference`, `agc_driver_sample_order_recipe_depth_locations`), 0 fail; the before arm fails seven of the `agc_driver_partially_committed_` tests. Windows: 34 run, 4 pass, 30 skip (no Vulkan device), 0 fail. Suites: libc and libkernel pass on Linux (144 and 207) and on Windows (171 and 223). The suites ran with `APS5_SKIP_TIMING_TESTS=1`, which relaxes `precise_wait`'s median bounds on GitHub's hosted runners. - **131bc657ca, a merge of `main` 0cd07dc4ab** ([run](https://github.com/EagleBearerYS/AnyPS5/actions/runs/40643396673)). `main`'s `agc_driver_copy_surface_bytes` properties and its no-alias test sit next to this PR's committed-volume test loop in `libSceAgcDriver/CMakeLists.txt`; the merge keeps both, and nothing else conflicted. This PR's changed lines are the same. The partially resident and committed-volume tests with `agc_driver_large_tracked_snapshot`, `agc_driver_alias_copy_label`, `agc_driver_copy_surface_bytes` and `agc_driver_sample_order`, 24 tests: on Linux, with `main`'s implementation of the changed files, 7 fail (`agc_driver_partially_committed_volume` and its `_bc`, `_compare`, `_empty`, `_linear`, `_mips` and `_thick` variants); with this PR all 24 pass 10 runs in a row, 0 skip. Windows: 24 run, 0 pass, 24 skip (no Vulkan device), 0 fail, on both trees. Suites: libc and libkernel pass on Linux (166 and 264) and on Windows (194 and 286). The suites ran with `APS5_SKIP_TIMING_TESTS=1`, which relaxes `precise_wait`'s median bounds on GitHub's hosted runners. - **2ffbae8eb6, a merge of `main` 3a2b919816** ([run](https://github.com/EagleBearerYS/AnyPS5/actions/runs/40787086997)). JJenkx's #8930 adds its `WriteChanged` entry at the end of `docs/dev/debt/libSceAgcDriver.md`, where this PR adds its partially committed 3D textures entry. The merge keeps both, `main`'s first, and nothing else conflicted. This PR's changed lines are the same. The tests are the partially resident and committed-volume ones with `agc_driver_large_tracked_snapshot`, `agc_driver_alias_copy_label`, `agc_driver_copy_surface_bytes` and `agc_driver_sample_order`, 24 in all: - on Linux, all 24 pass 10 runs in a row: 24 run, 24 pass, 0 skip, 0 fail; - on Windows all 24 skip, with no Vulkan device: 24 run, 0 pass, 24 skip, 0 fail. - The libc and libkernel suites run 191 and 291 tests on Linux and 220 and 314 on Windows, with 0 failed. The suites ran with `APS5_SKIP_TIMING_TESTS=1`, which relaxes `precise_wait`'s median bounds on GitHub's hosted runners. - **e15613356d, a merge of `main` f7e84c4cf1 after #9431 merged** (×10 [run](https://github.com/EagleBearerYS/AnyPS5/actions/runs/40854895663), `^agc` [sweep](https://github.com/EagleBearerYS/AnyPS5/actions/runs/40855071594)). The one conflict was the detile loop in `Texture`'s constructor (see Overlap). The resolution keeps this PR's loop over the uploaded slabs, detiles a full snapshot from `geometry.GuestOffset(slot.layer, mip)` as `main` does and a packed slab from its offset in the snapshot, and adds a `Require` that refuses a partially committed snapshot of a level-major surface. This PR's other changed lines are the same. - `^agc_driver_partially_`, `agc_driver_copy_surface_bytes_no_alias` and `agc_driver_large_tracked_snapshot`, 22 tests: on Linux all 22 pass 10 runs in a row (22 run, 22 pass, 0 skip, 0 fail), and the before arm with `main`'s implementation of the changed files fails; on Windows all 22 skip, with no Vulkan device: 22 run, 0 pass, 22 skip, 0 fail. - Every `^agc` test, once: Linux 1,138 run, 1,065 pass, 73 skip, 0 fail; Windows 1,167 run, 337 pass, 830 skip, 0 fail. - The libc and libkernel suites run 191 and 291 tests on Linux and 220 and 314 on Windows, with 0 failed. The suites ran with `APS5_SKIP_TIMING_TESTS=1`, which relaxes `precise_wait`'s median bounds on GitHub's hosted runners. - **9e2c796766, a merge of `main` 6d56eb813c** ([run](https://github.com/EagleBearerYS/AnyPS5/actions/runs/40988040253)), which brings thuanquang's #11740. - **The conflict:** `ShaderResources.cpp`, where #11740 adds `PendingLookup` and its lookup function at the place this PR adds `committedSlabs`. The merge keeps both functions, one after the other. - This PR's added and removed lines are unchanged. - **×10:** `^agc_driver_partially_`, `agc_driver_copy_surface_bytes_no_alias` and `agc_driver_large_tracked_snapshot`, 22 tests. - Linux: 22 run, 22 pass, 0 skip, 0 fail, 10 runs in a row. - Windows: 22 run, 0 pass, 22 skip (no Vulkan device), 0 fail. - The libc and libkernel suites run 194 and 294 tests on Linux and 224 and 318 on Windows, with 0 failed. The suites ran with `APS5_SKIP_TIMING_TESTS=1`, which relaxes `precise_wait`'s median bounds on GitHub's hosted runners. - **299171ba86, a merge of `main` c0fb4a6aad**, which brings mrfelek's #13373 ([run](https://github.com/EagleBearerYS/AnyPS5/actions/runs/41139629755)). - **The conflict:** `docs/dev/debt/libSceAgcDriver.md` only, where #13373's "Adaptive staging" bullet sits where this PR adds "Partially committed 3D textures". The merge keeps both, `main`'s first, as this PR's earlier merges did. This PR's own diff is unchanged. - **×10:** `agc_driver_partially_resident_snapshot`, `agc_driver_partially_resident_pending_stores`, `agc_driver_large_tracked_snapshot` and every `^agc_driver_partially_committed_` test. - Linux: 21 run, 21 pass, 0 skip, 0 fail. - Windows: 21 run, 0 pass, 21 skip (no Vulkan device), 0 fail. - The libc and libkernel suites run 199 and 307 tests on Linux and 226 and 329 on Windows, with 0 failed. The suites ran with `APS5_SKIP_TIMING_TESTS=1`, which relaxes `precise_wait`'s median bounds on GitHub's hosted runners. - **On a cloud Linux machine (lavapipe):** `ctest -R '^(agc|shader)'` 1,099 passed, 0 failed, 75 skipped. - **099305bfc1, a merge of `main` f5b82ff453**, which brings JJenkx's #13648 (sampled textures with fast-cleared DCC keys are cleared on the GPU) ([run](https://github.com/EagleBearerYS/AnyPS5/actions/runs/41201124404), validation [run](https://github.com/EagleBearerYS/AnyPS5/actions/runs/41201130783)). - **The conflicts:** `Texture.hpp`, `Texture.cpp` and `ShaderResources.cpp`, where both PRs change the `Texture` constructor, its snapshot check and `cachedTexture`. Three hand edits beyond keeping both sides: - `Texture.hpp:62` and `Texture.cpp:341`: #13648's `clear` is the seventh parameter and this PR's `packedSlabs` the eighth, so `main`'s two `clear` callers are unchanged. This PR's two callers, `ShaderResources.cpp:1024` and `:1144`, pass `nullptr` for `clear`. - `Texture.cpp:368`: a new check, "a cleared texture takes no snapshot, so it has no committed slabs". - The size check composes the two: a cleared texture takes an empty snapshot, one with committed slabs takes one `layerBytes` slab per packed index, and any other takes the whole surface. - `ShaderResources.cpp:1095-1099`: `main`'s cache entry for a cleared texture, sized with this PR's `snapshotSize` instead of `bytes`. - **Why the two never meet:** a texture is built from committed slabs only with uncompressed DCC keys and no DCC address, and `SampledClearColor` clears only with fast-cleared keys. Both read the same keys. - **What changes for a partially committed 3D view:** one with fast-cleared DCC keys now takes #13648's GPU clear, where before it took the whole-surface snapshot. This PR's slab path never took DCC views. - **This PR's own changed lines** are the same apart from these edits. - **×10** on the tests above and `agc_driver_sampled_clear_keys`: - Linux: 22 run, 22 pass, 0 skip, 0 fail. - Windows: 22 run, 0 pass, 22 skip (no Vulkan device), 0 fail. - **Validation**, `main` f5b82ff453 against this head, the same tests, on GitHub's Linux runner (layer 1.3.275): - they pass on both arms; - the loader inserted the layer 4 times on `main` and 22 with this head, and neither log has `was not found`; - both report only `VUID-VkDeviceCreateInfo-pNext-pNext`, so the merge adds none. - **On a cloud Linux machine (lavapipe):** the 21 tests pass 10 of 10, and `agc_driver_sampled_clear_keys` 10 of 10. `ctest -R '^agc'`: 1,168 passed, 0 failed, 75 skipped. - **cceb0e89fc, a merge of `main` 88e804b0a7.** `main` now has fma-rc's #10773, which reuses one tiled and one linear upload scratch per recorded batch. The merge keeps both in this PR's committed-slices upload in `Texture.cpp`. - Staging is built only when a slice uploads, sized to the snapshot. - With a recorder, the tiled and linear buffers come from #10773's scratch (`UploadScratchBuffer`); without one, they're new `DeviceBuffer`s, as before. - The zero buffer stays, and the barrier waits on `VK_PIPELINE_STAGE_HOST_BIT | Recorder::UploadScratchReuseStages`. - This PR's diff over `main` is otherwise unchanged. - **×10** ([run](https://github.com/EagleBearerYS/AnyPS5/actions/runs/41418039951)): the partially committed and partially resident tests, with `agc_driver_large_tracked_snapshot`, `agc_driver_sampled_clear_keys` and `agc_recorder_upload_scratch`. Linux: 23 run, 23 pass, 0 skip, 0 fail. Windows: 23 run, 0 pass, 23 skip (no Vulkan device), 0 fail, so Windows only shows that it builds. Suites: libc and libkernel pass on Linux (210 and 310) and on Windows (237 and 331). The suites ran with `APS5_SKIP_TIMING_TESTS=1`, which relaxes `precise_wait`'s median bounds on GitHub's hosted runners. - **Every `agc` test, once** ([run](https://github.com/EagleBearerYS/AnyPS5/actions/runs/41418055690)): Linux: 1,236 run, 1,158 pass, 77 skip, 1 fail. Windows: 1,272 run, 379 pass, 893 skip (no Vulkan device), 0 fail. The one failure is `agc_driver_pipeline_journal`'s 120-second timeout, which `main` 88e804b0a7's own run of every test hits too ([run](https://github.com/EagleBearerYS/AnyPS5/actions/runs/41424465991)). - **1de16256af, a merge of `main` 4f64f81ef7**, which brings B-Howell's #12246 (1D array layer rows), the PR this one's Depends on line put first. Both PRs change `Texture`'s constructor and its upload, and the merge keeps both. - **The constructor** takes `(…, depthCompare, layerRows, clear, packedSlabs)`: #12246's `layerRows` stays where it added it, after `depthCompare`, and this PR's `packedSlabs` stays last, after `clear`. `main`'s two call sites pass `layerRows`, and this PR's pass `layerRows, nullptr, packedSlabs(…)`. - **The upload** builds #12246's row regions first, then this PR's regions for each uploaded slice only when the texture isn't laid out as rows, then its zero-slice regions. `toTransferDst` takes #12246's range (one layer for rows, the full range otherwise), and the barrier stays this PR's. - **The two paths never meet:** rows need a `k1DArray`, and packed slabs come only from `committedSlabs`, which returns none unless the view is `k3D`. The zero fill and its barrier exist only with packed slabs, so they never meet the one-layer range. - This PR's diff over `main` is otherwise unchanged. - **×10** ([run](https://github.com/EagleBearerYS/AnyPS5/actions/runs/41458489675)): the partially committed and partially resident tests, the sample, image-sample and texture tests, and `agc_recorder_upload_scratch`. Linux: 48 run, 46 pass, 2 skip (`agc_driver_sample_order_grid_reference`, `agc_driver_sample_order_recipe_depth_locations`), 0 fail. Windows: 48 run, 2 pass, 46 skip (no Vulkan device), 0 fail, so Windows mostly shows that it builds. Suites: libc and libkernel pass on Linux (217 and 318) and on Windows (244 and 339). The suites ran with `APS5_SKIP_TIMING_TESTS=1`, which relaxes `precise_wait`'s median bounds on GitHub's hosted runners. - **Every `agc` test, once** ([run](https://github.com/EagleBearerYS/AnyPS5/actions/runs/41458506961)): Linux: 1,258 run, 1,179 pass, 78 skip, 1 fail. Windows: 1,294 run, 388 pass, 906 skip (no Vulkan device), 0 fail. The one failure is `agc_driver_pipeline_journal`'s 120-second timeout, which `main` 88e804b0a7's own run of every test hits too ([run](https://github.com/EagleBearerYS/AnyPS5/actions/runs/41424465991)). #12246's `agc_driver_image_array_rows_past_layer_limit` and the six 1D-array image tests pass on Linux. - **d66d426203, `test(agc)`, after BunnyFl's review.** The page case decommits one 4 KiB page inside a committed slab. On Windows, a host allocation is 64 KiB granular, and `WindowsMappings::reset` refuses to release part of one. - The case now skips on Windows (code 77), before it opens a device, with that reason. - A new debt entry, "Decommitted page in a committed slab", records that the case runs on Linux only. - The 3D textures entry names its title by ID only, as the debt files do. - **×10** ([run](https://github.com/EagleBearerYS/AnyPS5/actions/runs/41544387076)), the tests of 1de16256af's run: - Linux: 48 run, 46 pass, 2 skip (`agc_driver_sample_order_grid_reference`, `agc_driver_sample_order_recipe_depth_locations`), 0 fail. The page case passes all 10. - Windows: 48 run, 2 pass, 46 skip, 0 fail. The page case skips with its new reason, and the other 45 skips have no Vulkan device. - Suites: libc and libkernel pass on Linux (217 and 318) and on Windows (244 and 339). The suites ran with `APS5_SKIP_TIMING_TESTS=1`, which relaxes `precise_wait`'s median bounds on GitHub's hosted runners. - **1d41692ec6, a merge of `main` 06a9092274**, which brings SuarezPM's #14943 (draw names in device-lost fault reports). - **The conflict:** `Texture.cpp`, in the constructor's snapshot checks, where #14943 notes each texture in its `LiveResourceRing` and this PR checks the snapshot's size against its committed slabs. The merge keeps #14943's `Note` line, then this PR's `slabBytes` line and its two snapshot checks, whose size check already covers `main`'s (`Texture.cpp:410-413` on that merge). This PR's diff over `main` is otherwise unchanged. - **×10** ([run](https://github.com/EagleBearerYS/AnyPS5/actions/runs/42212369978)): the partially committed and partially resident tests, the sample and image-sample tests, `agc_driver_large_tracked_snapshot`, `agc_driver_sampled_clear_keys` and `agc_recorder_upload_scratch`. The merge's first ×10 ([run](https://github.com/EagleBearerYS/AnyPS5/actions/runs/42195988002)) and validation run ([run](https://github.com/EagleBearerYS/AnyPS5/actions/runs/42196009886)) left out the 18 `agc_driver_partially_committed_*` cases, so these runs replace them. - Linux: 51 run, 48 pass, 3 skip (`agc_driver_image_sample_lod_clamp`, `agc_driver_sample_order_grid_reference`, `agc_driver_sample_order_recipe_depth_locations`), 0 fail. The 18 committed cases pass all 10, the page case included. - Windows: 51 run, 2 pass, 49 skip, 0 fail. The page case skips with its Windows reason, and the other skips have no Vulkan device. - Suites: libc and libkernel pass on Linux (324 and 342) and on Windows (355 and 369). The suites ran with `APS5_SKIP_TIMING_TESTS=1`, which relaxes `precise_wait`'s median bounds on GitHub's hosted runners. - **Validation** ([run](https://github.com/EagleBearerYS/AnyPS5/actions/runs/42212249269)), `main` 06a9092274 against this head, the same tests, on GitHub's Linux runner: - they pass on both arms; - the loader inserted the layer 32 times on `main` and 50 with this head; - both report only `VUID-VkDeviceCreateInfo-pNext-pNext`, so the merge adds none. - **407189c96e, a merge of `main` 1ff0fe98aa**, which brings hugodearaujo's #13646 (the unmapped levels below a T# minimum LOD get no device memory). - **The conflicts:** four regions of `Texture.cpp`. #13646 starts each layer's detile, repack and copy loops at `skip`, its count of unmapped levels below the T# minimum LOD, and this PR loops over its uploaded slices instead of every layer. The merge keeps this PR's loops and starts them at `skip`: - #13646's sparse helpers (`Texture.cpp:377-454`) stay above the constructor (`:493`), which keeps this PR's `packedSlabs` parameter. - The detile and repack loops over `uploaded` start at `skip` (`Texture.cpp:713` and `:722`). - `layerRegions` starts at `skip` (`Texture.cpp:758-759`), both for the uploaded slices (`:785`) and for the zero slices (`:790`). - **Why the zero slices share it:** `skip` (`Texture.cpp:572-573`) is nonzero only for a 2D or 2D-array view at base level 0 that isn't thick (`:378`). Zero slices come only from packed slabs, which `committedSlabs` builds only for a `k3D` view (`ShaderResources.cpp:821`), so `skip` is 0 wherever there are zero slices. Without packed slabs, `uploaded` holds every layer at `main`'s offsets (`Texture.cpp:544-547`), so #13646's textures take the same levels and layers as on `main`. - This PR's diff over `main` is otherwise unchanged. It merges cleanly with `main` 4c03784113. - **×10** ([run](https://github.com/EagleBearerYS/AnyPS5/actions/runs/42227780662)), the tests of 1d41692ec6's run: - Linux: 51 run, 48 pass, 3 skip (the same three), 0 fail. The 18 committed cases pass all 10. - Windows: 51 run, 2 pass, 49 skip, 0 fail. - Suites: libc and libkernel pass on Linux (325 and 342) and on Windows (356 and 369). The suites ran with `APS5_SKIP_TIMING_TESTS=1`, which relaxes `precise_wait`'s median bounds on GitHub's hosted runners. - **Validation** ([run](https://github.com/EagleBearerYS/AnyPS5/actions/runs/42227802760)), `main` 1ff0fe98aa against this head, the same tests, on GitHub's Linux runner: - they pass on both arms; - the loader inserted the layer 32 times on `main` and 50 with this head, and neither log has `was not found`; - both report only `VUID-VkDeviceCreateInfo-pNext-pNext`, so the merge adds none. - **Every `agc` test, once** ([run](https://github.com/EagleBearerYS/AnyPS5/actions/runs/42227826401)): Linux: 1,371 run, 1,283 pass, 87 skip, 1 fail. Windows: 1,411 run, 421 pass, 990 skip, 0 fail. The one failure is `agc_driver_pipeline_journal`'s 120-second timeout, which `main` 1ff0fe98aa's own run of every test hits too ([run](https://github.com/EagleBearerYS/AnyPS5/actions/runs/42227849737); Linux: 1,353 run, 1,265 pass, 87 skip, 1 fail; Windows: 1,393 run, 421 pass, 972 skip, 0 fail). - **Not run on GitHub's runners:** these loops from a nonzero `skip`. #13646's `agc_driver_texture_sparse_levels` skips on both arms there. It needs BC texture compression, `VK_EXT_image_view_min_lod` and sparse residency for 2D BC1 images, which the Linux runner's lavapipe doesn't all offer, and the Windows runner has no Vulkan device. Amoenus has since run it, with 99be522b4c merged into `main`, on two GPUs that have them (below). - **aea05465be, a merge of `main` 090f57166a** ([×10](https://github.com/EagleBearerYS/AnyPS5/actions/runs/42374629054)). - **The conflicts:** two hunks in `Texture.cpp`'s constructor, against akkadbakkad89's #16294, which samples guest 8_24_UNORM depth as D24_UNORM_S8_UINT and adds `depthToFloat` and `barrierAspect`. The repack loop keeps this PR's per-slot offsets and takes #16294's `depthToFloat` argument, and the transfer barrier takes #16294's `barrierAspect` range with this PR's barrier list. This PR's own lines are unchanged, and #15438's barrier range in `StorageTexture::upload` merged without a conflict. - **×10:** the tests of 407189c96e's run, with #16294's `^agc_driver_image_depth24`. Linux: 53 run, 49 pass, 3 skip (the same three), 1 fail; the 18 committed cases pass all 10, and `agc_driver_image_depth24_float` passes 10 of 10. The one failure, `agc_driver_image_depth24` ("image_load of 8_24_UNORM reads the wrong depth for format 141: 0x3effe004 for texel 0x007ff001") also fails on `main` 090f57166a's own tree ([run](https://github.com/EagleBearerYS/AnyPS5/actions/runs/42389027833)), and adriadam10's #16807 has since fixed it on `main`. Windows: 53 run, 2 pass, 51 skip, 0 fail. The libc and libkernel suites run 327 and 344 tests on Linux and 358 and 371 on Windows, with 0 failed. The suites ran with `APS5_SKIP_TIMING_TESTS=1`, which relaxes `precise_wait`'s median bounds on GitHub's hosted runners. - **99be522b4c, a merge of `main` b1f8766e5f**, which brings thuanquang's #9884 (a dropped sampled snapshot is read straight into its upload staging buffer) ([×10](https://github.com/EagleBearerYS/AnyPS5/actions/runs/42924738084), validation [run](https://github.com/EagleBearerYS/AnyPS5/actions/runs/42924764566), `^agc` [sweep](https://github.com/EagleBearerYS/AnyPS5/actions/runs/42924788588)). - **The conflicts:** `Texture.hpp`, `Texture.cpp` and `ShaderResources.cpp`. #9884 adds a `Texture` constructor that takes the staging buffer, and its `cachedTexture` drops a large snapshot and reads it into that buffer. The merge keeps #9884's flow and changes these of its lines: - `Texture.hpp` and `Texture.cpp`: #9884's staging constructor, and the private delegate that both public constructors forward to, take this PR's `packedSlabs` last. A partially committed snapshot that is dropped is then read slab by slab into the staging buffer. - `Texture.cpp`: the snapshot size check, and the upload's tiled buffer (`UploadScratchBuffer`), `Keep`, `DeviceBuffer` and copy, use the staging buffer's size when there is one (`snapshotSize`), since the snapshot span is then empty. The snapshot is copied into a new staging buffer only when there is none and a slice uploads (`staging == nullptr && !uploaded.empty()`). - `ShaderResources.cpp`: `cachedTexture` sizes #9884's drop test, staging buffer, spare snapshot and snapshot vector by this PR's packed snapshot size (`snapshotBytes(slabs, bytes)`) instead of `bytes`, reads through this PR's `readSnapshot`, and passes `packedSlabs` on both `createTexture` calls. - **The combined path is traced** on GitHub's Linux runner ([run](https://github.com/EagleBearerYS/AnyPS5/actions/runs/42925613812)), on a verify-only branch with two temporary log lines: 20 packed-slab textures dropped their snapshot and read it into the staging buffer. The first is in `agc_driver_partially_committed_volume`: 23 slabs of 64 KiB, 1,507,328 bytes, over the 256 KiB drop threshold. The cases that take the path are `agc_driver_partially_committed_volume` and its `_thick`, `_linear`, `_mips`, `_bc`, `_samples`, `_bc_samples`, `_thick_samples`, `_linear_samples` and `_mips_samples` variants. 8 textures, of 196,608 bytes or less, kept their snapshot, in the `_compare`, `_page_samples`, `_empty` and `_empty_samples` variants. - This PR's diff over `main` is otherwise unchanged. It merges cleanly with `main` 389c568e31. - **×10:** the tests of aea05465be's run, with `agc_snapshot_read_into_staging` (#9884's test), `agc_sampled_cache_device_selection` and the four `^agc_driver_recover_` tests, 59 in all. - Linux: 59 run, 56 pass, 3 skip (the same three, which skip on `main`'s tree too), 0 fail. `agc_snapshot_read_into_staging` and the 18 committed cases pass all 10. - Windows: 59 run, 3 pass, 56 skip, 0 fail. The page case skips with its Windows reason, and the other skips have no Vulkan device, so Windows mostly shows that it builds. - The libc and libkernel suites run 357 and 349 tests on Linux, with 0 failed. On Windows they run 387 and 376: libc has 0 failed, and libkernel's two failures, `guest_kernel_resident_fmem_export` and its `_patched` variant, fail on `main`'s tree too (validation run). The suites ran with `APS5_SKIP_TIMING_TESTS=1`, which relaxes `precise_wait`'s median bounds on GitHub's hosted runners. - **Validation**, `main` b1f8766e5f against this head, the same tests, on GitHub's Linux runner: - they pass on both arms; - the loader inserted the layer 39 times on `main` and 57 with this head, and neither log has `was not found`; - both report only `VUID-VkDeviceCreateInfo-pNext-pNext`, so the merge adds none. - **Every `agc` test, once:** Linux: 1,551 run, 1,458 pass, 93 skip, 0 fail. Windows: 1,594 run, 474 pass, 1,120 skip, 0 fail. - **`agc_driver_texture_sparse_levels` on two GPUs with sparse residency, by @Amoenus** ([comment](https://github.com/boykopovar/AnyPS5/pull/10064#issuecomment-6788487209), [report and logs](https://gist.github.com/Amoenus/d43d2ee78cc660bdd1292e62113fc212#file-report-md)): 99be522b4c merged into `main` f01683380f, and that `main` on its own, three runs of each on each GPU. Windows 11 Enterprise (26200), GCC 15.2 UCRT, Release, with the Khronos validation layer (1.4.363) loaded. - **NVIDIA GeForce RTX 5080 (32.0.16.2101) and AMD Radeon Graphics `1002:13c0` (32.0.21045.16010):** 12 of 12 runs pass, 0 skip: 3 with `main` and 3 with this PR on each GPU. None of the logs has a `VUID-` or `SYNC-HAZARD` line. - **The sparse path runs, not the skip:** on both GPUs, every run reports a 2048x2048 BC1 image with 8 levels, its mip tail from level 3, and the bytes the image holds at minimum LOD 2 and 1. So this PR's detile, repack and copy loops have run from a nonzero `skip` (see 407189c96e above). - This covers that test only. The `agc_driver_partially_*` tests weren't part of this run. ### Checklist <!-- Rules behind each item: https://github.com/boykopovar/AnyPS5/blob/main/CONTRIBUTING.md --> - [x] Based on current `main`; no other open PR implements the same functions - [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; #6249, #9431, #9842, #9884, #10773 and #12246 have merged - [x] Fixes: none (related: #9318) - [x] Unblocks: PPSA02225 #4461 (past the 20 GiB cap at the 320x1280x900 sampled view, once a game run confirms it) - [x] GPUs tested: Mesa llvmpipe, Ubuntu 24.04, on a cloud Linux machine and GitHub's Linux runner; AMD Radeon 860M (RADV, Mesa 26.2.5), Linux (Lander0606); NVIDIA GeForce RTX 3060 Ti (617.42) and Intel Arc Graphics (Meteor Lake, 101.9150), Windows 11, with the validation layer (BKlaasWerkman); AMD Radeon RX 9070 XT, Windows 11 (BunnyFl); NVIDIA GeForce RTX 5080 and AMD Radeon Graphics `1002:13c0`, Windows 11, with the validation layer, `agc_driver_texture_sparse_levels` only (Amoenus) - [x] AI-assisted: yes
thuanquang commented 2026-10-24 08:10:33 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by thuanquang on 2026-10-24T08:10:33Z.

Review: COMMENTED


A read-through at 4a90a1a1d0; I built and ran nothing. The slab mapping and the packed detile offsets look consistent with main's geometry, and the head merges cleanly into current main. A few things a reviewer will likely ask about:

Tests

  • PatternElement (PartiallyResidentSnapshot.cpp:499-504) depends only on the format and the slab, and CommitSlab (:516-521) repeats that one element across the whole slab. So the -samples checks can tell which slab a texel came from, or zero, but not where inside the slab it was read. The main new risk is the per-slab packed detile offset (slot.tiledOffset + mip.tiledOffset), and a misplaced offset inside a slab would still pass. An element value that encodes its position (for example x, y and z within the slab) would cover it.
  • No case has every slab uncommitted, so the branch where uploaded is empty (Texture.cpp:420-425, :443-447; no staging, tiled or linear buffers, zero snapshot bytes on the cache side) never runs.
  • CommittedCaseFor accepts --committed-volume-mips and --committed-volume-bc (:474-475), but CMakeLists.txt:2546 registers only their -samples variants. So the mip and BC byte accounting is never run by ctest, and the body's "all 15 modes" doesn't match the 13 registered tests. The -samples modes also pass on main; only the memory modes are red there.

Behaviour

  • Slabs are chosen by commitment (committedSlabs, ShaderResources.cpp:713-723), not by the view's allocation. If the range past the allocation is committed by neighbouring allocations, every slab has a committed page, :723 returns nullopt and the view takes main's full-size path unchanged. Has PPSA02225 been run with this head? The body's logs come from a stack with other open PRs, and the local cut that pointed at this view kept slices by allocation.
  • A question rather than a finding: when the packed snapshot falls under SnapshotCompareBytes (256 KiB, :1067), it is kept for comparison where main's full-size snapshot was parked. A later lookup with the same slab set then goes through equalsCommittedSlabs, which compares committed pages only. So if part of a slab is decommitted while the slab keeps other pages, is the cached texture returned with the old texels instead of rebuilt with zeros?

Body

  • The cost line ("only for k3D views whose range isn't wholly committed") reads narrower than the code: committedSlabs runs whenever slabbed holds (:924), including wholly committed k3D views with write generation 0, and before the cache lookup, so hits pay it too.
  • Depends on: lists #9253 (merged today) and #9884 (closed without merging); the Overlap section still describes composing with #9884.
  • The debt entry's "the image takes 4.7 GiB" is the guest (tiled, padded) byte count, not the VkImage size.
<!-- greyfinch-sync:boykopovar/AnyPS5:review:5637462241 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/10064#pullrequestreview-5637462241). Originally posted by [thuanquang](https://github.com/thuanquang) on 2026-10-24T08:10:33Z. **Review:** COMMENTED --- A read-through at `4a90a1a1d0`; I built and ran nothing. The slab mapping and the packed detile offsets look consistent with main's geometry, and the head merges cleanly into current `main`. A few things a reviewer will likely ask about: **Tests** - `PatternElement` (`PartiallyResidentSnapshot.cpp:499-504`) depends only on the format and the slab, and `CommitSlab` (`:516-521`) repeats that one element across the whole slab. So the `-samples` checks can tell which slab a texel came from, or zero, but not where inside the slab it was read. The main new risk is the per-slab packed detile offset (`slot.tiledOffset + mip.tiledOffset`), and a misplaced offset inside a slab would still pass. An element value that encodes its position (for example x, y and z within the slab) would cover it. - No case has every slab uncommitted, so the branch where `uploaded` is empty (`Texture.cpp:420-425`, `:443-447`; no staging, tiled or linear buffers, zero snapshot bytes on the cache side) never runs. - `CommittedCaseFor` accepts `--committed-volume-mips` and `--committed-volume-bc` (`:474-475`), but `CMakeLists.txt:2546` registers only their `-samples` variants. So the mip and BC byte accounting is never run by ctest, and the body's "all 15 modes" doesn't match the 13 registered tests. The `-samples` modes also pass on `main`; only the memory modes are red there. **Behaviour** - Slabs are chosen by commitment (`committedSlabs`, `ShaderResources.cpp:713-723`), not by the view's allocation. If the range past the allocation is committed by neighbouring allocations, every slab has a committed page, `:723` returns `nullopt` and the view takes main's full-size path unchanged. Has PPSA02225 been run with this head? The body's logs come from a stack with other open PRs, and the local cut that pointed at this view kept slices by allocation. - A question rather than a finding: when the packed snapshot falls under `SnapshotCompareBytes` (256 KiB, `:1067`), it is kept for comparison where main's full-size snapshot was parked. A later lookup with the same slab set then goes through `equalsCommittedSlabs`, which compares committed pages only. So if part of a slab is decommitted while the slab keeps other pages, is the cached texture returned with the old texels instead of rebuilt with zeros? **Body** - The cost line ("only for k3D views whose range isn't wholly committed") reads narrower than the code: `committedSlabs` runs whenever `slabbed` holds (`:924`), including wholly committed k3D views with write generation 0, and before the cache lookup, so hits pay it too. - `Depends on:` lists #9253 (merged today) and #9884 (closed without merging); the Overlap section still describes composing with #9884. - The debt entry's "the image takes 4.7 GiB" is the guest (tiled, padded) byte count, not the VkImage size.
BunnyFl commented 2026-11-02 23:06:15 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by BunnyFl on 2026-11-02T23:06:15Z.

Review: CHANGES_REQUESTED


The sampling change holds up on Windows, but one of the new cases can't run there.

Windows 11, WinLibs GCC 15.2.0, Release, AMD Radeon RX 9070 XT, with this head merged onto current main, all 20 agc_driver_partially_* tests:

  • 19 pass, nothing skipped. With main's Texture.cpp, ShaderResources.cpp and Texture.hpp, 8 of them fail (..._committed_volume, ..._thick, ..._linear among them), so the new cases catch the bug.
  • agc_driver_partially_committed_volume_page_samples fails 3 runs out of 3, in the test's own setup, not in a sample check. After the level 0 sample (hash 414e3bcd55dc4325 every run) it stops with cannot release part of a host allocation.

That message comes from WindowsMappings::reset (core/libs/prx/libc/include/WindowsMappings.hpp:1194), which refuses to reset a resident run unless the range starts at the host allocation's base. On Windows the test's Decommit (tests/execution/PartiallyResidentSnapshot.cpp:249-251) calls GuestArenaReset on one page inside a committed slab (surface.Decommit(2 * BlockBytes, BlockBytes), :332), which is exactly a part of an allocation. On Linux the same step is an mmap(MAP_FIXED). Your Tested section lists lavapipe only, and I haven't seen a Windows run of this case.

Could the page case commit that page as its own allocation on Windows, or skip with code 77 there (with the gap in the debt entry)? Either would keep the Linux coverage. I haven't checked whether the arena could support a mid-allocation reset instead.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5744702581 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/10064#pullrequestreview-5744702581). Originally posted by [BunnyFl](https://github.com/BunnyFl) on 2026-11-02T23:06:15Z. **Review:** CHANGES_REQUESTED --- The sampling change holds up on Windows, but one of the new cases can't run there. Windows 11, WinLibs GCC 15.2.0, Release, AMD Radeon RX 9070 XT, with this head merged onto current `main`, all 20 `agc_driver_partially_*` tests: - 19 pass, nothing skipped. With `main`'s `Texture.cpp`, `ShaderResources.cpp` and `Texture.hpp`, 8 of them fail (`..._committed_volume`, `..._thick`, `..._linear` among them), so the new cases catch the bug. - `agc_driver_partially_committed_volume_page_samples` fails 3 runs out of 3, in the test's own setup, not in a sample check. After the level 0 sample (hash `414e3bcd55dc4325` every run) it stops with `cannot release part of a host allocation`. That message comes from `WindowsMappings::reset` (`core/libs/prx/libc/include/WindowsMappings.hpp:1194`), which refuses to reset a resident run unless the range starts at the host allocation's base. On Windows the test's `Decommit` (`tests/execution/PartiallyResidentSnapshot.cpp:249-251`) calls `GuestArenaReset` on one page inside a committed slab (`surface.Decommit(2 * BlockBytes, BlockBytes)`, `:332`), which is exactly a part of an allocation. On Linux the same step is an `mmap(MAP_FIXED)`. Your Tested section lists lavapipe only, and I haven't seen a Windows run of this case. Could the page case commit that page as its own allocation on Windows, or skip with code 77 there (with the gap in the debt entry)? Either would keep the Linux coverage. I haven't checked whether the arena could support a mid-allocation reset instead.
BunnyFl commented 2026-11-03 01:39:42 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by BunnyFl on 2026-11-03T01:39:42Z.

Review: APPROVED


Re-review of d66d426203: my change request is addressed with the second option. agc_driver_partially_committed_volume_page_samples now returns 77 on Windows before opening a device (core/libs/prx/libSceAgcDriver/tests/execution/PartiallyResidentSnapshot.cpp:987), and docs/dev/debt/libSceAgcDriver.md:354 records that the case runs on Linux only.

Windows 11, AMD RX 9070 XT, ANYPS5_REQUIRE_VULKAN=1, merged onto current main, the same 20 agc_driver_partially_* tests as my first run:

  • PR: 19 pass, the page case skips with the new message, 0 fail.
  • Main's Texture.hpp, ShaderResources.cpp and Texture.cpp restored: 7 fail (partially_committed_volume, _thick, _linear, _compare, _mips, _bc, _empty).
<!-- greyfinch-sync:boykopovar/AnyPS5:review:5746021059 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/10064#pullrequestreview-5746021059). Originally posted by [BunnyFl](https://github.com/BunnyFl) on 2026-11-03T01:39:42Z. **Review:** APPROVED --- Re-review of `d66d426203`: my change request is addressed with the second option. `agc_driver_partially_committed_volume_page_samples` now returns 77 on Windows before opening a device (`core/libs/prx/libSceAgcDriver/tests/execution/PartiallyResidentSnapshot.cpp:987`), and `docs/dev/debt/libSceAgcDriver.md:354` records that the case runs on Linux only. Windows 11, AMD RX 9070 XT, `ANYPS5_REQUIRE_VULKAN=1`, merged onto current `main`, the same 20 `agc_driver_partially_*` tests as my first run: - PR: 19 pass, the page case skips with the new message, 0 fail. - Main's `Texture.hpp`, `ShaderResources.cpp` and `Texture.cpp` restored: 7 fail (`partially_committed_volume`, `_thick`, `_linear`, `_compare`, `_mips`, `_bc`, `_empty`).
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!10064
No description provided.