Skip to content

feat(agc): support 64 KiB display XOR color targets - #4318

Merged
oneandonlydean merged 3 commits into
boykopovar:mainfrom
Amoenus:codex/fix-color-target-d64-x
Oct 12, 2026
Merged

oneandonlydean merged 3 commits into
boykopovar:mainfrom
Amoenus:codex/fix-color-target-d64-x

Conversation

@Amoenus

@Amoenus Amoenus commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

What

Support SW_64KB_D_X (0x1a) color targets through the existing texture equations and mip geometry. Give D_X its own equation-cache slot; validate pipe/bank XOR and reject unresolved raw column bits before resident lookup as well as direct layout construction. Extend layout, transfer, array/mip-view and GPU draw tests.

Needed by Sonic Unleashed Recompiled, PPSA99902 /01.003.000: the captured descriptor is CB_COLOR_ATTRIB3=0x0dc68000. Issue #2970 records conditional title runs stopping at:

[videoout] presentation failed: AGC graphics: unsupported color tile mode

The unchanged decoder on tested main ffa198407 rejects that descriptor in 5/5 independently compiled runs; this rebased branch passes 5/5. The historical title comparisons use documented startup prerequisites and are not unchanged-current-main boot results. This patch supplies the missing color mode; it does not promise a complete title boot.

Source: AMD addrlib GFX10 non-RB+ c5e80007, the same synthetic 16-pipe/256-byte configuration as the existing texture equations. Unmeasured console behavior and unsupported column bits are recorded in TechnicalDebt. No new dependency or environment switch in the implementation.

Tested

Current exact head b6f1a4a69, rebased onto main 2f4cc8983be9b9eacb878a4c705bdf5fcdc2d84f, including #4431's specialization cleanup. Code-only contribution delta is unchanged by this rebase. Debt follows the new per-library layout in docs/dev/debt/libSceAgcDriver.md.

Windows 11 Enterprise 26200, WinLibs GCC15.2.0r7, Ninja Release / testing ON; RTX5080/NVIDIA610.62 and AMD1002:13c0/driver32.0.21036.18. Ordinary LTO, AnyPS5 shader cache disabled; driver-coldness not established.

  • Full build and system libraries, conventions, registration and diff checks pass.

  • Full suite with two CTest workers (--parallel 2 --timeout 30): 989 passed / 0 failed / 7 skipped of 996, maximum 21.267s; every observed test finishes below30s. Skips are stencil-reference export and six video-output cases.

  • NVIDIA: all13 selected groups pass5/5. AMD: eleven groups pass5/5; agc_driver_graphics and agc_driver_array_layer_target report failures. No selected group skips. AMD validation remains unresolved; this is not an all-green or merge-ready claim. Specialization/module and formatted-load regressions are included to validate the new upstream changes. GPU campaigns run sequentially. Driver-backed cases verify the requested GPU. Recorder-based helper controls independently select NVIDIA; no AMD or GPL-off coverage is claimed for those helpers.

  • Selected groups cover graphics/prepared/multisample, draw-cache reuse including GPL-off, R_X/D_X full-array transport, color1555, merged R_X packed tails and uint8x4 resident/nonresident D_X rendering. No new addrlib sweep, console measurement or title-startup comparison was performed; historical controls remain scoped below.

  • The latest private title descriptor is D64_X /16-byte RGBA32_UINT, packed mip2 of a128x64 surface, pipeBankXor0x4000. This layout PR leaves a separate D_X GPU routing gap, maintained in #4328 and bring-up #4443. A focused follow-up is being investigated; no new launch milestone is claimed.

  • Harness correction: APS5_NO_GPL is presence-based. Corrected GPL-on runs leave it unset; off runs use1. Earlier0/1 matrices exercised GPL-off twice and are retained with that corrected scope. No production environment switch or workaround was added.

  • An earlier same-head artifact produced four AMD legacy-path tiled-render mismatches; the graphics group also hit the previously recorded host-exclusion fixture signature. Stock-runtime controls passed. Recompiling all driver/compiler sources without a tracked-code change clears the matched rendering failures. The old failing DLL and logs are retained; the exact stale-artifact origin is unconfirmed. The fresh broad retest still records a host-exclusion fixture failure and an AMD array-render mismatch (0xdeadbeef instead of0x3e800000); the source of that remaining mismatch is unresolved. Earlier passing runs are not substituted for this failed campaign.

Previous exact head 6a42bd7e4 on d592: full965/0/7 of972, NVIDIA selected groups pass, AMD array/color1555 crash with ordinary LTO and pass5/5 with the existing LTO-off diagnostic control. A stock-source/header-matched frozen-main-runtime control reproduces color1555 crashes5/5 but its original R_X-only array fixture passes5/5; the extended candidate array failure was not claimed as reproduced by that control. No diagnostic switch was added to this implementation.

Historical exact head c17fc4537 on main ffa198407: full 945/0/7 of952; 17/18 relevant groups x5, with an intermittent host-exclusion fixture signature also reproduced on matched main (main1/20, candidate0/20). Captured decoder: main fails5/5, candidate passes5/5. Pinned-addrlib CPU comparison: 140 configurations/536,940 addresses per run x5, zero differences. Earlier broad comparison: all64 legal tags, 2,240 configurations/8,591,040 addresses per run x5, zero differences; five deliberately broken decoder/cache/mapping/XOR/refusal variants detected5/5. These are source-model checks, not console measurements. Earlier heap-corruption findings and #4029 baseline evidence remain in the maintained report.

