fix(agc): overestimate single-sample draws with centroid inputs #6464

Merged
AymanFE merged 1 commit from upstream-pr/6464 into main 2026-10-19 01:02:02 +00:00
AymanFE commented 2026-10-15 16:23:41 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by AymanFE on 2026-10-15T16:23:41Z.


Requested by Ayman

What

ASTRO BOT (PPSA21564 01.007.000) stops in its first level, Sky Garden, a few minutes after the player starts walking. On current main it stops at:

[gpu] driver failure: AGC graphics: conservative rasterization with centroid interpolation is unsupported

followed by terminate called after throwing an instance of 'std::runtime_error' from the next sceAgcDcbSetFlip.

The draw sets PA_SC_CONSERVATIVE_RASTERIZATION_CNTL 0x6001 with SPI_PS_INPUT_ENA.PERSP_CENTROID or LINEAR_CENTROID, and decodeConservativeRasterization refused centroid inputs for every sample count. With PA_SC_AA_CONFIG.MSAA_NUM_SAMPLES 0 the one rasterized sample is the pixel centre, and the recompiler already gives the centroid pairs the pixel-centre barycentrics (docs/dev/debt/shader.md), so the draw now decodes to overestimation. More rasterized samples, and a single-sample draw raised to a multisampled color target, still throw, each with its own message. The inference is recorded in docs/dev/debt/libSceAgcDriver.md.

Tested

  • agc_driver_graphics_tests (Linux): ConservativeRasterizationTests now decodes centroid inputs at one rasterized sample and expects the two remaining throws. On main the test fails with AGC graphics: conservative rasterization with centroid interpolation is unsupported; with this change it passes.
  • ASTRO BOT 01.007.000 on Windows 11, NVIDIA GeForce RTX 5070 Ti, from the same save and route (Sky Garden, walking the first path): main (8856f180c) stopped with the line above 4.3 minutes into the walk; with this change (on 92e50418f) the walk went on for 9.2 minutes, past the first enemies onto the stone platforms, with no throw, assert or abort, until the window was closed (exit code 0).

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Unblocks: PPSA21564 (ASTRO BOT), first level
  • GPUs tested: GPU tests not run; the change is in state decoding, covered by the CPU-only agc_driver_graphics_tests. The game run above used an NVIDIA GeForce RTX 5070 Ti on Windows 11
  • AI-assisted: yes

🤖 Generated with Claude Code

