feat(agc): report every trace phase total behind APS5_TRACE_ALL_PHASES #18243
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/18243"
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 Logan1h on 2026-11-10T23:32:33Z.
What
The trace summary names only the eight largest scopes and stages (
top_phases_ms_per_frame). Every other stage is folded away, so a stage that dominates one part of a frame but is small next to a larger one cannot be read from the summary at all, and the summary's own documentation says a missing stage does not establish that it did not run or cost nothing.APS5_TRACE_ALL_PHASES=1adds aphase_totalsobject to every summary line (windowedAPS5_TRACE_FRAMES/APS5_TRACE_SECONDS, and eachAPS5_TRACE_SUMMARY_EVERYline). It carries every recorded scope and stage withcount,sum_msandms_per_present, merged across threads the same way the top list is, so short stages and per-thread call counts stay visible regardless of the eight-entry cut. This includes the recordedDriver.WorkerWaitscope inphase_totalswhile keeping it out oftop_phases_ms_per_frame.The counts come from the per-thread totals table the trace already keeps; no new timing is recorded and no GPU path changes. Without the variable the summary line is byte-identical to today's, which the test asserts.
docs/dev/ENVIRONMENT.mdgains the variable anddocs/dev/BUILD.mdgains the field in the summary description.Integration status: #15952 is merged and is an ancestor of this head. A current pairwise
git merge-tree --write-treebetween this head36cb6ddb4ecand #18029d161c08eea2exits 0 with no conflicts (a680c7b862f7c74ec981ba64e3fd1b0cc885943a), so the earlier schema/order blocker is resolved and no dependency remains.Tested
Current head
36cb6ddb4ecea83cd394a9f2f2108f115ab6bdbc, rebased ontomain2b718a22fe1c8b234260a720c2fcf247ad3668ac. Before pushorigin/mainadvanced tod50640e26408445609a1c2e5ebfb8ed962376909; no upstream changes since the tested base intersect this PR, andgit merge-tree --write-tree origin/main HEADis clean (12830d089e6f7e57be03fc3f176a39dd73223010).Windows 11, Ryzen 5 7500F, GeForce RTX 4070 SUPER, WinLibs GCC 15.2.0 Release:
libSceAgcDriver,agc_performance_trace_tests,agc_packet_info_tests,agc_driver_depth_plane_sampling_tests,agc_driver_image_converted_unorm_testsandagc_driver_pm4_testsbuild successfully; the build log reaches 772/772 with exit 0.agc_performance_tracepasses withANYPS5_REQUIRE_VULKAN=1,ANYPS5_NO_SHADER_CACHE=1andVK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation, includingSummaryAllPhaseTotals: the compact summary exports neitherphase_totalsnor a stage outside the top eight; with the switch on, a 5 us stage called twice on one thread and a 7 us stage called three times on another merge into{"count":5,"sum_ms":0.012,"ms_per_present":0.006}, andDriver.WorkerWait(3 ms x 4 on the first thread, 2 ms x 1 on the second) merges into{"count":5,"sum_ms":5.000,"ms_per_present":2.500}while staying out of the top phases.agc_driver_depth_plane_sampling,agc_driver_depth_plane_sampling_evicting,agc_driver_image_converted_unorm,agc_driver_pm4andagc_performance_tracepass 5 of 5 with the same validation environment, with zeroVUID-or layer-missing lines.tools/vulkan_validation_gate.py, baseline2b718a22fe1vs this head,APS5_TRACE_ALL_PHASES=1,agc_driver_depth_plane_sampling, two iterations per side:status=complete,problems=[],new_diagnostics={}; every run insertedVK_LAYER_KHRONOS_validation.main: upstream58e8e208bab test(libSceAgc): probe unwritable outputs with an address that cannot be mappedreplaces the mappable0x10000fixture with0x10. On this rebased headagc_packet_info_tests --repeat until-fail:100passes 100 of 100. No PacketInfo production or test change is carried by this PR.git diff --check origin/main...HEAD,tools/check_conventions.py --base origin/main,tools/check_test_registration.py buildandtools/check_test_registration.py --scriptspass; registration reports 3197 test executables and 0 built but not run.tools/pr_overlap.py --base main --branch feat/agc-trace-phase-totals --jobs 8exits 2 for documentation-only overlaps and older fail-closed branches.Depends on: noneremains unchanged.adam25136(measurement): GTA V PS5, RTX 5080,mainc348559ad3plus a local field equivalent to this PR'sDriver.Drawcount — not this PR head. The count was steady at about 1,343 draws per present while the trace events showed less than a third of them;APS5_PIPELINE_STATSagreed within 0.3% over 210 s. The measured 34.9 ms per frame therefore reads as about 26.0 us per draw. This validates the schema's usefulness and interpretation, not the implementation of this head.36cb6ddb4ec; green CI is not claimed from the local results.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-11T00:01:32Z.
Review: CHANGES_REQUESTED
Reviewed — changes requested
phase_totalsclaims to include every recorded scope, but the summary builder filters out the recordedDriver.WorkerWaitscope before producing that field.What I ran
Reviewed head
45b50d0c24bb7f7f01ca06548ad8e7e50934f062; the precheck and clean merge preview used current basebc94a8e423ea026aadbb29165fed1ad2db471154. I inspected all four changed files, the summary aggregation and the existing summary tests.Environment: Linux 6.1, Python 3.11.2, GCC 12.2.0. I ran:
I did not build or run CTest locally. The author reports the focused tests and paired GPU validation-layer runs on a GeForce RTX 4070 SUPER; I did not reproduce those runs.
Results
agc_performance_trace.phase_totalsomitsDriver.WorkerWait.Precheck and hosted status details
Precheck output:
The precheck's
git diff --checkexited 0 with no output. The ABI audit was not applicable. The test-quality heuristic reportedPerformanceTrace.cppas possibly unregistered; I verified the existingagc_performance_trace_tests.cmakeregisters it. Build and build-dependent C++ tests were not run by the no-build precheck.Hosted status command:
Observed statuses: Windows passed; seven jobs skipped; intake, conventions, eligibility, labels, report and library-portability passed.
Negative control
I did not run a base-versus-change negative control. The new unit test checks aggregation across threads but does not exercise the recorded
Driver.WorkerWaitscope withAPS5_TRACE_ALL_PHASES=1.Findings
Blocking
Driver.WorkerWaitis recorded as aPerformanceTimerscope, but thescope != WorkerWaitScopefilter excludes it fromphases. The newphase_totalsiteratesphases, so it also omits this scope despite documenting that it contains every recorded scope and stage. Keep the existing exclusion fromtop_phases_ms_per_frameif that behavior is intentional, but collect the all-phase totals separately sophase_totalsincludes the wait scope; add a test that asserts its count and durations. Alternatively, narrow the field's documentation and PR claim to name the exclusion explicitly.Non-blocking
None.
Sources
WorkerWaitbefore buildingphase_totalsDriver.WorkerWait;phase_totalsis documented as every recorded scope and stageDriver.WorkerWaitwhen all phase totals are enabledNot verified
agc_performance_traceCTest.To get this to a good state
Include
Driver.WorkerWaitinphase_totalswithout changing the existing top-eight behavior, and add a test for its count and duration (or document the exclusion consistently). I’ll rerun the precheck and inspect the focused test on the new head.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-11T23:22:58Z.
Review: CHANGES_REQUESTED
Reviewed — changes requested
The missing
Driver.WorkerWaittotals are now covered, but the PR still needs an agreed integration order with two open PRs that overlap this summary output.What I ran
Reviewed head
6b7bbec930e4017842c3047ba1706a7fc2912ed3against currentmain3a0a54bbd85f2545103be14d046fef44cd7c5905; the merged preview is clean. Environment: Linux 6.1, Debian glibc 2.36, Python 3.11.2, GCC 12.2. The Windows hosted check also passed on this exact head. The author-reported focused Vulkan runs are identified separately below; I did not run them.Results
main; not reproduced here.Precheck and merge output
The full precheck check table is reproduced here from the report:
git diff --check 3a0a54bbd85f2545103be14d046fef44cd7c5905...6b7bbec930e4017842c3047ba1706a7fc2912ed3/usr/bin/python3 tools/check_conventions.py --base 3a0a54bbd85f2545103be14d046fef44cd7c5905 --head 6b7bbec930e4017842c3047ba1706a7fc2912ed3 --title feat(agc): report every trace phase total behind APS5_TRACE_ALL_PHASES --body /tmp/anyps5-pr-precheck-18243-current/pr-body.md/usr/bin/python3 /marc/AnyPS5/tools/pr_abi_audit.py --base 3a0a54bbd85f2545103be14d046fef44cd7c5905 --head 6b7bbec930e4017842c3047ba1706a7fc2912ed3 --json/usr/bin/python3 /marc/AnyPS5/tools/pr_stack_check.py 18243 --repo boykopovar/AnyPS5 --output-dir /tmp/anyps5-pr-precheck-18243-current/stack/usr/bin/python3 /marc/AnyPS5/tools/pr_test_quality.py --root /tmp/anyps5-pr-precheck-18243-current/head-6b7bbec930e4-9208d4c3 --json core/libs/prx/libSceAgcDriver/Execution/include/PerformanceTrace.hpp core/libs/prx/libSceAgcDriver/tests/PerformanceTrace.cpp docs/dev/BUILD.md docs/dev/ENVIRONMENT.mdgit merge-treereturned exit 0 for the current-main preview. It returned exit 1 for each pairwise preview:GitHub's Windows check for this head passed. Seven product jobs were skipped by CI path policy. The author reports that the focused AGC set passed on
mainand this head with Vulkan validation enabled and no VUID or sync-hazard lines; that evidence was not independently reproduced here.Negative control
No mutation negative control was run. The new regression directly checks that
Driver.WorkerWaitis included in the opt-in totals while remaining excluded from the compact summary and top-phase list.Findings
Blocking
phase_totals_ms); #18243 addsphase_totalswith counts and per-present values. Their current heads conflict in the trace test and build documentation. Open #18029 adds encoder counters in the same trace-summary implementation, and its current head conflicts with this one inPerformanceTrace.hpp. The PR checklist currently saysDepends on: none, contrary to the repository's overlap rule. Please coordinate with both authors, agree which change lands first or consolidate the overlapping summary work, then update the dependency checklist and resolve the resulting conflicts.Non-blocking
No separate defect was found in the changed implementation or regression test. The earlier omission of
Driver.WorkerWaitis fixed by collecting its totals separately from the top-phase map.Sources
Not verified
To get this to a good state
Coordinate the all-phase schema and landing order with #15952 and #18029, update
Depends on, and push the integrated head. I will rerun the no-build precheck and current-base/pairwise merge checks, then review the new exact head.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-14T16:38:20Z.
Review: COMMENTED
Reviewed — no blocking findings
The changed summary formatting and documentation were reviewed at head
21e519248bfb41b3556836724198cc84374b04d5; no blocking defect was verified, and automated checks were not run.What I ran
Read the prepared description, commit list, diff, manifest, and all four changed files’ added lines. Inspected the related summary-formatting helpers. No test or build command was run.
Results
Findings
Blocking
None.
Non-blocking
None.
Not verified
The author reports passing tests, but I did not run them. Full file text beyond the relevant changed lines was not read. Files read:
PerformanceTrace.hpp,PerformanceTrace.cpp,docs/dev/BUILD.md, anddocs/dev/ENVIRONMENT.md. The manifest lists these same four files as reviewed; all added lines were read.To get this to a good state
Nothing is required. Optional: run
agc_performance_traceon this head to confirm the reported result.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-20T04:50:06Z.
Review: APPROVED
Reviewed — looks good
The change adds opt-in per-phase call counts and duration totals to trace summaries, including the worker wait scope; the reviewed implementation and tests support the stated behavior.
What I ran
Reviewed head
36cb6ddb4ecea83cd394a9f2f2108f115ab6bdbc. No commands or tests were run; the author-reported test results are not independent runs.Results
Findings
Blocking
None.
Non-blocking
None.
Not verified
No runtime behavior, test output, build, CI result, merge preview, or title behavior was independently verified. The description reports these checks, but they were not run in this review.
To get this to a good state
Nothing is required.
Files read:
core/libs/prx/libSceAgcDriver/Execution/include/PerformanceTrace.hpp,core/libs/prx/libSceAgcDriver/tests/PerformanceTrace.cpp,docs/dev/BUILD.md, anddocs/dev/ENVIRONMENT.md. Files reviewed in the manifest: all four; no exclusions were listed.