ASTRO BOT (PPSA21567): "too many objects/batches in this scene" assert in the robot cutscene after New Game: draw threads race for bone uploads while the flip submission is held #5645
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 hugodearaujo on 2026-10-14T03:12:11Z.
What happens
After New Game, the cutscene with the crowd of robots stops on the title's own assert in about 70–80% of runs (Linux, RX 9070 XT / RADV, current
mainplus #5309 and #5390):Getting past the scene is random. In runs that pass, nothing visible differs.
What the title does (measured with temporary in-process hooks, not part of any PR)
The title records each frame on five command buffer contexts. Four of them belong to fixed draw threads:
DrawThreadDraw GeometryDraw ShadowDraw Extra GeometryEvery animated robot carries a per-frame "bones uploaded" byte (
object+0x14, checked atapp.elf+0x496fb8, set at+0x4970aa, not atomic). The first draw thread to draw a robot in a frame copies its 24 KiB of bone data into its own command buffer and sets the byte. Later draws on the other threads only reference that copy.DrawThreadgets to almost every robot first (75–150 uploads), and the other threads make 0–3.DrawThreadmade only 9–29.Draw Geometry,Draw ShadowandDraw Extra Geometrygot to the robots first (for example 62 / 87 / 98 uploads), and a 4 MiB context overflowed. In the run where we also logged when each thread started,DrawThreadhad not started any display list of that frame whenDraw Extra Geometryreached its 40th upload, 0.54 ms after the flip.DrawThreadto lose.Where
DrawThreadis at that pointA sampling profiler signalled
DrawThreadevery 100 µs while it had not started its first display list of the frame. In each 600-flip window, 92–97% of 73,000–189,000 samples were in the same place:That is the hold from #1745. A queue 0 submission with a flip waits until the worker has reached every earlier flip.
DrawThreadsubmits the frame's flip and is released only when the worker reaches the previous flip. The helper threads start the next frame at about that same moment (within about 1 ms of the flip in every frame we logged), so the four threads start together and the bone uploads go to whichever thread arrives first. On hardware the submit returns at once, soDrawThreadwould already be into the next frame by then.What we could not establish
holdFlipBehindWorkerreturn at once, or that allows one flip ahead), the title stops at the logo withcompute shader ...: AGC graphics: guest snapshot differs from registered memory. AddingAPS5_NO_SNAPSHOT_CHECK=1gives black frames and artifacts at the logo and then a lost device (vkQueueSubmit ... -4). These are the per-frame ring overruns #1745 describes, so the title never reaches the scene.APS5_NO_FLIP_HOLD, mentioned in #1745, no longer exists in the code.What we ruled out (repeated runs)
The occlusion latency (CPU-side occlusion dumps), the PS5 Pro mode, synchronous presentation,
APS5_TIME_SCALEwith a scaled vblank, the GPU timestamp values, host CPU affinity, and thread priority (all four draw threads use 680). None of them removes the crash.Possible directions
Environment
🤖 Generated with Claude Code
Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-14T03:36:32Z.
We don't reproduce this on PPSA21564 (same game, other region; Linux, RTX 4090, NVIDIA): 152 runs of
mainbuilds that include #1745 went through the New Game cutscene with no assert.Your reading matches the code.
Driver::holdFlipBehindWorker(core/libs/prx/libSceAgcDriver/Execution/src/Driver/Queues/Submission.cpp:147) blocks the thread that submits a queue 0 flip until the worker has reached every earlier flip. The console's submit never blocks like that, soDrawThreadstarts the next frame together with the helpers instead of ahead of them. The 4 MiB contexts and the assert are the title's own (command_buffer_writer.ppr.cpp:31), and the bone-upload byte is an unsynchronised race in the title that console timing always settles the same way.We don't have an exact fix to offer yet. The hold is there because the worker records from per-frame memory in place and falls more than a frame behind. Your runs without it, and with one flip ahead, show it can't be loosened until the worker keeps up (your direction 1). Direction 2 would need everything a frame's commands read to be captured at submit, and the driver can't know that set until the worker records the frame.
One thing that would help: the queue 0 delay in this scene on your machine, from a build with
-DAPS5_ENABLE_TIMING_LOG=ON(theSubmission queueanddequeuerows offrame-timing.log), so we can see how far behind the worker is when the assert hits.Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-14T10:01:32Z.
We timed this scene on the other region (RTX 4090, current
main) with a local probe. It logs submit entry and exit, the flip hold, and every guest wait longer than 20 µs, per thread.DrawThreadsubmits all of the frame's DCBs within about 1 ms, then sits in the hold. Median 40 ms per frame; 315 s of a 399 s run.Draw Geometry,Draw ShadowandDraw Extra Geometrynever started a frame whileDrawThreadwas held (0 of 5,794 frames). Their frame wake always came 0.6 ms or more afterDrawThreadreturned from the flip submission, and it moved with that return. When the rest of the submit took 1–3 ms longer, the helpers woke that much later.DrawThreadled the first helper by 0.65 ms median and 0.24 ms at p1.So here the hold doesn't let the helpers get ahead. It parks the whole process every frame until the queue 0 worker catches up, and then the title's own wake order decides who uploads the bones. The margin is the 0.3 ms you measured.
Could you check the same thing on your machine, for a few frames before the assert?
DrawThreadreturns from the flip submission;If the helpers wake before
DrawThreadreturns, the hold is involved on your side and we'll look at it again. If they wake after, as here, the fix is the worker keeping up (#5485), not a change to the hold. Your CPU model would help too.Imported from boykopovar/AnyPS5. Originally posted by hugodearaujo on 2026-10-14T12:40:06Z.
Measured on my machine with a lean probe (32-byte records written with
O_APPEND, no locks):DrawThreadentering and leaving the flip hold and returning from the flip submission (Driver::Submit), each draw thread waking for its frame (app.elf+0x2a9a84, right after the wait on state 1), and each thread's first bone upload of a frame (+0x496f90with the byte atobject+0x14still 0). Currentmain(eecf90953), Linux, RX 9070 XT, Ryzen 7 9800X3D, 8 cores with SMT off (8 logical CPUs).Same as on your side: across 5 runs (66,283 frames), no draw thread ever woke while
DrawThreadwas held. They wake 0.6–0.75 ms (median) after it returns, never sooner than 0.19 ms. The hold lasts 95–101 ms per frame in this scene, so the queue 0 worker is about 100 ms behind.Two of the five runs hit the assert. Times in ms after
DrawThreadreturned from the flip submission:Both assert frames are the first frame of the crowd shot. The helpers wake about 0.2–0.35 ms before
DrawThread's first upload, soDrawThreadreleases them during its own pre-work. In run 4,Draw Shadowuploaded 0.07 ms after waking and 0.16 ms ahead ofDrawThread. In run 5,Draw Extra Geometryuploaded 0.16 ms after waking and 0.18 ms ahead of it. So on my machine too, the hold doesn't let the helpers get ahead; the title's own wake order decides, by a fraction of a millisecond. With only 8 logical CPUs, that margin may be tighter here than on yours.Imported from boykopovar/AnyPS5. Originally posted by hugodearaujo on 2026-10-15T14:23:31Z.
Small corrections to my comment above, rechecked against the same five runs. The conclusion does not change.
DrawThreadreturned was 0.61–0.80 ms per thread and run, not 0.6–0.75 ms.DrawThread's first upload" holds for only some of them. In run 4, Geometry, Shadow and Decal woke 0.23–0.30 ms before it and Extra Geometry 0.52 ms after. In run 5, Extra Geometry woke 0.34 ms before it, Decal 0.03 ms before, and Geometry and Shadow after it. The helper that uploaded ahead ofDrawThreadin each run (Shadow in run 4, Extra Geometry in run 5) is one that woke early.Imported from boykopovar/AnyPS5. Originally posted by mrfelek on 2026-10-15T21:06:49Z.
Astro Bot on NVIDIA: presenter checked, assert not reproduced yet
Setup
origin/main44df21632, Release, Linuxorigin/mainrelinkerResults
APS5_PROFILE_DRAW=1intro_next); no presenter summaries printed, since the flag was off; no assertAPS5_PROFILE_DRAWflag, not a stall.Is there a setting or save point that gets to the robot cutscene faster? If so, I can run it on the same build.
AI-assisted; the build and runs are from my machine.
Imported from boykopovar/AnyPS5. Originally posted by hugodearaujo on 2026-10-16T11:30:49Z.
@mrfelek Thanks for checking. I don't know of a shortcut, but the scene is close to the start. At the save selection, Start Over (Triangle) starts a New Game on that slot, and the robot cutscene inside the mothership follows with no input. In my runs the assert came about 80 s after New Game; in the two runs I logged frame by frame, it hit at the first frame of the crowd shot. Pressing X at the save selection continues the saved game instead, which is probably why your scripted runs went to a level. Start Over may replace that slot's progress, so keep a copy of the save data if you need it.
On NVIDIA the scene may well pass: @oneandonlydean's 152 runs on an RTX 4090 went through it without the assert. On my RX 9070 XT (RADV) it hit in 2 of 5 runs on
main, and in 70–80% of runs with #5309 and #5390. If it passes on your machine, the useful number is how longDrawThreadis held at the flip submission in that scene, which was 95–101 ms per frame here: theSubmission queueanddequeuerows offrame-timing.logfrom a build with-DAPS5_ENABLE_TIMING_LOG=ON, as suggested above.Imported from boykopovar/AnyPS5. Originally posted by frankea on 2026-10-18T06:24:59Z.
NVIDIA datapoint, as asked above: PPSA21564 on an RTX 4090, current
mainbuilt with-DAPS5_ENABLE_TIMING_LOG=ON, New Game from the save selection, five runs. The crowd scene passed in all five (notoo many objects/batchesassert, no other stop), so here are theSubmission queueanddequeuerows for that scene. Short version: on this machine the queue 0 worker is about 270 ms behind during the crowd shot (the hold at the flip submission is ~225 ms per frame), after ~110 ms / ~90 ms in the mothership interior just before it, and the very first crowd frame holdsDrawThreadfor about 0.9 s. That is 2.5 to 10 times the 95-101 ms you measured on the RX 9070 XT, and the title still gets through.Setup. ASTRO BOT PPSA21564 01.018.000, Windows 11 (26200), RTX 4090 (NVIDIA 616.92), AMD Ryzen 7 5800X (8 cores, SMT on, 16 logical CPUs), MinGW-w64 GCC 15.2.0 r7 (UCRT).
main3de84fa10(2026-10-18 17:22 +13:00) in a fresh worktree, Release,libsandrelinkertargets only,-DBUILD_TESTING=OFF -DAPS5_ENABLE_TIMING_LOG=ON;app.exerelinked with that tree's relinker (--windows --registry). Windowed, the 3840x2160 guest output presented at 2016x1134 in an interactive desktop session (RDP), shader disk cache warm (0 misses in all five runs), no otherAPS5_*switch. Box idle otherwise, one run at a time, 480 s cap per run.Scene and input. The save slot was empty, so the save selection offers
NEW GAME 1on Cross; no Start Over was needed and the save-data memory slot (_sd_mem/u268435456/slot0.bin) was restored from a backup before every run so each run saw the same empty slot. Mouse-bound pad buttons do not reach this title on currentmain(#6569 keeps mouse buttons off the pad while the title hassceMouseOpen, and this title does), so the presses went through the command file (APS5_PAD_INPUT_FILE+tools/pad_input.py cross --hold-ms 700): Cross every 6 s from the first presented frame, which skips the logos (title screen ~55 s after launch), until a screen capture classified the save selection, then one more Cross for New Game and nothing after that. From there the title runs on its own: warp tunnel for ~100 s, then the space cutscene (planet, asteroids, the mothership from outside), the interior shot, and the crowd shot 212-214 s after New Game, which is where your assert hit.What the rows are. One
[FrameTiming]line per flip.Submission.queue=(count,sum_ms,max_ms)is, per queue 0 submission of that frame, the time from its enqueue until the worker starts it (orderedAt - enqueuedAt);Submission.dequeueisdequeuedAt - enqueuedAtand is identical here (order_waitis 0 throughout). The hold itself isSubmission.flip_room_wait(roomReadyAt - validatedAt, which spanswaitForFlipRoomandholdFlipBehindWorker) andSubmission.accept(the wholeDriver::Submitcall); I list them beside the queue rows since they are whatDrawThreadwaits in. The title submits 6 queue 0 command buffers per frame in this scene, sosumis over 6 andmaxis the one that waited longest (the flip submission).Submission.queuemax per frame median / p90flip_room_waitmax medianThe transition is the same in every run: four frames of ~95 ms with the queue delay at ~110 ms and the hold at ~90 ms, then one frame of 0.9 s in which the flip submission waits 0.9 s in queue 0 (
queuemax 954-994 ms,flip_room_wait902-947 ms), two or three frames at ~120 ms, and from then on the crowd shot at 220-230 ms per frame withqueuemax alternating between ~255 and ~365 ms and the hold at ~215-230 ms. The per-frame rows around that first crowd frame, and one full line from inside the scene, are in the details below. Fullframe-timing.logfiles (45 MB per run) and the 10 s captures are kept; I can share them if useful.Rows at the crowd-shot transition, all five runs (frame, flip interval ms, queue 0 submissions,
Submission.queuesum / max ms,Submission.dequeuemax ms,Submission.flip_room_waitmax ms,Submission.acceptmax ms)One complete line from the crowd shot of run 1 (frame 5110),
Driver.*,Shader.*,Vulkan.*andAsync.*metrics removed:AI-assisted: yes (Claude Code)
Imported from boykopovar/AnyPS5. Originally posted by hugodearaujo on 2026-10-18T13:51:28Z.
@frankea Thank you, that is the number that was missing. On your RTX 4090 the flip submission is held about 225 ms per frame in the crowd shot (0.9 s on its first frame), against 95-101 ms on my RX 9070 XT, and the scene passes in all five runs. So a longer hold, with the queue 0 worker further behind, does not make the assert more likely, which fits @oneandonlydean's reading that the hold is not what lets the helpers get ahead.
On my machine the two assert frames were the first frame of the crowd shot, and in each the helper that uploaded bones before
DrawThreadhad woken 0.23 ms (run 4) and 0.34 ms (run 5) beforeDrawThread's first upload. I have not measured that order on NVIDIA, so I can't say yet whether it is what differs between the two machines.