perf(agc-driver): join host-import spans only over whole aligned windows #3335
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3335"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by Tamalero on 2026-10-11T08:06:12Z.
What
Follow-up to #3158, from the data in my comment there (https://github.com/boykopovar/AnyPS5/pull/3158#issuecomment-6105102035).
Cause: a span is the whole chain of adjacent registered ranges with the same access. A title that grows a heap 16 KiB at a time re-imports the whole chain on every growth. Ratchet & Clank: Rift Apart re-imported about 1.5 TiB while loading its first scene, and NVIDIA refused grown spans (
VK_ERROR_OUT_OF_DEVICE_MEMORY), which leaves those ranges copied per draw.Fix: ranges are now joined only when a chain covers a whole aligned window: 8 MiB by default,
APS5_HOST_IMPORT_WINDOW_MIBon the device. Until the window is complete each range is imported on its own, and a span never crosses a window edge. Growth therefore re-imports a range at most once more, when its window completes, instead of the chain on every growth. A single range larger than the window is imported whole. The window is applied before #3324's fallback, so a window whose alias Windows refuses still drops to one range at a time.SetHostImportWindow(0)keeps the unbounded spans, which the existing tests use, so #3158's tests are unchanged.Joining any part of a window was tried first and still churned: each 16 KiB growth re-imported the window's partial span, about 2 GB per second in Ratchet (68 GB re-imported after 30 s for 8 GB live).
Tested
CachyOS (Linux 7.2), RTX 4090, NVIDIA 615.78, GCC Release.
importWindowTestsinagc_driver_graphics: a full window is one span, a partly filled window imports its range alone, a view crossing a window edge gets no import, and completing one window leaves the other window's import in place. With the window ignored it fails.ctest -R '^agc': 358/359 (agc_driver_dcc_keys_first_write, #2188).agc_driver_bda_deviceandagc_driver_bda_span_readspass.main1be0a7ce(with #3324); the tests below are from that tree.tools/check_conventions.pypasses.APS5_TRACE_HOST_IMPORT=1, whole run (about 4 min, ending at #3274):-2)Not measured on AMD/RADV.
Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt.mdfiles or images added to the repository (attach them to this PR)Tested and written by Claude (AI assistant) on a contributor's machine.
🤖 Generated with Claude Code
Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-11T08:07:21Z.
Thank you for your interest in the project! We are sorry, but we cannot accept more PRs while we work through the existing backlog. This PR has been automatically closed and labeled "intake paused". This is not a judgment of the quality of your changes.
Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-11T10:10:48Z.
Carried as #3425 with your commit kept under your name and one change on top: the window is fixed at 8 MiB instead of read from
APS5_HOST_IMPORT_WINDOW_MIB(environment switches aren't accepted). It also fixes a device loss #3158 causes on NVIDIA; details there.Pull request closed