fix(agc): reject pending writes before tracked snapshot reuse #6937
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/6937"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by Mustafa1p on 2026-10-16T20:11:58Z.
What
Fix a graphics-cache bug that can reuse old texture data while a GPU write to the same memory is still pending.
Before reusing a cached sampled texture or image table, check whether a recorded copied-buffer write overlaps its memory. Overlapping writes use the existing comparison and publication path; unrelated writes retain cache reuse. The two corrected fast paths are
cachedTextureandTableCurrent.Add five Windows regressions checking RGBA results, source-memory contents, guard regions, write publication, and cache retirement. Coverage includes whole and mixed image tables, overlapping and disjoint writes, and open and submitted command buffers. The mixed-table case is control coverage, not a claimed upstream regression.
This is a test-demonstrated correctness fix. No Wolverine unblock or FPS improvement is claimed.
Tested
Windows 11 Pro 10.0.26300; WinLibs GCC 15.2.0; Release; bundled dependencies; SPIR-V Tools enabled.
Picked up blawesom's rebase handoff, then rebased onto upstream
47a266cf975f00f7fba94013467d03bfa5e355e9. Published head:8f52b46de55c48b0dd71ee9aa975b8574f06c6b5, adding only the reviewed diagnostic spacing correction to tested code80c8072a703d3c824b7529094339acf55cad4352. The recorded results below remain tied to that tested revision. The conflict resolution preserves both upstream'srecorderEvictionTestsand all five Windows regressions. Independent source review confirmed that both production guards and the regression behavior are unchanged.80c8072a747a266cf9: 6 passes, 4 failures; PR80c8072a7: 10 passes, 0 failures; five cases on each actual GPUThe fresh paired comparison used byte-identical candidate fixture executables and non-AGC runtime dependencies; only
libSceAgcDriver.prxdiffered. Baseline productionShaderResources.cppmatched the pinned base exactly; the candidate contained the two pending-write guards. Both builds also generate trace-revision metadata. On both actual AMD and NVIDIA devices, baseline whole-table overlap failed withindependent RGBA mismatch queued-consumer lane=0, and baseline direct-snapshot overlap failed because lookup returned before copied-write publication. All four failures passed with the corrected provider and full success oracles; the six mixed/disjoint control runs passed with both providers. Inputs and runtime copies were hash-checked. This is evidence for this PR's pinned base, not the latest main or a title execution.The follow-up passes are
agc_driver_gpu_indirect_arguments_misaligned_writer_ahead,guest_shader_link,guest_agc_driver_resources, andguest_agc_driver_debug_unavailable. The former alignment build blocker was fixed upstream by4fe92c9c2; this PR does not claim that fix. The threeguest_*cases are ordinary native test executables linked against the libraries; they check bounded guest-ABI interfaces. They do not establish relinker conversion or execution of converted guest PRX artifacts. No native loaded-module enumeration was performed.Four failures remain visible:
video_out_flip_eopvideo_out_flip_eop_mainvideo_out_flip_eop_aftergpuwindows_import_modulesNo tests were excluded from either selected cohort. These failures have not been paired against an otherwise identical unmodified current-main build; their cause is not attributed to this patch or dismissed as pre-existing. The malformed-packet diagnostic in the EOP log is expected negative-control output, not its established failure cause. The full build is green; the complete Windows test suite is not claimed green. This revision registers 1,411 tests; only the stated cohorts were executed on it.
Older helpers do not all honor
ANYPS5_GPU, so 112 runs are not presented as dual-GPU coverage of every identity. All five new regressions verified the requested vendor.video_out_flip_lifetimeandvideo_out_flip_reopenpassed in both focused requests. The historicalagc_driver_recorderidentity is absent from this upstream revision; no pass is inferred.Earlier evidence, kept separate from current verification
1c6a06a919e4b3279209b921bacae671f94d31ad, the full Windows run accounted for 1,352 tests: 1,322 passes, 26 failures, four skips. A corrected-PATH rerun of exactly those 26 failures produced 21 passes and five failures. All 20 Git-dependent failures resolved;loadexec_argumentspassed on rerun without establishing the cause of its original temporary-file cleanup failure. Those counts are not current-commit full-suite results.agc_host_import_sparseandagc_driver_sparse_dma_buf_import(Linux-only udmabuf),agc_driver_stencil_ref_export(missing device extension), andguest_video_out_wqhd_detection_no_vulkan(intentional no-Vulkan fixture). Skips were never counted as passes.1b1f8483produced six passes and four failures across the ten vendor/case runs; the corrected provider produced ten passes with identical fixtures and non-AGC dependencies. Whole-table and direct-snapshot overlap cases failed on both vendors; mixed and disjoint controls passed. This older comparison is separate from the fresh pinned-base comparison reported above.8d0be22c3on baseadb0e7a8c, with a tessellation failure attributed to #4727. That is contributor-reported evidence for their revision, not our independent Linux validation. Our native Linux verification remains deferred; the five new regressions are Windows-gated.GPU-selector coordination: prerequisite #7570 is open at
5e901e0c396e5a9910610b72bb4aabe763417bdb. Local integrationb4782b8a9eb0dc3f31eb3e62039d40b88801a99bis prepared on that head: pending-snapshot modes use its common constructor and the vendor-only branch is removed. This integration has not been pushed to #6937; the agreed order is #7570 first, then adaptation here.The local composition's focused build passed. Its two 12-case full-name GPU requests and six alias/partial-name runs produced 30 behavioral passes, 0 failures, 0 skips: 28 GPU executions with the fixture's actual physical-device identity checked, plus two CPU executions. All five new regressions verified complete output/side-effect oracles on AMD and NVIDIA. Eight deliberately unavailable-name requests produced the expected error without
ANYPS5_REQUIRE_VULKAN, skips, or fallback; those rejection controls are separate from the 30 positive passes. These results belong to the local composition, not this PR's published head. No complete-suite run is claimed for that composition.Fresh real-validation follow-up (2026-10-18), separate from the earlier behavioral runs: a portable, officially signed LunarG SDK provided
VK_LAYER_KHRONOS_validation1.4.363.0. The loader actually inserted the layer into all selected GPU executions, and each fixture's own physical-device line matched the requested AMD/NVIDIA device. No system-wide SDK installation was required.On local #6937/#7570 composition
b4782b8a9, the two 12-case requests produced 24 behavioral passes, but the default case emitted sixVUID-VkImageCreateInfo-usage-00968errors on each GPU. This independently reproduces #7569. Those two runs are validation failures despite passing assertions; the other selected GPU cases had no validation errors or warnings.An existing separate fix, #7573 at
5394684198bc90e65afab15bda4240e1fb4b6c46, was then composed locally ontob4782b8a9, yielding5fbe8b50449fb8adb422d54fdf27047d5ff37e98. The CMake conflict was resolved by retaining both selector registrations and the disabled-feature registration. A fresh focused build passed. The resulting 13-case matrix on each GPU produced 26 behavioral passes, zero failures and zero skips: 24 actual-device-checked GPU executions with zero validation errors and zero warnings, plus two CPU selector executions. This includes the default case, memory case, three resource modes, actual-device/CPU selection, the deliberately disabled storage-image-multisample case, and all five pending-write regressions with their complete success oracles. Per-run source, executable, PRX and validation-layer hashes remained stable.Independent results were supplied to #7573. These are tests of the explicit unpublished composition, not #6937's published head, the standalone #7573 head, latest main, the full Windows suite, production MSAA rendering, or gameplay. The new fallback case verifies bounded placeholder/cache behavior; it does not prove every optional-feature-disabled shader path. #7573 remains a separate prerequisite for the validation-clean composition; it has not been folded into this PR.
The remaining failures were also rebuilt and rerun on composition
5fbe8b504:video_out_flip_eopandvideo_out_flip_eop_mainstill fail their label/reserved-flip assertion,video_out_flip_eop_aftergpureaches its registered 30-second timeout, andwindows_import_modulesstill fails its UCRT stdout-probe assertion. None is excluded or counted as a pass. A separate local EOP correction remains preserved at4e394aef9; it is outside this PR and its older results are not borrowed as current-composition coverage. No complete-suite green result is claimed.Latest pinned-main preflight (kept separate): after main advanced to
81cb8633944e092c0964ee0ad095fe393af85919, I composed it locally with both prerequisite heads and #6937 at3ee658e5526e256542af6bdd7e84cc3efb4e0c37. The only conflict was CMake registration: retain our five cases and upstream's retained-batch case. The two production pending-write guards remain the only #6937 changes inShaderResources.cpp; upstream's retained-storage accounting changes are preserved. This is a local preflight, not a published rebase or a claim that the prerequisites have landed.The affected cache, VideoOut and relinker build targets passed. A 15-case validation matrix per actual AMD/NVIDIA device, adding upstream storage-budget and retained-batch coverage, produced 30 behavioral passes, no failures or skips: 28 GPU executions with the actual Khronos layer loaded, zero validation errors/warnings, and verified physical-device identity; two CPU selector executions. The five pending-write cases again passed every output/side-effect oracle. Input hashes held. Conventions against pinned
origin/mainand whitespace checks passed. The build emitted compiler/CMake warnings; it is not described as warning-free.The four outstanding checks were rerun on that same
3ee658e55composition (NVIDIA for the GPU cases): both EOP assertions fail, after-GPU EOP times out at 30 seconds, and the UCRT stdout probe fails. Thus these selected current-composition runs account for 30 passes and four failures, with no skips or exclusions; the complete Windows suite was not run. On the earlier5fbe8b504composition, the three EOP failures were also reproduced on actual AMD. Their local correction remains separate. No converted guest fixture execution was performed in this follow-up.#5997 and #5998 are now merged upstream. Coordination was requested with #6340 because its per-entry rewrite removes the query vector used by our table guard; the eventual composition must preserve pending copied-write rejection per eligible entry. That combined path remains untested and its ordering remains unagreed. A maintainer review-scope decision was requested; no acceptance of unit-test evidence instead of title evidence is assumed.
Related PRs #5997, #5998, #6340, #6365, #6454 and #6609 were inspected previously; no exact duplicate was established. In particular, #6340 restructures table reuse and needs deliberate guard adaptation if combined. The overlap bot now lists further shared-file comparisons it could not complete. This is not a claim that all overlaps are resolved or that combined patches are validated; coordination remains pending.
No current-main Wolverine PPSA03671 failure has been attributed to this exact defect. No title unblock or FPS improvement is claimed. Draft while title-trigger evidence, overlap coordination, and resolution or attribution of the remaining failures are pending. Not submitted as ready to merge. Unit coverage does not satisfy the earlier request for a current-main title stop. Gated workflows and merging require maintainer action.
Run the five new cases separately with
ANYPS5_GPU=AMDandANYPS5_GPU=NVIDIA,ANYPS5_REQUIRE_VULKAN=1, andANYPS5_NO_SHADER_CACHE=1. Each retains its 30-second registered deadline.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-16T20:22:16Z.
Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.
core/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/tests/execution/SampledCacheBudget.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cppcore/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cppcore/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cppcore/libs/prx/libSceAgcDriver/tests/execution/ImageTableReuse.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cppcore/libs/prx/libSceAgcDriver/tests/execution/ImageTableReuse.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cppcore/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cppcore/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cppcore/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/tests/execution/ImageTableReuse.cppcore/libs/prx/libSceAgcDriver/tests/execution/SampledCacheBudget.cppcore/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cppcore/libs/prx/libSceAgcDriver/tests/execution/SampledCacheBudget.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cppcore/libs/prx/libSceAgcDriver/tests/execution/SampledCacheBudget.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cppcore/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cppcore/libs/prx/libSceAgcDriver/tests/execution/SampledCacheBudget.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cppcore/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtImported from boykopovar/AnyPS5. Originally posted by blawesom on 2026-10-17T08:49:31Z.
Rebase handoff — rebased onto current
main(authorship unchanged). One conflict inSampledCacheBudget.cpp: your Windows snapshot-word oracle and pending-snapshot fixtures sit alongsidemain's newer recorder-eviction test, both kept.Verified on Linux (CachyOS, kernel 7.2.9, GCC 16.2.1, Ninja, Release,
BUILD_TESTING=ON, AMD RX 9070 XT / RADV):tools/check_conventions.py --base origin/mainpassesmainregression (agc_driver_tessellationsegfault, #4727), not this PR (your snapshot tests are Windows-gated and skip here)To pick it up:
Head is
8d0be22c3.Imported from boykopovar/AnyPS5. Originally posted by Amoenus on 2026-10-18T14:01:38Z.
@Mustafa1p I confirmed the legacy sampled-cache selector gap while validating the refreshed native-color stack: with
ANYPS5_GPU=AMD Radeon(TM) Graphics,agc_driver_sampled_cache_budget_memoryused NVIDIA RTX5080 in3/3 runs, as shown by the Vulkan loader's selected-device line. The fixture source matches current main385ed71f2c; the linked validation composition was5ec8692b8a. The native-color fixtures selected AMD correctly, and I corrected our public counts.Your diff enables the new vendor selector for the new pending-snapshot cases; the existing default/memory modes still reach
devices.front(). The default mode also contains #6492's released-texture regression, so this matters for its AMD validation.I would like to prepare a focused general name-selector correction using the established Recorder fixture pattern, with CPU selection cases and an actual-device regression. It overlaps this constructor. Are you already covering the legacy modes, and would you prefer folding that correction here or landing an independent prerequisite first? I'll coordinate the order before opening an overlapping PR. AI-assisted investigation: yes.
Imported from boykopovar/AnyPS5. Originally posted by Mustafa1p on 2026-10-18T14:12:01Z.
@Amoenus Thank you for checking the actual device and correcting the counts. You are right: #6937 enables explicit selection only for the new pending-snapshot modes; it does not repair selection in the legacy default/memory modes. Our five new regressions checked the actual selected vendor, and the 112-run focused result is not a claim of AMD and NVIDIA coverage for every legacy case.
Please take the general selector correction as a separate focused PR and land it first. That keeps this cache-coherency fix separate from test-device selection and avoids both of us implementing the same constructor change. Using the established Recorder selection pattern, with CPU selection cases and an actual-device regression, sounds appropriate. Please cover all modes through the common selector, including pending-snapshot modes, preserve the existing AMD/NVIDIA requests, and make an unavailable explicit request fail clearly rather than silently selecting the first device.
For the device regression, please record the VkPhysicalDevice used by the sampled-cache fixture itself; a selected-device line from a separate driver-created Vulkan device would not establish that fixture's device. Both identities are useful if a test creates both.
Once you have a PR number, please link it here. I will declare the dependency, adapt #6937 to your selector instead of retaining its separate vendor-only branch, and rerun the pending-snapshot and legacy modes with actual-device evidence. Until then, the legacy AMD attribution remains unverified. AI-assisted: yes.
Imported from boykopovar/AnyPS5. Originally posted by Copilot on 2026-10-18T14:23:51Z.
Code review location:
core/libs/prx/libSceAgcDriver/tests/execution/ImageTableReuse.cpp; line 400Minor: the assertion message reads "all48 descriptors", missing a space between "all" and "48". Consider "all 48 descriptors" so the diagnostic reads cleanly if it fires.
Imported from boykopovar/AnyPS5. Originally posted by copilot-pull-request-reviewer[bot] on 2026-10-18T14:23:52Z.
Review: COMMENTED
🔵 Needs a closer look
It modifies a shared, concurrency-sensitive graphics-cache reuse path and the author explicitly flags unresolved overlap with other in-flight PRs (e.g. #6340 reworking the same table-reuse code) and unexplained test failures, so a human maintainer should make the final call.
1 open issue
What changed in this PR
This PR fixes a graphics-cache correctness bug in AnyPS5's AGC driver where a cached sampled texture or reused image-table could be served from stale guest memory while a recorder-tracked copied-buffer GPU write to the same memory was still pending. The fix adds a pending-write/snapshot overlap check to two reuse fast paths before a tracked snapshot is reused, routing overlapping cases back through the existing comparison-and-publication path while leaving disjoint writes reusable. It also adds Windows regression tests and their CTest registrations.
Changes:
ShaderResources.cpp:cachedTexture's snapshot-reuse predicate now rejects reuse on any pending write (previously only on the committed-ranges branch);TableCurrentrejects reuse when any of the table's queried ranges overlap the recorder's published pending-write snapshot.pendingSnapshotTests,RunTrackedPendingTable) covering RGBA results, guard regions, write publication, overlapping/disjoint writes, and cache retirement;SampledCacheBudgetalso gains an optionalANYPS5_GPUvendor selector.CMakeLists.txtregisters five new Windows CTest cases (whole/mixed/disjoint table, overlapping/disjoint sampled snapshot).core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cppcachedTextureandTableCurrentreuse paths against pending recorder writes.core/libs/prx/libSceAgcDriver/tests/execution/SampledCacheBudget.cpppendingSnapshotTestsand an optional GPU vendor selector for the fixture.core/libs/prx/libSceAgcDriver/tests/execution/ImageTableReuse.cppTrackedPendingregressions and an argv-dispatchedmain.core/libs/prx/libSceAgcDriver/CMakeLists.txtNotes on conventions: the production change adds no in-code comments (consistent with the repo's "no comments" rule), the referenced helper symbols and test target names all resolve, and the pre-existing no-arg
agc_driver_image_table_reusetest remains compatible with the newmain(argc, argv).Review effort: Balanced
Imported from boykopovar/AnyPS5. Originally posted by Amoenus on 2026-10-18T14:52:31Z.
@Mustafa1p The agreed prerequisite is ready: #7570, fork branch
Amoenus:codex/fix-sampled-cache-gpu-selector, head5e901e0c396e5a9910610b72bb4aabe763417bdb, based on maine00260b6b3. Please replace your vendor-only selection branch with the common constructor path when adapting #6937; AMD/NVIDIA aliases and case-insensitive partial names are covered.The test-only control fails 3/3 AMD requests, with the fixture's own
context.physicalproperties showing NVIDIA. The corrected fixture records actual AMD/NVIDIA properties in every current GPU mode. Six GPU modes each pass 3/3 per vendor; CPU cases and lavapipe pass too. The rebased head has matching full Windows/Linux builds and repeated selection checks. All six GPU modes reject an unavailable explicit name without requiringANYPS5_REQUIRE_VULKAN.One separate finding for your validation: default-mode behavioral assertions pass but emit six
VUID-VkImageCreateInfo-usage-00968errors per execution because the fixture does not enable multisampled storage images for that mode. Unchanged main reproduces it on NVIDIA; recorded as #7569 and explicitly disclosed in #7570. The memory/resource/selection-only modes are validation-error-free on our Windows runs. I have not claimed your pending-snapshot modes were tested on our selector-only head; they are not present there yet.AI-assisted: yes (Codex).
Imported from boykopovar/AnyPS5. Originally posted by Mustafa1p on 2026-10-18T15:19:23Z.
@Amoenus Thank you; #7570 is now declared as the prerequisite. I prepared local integration
b4782b8a9on your pinned head5e901e0c3, retained the common constructor for every mode, and removed #6937's vendor-only branch.On this Windows host, the composed fixtures produced 30 behavioral passes without skips: 28 actual-device-checked executions on AMD Radeon(TM) Graphics and NVIDIA RTX 5090, plus two CPU executions. This includes all five pending-write regressions with full success oracles, the six legacy/selection GPU modes, and additional alias/partial-name checks. All eight sampled-cache GPU modes also rejected a deliberately unavailable name without ANYPS5_REQUIRE_VULKAN or fallback; those expected failures are counted separately.
I retained #7569 as an unresolved validation gap. VK_LAYER_KHRONOS_validation is not available on this host, so I am not claiming validation-clean runs, a composed full-suite pass, or independent Linux coverage. I have not published the composed branch into #6937 while #7570 is pending; the agreed prerequisite-first order remains. The PR stays draft.
The separate review diagnostic typo is fixed in published commit
8f52b46de.Imported from boykopovar/AnyPS5. Originally posted by Mustafa1p on 2026-10-18T15:19:45Z.
Code review location:
core/libs/prx/libSceAgcDriver/tests/execution/ImageTableReuse.cpp; line 400Fixed in
8f52b46de55c48b0dd71ee9aa975b8574f06c6b5; the assertion diagnostic now reads "all 48 descriptors". This commit changes the diagnostic text only.Imported from boykopovar/AnyPS5. Originally posted by Mustafa1p on 2026-10-18T15:51:55Z.
Validation update and a review-scope question:
b4782b8a9; #6937's vendor-only branch is removed. This integration has not been pushed over the published head while the prerequisite remains unmerged.b4782b8a9reproduces #7569: six default-mode validation errors per run even though assertions pass.539468419in a separate local composition,5fbe8b504. The 13-case matrix on each GPU gives 26 behavioral passes (24 GPU + 2 CPU), no failures/skips, and zero GPU validation errors/warnings, including deliberately disabled storage MSAA. All five pending-write regressions retain their complete output/side-effect oracles. Details and limits: https://github.com/boykopovar/AnyPS5/pull/7573#issuecomment-6251897381 . Neither this composition nor #7573 has been folded into the published #6937 head.video_out_flip_eopand_mainat the label/reserved-flip assertion,_aftergpuat its 30-second deadline, andwindows_import_modulesat its UCRT stdout probe. They remain visible in the PR body. The separate local EOP correction is not part of this change; no whole-suite pass is claimed.Latest pinned-main preflight: local
3ee658e55now includes main81cb86339, both prerequisite heads, and #6937. Fresh affected builds and conventions pass. Adding upstream storage-budget/retained-batch cases gives 30 behavioral passes (28 actual-device GPU executions with the layer loaded, zero validation errors/warnings; two CPU cases). The four outstanding checks were rebuilt/rerun on this same composition and still fail as listed above. These are selected cohorts, not a complete-suite pass. #6340 overlap coordination was also requested: https://github.com/boykopovar/AnyPS5/pull/6340#issuecomment-6251961600 . This newest preflight is still local and does not update the published PR head.@boykopovar Would you accept review of this bounded cache-coherency correctness fix using the paired failing/passing regressions and dual-vendor validation, without a demonstrated current-main title stop? The earlier title-evidence condition remains unmet, and I am not treating unit tests as title evidence. If that condition remains required, #6937 will stay draft until it is met.
The body now distinguishes published head
8f52b46de, tested earlier revisions, and unpublished compositions; lists #7570/#7573 as dependencies; and preserves the known failures. After prerequisites land, the remaining work is adaptation to actual main, conflict/overlap coordination, final regression checks, and maintainer-triggered GitHub builds. No title unblock, gameplay/FPS improvement, independent Linux verification, or merge readiness is claimed.AI-assisted: yes.
Imported from boykopovar/AnyPS5. Originally posted by Scramblrrrr on 2026-10-19T13:07:41Z.
Windows cross-test of published #6937 head
8f52b46de, integrated at aefd25175beff28ef6bf7d2e458957ff85f6c975 on our 007 baseline63ec (mainca13 plus carried title prerequisites):https://github.com/Scramblrrrr/AnyPS5/tree/codex/first-light-table-cache-oct19
14/14 selected native controls pass, no skips (12.44s), actual NVIDIA RTX5070Ti617.42 / Windows / WinLibs15.2. Two fixture integration resolutions retain current main's storage-retained-batch test and multisample enable/disable behavior; no production guard was dropped. This is an integration cross-test, not clean main or validation-layer coverage.
Paired negative control rebuilt only ShaderResources.cpp/the provider DLL with baseline63ec production and left both fixture executables byte-identical: tracked overlapping write and direct sampled snapshot overlapping write fail; mixed/disjoint controls pass (3/5 pass,2.15s). Exact positive source restored/recompiled:5/5 pass2.11s, EXE SHA256 unchanged. Source is restored/clean. #6340 is NOT combined. No title stop/FPS benefit or maintainer scope approval claimed. AI-assisted: Codex.
Imported from boykopovar/AnyPS5. Originally posted by Scramblrrrr on 2026-10-19T14:04:24Z.
Combined #6340/#6937 Windows WIP now public at adfd0c4b2, based on our tested 007 integration162c34ee8/main3bb15be09:
https://github.com/Scramblrrrr/AnyPS5/tree/codex/first-light-entry-cache-oct19b
Retains #6340 published0dad1b2ac and #6937 published8f52b46de authorship. Integration adapts the pending copied-write snapshot check per reusable element in both TableCurrent and fresh-entry installation. It preserves main/#6454 full-table sampler replay, plus replay for eligible unchanged entries of a partial table; writable/source-backed entries stay outside this proof.
Focused NVIDIA RTX5070Ti617.42/Windows checks: all five pending-write modes pass, including a strengthened mixed-table warm assertion (tracked siblings reused while the untracked entry resolves), with full RGBA/surface/source/sentinel oracles retained. Paired negative changes ONLY the two per-entry SnapshotOverlaps checks, retaining cachedTexture's separate #6937 fix and unchanged fixture EXEs: whole and mixed cases fail, disjoint and both direct-snapshot controls pass (3/5,2.22s). Exact positive source restored/recompiled:5/5 pass2.15s; EXE hashes unchanged.
Existing image-table fixture initially expected1reuse/1resolution after a driver store; the combined path gives2reuse/1resolution: first dispatch resolves the changed entry while reusing siblings, second reuses the refreshed table. Both original texel readbacks pass. Integration expectation updated to describe that behavior; image-table reuse then passes. Broader affected checks are still running; NOT staged/title-tested, no FPS/unblock or validation-layer claim. AI-assisted: Codex. Raw title data stays local.
Pull request closed