agc-driver: write-back drops GPU results of full 64 KiB blocks of 1920x1080 render targets (PPSA12544 backgrounds garbled) #1970

Closed
opened 2026-10-09 03:26:09 +00:00 by lubaxe · 6 comments
lubaxe commented 2026-10-09 03:26:09 +00:00 (Migrated from github.com)
Contributor

Imported from boykopovar/AnyPS5. Originally posted by lubaxe on 2026-10-09T03:26:09Z.


Summary

On Windows with an RTX 5090, PPSA12544 (Hollow Knight: Silksong) reaches gameplay in tut_01, but its background layers render as colored noise. The HUD and prompts draw correctly. With APS5_EAGER_WRITEBACK=1 the scene renders correctly at the same frame rate (about 5 fps).

The log repeats storage image ...: guest memory changed while GPU results were pending; keeping the CPU's blocks for three 1920x1080 render targets. Unlike #865 (now limited to the partial 64 KiB edge blocks of the glyph atlas), these images start 64 KiB aligned. The blocks kept for the CPU are interior blocks, which the full-block rule in StorageTexture::Refresh (droppable) drops whole. #1918 does not change this.

Setup

  • Windows 11 Pro, Ryzen 7 9800X3D, RTX 5090 (driver 617.42), WinLibs GCC 15.2.0 r7, Release.
  • main f1451396 with #846 and #425, plus two fixes needed to reach gameplay: #1968 and #1969. The registered type-4 shader that #1836 defers was handled by an equivalent local change.
  • Relinked with --windows --module-dir Media/Plugins.

Results

Each run was played (or left to play the intro) into tut_01.

Write-back Other switches Result
lazy none backgrounds garbled, about 5 fps, no crash
eager APS5_NO_TEXTURE_CACHE plus 9 other cache and recipe switches correct, 0.9 fps
eager APS5_NO_TEXTURE_CACHE, APS5_NO_SAMPLED_FROM_STORAGE, APS5_NO_RESIDENT_TARGETS, APS5_NO_TEXTURE_HASH correct, 0.9 fps
eager none correct, about 5 fps
lazy, with #1918 none crash while tut_01 loads (see below)
lazy, with #1918 trace switches, no input crash in tut_01 (see below)
lazy, local switch that never drops full blocks none crash in opening_sequence: [videoout] presentation failed: AGC driver: null or misaligned address

Trace

APS5_TRACE_FLUSH=1 APS5_TRACE_DCC_KEYS=1 APS5_TRACE_UPLOAD=1, for one of the three images (the other two, 0x217de0000 and 0x218650000, show the same pattern):

[dcc-keys] uncompressed store by first write (?) for surface 0x217570000+0x870000: keys 0x211539000+0xc000 (packet 0x27 queue 0x0)
[upload] 0x217570000+0x870000 1920x1080 mips 1: guest memory changed (keys uncompressed -> uncompressed, originalValid 0, dirty 1)
[gpu] storage image 0x217570000: guest memory changed while GPU results were pending; keeping the CPU's blocks
[dcc-keys] uncompressed store by block write-back (refresh) for surface 0x217570000+0x870000: keys 0x211539000+0xc000 (packet 0xfffffffe queue 0xffffffff)
[upload] 0x217570000+0x870000 1920x1080 mips 1: guest memory changed (keys uncompressed -> uncompressed, originalValid 0, dirty 0)
[upload] 0x217570000+0x870000 1920x1080 mips 1: guest memory changed (keys uncompressed -> uncompressed, originalValid 0, dirty 1)
[gpu] storage image 0x217570000: guest memory changed while GPU results were pending; keeping the CPU's blocks
  • All three images are format 56, tile 7, 0x870000 bytes, with uncompressed DCC keys. The keys never change, so this is not the fast-clear case #903 fixed.
  • originalValid is 0, so there is no baseline to compare the CPU's bytes against, unlike the 1 MiB limit #1599 uses.

Not established

  • Whether the CPU actually changes those bytes. Forcing the GPU results for full blocks crashed at the first flip of the opening sequence. So at least some of the stamped ranges hold real CPU data, possibly memory the title reused. A byte comparison like #1599 or #1918, extended to full blocks, looks like the next step, but an 8.4 MiB baseline per render target may be too costly per frame.

  • Whether the crash is related. With lazy write-back the title crashed 3 times while tut_01 loaded or ran:

    • Background Job.Worker 2 at +0x1a5771d, a write to 0x18. This happened twice, once on an older main (084aeeb6).
    • UnityGfxDeviceWorker at +0x1a57ad7, a read.

    It never crashed with eager write-back. The one lazy run without #1918 reached gameplay without crashing. That is a correlation, not a confirmed cause.

