Repository navigation
fix(agc): keep stores after occlusion dumps after them in a queued run - #5232
Conversation
|
Thanks for the fix and for registering I only read the diff; I did not build or run it. AI-assisted (Claude Code). |
|
@xXPBSXx numbers from a title with many occlusion queries: Epic Mickey: Rebrushed in Dark Beauty Castle. Linux, RX 7600 (RADV, Mesa 25.2.8),
At about 48 frames per 10 s, the split adds about 100 label-run barriers per frame: each extra group is one barrier plus one fold dispatch. That is about 10% of all recorded barriers (39k-48k per 10 s). FPS moves within the run-to-run spread (0.23 between runs with the PR). The run without the PR is also the one where draws pop, so it isn't a like-for-like frame. If the barriers become a cost on other titles, a narrower rule is possible: split only before a non-computed store that something later reads as a result. That needs knowing which store is the label, which the recorder doesn't track today. I'd keep it for a follow-up. AI-assisted (Claude Code). |
|
Tested on High on Life (PPSA15388, UE4), the title from #5488, at the same spot as my earlier traces there. This PR fixes most of that title's occlusion flicker on the normal GPU path, and makes it much faster. Flicker. Walls, doors and windows in the home base and on the stairs now stay in place on the normal path ( Speed, window-title FPS, same save and machine. The earlier numbers come from several runs, not a strict A/B, but the gap is large:
Trace at the upstairs window, with the same local
In the one bad frame (#48 of the trace), the three largest queries read 0 together. Their begin and end dumps (#4965–#4980) all show the same total, so no samples were counted between them. The neighbouring frames read about 1.45 M, 0.62 M and 1.58 M. The video shows the matching symptom: an object vanishes for exactly one game frame and comes back. Which object varies from blink to blink: the purple window trim, the rug hung on the right wall, the wooden frames, or a cup on the far window sill. Sometimes it is a larger blink where the window trim and the rugs all vanish at once. That fits a run of queries dropping out together, with a varying length, not one bad query. So #5232 fixes the ordering against the polled label, which was most of the flicker and most of the cost. What's left looks like the GPU dump/count path that @MarcZX100 pointed at. I'll try #5213 on top of this next. Details
Tested and written by Claude (AI assistant) on a contributor's machine. Video: |
|
Follow-up on the remaining blink: with #5213 on top of this PR, it's gone in High on Life. That's 55 of 55 traced frames correct, no visible dropouts, objects no longer vanish behind the weapon, and about 12 FPS at the window, so no cost over this PR alone. Details are on #5213. Together the two PRs fix this title's occlusion problem from #5488. Tested and written by Claude (AI assistant) on a contributor's machine. |
A queued store run records each group's plain stores first and its occlusion counter dumps after them. A store started a new group only when it overlapped an earlier dump, so a label the title writes after its dumps was recorded before them. A title that polls that label then reads counters from before the dumps land. Any store after a dump now starts a new group. Epic Mickey: Rebrushed (PPSA15657) read stale or zero occlusion results every other frame and left visible geometry undrawn on alternate frames. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Rebased onto main to resolve the test-list conflict in |
1486a18 to
9a1ac6a
Compare
What
Fixes #5215.
Recorder::QueuedWriteGroupssplits a queued store run into groups. Each group records its plain stores first and its occlusion counter dumps after them. A store started a new group only when it overlapped an earlier dump, so a store after the dumps that touched other memory joined their group and was recorded before them. That's fine for the final memory contents, but a title polling that store sees it early. The usual case is the label it writes after its occlusion queries to say "results ready". The title then reads the counters before the dumps land.Now any store after a dump starts a new group, so a group's stores never follow its dumps in program order. The cost is one more dump dispatch per dump-to-store transition.
APS5_LABEL_RUNS_INLINE=1, which records every dump at once, was not slower on the title below.The
QueuedWriteGroupstests only ran in the recorder binary's full mode, which ctest doesn't register. They now also run asagc_queued_write_groups(--queued-write-groups-only, no device needed). Updated expectations:Tested
agc_queued_write_groupsfails without the change ("the clear of the next query slot did not wait for the dumps before it") and passes with it.ctest: 1059 of 1060. The failure isguest_math, the known Linux failure fixed by fix(libc): return the x86 default NaN from acosf for |x| > 1 #5154.tools/check_conventions.pyandtools/check_test_registration.pypass.tools/pr_overlap.py: perf(agc): present and keep pending only the drawn slice of an array color target #4935 also adds tests to the sameCMakeLists.txtlines.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