perf(agc-driver): join the imports of adjacent ranges of any size that a buffer is bound exactly over #4517

Merged
AlxcBTW merged 2 commits from upstream-pr/4517 into main 2026-10-14 00:53:01 +00:00
AlxcBTW commented 2026-10-12 14:09:38 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by AlxcBTW on 2026-10-12T14:09:38Z.


Sword of the Sea (PPSA25344) loading: 16 MiB and 4 MiB buffers bound over several small adjacent registered ranges are imported once instead of copied on every use. CPU copies outside imports drop from 256-348 GB per loading run to 2.3 GB.

What

The join from #4515 imports adjacent registered ranges as one when a buffer is bound across them, but only when every range is larger than the 8 MiB window. The title's loading screen binds fixed 16 MiB and 4 MiB buffers whose backing is registered in two to six adjacent pieces with the same access, and some pieces are smaller than the window. A diagnostic build listed the first nine such regions of a loading run. Each one starts exactly at a range's start and ends exactly at a later range's end, for example:

  • 0x32609f0000+0x1000000 over 0xc60000 + 0x3a0000;
  • 0x304df90000+0x1000000 over 0x810000 + 0x70000 + 0x780000;
  • 0x32c7810000+0x400000 over 0x210000 + 0xd0000 + 0x20000 + 0x100000.

No import covers such a buffer, so every use copied it on the CPU.

Now joinedRun also joins a run of any range sizes when the bound region covers it exactly, from the first range's start to the last range's end:

  • Growing heaps. A heap grown in pieces matches only for a binding over exactly its current pieces. A binding that starts or ends inside a piece stays apart, as before, so growth beside an import never re-imports it. This is the churn the 8 MiB window was introduced against.
  • Unchanged. Runs whose ranges are all larger than the window join as before.
  • joinedCovers. It is used when a joined import retires (its shadowed units go back to the ranges still registered) and now accepts any adjacent run, so a unit inside a joined run of small ranges still counts as registered.

The TechnicalDebt entry for host imports names the new case.

Tested

Windows 11, WinLibs GCC 15.2.0 r7, Release, on top of #4515.

  • importJoinTests (in agc_driver_graphics, RTX 5070 Laptop): a new check binds a buffer exactly over two 64 KiB pieces of a partly filled window and requires one import of both. The existing check (a binding across them that starts inside the first piece stays apart) still holds. Passes; with the joinedRun change reverted, it fails with a buffer bound exactly over two pieces no larger than the import window was not imported as one.

  • Non-GPU suite (ctest -E "^agc_driver|^video_out|^guest_video"): 600 of 601 pass; log_macros fails as on main on that machine.

  • Sword of the Sea, New Game into the first scene (our lab branch: main plus local patches for this title, upstream default env, join on):

    Run CPU copies outside imports Frame reached
    without this change, 300 s 348,001 MiB 182 at t295
    without this change, 1800 s 256,453 MiB 653 at t900
    with this change, 900 s 2,282 MiB 982 at t895

    With the change, 83 imports log joined at bind, and the scene's picture shows from t420. Without it, the 1800 s run first showed it between its t300 and t600 captures. No GPU event or device loss occurred.

  • Conventions: tools/check_conventions.py passes.

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: #4515
  • AI-assisted: yes (Claude Code)

