perf(game): OoT preloads no neighbouring map during play (HOS_OCB_PRELOAD) #2900

Merged
HumanBean merged 1 commit from Veix/Longshot:perf/ocb-no-preload into main 2026-11-30 16:41:42 +00:00
Member

Summary

OoT no longer preloads the neighbouring map during play: on PC the preload costs more while walking than it saves at the door. In the Market at 4K the frames over 20 ms halve, and the first frame after an area's fade is about 40 % lighter; the castle's black screen is up to 0.4 s longer.

OoT's OptimizeChangeBank thread preloads the neighbouring map Link heads towards: its layouts, actor packs and models, read, unpacked and written during play. On the console that is unpacking on a spare core. On PC every map it writes is copied for the renderer, its textures are converted (ASTC to BC), and its threads take the game's emulated cores, so the game thread waits in frames you see. In the Market the game turns between the castle and the field side; with the 2 s hold of #1814 it still loads one or the other again every few seconds. And entering an area starts the preload of its neighbour in the same frames as the area's own first frame: the castle's first frame after its fade did the same work with and without it, but its command recording took 95-216 ms against 11-12 ms and its texture conversion 20-34 ms against 10 ms.

Now the preload manager's update goes on with no unit (the game's "none in range"), so it asks for no map and lets go of the one asked for before; the area loads when it is entered, behind its fade. A direct request (the game's own explicit load) and a manager laid out otherwise (another game build) keep the game's choice. HOS_OCB_PRELOAD=1 brings back the game's preload with the hold, as before.

Read first: game/oot_ocb_hold.h (oot_ocb_preload_on, oot_ocb_none), game/oot_ocb_hold.c (hos_oot_ocb_pick).

Testing

Tested: Windows 11, RTX 4070 SUPER 12 GB, driver 621.24, Ryzen 9 9900X: the automated walking route (Market, Castle, Market) at 4K, this PR against HOS_OCB_PRELOAD=1, as in Measurements. The log shows the mode in every run ("ocb: no neighbouring map preloaded during play", or the hold's line); both entries load and play normally. Earlier, on a test build with the same rule, the game asked for a neighbour 19-21 times a run and loaded none. Game-free: test_ocb_hold checks the switch's values, that a choice flickering between two neighbours loads nothing and lets the map loaded before go once (the update's rest modelled), and that a direct request and another vtable keep the game's choice. The checks this change touches: test_ocb_hold passes but for test_callback_in_the_update, which does not build here (this PC's Rust toolchain has no gcc libraries for its build scripts; the change does not touch the site), and test_switch_table fails only on LONGSHOT_LAUNCHER_STARTUP, as on main.

Still to test:

  • Windows, 4 cores (the game limited to 4 of this PC's cores, as a Steam Deck has): the same route, this PR against HOS_OCB_PRELOAD=1, expecting the same direction in play and a longer black screen at entries (by hand)
  • Steam Deck: walking the Market and Hyrule Field, expecting fewer hitches while walking and turning (by hand)
  • Linux, AMD: Hyrule Field near Kakariko, where the preload swaps between Castle Town and Kakariko, expecting no frame over 50 ms while walking (@Beanstalk Hyrule Field near Kakariko, HOS_OCB_PRELOAD unset against =1)

Measurements

Verdict: in the Market at 4K frames over 20 ms 48 / 35 -> 24 / 22, 1 % low 40.7 / 44.2 -> 46.9 / 46.0 fps, p99 20.8 / 19.9 -> 18.8 / 19.1 ms; the heaviest frame after an entry's fade 233 / 258 -> 139 / 134 ms (castle) and 124 / 121 -> 87 / 84 ms (Market); the castle's black screen 1.12 / 1.08 -> 1.54 / 1.20 s, the Market's 2.26 / 2.31 -> 2.31 / 2.31 s.

Setup: Windows 11, RTX 4070 SUPER 12 GB, driver 621.24, Ryzen 9 9900X; one build: this PR on main 28cb22b9e, HOS_OCB_PRELOAD=1 (main's behaviour: the switch is the only difference) against unset, interleaved main / PR / PR / main; the automated walking route, 3840x2160 DLAA, uncapped, V-Sync off, shaders loaded at start, headless. The Market: its second stay from 5 s after its entry. A black screen: the frames with almost no drawing (draw recording under 0.2 ms) around the entry; the heaviest frame: the slowest in the 0.5 s after it. From the frame trace.

Before: main @ 28cb22b9e (HOS_OCB_PRELOAD=1) After: this PR @ 8bfbc37fa
Market: frames over 20 ms 48 / 35 24 / 22
Market: frames over 25 ms 7 / 4 3 / 2
Market: p99 20.8 / 19.9 ms 18.8 / 19.1 ms
Market: 1 % low 40.7 / 44.2 fps 46.9 / 46.0 fps
Market: frames in the window 3,643 / 3,672 3,704 / 3,706
Castle entry: black screen 1.12 / 1.08 s 1.54 / 1.20 s
Castle entry: heaviest frame after it 233 / 258 ms 139 / 134 ms
Market entry: black screen 2.26 / 2.31 s 2.31 / 2.31 s
Market entry: heaviest frame after it 124 / 121 ms 87 / 84 ms

What the preload costs in a given frame depends on timing, not on the route alone: whether its reading, unpacking and copying overlap a heavy frame (an entry's first frame, a turn) or quiet ones, whether the game's choice lasts the hold (a wall-clock time), and where the loader threads get a core. The route plays the same inputs every run, and main's two runs spread more than this PR's: frames over 20 ms 48 / 35 against 24 / 22, 1 % low 40.7 / 44.2 against 46.9 / 46.0 fps.

Risks

An area loads when it is entered: its black screen can be longer (the castle's up to 0.4 s here); a slower CPU loads it slower. Where the game would use a preloaded map in another way than the change to it, that map is loaded then. HOS_OCB_PRELOAD=1 brings back the game's preload with HOS_OCB_HOLD_MS, as before; a revert is enough too. Nothing changes for a player's saves, longshot_options.ini or the caches.

Checklist

Ready for review

  • One topic, on current main; the title is a Conventional Commit.
  • Tested on my own PC, in the game for a change the game runs, as Testing says.
  • mise run test passes (any failure that also fails on main is named).
  • Measured against main, or Measurements says why there is nothing to measure.
  • No game files, build output or hand-edited generated files; third_party/ untouched; nothing GPL-incompatible.

When it applies

  • A switch added or changed: it ships at the default the measurements chose, with its row in gpu/vk/switches.def.
  • A check under tests/ that reads changed source is updated, not weakened.
  • AI assistance recorded with Assisted-by: / Co-Authored-By: trailers.

Ready to merge

  • Everything in Still to test has run, its results in Tested.
  • Tier 1 hardware it can affect is tested (docs/dev/standards.md, "Hardware tiers").
  • Approved in review, every comment answered.
  • CI passes on the head; on current main, measured again or a comment says why the numbers still hold.

🤖 Generated with Claude Code

## Summary **OoT no longer preloads the neighbouring map during play: on PC the preload costs more while walking than it saves at the door. In the Market at 4K the frames over 20 ms halve, and the first frame after an area's fade is about 40 % lighter; the castle's black screen is up to 0.4 s longer.** OoT's OptimizeChangeBank thread preloads the neighbouring map Link heads towards: its layouts, actor packs and models, read, unpacked and written during play. On the console that is unpacking on a spare core. On PC every map it writes is copied for the renderer, its textures are converted (ASTC to BC), and its threads take the game's emulated cores, so the game thread waits in frames you see. In the Market the game turns between the castle and the field side; with the 2 s hold of #1814 it still loads one or the other again every few seconds. And entering an area starts the preload of its neighbour in the same frames as the area's own first frame: the castle's first frame after its fade did the same work with and without it, but its command recording took 95-216 ms against 11-12 ms and its texture conversion 20-34 ms against 10 ms. Now the preload manager's update goes on with no unit (the game's "none in range"), so it asks for no map and lets go of the one asked for before; the area loads when it is entered, behind its fade. A direct request (the game's own explicit load) and a manager laid out otherwise (another game build) keep the game's choice. `HOS_OCB_PRELOAD=1` brings back the game's preload with the hold, as before. Read first: `game/oot_ocb_hold.h` (`oot_ocb_preload_on`, `oot_ocb_none`), `game/oot_ocb_hold.c` (`hos_oot_ocb_pick`). ## Testing **Tested:** Windows 11, RTX 4070 SUPER 12 GB, driver 621.24, Ryzen 9 9900X: the automated walking route (Market, Castle, Market) at 4K, this PR against `HOS_OCB_PRELOAD=1`, as in Measurements. The log shows the mode in every run ("ocb: no neighbouring map preloaded during play", or the hold's line); both entries load and play normally. Earlier, on a test build with the same rule, the game asked for a neighbour 19-21 times a run and loaded none. Game-free: `test_ocb_hold` checks the switch's values, that a choice flickering between two neighbours loads nothing and lets the map loaded before go once (the update's rest modelled), and that a direct request and another vtable keep the game's choice. The checks this change touches: `test_ocb_hold` passes but for `test_callback_in_the_update`, which does not build here (this PC's Rust toolchain has no gcc libraries for its build scripts; the change does not touch the site), and `test_switch_table` fails only on `LONGSHOT_LAUNCHER_STARTUP`, as on `main`. **Still to test:** - Windows, 4 cores (the game limited to 4 of this PC's cores, as a Steam Deck has): the same route, this PR against `HOS_OCB_PRELOAD=1`, expecting the same direction in play and a longer black screen at entries (by hand) - Steam Deck: walking the Market and Hyrule Field, expecting fewer hitches while walking and turning (by hand) - Linux, AMD: Hyrule Field near Kakariko, where the preload swaps between Castle Town and Kakariko, expecting no frame over 50 ms while walking (@Beanstalk Hyrule Field near Kakariko, HOS_OCB_PRELOAD unset against =1) ## Measurements **Verdict:** in the Market at 4K frames over 20 ms 48 / 35 -> 24 / 22, 1 % low 40.7 / 44.2 -> 46.9 / 46.0 fps, p99 20.8 / 19.9 -> 18.8 / 19.1 ms; the heaviest frame after an entry's fade 233 / 258 -> 139 / 134 ms (castle) and 124 / 121 -> 87 / 84 ms (Market); the castle's black screen 1.12 / 1.08 -> 1.54 / 1.20 s, the Market's 2.26 / 2.31 -> 2.31 / 2.31 s. Setup: Windows 11, RTX 4070 SUPER 12 GB, driver 621.24, Ryzen 9 9900X; one build: this PR on main 28cb22b9e, `HOS_OCB_PRELOAD=1` (main's behaviour: the switch is the only difference) against unset, interleaved main / PR / PR / main; the automated walking route, 3840x2160 DLAA, uncapped, V-Sync off, shaders loaded at start, headless. The Market: its second stay from 5 s after its entry. A black screen: the frames with almost no drawing (draw recording under 0.2 ms) around the entry; the heaviest frame: the slowest in the 0.5 s after it. From the frame trace. | | Before: main @ 28cb22b9e (`HOS_OCB_PRELOAD=1`) | After: this PR @ 8bfbc37fa | |---|---|---| | Market: frames over 20 ms | 48 / 35 | 24 / 22 | | Market: frames over 25 ms | 7 / 4 | 3 / 2 | | Market: p99 | 20.8 / 19.9 ms | 18.8 / 19.1 ms | | Market: 1 % low | 40.7 / 44.2 fps | 46.9 / 46.0 fps | | Market: frames in the window | 3,643 / 3,672 | 3,704 / 3,706 | | Castle entry: black screen | 1.12 / 1.08 s | 1.54 / 1.20 s | | Castle entry: heaviest frame after it | 233 / 258 ms | 139 / 134 ms | | Market entry: black screen | 2.26 / 2.31 s | 2.31 / 2.31 s | | Market entry: heaviest frame after it | 124 / 121 ms | 87 / 84 ms | What the preload costs in a given frame depends on timing, not on the route alone: whether its reading, unpacking and copying overlap a heavy frame (an entry's first frame, a turn) or quiet ones, whether the game's choice lasts the hold (a wall-clock time), and where the loader threads get a core. The route plays the same inputs every run, and main's two runs spread more than this PR's: frames over 20 ms 48 / 35 against 24 / 22, 1 % low 40.7 / 44.2 against 46.9 / 46.0 fps. ## Risks An area loads when it is entered: its black screen can be longer (the castle's up to 0.4 s here); a slower CPU loads it slower. Where the game would use a preloaded map in another way than the change to it, that map is loaded then. `HOS_OCB_PRELOAD=1` brings back the game's preload with `HOS_OCB_HOLD_MS`, as before; a revert is enough too. Nothing changes for a player's saves, `longshot_options.ini` or the caches. ## Checklist ### Ready for review - [x] One topic, on current `main`; the title is a Conventional Commit. - [x] Tested on my own PC, in the game for a change the game runs, as Testing says. - [x] `mise run test` passes (any failure that also fails on `main` is named). - [x] Measured against `main`, or Measurements says why there is nothing to measure. - [x] No game files, build output or hand-edited generated files; `third_party/` untouched; nothing GPL-incompatible. ### When it applies - [x] A switch added or changed: it ships at the default the measurements chose, with its row in `gpu/vk/switches.def`. - [x] A check under `tests/` that reads changed source is updated, not weakened. - [x] AI assistance recorded with `Assisted-by:` / `Co-Authored-By:` trailers. ### Ready to merge - [ ] Everything in Still to test has run, its results in Tested. - [ ] Tier 1 hardware it can affect is tested (docs/dev/standards.md, "Hardware tiers"). - [ ] Approved in review, every comment answered. - [ ] CI passes on the head; on current `main`, measured again or a comment says why the numbers still hold. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
perf(game): OoT preloads no neighbouring map during play (HOS_OCB_PRELOAD)
Some checks are pending
CI / What the change needs (pull_request) Blocked by required conditions
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Blocked by required conditions
CI / Third-party parts and guide screenshots (pull_request) Blocked by required conditions
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Blocked by required conditions
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Blocked by required conditions
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Blocked by required conditions
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Blocked by required conditions
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Blocked by required conditions
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Blocked by required conditions
CI / Website build and checks (pull_request) Blocked by required conditions
PR description / Title and description (pull_request_target) Successful in 7s
beanstalk/approval not approved yet
8bfbc37faa
OoT's OptimizeChangeBank preloads the neighbouring map Link heads towards: its layouts, actor
packs and models, read, unpacked and written during play. On PC every map written is copied for
the renderer and the loader threads take the game's cores, so the preload costs more during
play than it saves at an entry, which loads behind its fade. The preload manager's update now
goes on with no unit (none in range), so it asks for no map and lets go of the one asked for
before; a direct request and a manager laid out otherwise stay the game's own.

- HOS_OCB_PRELOAD=1: the game's preload with HOS_OCB_HOLD_MS, as before.
- game/oot_ocb_hold.h: oot_ocb_preload_on, oot_ocb_none; game/oot_ocb_hold.c applies them.
- tests/test_ocb_hold.py: the switch's values; a flickering choice loads nothing and lets the
  loaded map go once; a direct request and another vtable keep the game's choice.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Author
Member

Tested in game: Windows 11, RTX 4070 SUPER 12 GB, driver 621.24, Ryzen 9 9900X: the automated walking route (Market, Castle, Market) at 4K DLAA, this PR against HOS_OCB_PRELOAD=1, two runs each, interleaved. Both entries load and play normally; the log shows the mode in every run; in the Market frames over 20 ms 48 / 35 -> 24 / 22.

Tested in game: Windows 11, RTX 4070 SUPER 12 GB, driver 621.24, Ryzen 9 9900X: the automated walking route (Market, Castle, Market) at 4K DLAA, this PR against HOS_OCB_PRELOAD=1, two runs each, interleaved. Both entries load and play normally; the log shows the mode in every run; in the Market frames over 20 ms 48 / 35 -> 24 / 22.
Author
Member
@review
BeanBot left a comment

Recommendation: Approve. The code is ready: only testing is left. The measured Windows route shows fewer long Market frames, but the default also extends the castle loading screen by up to 0.42 seconds in these runs. The tradeoff and behavior on other affected Tier 1 systems still need testing before merge. Recommend approval; not approved on the forge.

Disables automatic neighbouring-map preloads by default, moving their work to area entry; an environment switch restores the previous held-preload behavior. This reduces measured walking hitches on the tested PC at the cost of longer loading screens.

Testing before merging (2) (runs on the systems it can change; it doesn't hold the recommendation)

  • L1: The new default changes loading and loader contention across the game, but its reported comparison covers one Windows NVIDIA machine and route. When: On a four-core CPU or Steam Deck, disabling background loading may change walking frame times and make area-entry waits materially longer than on the tested 9900X. Do: Run the stated four-core comparison and Steam Deck route, recording walking frame times and entry loading times for both modes.
  • L2: The default has no reported Linux or AMD comparison, including the Hyrule Field preload-swap case. When: Different CPU scheduling and asset conversion costs can change both walking hitches and the extra work left for area entry on these systems. Do: Run the requested Linux AMD Hyrule Field comparison and cover the other affected Tier 1 OS and vendor combinations, recording frame times and entry waits in both modes.

Questions (2) (not confirmed from the code; they don't hold the recommendation)

  • Does the game's alternate two-unit mode reach this hook, and if so, does suppressing its selected unit preserve the intended behavior?
  • tests/test_ocb_hold.py:414: Is there a current case where the host selects the wrong behavior, beyond the hypothetical removal or inversion of the branch?

Checks: Still running: 10 checks.

More: does it help, other systems, switches, what was read

Does it help: Yes, on the reported Windows RTX 4070 SUPER route: Market frames over 20 ms fell from 48/35 to 24/22 across two interleaved runs per mode, and castle entry's heaviest post-fade frame fell from 233/258 to 139/134 ms. Castle black screen time rose from 1.12/1.08 to 1.54/1.20 seconds. The comparison used the PR build with its switch restoring base behavior; results elsewhere remain unproven.

Other systems: The manager runs independently of GPU vendor and OS, but CPU contention, storage and loading times can change the result on Windows, Linux and Steam Deck. Direct requests and unknown manager layouts retain the game's choice; the game-free test covers those helper cases. Other areas and the game's alternate two-unit mode have not been exercised in the reported runs.

Switches: Adds HOS_OCB_PRELOAD: unset, 0 or other values disable automatic neighbouring-map preloads; 1 or on restores preloading with HOS_OCB_HOLD_MS. Its default has evidence on one Windows PC but needs the outstanding platform runs. HOS_OCB_HOLD_MS remains available but affects automatic choices only when preloading is enabled. The new switch has a switches.def row.

Reviewed: 8bfbc37faa against 28cb22b9ed: Read AGENTS.md, CONTRIBUTING.md, the PR template, docs/dev/standards.md, the complete diff and commit, game/oot_ocb_hold.c and game/oot_ocb_hold.h. Read the changed test and its harness, the switch-table change, and searched the hook and its callers; skimmed the remainder of switches.def. docs/review-checklist.md and ../Tooling/AGENTS.md are absent. No generated files or recorded runs were changed.; nothing run (a code review).

Checked and fine:

  • The new shared host state is initialized and accessed under hold_lock.
  • The supported-build guard and direct-request fallback are retained.
  • The commit records AI assistance, and the diff contains no game-derived output, generated files, third-party changes or API version changes.

Testing: Read-only review; no code or tests were run. The author reports two interleaved runs per mode on Windows and a game-free helper test; CI is still running.

Overlaps and merge order: No overlapping pull requests identified from the supplied information.


Automated code review by BeanBot (gpt-6.1-terra), asked for by Veix. Nothing was run; a maintainer decides.

**Recommendation: Approve.** The code is ready: only testing is left. The measured Windows route shows fewer long Market frames, but the default also extends the castle loading screen by up to 0.42 seconds in these runs. The tradeoff and behavior on other affected Tier 1 systems still need testing before merge. Recommend approval; not approved on the forge. Disables automatic neighbouring-map preloads by default, moving their work to area entry; an environment switch restores the previous held-preload behavior. This reduces measured walking hitches on the tested PC at the cost of longer loading screens. **Testing before merging (2)** (runs on the systems it can change; it doesn't hold the recommendation) - **L1**: The new default changes loading and loader contention across the game, but its reported comparison covers one Windows NVIDIA machine and route. *When:* On a four-core CPU or Steam Deck, disabling background loading may change walking frame times and make area-entry waits materially longer than on the tested 9900X. **Do:** Run the stated four-core comparison and Steam Deck route, recording walking frame times and entry loading times for both modes. - **L2**: The default has no reported Linux or AMD comparison, including the Hyrule Field preload-swap case. *When:* Different CPU scheduling and asset conversion costs can change both walking hitches and the extra work left for area entry on these systems. **Do:** Run the requested Linux AMD Hyrule Field comparison and cover the other affected Tier 1 OS and vendor combinations, recording frame times and entry waits in both modes. **Questions (2)** (not confirmed from the code; they don't hold the recommendation) - Does the game's alternate two-unit mode reach this hook, and if so, does suppressing its selected unit preserve the intended behavior? - `tests/test_ocb_hold.py:414`: Is there a current case where the host selects the wrong behavior, beyond the hypothetical removal or inversion of the branch? **Checks:** Still running: 10 checks. <details> <summary>More: does it help, other systems, switches, what was read</summary> **Does it help:** Yes, on the reported Windows RTX 4070 SUPER route: Market frames over 20 ms fell from 48/35 to 24/22 across two interleaved runs per mode, and castle entry's heaviest post-fade frame fell from 233/258 to 139/134 ms. Castle black screen time rose from 1.12/1.08 to 1.54/1.20 seconds. The comparison used the PR build with its switch restoring base behavior; results elsewhere remain unproven. **Other systems:** The manager runs independently of GPU vendor and OS, but CPU contention, storage and loading times can change the result on Windows, Linux and Steam Deck. Direct requests and unknown manager layouts retain the game's choice; the game-free test covers those helper cases. Other areas and the game's alternate two-unit mode have not been exercised in the reported runs. **Switches:** Adds HOS_OCB_PRELOAD: unset, 0 or other values disable automatic neighbouring-map preloads; 1 or on restores preloading with HOS_OCB_HOLD_MS. Its default has evidence on one Windows PC but needs the outstanding platform runs. HOS_OCB_HOLD_MS remains available but affects automatic choices only when preloading is enabled. The new switch has a switches.def row. **Reviewed:** 8bfbc37faa12 against 28cb22b9ed23: Read AGENTS.md, CONTRIBUTING.md, the PR template, docs/dev/standards.md, the complete diff and commit, game/oot_ocb_hold.c and game/oot_ocb_hold.h. Read the changed test and its harness, the switch-table change, and searched the hook and its callers; skimmed the remainder of switches.def. docs/review-checklist.md and ../Tooling/AGENTS.md are absent. No generated files or recorded runs were changed.; nothing run (a code review). **Checked and fine:** - The new shared host state is initialized and accessed under hold_lock. - The supported-build guard and direct-request fallback are retained. - The commit records AI assistance, and the diff contains no game-derived output, generated files, third-party changes or API version changes. **Testing:** Read-only review; no code or tests were run. The author reports two interleaved runs per mode on Windows and a game-free helper test; CI is still running. **Overlaps and merge order:** No overlapping pull requests identified from the supplied information. </details> --- <sub>Automated code review by BeanBot (gpt-6.1-terra), asked for by Veix. Nothing was run; a maintainer decides.</sub>
Author
Member

On fewer cores, and with Threaded rendering off: the same build (8bfbc37fa, this PR on main 28cb22b9e), HOS_OCB_PRELOAD=1 against unset, interleaved main / PR / PR / main, the automated walking route at 3840x2160 DLAA, uncapped, headless; the game limited to the cores by its process's CPU affinity (Windows 11, RTX 4070 SUPER, driver 621.24, Ryzen 9 9900X). The Market: its second stay from 5 s after its entry. The log shows the preload's mode and the threading in every run.

4 cores / 8 threads, Threaded rendering on (Auto: the render and recorder threads)

HOS_OCB_PRELOAD=1 this PR
Market: frames over 20 ms 51 / 48 30 / 30
Market: frames over 25 ms 5 / 6 5 / 1
Market: p99 20.9 / 20.5 ms 19.6 / 19.9 ms
Market: 1 % low 43.6 / 44.2 fps 43.7 / 46.6 fps
Castle entry: black screen 0.94 / 0.93 s 1.08 / 1.51 s
Castle entry: heaviest frame after it 214 / 182 ms 127 / 148 ms
Market entry: black screen 1.59 / 1.51 s 1.79 / 1.81 s
Market entry: heaviest frame after it 103 / 109 ms 98 / 99 ms

6 cores / 12 threads, Threaded rendering off (RX_VK_ASYNC=0, RX_VK_RECORDER=off)

HOS_OCB_PRELOAD=1 this PR
Market: frames over 20 ms 121 / 112 52 / 68
Market: frames over 25 ms 16 / 10 3 / 1
Market: p99 23.3 / 22.5 ms 20.9 / 20.7 ms
Market: 1 % low 38.4 / 40.0 fps 44.1 / 44.5 fps
Castle entry: black screen 0.84 / 0.91 s 1.36 / 0.80 s
Castle entry: heaviest frame after it 177 / 158 ms 136 / 146 ms
Market entry: black screen 1.51 / 1.47 s 1.48 / 2.01 s
Market entry: heaviest frame after it 121 / 126 ms 108 / 100 ms

The three setups, the Market (HOS_OCB_PRELOAD=1 -> this PR)

frames over 20 ms 1 % low p99
12 cores, Threaded rendering on (the description) 48 / 35 -> 24 / 22 40.7 / 44.2 -> 46.9 / 46.0 fps 20.8 / 19.9 -> 18.8 / 19.1 ms
4 cores, Threaded rendering on 51 / 48 -> 30 / 30 43.6 / 44.2 -> 43.7 / 46.6 fps 20.9 / 20.5 -> 19.6 / 19.9 ms
6 cores, Threaded rendering off 121 / 112 -> 52 / 68 38.4 / 40.0 -> 44.1 / 44.5 fps 23.3 / 22.5 -> 20.9 / 20.7 ms

With Threaded rendering off the renderer's work runs on the game's own threads, and the preload costs the most there: frames over 25 ms 16 / 10 -> 3 / 1. That is the mode a Steam Deck runs in (an integrated GPU: Auto keeps the render thread off, and the recorder thread needs 6 cores). In each setup one of the two runs of this PR has a black screen 0.4-0.6 s longer and the other about the same; the heaviest frame after it is lighter or the same in all of them.

On fewer cores, and with Threaded rendering off: the same build (8bfbc37fa, this PR on main 28cb22b9e), `HOS_OCB_PRELOAD=1` against unset, interleaved main / PR / PR / main, the automated walking route at 3840x2160 DLAA, uncapped, headless; the game limited to the cores by its process's CPU affinity (Windows 11, RTX 4070 SUPER, driver 621.24, Ryzen 9 9900X). The Market: its second stay from 5 s after its entry. The log shows the preload's mode and the threading in every run. **4 cores / 8 threads, Threaded rendering on (Auto: the render and recorder threads)** | | `HOS_OCB_PRELOAD=1` | this PR | |---|---|---| | Market: frames over 20 ms | 51 / 48 | 30 / 30 | | Market: frames over 25 ms | 5 / 6 | 5 / 1 | | Market: p99 | 20.9 / 20.5 ms | 19.6 / 19.9 ms | | Market: 1 % low | 43.6 / 44.2 fps | 43.7 / 46.6 fps | | Castle entry: black screen | 0.94 / 0.93 s | 1.08 / 1.51 s | | Castle entry: heaviest frame after it | 214 / 182 ms | 127 / 148 ms | | Market entry: black screen | 1.59 / 1.51 s | 1.79 / 1.81 s | | Market entry: heaviest frame after it | 103 / 109 ms | 98 / 99 ms | **6 cores / 12 threads, Threaded rendering off (`RX_VK_ASYNC=0`, `RX_VK_RECORDER=off`)** | | `HOS_OCB_PRELOAD=1` | this PR | |---|---|---| | Market: frames over 20 ms | 121 / 112 | 52 / 68 | | Market: frames over 25 ms | 16 / 10 | 3 / 1 | | Market: p99 | 23.3 / 22.5 ms | 20.9 / 20.7 ms | | Market: 1 % low | 38.4 / 40.0 fps | 44.1 / 44.5 fps | | Castle entry: black screen | 0.84 / 0.91 s | 1.36 / 0.80 s | | Castle entry: heaviest frame after it | 177 / 158 ms | 136 / 146 ms | | Market entry: black screen | 1.51 / 1.47 s | 1.48 / 2.01 s | | Market entry: heaviest frame after it | 121 / 126 ms | 108 / 100 ms | **The three setups, the Market (`HOS_OCB_PRELOAD=1` -> this PR)** | | frames over 20 ms | 1 % low | p99 | |---|---|---|---| | 12 cores, Threaded rendering on (the description) | 48 / 35 -> 24 / 22 | 40.7 / 44.2 -> 46.9 / 46.0 fps | 20.8 / 19.9 -> 18.8 / 19.1 ms | | 4 cores, Threaded rendering on | 51 / 48 -> 30 / 30 | 43.6 / 44.2 -> 43.7 / 46.6 fps | 20.9 / 20.5 -> 19.6 / 19.9 ms | | 6 cores, Threaded rendering off | 121 / 112 -> 52 / 68 | 38.4 / 40.0 -> 44.1 / 44.5 fps | 23.3 / 22.5 -> 20.9 / 20.7 ms | With Threaded rendering off the renderer's work runs on the game's own threads, and the preload costs the most there: frames over 25 ms 16 / 10 -> 3 / 1. That is the mode a Steam Deck runs in (an integrated GPU: Auto keeps the render thread off, and the recorder thread needs 6 cores). In each setup one of the two runs of this PR has a black screen 0.4-0.6 s longer and the other about the same; the heaviest frame after it is lighter or the same in all of them.
Author
Member

@Beanstalk Check what this costs at area changes. Three times: teleport to Market_Entrance, wait until in play, walk forward 3 s, then walk backwards until the next area starts loading (wait for loading_start, then a timer from loading_start to loading_end). Then the same three times from HyruleField_Child. Main against this PR. Targets: any, radv, steamdeck. Probes: frametime, process, crash. Fails if a timed load is more than 1 s longer or p99 is clearly worse.

@Beanstalk Check what this costs at area changes. Three times: teleport to Market_Entrance, wait until in play, walk forward 3 s, then walk backwards until the next area starts loading (wait for loading_start, then a timer from loading_start to loading_end). Then the same three times from HyruleField_Child. Main against this PR. Targets: any, radv, steamdeck. Probes: frametime, process, crash. Fails if a timed load is more than 1 s longer or p99 is clearly worse.
Member

@Veix only members of BigBeans can start the farm. One of them can approve this request by reacting 👍 to it or to this comment.

@Veix only members of `BigBeans` can start the farm. One of them can approve this request by reacting 👍 to it or to this comment.
Author
Member

A note on reading the numbers above for normal play: the 1 % lows a player sees will likely gain less than these runs show. The preload only costs where a neighbouring map is in reach, and the route turns constantly in the Market, which keeps switching the game's choice between the castle and the field side and so exaggerates the losses with the preload on. Each frame the preload hit still gains the same; in normal play fewer frames are hit. The Market and Hyrule Field, where the game switches between neighbours the most, are likely where normal play gains the most.

A note on reading the numbers above for normal play: the 1 % lows a player sees will likely gain less than these runs show. The preload only costs where a neighbouring map is in reach, and the route turns constantly in the Market, which keeps switching the game's choice between the castle and the field side and so exaggerates the losses with the preload on. Each frame the preload hit still gains the same; in normal play fewer frames are hit. The Market and Hyrule Field, where the game switches between neighbours the most, are likely where normal play gains the most.
HumanBean deleted branch perf/ocb-no-preload 2026-11-30 16:41:42 +00:00
Some checks are pending
CI / What the change needs (pull_request) Blocked by required conditions
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Blocked by required conditions
CI / Third-party parts and guide screenshots (pull_request) Blocked by required conditions
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Blocked by required conditions
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Blocked by required conditions
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Blocked by required conditions
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Blocked by required conditions
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Blocked by required conditions
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Blocked by required conditions
CI / Website build and checks (pull_request) Blocked by required conditions
PR description / Title and description (pull_request_target) Successful in 7s
beanstalk/approval not approved yet
Some workflows are waiting to be reviewed.
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
3 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
MagicBeanDev/Longshot!2900
No description provided.