AGC: native multisample depth publication fails "cannot re-import the guest's undecided byte" when the guest has rewritten the whole HTILE (Blue Prince, Windows) #28664

Closed
opened 2026-12-02 17:03:05 +00:00 by JJenkx · 0 comments
JJenkx commented 2026-12-02 17:03:05 +00:00 (Migrated from github.com)
Contributor

Imported from boykopovar/AnyPS5. Originally posted by JJenkx on 2026-12-02T17:03:05Z.


Summary

On main 7d3d015fee, Blue Prince (PPSA25009) on Windows often stops with:

terminate called after throwing an instance of 'std::runtime_error'
  what():  AGC graphics: native multisample depth publication cannot re-import the guest's undecided byte

In 6 of the last 13 entrance-hall runs it was the stop (62 to 82 s in). A one-line diagnostic just before the Require shows the same shape each time. The surface is a 1920x1080, 4-sample D32_SFLOAT_S8_UINT target with depth-only HTILE, and the publication runs for a guest Access. Only the HTILE plane took guest bytes. Every HTILE word fails htileProvesClear, so the htile branch of the re-import check cannot accept it.

Where

DepthSurface::PublishToGuest, DepthSurface.cpp:3713-3718 at 7d3d015fee, unchanged on current main fc294cbbb5:

bool importable = true;
if (uniformPlaneTarget(target)) importable = uniformWord(0u) && uniformByte(1u);
else if (bareDepthTarget(target)) importable = bareImportable();
else if (target.htileAddress != 0u) importable = htileProven() && (!separateStencil || ...);
else importable = false;
Require(importable, "native multisample depth publication cannot re-import the guest's undecided byte");

This block runs when a byte stayed ambiguous for a DepthReadCause::Access or Write (ambiguous) and at least one plane took guest bytes (tookGuest). For an HTILE target, htileProven requires every word to pass htileProvesClear, which rejects any word whose low nibble is 0xF and otherwise accepts only the two clear encodings.

What the diagnostic printed

The diagnostic prints only when importable is false. It reports the cause, the branch taken, the target, tookGuest per plane, and how many HTILE words fail htileProvesClear, with the first failing word:

[diag-reimport] cause 0 branch htile, extent 1920x1080, samples 4, format 130, depth 0x23c0d0000, htile 0x236de8000 depthOnly 1 stencilInHtile 0, tookGuest 0/1/0, planes 3, htile words not proving clear 49152 (first 0xfffc000f), clearDepth 0
[diag-reimport] cause 0 branch htile, extent 1920x1080, samples 4, format 130, depth 0x23c390000, htile 0x2370a8000 depthOnly 1 stencilInHtile 0, tookGuest 0/1/0, planes 3, htile words not proving clear 49152 (first 0xff452cd0), clearDepth 0

These are two runs, with one line each, and the abort follows straight after. 49152 words is the whole 0x30000 HTILE. In the first run the first word has low nibble 0xF. In the second it is 0xff452cd0, which is neither clear encoding. The depth and stencil planes kept the host result (tookGuest 0 for planes 0 and 2).

So by the time of this guest access, the guest has rewritten the whole HTILE of this surface with words that do not describe a clear, while the depth plane bytes are still ours. The current check has no case for that combination.

Not known

  • What writes that HTILE. My fill logs on the same title show only pattern 0 DMA fills on these HTILE ranges, so it is not a fill the driver sees through NoteDepthMetadataFill. It may be a shader or copy write.
  • Whether Linux sees the same stop on this title. Everything above is Windows (RX 6700 XT, MinGW-w64 GCC 15.2 UCRT r7, Release).

The diagnostic patch and all run logs are on disk if a different field would help.

AI-assisted: yes

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:6750338571 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/28664). Originally posted by [JJenkx](https://github.com/JJenkx) on 2026-12-02T17:03:05Z. --- ### Summary On `main` `7d3d015fee`, Blue Prince (PPSA25009) on Windows often stops with: ``` terminate called after throwing an instance of 'std::runtime_error' what(): AGC graphics: native multisample depth publication cannot re-import the guest's undecided byte ``` In 6 of the last 13 entrance-hall runs it was the stop (62 to 82 s in). A one-line diagnostic just before the `Require` shows the same shape each time. The surface is a 1920x1080, 4-sample `D32_SFLOAT_S8_UINT` target with depth-only HTILE, and the publication runs for a guest `Access`. Only the HTILE plane took guest bytes. Every HTILE word fails `htileProvesClear`, so the `htile` branch of the re-import check cannot accept it. ### Where `DepthSurface::PublishToGuest`, `DepthSurface.cpp:3713-3718` at `7d3d015fee`, unchanged on current `main` `fc294cbbb5`: ```cpp bool importable = true; if (uniformPlaneTarget(target)) importable = uniformWord(0u) && uniformByte(1u); else if (bareDepthTarget(target)) importable = bareImportable(); else if (target.htileAddress != 0u) importable = htileProven() && (!separateStencil || ...); else importable = false; Require(importable, "native multisample depth publication cannot re-import the guest's undecided byte"); ``` This block runs when a byte stayed ambiguous for a `DepthReadCause::Access` or `Write` (`ambiguous`) and at least one plane took guest bytes (`tookGuest`). For an HTILE target, `htileProven` requires every word to pass `htileProvesClear`, which rejects any word whose low nibble is `0xF` and otherwise accepts only the two clear encodings. ### What the diagnostic printed The diagnostic prints only when `importable` is false. It reports the cause, the branch taken, the target, `tookGuest` per plane, and how many HTILE words fail `htileProvesClear`, with the first failing word: ``` [diag-reimport] cause 0 branch htile, extent 1920x1080, samples 4, format 130, depth 0x23c0d0000, htile 0x236de8000 depthOnly 1 stencilInHtile 0, tookGuest 0/1/0, planes 3, htile words not proving clear 49152 (first 0xfffc000f), clearDepth 0 [diag-reimport] cause 0 branch htile, extent 1920x1080, samples 4, format 130, depth 0x23c390000, htile 0x2370a8000 depthOnly 1 stencilInHtile 0, tookGuest 0/1/0, planes 3, htile words not proving clear 49152 (first 0xff452cd0), clearDepth 0 ``` These are two runs, with one line each, and the abort follows straight after. 49152 words is the whole `0x30000` HTILE. In the first run the first word has low nibble `0xF`. In the second it is `0xff452cd0`, which is neither clear encoding. The depth and stencil planes kept the host result (`tookGuest` 0 for planes 0 and 2). So by the time of this guest access, the guest has rewritten the whole HTILE of this surface with words that do not describe a clear, while the depth plane bytes are still ours. The current check has no case for that combination. ### Not known - What writes that HTILE. My fill logs on the same title show only pattern 0 DMA fills on these HTILE ranges, so it is not a fill the driver sees through `NoteDepthMetadataFill`. It may be a shader or copy write. - Whether Linux sees the same stop on this title. Everything above is Windows (RX 6700 XT, MinGW-w64 GCC 15.2 UCRT r7, Release). The diagnostic patch and all run logs are on disk if a different field would help. AI-assisted: yes
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#28664
No description provided.