Slay the Princess (PPSA24423) on Windows: AGC draw aborts with "vertex buffer aliases the render target" #4369

Closed
opened 2026-10-12 07:54:15 +00:00 by xXPBSXx · 9 comments
xXPBSXx commented 2026-10-12 07:54:15 +00:00 (Migrated from github.com)
Contributor

Imported from boykopovar/AnyPS5. Originally posted by xXPBSXx on 2026-10-12T07:54:15Z.


Slay the Princess (PPSA24423, from the owner's own dump), Windows 10, MinGW GCC, NVIDIA RTX 4080 SUPER.

Observed: on current main plus the fcntl/ioctl change of #3840 (merged locally onto d06c06565, clean merge), the title runs about 70 s and aborts with

what():  AGC graphics: vertex buffer aliases the render target
FATAL: abort() (SIGABRT)

The throw is Require(!state.hasColorTarget || address + bytes <= state.color.address || state.color.address + state.color.bytes <= address, "vertex buffer aliases the render target") in core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp (around line 1161): a draw whose vertex buffer range overlaps the bound color target's range. The log before it shows storage-image texture creations for 1920x1080 targets (formats 56, vk=37); I did not look at which draw or buffer it is.

Not established: which buffer and which target overlap, whether the vertex data is a render-to-vertex-buffer use or a stale color target binding, and whether the overlap is real on the console. One run only. Without #3840 the title stops earlier at sceKernelFcntl: file descriptors are not implemented, fd=6 (#3757). The import audit shows 0 absent imports (60 s run on main ceb342b94).

AI-assisted (Claude Code).

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5810281927 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/4369). Originally posted by [xXPBSXx](https://github.com/xXPBSXx) on 2026-10-12T07:54:15Z. --- Slay the Princess (PPSA24423, from the owner's own dump), Windows 10, MinGW GCC, NVIDIA RTX 4080 SUPER. **Observed:** on current `main` plus the fcntl/ioctl change of #3840 (merged locally onto `d06c06565`, clean merge), the title runs about 70 s and aborts with ``` what(): AGC graphics: vertex buffer aliases the render target FATAL: abort() (SIGABRT) ``` The throw is `Require(!state.hasColorTarget || address + bytes <= state.color.address || state.color.address + state.color.bytes <= address, "vertex buffer aliases the render target")` in `core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp` (around line 1161): a draw whose vertex buffer range overlaps the bound color target's range. The log before it shows storage-image texture creations for 1920x1080 targets (formats 56, `vk=37`); I did not look at which draw or buffer it is. **Not established:** which buffer and which target overlap, whether the vertex data is a render-to-vertex-buffer use or a stale color target binding, and whether the overlap is real on the console. One run only. Without #3840 the title stops earlier at `sceKernelFcntl: file descriptors are not implemented, fd=6` (#3757). The import audit shows 0 absent imports (60 s run on `main` `ceb342b94`). AI-assisted (Claude Code).
MarcZX10 commented 2026-10-12 09:02:52 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-12T09:02:52Z.


Could you capture the failing draw’s vertex-buffer guest address and byte range, and the bound color target’s guest address and byte range (including format and extent)? The overlap check only reports that the ranges intersect; those values would distinguish a real alias from stale target state or a range-calculation issue. If available, please include the draw/shader identifier and a trace or minimal replay, and confirm whether it still reproduces on current main with the required fcntl change.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6121091556 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/4369#issuecomment-6121091556). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-12T09:02:52Z. --- Could you capture the failing draw’s vertex-buffer guest address and byte range, and the bound color target’s guest address and byte range (including format and extent)? The overlap check only reports that the ranges intersect; those values would distinguish a real alias from stale target state or a range-calculation issue. If available, please include the draw/shader identifier and a trace or minimal replay, and confirm whether it still reproduces on current main with the required fcntl change.
xXPBSXx commented 2026-10-12 09:15:30 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by xXPBSXx on 2026-10-12T09:15:30Z.


Slay the Princess (PPSA24423) on main 375e99ec3 + #3840 + #425, Windows, with a temporary local diagnostic in Draw.cpp (prints, not committed). The check is not too strict in the sense that the overlap is real in the numbers it sees, but the numbers come from garbage index data, and the title stops there in every run (4 of 4 runs here; two of them hit the buffer allocation below before the alias check printed anything).

The draw that throws, from the diagnostic:

big index: highest=0xff000000 addr=0x39a418000 count=6 size=4 import=1 restart=0
           first bytes: 00 00 00 ff  00 00 00 ff  00 00 00 ff  00 00 00 ff  00 00 00 ff  00 00 00 ff
big vb:    bytes=0x7f8000008  V# = 848c8000 00080003 00000004 0004022c   (stride 8, records 4)
vb alias:  vb=0x3848c8000+0x7f8000008  color=0x385c30000+0x870000 fmt=37 1920x1080
  • It is an indexed draw of 6 32-bit indices read in place from guest memory at 0x39a418000. All six hold 0xff000000 (bytes 00 00 00 ff), which is not a plausible index list for a vertex buffer with 4 records (a quad would be something like 0,1,2,2,1,3); it looks like opaque-black RGBA pixels, or a value the CPU or GPU had not written yet.
  • VertexBufferReadSize takes the highest index (0xff000000) times stride 8 and gets a range of 0x7f8000008 bytes (about 32 GiB), which spans the 1080p color target and is what Draw.cpp ~1161 rejects as vertex buffer aliases the render target. When that check does not fire first, the same range ends in vkAllocateMemory buffer: allocation=34225520656 (that is 0x7f8000010, same size) failing with VK_ERROR_OUT_OF_DEVICE_MEMORY.
  • The vertex V# itself is sane (4 records of 8 bytes, 32 bytes in total). The same draw would pass if the index data were valid.

So the question is why the index memory does not hold the indices: whether the title writes the indices after this draw is recorded (a CPU write our snapshot misses or a GPU write whose result is not in guest memory yet, as in #1787), or an earlier GPU or DMA operation of the title overwrites that memory with the black pixel pattern (for example a clear or fill reaching the wrong address). I have not determined which; I looked at neither the packets before this draw nor who writes 0x39a418000.

Sources: this is about the code and the numbers above, not about Vulkan or console semantics. Vulkan feedback-loop rules (a vertex buffer in the same memory as an attachment) are not what triggers here, because the vertex data is copied or imported as a separate buffer. A tolerant treatment (clamping the vertex range to the descriptor's num_records * stride) is possible for out-of-range indices on the console (OOB_SELECT returns zero for fetches beyond num_records, per the V# fields our VertexBufferReadSize already reads), but it would hide the real problem here, which is the wrong index data; I would not do that without knowing what the title expects.

AI-assisted (Claude Code).

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6121278051 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/4369#issuecomment-6121278051). Originally posted by [xXPBSXx](https://github.com/xXPBSXx) on 2026-10-12T09:15:30Z. --- Slay the Princess (PPSA24423) on `main` 375e99ec3 + #3840 + #425, Windows, with a temporary local diagnostic in `Draw.cpp` (prints, not committed). The check is not too strict in the sense that the overlap is real in the numbers it sees, but the numbers come from garbage index data, and the title stops there in every run (4 of 4 runs here; two of them hit the buffer allocation below before the alias check printed anything). The draw that throws, from the diagnostic: ``` big index: highest=0xff000000 addr=0x39a418000 count=6 size=4 import=1 restart=0 first bytes: 00 00 00 ff 00 00 00 ff 00 00 00 ff 00 00 00 ff 00 00 00 ff 00 00 00 ff big vb: bytes=0x7f8000008 V# = 848c8000 00080003 00000004 0004022c (stride 8, records 4) vb alias: vb=0x3848c8000+0x7f8000008 color=0x385c30000+0x870000 fmt=37 1920x1080 ``` - It is an indexed draw of 6 32-bit indices read in place from guest memory at `0x39a418000`. All six hold `0xff000000` (bytes `00 00 00 ff`), which is not a plausible index list for a vertex buffer with 4 records (a quad would be something like 0,1,2,2,1,3); it looks like opaque-black RGBA pixels, or a value the CPU or GPU had not written yet. - `VertexBufferReadSize` takes the highest index (`0xff000000`) times stride 8 and gets a range of `0x7f8000008` bytes (about 32 GiB), which spans the 1080p color target and is what `Draw.cpp` ~1161 rejects as `vertex buffer aliases the render target`. When that check does not fire first, the same range ends in `vkAllocateMemory buffer: allocation=34225520656` (that is `0x7f8000010`, same size) failing with `VK_ERROR_OUT_OF_DEVICE_MEMORY`. - The vertex V# itself is sane (4 records of 8 bytes, 32 bytes in total). The same draw would pass if the index data were valid. So the question is why the index memory does not hold the indices: whether the title writes the indices after this draw is recorded (a CPU write our snapshot misses or a GPU write whose result is not in guest memory yet, as in #1787), or an earlier GPU or DMA operation of the title overwrites that memory with the black pixel pattern (for example a clear or fill reaching the wrong address). I have not determined which; I looked at neither the packets before this draw nor who writes `0x39a418000`. Sources: this is about the code and the numbers above, not about Vulkan or console semantics. Vulkan feedback-loop rules (a vertex buffer in the same memory as an attachment) are not what triggers here, because the vertex data is copied or imported as a separate buffer. A tolerant treatment (clamping the vertex range to the descriptor's `num_records * stride`) is possible for out-of-range indices on the console (`OOB_SELECT` returns zero for fetches beyond `num_records`, per the V# fields our `VertexBufferReadSize` already reads), but it would hide the real problem here, which is the wrong index data; I would not do that without knowing what the title expects. AI-assisted (Claude Code).
xXPBSXx commented 2026-10-12 11:08:18 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by xXPBSXx on 2026-10-12T11:08:18Z.


Follow-up on Slay the Princess (PPSA24423) with more local diagnostics (temporary prints, not committed), main e7c70a2df + #4408 + #3840, Windows; the numbers change what I wrote above.

  • It is intermittent. The failing draws are explicit DRAW_INDEX packets (opcode 0x27, indexType 32-bit, count 6) that carry their own index address, one buffer per quad. In one 150 s run the diagnostic printed 1,923 such draws and every one reads 00000000 00000001 00000002 00000002 00000003 00000000 (a quad); the run ended on the time limit without a stop. In three other runs the abort comes at a draw of the same shape whose six indices all read 0xff000000, at a different address each time (0x39a418000, 0x38a22c000, 0x394bf8000). So the abort needs one draw in a few thousand to see garbage in its index buffer.
  • No stream writer touches it. In a failing run no CP DMA_DATA, no HLE dword fill (fillBuffer) and no copy kernel targeted that page (I printed the destination of every one: zero lines). So the bytes are not written by a command in this stream; either the CPU writes them and we read before that write is visible, or the memory was remapped or reused between the title's write and our read.
  • Index buffers are in-place imports (import=1), so the read is a direct view of guest memory at record time.

That points to ordering between the title's CPU writes and the moment the driver reads the buffer (or to a remap of the page), not to the aliases the render target check; #4408's change to that check does not help here, as I wrote there. I have not found what makes the page read 0xff000000 (opaque black RGBA).

AI-assisted (Claude Code).

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6123050698 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/4369#issuecomment-6123050698). Originally posted by [xXPBSXx](https://github.com/xXPBSXx) on 2026-10-12T11:08:18Z. --- Follow-up on Slay the Princess (PPSA24423) with more local diagnostics (temporary prints, not committed), `main` e7c70a2df + #4408 + #3840, Windows; the numbers change what I wrote above. - **It is intermittent.** The failing draws are explicit `DRAW_INDEX` packets (opcode `0x27`, `indexType` 32-bit, count 6) that carry their own index address, one buffer per quad. In one 150 s run the diagnostic printed 1,923 such draws and every one reads `00000000 00000001 00000002 00000002 00000003 00000000` (a quad); the run ended on the time limit without a stop. In three other runs the abort comes at a draw of the same shape whose six indices all read `0xff000000`, at a different address each time (`0x39a418000`, `0x38a22c000`, `0x394bf8000`). So the abort needs one draw in a few thousand to see garbage in its index buffer. - **No stream writer touches it.** In a failing run no CP `DMA_DATA`, no HLE dword fill (`fillBuffer`) and no copy kernel targeted that page (I printed the destination of every one: zero lines). So the bytes are not written by a command in this stream; either the CPU writes them and we read before that write is visible, or the memory was remapped or reused between the title's write and our read. - Index buffers are in-place imports (`import=1`), so the read is a direct view of guest memory at record time. That points to ordering between the title's CPU writes and the moment the driver reads the buffer (or to a remap of the page), not to the `aliases the render target` check; #4408's change to that check does not help here, as I wrote there. I have not found what makes the page read `0xff000000` (opaque black RGBA). AI-assisted (Claude Code).
xXPBSXx commented 2026-10-12 12:18:15 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by xXPBSXx on 2026-10-12T12:18:15Z.


Possible lead for the intermittent garbage index data: with #1359 ("order direct reads after copied writes", clean merge on main ffa198407) Slay the Princess ran 3 of 3 runs of 150 s without the abort, where it aborted in 3 of 4 earlier runs without it (details and caveats on #1359: no same-day control run on identical main, so not proven). If that holds, the index bytes are read before an earlier copied writeback or completion has landed.

AI-assisted (Claude Code).

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6124114118 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/4369#issuecomment-6124114118). Originally posted by [xXPBSXx](https://github.com/xXPBSXx) on 2026-10-12T12:18:15Z. --- Possible lead for the intermittent garbage index data: with #1359 ("order direct reads after copied writes", clean merge on `main` ffa198407) Slay the Princess ran 3 of 3 runs of 150 s without the abort, where it aborted in 3 of 4 earlier runs without it (details and caveats on #1359: no same-day control run on identical `main`, so not proven). If that holds, the index bytes are read before an earlier copied writeback or completion has landed. AI-assisted (Claude Code).
xXPBSXx commented 2026-10-12 12:32:44 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by xXPBSXx on 2026-10-12T12:32:44Z.


Correction to my comment above about #1359: the control run (plain main ffa198407, same title, 3 x 150 s) did not abort either, so the 0-of-3 with #1359 is no evidence for it. The abort was seen only on an older tree (main e7c70a2df + #4408 + #3840 + my diagnostic prints); on main ffa198407 it does not reproduce in 3 runs. Whether a change on main between the two fixed it, or the diagnostic prints or chance hid it, I do not know.

AI-assisted (Claude Code).

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6124331176 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/4369#issuecomment-6124331176). Originally posted by [xXPBSXx](https://github.com/xXPBSXx) on 2026-10-12T12:32:44Z. --- Correction to my comment above about #1359: the control run (plain `main` ffa198407, same title, 3 x 150 s) did not abort either, so the 0-of-3 with #1359 is no evidence for it. The abort was seen only on an older tree (`main` e7c70a2df + #4408 + #3840 + my diagnostic prints); on `main` ffa198407 it does not reproduce in 3 runs. Whether a change on `main` between the two fixed it, or the diagnostic prints or chance hid it, I do not know. AI-assisted (Claude Code).
oneandonlydean commented 2026-10-13 02:09:02 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-13T02:09:02Z.


Per your control run this does not reproduce on main ffa198407. If three more runs on current main are clean, please close it; reopen with the index bytes of the failing draw if it comes back.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6136640712 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/4369#issuecomment-6136640712). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-13T02:09:02Z. --- Per your control run this does not reproduce on main `ffa198407`. If three more runs on current main are clean, please close it; reopen with the index bytes of the failing draw if it comes back.
santhoshkumar-dev commented 2026-10-13 08:50:27 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by santhoshkumar-dev on 2026-10-13T08:50:27Z.


@xXPBSXx following up on your Slay the Princess results: have you been able to complete the three additional 150-second runs on current main requested above?

Could you share the exact main commit, any additional patches or diagnostic prints, and whether the original alias error returned? If it reproduces, the failing draw's index bytes and vertex/target ranges would help confirm whether it is still the same intermittent index-data problem.

#4408 is now ready for review at 44623222c. Its copied/imported regressions pass, and both fail when only main's Draw.cpp is restored, confirming the separate skipped-prefix false positive. Your earlier firstVertex-0 draw with 0xff000000 indices does not match that case, so we are not claiming this PR fixes #4369.

Does that distinction still match your latest findings, or have you found a draw where the skipped prefix is involved? If the additional main runs are clean, please update this issue with the results as the maintainer requested.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6141885202 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/4369#issuecomment-6141885202). Originally posted by [santhoshkumar-dev](https://github.com/santhoshkumar-dev) on 2026-10-13T08:50:27Z. --- @xXPBSXx following up on your Slay the Princess results: have you been able to complete the three additional 150-second runs on current `main` requested above? Could you share the exact main commit, any additional patches or diagnostic prints, and whether the original alias error returned? If it reproduces, the failing draw's index bytes and vertex/target ranges would help confirm whether it is still the same intermittent index-data problem. #4408 is now ready for review at `44623222c`. Its copied/imported regressions pass, and both fail when only main's Draw.cpp is restored, confirming the separate skipped-prefix false positive. Your earlier firstVertex-0 draw with `0xff000000` indices does not match that case, so we are not claiming this PR fixes #4369. Does that distinction still match your latest findings, or have you found a draw where the skipped prefix is involved? If the additional main runs are clean, please update this issue with the results as the maintainer requested.
xXPBSXx commented 2026-10-14 10:53:13 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by xXPBSXx on 2026-10-14T10:53:13Z.


Three clean runs on current main, as requested.

  • main: 43349d4337543eca207772b065f10ab19acc24c9 (fetched 2026-10-14 11:23 local). No local patches or prints: the worktree was detached at that commit with git status --porcelain empty.
  • Build: libs target plus the relinker from that same commit (Release, 128 prx); the title ELF was relinked with that relinker (relink_title.ps1 ... -ModuleDir @() -Suffix J, exit 0).
  • Slay the Princess (PPSA24423), Windows, three 150 s runs back to back (no #4408 or other local branch merged):
    • run 1: 11:33:23-11:35:56, run_113324.err, 489 lines
    • run 2: 11:35:56-11:48:31 (includes about 10 min waiting for my game lock before the title started), run_113558.err, 486 lines
    • run 3: 12:46:31-12:49:06, run_124632.err, 486 lines
      In all three the log has 0 occurrences of vertex buffer aliases, 0 what() and 0 FATAL. An earlier 300 s run on e46c69505 (run_105149.err) also ended without a stop.

So the alias error did not return in 3 of 3 runs here; I cannot say what changed it. Regarding #4408: I have not found a draw in which a skipped prefix is involved, and I did not test #4408 on this title, so I make no claim about it either way.

AI-assisted (Claude Code).

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6166715203 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/4369#issuecomment-6166715203). Originally posted by [xXPBSXx](https://github.com/xXPBSXx) on 2026-10-14T10:53:13Z. --- Three clean runs on current main, as requested. - main: `43349d4337543eca207772b065f10ab19acc24c9` (fetched 2026-10-14 11:23 local). **No local patches or prints**: the worktree was detached at that commit with `git status --porcelain` empty. - Build: `libs` target plus the relinker from that same commit (Release, 128 prx); the title ELF was relinked with that relinker (`relink_title.ps1 ... -ModuleDir @() -Suffix J`, exit 0). - Slay the Princess (PPSA24423), Windows, three 150 s runs back to back (no #4408 or other local branch merged): - run 1: 11:33:23-11:35:56, `run_113324.err`, 489 lines - run 2: 11:35:56-11:48:31 (includes about 10 min waiting for my game lock before the title started), `run_113558.err`, 486 lines - run 3: 12:46:31-12:49:06, `run_124632.err`, 486 lines In all three the log has 0 occurrences of `vertex buffer aliases`, 0 `what()` and 0 `FATAL`. An earlier 300 s run on `e46c69505` (`run_105149.err`) also ended without a stop. So the alias error did not return in 3 of 3 runs here; I cannot say what changed it. Regarding #4408: I have not found a draw in which a skipped prefix is involved, and I did not test #4408 on this title, so I make no claim about it either way. AI-assisted (Claude Code).
xXPBSXx commented 2026-10-14 10:53:15 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by xXPBSXx on 2026-10-14T10:53:15Z.


Closing as suggested above: three clean runs on current main (see previous comment); I will reopen with the index bytes of the failing draw if it comes back.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6166715660 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/4369#issuecomment-6166715660). Originally posted by [xXPBSXx](https://github.com/xXPBSXx) on 2026-10-14T10:53:15Z. --- Closing as suggested above: three clean runs on current main (see previous comment); I will reopen with the index bytes of the failing draw if it comes back.
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#4369
No description provided.