Skip to content

fix(agc): count every CP data write of a dispatch group as a write of the run - #4586

Merged
oneandonlydean merged 1 commit into
boykopovar:mainfrom
ee6aba54:fix/agc-lookahead-write-data
Oct 13, 2026
Merged

oneandonlydean merged 1 commit into
boykopovar:mainfrom
ee6aba54:fix/agc-lookahead-write-data

Conversation

@ee6aba54

Copy link
Copy Markdown
Contributor

What

The compute dispatch look-ahead (resolveGroupAhead) captures the dispatches of a group before the earlier ones run, and stops before a dispatch whose captured memory an earlier part of the run writes. WRITE_DATA and RELEASE_MEM stores were noted only as labels, and NoteLabel keeps only 4- and 8-byte values. A WRITE_DATA of more words, such as one that fills a buffer descriptor or an argument block between two dispatches, was not recorded at all, so the later dispatch was captured with the bytes from before the store.

Every such store now also enters the run's written ranges. A later dispatch whose capture overlaps it is no longer resolved ahead and is captured when it runs; an indirect dispatch whose arguments it covers stops the look-ahead as well, through the existing check of those ranges.

Tested

  • Ubuntu 24.04, Linux 7.0, GCC 13.3, Release, based on 2a5eca11c. ctest: 960 tests pass; video_out_flip_* and agc_driver_stencil_ref_export are skipped on this machine.
  • New agc_driver_write_data_written_ahead (RTX 5080): after a gate, one dispatch runs, a 16-byte WRITE_DATA replaces the buffer descriptor the next dispatch loads from memory, and the next dispatch increments the buffer that descriptor names. Without the change it increments the old buffer (stale 1, fresh 0); with it the new one. agc_driver_indirect_arguments_written_ahead still passes.
  • PPSA15304 (engine: Unreal Engine 5): a compute shader loaded record counts from an argument block the command buffer fills just before it and read float bounds left there (-FLT_MAX, -inf) as counts; the next dispatch stopped with "shader buffer exceeds descriptor range limit", and with that check relaxed the GPU hung on the resulting loop. With this change and fix(libSceAgcDriver): accept DCC on 3D color targets #4499, feat(libSceAgcDriver): storage image access to depth surfaces #4500 and feat(libSceAgcDriver): render color views of several 3D slices as layered attachments #4573 the title reaches its main menu.
  • Windows not built or tested.

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 in TechnicalDebt
  • 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
  • AI-assisted: yes

🤖 Generated with Claude Code

… the run

The compute dispatch look-ahead noted WRITE_DATA and RELEASE_MEM stores only
as labels, and labels other than 4 or 8 bytes were dropped. A WRITE_DATA that
fills a descriptor or an argument block between two dispatches was invisible,
so the later dispatch was captured ahead with the old bytes. Every such store
now also enters the run's written ranges, which stop the look-ahead before a
dispatch that reads them.
@Scramblrrrr

Copy link
Copy Markdown
Contributor

Preparing Windows RTX5070Ti cross-test of head50deecc122117985665f9d4640ce39587b55377e. Applied cleanly to our public007 integration as source-only head9e54939c9ccbb7819288174438936da7716a5994: https://github.com/Scramblrrrr/AnyPS5/tree/codex/first-light-dispatch-write-cross-test . Conventions pass. Will freshly build the new GPU regression and existing indirect-arguments regression, then run production-only negative/restored if positive passes. Current007 import-budget comparison is still running older graphics, so no title-result claim for this fix yet. No duplicate upstream PR. AI-assisted: Codex.

@Scramblrrrr

Copy link
Copy Markdown
Contributor

Windows RTX5070Ti cross-test completed on integration9e54939c9 (canonical50deecc1 credited). Fresh GPU positive2/2PASS1.49s: write_data_written_ahead and indirect_arguments_written_ahead. Production-only negative removed the new writes.emplace_back line, retaining the new fixture: FAIL0.44s with exactly stale1/fresh0. Restored4/4PASS1.46s including copied_writer_copy and joined_import_writer_copy, no skips. Worktree clean, conventions pass. Source branch: https://github.com/Scramblrrrr/AnyPS5/tree/codex/first-light-dispatch-write-cross-test .

Patched graphics SHA2560D811ECCA52E21F573DCFD6D8886A546C0A75027EA6AFB8A5D90950E2E3625F4. Preparing007 cross-test, same quiet warm-cache12GiB-import config as previous control; unchanged libc. No007 improvement claim yet. AI-assisted: Codex; no title data uploaded.

@github-actions github-actions Bot added the agc libSceAgc* label Oct 12, 2026
@oneandonlydean oneandonlydean self-assigned this Oct 13, 2026
@oneandonlydean
oneandonlydean merged commit 417c7d0 into boykopovar:main Oct 13, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agc libSceAgc*

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants