Repository navigation
fix(agc): trace the title threads that register shaders - #7293
Merged
oneandonlydean merged 1 commit intoOct 17, 2026
Merged
Conversation
Shader registration and the shader ABI resolves run on the title's own threads, which never bound a trace buffer, so their Shader.Register and Shader.Resolve* scopes were missing from every trace and summary. Those entry points now bind the calling thread as `title` with the 32,768-event buffer the shader preparation threads use. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
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.
|
11 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Driver::RegisterShader,ResolveShaderAbi,ResolveGraphicsAbiandResolveGraphicsStagesAbirun on the title's own threads (sceAgcCreateShaderand the ABI calls oflibSceAgc). Those threads never callPerformanceTrace::BindThread, soPerformanceTrace::Thread()is null there. TheirShader.RegisterandShader.Resolve*scopes, and anyShader.PrepareArtifactwork they do inline, were missing from everyAPS5_TRACE_*trace and summary. The summary still saidtrace_dropped: false.Each of the four entry points now binds the calling thread first, when a trace is configured, as
title. It uses the 32,768-event buffer the shader preparation threads use (TraceThread::DefaultCapacity / 8).BindThreadreturns at once for a thread that is already bound, such as a queue worker. Without a trace switch, nothing is allocated.docs/dev/BUILD.mdnames the new buffer next to the shader preparation ones.#6341 does the same for the draw committer thread. This PR binds different threads and puts its test entries in another part of the CMake test block, so the two don't touch the same lines.
Tested
Linux (Ubuntu 24.04, GCC 13.3, Release), RTX 4070 Ti, NVIDIA 595.99.02;
maine815fb4.New
agc_driver_registration_trace(APS5_TRACE_FRAMES=0:1): a new thread registers a pixel shader inside the window. That thread must then hold a trace buffer namedtitle, not dropped, whose slices and totals both have aShader.Registerscope longer than zero.agc_driver_registration_trace_disabledruns it with the trace switches unset; the registering thread must have no buffer.With
main'sShaderRegistry.cppthe traced case fails 3 of 3 witha title thread that registered a shader has no trace buffer, and the disabled case passes. With this change both pass 3 of 3.ctest
^agc_(674 tests): all pass.Forspoken (PPSA03984), warm caches, 130 s with scripted pad input,
APS5_TRACE_SECONDS=45:20, one run of each build. Onmain922dc89 the trace has notitlethread, and the summary's eight largest phases are driver and Vulkan scopes. With this PR (f7cd8df) the trace has seventitlethreads holding 7,047Shader.Registerscopes (14.5 s summed over the threads), 323Shader.ResolveGraphicsStagesAbi(780 ms), 163Shader.ResolveAbi(536 ms) and oneShader.ResolveGraphicsAbi.Shader.Registeris the summary's fourth largest phase, at 500.8 ms per frame:check_conventions.pypasses.pr_overlap.pylists the PRs that editCMakeLists.txtand the two that also editShaderRegistry.cpp(perf(agc): draw finisher pipeline (APS5_DRAW_PIPELINE) #6946, perf(agc): GPU descriptor heap (APS5_GPU_HEAP) #6947). None of them binds these threads.Not checked on Windows, macOS, AMD or Intel.
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)🤖 Generated with Claude Code