shader: list SRT walker unknowns per evaluation context #1821
No reviewers
Labels
No labels
bug
documentation
duplicate
enhancement
GPU
GUI
help wanted
question
Shaders
Video
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/KytyPS5--KytyPS5!1821
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/1821/head"
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?
@NeySlim on GitHub · 2026-10-22 07:11 UTC · original
NeySlim:perf/srt-unknown-lists→main· +9 −2 · 2 files · 1 commits · closed without mergingProblem
SrtWalker::ResetUnknownsscans every memo entry of every context of the session to find the values marked unknown.RefreshFlatBuffercalls it for the walker and for the clean evaluator before each reachability walk, so a plan with control flow pays two to four full scans of its memo per materialization, whether or not anything is unknown.In God of War Ragnarök (PPSA08332, 05.005) that is about 8 000 resets and 3 million memo entries scanned per frame for ~3 600 materializations, and almost none of them are unknown. On the GPU thread profile it is ~3 ms per frame (2.8 ms in the opening cutscene, 3.5 ms on the sled).
Change
Each evaluation context keeps the indices it marked unknown in its current generation.
ResetUnknownsresets those and clears the list. Contexts are reused across sessions, so the lists keep their capacity and nothing is allocated per materialization. The memo protocol is unchanged: same entries reset, same entries kept.Test
No new test: the change does not alter results. Dropping the
push_back(entries never reset) makesTestEmptyTraversalSkipsUnmappedDescriptorfail, so the existing reachability tests cover the list.Validation
Linux, Radeon 8060S (RDNA 3.5), Mesa RADV 26.2.5.
shader_recompiler_compute_testsone case per process: same results as main (770 of 823 pass).--tessellation, on top of my other open PRs (main alone does not get in game), warm caches: the reset no longer shows in the GPU thread profile. The frame rate gain on that stack is small (about 1 ms per frame on the sled, cutscene within noise).Not tested on Windows. Nothing platform specific in the change.
AI use
I used Claude Code (AI agent) to profile the GPU thread, find the cause, write the change, and run the tests and game runs above on my machine. I reviewed the diff and the results.
@coderabbitai[bot] on GitHub · 2026-10-22 07:17 UTC · original
No actionable comments were generated in the recent review. 🎉
ℹ️ Recent review info
⚙️ Run configuration
2a92c384-63ba-4a14-81c2-474a5801bc69📥 Commits
Reviewing files that changed from the base of the PR and between
c5016d9455and4f8d7cd6c4.📒 Files selected for processing: 2
src/graphics/shader/recompiler/ir/ShaderIR.hsrc/graphics/shader/recompiler/ir/passes/SrtWalker.cppIncluded review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.
📝 Walkthrough
EvaluationContextnow stores memo indices for values marked unknown in the current generation.EvaluateWiderecords an index when instruction evaluation fails.AcquireContextclears the list, andResetUnknownsprocesses listed entries that remain unknown for the current generation before clearing the list.Suggested reviewers:
nmzikPriority: ⬇️ Low
Change: Refactor
Merge Risk: ⚪ Minimal · up to
4f8d7No actionable merge-blocking risk was identified in the changed unknown-entry tracking.
Pre-merge checks:
4 ·
1
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
❤️ Share
Comment
@coderabbitai helpto get the list of available commands.@NeySlim on GitHub · 2026-10-24 22:56 UTC · original
Closing this as well. With every resource plan walked by the JIT walker on main, the per-context unknown lists no longer change anything measurable.
Pull request closed