https://claude.ai/code/session_01XJ3RTcWpqBBdVE8QRtKxJD

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4876443263 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6464). Originally posted by [AymanFE](https://github.com/AymanFE) on 2026-10-15T16:23:41Z. --- <!-- claude-projects-attribution: {"github_login":"AymanFE"} --> _Requested by **Ayman**_ ### What ASTRO BOT (PPSA21564 01.007.000) stops in its first level, Sky Garden, a few minutes after the player starts walking. On current `main` it stops at: ``` [gpu] driver failure: AGC graphics: conservative rasterization with centroid interpolation is unsupported ``` followed by `terminate called after throwing an instance of 'std::runtime_error'` from the next `sceAgcDcbSetFlip`. The draw sets `PA_SC_CONSERVATIVE_RASTERIZATION_CNTL` 0x6001 with `SPI_PS_INPUT_ENA.PERSP_CENTROID` or `LINEAR_CENTROID`, and `decodeConservativeRasterization` refused centroid inputs for every sample count. With `PA_SC_AA_CONFIG.MSAA_NUM_SAMPLES` 0 the one rasterized sample is the pixel centre, and the recompiler already gives the centroid pairs the pixel-centre barycentrics (docs/dev/debt/shader.md), so the draw now decodes to overestimation. More rasterized samples, and a single-sample draw raised to a multisampled color target, still throw, each with its own message. The inference is recorded in docs/dev/debt/libSceAgcDriver.md. ### Tested - `agc_driver_graphics_tests` (Linux): `ConservativeRasterizationTests` now decodes centroid inputs at one rasterized sample and expects the two remaining throws. On `main` the test fails with `AGC graphics: conservative rasterization with centroid interpolation is unsupported`; with this change it passes. - ASTRO BOT 01.007.000 on Windows 11, NVIDIA GeForce RTX 5070 Ti, from the same save and route (Sky Garden, walking the first path): `main` (8856f180c) stopped with the line above 4.3 minutes into the walk; with this change (on 92e50418f) the walk went on for 9.2 minutes, past the first enemies onto the stone platforms, with no throw, assert or abort, until the window was closed (exit code 0). ### Checklist - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except technical debt - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's technical debt file - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] Unblocks: PPSA21564 (ASTRO BOT), first level - [x] GPUs tested: GPU tests not run; the change is in state decoding, covered by the CPU-only `agc_driver_graphics_tests`. The game run above used an NVIDIA GeForce RTX 5070 Ti on Windows 11 - [x] AI-assisted: yes 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01XJ3RTcWpqBBdVE8QRtKxJD
github-actions[bot] commented 2026-10-15 16:37:21 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-15T16:37:21Z.


Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.

Pull request Shared files not compared
PR 1191 core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
PR 1395 core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 2434 docs/dev/debt/libSceAgcDriver.md
PR 4040 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 4448 docs/dev/debt/libSceAgcDriver.md
PR 5058 docs/dev/debt/libSceAgcDriver.md
PR 5372 docs/dev/debt/libSceAgcDriver.md
PR 5441 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 5499 core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
docs/dev/debt/libSceAgcDriver.md
PR 5500 core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 5925 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
docs/dev/debt/libSceAgcDriver.md
PR 6188 core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 6194 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
docs/dev/debt/libSceAgcDriver.md
PR 6223 docs/dev/debt/libSceAgcDriver.md
PR 6235 core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 6273 docs/dev/debt/libSceAgcDriver.md
PR 6280 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
docs/dev/debt/libSceAgcDriver.md
PR 6300 docs/dev/debt/libSceAgcDriver.md
PR 6312 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 6454 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 6457 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
docs/dev/debt/libSceAgcDriver.md
PR 6472 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
docs/dev/debt/libSceAgcDriver.md
PR 6479 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
docs/dev/debt/libSceAgcDriver.md
PR 6481 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
docs/dev/debt/libSceAgcDriver.md
PR 6498 docs/dev/debt/libSceAgcDriver.md
PR 6529 core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
docs/dev/debt/libSceAgcDriver.md
PR 6535 core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 6543 docs/dev/debt/libSceAgcDriver.md
PR 6548 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
docs/dev/debt/libSceAgcDriver.md
PR 6549 docs/dev/debt/libSceAgcDriver.md
PR 6563 core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
docs/dev/debt/libSceAgcDriver.md
PR 6612 core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
docs/dev/debt/libSceAgcDriver.md
PR 6730 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
docs/dev/debt/libSceAgcDriver.md
PR 6786 docs/dev/debt/libSceAgcDriver.md
PR 6808 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
docs/dev/debt/libSceAgcDriver.md
PR 6867 docs/dev/debt/libSceAgcDriver.md
PR 6868 docs/dev/debt/libSceAgcDriver.md
PR 6941 docs/dev/debt/libSceAgcDriver.md
PR 6946 docs/dev/debt/libSceAgcDriver.md
PR 6947 docs/dev/debt/libSceAgcDriver.md
PR 6970 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 6972 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 6977 core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
docs/dev/debt/libSceAgcDriver.md
PR 7008 docs/dev/debt/libSceAgcDriver.md
PR 7154 docs/dev/debt/libSceAgcDriver.md
PR 7250 docs/dev/debt/libSceAgcDriver.md
PR 7254 core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
docs/dev/debt/libSceAgcDriver.md
PR 7256 core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
docs/dev/debt/libSceAgcDriver.md
PR 7258 docs/dev/debt/libSceAgcDriver.md
PR 7390 docs/dev/debt/libSceAgcDriver.md
PR 7432 docs/dev/debt/libSceAgcDriver.md
PR 7505 docs/dev/debt/libSceAgcDriver.md
PR 7604 docs/dev/debt/libSceAgcDriver.md
PR 7642 docs/dev/debt/libSceAgcDriver.md
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6197193270 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6464#issuecomment-6197193270). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-15T16:37:21Z. --- <!-- pr-overlap --> Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap. | Pull request | Shared files not compared | |---|---| | [PR 1191](https://www.github.com/boykopovar/AnyPS5/pull/1191) | `core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp` | | [PR 1395](https://www.github.com/boykopovar/AnyPS5/pull/1395) | `core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp`<br>`core/libs/prx/libSceAgcDriver/tests/Graphics.cpp` | | [PR 2434](https://www.github.com/boykopovar/AnyPS5/pull/2434) | `docs/dev/debt/libSceAgcDriver.md` | | [PR 4040](https://www.github.com/boykopovar/AnyPS5/pull/4040) | `core/libs/prx/libSceAgcDriver/tests/Graphics.cpp` | | [PR 4448](https://www.github.com/boykopovar/AnyPS5/pull/4448) | `docs/dev/debt/libSceAgcDriver.md` | | [PR 5058](https://www.github.com/boykopovar/AnyPS5/pull/5058) | `docs/dev/debt/libSceAgcDriver.md` | | [PR 5372](https://www.github.com/boykopovar/AnyPS5/pull/5372) | `docs/dev/debt/libSceAgcDriver.md` | | [PR 5441](https://www.github.com/boykopovar/AnyPS5/pull/5441) | `core/libs/prx/libSceAgcDriver/tests/Graphics.cpp` | | [PR 5499](https://www.github.com/boykopovar/AnyPS5/pull/5499) | `core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp`<br>`core/libs/prx/libSceAgcDriver/tests/Graphics.cpp`<br>`docs/dev/debt/libSceAgcDriver.md` | | [PR 5500](https://www.github.com/boykopovar/AnyPS5/pull/5500) | `core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp`<br>`core/libs/prx/libSceAgcDriver/tests/Graphics.cpp` | | [PR 5925](https://www.github.com/boykopovar/AnyPS5/pull/5925) | `core/libs/prx/libSceAgcDriver/tests/Graphics.cpp`<br>`docs/dev/debt/libSceAgcDriver.md` | | [PR 6188](https://www.github.com/boykopovar/AnyPS5/pull/6188) | `core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp`<br>`core/libs/prx/libSceAgcDriver/tests/Graphics.cpp` | | [PR 6194](https://www.github.com/boykopovar/AnyPS5/pull/6194) | `core/libs/prx/libSceAgcDriver/tests/Graphics.cpp`<br>`docs/dev/debt/libSceAgcDriver.md` | | [PR 6223](https://www.github.com/boykopovar/AnyPS5/pull/6223) | `docs/dev/debt/libSceAgcDriver.md` | | [PR 6235](https://www.github.com/boykopovar/AnyPS5/pull/6235) | `core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp`<br>`core/libs/prx/libSceAgcDriver/tests/Graphics.cpp` | | [PR 6273](https://www.github.com/boykopovar/AnyPS5/pull/6273) | `docs/dev/debt/libSceAgcDriver.md` | | [PR 6280](https://www.github.com/boykopovar/AnyPS5/pull/6280) | `core/libs/prx/libSceAgcDriver/tests/Graphics.cpp`<br>`docs/dev/debt/libSceAgcDriver.md` | | [PR 6300](https://www.github.com/boykopovar/AnyPS5/pull/6300) | `docs/dev/debt/libSceAgcDriver.md` | | [PR 6312](https://www.github.com/boykopovar/AnyPS5/pull/6312) | `core/libs/prx/libSceAgcDriver/tests/Graphics.cpp` | | [PR 6454](https://www.github.com/boykopovar/AnyPS5/pull/6454) | `core/libs/prx/libSceAgcDriver/tests/Graphics.cpp` | | [PR 6457](https://www.github.com/boykopovar/AnyPS5/pull/6457) | `core/libs/prx/libSceAgcDriver/tests/Graphics.cpp`<br>`docs/dev/debt/libSceAgcDriver.md` | | [PR 6472](https://www.github.com/boykopovar/AnyPS5/pull/6472) | `core/libs/prx/libSceAgcDriver/tests/Graphics.cpp`<br>`docs/dev/debt/libSceAgcDriver.md` | | [PR 6479](https://www.github.com/boykopovar/AnyPS5/pull/6479) | `core/libs/prx/libSceAgcDriver/tests/Graphics.cpp`<br>`docs/dev/debt/libSceAgcDriver.md` | | [PR 6481](https://www.github.com/boykopovar/AnyPS5/pull/6481) | `core/libs/prx/libSceAgcDriver/tests/Graphics.cpp`<br>`docs/dev/debt/libSceAgcDriver.md` | | [PR 6498](https://www.github.com/boykopovar/AnyPS5/pull/6498) | `docs/dev/debt/libSceAgcDriver.md` | | [PR 6529](https://www.github.com/boykopovar/AnyPS5/pull/6529) | `core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp`<br>`core/libs/prx/libSceAgcDriver/tests/Graphics.cpp`<br>`docs/dev/debt/libSceAgcDriver.md` | | [PR 6535](https://www.github.com/boykopovar/AnyPS5/pull/6535) | `core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp`<br>`core/libs/prx/libSceAgcDriver/tests/Graphics.cpp` | | [PR 6543](https://www.github.com/boykopovar/AnyPS5/pull/6543) | `docs/dev/debt/libSceAgcDriver.md` | | [PR 6548](https://www.github.com/boykopovar/AnyPS5/pull/6548) | `core/libs/prx/libSceAgcDriver/tests/Graphics.cpp`<br>`docs/dev/debt/libSceAgcDriver.md` | | [PR 6549](https://www.github.com/boykopovar/AnyPS5/pull/6549) | `docs/dev/debt/libSceAgcDriver.md` | | [PR 6563](https://www.github.com/boykopovar/AnyPS5/pull/6563) | `core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp`<br>`core/libs/prx/libSceAgcDriver/tests/Graphics.cpp`<br>`docs/dev/debt/libSceAgcDriver.md` | | [PR 6612](https://www.github.com/boykopovar/AnyPS5/pull/6612) | `core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp`<br>`core/libs/prx/libSceAgcDriver/tests/Graphics.cpp`<br>`docs/dev/debt/libSceAgcDriver.md` | | [PR 6730](https://www.github.com/boykopovar/AnyPS5/pull/6730) | `core/libs/prx/libSceAgcDriver/tests/Graphics.cpp`<br>`docs/dev/debt/libSceAgcDriver.md` | | [PR 6786](https://www.github.com/boykopovar/AnyPS5/pull/6786) | `docs/dev/debt/libSceAgcDriver.md` | | [PR 6808](https://www.github.com/boykopovar/AnyPS5/pull/6808) | `core/libs/prx/libSceAgcDriver/tests/Graphics.cpp`<br>`docs/dev/debt/libSceAgcDriver.md` | | [PR 6867](https://www.github.com/boykopovar/AnyPS5/pull/6867) | `docs/dev/debt/libSceAgcDriver.md` | | [PR 6868](https://www.github.com/boykopovar/AnyPS5/pull/6868) | `docs/dev/debt/libSceAgcDriver.md` | | [PR 6941](https://www.github.com/boykopovar/AnyPS5/pull/6941) | `docs/dev/debt/libSceAgcDriver.md` | | [PR 6946](https://www.github.com/boykopovar/AnyPS5/pull/6946) | `docs/dev/debt/libSceAgcDriver.md` | | [PR 6947](https://www.github.com/boykopovar/AnyPS5/pull/6947) | `docs/dev/debt/libSceAgcDriver.md` | | [PR 6970](https://www.github.com/boykopovar/AnyPS5/pull/6970) | `core/libs/prx/libSceAgcDriver/tests/Graphics.cpp` | | [PR 6972](https://www.github.com/boykopovar/AnyPS5/pull/6972) | `core/libs/prx/libSceAgcDriver/tests/Graphics.cpp` | | [PR 6977](https://www.github.com/boykopovar/AnyPS5/pull/6977) | `core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp`<br>`docs/dev/debt/libSceAgcDriver.md` | | [PR 7008](https://www.github.com/boykopovar/AnyPS5/pull/7008) | `docs/dev/debt/libSceAgcDriver.md` | | [PR 7154](https://www.github.com/boykopovar/AnyPS5/pull/7154) | `docs/dev/debt/libSceAgcDriver.md` | | [PR 7250](https://www.github.com/boykopovar/AnyPS5/pull/7250) | `docs/dev/debt/libSceAgcDriver.md` | | [PR 7254](https://www.github.com/boykopovar/AnyPS5/pull/7254) | `core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp`<br>`core/libs/prx/libSceAgcDriver/tests/Graphics.cpp`<br>`docs/dev/debt/libSceAgcDriver.md` | | [PR 7256](https://www.github.com/boykopovar/AnyPS5/pull/7256) | `core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp`<br>`core/libs/prx/libSceAgcDriver/tests/Graphics.cpp`<br>`docs/dev/debt/libSceAgcDriver.md` | | [PR 7258](https://www.github.com/boykopovar/AnyPS5/pull/7258) | `docs/dev/debt/libSceAgcDriver.md` | | [PR 7390](https://www.github.com/boykopovar/AnyPS5/pull/7390) | `docs/dev/debt/libSceAgcDriver.md` | | [PR 7432](https://www.github.com/boykopovar/AnyPS5/pull/7432) | `docs/dev/debt/libSceAgcDriver.md` | | [PR 7505](https://www.github.com/boykopovar/AnyPS5/pull/7505) | `docs/dev/debt/libSceAgcDriver.md` | | [PR 7604](https://www.github.com/boykopovar/AnyPS5/pull/7604) | `docs/dev/debt/libSceAgcDriver.md` | | [PR 7642](https://www.github.com/boykopovar/AnyPS5/pull/7642) | `docs/dev/debt/libSceAgcDriver.md` |
mrfelek commented 2026-10-16 21:27:29 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by mrfelek on 2026-10-16T21:27:29Z.


Astro Bot (PPSA21564) on Linux (RTX 3080 Ti, NVIDIA 615.71.09): without this PR, Sky Garden stops after about 8 minutes on AGC graphics: conservative rasterization with centroid interpolation is unsupported. With this PR, 40 minutes in the same level with no stop (build main 44df21632 + #5390 + #5998 + #5997 + #6492 + #6465, merged with this head 76cc70c24).

AI-assisted: this comment was drafted with the help of Claude Code and checked against the logs by us.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6225028631 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6464#issuecomment-6225028631). Originally posted by [mrfelek](https://github.com/mrfelek) on 2026-10-16T21:27:29Z. --- Astro Bot (PPSA21564) on Linux (RTX 3080 Ti, NVIDIA 615.71.09): without this PR, Sky Garden stops after about 8 minutes on `AGC graphics: conservative rasterization with centroid interpolation is unsupported`. With this PR, 40 minutes in the same level with no stop (build `main` `44df21632` + #5390 + #5998 + #5997 + #6492 + #6465, merged with this head `76cc70c24`). AI-assisted: this comment was drafted with the help of Claude Code and checked against the logs by us.
Sign in to join this conversation.
No reviewers
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!6464
No description provided.