🤖 Generated with Claude Code

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4830612548 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4517). Originally posted by [AlxcBTW](https://github.com/AlxcBTW) on 2026-10-12T14:09:38Z. --- Sword of the Sea (PPSA25344) loading: 16 MiB and 4 MiB buffers bound over several small adjacent registered ranges are imported once instead of copied on every use. CPU copies outside imports drop from 256-348 GB per loading run to 2.3 GB. ### What The join from #4515 imports adjacent registered ranges as one when a buffer is bound across them, but only when every range is larger than the 8 MiB window. The title's loading screen binds fixed 16 MiB and 4 MiB buffers whose backing is registered in two to six adjacent pieces with the same access, and some pieces are smaller than the window. A diagnostic build listed the first nine such regions of a loading run. Each one starts exactly at a range's start and ends exactly at a later range's end, for example: - `0x32609f0000+0x1000000` over `0xc60000 + 0x3a0000`; - `0x304df90000+0x1000000` over `0x810000 + 0x70000 + 0x780000`; - `0x32c7810000+0x400000` over `0x210000 + 0xd0000 + 0x20000 + 0x100000`. No import covers such a buffer, so every use copied it on the CPU. Now `joinedRun` also joins a run of any range sizes when the bound region covers it exactly, from the first range's start to the last range's end: - **Growing heaps.** A heap grown in pieces matches only for a binding over exactly its current pieces. A binding that starts or ends inside a piece stays apart, as before, so growth beside an import never re-imports it. This is the churn the 8 MiB window was introduced against. - **Unchanged.** Runs whose ranges are all larger than the window join as before. - **`joinedCovers`.** It is used when a joined import retires (its shadowed units go back to the ranges still registered) and now accepts any adjacent run, so a unit inside a joined run of small ranges still counts as registered. The TechnicalDebt entry for host imports names the new case. ### Tested Windows 11, WinLibs GCC 15.2.0 r7, Release, on top of #4515. - **`importJoinTests` (in `agc_driver_graphics`, RTX 5070 Laptop):** a new check binds a buffer exactly over two 64 KiB pieces of a partly filled window and requires one import of both. The existing check (a binding across them that starts inside the first piece stays apart) still holds. Passes; with the `joinedRun` change reverted, it fails with `a buffer bound exactly over two pieces no larger than the import window was not imported as one`. - **Non-GPU suite (`ctest -E "^agc_driver|^video_out|^guest_video"`):** 600 of 601 pass; `log_macros` fails as on `main` on that machine. - **Sword of the Sea, New Game into the first scene** (our lab branch: `main` plus local patches for this title, upstream default env, join on): | Run | CPU copies outside imports | Frame reached | |---|---|---| | without this change, 300 s | 348,001 MiB | 182 at t295 | | without this change, 1800 s | 256,453 MiB | 653 at t900 | | with this change, 900 s | 2,282 MiB | 982 at t895 | With the change, 83 imports log `joined at bind`, and the scene's picture shows from t420. Without it, the 1800 s run first showed it between its t300 and t600 captures. No GPU event or device loss occurred. - **Conventions:** `tools/check_conventions.py` passes. ### Checklist <!-- Rules behind each item: https://github.com/boykopovar/AnyPS5/blob/main/CONTRIBUTING.md --> - [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 in [TechnicalDebt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/TechnicalDebt.md#silent-stubs) - [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: #4515 - [x] AI-assisted: yes (Claude Code) 🤖 Generated with [Claude Code](https://claude.com/claude-code)
blawesom commented 2026-10-12 14:53:42 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by blawesom on 2026-10-12T14:53:42Z.


Pre-review found a deterministic test failure on Linux/RADV — flagging early since full CI doesn't run automatically on PRs.

Independent pre-review (CachyOS, kernel 7.2.9, GCC 16.2.1, Ninja, Release, BUILD_TESTING=ON, AMD RX 9070 XT / RADV GFX1201):

  • The PR builds and tools/check_conventions.py passes.
  • agc_host_import_retire fails 3/3 runs (deterministic):
AGC graphics: missing Vulkan function: vkCmdCopyBuffer

vkCmdCopyBuffer is core Vulkan 1.0 and present on this device, so the failure is in how the new code resolves it: the retire path calls context.Resolved(&DeviceFunctions::cmdCopyBuffer, ...) on a route where the test's context has no cmdCopyBuffer table entry and no deviceProc fallback — Context.hpp's Function() then throws. Worth checking whether the test context needs the table entry, or whether the call belongs on a layer that always has the resolver.

Everything else passes (949/950 — only this test).

Also worth noting: this PR contains all of #4515's commits (the "adjacent large ranges" version) plus its generalization — listing #4515 in Depends on (or closing it as superseded) would make the relationship explicit for reviewers.

Reproduce: ctest -R agc_host_import_retire --output-on-failure

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6126731926 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4517#issuecomment-6126731926). Originally posted by [blawesom](https://github.com/blawesom) on 2026-10-12T14:53:42Z. --- **Pre-review found a deterministic test failure on Linux/RADV** — flagging early since full CI doesn't run automatically on PRs. Independent pre-review (CachyOS, kernel 7.2.9, GCC 16.2.1, Ninja, Release, `BUILD_TESTING=ON`, AMD RX 9070 XT / RADV GFX1201): - The PR builds and `tools/check_conventions.py` passes. - **`agc_host_import_retire` fails 3/3 runs** (deterministic): ``` AGC graphics: missing Vulkan function: vkCmdCopyBuffer ``` `vkCmdCopyBuffer` is core Vulkan 1.0 and present on this device, so the failure is in how the new code resolves it: the retire path calls `context.Resolved(&DeviceFunctions::cmdCopyBuffer, ...)` on a route where the test's context has no `cmdCopyBuffer` table entry and no `deviceProc` fallback — `Context.hpp`'s `Function()` then throws. Worth checking whether the test context needs the table entry, or whether the call belongs on a layer that always has the resolver. Everything else passes (949/950 — only this test). **Also worth noting:** this PR contains all of #4515's commits (the "adjacent large ranges" version) plus its generalization — listing #4515 in **Depends on** (or closing it as superseded) would make the relationship explicit for reviewers. Reproduce: `ctest -R agc_host_import_retire --output-on-failure`
Scramblrrrr commented 2026-10-12 15:05:46 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Scramblrrrr on 2026-10-12T15:05:46Z.


Preparing a Windows 007 cross-test of your #4515 + #4517 heads7a99692b/da93351f. Our diagnostic run on0e981f4e (all public Sleg hull-v1 commits plus #4017/#1359/#3471) reaches rendered menu ~1.4FPS under APS5_PROFILE_DRAW=1, then black frames after Resume. Completed CPU-copy reads grow from340459MiB at menu to1281216MiB after ~5minutes loading; all counted outside imports. Sparse trimming/mirroring is already enabled. This is cumulative traffic, not resident RAM.

Source-only port https://github.com/Scramblrrrr/AnyPS5/tree/codex/first-light-joined-import-cross-test head481d840452a34814d909f56099f15bfedfe2a4a6 is building now. Includes Angel21PC Windows non-contiguous alias87af6e09; our integration already has map-node retirement/KeepThroughHold/holder parking. Resolved conflicts preserving our end-aware single-range window imports, adaptive import budget/eviction, per-build pointer protection and #4017 unlocked-refusal handling. Author fixtures retained alongside our whole-range and relief fixtures. No new upstream PR, no claimed 007 benefit yet. I will report native checks and whether actual joined-at-bind imports reduce those copies. AI-assisted: Codex.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6126954349 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4517#issuecomment-6126954349). Originally posted by [Scramblrrrr](https://github.com/Scramblrrrr) on 2026-10-12T15:05:46Z. --- Preparing a Windows 007 cross-test of your #4515 + #4517 heads7a99692b/da93351f. Our diagnostic run on0e981f4e (all public Sleg hull-v1 commits plus #4017/#1359/#3471) reaches rendered menu ~1.4FPS under APS5_PROFILE_DRAW=1, then black frames after Resume. Completed CPU-copy reads grow from340459MiB at menu to1281216MiB after ~5minutes loading; all counted outside imports. Sparse trimming/mirroring is already enabled. This is cumulative traffic, not resident RAM. Source-only port https://github.com/Scramblrrrr/AnyPS5/tree/codex/first-light-joined-import-cross-test head481d840452a34814d909f56099f15bfedfe2a4a6 is building now. Includes Angel21PC Windows non-contiguous alias87af6e09; our integration already has map-node retirement/KeepThroughHold/holder parking. Resolved conflicts preserving our end-aware single-range window imports, adaptive import budget/eviction, per-build pointer protection and #4017 unlocked-refusal handling. Author fixtures retained alongside our whole-range and relief fixtures. No new upstream PR, no claimed 007 benefit yet. I will report native checks and whether actual joined-at-bind imports reduce those copies. AI-assisted: Codex.
Scramblrrrr commented 2026-10-12 15:12:43 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Scramblrrrr on 2026-10-12T15:12:43Z.


Native checks completed on final adaptation c990fc176a714ead3241d93645826488651cad64: nine targeted tests pass (graphics author join fixtures plus existing whole-range/relief cases; guest_memory Windows alias; copied/direct ordering; retirement/at-map; storage snapshots/upload; mid-hold import lifetime). Native lifetime fixture is mocked, not a GPU race reproduction. Exact-small-span negative control retaining all fixtures but refusing joinedRun's exact-span case fails specifically 'a buffer bound exactly over two pieces no larger than the import window was not imported as one'; restored9/9 pass, conventions clean.

Two adapter issues caught and fixed by retained fixtures: fresh end=0 lookup must not mark a shorter window as used before replacement; join boundary probes must not count as uses. Ordinary replacement/eviction retains per-build pointer protection; pre-confirmation joins use the existing extracted-node/KeepThroughHold lifetime and epoch invalidation, as in your branch. Runtime now staging graphics and the required Windows-alias libc only; originals backed up. Same warm cache and PROFILE_DRAW settings as preceding 007 diagnostic. No benefit claim yet. Final branch https://github.com/Scramblrrrr/AnyPS5/tree/codex/first-light-joined-import-cross-test . AI-assisted: Codex.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6127081144 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4517#issuecomment-6127081144). Originally posted by [Scramblrrrr](https://github.com/Scramblrrrr) on 2026-10-12T15:12:43Z. --- Native checks completed on final adaptation c990fc176a714ead3241d93645826488651cad64: nine targeted tests pass (graphics author join fixtures plus existing whole-range/relief cases; guest_memory Windows alias; copied/direct ordering; retirement/at-map; storage snapshots/upload; mid-hold import lifetime). Native lifetime fixture is mocked, not a GPU race reproduction. Exact-small-span negative control retaining all fixtures but refusing joinedRun's exact-span case fails specifically 'a buffer bound exactly over two pieces no larger than the import window was not imported as one'; restored9/9 pass, conventions clean. Two adapter issues caught and fixed by retained fixtures: fresh end=0 lookup must not mark a shorter window as used before replacement; join boundary probes must not count as uses. Ordinary replacement/eviction retains per-build pointer protection; pre-confirmation joins use the existing extracted-node/KeepThroughHold lifetime and epoch invalidation, as in your branch. Runtime now staging graphics and the required Windows-alias libc only; originals backed up. Same warm cache and PROFILE_DRAW settings as preceding 007 diagnostic. No benefit claim yet. Final branch https://github.com/Scramblrrrr/AnyPS5/tree/codex/first-light-joined-import-cross-test . AI-assisted: Codex.
Scramblrrrr commented 2026-10-12 15:18:47 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Scramblrrrr on 2026-10-12T15:18:47Z.


First 007 runtime signal on c990fc176 (still running, not gameplay): same PROFILE_DRAW config/warm cache as0e981f4e. At exactly34,000 resource builds, guest-memory upload drops29710→4890ms and image preparation39556→21716ms; bindings767→761ms/precollect2643→2561ms. Startup/autosave and health screens render2.05–2.10FPS versus preceding autosave1.62FPS. Last copy counter7,000operations/46,307MiB, and the old prominent0x3f10000000 copy bucket is absent so far. Cumulative traffic, not RAM; startup screen advancement/control timing differ, so not a whole-run copy ratio or playable-FPS claim. New private~16.4GB. No native builds during this run. Continuing to menu/Resume; I will report the result. Host-import trace was not enabled in this run, so no joined-at-bind diagnostic line yet. AI-assisted: Codex.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6127188648 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4517#issuecomment-6127188648). Originally posted by [Scramblrrrr](https://github.com/Scramblrrrr) on 2026-10-12T15:18:47Z. --- First 007 runtime signal on c990fc176 (still running, not gameplay): same PROFILE_DRAW config/warm cache as0e981f4e. At exactly34,000 resource builds, guest-memory upload drops29710→4890ms and image preparation39556→21716ms; bindings767→761ms/precollect2643→2561ms. Startup/autosave and health screens render~2.05–2.10FPS versus preceding autosave~1.62FPS. Last copy counter7,000operations/46,307MiB, and the old prominent0x3f10000000 copy bucket is absent so far. Cumulative traffic, not RAM; startup screen advancement/control timing differ, so not a whole-run copy ratio or playable-FPS claim. New private~16.4GB. No native builds during this run. Continuing to menu/Resume; I will report the result. Host-import trace was not enabled in this run, so no joined-at-bind diagnostic line yet. AI-assisted: Codex.
Scramblrrrr commented 2026-10-12 15:25:08 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Scramblrrrr on 2026-10-12T15:25:08Z.


007 runtime ended unexpectedly15:23:32 UTC on c990fc176, exit0xc0000005 (access violation), below memory guard limit. Last UI sampled15:23:06 was black frame1862~6.53FPS (~80s after Resume15:21:44); no visible level. Last private24.116GB/free5.943GB. Crash reported on guest RenderThread, read of0x40 with RSI=0; reported instruction location game-dump-modules.exe+0x17bd927 (not a native libSceAgcDriver frame). This identifies the detection site only; not attributing the invalid guest state to this PR. Local dump retained privately, no game instructions/data uploaded. Earlier unsupported image-table writeback pcs0x224/0xa4 still occurred. No debugger attached.

Performance lead remains: matched34k resource checkpoint upload29.710→4.890s, images39.556→21.716s; title/menu1.8–1.9FPS under profiling vs preceding1.4; load advanced quickly before the crash. Last CPU-copy counter20k/209740MiB, no0x3f10000000 bucket yet. Needs repeat/control to separate newly reached guest failure from integration regression. Will inspect locally and cross-test. AI-assisted: Codex.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6127293399 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4517#issuecomment-6127293399). Originally posted by [Scramblrrrr](https://github.com/Scramblrrrr) on 2026-10-12T15:25:08Z. --- 007 runtime ended unexpectedly15:23:32 UTC on c990fc176, exit0xc0000005 (access violation), below memory guard limit. Last UI sampled15:23:06 was black frame1862~6.53FPS (~80s after Resume15:21:44); no visible level. Last private24.116GB/free5.943GB. Crash reported on guest RenderThread, read of0x40 with RSI=0; reported instruction location game-dump-modules.exe+0x17bd927 (not a native libSceAgcDriver frame). This identifies the detection site only; not attributing the invalid guest state to this PR. Local dump retained privately, no game instructions/data uploaded. Earlier unsupported image-table writeback pcs0x224/0xa4 still occurred. No debugger attached. Performance lead remains: matched34k resource checkpoint upload29.710→4.890s, images39.556→21.716s; title/menu~1.8–1.9FPS under profiling vs preceding~1.4; load advanced quickly before the crash. Last CPU-copy counter20k/209740MiB, no0x3f10000000 bucket yet. Needs repeat/control to separate newly reached guest failure from integration regression. Will inspect locally and cross-test. AI-assisted: Codex.
Scramblrrrr commented 2026-10-12 15:35:53 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Scramblrrrr on 2026-10-12T15:35:53Z.


Alias-dependency control: old graphics0e981f4e with the same new libc5A176460..., same cache/PROFILE_DRAW settings. Matched34,000-build upload30391ms/images39932ms versus joined graphics c990 upload4890ms/images21716ms. Original old-graphics/old-libc run was29710ms/39556ms. Thus the required alias library alone does not explain the measured preparation gain. Large0x3f10000000 outside-import CPU-copy bucket returns (29,431MiB already during startup); title frame959~1.16FPS/private19.91GB. One run each, FPS not fixed-frame matched. Control is still running toward Resume, to compare the guest null-pointer crash. No native builds during measurements. A new synthetic GPU writer/copy check across two registered ranges is prepared but unbuilt/unpublished so far. AI-assisted: Codex.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6127476726 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4517#issuecomment-6127476726). Originally posted by [Scramblrrrr](https://github.com/Scramblrrrr) on 2026-10-12T15:35:53Z. --- Alias-dependency control: old graphics0e981f4e with the same new libc5A176460..., same cache/PROFILE_DRAW settings. Matched34,000-build upload30391ms/images39932ms versus joined graphics c990 upload4890ms/images21716ms. Original old-graphics/old-libc run was29710ms/39556ms. Thus the required alias library alone does not explain the measured preparation gain. Large0x3f10000000 outside-import CPU-copy bucket returns (29,431MiB already during startup); title frame959~1.16FPS/private19.91GB. One run each, FPS not fixed-frame matched. Control is still running toward Resume, to compare the guest null-pointer crash. No native builds during measurements. A new synthetic GPU writer/copy check across two registered ranges is prepared but unbuilt/unpublished so far. AI-assisted: Codex.
AlxcBTW commented 2026-10-12 15:47:44 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by AlxcBTW on 2026-10-12T15:47:44Z.


@blawesom fixed in #4385's 63ddeb09f (the Linux write-protection probe hit the test's mock device, not the retire path); details on #4515. Merged into this branch as 2a479b422.

AI-assisted: yes (Claude Code)

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6127677645 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4517#issuecomment-6127677645). Originally posted by [AlxcBTW](https://github.com/AlxcBTW) on 2026-10-12T15:47:44Z. --- @blawesom fixed in #4385's 63ddeb09f (the Linux write-protection probe hit the test's mock device, not the retire path); details on #4515. Merged into this branch as 2a479b422. AI-assisted: yes (Claude Code)
Scramblrrrr commented 2026-10-12 15:55:30 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Scramblrrrr on 2026-10-12T15:55:30Z.


Windows follow-up: alias-only control (graphics0e981f4e, same new multi-section libc5A176460) ended deliberately15:46:59 UTC at black frame2015~0.07FPS, private28.16GB/free3.09GB. Same unsupported image-table operations reached, no logged access violation before shutdown. Completed CPU copies101k/1439788MiB cumulative. Matched34k resource builds: upload30391ms/images39932ms, close to original29710/39556; joined c990 was4890/21716. One run each; late progress differs, so absence of crash is not regression proof.

Added actual Windows Vulkan crossing-writer/copy test on fork head0d8bbef5712c3ed67dfc81a2ddbb47657a8a99c4: https://github.com/Scramblrrrr/AnyPS5/tree/codex/first-light-joined-import-cross-test . Dispatch stores across two adjacent registered ranges, requires one import covering output, then copies and checks bytes/boundary guards. Disabled large-range joining with fixture retained: FAIL at covering-import assertion0.39s; restored final2/2PASS0.65s, no skips. This tests that path, not the game's terrain readback race. Production remains c990; newest commit tests only.

@SleglJan Thanks for the crash breakdown. I will repeat quiet at6GiB first, with host-import diagnostics, then compare a larger budget if it recurs. Same signature suggests newly reached readback failure, but I will not attribute it without the comparison. All title data/dumps retained locally only. AI-assisted: Codex.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6127805635 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4517#issuecomment-6127805635). Originally posted by [Scramblrrrr](https://github.com/Scramblrrrr) on 2026-10-12T15:55:30Z. --- Windows follow-up: alias-only control (graphics0e981f4e, same new multi-section libc5A176460) ended deliberately15:46:59 UTC at black frame2015~0.07FPS, private28.16GB/free3.09GB. Same unsupported image-table operations reached, no logged access violation before shutdown. Completed CPU copies101k/1439788MiB cumulative. Matched34k resource builds: upload30391ms/images39932ms, close to original29710/39556; joined c990 was4890/21716. One run each; late progress differs, so absence of crash is not regression proof. Added actual Windows Vulkan crossing-writer/copy test on fork head0d8bbef5712c3ed67dfc81a2ddbb47657a8a99c4: https://github.com/Scramblrrrr/AnyPS5/tree/codex/first-light-joined-import-cross-test . Dispatch stores across two adjacent registered ranges, requires one import covering output, then copies and checks bytes/boundary guards. Disabled large-range joining with fixture retained: FAIL at covering-import assertion0.39s; restored final2/2PASS0.65s, no skips. This tests that path, not the game's terrain readback race. Production remains c990; newest commit tests only. @SleglJan Thanks for the crash breakdown. I will repeat quiet at6GiB first, with host-import diagnostics, then compare a larger budget if it recurs. Same signature suggests newly reached readback failure, but I will not attribute it without the comparison. All title data/dumps retained locally only. AI-assisted: Codex.
AlxcBTW commented 2026-10-12 16:58:10 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by AlxcBTW on 2026-10-12T16:58:10Z.


@Scramblrrrr thanks a lot for the 007 cross-test, that's exactly the independent evidence these two need. At the matched 34k-build checkpoint the joined head goes from 29.7 s to 4.9 s upload and from 39.6 s to 21.7 s image preparation, and the alias-only control stays at 30.4 s / 39.9 s. So the join, not the alias library, removes the outside-import copies (including the 0x3f10000000 bucket).

On the RenderThread crash (read of 0x40 with RSI=0 in guest code, not a driver frame): one candidate worth ruling out is #361. On Sword of the Sea, parl0v just proved that Windows writes the exception frame below rsp when a guest store faults on a shared view (WindowsMappings::HandleWrite), which zeroes red-zone locals of leaf functions; the crashing leaf then reads a pointer back as 0. Faster loading means more first-touch faults on freshly mapped ranges, so a run that gets further can hit it more often. A ring of resumed faults in the vectored handler (thread, rsp, rip) shows it directly: a shared-view write fault on the crashing thread at the crash rsp, 0 ms before.

Your crossing-writer Vulkan test (dispatch storing across two adjacent registered ranges, one covering import, byte and boundary checks) would be a good addition to #4517. If you're fine with it, I'll cherry-pick it with your authorship.

AI-assisted: yes (Claude Code)

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6128796590 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4517#issuecomment-6128796590). Originally posted by [AlxcBTW](https://github.com/AlxcBTW) on 2026-10-12T16:58:10Z. --- @Scramblrrrr thanks a lot for the 007 cross-test, that's exactly the independent evidence these two need. At the matched 34k-build checkpoint the joined head goes from 29.7 s to 4.9 s upload and from 39.6 s to 21.7 s image preparation, and the alias-only control stays at 30.4 s / 39.9 s. So the join, not the alias library, removes the outside-import copies (including the 0x3f10000000 bucket). On the RenderThread crash (read of 0x40 with RSI=0 in guest code, not a driver frame): one candidate worth ruling out is #361. On Sword of the Sea, parl0v just proved that Windows writes the exception frame below `rsp` when a guest store faults on a shared view (`WindowsMappings::HandleWrite`), which zeroes red-zone locals of leaf functions; the crashing leaf then reads a pointer back as 0. Faster loading means more first-touch faults on freshly mapped ranges, so a run that gets further can hit it more often. A ring of resumed faults in the vectored handler (thread, rsp, rip) shows it directly: a shared-view write fault on the crashing thread at the crash rsp, 0 ms before. Your crossing-writer Vulkan test (dispatch storing across two adjacent registered ranges, one covering import, byte and boundary checks) would be a good addition to #4517. If you're fine with it, I'll cherry-pick it with your authorship. AI-assisted: yes (Claude Code)
TideOPL commented 2026-10-13 10:14:53 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by TideOPL on 2026-10-13T10:14:53Z.


Tested on Minecraft Dungeons II (PPSA16064): Windows 11, RTX 5070, WinLibs GCC, Release, gameplay at the Squid Coast spawn, trace window 25-40 s after the HUD appears (#4526 trace, APS5_TRACE_SECONDS=25:15).

In gameplay, Unreal binds buffers exactly over 2 to 5 adjacent registered pieces of the one direct-memory allocation (for example 0x306a280000+0xa00000 over 0x810000 + 0x1f0000, or 0x322b8b0000+0x200000 over five pieces). Without this change none of them could be imported (the 8 MiB window), so they were copied on the CPU, which also made those builds non-reusable. That was about 300 full resource builds per frame on queue 0, and the frame time depended on where the heap placed them: p50 118 ms in one run, 158-229 ms in others.

With #4515 + #4517 (and #4367) on main plus the patches MCD2 needs to reach gameplay: p50 131 ms, p99 139-155 ms, steady across 5 runs. Queue-0 resource builds drop to about 50 per frame. (An older build without the join ran about 4.8 FPS at the same spot, on a different base.)

Not run: Linux, AMD, the PR's own tests.

AI-assisted (Claude Code).

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6143310937 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4517#issuecomment-6143310937). Originally posted by [TideOPL](https://github.com/TideOPL) on 2026-10-13T10:14:53Z. --- Tested on Minecraft Dungeons II (PPSA16064): Windows 11, RTX 5070, WinLibs GCC, Release, gameplay at the Squid Coast spawn, trace window 25-40 s after the HUD appears (#4526 trace, `APS5_TRACE_SECONDS=25:15`). In gameplay, Unreal binds buffers exactly over 2 to 5 adjacent registered pieces of the one direct-memory allocation (for example `0x306a280000+0xa00000` over `0x810000 + 0x1f0000`, or `0x322b8b0000+0x200000` over five pieces). Without this change none of them could be imported (the 8 MiB window), so they were copied on the CPU, which also made those builds non-reusable. That was about 300 full resource builds per frame on queue 0, and the frame time depended on where the heap placed them: p50 118 ms in one run, 158-229 ms in others. With #4515 + #4517 (and #4367) on `main` plus the patches MCD2 needs to reach gameplay: p50 131 ms, p99 139-155 ms, steady across 5 runs. Queue-0 resource builds drop to about 50 per frame. (An older build without the join ran about 4.8 FPS at the same spot, on a different base.) Not run: Linux, AMD, the PR's own tests. AI-assisted (Claude Code).
oneandonlydean commented 2026-10-13 10:32:06 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-13T10:32:06Z.


Same as #4515: rebase onto main without the merge commits (six here), keeping only #4515's commit and this one.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6143600475 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4517#issuecomment-6143600475). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-13T10:32:06Z. --- Same as #4515: rebase onto main without the merge commits (six here), keeping only #4515's commit and this one.
AlxcBTW commented 2026-10-13 11:46:36 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by AlxcBTW on 2026-10-13T11:46:36Z.


Rebased onto current main on top of the rebased #4515, so the branch holds only #4515's commit and this PR's commit, without merge commits. The debt entry is merged the same way as in #4515. Checked with check_conventions and a full Linux and Windows run on a fork branch before the push (the Windows job hit a one-off agc_driver_wait_shutdown timeout once and passed on re-run).

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6144827100 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4517#issuecomment-6144827100). Originally posted by [AlxcBTW](https://github.com/AlxcBTW) on 2026-10-13T11:46:36Z. --- Rebased onto current main on top of the rebased #4515, so the branch holds only #4515's commit and this PR's commit, without merge commits. The debt entry is merged the same way as in #4515. Checked with check_conventions and a full Linux and Windows run on a fork branch before the push (the Windows job hit a one-off agc_driver_wait_shutdown timeout once and passed on re-run).
ps54all commented 2026-10-13 17:37:38 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by ps54all on 2026-10-13T17:37:38Z.


Palworld (PPSA23126, UE5) data point, Windows 11, RTX 3080 (driver 610.74), 32 GB, WinLibs GCC 15.2.0 r7, Release.

Palworld's character creation binds buffers across adjacent registered ranges of its direct memory. With APS5_PROFILE_DRAW=1 on my test branch, where these joins did not happen (see the caveat below), [buffers] reported 16,000-44,000 CPU copies outside imports per run (290-820 GB in total), almost all in 0x3130000000-0x31a0000000, and draw resources took 6-7.6 s of every 10 s (upload almost all of it). A local trace of the first regions of 1 MiB or more showed three shapes, each starting at a range's start:

  • exactly over two ranges: 0x3125480000+0x800000 over 0x780000 + 0x80000;
  • ending inside the second of two ranges larger than the 8 MiB window: 0x3137de0000+0x18f0000 over 0x1010000 + 0xfd0000;
  • ending inside the last of three ranges, some smaller than the window: 0x3139de0000+0xa80000 over 0x810000 + 0x60000 + 0x790000.

On main ffa2a6ecd + #5003 + this PR (a7851d475, with #4515 in it), the same scene logs 9 copies outside imports (under 1 MiB in total), upload falls to 9 ms per 10 s, and the menu ran at 20-22 FPS against 15-17 on the branch that still copied. Character creation is then bound by pipeline compiles on a cold cache and by per-draw cost (about 20,000 draws per 10 s) once warm, at about 1.2 FPS, so the copies were the first wall, not the last.

One caveat: when I merged this PR by hand together with #290 (host import windows), the joins did not happen and the copies stayed. I did not find why, so it may be my merge; mentioning it in case the two meet.

AI-assisted (Claude Code); I ran the above on my machine.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6151477679 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4517#issuecomment-6151477679). Originally posted by [ps54all](https://github.com/ps54all) on 2026-10-13T17:37:38Z. --- Palworld (PPSA23126, UE5) data point, Windows 11, RTX 3080 (driver 610.74), 32 GB, WinLibs GCC 15.2.0 r7, Release. Palworld's character creation binds buffers across adjacent registered ranges of its direct memory. With `APS5_PROFILE_DRAW=1` on my test branch, where these joins did not happen (see the caveat below), `[buffers]` reported 16,000-44,000 CPU copies outside imports per run (290-820 GB in total), almost all in 0x3130000000-0x31a0000000, and draw `resources` took 6-7.6 s of every 10 s (`upload` almost all of it). A local trace of the first regions of 1 MiB or more showed three shapes, each starting at a range's start: - exactly over two ranges: `0x3125480000+0x800000` over `0x780000 + 0x80000`; - ending inside the second of two ranges larger than the 8 MiB window: `0x3137de0000+0x18f0000` over `0x1010000 + 0xfd0000`; - ending inside the last of three ranges, some smaller than the window: `0x3139de0000+0xa80000` over `0x810000 + 0x60000 + 0x790000`. On `main` ffa2a6ecd + #5003 + this PR (a7851d475, with #4515 in it), the same scene logs 9 copies outside imports (under 1 MiB in total), `upload` falls to 9 ms per 10 s, and the menu ran at 20-22 FPS against 15-17 on the branch that still copied. Character creation is then bound by pipeline compiles on a cold cache and by per-draw cost (about 20,000 draws per 10 s) once warm, at about 1.2 FPS, so the copies were the first wall, not the last. One caveat: when I merged this PR by hand together with #290 (host import windows), the joins did not happen and the copies stayed. I did not find why, so it may be my merge; mentioning it in case the two meet. AI-assisted (Claude Code); I ran the above on my machine.
AlxcBTW commented 2026-10-13 17:38:57 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by AlxcBTW on 2026-10-13T17:38:57Z.


Thank you @ps54all, that's a strong independent data point. On Palworld, 290–820 GB of outside-import copies drop to under 1 MiB, and the menu goes from 15–17 to 20–22 FPS.

On your caveat with #290, it's not your merge. We hit the same thing on Sword of the Sea: #290's replace loop refuses a join whose new import would replace imports that are still held. With both PRs in, the join is never made and the buffer keeps copying. In our main-based lab build it was 639 GB of copies with both in, and back to the joined behaviour after a small fix that lets a join replace held imports. I'll offer that fix on #290, since it belongs where the two meet.

This PR needs a rebase now that #4515 is merged; that's next on my list.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6151500827 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4517#issuecomment-6151500827). Originally posted by [AlxcBTW](https://github.com/AlxcBTW) on 2026-10-13T17:38:57Z. --- Thank you @ps54all, that's a strong independent data point. On Palworld, 290–820 GB of outside-import copies drop to under 1 MiB, and the menu goes from 15–17 to 20–22 FPS. On your caveat with #290, it's not your merge. We hit the same thing on Sword of the Sea: #290's replace loop refuses a join whose new import would replace imports that are still held. With both PRs in, the join is never made and the buffer keeps copying. In our main-based lab build it was 639 GB of copies with both in, and back to the joined behaviour after a small fix that lets a join replace held imports. I'll offer that fix on #290, since it belongs where the two meet. This PR needs a rebase now that #4515 is merged; that's next on my list.
AlxcBTW commented 2026-10-13 18:24:32 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by AlxcBTW on 2026-10-13T18:24:32Z.


Rebased onto current main now that #4515 is merged. Git dropped the #4515 commit as already applied, so this branch is now only the exact-cover join commit. The fork CI is green on Windows and Linux.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6152317416 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4517#issuecomment-6152317416). Originally posted by [AlxcBTW](https://github.com/AlxcBTW) on 2026-10-13T18:24:32Z. --- Rebased onto current main now that #4515 is merged. Git dropped the #4515 commit as already applied, so this branch is now only the exact-cover join commit. The fork CI is green on Windows and Linux.
TideOPL commented 2026-10-13 18:29:09 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by TideOPL on 2026-10-13T18:29:09Z.


Thanks for this. It's in our Minecraft Dungeons II (PPSA16064) test build, and we hit a case it still leaves on the CPU path. I've opened #5372 on top of this PR (it includes your commit) instead of changing the behaviour here, so you can choose what to take.

  • The case. A 1.4–1.5 MiB writable buffer starts at one registered piece and ends inside a later piece that's registered a moment later. For example, 0x305fca0000+0x160000 over 0x110000 + 0x30000 + part of 0x50000. When the first bind comes before the 8 MiB window is full, importRun imports the first piece alone and joinedRun refuses the partial cover. The buffer is then copied on every draw: about 40k copies in 25 s, and about 280 resource builds per frame. About half the runs land there: p50 113–131 ms against 92–97 ms.
  • #5372. It joins every range a bound buffer crosses, whole. That flips the "two pieces no larger than the import window were joined" check from #4515, which is why it's a separate PR. Host-import churn didn't change in our runs: 31–33 joins and 1.2–2.1k retirements per run, before and after.
  • Also affects this PR. #5372 fixes an upload-path case that is reachable with this PR alone. An exact-cover join, then the window around it fills, then a bind across the join's end. importAllocation hands that region the joined import found at its start, and Descriptor fails with rounded up to its view range exceeds its GPU owner. The growth check in #5372's importJoinTests reproduces it.

#5372's joins would hit the same #290 refusal, so your fix there covers both.

Numbers and test details are in #5372. Happy to fold it into this PR instead if you prefer.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6152398867 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4517#issuecomment-6152398867). Originally posted by [TideOPL](https://github.com/TideOPL) on 2026-10-13T18:29:09Z. --- Thanks for this. It's in our Minecraft Dungeons II (PPSA16064) test build, and we hit a case it still leaves on the CPU path. I've opened #5372 on top of this PR (it includes your commit) instead of changing the behaviour here, so you can choose what to take. - **The case.** A 1.4–1.5 MiB writable buffer starts at one registered piece and ends **inside** a later piece that's registered a moment later. For example, `0x305fca0000+0x160000` over `0x110000 + 0x30000 + part of 0x50000`. When the first bind comes before the 8 MiB window is full, `importRun` imports the first piece alone and `joinedRun` refuses the partial cover. The buffer is then copied on every draw: about 40k copies in 25 s, and about 280 resource builds per frame. About half the runs land there: p50 113–131 ms against 92–97 ms. - **#5372.** It joins every range a bound buffer crosses, whole. That flips the "two pieces no larger than the import window were joined" check from #4515, which is why it's a separate PR. Host-import churn didn't change in our runs: 31–33 joins and 1.2–2.1k retirements per run, before and after. - **Also affects this PR.** #5372 fixes an upload-path case that is reachable with this PR alone. An exact-cover join, then the window around it fills, then a bind across the join's end. `importAllocation` hands that region the joined import found at its start, and `Descriptor` fails with `rounded up to its view range exceeds its GPU owner`. The growth check in #5372's `importJoinTests` reproduces it. #5372's joins would hit the same #290 refusal, so your fix there covers both. Numbers and test details are in #5372. Happy to fold it into this PR instead if you prefer.
TideOPL commented 2026-10-13 18:35:35 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by TideOPL on 2026-10-13T18:35:35Z.


@AlxcBTW Above

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6152513169 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4517#issuecomment-6152513169). Originally posted by [TideOPL](https://github.com/TideOPL) on 2026-10-13T18:35:35Z. --- @AlxcBTW Above
AlxcBTW commented 2026-10-13 18:38:04 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by AlxcBTW on 2026-10-13T18:38:04Z.


@TideOPL thanks, that's a real gap. The first piece gets imported alone before the window fills, and then the partial cover is refused. I'd keep this PR as it is: it's rebased and green, and it has two independent measurements (Palworld, SotS). #5372 can follow it as the general join, since it changes #4515's "two pieces no larger than the window" expectation and is better reviewed on its own. I'll run #5372 on Sword of the Sea in our next main-based row (current main + the join stack) and post the outside-import copy counts there, so it gets a second title next to Minecraft Dungeons II.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6152557432 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4517#issuecomment-6152557432). Originally posted by [AlxcBTW](https://github.com/AlxcBTW) on 2026-10-13T18:38:04Z. --- @TideOPL thanks, that's a real gap. The first piece gets imported alone before the window fills, and then the partial cover is refused. I'd keep this PR as it is: it's rebased and green, and it has two independent measurements (Palworld, SotS). #5372 can follow it as the general join, since it changes #4515's "two pieces no larger than the window" expectation and is better reviewed on its own. I'll run #5372 on Sword of the Sea in our next main-based row (current main + the join stack) and post the outside-import copy counts there, so it gets a second title next to Minecraft Dungeons II.
oneandonlydean commented 2026-10-13 19:35:19 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-13T19:35:19Z.


#4515 is merged now. Please rebase this onto main so it carries only its own commit; the copy of #4515 in this branch (3fbd63fb0) now conflicts with the merged one.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6153602600 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4517#issuecomment-6153602600). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-13T19:35:19Z. --- #4515 is merged now. Please rebase this onto main so it carries only its own commit; the copy of #4515 in this branch (`3fbd63fb0`) now conflicts with the merged one.
oneandonlydean commented 2026-10-13 22:38:01 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-13T22:38:01Z.


TideOPL's note above says this PR alone can reach a throw: after an exact-cover join, once the window around it fills, a bind across the join's end gets the joined import from importAllocation and Descriptor fails with rounded up to its view range exceeds its GPU owner. Does the growth check in #5372's importJoinTests fail on this head? If it does, the fix belongs in this PR, since it turns a copied buffer into a stop.

My rebase note was out of date; the branch is fine as it is.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6156706955 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4517#issuecomment-6156706955). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-13T22:38:01Z. --- TideOPL's note above says this PR alone can reach a throw: after an exact-cover join, once the window around it fills, a bind across the join's end gets the joined import from `importAllocation` and `Descriptor` fails with `rounded up to its view range exceeds its GPU owner`. Does the growth check in #5372's `importJoinTests` fail on this head? If it does, the fix belongs in this PR, since it turns a copied buffer into a stop. My rebase note was out of date; the branch is fine as it is.
TideOPL commented 2026-10-13 22:45:21 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by TideOPL on 2026-10-13T22:45:21Z.


@oneandonlydean Yes. On this head (f6c289ea4) I added only the growth step to importJoinTests: after the exact two-piece join, register a third 64 KiB piece and bind 32 bytes across the join's end, with no expectations. It fails with AGC graphics: guest buffer view …+0x20 rounded up to its view range exceeds its GPU owner …. With main's GuestBufferMemory.cpp the same bind passes; it's copied. So I agree it belongs here.

@AlxcBTW The fix in #5372 is two lines in UploadFinish, after the importAllocation call for a region a window run covers:

if (entry != nullptr && region.end > entry->base + entry->bytes) entry = importJoined(context, state, region.begin, region.end, importRanges());
if (entry != nullptr && (region.begin < entry->base || region.end > entry->base + entry->bytes)) entry = nullptr;

On this PR, importJoined refuses the partial cover, so the region falls back to a copy, as on main. Feel free to take it with the growth step; I'll drop it from #5372 once it's in here.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6156807458 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4517#issuecomment-6156807458). Originally posted by [TideOPL](https://github.com/TideOPL) on 2026-10-13T22:45:21Z. --- @oneandonlydean Yes. On this head (`f6c289ea4`) I added only the growth step to `importJoinTests`: after the exact two-piece join, register a third 64 KiB piece and bind 32 bytes across the join's end, with no expectations. It fails with `AGC graphics: guest buffer view …+0x20 rounded up to its view range exceeds its GPU owner …`. With `main`'s `GuestBufferMemory.cpp` the same bind passes; it's copied. So I agree it belongs here. @AlxcBTW The fix in #5372 is two lines in `UploadFinish`, after the `importAllocation` call for a region a window run covers: ```cpp if (entry != nullptr && region.end > entry->base + entry->bytes) entry = importJoined(context, state, region.begin, region.end, importRanges()); if (entry != nullptr && (region.begin < entry->base || region.end > entry->base + entry->bytes)) entry = nullptr; ``` On this PR, `importJoined` refuses the partial cover, so the region falls back to a copy, as on `main`. Feel free to take it with the growth step; I'll drop it from #5372 once it's in here.
AlxcBTW commented 2026-10-13 23:13:39 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by AlxcBTW on 2026-10-13T23:13:39Z.


@TideOPL thanks. Your two lines are in ea2ea5518 (with you as co-author), and importJoinTests now does your growth step: after the exact two-piece join it registers a third 64 KiB piece and binds 32 bytes across the join's end. Fork CI for the head: run 38482881106, running. You can drop it from #5372 once that's green. @oneandonlydean

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6157183850 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4517#issuecomment-6157183850). Originally posted by [AlxcBTW](https://github.com/AlxcBTW) on 2026-10-13T23:13:39Z. --- @TideOPL thanks. Your two lines are in `ea2ea5518` (with you as co-author), and `importJoinTests` now does your growth step: after the exact two-piece join it registers a third 64 KiB piece and binds 32 bytes across the join's end. Fork CI for the head: [run 38482881106](https://github.com/AlxcBTW/AnyPS5/actions/runs/38482881106), running. You can drop it from #5372 once that's green. @oneandonlydean
AlxcBTW commented 2026-10-13 23:36:43 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by AlxcBTW on 2026-10-13T23:36:43Z.


Fork CI for ea2ea5518 is green on Linux and Windows (run 38482881106), the growth step in importJoinTests included.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6157477627 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4517#issuecomment-6157477627). Originally posted by [AlxcBTW](https://github.com/AlxcBTW) on 2026-10-13T23:36:43Z. --- Fork CI for `ea2ea5518` is green on Linux and Windows ([run 38482881106](https://github.com/AlxcBTW/AnyPS5/actions/runs/38482881106)), the growth step in `importJoinTests` included.
oneandonlydean commented 2026-10-14 00:46:21 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-14T00:46:21Z.


Rebased onto main to resolve the conflict in docs/dev/debt/libSceAgcDriver.md after #4603 (kept both entries); no other change.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6158329910 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4517#issuecomment-6158329910). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-14T00:46:21Z. --- Rebased onto main to resolve the conflict in `docs/dev/debt/libSceAgcDriver.md` after #4603 (kept both entries); no other change.
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!4517
No description provided.