fix(agc): prioritize demanded shader preparation #4404
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/4404"
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 eljackjoestar-cmd on 2026-10-12T09:35:15Z.
What
Lost Soul Aside (PPSA26358) can stop during startup with
LastObjectNotReadyForFinishDestroy is NULLwhile a game task waits inAwaitRegisteredPreparation. The registration pool processes jobs in FIFO order, so a shader needed immediately can sit behind hundreds of unrelated preparation jobs even with a warm disk cache.Tag registration jobs with their prepared-state identity and move the requested job to the front when a caller waits for it. Record demand before consulting the queue, so a request arriving between snapshot publication and job submission also receives priority. Existing running jobs complete normally; queued work is retained, each job executes once, and preparation failures still propagate. Shader instruction semantics are unchanged.
Tested
Windows 11, GCC 15.2 Release, RTX 5070 (12 GB, driver 617.14), Ryzen 7 7800X3D, 32 GB RAM. Branch based on main
fc1f063f5; head68c2b0f74.agc_driver_prepared_publicationpasses without skips in 0.66 s. The regressions verify that demanded work runs first without duplication, both after enqueue and when demand arrives before enqueue.demanded preparation waited behind background work or ran twice. Restoring it passes.No game run was repeated for this rebase. Earlier title tests used the integration described in #4401, including unmerged rendering/ancillary/IR-memory/direct-memory fixes. This branch contains only the scheduling change and its regression tests. Level loading still exhausted available commit headroom and the memory guard stopped the game; gameplay and complete compatibility are not claimed. Rendering and startup audio are separate from this scheduling fix.
tools/check_conventions.py --base origin/mainandgit diff --checkpass. Linux, console hardware and collaborator-triggered full CI were not run.Checklist
main; no other open PR implements this demand-priority behavior. Related #2589 moves static ABI preparation to the background pool; this change prioritizes existing registration jobs.Imported from boykopovar/AnyPS5. Originally posted by xXPBSXx on 2026-10-13T06:56:32Z.
Windows test (MinGW GCC 15.2, Release, Windows 10, RTX 4080 SUPER). Built on main
88107b7detogether with thirteen other open GPU PRs (their own commits cherry-picked, no merge commits), so only the tests that belong to this PR say something about it:tests/execution/PreparedPublication.cpp(agc_driver_prepared_publication): 3 of 3 runs passed.Not tested: no game run. The batch was built once, not per PR; nothing failed, so no bisect was needed.
AI-assisted (Claude Code).
Imported from boykopovar/AnyPS5. Originally posted by fdfawef324 on 2026-10-13T08:01:03Z.
Tested on Windows with Black Myth: Wukong (PPSA23226). This PR fixes a hang there.
Without it: the title never presents a frame. With a warm shader cache, queue 0 stops executing after 173 submissions, at about 167 s. The queue worker is parked in
AwaitRegisteredPreparation, behind the background preparation pool. The render thread waits for the last submission's completion label. At about 325 s Unreal aborts:GameThread timed out waiting for RenderThread after 120.00 secs. A cold-cache run stops the same way, at 270 s.With this PR:
APS5_TRACE_PREPARATION_WAIT=1shows the shaders the worker waited on had been queued at these positions:The title now presents frames, the first at 45.6 s. Queue 0 executes 343 submissions, and Unreal reaches level and game-mode setup. There is no GameThread timeout. It runs until an unrelated crash at 262 s.
agc_driver_prepared_publicationpasses, and it fails whenPrioritizeRegistrationPreparationis emptied. The PR merged cleanly ontomain6d7b87370and onto my integration branch. That branch also carries #4508 and #4960, which this title needs to start.Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-13T08:07:25Z.
Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.
main)core/libs/prx/libSceAgcDriver/Execution/include/Driver/Shaders/ShaderRegistry.hppL110core/libs/prx/libSceAgcDriver/Execution/src/Driver/Shaders/ShaderRegistry.cppL796, L804, L830, L838-839, L852Imported from boykopovar/AnyPS5. Originally posted by eljackjoestar-cmd on 2026-10-13T08:22:53Z.
Rebased cleanly onto main
fc1f063f5. Full Windows Release build passes, andagc_driver_prepared_publicationpasses without skips (0.66 s), including demanded work both before and after enqueue. Conventions and whitespace checks pass. The PR description separates this fresh rebase validation from the earlier integration/game and negative-control results; no new game run is claimed.