fix(agc): pin the import ceiling only on memory exhaustion #8091
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/8091"
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 JJenkx on 2026-10-19T21:10:46Z.
What
vkAllocateMemoryreturningVK_ERROR_INVALID_EXTERNAL_HANDLEorVK_ERROR_UNKNOWNdoes not by itself mean the host heap is exhausted. Since #6479, three such failures in a row, or one near the budget, pin a permanent ceiling at the bytes live at that moment. In affected titles that is a few MiB, and it disables imports for the rest of the run.With this change, only
VK_ERROR_OUT_OF_HOST_MEMORYandVK_ERROR_OUT_OF_DEVICE_MEMORYpin the ceiling. Any failedvkAllocateMemorystill setsallocationFailed, so the default budget then follows the driver'sVK_EXT_memory_budgetheadroom, as onmain. This was revised on 2026-10-27 after review. The earlier head also stopped non-OOM failures from switching to the reported budget, which removed that protection on RADV, where a refused import under pressure never returns an OOM code.RADV error ambiguity: Mesa 26.2.4
radv_amdgpu_winsys_bo_from_ptrmaps a failedac_drm_create_bo_from_user_memcall toVK_ERROR_INVALID_EXTERNAL_HANDLEwithout distinguishing its cause. A real user-pointer/GTT allocation failure can therefore reach this non-OOM path too. The classification change prevents unsupported mappings from automatically shrinking the ceiling, but does not establish safe admission under physical pressure. The smaller-GTT validation blocker below remains material; injected Vulkan return codes do not replace it.Current status (2026-10-28)
On head
1c7f19e716(one commit onmain801d5b9bc1):vkAllocateMemory, the default budget follows the driver'sVK_EXT_memory_budgetreport, exactly as onmain. Only the permanent ceiling pin is now limited to OOM codes, as the reviewer asked. This PR no longer changes admission on low-GTT systems, though I have not run one.mainbuilt from exactly801d5b9bc1, the title crashes at about 30 s in 3 of 3 runs, after the ceiling is pinned at 77 MiB. With this PR it ran 150 s in 3 of 3 runs at about 33 FPS (pairs). Over five 150 s runs this PR crashed once. The earlier association with crashes was measured against an older base that did not crash.mainstalls on the FMOD start-up logo in 2 of 2 runs, with a 77 MiB ceiling against a 51,060 MiB reported heap budget. With this PR it reaches the System settings screen in 2 of 2 runs (pair).mainruns at 16.9 FPS: the budget is lowered to about 70 MiB, and every storage-image write-back (9.8 GB per 10 s) goes through the CPU. With this PR it runs at a capped 60 FPS, with all write-backs done on the GPU into imported memory (comment). Its output is black in both arms, a separate issue.b6fe513b9, five alternating launches per arm. With this PR: 80 to 83 presents per 20 s window every time, and the ceiling is never lowered. On the base: one launch hung at boot, and the other four gave 21 to 132 presents, with the ceiling lowered 10 to 21 times to 776 to 1,298 MiB. Peer-reported; not reproduced locally.Older results below refer to earlier heads and bases, as labelled.
Tested
Revision
1c7f19e716(2026-10-27), one commit onmain801d5b9bc1. Linux 7.2.9, RX 6650 XT, RADV Mesa 26.2.4. Results: comment. Everything below this paragraph refers to the earlier head71d29197ffand its pins.Rebased without merge commits onto
7ab4b2e5610c3d4328c83566cba488eb82972c9c, head71d29197ffb2142d3a9e3a7320437ec43d7dcdde. Clean merge against newer mainf47c85663404ecd27764bf0c6f1adaa44922c423; conventions and whitespace checks pass. No other PR changes are included.Linux 7.2.9-arch1-1, Ryzen 9 7950X, RX 6650 XT, RADV Mesa 26.2.4:
ctest --test-dir build-full -R '^(agc_driver_graphics|agc_driver_host_import_failure_handles)$' -V: 2/2 pass on each.ANYPS5_REQUIRE_VULKAN=1,ANYPS5_NO_SHADER_CACHE=1,VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation, explicit layer path and RADV ICD; loader logs confirm the Khronos layer was inserted, no VUIDs or skips. The device test supplies actual-layer coverage separately from the mocked graphics fixture.dead21e87cc2a0916d898cac1bb66ab3d608c314(candidate tests, unchanged main implementation) fails withallocation error -1000072003 incorrectly changed the host import budget. Candidate source and build restored afterward.Historical standalone Lodoss PPSA05347 regression, before #7465 merged. A fresh pair compares unmodified main
9f4ddf7cf985d80e2885ee3942fe48871e4a5e5awith only this change (bb414a0aab5b1a1d168f7e4304035a874d2b7d0c). These runtime pins differ from the rebased validation pins above. Same machine, 3840x2160, copied warm-cache seed (625 files), save seed (3 files), input schedule and 250-second close; screenshots at 190/240 seconds show the same stationary tutorial scene. Both exit 0, native PIDs disappear and the diagnostic udmabuf setting returns from 8192 to 64 MiB. Native captures have validation disabled; focused layer validation is separate.tools/trace_digest.pysummaries, seconds 200:30:9f4ddf7cf985bb414a0aab5bObserved presents/s: 52.65 versus 29.65. Main reports 19 budget reductions and 48 invalid-handle failures; the change reports zero reductions/refusals but 472,840 invalid-handle failures and 711,825 successful imports across the run. Repeated failures cover 484 exact virtual-address/size spans; one recurs 64,460 times. Address reuse alone does not prove backing identity, so caching failures solely by address would be unsafe.
This is one ordered diagnostic pair, not a general performance claim. Neither trace dropped events. A two-second compiler/linker monitor found no overlap (126 samples/run, maximum gap 2.02 seconds); short jobs could be missed and other host workloads were not comprehensively captured.
performance_comparison_validtherefore remains false in the machine report. Subsequent isolation and smaller-GTT feedback are summarized below; the standalone retry and pressure limitations remain unresolved.Full evidence archive: paired traces, native logs/screenshots, protocols, cache/save manifests, compiler monitor, official digests, failure recurrence and main/candidate/negative-control validation. Download verified SHA256
e2ec9076db8c0d92a54f083597fac597fa8c14c65f28863ba88b3bde1e29035b.Independent contributor evidence: alfalfa-star tested Kena: Bridge of Spirits PPSA01802 02.008.000 on an RX 9070 XT / i7-13700KF, main
3e7d1d297versus this head merged onto that main (ac17c9ece), in three alternating rounds from a fixed forest-title save. Reported frame p50 was 1532–2441 ms on main versus 73–81 ms with this fix; budget reductions fell from 22–37 per run to zero, with no crash or GPU reset in six runs. These are peer-reported results, not locally reproduced. The displayed candidate trace dropped events, limiting detailed slice interpretation; no OOM occurred, so these runs do not validate the exhaustion path. This supports title-dependent benefit but does not resolve the PPSA05347 eager-import regression above; the PR remains draft.Subsequent evidence and remaining blockers
Lodoss isolation on pinned main
525e299fc085measured main / this PR / this PR plus #7465 / #7465 alone at 51.65 / 29.73 / 58.26 / 59.94 presents/s in the same stationary tutorial. This was one ordered set, not a reverse-order repeat. #7465 alone was sufficient for the gain; the combined result does not establish a benefit from #8091. Focused validation was 16/17 on each variant, with the same baseline guest-memory-lifetime failure and fence-reset VUID. These results do not replace the standalone regression above.The development worker measured Minecraft Dungeons II PPSA16064 on this PR's base
7ab4b2e561and head71d29197ff, alternating base/PR/base/PR with identical warm-cache and save seeds, no concurrent build, and complete traces. At the Accessibility menu, frame p50 was 2725.2 / 162.0 / 2509.1 / 164.9 ms. The linked report includes the official summary lines and downloadable traces. This is menu evidence on one machine, not gameplay or general stability evidence.Default memory-pressure admission remains unresolved. 3mro777o's Stellar Blade PPSA13195 report compares main
11bb53a34with this change on an RX 6700 XT with about 7.9 GiB GTT. A host-pressure monitor terminated main at 175 s and the second default-budget candidate run at 44 s; other candidate runs crashed with causes not established. These are peer-reported single runs without frame-time traces. As confirmed in the code review, the default uses reported heap headroom only after an OOM allocation error; pressure can surface elsewhere first. Correct error classification does not make that admission policy pressure-safe. This PR remains draft pending the standalone retry and pressure follow-ups.Ghost of Yōtei integration provenance correction: filter-on/off observations used different builds, including uncommitted changes. They do not isolate this PR's loading, pressure or frame-time effect.
Repeated Lodoss composition test on pinned main
b5d763770aused main / this PR / this PR + #7465 / this PR + #7465 / this PR / main, with matching cache/save seeds, inputs and a 200:30 trace window. The clean final main run measured 51.71 FPS; this PR alone measured 30.70 and 33.48 FPS, while both combined runs held 59.94 FPS. The first main run overlapped up to 22 compiler processes and measured 40.85 FPS. Map-time import attempts fell from roughly 730–770 thousand with this PR alone to 170 with #7465 alongside. All six runs closed cleanly, restored the diagnostic setting and produced traces without dropped events. This supports #7465 as a companion policy for map-churning titles; it does not establish that this PR alone is safe to merge or that it adds a gain over #7465 alone.Additional standalone stability blocker: JUMANJI PPSA03973 testing observed no crashes in four 188-second base runs but four crashes in five candidate runs. GDB located null reads in guest code; the cause remains unresolved, so this is an association with the candidate rather than an established root cause. The follow-up scope report records no crashes in the bounded Minecraft Dungeons II, Super Meat Boy 3D and Afterimage runs. Those other-title results do not resolve JUMANJI or the smaller-GTT pressure concern. The PR remains draft.
hugodearaujo's LEGO Horizon Adventures PPSA14632 01.004.000 report (Linux 7.2.11, RX 9070 XT, RADV Mesa 26.2.5): on
main342ac2eda0with #8881 and an emptyuecommandline.txt, the first imports fail with-1000072003. The budget is lowered to 82 MiB, against a reported 15,521 MiB host-heap budget, and by 24 minutes 2.4 million imports have been refused. The boot logos take about 24 minutes, and the run segfaults on the next loading screen before reaching the menu. With this PR's head71d29197ffon the same base, the budget is never lowered and the failed imports fall back to copies one by one. The main menu appears in about 3 minutes, and New Game reaches the first playable scene at about 9.5 minutes (four runs). These are progress times from runs with the log redirected to a file, not a performance report.Protocol-compliant Lodoss reruns (game output on a terminal, seeds restored per run, scene-matched): this PR alone on its merge base
7ab4b2e561:main53.43 / 53.47 FPS against this PR 34.03 / 34.90. Composition on pinnedmain94fbb8cea8:main43.89 / 53.02, #7465 59.94 / 59.94, #7465 + this PR 59.81 / 59.74. With #7465 present the standalone Lodoss regression is essentially gone. These replace the earlier, log-redirected Lodoss figures above for any claim.johnmaia’s Epic Mickey: Rebrushed PPSA15657 report, Linux/i3-12100/RX 7600 RADV: main
933c0e4f1reportedly lowers the import budget to about 87 MiB after non-OOM import failures and runs at a reported 0.76–0.88 FPS in-level. This PR alone aborts before gameplay in two runs withguest buffer has no GPU owner. This PR plus #10304 reaches the level in two runs, with reported 6.6–7.2 FPS and no budget lowering. The reporter’s bisect attributes the large slowdown to the #6479 merge. These are independent reported in-level observations; no downloadable official paired summaries/traces accompany that comment, and they were not reproduced locally. The report names invalid external handles but gives-13; the pinned Vulkan headers define-13asVK_ERROR_UNKNOWNandVK_ERROR_INVALID_EXTERNAL_HANDLEas-1000072003, so the exact return code needs the original failure line. Both codes are outside this PR’s two OOM cases. #10304 is a separate overlay-dissolution owner-retention fix; it is a tested title composition, not a build dependency of this error-classification change. This does not establish the cause of JUMANJI’s separate guest null-read crashes or validate smaller-GTT admission.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)Additional contributor evidence, with an unresolved stop: @hugodearaujo tested Skyrim PPSA03747 01.001.010 on RX 9070 XT / RADV 26.2.5, Linux, with main
88795ed448plus #11506/#11507, then this head71d29197ff. Invalid-handle failures reduced the base import ceiling to zero despite available budget; candidate imports continued. Their surviving candidate run improved the reported opening-cart interval, but one of two candidate runs stopped presenting around 200 s on threeWAIT_REG_MEMlabel timeouts. The cause is uninvestigated, and the performance figure excludes that stopped run. This adds a positive admission observation and a separate stability limitation; it does not clear the smaller-GTT admission question, the JUMANJI excess-crash blocker or this title's stop. The PR remains a technical draft. Original report with setup, counts and failure details.Imported from boykopovar/AnyPS5. Originally posted by JJenkx on 2026-10-19T22:20:56Z.
Follow-up on the draft's import-churn regression: the combined local stack now reaches approximately 60 presents/s in Lodoss PPSA05347's stationary opening forest. Two matched pairs against pinned main
903cbbd5ba31, in opposite execution orders, give main/change 50.41/59.94 and 50.73/59.91 presents/s. Both pairs use the same machine, scene, settings and independently cloned warm caches. The candidate's shutdown import counts fell to 174–175 successful imports with zero refusals or failures, compared with main's roughly 11,200 successes, over one million refusals and 5,600–5,700 failures.This combines this PR with #4449, #7465, #7849 and a local backing-descriptor ownership repair shared with #4449's author. It does not isolate this PR, establish that this PR alone is faster, or replace the standalone regression recorded above. I am leaving it in draft pending a dependency-aware standalone assessment. Movement/attack coverage is being tested separately; the benchmark scene is stationary.
Official summary lines, complete traces, screenshots, source composition and same-machine focused Vulkan validation evidence. Candidate validation passed 20/20 without VUIDs. The main control failed its guest-memory-lifetime test with
VUID-vkResetFences-pFences-01123; the evidence records that failure rather than calling the control clean.AI-assisted investigation and testing.
Imported from boykopovar/AnyPS5. Originally posted by JJenkx on 2026-10-20T04:09:51Z.
Follow-up isolation on pinned main
525e299fc085c400de4a703c6b1ab105eefb50c7: removing #4449 and #7849 from the earlier combined experiment still reproduces the budget-only slowdown, while adding #7465 largely removes it in this stationary Lodoss PPSA05347 scene.The budget-only run made 720,568 successful imports and 846,997 failed attempts; budget plus deferred imports made 174 successes and 112 failed attempts. All recorded failures were
vkAllocateMemory: -1000072003. These are whole-run counters, not just the 30-second trace window. This supports small-map eager import churn as a major contributor to the standalone regression; it does not establish that this PR is beneficial once #7465 is present. The subsequent #7465-only control measured 59.94 presents/s, made 121 successful imports, refused 63 and failed 75, with three budget cuts. This isolates #7465 as sufficient for the observed gain over pinned main in this scene. Adding this PR did not improve that result (58.26 versus 59.94); one run per variant does not establish the size of a small regression. This PR remains draft; no standalone performance benefit is claimed.Protocol: same RX 6650 XT, RADV Mesa 26.2.4, Linux, 3840x2160, stationary opening tutorial, settings/input schedule, and independently cloned identical warm-seeded caches. Sequential order main → budget → budget+deferred → deferred-only; no reverse-order repeat in this set. Official trace window 200:30 seconds; no dropped trace events. All four 240-second screenshots were visually inspected and show the same scene with readable UI. Native exits were 0, PIDs disappeared and kernel configuration was restored. This is not cold-cache, Windows, sustained 60 FPS or full-game evidence.
Focused Vulkan validation was 16/17 on each of the four variants, with the same baseline
guest prefix unmap failed/VUID-vkResetFences-pFences-01123inagc_driver_guest_memory_lifetime. No new VUID, missing-layer or skipped-test result. The deferred variant adjusts the existing eager-accounting fixture from 64 KiB to 128 KiB to match #7465; its added 64 KiB first-GPU-use test is retained. This test-only adjustment is included in the source patch.Complete traces, official summary JSONL, source composition/patch, commands, cache manifests, validation/native logs and screenshots.
Additional deferred-only control trace, summaries for all four variants, source patch, cache manifest, validation/native logs and screenshots.
Official summary lines (main, budget-only, budget+deferred, deferred-only respectively):
Local heads: main
525e299fc085c400de4a703c6b1ab105eefb50c7; budget50202a158fcaf33eef0a0d844268e93c0a139b20; budget+deferred+fixture adjustment1a42f919a6e92d9c34195aa685256c2f55909ede. #7465 authorship is preserved. Deferred-only control headdf77f5b03af90adea68c72a1d818fd2539c118e5. Main has advanced since this pinned comparison.AI-assisted investigation and testing.
Imported from boykopovar/AnyPS5. Originally posted by alfalfa-star on 2026-10-20T17:45:34Z.
@JJenkx Data from a second title, where this fix is the difference between unplayable and normal: Kena: Bridge of Spirits (PPSA01802) 02.008.000.
Setup: RX 9070 XT (RADV GFX1201), RADV Mesa 26.2.4, Linux 7.2.9, i7-13700KF. Forest title scene from a fixed save, no input,
APS5_TRACE_SECONDS=100:30, shared warm shader cache.main3e7d1d297built at its own commit, against this PR's head 1d6febae0 merged onto thatmain(merge ac17c9ece, no conflicts); three alternating rounds.agc_driver_graphics_testspasses on the merge.On
mainthe first three map-time imports fail with-1000072003within a few seconds of boot, and the budget is never usable again:main3e7d1d297mainvkAllocateMemoryfailures-1000072003-1000072003No out-of-memory result appeared in any run, so the remaining ceiling path was not exercised. The invalid-handle failures with this PR are about 40 per second at most (split map / build / access as 1.8k / 3.7k / 0.4k in round 1), well below the 262k failures and 765k imports per Lodoss run in your description. The eager-import churn you found does not show at that scale here. No crash or GPU reset in the six runs.
main3e7d1d297, round 1:tools/trace_digest.pyseconds 100:30 from present 450: 13 presents, frame p50 2441.4 / p90 2554.8 / p99 2601.6 / max 2601.6 ms, GPU busy 61.2 ms per present
AMD Radeon RX 9070 XT (RADV GFX1201), radv Mesa 26.2.4-arch1.1, Linux 7.2.9-arch1-1, 3840x2160, commit
3e7d1d297c, dropped: noSlowest frames (largest slices inside each, inclusive)
Threads (ms per frame)
Largest slices (ms per frame, inclusive, all threads): Driver.Packet 4435.0, Graphics.Draw 2305.5, Graphics.Draw.draw_and_resource_release 2216.0, Driver.Packet.memory_wait 2041.1, Driver.Packet.draw 1427.7, Driver.Draw 1427.1
Longest waits
Largest GPU batches (GPU ranges inside, and the CPU slices that recorded each, inclusive)
this PR on
main(ac17c9ece), round 1:tools/trace_digest.pyseconds 100:30 from present 961: 368 presents, frame p50 81.3 / p90 86.3 / p99 103.2 / max 117.5 ms, GPU busy 45.2 ms per present
AMD Radeon RX 9070 XT (RADV GFX1201), radv Mesa 26.2.4-arch1.1, Linux 7.2.9-arch1-1, 3840x2160, commit ac17c9ece2b3, dropped: yes
Slowest frames (largest slices inside each, inclusive)
Threads (ms per frame)
Largest slices (ms per frame, inclusive, all threads): Driver.Packet 73.2, Driver.Packet.memory_wait 56.8, batch 45.2, Graphics.Draw 24.2, Driver.WorkerWait 23.7, Driver.WorkerWait.idle_and_completion_poll 23.7
Longest waits
Largest GPU batches (GPU ranges inside, and the CPU slices that recorded each, inclusive)
AI-assisted: yes (Claude Code)
Imported from boykopovar/AnyPS5. Originally posted by JJenkx on 2026-10-21T00:46:54Z.
A fresh matched PPSA05347 (Lodoss) pair reproduces the regression on pinned main
e10b4d6190479edcabfe3f805169b76b18ffaaaaversus exactly that main plus this PR (5a40175977afa9c2222f8cb961685eca5d452128). No other PRs are included. Upstream main advanced during the comparison, so these are pinned-base results.Same machine (Ryzen 9 7950X / RX 6650 XT), stationary opening tutorial, identical warm-cache clones (625-file SHA256 manifests match), input schedule, pipeline/DMA settings and 250-second close protocol. This is one ordered pair, not a cold-cache or general speed claim.
Both runs reached matching tutorial screenshots, exited 0 with no surviving native PID, restored the udmabuf limit to 64 MiB and produced complete traces (no dropped events). Neither native log contained VUIDs; the matched focused validation runs explicitly enabled core validation, required Vulkan and disabled shader cache: both passed
agc_driver_graphicsandagc_driver_host_import_failure_handles(2/2, no skips, missing validation layer or VUIDs).The PR remains draft. Removing global budget suppression exposes repeated eager map-import failures; all failed imports in this pair were requester
map. The existing failure caches need investigation before calling this ready. This does not contradict the independently reported Kena benefit.Evidence archive: full traces and official trace-digest summaries, native logs/screenshots, source pins, protocols/results, focused validation logs and cache manifest. SHA256:
e7682c2ccb8ea5af88ca6575c6d120c72ee3203ccf92f900438d0a4257500e6c.Imported from boykopovar/AnyPS5. Originally posted by JJenkx on 2026-10-21T02:26:44Z.
Pinned Lodoss follow-up: this PR remains in draft. One ordered main / +#8091 / +#8091+#8802 comparison on main
6c12024f7d9breached the same tutorial scene on all three variants. All six 190/240-second screenshots were inspected; each shows the centered player between the stone columns and the sword/jump prompt. No visible corruption was apparent in those captures.Same machine: Ryzen 9 7950X (32 threads), RX 6650 XT RADV, Mesa 26.2.4, Linux 7.2.9, 3840×2160. Each variant started with an identical 625-file warm-cache seed and identical three-file private save seed. Same scripted input,
APS5_PIPELINED_DRAWS=1, pipeline DMA, full SPIR-V optimization, host import limit 16384 MiB; trace window200:30, close at 250 seconds.6c12024f7d9b56a11404511ecda85abc3b9bEvery recorded import failure was
vkAllocateMemory (-1000072003). The budget-only run made 737,288 imports and failed 640,560 times; its terminal log was 80 MB. Adding #8802 reduced failures to 492,094, but did not recover performance in this triplet. This is consistent with substantial remaining retry churn; these counts alone do not establish allocation identity or why a remembered failure stopped applying.All three builds passed
agc_driver_graphicsandagc_driver_host_import_failure_handleswith the actual Khronos layer inserted and no VUIDs. Native performance captures had validation disabled, no trace drops, exited zero, and restored the kernel udmabuf limit.Limits: one ordered run per variant, so run-order effects remain unmeasured; the import totals cover the full run while FPS covers only the 30-second trace window. This is diagnostic evidence and supports keeping this PR in draft. No title speedup is claimed. Next is investigating the remaining retry invalidation and repeating the relevant pair in reverse order after a supported fix.
Official trace summary lines (main, +8091, +8091+8802)
Imported from boykopovar/AnyPS5. Originally posted by JJenkx on 2026-10-21T02:31:14Z.
Correction to the preceding experiment report: another local worker has since supplied build timestamps showing that its
-j4build ran continuously from approximately 22:17–22:31 local time. That covers the entire finalmain + #8091 + #8802native run (22:21:33–22:25:46), including its 200–230-second capture. Its 27.479 FPS result therefore must not be treated as a clean performance comparison; I withdraw that timing comparison.An earlier build also overlapped the beginning of the
main + #8091run (22:13:06–22:17:19) until 22:13:49. The supplied timestamps do not place a build inside that run's later 200–230-second capture, but the run as a whole was not isolated either. The baseline ran 22:03:32–22:07:45. Treat this triplet as diagnostic evidence, not a controlled title performance comparison; replacement isolated captures are needed.The recorded import-failure counts remain observations, but do not establish a performance effect or an ownership-invalidation cause. #8091 remains draft; no speedup is claimed.
Imported from boykopovar/AnyPS5. Originally posted by 3mro777o on 2026-10-21T13:12:21Z.
Another title: Stellar Blade (PPSA13195) 01.014.001, Unreal Engine. Linux 7.2.8 (Omarchy), Ryzen 5 5600X, 16 GiB RAM, Radeon RX 6700 XT, RADV Mesa 26.2.5. GTT is 7931 MiB on this machine, smaller than VRAM.
Pins: main
11bb53a34and main + this PR cherry-picked (71d29197f), Release builds from one worktree, onlylibSceAgcDriver.prx(andlibSceVideoOut.prx) differ between the two runtime directories. Same relinked executable, same input schedule (Return every 4 s after the startup screens),APS5_PLAYGO_UNLISTED_CHUNKS=absent. A monitor stops the game with SIGTERM when system GTT use passes 85 %, because earlier unguarded runs here ran GTT out and took the compositor down with them.-1000072003import failuresRan out of memory allocating 548682072064 bytes(0x7FC0000000), SIGSEGV at 37 s, GTT 4.4 GiBAPS5_HOST_IMPORT_MIB=20480x207a900000in libc; GTT 5.6 GiBOn main the game's own fdinfo shows ~6.6 GiB GTT and ~4.6 GiB VRAM at the stop, so with imports held at ~100 MiB most of that GTT is not imports. With this PR the imports no longer collapse, but on this machine the default budget (about half of the host heap) plus the rest of the title's host-heap use exceeds GTT, and the budget does not follow the VK_EXT_memory_budget report unless an allocation fails; here exhaustion shows up at command submission, not at
vkAllocateMemory.These are single runs, not traces, and the crashes with this PR are not attributed: the 0x7FC0000000 size and the libc read could be stale data rather than anything this change does. I have not compared frame times.
AI-assisted: yes (Claude Code); results above were run on this machine.
Imported from boykopovar/AnyPS5. Originally posted by JJenkx on 2026-10-21T13:31:32Z.
Thank you; this exposes a limitation that the earlier large-RAM measurements did not cover. I checked the code at
71d29197ff:effectiveBudget()refreshes the heap report once per second, butHostImportBudgetWith()applies that report to the default only after an import allocation returns OUT_OF_HOST_MEMORY or OUT_OF_DEVICE_MEMORY. An INVALID_EXTERNAL_HANDLE failure no longer opens that gate. Thus this PR fixes the error classification while leaving the default unable to react to the reported headroom in the runs you describe. An explicit APS5_HOST_IMPORT_MIB also intentionally bypasses that report.Your results do not establish the cause of either crash, and I am not treating the 512-GiB Unreal allocation or libc read as a confirmed budget regression. They do show that the Minecraft menu frame-time improvement is not evidence of stability on a smaller-GTT system. A follow-up needs to evaluate pressure-aware default admission independently of allocation-error classification, including other heap users and the treatment of already-live imports; simply reclassifying INVALID_EXTERNAL_HANDLE as exhaustion would restore the original budget-collapse problem. I am keeping this feedback open while that follow-up is investigated.
Imported from boykopovar/AnyPS5. Originally posted by hritikutekar on 2026-10-21T13:40:45Z.
Ghost of Yōtei (PPSA26344 v02.002) data for this change, as asked in #675. RX 9070 XT, RADV Mesa 26.2.4 (plus an unrelated ACO spill fix), Linux 7.2.9. Build: Celegans12's
yotei/bestplus the same filter (onlyVK_ERROR_OUT_OF_HOST_MEMORY/VK_ERROR_OUT_OF_DEVICE_MEMORYlower the budget,github.com/hritikutekar/AnyPS5@5b4669400). Each run: boot → title menu → load → about 12 min of open-world gameplay. Every failed import is logged, so these are exact counts.Filter on, three runs:
INVALID_EXTERNAL_HANDLEfailures0x8000800000+0x800000,0x8002800000+0x800000,0x8002800000+0x400000). No span recurs beyond that, so Yōtei has no retry loop like the one in Lodoss.mapandbuild.Filter off (main's behaviour), one run: only 199 invalid-handle failures, but the budget was lowered 126 times. Once it collapsed, later imports were refused before
vkAllocateMemory, so they never failed. That's where the "~110 per run" in my #675 comment came from; the true count with imports allowed is ~3,780. That run stalled in the world load with 47k+ refused imports, ~13 ms draws and swap. The three filter-on runs reached gameplay with zero faults.So for Yōtei the cost is one failed attempt per span, all at load time, and nothing per frame. That points to the Lodoss retry cost being specific to that title. I can't give a frame-time pair against unmodified main, since main doesn't reach gameplay here.
Imported from boykopovar/AnyPS5. Originally posted by JJenkx on 2026-10-21T13:47:41Z.
Thanks for separating attempts from budget refusals and checking the spans. I checked
5b4669400e0d5ce1a2040073a88bec58a0ab7760: withAPS5_NO_IMPORT_OOM_FILTERunset, its allocation-result predicate matches this PR's OUT_OF_HOST_MEMORY / OUT_OF_DEVICE_MEMORY filter. Its filter-off switch restores counting every allocation failure; the commit also contains integration build fixes.Your three filter-on runs report 3,767–3,789 invalid-handle failures, confined to boot/world load, no span failing more than twice, and no such failures during the reported gameplay. The filter-off run's 199 failures and 126 budget reductions are therefore not evidence of fewer unsuitable spans: the subsequent 47k+ budget refusals prevent attempts from reaching the driver. This supports keeping invalid external handles separate from OOM, and distinguishes this report from Lodoss's repeated-attempt cost.
I'll retain this as your Ghost of Yōtei result on
yotei/bestwith the filter, RADV 26.2.4 and the separate ACO spill fix. It is not an unmodified-main comparison or a gameplay frame-time improvement measurement. The Stellar Blade pressure/termination report above remains unresolved; this result does not establish pressure-safe default admission on smaller GTT heaps.Could you attach the per-run logs or compact summaries and the exact common integration SHA used for both switch settings? That would make the paired evidence reproducible without treating this integration as current main.
Imported from boykopovar/AnyPS5. Originally posted by hritikutekar on 2026-10-21T14:18:36Z.
@JJenkx one correction first: the filter-off run was not the same build with the switch flipped. Exact builds (branch
hritikutekar/AnyPS5@yotei/linux-best-u1):36b2a8e35(merge of Celegans12yotei/beston main 2026-10-20) plus uncommitted local changes (including the Linux build fixes), without the filter, i.e. main's import-budget behaviour5b4669400…835fedbcfwere committed, already with the filter9b2bbdfff(contains5b4669400)So the 199 vs ~3,780 contrast compares two builds, not two switch settings on one SHA. The filter-on counts stand on their own.
Compact per-run summaries (every
[gpu] host import of … failedline; phases per run: boot until the title menu was detected (present 704–710; present 700 in the filter-off run, whose menu point was not recorded), menu until the cross press (present 1,290–1,353; 1,483 in the filter-off run), load from the press to gameplay (present ~1,740, checked by screenshots))The full logs are 22 MB (filter-off) and 875–978 MB (filter-on, profiling output), so I've summarised rather than attached them.
Imported from boykopovar/AnyPS5. Originally posted by JJenkx on 2026-10-21T14:34:04Z.
Thanks for the correction and compact summaries. I withdraw the same-build/switch interpretation in my previous reply. The filter-off run used
36b2a8e35plus uncommitted local changes; filter-on run 1 used an uncommitted working tree, and runs 2–3 used9b2bbdfff. There is no common pinned build across the two settings.I will retain the per-run counts as your observations on those integrations. They do not isolate the filter’s effect on loading, memory pressure or frame time. The filter-on runs report only invalid-external-handle allocation failures, no budget reductions, and no such failures during the observed gameplay; those observations alone do not establish that the default admission policy is pressure-safe.
The separate Stellar Blade pressure/termination report remains unresolved. No source change or new local test is claimed in this correction.
AI-assisted: yes
Imported from boykopovar/AnyPS5. Originally posted by JJenkx on 2026-10-21T21:46:27Z.
@3mro777o thanks, this matches what I see on a machine where GTT is not a factor.
What
-1000072003means on RADV. In Mesa 26.2.4,radv_amdgpu_winsys_bo_from_ptrreturnsVK_ERROR_INVALID_EXTERNAL_HANDLEfor any failure of the userptr ioctl. libdrm 2.4.134amdgpu_create_bo_from_user_mempassesAMDGPU_GEM_USERPTR_ANONONLY | REGISTER | VALIDATE. So the kernel refusing a file-backed range, refusing a range it can't pin for write, and running out of GTT or pinnable memory all come back as the same code. Before this PR, three failures in a row, or one within an eighth of the budget, collapsed the import budget to what was live, whatever the cause. This PR stops reacting to them, so they cover both cases.Would applying the heap report on these failures have helped?
effectiveBudgetonly uses theVK_EXT_memory_budgetcap afterallocationFailed, and this PR no longer sets that for-1000072003. I considered setting it again while keeping the budget collapse for the two out-of-memory codes. The report wouldn't bind in either case:HostImportBudgetForgives about 7869 − 1168 − 983 ≈ 5718 MiB, above the 3965 MiB default.So I'm not proposing that.
Crashes. Your runs 1 and 3 crashed at 4.4 and 5.6 GiB GTT, below your 85 % guard, and run 2 was stopped by the guard. I see the same pattern with JUMANJI (PPSA03973) on a Radeon RX 6650 XT, RADV Mesa 26.2.4, with 64 GiB of GTT and 11 GiB of it in use:
7ab4b2e561: 0 crashes in 4 runs, each running the full 188 s, with 13–16-1000072003failures each;71d29197ff: SIGSEGV in 4 of 5 runs (two of those under GDB), at 26–146 s; most fire just after the first input on the publisher logos. The runs I counted (jc1, jc2, jg1) log 1666–2263-1000072003failures each, on distinct ranges. The one run that didn't crash had frame p50 27.2 ms over seconds 150–175, against 310–333 ms on base.Where it crashes. I ran this PR's side under GDB, passing the write-watch SIGSEGVs through and logging each one with its registers and stack. Each run intercepts exactly one SIGSEGV, so the write-watch path never fires:
sce_module/libc.prx(converted with the title), called from its executable;mov (%rdi),%r8withrdi = 0atapp.elf+0x11c77a4.Both are on the same guest thread, and no AnyPS5 library is on the faulting frame. So the title's own code ends up with a null pointer when this PR is in. I haven't found what produces it. I ruled out three causes: the process running out of mappings or fds, the write-watch fallback, and
ImportWatchedwriting saved pages back (it only compares them). Your 0x7FC0000000-byte allocation and libc read look like the same kind of failure: the title's own code acting on a bad value.So on this title the frame-time gain from this PR comes with a crash I can't yet explain or attribute to a specific change in the import path. I'd treat that as a blocker until it's understood.
Traces with
SHA256SUMS(four base runs and the PR run that didn't crash), the gzipped logs of the crashing runs (jc2, jg1, jg5, jg6, the last three with GDB output and jg6 with the full memory map), the GDB scripts and the process samples: 20261021-pr8091-PPSA03973-crash.tar.gz (sha25692d1bc579b64aa4ef8426b59a59f5766843dc74161eadc2c6a2fb84ad9bf4538).AI-assisted: yes (Claude Code).
Imported from boykopovar/AnyPS5. Originally posted by JJenkx on 2026-10-21T23:12:06Z.
Scope of the crash in my reply above: every run of head
71d29197ffI've made, by title. "Full duration" means the run reached its scheduled end with no crash.So on this machine it's one title, plus your Stellar Blade runs. Both are Unreal titles, but Minecraft Dungeons II and Afterimage are too, and those don't crash, so the engine alone doesn't explain it.
AI-assisted: yes (Claude Code).
Imported from boykopovar/AnyPS5. Originally posted by JJenkx on 2026-10-21T23:43:22Z.
AMD/Linux composition data for the Lodoss regression noted in this PR. With #7465 alongside, it goes away on this title.
Setup
mainb5d763770aagainstmain+ this PR (71d29197ff, local merge 3bbce96100) andmain+ this PR + #7465 (local merge d837e51897).APS5_TRACE_SECONDS=200:30with 2097152 events.main, this PR, PR + #7465, PR + #7465, this PR,main.mainmainOn
main, the collapsed import budget refuses about a million map-time imports per run. This title maps and unmaps small direct-memory ranges continuously, and the copies happen to be cheaper here. With this PR the budget holds, so each of those mappings is attempted: ~730–770k imports per run, of which 370–500k fail. That costs about 35–40 % of the frame rate against the cleanmainrun.#7465 defers small imports to their first GPU use. With it on top, the map-time imports drop to 170 and both runs hold the 60 FPS cap.
So for map-churning titles like this one, this PR wants #7465 (or a similar map-time policy) with it. On the build/access-bound titles measured above (Afterimage, Super Meat Boy 3D, Minecraft Dungeons II, Jumanji), refusals are mostly by build/access, and this PR stands on its own. Earlier
main-only and #7465-only numbers on the same scene are on #7465.AI-assisted: yes (Claude Code); results above were run on this machine.
Imported from boykopovar/AnyPS5. Originally posted by JJenkx on 2026-10-22T08:01:48Z.
Narrowing the JUMANJI (PPSA03973) crash with this PR. Same head
71d29197ff, same seeded cache, saves and input schedule as before; only environment variables change:APS5_WRITE_WATCH_IMPORTS=watchAPS5_HOST_IMPORT_MIB=16What this rules out:
-1000072003handling itself. The 16 MiB runs still go through 627–727 failed imports each, and none crashes.beforeUnwatch/SaveBeforeUnwatchpath isn't taken for watched imports either.So the crash needs a large amount of guest memory imported zero-copy. That points at the imports themselves: an import covering a range it shouldn't, or GPU accesses through an import that reach title data. I haven't found which import yet. Next: a budget bisection between 16 MiB and the default, and a GDB capture with
APS5_TRACE_HOST_IMPORTon, to check whether the null object pointer the title reads (in guest heap, for examplerbx = 0x1220e1e758in run jg6) lies inside an imported range.AI-assisted: yes (Claude Code).
Imported from boykopovar/AnyPS5. Originally posted by JJenkx on 2026-10-22T09:21:49Z.
More narrowing on the JUMANJI crash with this PR, following https://github.com/boykopovar/AnyPS5/pull/8091#issuecomment-6335830460. Same head
71d29197ff, same seed, saves and inputs; only environment variables change:APS5_HOST_IMPORT_MIB=16APS5_HOST_IMPORT_MIB=256APS5_HOST_IMPORT_MIB=1024APS5_WRITE_WATCH_IMPORTS=watchAPS5_BDA_DWORD_STORES=1Each budget run reports its budget fully live ("256 MiB live of 256 MiB" and so on). The speed-up and the crash both grow with the amount of guest memory imported zero-copy.
A GDB capture at the default budget, with
APS5_TRACE_HOST_IMPORTandAPS5_TRACE_MEMORYon, crashed on the same guest thread as every earlier capture, but this time not on a null read. It's a byte store in the title's code,mov %al,0x20(%rbx,%r14,1)atapp.elf+0x39f511f. Withrbx = 0x10c0e1a790and the fault at0x10c0f50000, the loop index is about 1.27 MB past its array: a bad loop bound in title data.rbxis in a 64 KiBbuildimport,0x10c0e10000+0x10000.So far this rules out:
-1000072003handling (hundreds of failures in the 16 MiB runs, no crash);What's left is something about large numbers of live imports: GPU writes reaching title data in the same import unit through another path (dword BDA stores, storage write-backs, descriptor writes), or a visibility or ordering difference between imported and copied memory. Finding which needs per-write tracing that I haven't done. Until then I'd keep treating this as a blocker for JUMANJI. Notes and the capture are in my private evidence and can be attached.
AI-assisted: yes (Claude Code).