test(agc): lift the host import budget in the sparse dma-buf import test #6261

Merged
EdouardSence merged 1 commit from upstream-pr/6261 into main 2026-10-17 03:48:17 +00:00
EdouardSence commented 2026-10-15 08:15:46 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by EdouardSence on 2026-10-15T08:15:46Z.


What

agc_host_import_sparse fails on main on a Linux host where /dev/udmabuf is writable and udmabuf.size_limit_mb is raised to 8192, the setting the host import path needs for large titles:

[gpu] host import budget: 8257 MiB live of 15614 MiB (APS5_HOST_IMPORT_MIB); 1 imports (8257 MiB) refused so far, last 0x7f1b0c8d0000+0x204100000
FAIL: a failure at UDMABUF_CREATE after the sparse path was chosen did not throw (got "")
FAIL: a failure at vkQueueBindSparse after the sparse path was chosen did not throw (got "")
2 sparse dma-buf import checks failed

Why it fails:

  • The test sizes each range from udmabuf's limit (RangeBytes() gives limit + 65 MiB = 8257 MiB here), and the range from ImportsALargeRangeAsOneSparseBuffer stays live.
  • The default budget is the smaller of half the physical memory and the host heap minus 2 GiB. That is 15614 MiB on this 32 GB machine, which refuses the next 8257 MiB import.
  • HostImportFor then returns nullptr before the sparse decision, so the failure cases never reach the step they test.
  • With the default size_limit_mb of 64 every range is 129 MiB and the test passes. Hosts without /dev/udmabuf access skip it, which is likely why nobody reported it.

The fix is one line: the test lifts the budget with SetHostImportBudget, as BdaResources already does. The budget is not what this test checks.

#5390 edits other functions in this file and adds one more live import in UnalignedOffsetStartsAtTheBlockBelow, so on the same host it hits this too. The hunks don't overlap.

Tested

Based on main db81992c5. CachyOS Linux 7.2.9, GCC, RX 9070 XT (RADV Mesa 26.2.4), 32 GB RAM, udmabuf.size_limit_mb=8192, /dev/udmabuf writable:

  • On main, agc_host_import_sparse fails as shown above. It fails the same way on a050f856f, and passes there with APS5_HOST_IMPORT_MIB=40000.
  • With this commit, it passes (host import sparse dma-buf tests passed).

Not tested: other RAM sizes or the default size_limit_mb, which needs root to change.

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: none (test only)
  • GPUs tested: AMD Radeon RX 9070 XT, RADV Mesa 26.2.4, CachyOS Linux 7.2.9
  • AI-assisted: yes

Tested and written by Claude (AI assistant) on a contributor's machine.

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4870281552 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6261). Originally posted by [EdouardSence](https://github.com/EdouardSence) on 2026-10-15T08:15:46Z. --- ### What `agc_host_import_sparse` fails on `main` on a Linux host where `/dev/udmabuf` is writable and `udmabuf.size_limit_mb` is raised to 8192, the setting the host import path needs for large titles: ``` [gpu] host import budget: 8257 MiB live of 15614 MiB (APS5_HOST_IMPORT_MIB); 1 imports (8257 MiB) refused so far, last 0x7f1b0c8d0000+0x204100000 FAIL: a failure at UDMABUF_CREATE after the sparse path was chosen did not throw (got "") FAIL: a failure at vkQueueBindSparse after the sparse path was chosen did not throw (got "") 2 sparse dma-buf import checks failed ``` Why it fails: - The test sizes each range from udmabuf's limit (`RangeBytes()` gives limit + 65 MiB = 8257 MiB here), and the range from `ImportsALargeRangeAsOneSparseBuffer` stays live. - The default budget is the smaller of half the physical memory and the host heap minus 2 GiB. That is 15614 MiB on this 32 GB machine, which refuses the next 8257 MiB import. - `HostImportFor` then returns `nullptr` before the sparse decision, so the failure cases never reach the step they test. - With the default `size_limit_mb` of 64 every range is 129 MiB and the test passes. Hosts without `/dev/udmabuf` access skip it, which is likely why nobody reported it. The fix is one line: the test lifts the budget with `SetHostImportBudget`, as `BdaResources` already does. The budget is not what this test checks. #5390 edits other functions in this file and adds one more live import in `UnalignedOffsetStartsAtTheBlockBelow`, so on the same host it hits this too. The hunks don't overlap. ### Tested Based on `main` db81992c5. CachyOS Linux 7.2.9, GCC, RX 9070 XT (RADV Mesa 26.2.4), 32 GB RAM, `udmabuf.size_limit_mb=8192`, `/dev/udmabuf` writable: - On `main`, `agc_host_import_sparse` fails as shown above. It fails the same way on `a050f856f`, and passes there with `APS5_HOST_IMPORT_MIB=40000`. - With this commit, it passes (`host import sparse dma-buf tests passed`). Not tested: other RAM sizes or the default `size_limit_mb`, which needs root to change. ### 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](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/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: none (test only) - [x] GPUs tested: AMD Radeon RX 9070 XT, RADV Mesa 26.2.4, CachyOS Linux 7.2.9 - [x] AI-assisted: yes *Tested and written by Claude (AI assistant) on a contributor's machine.*
github-actions[bot] commented 2026-10-15 12:17:39 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-15T12:17:39Z.


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 5390 core/libs/prx/libSceAgcDriver/tests/HostImportSparseDmaBuf.cpp
PR 6222 core/libs/prx/libSceAgcDriver/tests/HostImportSparseDmaBuf.cpp
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6191850108 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6261#issuecomment-6191850108). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-15T12:17:39Z. --- <!-- 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 5390](https://www.github.com/boykopovar/AnyPS5/pull/5390) | `core/libs/prx/libSceAgcDriver/tests/HostImportSparseDmaBuf.cpp` | | [PR 6222](https://www.github.com/boykopovar/AnyPS5/pull/6222) | `core/libs/prx/libSceAgcDriver/tests/HostImportSparseDmaBuf.cpp` |
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!6261
No description provided.