fix(oot): a full model heap hands the rest of its material block to the parent heap instead of crashing #2452
No reviewers
Labels
No labels
area/accessibility
area/audio
area/input
area/install
area/menu
area/mods
area/renderer
area/saves
area/tooling
area/upscaling
beanstalk: approved
beanstalk: failed
beanstalk: needs approval
beanstalk: running
beanstalk: tested
ci: approved
good first issue
gpu/amd
gpu/igpu
gpu/intel
gpu/nvidia
help wanted
kind
bug
kind
chore
kind
docs
kind
feature
kind
performance
kind
question
needs measurements
platform/linux
platform/macos
platform/steam-deck
platform/windows
preview
priority
critical
priority
high
priority
low
regression
risk
high
risk
low
risk
medium
status
blocked
status
confirmed
status
duplicate
status
invalid
status
needs-info
status
wontfix
ci: approved
No milestone
No project
No assignees
4 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Longshot!2452
Loading…
Reference in a new issue
No description provided.
Delete branch "PirateKingIsh/Longshot:fix/matblock-alloc-retry"
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?
Summary
The game could crash when a model's own small heap ran out of room while its material block was being built (f_804566e0). That build takes memory from the heap in many places and checks none of them.
host/oot_heap_retry.calready tries the block's two buffers and its GPU memory again in the heap's parents. Two things were left:Three changes:
HOS_GPU_ALLOC_REST=0turns this part off.HOS_GPU_ALLOC_TEST_FILL=<n>[,<place>]empties up to n eligible model heaps that reach a place (the call's address; left out, the object's), through their own tryAlloc. It only fills heaps of at most 4 MB and skips heap addresses among the most recent 64 filled. To see the bug with this branch's build:HOS_GPU_ALLOC_TEST_FILL=1 HOS_GPU_ALLOC_RETRY=0crashes while the game starts on #2437's line, andHOS_GPU_ALLOC_TEST_FILL=1,0x80443e2c HOS_GPU_ALLOC_RETRY=0on the crash bot's most frequent one.This description replaces the first one. The first commit (
eebb1e6d) covered the object alone; the second (ef42c238) is the same fix taken to the allocations the crash reports show, after I read that thread.Read first: the header of
host/oot_heap_retry.c("The rest of a build"), itsSITEStable,hos_oot_heap_retry,hos_oot_heap_rest_ownandhos_oot_heap_rest_end; thenOBJECT_ALLOC_SITES,REST_OWN_SITESandREST_END_SITESinnx2/oot_patches.py.Fixes #2437 (its crash line and the state behind it; whether that reporter's session is cured only they can tell).
Testing
Tested: Windows 11, RTX 5090, NVIDIA 621.24, in the game, each start from the repository's kokiri-start save with an options file and a save folder of its own. One build for all ten starts: the first commit
eebb1e6dwith the second commit's changes, built before that commit (the log'slongshot v3.2.0-13-geebb1e6d-dirty). The four files committed are the ones that were built; their hashes were checked before the commit. Main9046a8d7was merged in afterwards (206dcde9, no conflicts). Its 3 commits since8aa5ab87touch none of these four files; the game was not run again on the merged tree.Nothing tried again (
HOS_GPU_ALLOC_RETRY=0), one heap emptied at one place (HOS_GPU_ALLOC_TEST_FILL=1,<place>). Each start crashes while the game starts, on sead::MainThread:write ..., guest 0x20, lr 0x8044f684, x0 0x10, x2 0x228, x20 0, with the first eight guest frames of #2437's report (there on OptimizeChangeBanc).write ..., guest 0, lr 0x80443e30 0x8044dcb8 0x8044cf14 0x80456d48. The crash bot's groups3c3421252152,c384a6da8184,9122fc95b8c9,d69d4996d756,395dbd5efd30(10 reports) have these frames.write ..., guest 0x190, lr 0x80443240 0x8044dcb8 0x8044cf14 0x80456d48. Groups7f6d6dd2100d,93a7083f0baf,9e83ad4976d1(4 reports).write ..., guest 0, lr 0x8044f3c0 0x8044f088 0x8044f6f4 0x8044dbd0. Groupsaa6ab20813b9,5a665be1f85a,97435d2d0d74(4 reports) have these four frames under one more, 0x814f2438; why this build's record does not have that frame I did not check.Each allocation tried again alone (
HOS_GPU_ALLOC_REST=0):HOS_GPU_ALLOC_TEST_FILL=150,0x8045690c HOS_GPU_ALLOC_REST=0: the first heap is emptied at the block's first buffer. The buffer, two objects, their four buffers and f_80443000's buffer and object are each made in the parent (the log has six of the seven places), then the game crashes:write ..., guest 0x20, lr 0x8044e204 0x8044dcd4 0x8044cf14 0x80456d48, which is f_8044e020's 0x268-byte object.The fix as it ships, 150 heaps emptied at one place each (
HOS_GPU_ALLOC_TEST_FILL=150,<place>), four starts:In each of the four: 150 model heaps emptied (on sead::MainThread, SceneLowPriority, BaseProcCreateAndDeleteThread, BootupBackgroundWorkThread and OptimizeChangeBanc; in start 6 on engine::GraphicsModule too). The game starts, loads the save, makes Link adult and goes through 7 area changes (the control bridge's
ageandteleport): Gerudo Valley, Gerudo's Fortress, Gerudo Valley, Kokiri Forest, Hyrule Field, Kakariko, Gerudo Valley. NoCRASH:line, closed normally. The log has the allocation made in the parent and the rest of the build handed to it, counted to 144 builds (that line is written for the first 60 and every 16th after); one build in each start, the first, on sead::MainThread, is handed over with its GPU heap.oot:line in the log (nothing was tried again), no crash.Not run in the game: the hand-over starting at f_80443000's buffer (0x804431fc) or at the object's first buffer (0x8044efc4). Both places' retries ran in start 5, and the game-free check hands a build over from each kind of place (the block's buffer, the object, an object's buffer, f_80443000's object).
Not reproduced by play: 20 crossings of Gerudo Valley's gap as adult Link (no-clip flight) on a build of main
0e32bc10(with what became #2358), and the area changes above on this branch, never logged a failed allocation. I have no save with Epona at that bridge. The first commit's own four starts are in this PR's first comment.The game-free check
tests/test_oot_heap_retry.pyfails on main's sources (f_8044f420's tryAlloc of its 0x238-byte object (0x8044f66c) is not tried again: issue 2437's crash) and passed on this branch (14 PASS lines); both were run again after the merge, against main 9046a8d7's sources and on the then head, with the same result. The whole Windows run of the checks (tests/run_all.py) on that merged head: 837 passed, 14 failed, 129 skipped. These 14 fail on main9046a8d7too, run there on the same PC:tests/test_auto_handheld.py,tests/test_crash_dialog.py,tests/test_dev_ab.py,tests/test_dev_build.py,tests/test_dev_migrate.py,tests/test_game_menu_mouse_buttons.py,tests/test_input_movie.py,tests/test_linux_preflight.py,tests/test_pads_after_menu.py,tests/test_perf_report.py,tests/test_portable_builder_home.py,tests/test_portable_builder_startup.py,tests/test_sdiv_overflow.py,tests/test_work_lock.py.Still to test:
HOS_GPU_ALLOC_TEST_FILL=150,0x8045690c, load a save and change area a few times, expecting no crash andoot: model buffer: the rest of the build takes its memory fromlines in the log (Test Farm if a maintainer wants it, or by hand).oot:line withthe rest of the build takes its memoryinlongshot_log.txtshows it ran. The same for anyone who gets one of the crash bot's lines above by play (by hand).Measurements
Verdict: with a model's heap out of room at the object or at one of the three places the crash reports show, the game crashed on #2437's line or on the crash bot's. With this PR's tested build it played on at three of those four places; the fourth was not run.
Baseline: this PR's build with
HOS_GPU_ALLOC_RETRY=0, which leaves these allocations as main has them (main tries none of the four again). Main has no switch that empties a heap, and the crash did not come by play. All three columns are one build, made from ef42c238's tree before it was committed.Setup: Windows 11, RTX 5090, NVIDIA 621.24; the kokiri-start save, every setting at its default (an empty options file); the heap emptied by
HOS_GPU_ALLOC_TEST_FILL; what the log says, and whether the game goes on.HOS_GPU_ALLOC_RETRY=0(the allocations as main has them): this PR @ef42c238HOS_GPU_ALLOC_REST=0(each allocation alone): this PR @ef42c238ef42c238tests/test_oot_heap_retry.pyBefore, the object (asset names shortened):
Before, f_80443000's object:
Each allocation alone (the last one made in the parent, then the crash):
After, f_80443000's object (the first of the 150, and the last count line):
Not measured: frame time. The changed code runs where material blocks are built. With no switch set an area change took 3.26 to 3.41 s to Gerudo Valley (3 visits) and 3.49 to 3.75 s to the Fortress (2), against 3.33 to 3.39 s and 3.49 to 3.84 s on the first commit's build over the same route (from sending the teleport to the bridge reporting the new map; other programs were running on the PC during the second commit's start: not a controlled comparison).
Risks
the rest of the build takes its memory from heap ... (N KB free)lines falls by 620000 to 675000 KB between a start's first such line and its last, and loading the save and the areas takes its memory from the same heap. I did not run a long session.HOS_GPU_ALLOC_REST=0(the hand-over alone) orHOS_GPU_ALLOC_RETRY=0(every retry, as shipped).nx2/oot_patches.pynow names an address in each. They are the 661st and the 425th of the hot list's 680 (hottest first); at least 17 other functions of that list are named in that file already. f_8044ed60 is not on the list. The frame-time effect is not measured (Measurements).longshot_options.inior the caches.Checklist
Ready for review
main; the title is a Conventional Commit.mise run testpasses (any failure that also fails onmainis named).main, or Measurements says why there is nothing to measure.third_party/untouched; nothing GPL-incompatible.When it applies
mainand passes here.gpu/vk/switches.def.HOS_GPU_ALLOC_RESTis on by default (off is start 5 above);HOS_GPU_ALLOC_TEST_FILLis a test switch, off by default;HOS_GPU_ALLOC_TEST_FAIL(a test) takes a third number.tests/that reads changed source is updated, not weakened._Thread_localashost/hos_main.cdoes).Assisted-by:/Co-Authored-By:trailers. Claude found the cause, read the crash reports, wrote the change and the test and drove the game in the runs; I built and ran everything on my PC.Ready to merge
main, measured again or a comment says why the numbers still hold.Tested on my PC (Windows 11, RTX 5090, NVIDIA 621.24), in the game, from the repository's kokiri-start save. The crash did not come by play here, so a model's heap was emptied for real with the new test switch. With
HOS_GPU_ALLOC_TEST_FILL=1 HOS_GPU_ALLOC_RETRY=0the game crashes while it starts on the report's line (write ..., guest 0x20, lr 0x8044f684). WithHOS_GPU_ALLOC_TEST_FILL=150and nothing else it starts, loads the save and goes through 10 area changes as adult Link (Gerudo Valley and Fortress, Kokiri Forest, Hyrule Field, Kakariko) with no crash; the log shows each emptied heap's build finished in the parent heap. With no switch set the same build plays the same route and its log has nooot:line. The game-free check fails on main's sources and passes on this branch.fix(oot): a full model heap hands the rest of its material block to the parent heap instead of crashingto WIP(oot): a full model heap hands the rest of its material block to the parent heap instead of crashingWIP(oot): a full model heap hands the rest of its material block to the parent heap instead of crashingto WIP: a full model heap hands the rest of its material block to the parent heap instead of crashingWIP: a full model heap hands the rest of its material block to the parent heap instead of crashingto fix(oot): a full model heap hands the rest of its material block to the parent heap instead of crashingI pushed a second commit (
ef42c238) and replaced the description.After opening this I read the crash bot's thread (#81) for this build. None of its groups has #2437's own line, but 18 reports in 11 groups crash at the allocations right next to it: f_80443000's object and its buffer, and the second buffer of the object this PR started with. In five of those groups the log ends with the buffer retry that main already has, working, one line before the crash. The first commit covered only the object, so it would not have helped those players.
The second commit gives those allocations the same retry, and the hand-over of the rest of the build to the parent heap now follows any of them, the two buffers main already tries again included.
Tested in the game on my PC (Windows 11, RTX 5090, NVIDIA 621.24), ten starts, as the description lists them: with the retry off and a heap emptied at each of those places, the game crashes on the crash bot's lines (the same frames; for the second buffer the bot's reports have one more frame on top); with the fix on and 150 heaps emptied, it starts, loads the save and goes through 7 area changes with no crash, at each of four places. With no switch set the log has no
oot:line.What it does not claim is in Risks: the 15-report line under 0x80457138 and the deeper ones under f_80443000 are not understood or not read.
9046a8d7into fix/matblock-alloc-retryMerged main
9046a8d7in (206dcde9): a plain merge, no conflicts, no force-push. Main's 3 commits since this branch started touch none of its four files. The checks were run again on the merged head: 837 passed, 14 failed, 129 skipped; the 14 that fail also fail on main9046a8d7. The game was not run again on the merged tree; the description says so.One more thing for whoever reviews this. The reporter of #2437 followed up on the issue on 2026-11-24: it crashes every time on his save, also when he warps to Gerudo Fortress, still on nightly-801, with the same record (OptimizeChangeBanc, guest 0x20, lr 0x8044f684). That is the line this pull request's first commit is about, so his save on a build with this branch is the direct test I could not do myself.
@review
Recommendation: Request changes. The retry can still leave the rest of a build on a full heap even when a higher parent has room, and its new shared state has data races. The test also commits passages shaped from lifted game code, contrary to the repository’s game-data rule.
The change retries five more material-block allocations and moves subsequent allocations to a parent heap. Forced-full Windows runs show the approach can avoid the reported crashes, but recovery is incomplete in one parent-heap case and its memory lifetime and cross-platform behavior need further validation.
Blocking (2): must change before merging.
host/oot_heap_retry.c:342: The retry stops at the first parent that can satisfy the individual allocation, even if that parent cannot support the rest of the build. (more on the line) Do: Select a parent suitable for the whole hand-over before allocating the retried block, continuing up the chain when the nearest parent is too small, and add a test with a small intermediate parent and a sufficiently large ancestor.tests/test_oot_heap_retry.py:476: The new fixture includes passages presented as lifted game instructions, which the repository prohibits committing. (more on the line) Do: Replace the passages with independently authored synthetic fixtures containing only the minimal patch anchors and fabricated surrounding behavior, and remove the sampled game-derived sequences from the commits.Should fix (2): not blocking, but worth doing before merging.
host/oot_heap_retry.c:93: The new cached switch value is read and written without synchronization across game threads. (more on the line) Do: Initialize and publish the cached value with atomics or a once primitive, or read the switch without a shared mutable cache.host/oot_heap_retry.c:295: The test-fill counter is read outside its lock while other threads decrement it under the lock; volatile does not make those accesses atomic. (more on the line) Do: Use atomic accesses consistently for left, including its decrement, or perform every access under the same lock.Testing before merging (2) (runs on the systems it can change; it doesn't hold the recommendation)
host/oot_heap_retry.c:348: The new parent-heap hand-over needs a longer lifetime check and runs on the supported platforms it affects. (more on the line) Do: Run repeated model rebuilds and area changes on Linux and representative Tier 1 systems, tracking parent-heap use after the models are released; also test the reporter’s reproducible save if available. (@fixdoes its part first: Add accounting for the allocations made after hand-over so a repeated-load run can distinguish retained build memory from unrelated parent-heap use.)nx2/oot_patches.py:1496: The hot functions now lose register-local optimization and execute additional hooks, but their frame-time cost has not been measured. (more on the line) Do: Compare the base and head with repeated interleaved runs in material-heavy gameplay, recording frame-time distribution and 1% lows. (@fixdoes its part first: Restructure the hook insertion so these functions can retain register-local optimization, or avoid the per-allocation test hook in ordinary builds.)@fixcan do L1, L2, L3, L4, L5 and L6.Checks: Still running: 13 checks.
More: does it help, other systems, switches, what was read
Does it help: Yes, for the forced-full cases tested: four Windows starts each emptied 150 heaps and completed seven area changes without a crash, whereas the corresponding retry-disabled cases crashed. The reporter’s save and the merged head have not been run in the game, so recovery of that session remains unproven.
Other systems: The hooks affect material-block builds on several game threads and both Windows and Linux, regardless of GPU vendor. Only Windows on an RTX 5090 was exercised in game; parent-heap allocation lifetime, Linux, other Tier 1 systems and frame-time effects remain unverified.
Switches: HOS_GPU_ALLOC_REST is added on by default as a kill switch; the recovery case below prevents accepting that default as complete. HOS_GPU_ALLOC_TEST_FILL is added off by default for fault injection. HOS_GPU_ALLOC_TEST_FAIL gains an optional third count, with two-count behavior retaining zero for the new sites. All have switch-table rows.
Reviewed:
206dcde9a0against9046a8d750: Read AGENTS.md, CONTRIBUTING.md, the pull request template, relevant standards, commit messages, the changed host implementation and heap-patching sections, and the changed test and switch entries. Skimmed the remainder of nx2/oot_patches.py and the switch table; docs/review-checklist.md and ../Tooling/AGENTS.md were absent. No recorded runs or generated files were added.; nothing run (a code review).Checked and fine:
Testing: Read-only review; no builds, tests, or project scripts were run. The supplied CI checks were still running.
Overlaps and merge order: Not checked; the network is closed.
Automated code review by BeanBot (gpt-6.1-terra), asked for by llun. Nothing was run; a maintainer decides.
@ -50,1 +91,3 @@/* HOS_GPU_ALLOC_TEST_FAIL: 1 while this kind's first n allocations are refused (kind 0 the GPU memory, 1 the CPU buffer) */static int rest_on(void) {static int on = -1;if (on < 0) on = env_on_or("HOS_GPU_ALLOC_REST", 1);L2 (should fix): The new cached switch value is read and written without synchronization across game threads.
When: When two threads first recover full heaps concurrently, both can read and write the static on value in rest_on. These conflicting plain accesses form a C data race, making the recovery path undefined even when both read the same environment value.
Do: Initialize and publish the cached value with atomics or a once primitive, or read the switch without a shared mutable cache.
@ -208,0 +292,4 @@}__sync_lock_release(&lock);}if (left <= 0 || lr != at || !holder || !readable(heap) || rest.holder == holder) return;L3 (should fix): The test-fill counter is read outside its lock while other threads decrement it under the lock; volatile does not make those accesses atomic.
When: With HOS_GPU_ALLOC_TEST_FILL enabled, two model-building threads can reach this check while one decrements left at line 303. The resulting data race makes the fault-injection run undefined and can invalidate the multi-threaded test result.
Do: Use atomic accesses consistently for left, including its decrement, or perform every access under the same lock.
@ -208,0 +339,4 @@if (got && site >= 0) count_moved(1 + site, size, say);if (got && rest_on() && holder && readable(heap) && recomp_load64(c, holder + 8) == heap) {const uint64_t f = free_size(c, in), whole = recomp_load64(c, heap + HEAP_SIZE);if (f != ~0ULL && f < whole + 0x2000) {L1 (blocking): The retry stops at the first parent that can satisfy the individual allocation, even if that parent cannot support the rest of the build.
When: If the model heap is full, its immediate parent can fit the 0x238-byte object plus the retry margin but has less than the model heap’s size free, and a higher parent has ample room, the object is allocated in the immediate parent. This check leaves the holder pointing at the full model heap; an unchecked later allocation such as f_8044e020’s object can then return null and crash, despite the higher parent having room.
Do: Select a parent suitable for the whole hand-over before allocating the retried block, continuing up the chain when the nearest parent is too small, and add a test with a small intermediate parent and a sufficiently large ancestor.
@ -208,0 +345,4 @@} else {/* (a parent that ran out in its turn hands the build on: the build's own heap stays the one to put back) */if (rest.holder != holder || rest.in != heap) rest.own = heap, rest.gpu = 0;recomp_store64(c, holder + 8, in);L5 (should fix): The new parent-heap hand-over needs a longer lifetime check and runs on the supported platforms it affects.
When: After a full model heap triggers the hand-over, later allocations also come from the parent. The author traced several frees but not every allocation moved by the hand-over; a long session and Linux have not been tested.
Do: Run repeated model rebuilds and area changes on Linux and representative Tier 1 systems, tracking parent-heap use after the models are released; also test the reporter’s reproducible save if available.
@ -1483,0 +1493,4 @@# f_8044f420's 0x238-byte object for each entry of its list (0x8044f66c; the holder is x21), cleared at once (issue 2437:# write guest 0x20, thread OptimizeChangeBanc, lr 0x8044f684); the two buffers f_8044ed60 takes for that object (the# holder is x22 there); f_80443000's buffer and its 0x310-byte object (the holder is its fourth argument, kept at sp+0)OBJECT_ALLOC_SITES = ((0x8044f670, "c->x[21]"), (0x8044efc8, "c->x[22]"), (0x8044f074, "c->x[22]"),L6 (should fix): The hot functions now lose register-local optimization and execute additional hooks, but their frame-time cost has not been measured.
When: The added addresses keep f_8044f420 and f_80443000 in the context-based form on every call, including normal play when no allocation fails. The reported area-change timings are uncontrolled and do not measure frame pacing.
Do: Compare the base and head with repeated interleaved runs in material-heavy gameplay, recording frame-time distribution and 1% lows.
@ -237,0 +473,4 @@# (f_8044f420's place, as the lift writes it for a function the edits keep in the context: the heap's tryAlloc of the# 0x238-byte object and the clear that follows it; and the places of f_8044ed60 and f_80443000 after it, in files of# their own in a lift (the hot list's)OBJECT_FUNCTION = '''void f_8044f420(Ctx *__restrict A64_NOESC c) {L4 (blocking): The new fixture includes passages presented as lifted game instructions, which the repository prohibits committing.
When: OBJECT_FUNCTION and the new sequences in OTHER_FUNCTIONS and LIFTED reproduce the lifted calls and surrounding register operations from the game. CONTRIBUTING.md excludes lifted C and anything generated from the dump, including samples used in tests.
Do: Replace the passages with independently authored synthetic fixtures containing only the minimal patch anchors and fabricated surrounding behavior, and remove the sampled game-derived sequences from the commits.
@fix
@fix
Recommendation: Request changes. The current fixture is synthetic, but the pull request’s earlier commits still contain passages presented as lifted game instructions, contrary to the repository’s licensing rule. The hand-over’s lifetime and frame-time costs also remain unmeasured.
What
@fixchangedI changed this pull request: the new head is
3bb0b989be. I mergedmain(3395639aad) into it, as it has merge commits. I edited its description to match the change.Changed
Changed in part (the rest is for the author)
Not done
Left for the author
Nothing was built or run: the checks run again on the new head.
The change retries several material-block allocations in parent heaps and moves the rest of a build there after a retry, aiming to prevent crashes when a model heap fills. It adds allocation hooks and can move build memory into a shared parent heap; their lifetime and performance costs remain uncertain.
Blocking (1): must change before merging.
tests/test_oot_heap_retry.py:476: The new fixture includes passages presented as lifted game instructions, which the repository prohibits committing. When: OBJECT_FUNCTION and the new sequences in OTHER_FUNCTIONS and LIFTED reproduce the lifted calls and surrounding register operations from the game. CONTRIBUTING.md excludes lifted C and anything generated from the dump, including samples used in tests. Do: Replace the passages with independently authored synthetic fixtures containing only the minimal patch anchors and fabricated surrounding behavior, and remove the sampled game-derived sequences from the commits. (for the author:@fixcouldn't: The fixture at tests/test_oot_heap_retry.py:483 is synthetic, but the earlier branch commits still contain the passages presented as lifted instructions. The author must remove those passages from bra)Testing before merging (2) (runs on the systems it can change; it doesn't hold the recommendation)
host/oot_heap_retry.c:348: The new parent-heap hand-over needs a longer lifetime check and runs on the supported platforms it affects. When: After a full model heap triggers the hand-over, later allocations also come from the parent. The author traced several frees but not every allocation moved by the hand-over; a long session and Linux have not been tested. Do: Run repeated model rebuilds and area changes on Linux and representative Tier 1 systems, tracking parent-heap use after the models are released; also test the reporter’s reproducible save if available.nx2/oot_patches.py:1496: The hot functions now lose register-local optimization and execute additional hooks, but their frame-time cost has not been measured. When: The added addresses keep f_8044f420 and f_80443000 in the context-based form on every call, including normal play when no allocation fails. The reported area-change timings are uncontrolled and do not measure frame pacing. Do: Compare the base and head with repeated interleaved runs in material-heavy gameplay, recording frame-time distribution and 1% lows.Checks: they run again on this head; a failure shows on the pull request.
Also noticed (2; not asked for, not blocking)
More: does it help, other systems, switches, what was read
Does it help: Unproven on the current head. On the earlier tested build, Windows runs continued through seven area changes with 150 heaps forcibly filled at each of four sites; the corresponding unfixed allocation cases crashed. The reporter’s save and the current fix have not been run in game.
Other systems: The hand-over affects CPU and sometimes GPU allocations on several game threads. Linux behavior, longer-lived parent-heap allocations, and frame-time effects remain untested; the recorded game runs used Windows and NVIDIA hardware.
Switches: HOS_GPU_ALLOC_REST is added, on by default; HOS_GPU_ALLOC_TEST_FILL is added, off by default; HOS_GPU_ALLOC_TEST_FAIL gains a third count and remains off by default. The test switches are appropriate as opt-in diagnostics; the hand-over default still needs the lifetime and platform evidence in L5.
Reviewed:
3bb0b989beagainst3395639aad: Read AGENTS.md, CONTRIBUTING.md, the pull request template, host/oot_heap_retry.c, the fix diff and the prior fixture passages. Inspected the heap patch and test changes and the switch references. The full base diff includes merged title-card changes; those files, the complete large patch and test files, and other dependent code were not read in full.; nothing run (a code review).Checked and fine:
Testing: No commands that build, run tests, or execute project code were run. The author reports game and game-free checks on earlier trees; the current head still needs CI and the runs described in the ledger.
Overlaps and merge order: Not checked; network access is closed.
Automated code review by BeanBot (gpt-6.1-terra), asked for by BeanBot, after its fix. Nothing was run; a maintainer decides.