Skip to content

fix(agc): reuse a host import only while it covers its region - #2101

Closed
johnmaia wants to merge 1 commit into
boykopovar:mainfrom
johnmaia:fix/agc-stale-host-import
Closed

johnmaia wants to merge 1 commit into
boykopovar:mainfrom
johnmaia:fix/agc-stale-host-import

Conversation

@johnmaia

@johnmaia johnmaia commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

What

UploadPrepare merges overlapping regions. At the lease, a registered range takes a host import of exactly its size and records it in direct. When a descriptor range runs past that range's end, and into the next registered range, all three merge into one region. The merged region keeps the first range's import in direct.

UploadPrepare and UploadFinish then reuse that import while the import epoch is unchanged. Descriptor binds the view only up to the import's end and throws guest buffer view exceeds its GPU owner.

Both reuse sites now keep the import only while it covers the whole region. Otherwise the region looks an import up again (findImport already requires coverage) or is copied, as before.

Disney Epic Mickey: Rebrushed (PPSA15657, UE4) stopped at its first presentation on this. A 0x50000-byte import was kept for a merged 0x80000-byte region, under a 0x7f800-byte storage view at its base.

Tested

Linux (Ubuntu 24.04, GCC), RX 7600 (RADV).

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

https://claude.ai/code/session_0134RWCyiyydJBbfKz8g9Bwe

@rmz-24

rmz-24 commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

Windows run: Windows 11 Pro 25H2 (10.0.26200.9457), RTX 5060 Ti (NVIDIA 617.42), MinGW-w64 GCC 15.2.0 (WinLibs r7), Release, -DANYPS5_ENABLE_SPIRV_TOOLS=ON, full build plus libs. b597c7f cherry-picked onto current main d70b899 (applies cleanly).

AI-assisted: yes

UploadPrepare merges overlapping regions. A registered range that took
an exact-size host import at the lease can merge with a descriptor range
that runs past its end, and with the next registered range. The merged
region kept the first range's import in `direct`. UploadPrepare and
UploadFinish reused it while the import epoch was unchanged, and
Descriptor then bound the view only up to that import's end, throwing
"guest buffer view exceeds its GPU owner".

The import is reused only while it covers the whole region; otherwise
the region looks one up again (or is copied, as before).

PPSA15657 stopped at its first presentation on this.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0134RWCyiyydJBbfKz8g9Bwe
@johnmaia
johnmaia force-pushed the fix/agc-stale-host-import branch from b597c7f to 57ba6cd Compare October 9, 2026 13:32
@oneandonlydean

Copy link
Copy Markdown
Collaborator

Closing: #1489 (merged since) drops the import in UploadPrepare when a merge takes a region past its end, which is this case. Please reopen if PPSA15657 still stops at guest buffer view exceeds its GPU owner on current main.

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