fix(agc): stop optional compute captures at their bounds #6259
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/6259"
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 fdfawef324 on 2026-10-15T08:12:46Z.
What
When
APS5_DUMP_COMPUTE_PIPELINESreaches its 128-record or 256 MiB bound, the strict writer throws inside compute pipeline creation. The optional dispatch capture now stops once with a diagnostic at either bound or a host I/O failure, and skips subsequent capture filtering and SPIR-V copies. The strictWriteAPI retains its bounds, deduplication, immutable records and diagnostics. Invalid pipeline input, damaged/incomplete records, unexpected entries and allocation failures still propagate.PPSA01342 reached the generic error
compute pipeline capture: capture directory reached 128 entriesat 1385.2 seconds in the historical external experimental integration runds-c0076. Its metadata, triage and fatal line were checked. This title observation is scoped to that experimental integration; current-main title execution has not been verified for this change.Tested
Windows Server 2025 10.0.26100, O3 CPU tests using the actual production capture writer and repository homebrew fixture:
VulkanDevice.cpppasses O3 syntax checking with the matching component headers.Current head
66556448b(rebased ontomain38d245448, patch unchanged), MinGW GCC 15.2 Release, NVIDIA GeForce RTX 3060 12 GB, driver 591.86:libSceAgcDriverbuilds. All sevenagc_compute_pipeline*CTests pass withANYPS5_REQUIRE_VULKAN=1andANYPS5_ENABLE_SPIRV_TOOLS=ON, includingagc_compute_pipeline_capture_run: 2 pipelines are captured through the dispatch path and replayed without dispatch.APS5_DUMP_COMPUTE_PIPELINESset to a directory already holding 128 entries, a directory at exactly 256 MiB, or a path below a regular file. On this head each run passes, prints oneoptional capture disabledline naming the bound or I/O error, and adds no records. Withmain's writer and dispatch gate the same three runs fail: the 128-entry and 256 MiB errors end the fixture with exit 1, and the I/O case raises an undeliverablefilesystem_error(exit 67). An empty directory receives the same 2 records on both.No title run or title-performance claim.
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)Co-Authored-By: Codex [email protected]
Imported from boykopovar/AnyPS5. Originally posted by jotitadev on 2026-10-15T11:02:01Z.
Review: COMMENTED
macOS run of the capture tests, plus one macOS-specific case the optional path still turns into a fatal error.
Machine: Apple M2 Max, macOS 27.2, Apple clang (Xcode 27), libc++. Head
870952f2c, basemain8856f180c.maindoes not build fully on macOS, so I compiledagc_compute_pipeline_capture_teststhe way its CMake target does (tests/ComputePipelineCapture.cpp+Execution/src/ComputePipelineCapture.cpp,-std=c++20 -O2, Vulkan headers from the SDK) as a standalone binary, natively on arm64 and as x86_64 under Rosetta.--optional-entry-cap,--optional-byte-cap(0.70 s / 0.77 s),--optional-io(cannot create capture directory: Not a directory),--optional-invalid.WriteOptional/OptionalEnabledare new), as expected.Finder writes a
.DS_Storefile into folders it opens. The directory scan only accepts subdirectories, so that file hitscapture directory contains an unexpected entry, which is aCaptureError, not a limit or I/O failure.WriteOptionalrethrows it, and the next distinct compute pipeline creation fails. Reproduced on this head: oneWriteOptional, then an empty.DS_Storein the capture directory, thenWriteOptionalwith a different specialization value throwscompute pipeline capture: capture directory contains an unexpected entry. The check is the same onmain, so this is not a regression, but on macOS just looking atAPS5_DUMP_COMPUTE_PIPELINESin Finder during a run is enough to make the next pipeline creation fail. Skipping entries whose name starts with.in the scan, or treating an unexpected entry as an optional stop, would avoid it. Your call whether that fits this PR or a follow-up.Written with AI assistance (Claude Code). I ran the builds and tests above on my machine.
Imported from boykopovar/AnyPS5. Originally posted by fdfawef324 on 2026-10-15T12:06:34Z.
@jotitadev thanks for the macOS run. I rebased onto
main38d245448, and the range-diff shows both commits unchanged, so your results for870952f2calso cover the new head66556448b.On
.DS_Store: I can confirm this. The scan rejects every entry that is not a directory, whatever its name. This PR keeps that an error on purpose. The--optional-invalidtest checks that a stray file namedforeignstill throws and leaves optional capture enabled. Only the two bounds and host I/O failures stop optional capture. Skipping dot-prefixed entries would change which directories bothWriteandWriteOptionalaccept as capture directories. That behaviour already exists onmainand is separate from the bounds, so it belongs in a follow-up PR once this one lands, not in this one.I've also added current-head RTX 3060 results to the description. All seven
agc_compute_pipeline*CTests pass, includingcapture_run. The real compute fixture also passes when the capture directory is already at 128 entries, already at 256 MiB, or under a regular file, and the same three runs fail when built frommain's writer.AI-assisted: yes
Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-15T12:17:37Z.
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/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.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/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppImported from boykopovar/AnyPS5. Originally posted by jotitadev on 2026-10-15T19:53:41Z.
Thanks, that makes sense. Re-ran
66556448bon the M2 Max: all 5 capture modes pass on arm64 and on x86_64 under Rosetta, and the.DS_Storecase still throwscapture directory contains an unexpected entry, as you describe.I'll take the
.DS_Storefollow-up once this lands. It will skip only Finder's.DS_Store(not every dot entry) in the scan thatWriteandWriteOptionalshare, keep--optional-invalidthrowing for other stray files, and add a test for it.Written with AI assistance (Claude Code). I ran the builds and tests above on my machine.
Imported from boykopovar/AnyPS5. Originally posted by coltken95 on 2026-10-15T21:03:00Z.
Tested on Linux x86-64 (Release build, lavapipe / llvmpipe LLVM 20.1.2), with 66556448b merged into main
4eb91eacd:agc_compute_pipeline_captureand the four newagc_compute_pipeline_capture_optional_*tests (byte_cap, entry_cap, invalid, io) pass.ComputePipelineCapture.cppdoesn't build without the change ('struct AgcDriver::ComputePipelineCapture' has no member named 'WriteOptional').AI-assisted: yes (Claude Code)
Imported from boykopovar/AnyPS5. Originally posted by fdfawef324 on 2026-10-16T19:53:48Z.
We rebased this onto current main (
c84249186); the new head is 0984c3090 (was 66556448b), the same two commits with their authorship unchanged.The only conflict was in VulkanDevice.cpp: main moved the compute pipeline build into createComputePipeline, so the OptionalEnabled gate and the WriteOptional call moved there with no other change.
Tests: the five agc_compute_pipeline_capture tests (strict round trip, plus entry-cap, byte-cap, io and invalid) pass on this head on CPU, and tools/check_conventions.py --base upstream/main passes.
GPU, on the RTX 3060 (driver 591.86, Windows Server 2025):
agc_compute_pipeline_capture_runandagc_compute_pipeline_replaypass (2 of 2) on this head.AI-assisted: yes