Sequencing: #4551's author agreed that #4551 goes first, then #4318. Only their shared ArrayLayerTarget.cpp fixture conflicts; runtime changes are independent. After it lands, I will rebase this test to retain their R_X collapsed-slice1/2/3 checks and our R_X/D_X full-array checks, then repeat validation. The current head is not that combined fixture yet.

No new title-startup milestone is claimed. Conditional PPSA99902 progress and remaining prerequisites are maintained in Game bring-up #4443.

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; silent stubs are listed in TechnicalDebt
  • No notes, investigation .md files or images added to the repository
  • New third-party code is a submodule built from source — none added
  • Generic behaviour, not specific to one title
  • Depends on: fix(agc): preserve array slice XOR in color target views #4551 (agreed shared array-fixture sequencing; no functional dependency)
  • Unblocks: PPSA99902 Sonic Unleashed Recompiled (PPSA99902): initial gameplay on fork and remaining work #4443 (conditional color-layout stop)
  • AI-assisted: yes (Codex); implementation and validation prepared under the author’s authorization

@oneandonlydean oneandonlydean self-assigned this Oct 12, 2026
@github-actions github-actions Bot added the needs rebase Conflicts with main, rebase needed label Oct 12, 2026
@Amoenus
Amoenus force-pushed the codex/fix-color-target-d64-x branch from c8f7043 to c17fc45 Compare October 12, 2026 12:35
@github-actions github-actions Bot removed the needs rebase Conflicts with main, rebase needed label Oct 12, 2026
@blawesom

Copy link
Copy Markdown
Contributor

Rebase handoff — rebased onto current main (staleness only; all three commits applied cleanly), authorship unchanged.

Verified on Linux (CachyOS, kernel 7.2.9, GCC 16.2.1, Ninja, Release, BUILD_TESTING=ON, AMD RX 9070 XT / RADV):

  • builds; tools/check_conventions.py --base origin/main passes
  • full suite: 100% passed

To pick it up:

git fetch https://github.com/blawesom/AnyPS5 rebase/4318
git checkout <your branch>
git merge --ff-only FETCH_HEAD

Head is 280722906.

@Amoenus

Amoenus commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor Author

Rebase pushed (2026-10-12): b6f1a4a69, based on main 2f4cc8983. Original code patches remain unchanged by range comparison; technical debt is migrated to the per-library file. Full build/libs/conventions/registration pass. Full NVIDIA suite:989 passed/0 failed/7 skipped of996. All13 selected NVIDIA groups pass5/5.

Remaining AMD validation: in the corrected default/GPL-on campaign, eleven groups pass5/5; the graphics fixture reports the previously recorded host-exclusion signature, and the extended array fixture reads0xdeadbeef instead of0x3e800000 after the draw. These results are retained, not replaced by older passing campaigns. Merge readiness remains unresolved.

Earlier tests using APS5_NO_GPL=0 actually disabled GPL and produced four tiled-render mismatches. Stock main-runtime controls passed those four cases5/5 on both devices; the frozen D_X artifact reproduced the off-path mismatches. Recompiling the driver/compiler from unchanged tracked source clears matched color1555/packed-tail failures in crossed-executable controls. The old DLL and failed logs are retained; exact stale-artifact cause and the remaining array mismatch are unconfirmed. Recorder helper controls independently select NVIDIA and are not AMD coverage.

The #4551-first shared-array-fixture order remains pending, so Depends on:#4551 remains. No new title launch or console measurement is claimed. The separate captured D64_X/16-byte packed-mip GPU-routing gap is maintained in #4328; it is outside this layout patch.

Status update (2026-10-13): #4318 was merged at 6f438a1c2 after the above validation report was posted. The remaining AMD findings are still under investigation; merge status does not turn them into passes. #4551 remains open, so the previously agreed ordering was not followed by the actual merge.

@Amoenus
Amoenus force-pushed the codex/fix-color-target-d64-x branch from 6a42bd7 to 6f24b0c Compare October 12, 2026 17:15
@github-actions github-actions Bot added the needs rebase Conflicts with main, rebase needed label Oct 12, 2026
@Amoenus
Amoenus force-pushed the codex/fix-color-target-d64-x branch from 6f24b0c to 8191684 Compare October 12, 2026 19:30
@github-actions github-actions Bot removed the needs rebase Conflicts with main, rebase needed label Oct 12, 2026
Map SW_64KB_D_X color surfaces through the existing source-backed texture equations and mip geometry. Keep display and render-target equation caches separate. Reject unresolved raw column bits for the new mode instead of accepting them.

Cover the captured PPSA99902 descriptor, independent source offsets, pipe/bank tags, transfers, array/mip placement and resident/non-resident GPU draws. Record unmeasured console behavior in TechnicalDebt.

CPU validation on main e013f8c: captured-descriptor failure 5/5; changed passes 5/5; pinned AMD addrlib reference 536940 addresses per run, five runs. Full build and GPU validation are tracked externally. AI-assisted implementation and validation: Codex.
Apply the source-configured D_X XOR refusal during color decoding as well as direct layout construction. Regression tests reject each raw column-bit combination before storage or rendering is selected. Existing resident-array and packed-mip refusal paths remain in force.

AI-assisted implementation and validation: Codex.
Run the existing array-layer draw, recompiled shader load, untouched-layer and guest-publication checks with D_X as well as R_X. This exercises the resident array path that carries slice-dependent address XOR; a direct per-slice copy is not an equivalent model.

AI-assisted implementation and validation: Codex.
@Amoenus
Amoenus force-pushed the codex/fix-color-target-d64-x branch from 8191684 to b6f1a4a Compare October 12, 2026 20:56
@oneandonlydean
oneandonlydean merged commit 6f438a1 into boykopovar:main Oct 12, 2026
8 of 9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants