Skip to content

Prevent Castle Town guard-house crashes with a larger render-target pool - #1202

Merged
hckrman101 merged 1 commit into
NotRexed:mainfrom
nathanaelries:fix/guardhouse-render-target-pool
Nov 9, 2026
Merged

hckrman101 merged 1 commit into
NotRexed:mainfrom
nathanaelries:fix/guardhouse-render-target-pool

Conversation

@nathanaelries

Copy link
Copy Markdown
Contributor

Talking to the soldier in Castle Town’s guard house while rotating the camera repeatedly crashed at 2560×1440 with the 305 MiB render-target pool. Reserving 512 MiB resolved the reported reproduction.

This gives the pool a 512 MiB minimum while preserving existing 4K/ultrawide growth and explicit HOS_RT_POOL_MB overrides. The existing graphics-heap/budget hooks use the same sizing function, so the backing allocation grows with it. The base reservation increases by 207 MiB.

The initial stop was native NVN: texture handle ids -1/264. The companion handle correction matches the original SDK: sign-extend both IDs, combine them, and return zero when the texture ID is zero. That correction alone did not resolve the room: it exposed a subsequent allocator crash in f_8005ed00. Disabling write-back diff and the separate present queue also did not resolve it. Raising the pool to 512 MiB with those changes retained did.

Validation

  • python -I -B tests/run_all.py --jobs 1 --strict nvn rt_pool: 5 passed.
  • New production-function fixtures: 12 pool-sizing cases and 13 handle cases, passing with GCC and Clang. The pool regression fails against current main’s old sizing; the handle regression fails against the old constructor.
  • Local differential check: the corrected source routine and the patched native routine matched the original SDK in 10,196 boundary/random argument pairs. SDK bytes and generated artifacts stay local; the committed fixtures contain authored constants only.
  • In-game confirmation: v2.0.8 (source ed212f62), Linux, RX 7800 XT/RADV, docked 2560×1440 at 100% resolution, frame generation off. The same soldier/camera action passed after setting the pool to 512 MiB. Steam’s overlay remained enabled for the working controller setup.

The complete game has not been rebuilt from this exact branch, and Windows runtime behavior has not been tested. The pool recommendation is based on the repeatable allocation failure and the successful larger-pool test; peak pool use has not been instrumented. No game files, saves, settings files, binaries, caches, or SDK code are included.

@hckrman101
hckrman101 merged commit 73b9732 into NotRexed:main Nov 9, 2026
notquiteog added a commit to notquiteog/Hookshot that referenced this pull request Nov 9, 2026
Microphone input, motion controls, the FPX sticky rescue, the guard-house
render-target pool and upstream's test fixes. vk_menu.h keeps both the
neural-rendering options and the microphone's; the rumble and output-resolution
tests take upstream's fixtures, with the render-target expectation brought up to
NotRexed#1202's 512 MB floor (upstream's own copy was red on that).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
mmkzer0 added a commit to mmkzer0/Hookshot that referenced this pull request Nov 10, 2026
NotRexed#1202 keeps the render-target pool at 512 MB or more, but the output
resolution test still expected the shipped 305 MB at 2560x1440 and
1920x1080, so it failed on every compiler. The 4K case keeps its scaled
687 MB, which is above the minimum.

Tested: tests/test_output_resolution.py with clang++ (MSVC target) and
llvm-mingw's g++; it failed before this change.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant