AGC: the end-of-pipe event a flip raises makes Death Stranding 2 call a null handler #6462

Closed
opened 2026-10-15 16:22:29 +00:00 by fma-rc · 5 comments
fma-rc commented 2026-10-15 16:22:29 +00:00 (Migrated from github.com)
Contributor

Imported from boykopovar/AnyPS5. Originally posted by fma-rc on 2026-10-15T16:22:29Z.


The graphics end-of-pipe event that flips raise since #4215 crashes Death Stranding 2 (PPSA02015, 01.015.000) about 56 s in.

Setup: Linux, RTX 5080, main 0029e62f9 plus #6437, #5426 and #5855, without which it stops earlier.

The title registers graphics event 0 with sceAgcDriverAddEqEvent and runs a thread that waits on it and calls a handler from a table indexed by sceAgcDriverGetEqContextId. Every flip raises the event, and the thread calls address 0 (SIGSEGV, called from app.elf + 0x1bd01b1). With a local switch that skips the flip event, 20 flips go by without a crash, and the first event comes from the title's own RELEASE_MEM with INT_SEL 2 on queue 72 at about 131 s.

Run Result
as is SIGSEGV at 56 s, null call from the event thread
flip event skipped 20 flips without a crash; at about 131 s the first RELEASE_MEM interrupt hits the same null call, a separate bug in what sceAgcDriverGetEqContextId returns that I have a fix for

