fix(agc): honor the requested GPU trace capacity #20372
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/20372"
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 JJenkx on 2026-11-15T03:05:53Z.
What
Honor
APS5_TRACE_EVENTSfor GPU ranges using the same validated capacity parser as CPU trace buffers. Previously the GPU vector always reserved 262144 entries and used its allocation capacity as the limit, so increasing the setting still lost GPU events and reducing it was ignored. Store and enforce the requested logical limit when the capture window opens.A Kao diagnostic motivated this change: requesting 4194304 events still lost 11257 GPU timeline ranges. This fixes capture configuration; it makes no FPS or title-unblock claim.
The Windows regression now sets its trace directory with
_wputenv_s, matching the runtime’s wide environment reader.GpuRange()and its private GPU state definitions reside in the driver translation unit, so the test EXE inserts into the same DLL-owned capture state asPresent(). This addresses both reported fixture failures.Tested
Source-only refresh 2026-11-23: head
3972ceb8ad3abf229e6cf9fe7c9bccf868147464rebased onto mainb8b8f49250f3054cb450636839b4d8c9a905f7d1as two linear commits, with no merge commits. Both patches are unchanged bygit range-diff; newer upstream header declarations andsummaryFile.close()are preserved. Diff/conventions checks pass. Windows (2026-11-23, verified on this exact head): RX 6700 XT, Khronos validation 1.4.309.agc_gpu_trace_capacity_smalland_largepass 3/3 with the validation layer inserted in every run, 0VUID-, nothing skipped;agc_performance_tracepasses 3/3. The control (mainb8b8f49250plus only this PR's test files) fails both capacity cases 3/3 withthe runtime GPU trace ignored the requested capacity. Windows result. The Linux qualification below retains its original pins.Current-main refresh (2026-11-19): head
b8f38e1c0c031c7e401464003cda724f5b394b37is one linear commit on mainaa698cdc084344c180836f3bc6fee58a4051384b. Resolved the documentation conflict while preserving main’s newer trace-digest loss explanation. Production and fixture added/removed lines are unchanged from the previous head. Same five registrations and fixture sources on both sides: the fixed-capacity control passes the CPU trace and two depth rendering tests, failing only the two capacity witnesses; the change passes all five. Control requested 1/submitted 2 retains 2, and requested 262145 retains 262144. The change retains exactly 1 with 1 lost range and all 262145 without loss. The control includes the shared SDK-owned state seam while retaining the fixed capacity, so it is main plus test instrumentation. Both arms have four calibrated-device/rendering cases with validation-layer insertion and AMD selection, zero skips or VUIDs. The two capacity cases inject synthetic ranges; the two depth cases execute rendering. Full SDK/relinker builds pass, frozen banks stay unchanged and builder source/configuration are restored. No new native-title, FPS, Windows or NVIDIA execution claim; earlier external evidence retains its original pins. Build logs, verbose CTest/JUnit, exact patches, symbol ownership and bank manifests, SHA-256d1786f7d565ef2c398d0bf834067b85f5efbac31c80214360dd641b22d990aff(download and all payload hashes verified).Historical qualification below retains its own source pins.
Refreshed on main
324dc5aae57113ce9ed9fa707eb2ef0814eb76dc; change0476b63b8ae4bc58017c481306b2c1991d30f281. Same Linux AMD Radeon RX 6650 XT, RADV/Mesa 26.2.7, validation 1.4.363 (headers 335), required Vulkan and no shader cache:1870731ecd2d79785096a7c31db5445db8410cd9includes identical fixtures and the state-ownership bridge, retaining main’s original capacity behavior. CPU trace and two depth GPU cases pass. Both capacity cases fail as expected: requested 1/submitted 2 retains 2; requested/submitted 262145 retains 262144. This is main plus instrumentation, not an unmodified-main executable.GpuRange()and defines none of its GPU capture state; insertion and storage are defined by the driver.3972ceb8adin the 2026-11-23 result above.Full refreshed qualification evidence, SHA-256
17de82ad5456431db72d1f480e3fe1f2939e915c9480e48c0dcfd17eeac55190. All 42 members verified after download, including source/control patches, build logs, verbose CTest/JUnit, symbol inspection, frozen-bank manifests and overlap review. Earlier Linux evidence remains in the PR history.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 MarcZX10 on 2026-11-15T03:48:17Z.
Review: APPROVED
Reviewed — looks good
The GPU trace capacity change and all four changed files were reviewed at head
9b0be379eca36276da8cea403cc32ad387ac0fd8; the capacity is parsed and enforced consistently, and the new tests cover small and large limits.What I ran
No build or test commands were run. I inspected the prepared diff and used the pinned repository reader for changed lines and targeted context.
Results
Findings
Blocking
None.
Non-blocking
None.
Not verified
Build and test results, including the author-reported Linux qualification, were not independently verified. Windows behavior was not verified. No files were excluded from the review; all four changed files listed in the manifest were read.
To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-15T08:51:47Z.
Review: APPROVED
Reviewed — looks good
Nothing blocks this change; the implementation uses the validated capacity parser and enforces the requested GPU range limit.
What I ran
Reviewed head
0476b63b8ae4bc58017c481306b2c1991d30f281using the prepared diff and the pinnedrepo_read.pyreader. No build or tests were run in this review.Results
Findings
Blocking
None.
Non-blocking
None.
Not verified
Windows execution, console behavior, and the author-reported Linux builds and GPU test runs were not independently verified. Read all four changed files listed in the manifest:
PerformanceTrace.hpp,PerformanceTrace.cpp,GpuTraceCapacity.cpp, andagc_gpu_trace_capacity_tests.cmake. The bundle'sfiles.jsonwas unavailable; no excluded-file inventory was verified.To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-17T16:23:47Z.
Review: COMMENTED
Reviewed — no blocking findings
Nothing blocks this; the points below are optional.
What I ran
83b67d71336339ec3d07337910cdcfbee4740c80, basemain.diff.patch.files.jsonwas not opened.Results
diff.patchParseCapacityruns only when a window opensfile(GLOB)inCMakeLists.txtBUILD.md:324still says 262,144 rangesFindings
Blocking
None.
Non-blocking
docs/dev/BUILD.md:314— The new sentence says the GPU range buffer "uses the same count". The unchanged linedocs/dev/BUILD.md:324still says "The track keeps up to 262,144 ranges; more settrace_dropped", which is wrong for a windowed trace now. Changing that line to theAPS5_TRACE_EVENTScount would keep the two in step.core/libs/prx/libSceAgcDriver/Execution/src/PerformanceTrace.cpp:378—gpuRanges.reserve(gpuCapacity)allocates when the window opens. The memory paragraph atdocs/dev/BUILD.md:314only counts the slice buffers. At4194304the reservation is that count timessizeof(TraceGpuRange); I did not check the struct size. The doc should mention the GPU range reservation.Not verified
libSceAgcDriverand the newagc_gpu_trace_capacity_testsexecutable, on Linux or Windows._wputenv_sbranch and the DLL-owned GPU state.83b67d7.files/. The review covers their diff hunks and the targeted head reads above.files.jsonwas not opened.GpuRangemoved from the header into the.cpp, so each call is now out of line. No measurement was made.To get this to a good state
Nothing is required.
Optional: update
docs/dev/BUILD.md:324to theAPS5_TRACE_EVENTScount, and add the GPU range reservation to the memory note atdocs/dev/BUILD.md:314.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-21T00:21:44Z.
Review: APPROVED
Reviewed — looks good
Nothing blocks this change; the inspected implementation and tests support merging.
What I ran
Reviewed head
b8f38e1c0c031c7e401464003cda724f5b394b37. I read the prepared description, commits, manifest, diff, and all five changed files. I did not run commands or tests; the build and test outcomes in the PR description are author-reported.Results
Findings
Blocking
None.
Non-blocking
None.
Not verified
No tests or builds were run. Windows, native-title behavior, and the attached qualification evidence were not independently verified. All five changed files listed in the manifest were read;
files.jsonwas not available through the reader. No changed files were excluded by the manifest.To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by malekaifa on 2026-11-23T02:45:20Z.
Review: CHANGES_REQUESTED
@JJenkx The production capacity change still looks sound, but current head
b8f38e1c0c031c7e401464003cda724f5b394b37has a confirmed Windows regression in its new test cleanup. Your Nov. 20 rerun showed both capacity assertions complete successfully, thenstd::filesystem::remove_all(directory)throws becausesummaryFilestill hasaps5-summary.jsonlopen; addingsummaryFile.close()before cleanup makes both cases pass 3/3. Please fold that test-only close into the branch and rerun the Windows capacity cases. No production behavior change is requested. AI-assisted: yesImported from boykopovar/AnyPS5. Originally posted by malekaifa on 2026-11-23T06:12:13Z.
Review: APPROVED
Verified the requested Windows test-cleanup correction on exact head
1d123d90681cdd231125ab193fc0ee219b5026da. It is a one-commit fast-forward from reviewedb8f38e1c0cand changes onlyGpuTraceCapacity.cppby closingsummaryFilebefore the finalstd::filesystem::remove_all(directory). That is exactly the requested fix for the confirmed Windows open-file teardown failure; production GPU-capacity behavior is unchanged. The earlier Windows reproduction reported both capacity cases passing 3/3 with this close in place. No remaining code blocker from my review. AI-assisted: yesImported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-23T06:24:05Z.
Review: APPROVED
Reviewed — looks good
Nothing blocks this change; the requested GPU trace capacity is enforced and a regression test covers small and large limits.
What I ran
Reviewed head
1d123d90681cdd231125ab193fc0ee219b5026dausing the prepared diff and pinned reader. No commands or tests were run.Results
Findings
Blocking
None.
Non-blocking
None.
Not verified
Tests and runtime behavior were not independently executed. The author reports Linux AMD validation; Windows confirmation remains pending. Read all five files marked reviewed; no files were excluded.
To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by malekaifa on 2026-11-23T06:47:40Z.
Review: APPROVED
Re-reviewed exact head
3972ceb8ad3abf229e6cf9fe7c9bccf868147464after the current-main refresh. The conflict was limited toPerformanceTrace.hpp; the refreshed diff preserves main's newer header content plus the previously reviewed out-of-lineGpuRange, explicit GPU capacity/state storage, and requestedAPS5_TRACE_EVENTSenforcement. The test still closessummaryFilebefore Windows cleanup. No new production behavior was introduced by the rebase, and GitHub reports the PR mergeable again. No remaining code blocker from my review. AI-assisted: yes