agc: with APS5_ASYNC_DRAW_COMPILE a dispatch whose shader is prepared in the background is dropped silently; vkQuake loses BLAS builds and every refit faults #25225

Closed
opened 2026-11-21 19:39:10 +00:00 by Ketz7 · 0 comments
Ketz7 commented 2026-11-21 19:39:10 +00:00 (Migrated from github.com)
Contributor

Imported from boykopovar/AnyPS5. Originally posted by Ketz7 on 2026-11-21T19:39:10Z.


What happens

With APS5_ASYNC_DRAW_COMPILE set, a compute dispatch whose shader is still being prepared or specialized on the library prebuild pool is dropped without any log line: Dispatch.cpp catches DrawCompilePending and returns (from a9259f8865). A dropped draw costs one frame, but a dropped compute dispatch loses data the guest keeps using.

vkQuake (PPSA99010) builds each animated model's BLAS once at level load. When the encode pass of a BLAS is one of the dropped dispatches, the structure never gets its header (bvh_offset) or its root parent link (0xffffffff, written by RADV's encode.comp). Every refit of that BLAS afterwards (0x20c61cb00) walks up to the root, reads a parent link of 0 instead of the invalid marker, computes a wrapped parent_index, and does its atomicAdd on internal_ready_count 128 MiB past the buffer. That gives a steady stream of BDA access failed ... instruction=0xf60 bytes=4 reason=1 (about 5,000 a minute), and each failing refit's write-back is discarded.

This happens even with every pipeline cached. The background preparation still runs once per shader per session, and the first dispatches of each shader at level load are the ones that get dropped.

Title, test or build step

PPSA99010 (vkQuake homebrew), demo playback, APS5_ASYNC_DRAW_COMPILE=1

AnyPS5 commit

0e001115a9 (main); also seen on 1122de2b35 and on branches built from 9dcf983

System

Windows 11 Pro 10.0.26300, AMD Radeon RX 7900 XT, AMD proprietary driver 26.10.1 (32.0.32015.7029)

Host report

n/a

Steps to reproduce

  1. Run PPSA99010 long enough for every compute pipeline to be built and cached (one run of about 300 s).
  2. Run it again for 120 s with APS5_ASYNC_DRAW_COMPILE=1.
  3. Count instruction=0xf60 in stderr.

Log

[gpu] deferred write-back failed: BDA access failed: address=0x4017c01454 instruction=0xf60 bytes=4 stage=4 reason=1

What was checked

  • Warm 120 s runs (0 pipeline skips) on main: 8,155 faults at pc 0xf60. The same run without APS5_ASYNC_DRAW_COMPILE: 0 faults.
  • A trace of the BVH dispatches: 3 of 32 encode dispatches (and 3 leaf and 4 refit dispatches) were never recorded. Those 3 BLASes are the only ones that fault, and their header bvh_offset reads 0 at every refit. Every BLAS whose encode was recorded has root parent 0xffffffff and never faults.
  • Every fault address matches the address predicted for a parent link of 0: ready_count + 4 * (((0 - first_internal) >> 7) + 1).
  • Switching off the dispatch cache, data hits, copy/fill HLE, write evidence, known values or validation skipping changes nothing. The count is the same with the old note_bda_write tracking and with the write bitmap of #22944.
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:6533505886 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/25225). Originally posted by [Ketz7](https://github.com/Ketz7) on 2026-11-21T19:39:10Z. --- ### What happens With `APS5_ASYNC_DRAW_COMPILE` set, a compute dispatch whose shader is still being prepared or specialized on the library prebuild pool is dropped without any log line: `Dispatch.cpp` catches `DrawCompilePending` and returns (from a9259f8865). A dropped draw costs one frame, but a dropped compute dispatch loses data the guest keeps using. vkQuake (PPSA99010) builds each animated model's BLAS once at level load. When the encode pass of a BLAS is one of the dropped dispatches, the structure never gets its header (`bvh_offset`) or its root parent link (`0xffffffff`, written by RADV's `encode.comp`). Every refit of that BLAS afterwards (`0x20c61cb00`) walks up to the root, reads a parent link of 0 instead of the invalid marker, computes a wrapped `parent_index`, and does its `atomicAdd` on `internal_ready_count` 128 MiB past the buffer. That gives a steady stream of `BDA access failed ... instruction=0xf60 bytes=4 reason=1` (about 5,000 a minute), and each failing refit's write-back is discarded. This happens even with every pipeline cached. The background preparation still runs once per shader per session, and the first dispatches of each shader at level load are the ones that get dropped. ### Title, test or build step PPSA99010 (vkQuake homebrew), demo playback, `APS5_ASYNC_DRAW_COMPILE=1` ### AnyPS5 commit 0e001115a9 (main); also seen on 1122de2b35 and on branches built from 9dcf983 ### System Windows 11 Pro 10.0.26300, AMD Radeon RX 7900 XT, AMD proprietary driver 26.10.1 (32.0.32015.7029) ### Host report n/a ### Steps to reproduce 1. Run PPSA99010 long enough for every compute pipeline to be built and cached (one run of about 300 s). 2. Run it again for 120 s with `APS5_ASYNC_DRAW_COMPILE=1`. 3. Count `instruction=0xf60` in stderr. ### Log ``` [gpu] deferred write-back failed: BDA access failed: address=0x4017c01454 instruction=0xf60 bytes=4 stage=4 reason=1 ``` ### What was checked - Warm 120 s runs (0 pipeline skips) on main: 8,155 faults at pc 0xf60. The same run without `APS5_ASYNC_DRAW_COMPILE`: 0 faults. - A trace of the BVH dispatches: 3 of 32 encode dispatches (and 3 leaf and 4 refit dispatches) were never recorded. Those 3 BLASes are the only ones that fault, and their header `bvh_offset` reads 0 at every refit. Every BLAS whose encode was recorded has root parent `0xffffffff` and never faults. - Every fault address matches the address predicted for a parent link of 0: `ready_count + 4 * (((0 - first_internal) >> 7) + 1)`. - Switching off the dispatch cache, data hits, copy/fill HLE, write evidence, known values or validation skipping changes nothing. The count is the same with the old `note_bda_write` tracking and with the write bitmap of #22944.
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#25225
No description provided.