So this title does not expect an event per flip. How does Minecraft (the title #4215 was for) get its per-flip event on a console? If its flips carry their own end-of-pipe release with an interrupt, raising the event only from that release would serve both.

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5869872819 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/6462). Originally posted by [fma-rc](https://github.com/fma-rc) on 2026-10-15T16:22:29Z. --- The graphics end-of-pipe event that flips raise since #4215 crashes Death Stranding 2 (PPSA02015, 01.015.000) about 56 s in. Setup: Linux, RTX 5080, `main` 0029e62f9 plus #6437, #5426 and #5855, without which it stops earlier. The title registers graphics event 0 with `sceAgcDriverAddEqEvent` and runs a thread that waits on it and calls a handler from a table indexed by `sceAgcDriverGetEqContextId`. Every flip raises the event, and the thread calls address 0 (SIGSEGV, called from `app.elf` + 0x1bd01b1). With a local switch that skips the flip event, 20 flips go by without a crash, and the first event comes from the title's own `RELEASE_MEM` with `INT_SEL` 2 on queue 72 at about 131 s. | Run | Result | |---|---| | as is | SIGSEGV at 56 s, null call from the event thread | | flip event skipped | 20 flips without a crash; at about 131 s the first `RELEASE_MEM` interrupt hits the same null call, a separate bug in what `sceAgcDriverGetEqContextId` returns that I have a fix for | So this title does not expect an event per flip. How does Minecraft (the title #4215 was for) get its per-flip event on a console? If its flips carry their own end-of-pipe release with an interrupt, raising the event only from that release would serve both.
MarcZX10 commented 2026-10-15 22:35:38 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-15T22:35:38Z.


I traced this to the flip path added for #4215: after flushing/queuing the flip, it calls AgcDriverDeliverEopInterrupt(submission.queue) unconditionally (or defers the same call until recorded work completes). The existing RELEASE_MEM interrupt path is separate. #4215 explicitly left unmeasured whether console flips raise this event themselves or only through an interrupt in the flip sequence. Do you have a packet trace or command-buffer excerpt for the affected Death Stranding 2 flip showing whether its submission contains an interrupting release? Comparing that with the Minecraft flip that needs the event would establish whether the event should be tied to a packet condition rather than every flip.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6203687077 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/6462#issuecomment-6203687077). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-15T22:35:38Z. --- I traced this to the flip path added for #4215: after flushing/queuing the flip, it calls `AgcDriverDeliverEopInterrupt(submission.queue)` unconditionally (or defers the same call until recorded work completes). The existing `RELEASE_MEM` interrupt path is separate. #4215 explicitly left unmeasured whether console flips raise this event themselves or only through an interrupt in the flip sequence. Do you have a packet trace or command-buffer excerpt for the affected Death Stranding 2 flip showing whether its submission contains an interrupting release? Comparing that with the Minecraft flip that needs the event would establish whether the event should be tied to a packet condition rather than every flip.
MarcZX10 commented 2026-10-15 22:45:38 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-15T22:45:38Z.


Related evidence from GT7 in #6350: its current-main trace records one EOP delivery from the guest's interrupting RELEASE_MEM marker and a second delivery from the separate flip branch, with one flip in that run. That matches the two independent paths in the code and confirms the emulator can deliver both for one submission. It still does not establish whether console behavior should coalesce them; the missing discriminator remains a console-side event count/data trace or another reliable reference for a submission containing both.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6203840192 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/6462#issuecomment-6203840192). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-15T22:45:38Z. --- Related evidence from GT7 in #6350: its current-main trace records one EOP delivery from the guest's interrupting `RELEASE_MEM` marker and a second delivery from the separate flip branch, with one flip in that run. That matches the two independent paths in the code and confirms the emulator can deliver both for one submission. It still does not establish whether console behavior should coalesce them; the missing discriminator remains a console-side event count/data trace or another reliable reference for a submission containing both.
fma-rc commented 2026-10-16 00:44:29 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by fma-rc on 2026-10-16T00:44:29Z.


I logged every flip submission in Death Stranding 2 with its packets (same stack as the issue, local print only). In two runs the game dies after its first flip, with the same null call from app.elf+0x1bd01b1. That flip is submission 10 on queue 0, and the submission is the flip packet alone, six dwords (c004105c 00000001 00000000 00000001 00000000 00000000). It holds no RELEASE_MEM and nothing with INT_SEL, so the only event that submission raises is the one from the flip branch's unconditional AgcDriverDeliverEopInterrupt.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6205400524 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/6462#issuecomment-6205400524). Originally posted by [fma-rc](https://github.com/fma-rc) on 2026-10-16T00:44:29Z. --- I logged every flip submission in Death Stranding 2 with its packets (same stack as the issue, local print only). In two runs the game dies after its first flip, with the same null call from `app.elf+0x1bd01b1`. That flip is submission 10 on queue 0, and the submission is the flip packet alone, six dwords (`c004105c 00000001 00000000 00000001 00000000 00000000`). It holds no `RELEASE_MEM` and nothing with `INT_SEL`, so the only event that submission raises is the one from the flip branch's unconditional `AgcDriverDeliverEopInterrupt`.
MarcZX10 commented 2026-10-16 03:27:46 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-16T03:27:46Z.


Thanks, this isolates the local trigger: the first failing submission is a flip packet with no RELEASE_MEM or INT_SEL, so the event comes from the unconditional flip path. It still does not establish whether the console raises this event for a bare flip; #4215 relies on that behavior for Minecraft, so I do not have a safe generic change to propose yet. A console event count or trace for this packet shape would settle the remaining question.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6207410756 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/6462#issuecomment-6207410756). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-16T03:27:46Z. --- Thanks, this isolates the local trigger: the first failing submission is a flip packet with no `RELEASE_MEM` or `INT_SEL`, so the event comes from the unconditional flip path. It still does not establish whether the console raises this event for a bare flip; #4215 relies on that behavior for Minecraft, so I do not have a safe generic change to propose yet. A console event count or trace for this packet shape would settle the remaining question.
fma-rc commented 2026-10-17 08:30:21 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by fma-rc on 2026-10-17T08:30:21Z.


One more fact for this: that bare flip packet is written by the game's own sceAgcDcbSetFlip (video out handle 1, buffers 0 and 1), not by sceVideoOutSubmitFlip. I logged both callers on the same stack and only sceAgcDcbSetFlip fires before the crash. So it is the same packet shape a title gets from the AGC flip call, which is also the path #4215 relies on, and PR #7008 (which only changes VideoOut flips) leaves this crash unchanged in my runs.

PR #7978 fixes this: flips no longer raise the graphics end-of-pipe event (a flip in a command buffer now waits for the previous flip submission's GPU work instead), and the event carries the release's interrupt context so sceAgcDriverGetEqContextId returns it. With it and #5426, Death Stranding 2 gets past the null call on current main and stops at unsupported MIMG opcode 0xb8.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6231762919 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/6462#issuecomment-6231762919). Originally posted by [fma-rc](https://github.com/fma-rc) on 2026-10-17T08:30:21Z. --- One more fact for this: that bare flip packet is written by the game's own `sceAgcDcbSetFlip` (video out handle 1, buffers 0 and 1), not by `sceVideoOutSubmitFlip`. I logged both callers on the same stack and only `sceAgcDcbSetFlip` fires before the crash. So it is the same packet shape a title gets from the AGC flip call, which is also the path #4215 relies on, and PR #7008 (which only changes VideoOut flips) leaves this crash unchanged in my runs. PR #7978 fixes this: flips no longer raise the graphics end-of-pipe event (a flip in a command buffer now waits for the previous flip submission's GPU work instead), and the event carries the release's interrupt context so `sceAgcDriverGetEqContextId` returns it. With it and #5426, Death Stranding 2 gets past the null call on current `main` and stops at `unsupported MIMG opcode 0xb8`.
Sign in to join this conversation.
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5#6462
No description provided.