AGC: on a cold shader cache, the first submission waits for every queued registration preparation; Ghost of Yōtei reaches its loading spinner 2.6x later than with APS5_LAZY_SHADER_PREPARE=1 #6846
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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 Pipodi on 2026-10-16T14:10:43Z.
What happens
On a cold shader cache, Ghost of Yōtei (PPSA26344) shows a black screen for 80–180 s before its first frame. With a warm cache, the first frame comes at about 40 s. While the screen is black, about 1.3 CPU cores are busy.
Thread dumps at 45 s and 70 s (main
82ddae75b, cold) show:Driver::Submit→AwaitRegistrationPreparation;Structurizer::computeDominatorTree/tarjanVisit);In the first 10 s the title registers about 1,600 shaders, and almost all of them are prepared within that window. A few giant registrations, about 21 MiB of SPIR-V each, stay in the pool for tens of seconds. Since #5007,
Driver::Submitwaits for every preparation queued before it, not only the ones its commands use. So the first submission waits for those giants. The debt entry "Registration preparation at submit" indocs/dev/debt/libSceAgcDriver.mdalready describes this case.Measured
Windows 11 Pro 26200, RTX 4090, driver 617.42.
main82ddae75bplus #6227, which this title needs to start on current main, plus a local crash-report thread-dump hook. Each run has its own empty shader cache directory.APS5_LAZY_SHADER_PREPAREPossible fixes
Driver::Submitwait only for the preparations of the shaders its commands bind. The Goat Simulator 3 case from #5007 only needs those.I can turn option 2 or 3 into a PR with this A/B if one of them is the preferred direction.
🤖 Generated with Claude Code
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-16T14:15:46Z.
I would favor option 2 as the next investigation: it targets the measured wait on unrelated registrations while preserving the existing eager-preparation behavior by default. Before removing the submission-wide barrier, I would want a regression that queues a slow unrelated registration ahead of a submission, verifies the submission waits for the shaders its commands actually reference, and verifies unrelated preparations do not hold that submission back. The existing per-shader first-use wait and prioritization need to remain safe with the queue worker. Since you offered to implement option 2 or 3, please take that direction if it still fits your plan; I will avoid starting an overlapping change.
Imported from boykopovar/AnyPS5. Originally posted by Pipodi on 2026-10-16T14:59:10Z.
Implemented option 2 in #6867, as you suggested.
Driver::Submitnow reads the program address registers its commands write (SET_SH_REGand indirect SH register lists) and waits only for those programs' pending preparations, moving them to the front of the queue. The global wait is gone. A program it can't see still waits in the queue worker at first use.It includes the regression you asked for:
On a cold Yōtei boot (two runs), submission waits drop from 117 s to about 6 s, and frame 619 comes at 101 s instead of 181 s. That's the same as
APS5_LAZY_SHADER_PREPARE=1, with preparation still eager.🤖 Generated with Claude Code