(Investigated with AI assistance: Claude Code. The runs were on my machine.)

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5772295856 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/1970). Originally posted by [lubaxe](https://github.com/lubaxe) on 2026-10-09T03:26:09Z. --- ### Summary On Windows with an RTX 5090, PPSA12544 (Hollow Knight: Silksong) reaches gameplay in `tut_01`, but its background layers render as colored noise. The HUD and prompts draw correctly. With `APS5_EAGER_WRITEBACK=1` the scene renders correctly at the same frame rate (about 5 fps). The log repeats `storage image ...: guest memory changed while GPU results were pending; keeping the CPU's blocks` for three 1920x1080 render targets. Unlike #865 (now limited to the partial 64 KiB edge blocks of the glyph atlas), these images start 64 KiB aligned. The blocks kept for the CPU are interior blocks, which the full-block rule in `StorageTexture::Refresh` (`droppable`) drops whole. #1918 does not change this. ### Setup - Windows 11 Pro, Ryzen 7 9800X3D, RTX 5090 (driver 617.42), WinLibs GCC 15.2.0 r7, Release. - `main` f1451396 with #846 and #425, plus two fixes needed to reach gameplay: #1968 and #1969. The registered type-4 shader that #1836 defers was handled by an equivalent local change. - Relinked with `--windows --module-dir Media/Plugins`. ### Results Each run was played (or left to play the intro) into `tut_01`. | Write-back | Other switches | Result | |---|---|---| | lazy | none | backgrounds garbled, about 5 fps, no crash | | eager | `APS5_NO_TEXTURE_CACHE` plus 9 other cache and recipe switches | correct, 0.9 fps | | eager | `APS5_NO_TEXTURE_CACHE`, `APS5_NO_SAMPLED_FROM_STORAGE`, `APS5_NO_RESIDENT_TARGETS`, `APS5_NO_TEXTURE_HASH` | correct, 0.9 fps | | eager | none | **correct, about 5 fps** | | lazy, with #1918 | none | crash while `tut_01` loads (see below) | | lazy, with #1918 | trace switches, no input | crash in `tut_01` (see below) | | lazy, local switch that never drops full blocks | none | crash in `opening_sequence`: `[videoout] presentation failed: AGC driver: null or misaligned address` | ### Trace `APS5_TRACE_FLUSH=1 APS5_TRACE_DCC_KEYS=1 APS5_TRACE_UPLOAD=1`, for one of the three images (the other two, `0x217de0000` and `0x218650000`, show the same pattern): ``` [dcc-keys] uncompressed store by first write (?) for surface 0x217570000+0x870000: keys 0x211539000+0xc000 (packet 0x27 queue 0x0) [upload] 0x217570000+0x870000 1920x1080 mips 1: guest memory changed (keys uncompressed -> uncompressed, originalValid 0, dirty 1) [gpu] storage image 0x217570000: guest memory changed while GPU results were pending; keeping the CPU's blocks [dcc-keys] uncompressed store by block write-back (refresh) for surface 0x217570000+0x870000: keys 0x211539000+0xc000 (packet 0xfffffffe queue 0xffffffff) [upload] 0x217570000+0x870000 1920x1080 mips 1: guest memory changed (keys uncompressed -> uncompressed, originalValid 0, dirty 0) [upload] 0x217570000+0x870000 1920x1080 mips 1: guest memory changed (keys uncompressed -> uncompressed, originalValid 0, dirty 1) [gpu] storage image 0x217570000: guest memory changed while GPU results were pending; keeping the CPU's blocks ``` - All three images are format 56, tile 7, 0x870000 bytes, with uncompressed DCC keys. The keys never change, so this is not the fast-clear case #903 fixed. - `originalValid` is 0, so there is no baseline to compare the CPU's bytes against, unlike the 1 MiB limit #1599 uses. ### Not established - **Whether the CPU actually changes those bytes.** Forcing the GPU results for full blocks crashed at the first flip of the opening sequence. So at least some of the stamped ranges hold real CPU data, possibly memory the title reused. A byte comparison like #1599 or #1918, extended to full blocks, looks like the next step, but an 8.4 MiB baseline per render target may be too costly per frame. - **Whether the crash is related.** With lazy write-back the title crashed 3 times while `tut_01` loaded or ran: - `Background Job.Worker 2` at `+0x1a5771d`, a write to `0x18`. This happened twice, once on an older `main` (084aeeb6). - `UnityGfxDeviceWorker` at `+0x1a57ad7`, a read. It never crashed with eager write-back. The one lazy run without #1918 reached gameplay without crashing. That is a correlation, not a confirmed cause. (Investigated with AI assistance: Claude Code. The runs were on my machine.)
MarcZX10 commented 2026-10-09 04:20:12 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-09T04:20:12Z.


Two follow-up approaches are now open: #1995 proposes an opt-in writeback of all pending storage images at each flip; #1997 extends #1918’s byte-baseline merge to full 64 KiB blocks. #1994 separately adds an opt-in Windows import-watch mode and was enabled in #1995’s reported successful Silksong run. I asked #1995 for an ablation of the two flags, since the reported good run used both. #1997 explicitly leaves native CI, exact Silksong reproduction, Windows GPU validation and performance measurements pending. Neither approach is validated by upstream CI yet, so the issue remains unresolved pending those results and maintainer choice.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6074186100 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/1970#issuecomment-6074186100). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-09T04:20:12Z. --- Two follow-up approaches are now open: #1995 proposes an opt-in writeback of all pending storage images at each flip; #1997 extends #1918’s byte-baseline merge to full 64 KiB blocks. #1994 separately adds an opt-in Windows import-watch mode and was enabled in #1995’s reported successful Silksong run. I asked #1995 for an ablation of the two flags, since the reported good run used both. #1997 explicitly leaves native CI, exact Silksong reproduction, Windows GPU validation and performance measurements pending. Neither approach is validated by upstream CI yet, so the issue remains unresolved pending those results and maintainer choice.
MarcZX10 commented 2026-10-09 04:40:12 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-09T04:40:12Z.


Update after #1995 supplied the requested four-way Silksong run matrix (Windows 11, RTX 5090, same build/stack, each allowed up to 180 s): APS5_STORE_AT_FLIP=1 alone rendered tut_01 correctly for 180 s at 56 presents/10 s; APS5_WRITE_WATCH_IMPORTS=watch alone reached 600 presents/10 s but crashed at 55 s while loading tut_01; both together rendered correctly for 180 s at 600 presents/10 s. The no-switch run crashed at 23 s in this matrix, and frame dumps may change timing. This substantially strengthens #1995 as a tested workaround for the reported corruption and shows #1994 is not safe alone. It is still author-reported hardware evidence, not upstream validation. #1997 remains a separate full-block merge candidate; its Linux/Windows CTest is still running, and its description says the exact Silksong reproduction and performance validation remain pending. I am keeping the issue open until the candidates have CI and maintainers choose a path.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6074389219 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/1970#issuecomment-6074389219). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-09T04:40:12Z. --- Update after #1995 supplied the requested four-way Silksong run matrix (Windows 11, RTX 5090, same build/stack, each allowed up to 180 s): `APS5_STORE_AT_FLIP=1` alone rendered `tut_01` correctly for 180 s at 56 presents/10 s; `APS5_WRITE_WATCH_IMPORTS=watch` alone reached 600 presents/10 s but crashed at 55 s while loading `tut_01`; both together rendered correctly for 180 s at 600 presents/10 s. The no-switch run crashed at 23 s in this matrix, and frame dumps may change timing. This substantially strengthens #1995 as a tested workaround for the reported corruption and shows #1994 is not safe alone. It is still author-reported hardware evidence, not upstream validation. #1997 remains a separate full-block merge candidate; its Linux/Windows CTest is still running, and its description says the exact Silksong reproduction and performance validation remain pending. I am keeping the issue open until the candidates have CI and maintainers choose a path.
MarcZX10 commented 2026-10-09 04:43:04 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-09T04:43:04Z.


Another status update: #1997 now has successful native Linux and Windows Build/CTest runs on its current head (including the additional conventions run). Its author has explicitly withdrawn the full-block merge as a proposed fix for this issue: the new allocator-reuse evidence shows the byte baseline cannot prove that memory still belongs to the image. The PR remains a draft/reference branch, and the exact Silksong reproduction plus performance testing remain unverified there. #1995 has the four-way hardware matrix but still has no upstream checks. The issue therefore has a strong tested runtime workaround candidate, but no merged or maintainer-selected resolution yet.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6074418594 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/1970#issuecomment-6074418594). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-09T04:43:04Z. --- Another status update: #1997 now has successful native Linux and Windows Build/CTest runs on its current head (including the additional conventions run). Its author has explicitly withdrawn the full-block merge as a proposed fix for this issue: the new allocator-reuse evidence shows the byte baseline cannot prove that memory still belongs to the image. The PR remains a draft/reference branch, and the exact Silksong reproduction plus performance testing remain unverified there. #1995 has the four-way hardware matrix but still has no upstream checks. The issue therefore has a strong tested runtime workaround candidate, but no merged or maintainer-selected resolution yet.
orbz22 commented 2026-10-10 06:56:21 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by orbz22 on 2026-10-10T06:56:21Z.


A data point from a newer main, on Windows with NVIDIA: tut_01 renders correctly for me with the default (lazy) write-back and no extra switches.

  • Build: main d70b8998 + #1836 + #1968 + #1969 + #846 (+ #1599 in the later runs), relinked with --windows --module-dir Media/Plugins.
    • No APS5_STORE_AT_FLIP, no APS5_WRITE_WATCH_IMPORTS, no APS5_EAGER_WRITEBACK.
  • Result: in several runs into tut_01 (Moss Grotto) the background layers are intact.
    • I checked frames dumped with APS5_DUMP_FRAMES every 300 presents, plus window captures. There is no colored noise, and the HUD and Hornet draw normally.
    • It runs at 43-60 FPS (window title counter).
    • It looked the same before and after #1599 was added.
    • I played the start of the game and the first fights on this build without seeing garbled backgrounds.
  • The warning still prints: guest memory changed while GPU results were pending; keeping the CPU's blocks appears 8 times in a 150 s run into tut_01. It names storage images at 0x260371000, 0x2603e0000, 0x262090000, 0x2629d0000 and 0x263310000; the last four are 64 KiB aligned. So the kept blocks still occur, but they did not show up as visible damage in these scenes here.

This is not a bisect, so I can't say which change between f1451396 and d70b8998 matters, or whether timing on this machine just avoids it.

Windows 11, RTX 3060 Laptop (NVIDIA 616.92), WinLibs GCC 15.2.

🤖 Generated with Claude Code

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6094872564 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/1970#issuecomment-6094872564). Originally posted by [orbz22](https://github.com/orbz22) on 2026-10-10T06:56:21Z. --- A data point from a newer `main`, on Windows with NVIDIA: `tut_01` renders correctly for me with the default (lazy) write-back and no extra switches. - **Build:** `main` d70b8998 + #1836 + #1968 + #1969 + #846 (+ #1599 in the later runs), relinked with `--windows --module-dir Media/Plugins`. - No `APS5_STORE_AT_FLIP`, no `APS5_WRITE_WATCH_IMPORTS`, no `APS5_EAGER_WRITEBACK`. - **Result:** in several runs into `tut_01` (Moss Grotto) the background layers are intact. - I checked frames dumped with `APS5_DUMP_FRAMES` every 300 presents, plus window captures. There is no colored noise, and the HUD and Hornet draw normally. - It runs at 43-60 FPS (window title counter). - It looked the same before and after #1599 was added. - I played the start of the game and the first fights on this build without seeing garbled backgrounds. - **The warning still prints:** `guest memory changed while GPU results were pending; keeping the CPU's blocks` appears 8 times in a 150 s run into `tut_01`. It names storage images at 0x260371000, 0x2603e0000, 0x262090000, 0x2629d0000 and 0x263310000; the last four are 64 KiB aligned. So the kept blocks still occur, but they did not show up as visible damage in these scenes here. This is not a bisect, so I can't say which change between f1451396 and d70b8998 matters, or whether timing on this machine just avoids it. Windows 11, RTX 3060 Laptop (NVIDIA 616.92), WinLibs GCC 15.2. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
oneandonlydean commented 2026-10-10 09:28:38 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-10T09:28:38Z.


#1995 is merged as the opt-in APS5_STORE_AT_FLIP=1, and orbz22 sees no garbled backgrounds with the default write-back on a newer main. Does tut_01 still garble for you on current main without switches?

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6096127063 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/1970#issuecomment-6096127063). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-10T09:28:38Z. --- #1995 is merged as the opt-in `APS5_STORE_AT_FLIP=1`, and orbz22 sees no garbled backgrounds with the default write-back on a newer main. Does `tut_01` still garble for you on current main without switches?
oneandonlydean commented 2026-10-13 02:08:34 +00:00 (Migrated from github.com)
Author
Contributor

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


Closing: no answer since 10-10 on whether tut_01 still garbles on current main without switches; orbz22 sees it intact. Reopen with a frame from current main if it does.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6136630278 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/1970#issuecomment-6136630278). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-13T02:08:34Z. --- Closing: no answer since 10-10 on whether `tut_01` still garbles on current main without switches; orbz22 sees it intact. Reopen with a frame from current main if it does.
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#1970
No description provided.