perf(host): native zstd gives its virtual core up by default, except on Intel iGPUs (lower p99 on the PCs it applies to, higher fps on the Steam Deck) #1875

Merged
HumanBean merged 2 commits from Veix/Longshot:perf/native-zstd-give-core into main 2026-11-20 22:25:13 +00:00
Contributor

Summary

HOS_NATIVE_ZSTD now defaults to 1 on every PC except Intel integrated GPUs, which stay at 2. With 1, the game's zstd decode gives its virtual core up while libzstd works, so the game's other threads run meanwhile. That cuts slow frames wherever the game is short of CPU: Kokiri Forest on a Steam Deck OLED goes from 19.1 to 29.1 fps (#1726), and the Castle Town market's frames over 20 ms fall by about a third on a Ryzen desktop.

Intel iGPUs keep 2 because of the load freezes on a Core Ultra 7 155H that made #1632 switch everyone to 2; that laptop hasn't been checked again since.

How: an unset HOS_NATIVE_ZSTD asks the renderer through a new option id (HOS_OPT_NATIVE_ZSTD), which answers from the device policy (native_zstd_keep_core in gpu/vk/device_policy.h, on for an Intel integrated GPU). A value set wins as before.

Read first: zs_mode in host/hos_zstd.c, native_zstd_keep_core in gpu/vk/device_policy.h, and where it is published (gpu/vk/vk_main.cpp) and answered (gpu/vk/vk_replay.cpp, t.option). Follows up on #1726, as zeldaootr asked there.

See #1726, See #1632, See #1402, See #1477

Testing

Tested: Windows 11, Ryzen 9 9900X, RTX 4070 SUPER (NVIDIA 621.24): this PR's build in the game, six route runs (Market, Hyrule Castle, Market again, with camera turns), all ending normally; the log names the default the GPU gave (zstd: ... (HOS_NATIVE_ZSTD=1, this GPU's default: the core given up while it decodes)). tests/test_native_zstd.py (the default by the renderer's answer, before it can answer, and a value set over it; fails on main for the new cases), tests/test_device_policy.py (the rule's edges) and tests/test_switch_table.py pass.

Still to test:

  • windows+intel with a dedicated GPU, windows+amd, linux, steamdeck: a teleport tour, then the Market standing with camera turns, HOS_NATIVE_ZSTD=2 against unset, expecting no load to hang and p99 the same or better unset (@Beanstalk)
  • windows+intel, an Intel iGPU: a start, expecting HOS_NATIVE_ZSTD=2, this GPU's default in the log (@Beanstalk)

Measurements

Verdict: the Market's frames over 20 ms halve (57 to 29) and those over 25 ms fall from 14 to 2; the 1% low goes from 40.1 to 46.3 fps, fps the same. The three runs of each side don't overlap.

Setup: Windows 11, Ryzen 9 9900X (12 cores), RTX 4070 SUPER (NVIDIA 621.24), 64 GB; 3840x2160 with DLSS Quality, 90 fps cap, V-Sync on, the frame gate and readbacks as main ships them; a recorded walk (Market, Hyrule Castle, Market again), the frame trace; 3 runs a side, interleaved, the median; the window: the second Market stay from 5 s after arriving (about 55 s), from the present intervals.

The runs were made at 65769aa3; 095b160b after it moves the rule into the device policy with no change in what a PC gets (a short run of it logs native_zstd_keep_core=0 and HOS_NATIVE_ZSTD=1, this GPU's default).

Baseline: this PR's build with HOS_NATIVE_ZSTD=2 set, main's default: the only code this PR changes is which value an unset switch gets, so the same build with 2 runs as main does, and both sides share one build.

Before: this PR @ 65769aa3 with HOS_NATIVE_ZSTD=2 (main's default) After: this PR @ 65769aa3, unset (1 here)
fps 72.2 72.7
frametime p99 21.5 ms 19.5 ms
1% low 40.1 fps 46.3 fps
frames over 20 ms 57 (55, 57, 57) 29 (29, 25, 33)
frames over 25 ms 14 (14, 15, 14) 2 (2, 1, 3)
first Market stay, frames over 20 ms 25 17

For reference, the numbers in #1726 (in-run A/B, HOS_AB=HOS_NATIVE_ZSTD=1, both sides in the same run):

PC, scene =2 (main's default) =1
Steam Deck OLED, Kokiri Forest standing (2 runs) 19.1 fps 29.1 fps
Steam Deck OLED, Castle Town market (1 run) 14.7 fps 17.4 fps
Steam Deck OLED, Hyrule Field (2 runs) 33.9 fps 34.0 fps (no difference: no stream decode there)
i9-13900K + RTX 4090, market walk, run 1: p99 37.15 ms 28.51 ms
i9-13900K + RTX 4090, market walk, run 2: p99 34.38 ms 24.04 ms
i9-13900K + RTX 4090, market walk, both runs: fps 62.8 65.7
i9-13900K + RTX 4090, market walk, frame generation 2x with V-Sync (held at 60 fps): p99 37.59 ms 26.17 ms
i9-13900K + RTX 4090, the same: fps 54.7 59.3

The Deck (zeldaootr): SteamOS 3.9.5, RADV, Minimum, Render 50%, uncapped. The 13900K (Jiro113): Windows 11, 2560x1440 DLAA, uncapped except the frame generation run.

The log of each run names the mode: HOS_NATIVE_ZSTD=1, this GPU's default: the core given up while it decodes unset, HOS_NATIVE_ZSTD=2 with it set. All six runs ended normally.

Risks

What could break: a load that hangs where giving the core up meets whatever froze #1632's laptop on another PC; Intel integrated GPUs keep the old default for that reason. Turning it off: HOS_NATIVE_ZSTD=2 (the core kept, as main) or =0 (the game's own decoder). After updating: nothing in a player's files changes.

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). [tests/run_all.py on Windows: 714 pass; the 50 that fail here fail the same on main @ 89c3d21e in the same environment; test_vbytes.py timed out at 600 s and reads none of the changed files; test_device_policy.py skipped without the Vulkan headers and passes with them]
  • 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.

Written with help from Claude Code (Claude Opus 5.5).

## Summary `HOS_NATIVE_ZSTD` now defaults to 1 on every PC except Intel integrated GPUs, which stay at 2. With 1, the game's zstd decode gives its virtual core up while libzstd works, so the game's other threads run meanwhile. That cuts slow frames wherever the game is short of CPU: Kokiri Forest on a Steam Deck OLED goes from 19.1 to 29.1 fps (#1726), and the Castle Town market's frames over 20 ms fall by about a third on a Ryzen desktop. Intel iGPUs keep 2 because of the load freezes on a Core Ultra 7 155H that made #1632 switch everyone to 2; that laptop hasn't been checked again since. How: an unset `HOS_NATIVE_ZSTD` asks the renderer through a new option id (`HOS_OPT_NATIVE_ZSTD`), which answers from the device policy (`native_zstd_keep_core` in `gpu/vk/device_policy.h`, on for an Intel integrated GPU). A value set wins as before. Read first: `zs_mode` in `host/hos_zstd.c`, `native_zstd_keep_core` in `gpu/vk/device_policy.h`, and where it is published (`gpu/vk/vk_main.cpp`) and answered (`gpu/vk/vk_replay.cpp`, `t.option`). Follows up on #1726, as zeldaootr asked there. See #1726, See #1632, See #1402, See #1477 ## Testing **Tested:** Windows 11, Ryzen 9 9900X, RTX 4070 SUPER (NVIDIA 621.24): this PR's build in the game, six route runs (Market, Hyrule Castle, Market again, with camera turns), all ending normally; the log names the default the GPU gave (`zstd: ... (HOS_NATIVE_ZSTD=1, this GPU's default: the core given up while it decodes)`). `tests/test_native_zstd.py` (the default by the renderer's answer, before it can answer, and a value set over it; fails on main for the new cases), `tests/test_device_policy.py` (the rule's edges) and `tests/test_switch_table.py` pass. **Still to test:** - windows+intel with a dedicated GPU, windows+amd, linux, steamdeck: a teleport tour, then the Market standing with camera turns, `HOS_NATIVE_ZSTD=2` against unset, expecting no load to hang and p99 the same or better unset (@Beanstalk) - windows+intel, an Intel iGPU: a start, expecting `HOS_NATIVE_ZSTD=2, this GPU's default` in the log (@Beanstalk) ## Measurements **Verdict:** the Market's frames over 20 ms halve (57 to 29) and those over 25 ms fall from 14 to 2; the 1% low goes from 40.1 to 46.3 fps, fps the same. The three runs of each side don't overlap. Setup: Windows 11, Ryzen 9 9900X (12 cores), RTX 4070 SUPER (NVIDIA 621.24), 64 GB; 3840x2160 with DLSS Quality, 90 fps cap, V-Sync on, the frame gate and readbacks as main ships them; a recorded walk (Market, Hyrule Castle, Market again), the frame trace; 3 runs a side, interleaved, the median; the window: the second Market stay from 5 s after arriving (about 55 s), from the present intervals. The runs were made at 65769aa3; 095b160b after it moves the rule into the device policy with no change in what a PC gets (a short run of it logs `native_zstd_keep_core=0` and `HOS_NATIVE_ZSTD=1, this GPU's default`). Baseline: this PR's build with `HOS_NATIVE_ZSTD=2` set, main's default: the only code this PR changes is which value an unset switch gets, so the same build with 2 runs as main does, and both sides share one build. | | Before: this PR @ 65769aa3 with `HOS_NATIVE_ZSTD=2` (main's default) | After: this PR @ 65769aa3, unset (1 here) | |---|---|---| | fps | 72.2 | 72.7 | | frametime p99 | 21.5 ms | 19.5 ms | | 1% low | 40.1 fps | 46.3 fps | | frames over 20 ms | 57 (55, 57, 57) | 29 (29, 25, 33) | | frames over 25 ms | 14 (14, 15, 14) | 2 (2, 1, 3) | | first Market stay, frames over 20 ms | 25 | 17 | For reference, the numbers in #1726 (in-run A/B, `HOS_AB=HOS_NATIVE_ZSTD=1`, both sides in the same run): | PC, scene | `=2` (main's default) | `=1` | |---|---|---| | Steam Deck OLED, Kokiri Forest standing (2 runs) | 19.1 fps | 29.1 fps | | Steam Deck OLED, Castle Town market (1 run) | 14.7 fps | 17.4 fps | | Steam Deck OLED, Hyrule Field (2 runs) | 33.9 fps | 34.0 fps (no difference: no stream decode there) | | i9-13900K + RTX 4090, market walk, run 1: p99 | 37.15 ms | 28.51 ms | | i9-13900K + RTX 4090, market walk, run 2: p99 | 34.38 ms | 24.04 ms | | i9-13900K + RTX 4090, market walk, both runs: fps | 62.8 | 65.7 | | i9-13900K + RTX 4090, market walk, frame generation 2x with V-Sync (held at 60 fps): p99 | 37.59 ms | 26.17 ms | | i9-13900K + RTX 4090, the same: fps | 54.7 | 59.3 | The Deck (zeldaootr): SteamOS 3.9.5, RADV, Minimum, Render 50%, uncapped. The 13900K (Jiro113): Windows 11, 2560x1440 DLAA, uncapped except the frame generation run. The log of each run names the mode: `HOS_NATIVE_ZSTD=1, this GPU's default: the core given up while it decodes` unset, `HOS_NATIVE_ZSTD=2` with it set. All six runs ended normally. ## Risks What could break: a load that hangs where giving the core up meets whatever froze #1632's laptop on another PC; Intel integrated GPUs keep the old default for that reason. Turning it off: `HOS_NATIVE_ZSTD=2` (the core kept, as main) or `=0` (the game's own decoder). After updating: nothing in a player's files changes. ## 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). [`tests/run_all.py` on Windows: 714 pass; the 50 that fail here fail the same on `main` @ 89c3d21e in the same environment; `test_vbytes.py` timed out at 600 s and reads none of the changed files; `test_device_policy.py` skipped without the Vulkan headers and passes with them] - [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. Written with help from Claude Code (Claude Opus 5.5).
perf(host): the game's zstd stream decode gives its virtual core up by default, except on Intel integrated GPUs (HOS_NATIVE_ZSTD)
Some checks failed
Website / Website on Cloudflare (pull_request_target) Has been skipped
PR description / Description follows the template (pull_request_target) Successful in 4s
beanstalk/approval waiting for a BigBean's 👍 on the request
CI / Conventional Commit title (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been cancelled
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been cancelled
CI / Workflow lint (actionlint) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
Guide screenshots / Guide images and local UI source review (pull_request) Has been cancelled
Third-party parts / As their notes say (pull_request) Has been cancelled
Third-party parts / The same as upstream (pull_request) Has been cancelled
65769aa3a9
Unset or empty, HOS_NATIVE_ZSTD is now the renderer's default for its GPU (gpu/vk/device_policy.h native_zstd_mode, asked
through HOS_OPT_NATIVE_ZSTD): 1 (the core given up while libzstd decodes) everywhere but an Intel integrated GPU, which keeps
2, as #1632 set for every PC after loads froze on a Core Ultra 7 155H's Arc iGPU. Until the renderer can answer, a call keeps
the core and the next asks again. A value set wins as before. The switch's row says what unset does.

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

Tested in game: Windows 11, Ryzen 9 9900X, RTX 4070 SUPER (NVIDIA 621.24), 4K DLSS Quality, 90 fps cap: six route runs through the Castle Town market, Hyrule Castle and the market again (3 unset, 3 with HOS_NATIVE_ZSTD=2, interleaved), all ending normally; the log names the GPU's default (HOS_NATIVE_ZSTD=1, this GPU's default); the market's frames over 20 ms 57 -> 29, no load hanging.

Tested in game: Windows 11, Ryzen 9 9900X, RTX 4070 SUPER (NVIDIA 621.24), 4K DLSS Quality, 90 fps cap: six route runs through the Castle Town market, Hyrule Castle and the market again (3 unset, 3 with HOS_NATIVE_ZSTD=2, interleaved), all ending normally; the log names the GPU's default (HOS_NATIVE_ZSTD=1, this GPU's default); the market's frames over 20 ms 57 -> 29, no load hanging.
Veix changed title from perf(host): the game's zstd stream decode gives its virtual core up by default, except on Intel integrated GPUs (HOS_NATIVE_ZSTD) to perf(host): native zstd gives its virtual core up by default, except on Intel iGPUs (lower p99; Steam Deck Kokiri Forest 19 to 29 fps) 2026-11-20 14:39:36 +00:00
Veix changed title from perf(host): native zstd gives its virtual core up by default, except on Intel iGPUs (lower p99; Steam Deck Kokiri Forest 19 to 29 fps) to perf(host): native zstd gives its virtual core up by default, except on Intel iGPUs (lower p99, higher fps on the Steam Deck) 2026-11-20 14:42:59 +00:00
Veix changed title from perf(host): native zstd gives its virtual core up by default, except on Intel iGPUs (lower p99, higher fps on the Steam Deck) to perf(host): native zstd gives its virtual core up by default, except on Intel iGPUs (lower p99 on the PCs it applies to, higher fps on the Steam Deck) 2026-11-20 14:43:57 +00:00
Author
Contributor

@Beanstalk

  • windows+intel with a dedicated GPU, windows+amd, linux, steamdeck: a teleport tour, then the Market standing with camera turns, HOS_NATIVE_ZSTD=2 against unset, expecting no load to hang and p99 the same or better unset
  • windows+intel, an Intel iGPU: a start, expecting HOS_NATIVE_ZSTD=2, this GPU's default in the log
@Beanstalk - windows+intel with a dedicated GPU, windows+amd, linux, steamdeck: a teleport tour, then the Market standing with camera turns, `HOS_NATIVE_ZSTD=2` against unset, expecting no load to hang and p99 the same or better unset - windows+intel, an Intel iGPU: a start, expecting `HOS_NATIVE_ZSTD=2, this GPU's default` in the log
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. This request was for 65769aa, and the PR has changed since (095b160), so a 👍 no longer approves it. Comment @Beanstalk again to ask for the new commit.

@Veix only members of `BigBeans` can start the farm. ~~One of them can approve this request by reacting 👍 to it or to this comment.~~ This request was for `65769aa`, and the PR has changed since (`095b160`), so a 👍 no longer approves it. Comment `@Beanstalk` again to ask for the new commit.
refactor(vk): the native zstd default is a field of the device policy (native_zstd_keep_core)
Some checks reported errors
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Blocked by required conditions
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Blocked by required conditions
CI / Workflow lint (actionlint) (pull_request) Blocked by required conditions
CI / Website build and checks (pull_request) Blocked by required conditions
CI / Conventional Commit title (pull_request) Blocked by required conditions
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Blocked by required conditions
Guide screenshots / Guide images and local UI source review (pull_request) Blocked by required conditions
Third-party parts / As their notes say (pull_request) Blocked by required conditions
Third-party parts / The same as upstream (pull_request) Blocked by required conditions
PR description / Description follows the template (pull_request_target) Successful in 5s
Website / Website on Cloudflare (pull_request_target) Has been skipped
beanstalk/approval approved by llun (reviewed)
beanstalk/any 0/1 pass, 2 error
095b160b1f
As the renderer's other rules by the GPU: computed from DeviceFacts, shown in the policy log, checked on every PC of
tests/test_device_policy.py. The host reads it through an atomic set once the policy is made, not from the device's
properties while they are filled. Shorter comments. No change in what each PC gets.

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

@Beanstalk

@Beanstalk
Member

Beanstalk test farm · ⚠️ couldn't be judged on any

Commit 095b160 · approved by llun (reviewed) · dashboard

Summary, written by AI (gpt-6.1-terra) from the numbers below:

The change could not be judged on the any target: the Windows RTX 4080 report failed while building the baseline, before the game ran, and the Linux RTX 4070 report timed out. On Linux, measured load time increased from 4.22 to 6.93 s, and maximum load time increased from 5.66 to 10.79 s. No usable starts were available on either side for the required Market frame-time p99 comparison.

Done (started 15:07 UTC, last report 15:58 UTC). Comment @Beanstalk to run it again.

Target Result Reports Frame time p99 (ms), main → PR VRAM peak (MB) Crashes
any ⚠️ couldn't be judged 2 1 2 — — none

Couldn't be judged: the tester's PC could not finish the test. The farm tries another PC, or the same one after a fix; it says nothing about the PR on its own.

  • any, report 1: the main base failed (exit 1): build.py stopped (exit status 1): fatal error: too many errors emitted, stopping now [-ferror-limit=]
  • any, report 2: Insufficient frame-time evidence for 1 required comparison(s). See rule results. a step ran out of time: timeout: not met in time
What was tested

What will be tested · AI plan (gpt-6.1-terra)

The plan compares the new default with main during a teleport tour from Kokiri Forest through the Market and Hyrule Castle, then measures Market frame times during a camera turn. It takes about 13 minutes per tester and checks load completion, the reported GPU default, and Market visuals. A crash, missing default-mode log, timed-out load, substantial p99 regression, or screenshot difference fails the PR.

  • Where: any (any PC, 1-2 reports).
  • streaming-tour: from the repository's save kokiri-start, then teleport to Kokiri Forest, teleport to Market, teleport to Hyrule Castle, move the stick, take the picture market to compare with main, measure market for 30 s (after 5 s warm-up); 1 run on each side.
  • Measured: crashes, frame times, stutters and hitches, load times, the game's log.
  • The PR fails if: it crashes; or a picture differs from main by more than 5%; or frame time (p99) is more than 15% above main; or forbidden log lines is above 0; or expected log lines missing is above 0.
  • Time: about 12 min of game runs per tester (2 game starts), plus the two builds.
Measurements on `any`, for the PR description

Verdict: could not be judged on any (2 reports): required frame-time comparison inconclusive (fewer than two usable starts per side).

Hardware: 1: windows+nvidia+nvidia-proprietary+dgpu NVIDIA GeForce RTX 4080, 621.1.0 AMD Ryzen 7 9800X3D 8-Core Processor, 32 GB RAM; 2: linux+nvidia+nvidia-proprietary+dgpu NVIDIA GeForce RTX 4070, 615.71.9 AMD Ryzen 7 5800X3D 8-Core Processor, 64 GB RAM
Scene: streaming-tour, from the repository's save kokiri-start; each cell's settings and switches as the table names them
Method: the Beanstalk test farm: main and this PR built and run on the same PC in one session, game starts alternating (ABBA); streaming-tour: 1 game start a side, market 30 s after 5 s warm-up; each number the median of the runs, then of 2 reports
How to reproduce: the farm's plan above (@Beanstalk on this PR runs it again)

Before: main @ 89c3d21 After: this PR @ 095b160
streaming-tour · forbidden log lines 0.0 0.0
streaming-tour · expected log lines missing 1.0 0.0 (−100%)

Flags and settings

None: the plan varied no setting, switch or build option.

As Markdown for the PR description:

## Measurements

**Verdict:** could not be judged on any (2 reports): required frame-time comparison inconclusive (fewer than two usable starts per side).

Hardware: 1: windows+nvidia+nvidia-proprietary+dgpu `NVIDIA GeForce RTX 4080, 621.1.0` `AMD Ryzen 7 9800X3D 8-Core Processor, 32 GB RAM`; 2: linux+nvidia+nvidia-proprietary+dgpu `NVIDIA GeForce RTX 4070, 615.71.9` `AMD Ryzen 7 5800X3D 8-Core Processor, 64 GB RAM`  
Scene: streaming-tour, from the repository's save kokiri-start; each cell's settings and switches as the table names them  
Method: the Beanstalk test farm: main and this PR built and run on the same PC in one session, game starts alternating (ABBA); streaming-tour: 1 game start a side, market 30 s after 5 s warm-up; each number the median of the runs, then of 2 reports  
How to reproduce: the farm's plan above (`@Beanstalk` on this PR runs it again)

| | Before: main @ 89c3d21 | After: this PR @ 095b160 |
|---|---|---|
| streaming-tour · forbidden log lines | 0.0 | 0.0 |
| streaming-tour · expected log lines missing | 1.0 | 0.0 (−100%) |

**Flags and settings**

None: the plan varied no setting, switch or build option.
The testers' hardware
Target Report Ran on
any 1 windows+nvidia+nvidia-proprietary+dgpu NVIDIA GeForce RTX 4080, 621.1.0 AMD Ryzen 7 9800X3D 8-Core Processor, 32 GB RAM
any 2 linux+nvidia+nvidia-proprietary+dgpu NVIDIA GeForce RTX 4070, 615.71.9 AMD Ryzen 7 5800X3D 8-Core Processor, 64 GB RAM
<!-- beanstalk:sticky --> ### Beanstalk test farm · ⚠️ couldn't be judged on any Commit `095b160` · approved by llun (reviewed) · [dashboard](https://beanstalk.magicbean.dev/prs/1875) > **Summary**, written by AI (`gpt-6.1-terra`) from the numbers below: > > The change could not be judged on the any target: the Windows RTX 4080 report failed while building the baseline, before the game ran, and the Linux RTX 4070 report timed out. On Linux, measured load time increased from 4.22 to 6.93 s, and maximum load time increased from 5.66 to 10.79 s. No usable starts were available on either side for the required Market frame-time p99 comparison. Done (started 15:07 UTC, last report 15:58 UTC). Comment `@Beanstalk` to run it again. | Target | Result | Reports | Frame time p99 (ms), main → PR | VRAM peak (MB) | Crashes | | --- | --- | --- | --- | --- | --- | | `any` | ⚠️ couldn't be judged | 2 [1](https://beanstalk.magicbean.dev/reports/rp_705c0c12f0933e9b) [2](https://beanstalk.magicbean.dev/reports/rp_9064cfd1584c02c9) | — | — | none | **Couldn't be judged**: the tester's PC could not finish the test. The farm tries another PC, or the same one after a fix; it says nothing about the PR on its own. - `any`, [report 1](https://beanstalk.magicbean.dev/reports/rp_705c0c12f0933e9b): `the main base failed (exit 1): build.py stopped (exit status 1): fatal error: too many errors emitted, stopping now [-ferror-limit=]` - `any`, [report 2](https://beanstalk.magicbean.dev/reports/rp_9064cfd1584c02c9): `Insufficient frame-time evidence for 1 required comparison(s). See rule results. a step ran out of time: timeout: not met in time` <details><summary>What was tested</summary> **What will be tested** · AI plan (`gpt-6.1-terra`) The plan compares the new default with main during a teleport tour from Kokiri Forest through the Market and Hyrule Castle, then measures Market frame times during a camera turn. It takes about 13 minutes per tester and checks load completion, the reported GPU default, and Market visuals. A crash, missing default-mode log, timed-out load, substantial p99 regression, or screenshot difference fails the PR. - **Where:** any (any PC, 1-2 reports). - **streaming-tour:** from the repository's save `kokiri-start`, then teleport to Kokiri Forest, teleport to Market, teleport to Hyrule Castle, move the stick, take the picture market to compare with main, measure market for 30 s (after 5 s warm-up); 1 run on each side. - **Measured:** crashes, frame times, stutters and hitches, load times, the game's log. - **The PR fails if:** it crashes; or a picture differs from main by more than 5%; or frame time (p99) is more than 15% above main; or forbidden log lines is above 0; or expected log lines missing is above 0. - **Time:** about 12 min of game runs per tester (2 game starts), plus the two builds. </details> <details><summary>Measurements on `any`, for the PR description</summary> **Verdict:** could not be judged on any (2 reports): required frame-time comparison inconclusive (fewer than two usable starts per side). Hardware: 1: windows+nvidia+nvidia-proprietary+dgpu `NVIDIA GeForce RTX 4080, 621.1.0` `AMD Ryzen 7 9800X3D 8-Core Processor, 32 GB RAM`; 2: linux+nvidia+nvidia-proprietary+dgpu `NVIDIA GeForce RTX 4070, 615.71.9` `AMD Ryzen 7 5800X3D 8-Core Processor, 64 GB RAM` Scene: streaming-tour, from the repository's save kokiri-start; each cell's settings and switches as the table names them Method: the Beanstalk test farm: main and this PR built and run on the same PC in one session, game starts alternating (ABBA); streaming-tour: 1 game start a side, market 30 s after 5 s warm-up; each number the median of the runs, then of 2 reports How to reproduce: the farm's plan above (`@Beanstalk` on this PR runs it again) | | Before: main @ 89c3d21 | After: this PR @ 095b160 | |---|---|---| | streaming-tour · forbidden log lines | 0.0 | 0.0 | | streaming-tour · expected log lines missing | 1.0 | 0.0 (−100%) | **Flags and settings** None: the plan varied no setting, switch or build option. As Markdown for the PR description: ```markdown ## Measurements **Verdict:** could not be judged on any (2 reports): required frame-time comparison inconclusive (fewer than two usable starts per side). Hardware: 1: windows+nvidia+nvidia-proprietary+dgpu `NVIDIA GeForce RTX 4080, 621.1.0` `AMD Ryzen 7 9800X3D 8-Core Processor, 32 GB RAM`; 2: linux+nvidia+nvidia-proprietary+dgpu `NVIDIA GeForce RTX 4070, 615.71.9` `AMD Ryzen 7 5800X3D 8-Core Processor, 64 GB RAM` Scene: streaming-tour, from the repository's save kokiri-start; each cell's settings and switches as the table names them Method: the Beanstalk test farm: main and this PR built and run on the same PC in one session, game starts alternating (ABBA); streaming-tour: 1 game start a side, market 30 s after 5 s warm-up; each number the median of the runs, then of 2 reports How to reproduce: the farm's plan above (`@Beanstalk` on this PR runs it again) | | Before: main @ 89c3d21 | After: this PR @ 095b160 | |---|---|---| | streaming-tour · forbidden log lines | 0.0 | 0.0 | | streaming-tour · expected log lines missing | 1.0 | 0.0 (−100%) | **Flags and settings** None: the plan varied no setting, switch or build option. ``` </details> <details><summary>The testers' hardware</summary> | Target | Report | Ran on | | --- | --- | --- | | `any` | [1](https://beanstalk.magicbean.dev/reports/rp_705c0c12f0933e9b) | windows+nvidia+nvidia-proprietary+dgpu `NVIDIA GeForce RTX 4080, 621.1.0` `AMD Ryzen 7 9800X3D 8-Core Processor, 32 GB RAM` | | `any` | [2](https://beanstalk.magicbean.dev/reports/rp_9064cfd1584c02c9) | linux+nvidia+nvidia-proprietary+dgpu `NVIDIA GeForce RTX 4070, 615.71.9` `AMD Ryzen 7 5800X3D 8-Core Processor, 64 GB RAM` | </details>
Contributor

Steam Deck run: main against this PR, no switches set

The Deck gains from the PR's default, and no load hung. Kokiri Forest standing goes from 20.1 to 33.1 fps. The frames of 50 ms or more there fall from about 1,150 to 1 in 120 s. The Castle Town market goes from 17.5 to 20.2 fps, with a third fewer frames of 50 ms or more. Hyrule Field doesn't change while standing, and the camera pans are within run-to-run noise. With HOS_NATIVE_ZSTD=2 set on this PR's build, it runs as main does, so the switch still wins.

Builds. Both builds use the same base and translator. Neither side had a switch set, and both used the same prepared shader cache, with no preparation in any run.

  • A: main 89c3d21ea (v3.0.0-75-g89c3d21ea).
  • B: the same base plus this PR at 65769aa3a (v3.0.0-76-g65769aa3a), which sits directly on 89c3d21ea.

These runs are of 65769aa3a. The refactor in 095b160b1 came after them and wasn't run here.

Hardware. Steam Deck OLED, SteamOS 3.9.5, RADV VANGOGH (Mesa 26.2.0-devel), GPU clock set by hand to 1600 MHz (manual before and after every run), headless 1280x800.

Settings. Developers' settings: Minimum (quality_preset=1), handheld_profile=0, Render 50% (resolution=4), 1280x800, frame pacing on, uncapped (frame_rate_cap=6), V-Sync off, save at the Kokiri start.

  • Main route: Kokiri Forest standing 120 s, a teleport to Hyrule Field, standing 60 s, 4 camera pans, then standing to the end.
  • Market: the Castle Town market standing, from 20 s to 140 s after arriving.
  • Order: A B B A on each scene, then one more B on the main route with HOS_NATIVE_ZSTD=2 set.

Measures. Each table gives fps, p99 frame time, the 1% low (1000 / the mean of the slowest 1% of frame times) and the number of frames of 50 ms or more in the window. Each run is shown, with the median in bold.

Kokiri Forest, standing 120 s

fps p99 1% low frames ≥ 50 ms
A main, run 1 20.13 65.9 ms 14.15 1130
A main, run 2 20.14 64.4 ms 14.94 1162
A median 20.1 65.2 ms 14.5 1146
B PR, run 1 33.04 39.3 ms 23.97 1
B PR, run 2 33.13 39.1 ms 24.26 1
B median 33.1 39.2 ms 24.1 1
B with HOS_NATIVE_ZSTD=2 20.15 67.0 ms 14.54 1139

Hyrule Field, standing 60 s after the teleport

fps p99 1% low frames ≥ 50 ms
A main, runs 42.28, 42.60 28.3, 28.3 ms 33.21, 33.74 0, 0
A median 42.4 28.3 ms 33.5 0
B PR, runs 42.37, 42.49 28.3, 28.3 ms 33.64, 33.74 0, 0
B median 42.4 28.3 ms 33.7 0
B with =2 42.73 27.8 ms 33.97 0

Hyrule Field, 4 camera pans (about 44 s)

fps p99 1% low frames ≥ 50 ms
A main, runs 38.82, 40.22 56.4, 44.1 ms 12.40, 15.29 26, 13
A median 39.5 50.3 ms 13.8 19.5
B PR, runs 37.76, 40.56 54.1, 45.7 ms 15.57, 15.68 20, 11
B median 39.2 49.9 ms 15.6 15.5
B with =2 40.14 44.5 ms 17.95 12

The runs of the two sides overlap here, so the pans show no difference either way.

Hyrule Field, standing after the pans (about 87 s)

fps p99 1% low frames ≥ 50 ms
A main, runs 45.23, 46.36 32.4, 27.8 ms 26.35, 32.56 3, 1
A median 45.8 30.1 ms 29.5 2
B PR, runs 49.05, 48.43 24.5, 27.1 ms 37.35, 33.09 0, 1
B median 48.7 25.8 ms 35.2 0.5
B with =2 46.78 28.8 ms 31.50 1

In this window, B's fps is a little higher, and the runs of the two sides don't overlap.

Castle Town market, standing 120 s

fps p99 1% low frames ≥ 50 ms
A main, run 1 18.08 145.2 ms 6.15 1280
A main, run 2 16.87 159.6 ms 5.71 1390
A median 17.5 152.4 ms 5.9 1335
B PR, run 1 20.08 144.1 ms 6.15 839
B PR, run 2 20.39 115.6 ms 6.83 872
B median 20.2 129.9 ms 6.5 856

At the market, fps and the frames of 50 ms or more don't overlap between the sides. The p99 and the 1% low do overlap, and the market's longest stalls (over 100 ms) are on both sides.

The mode each side logged

Each run logged its mode once, at line 115 of the log (logs of 5,400 to 8,800 lines). That is before the first presents line (lines 471 to 481), so the mode was settled before the first frames.

  • A (all 4 runs): [hos ParallelDecompThread] zstd: the game's stream decode on the host's libzstd 1.5.7 (HOS_NATIVE_ZSTD=2)
  • B (all 4 runs): [hos ParallelDecompThread] zstd: the game's stream decode on the host's libzstd 1.5.7 (HOS_NATIVE_ZSTD=1, this GPU's default: the core given up while it decodes)
  • B with HOS_NATIVE_ZSTD=2 set: [hos ParallelDecompThread] zstd: the game's stream decode on the host's libzstd 1.5.7 (HOS_NATIVE_ZSTD=2), without "this GPU's default"

The override check. B with =2 set matches A in every window: Kokiri 20.15 fps against A's 20.1, and 1139 frames of 50 ms or more against A's 1146. A value set still wins over the GPU's default.

Loads and errors. All 9 runs exited with code 0. No run logged VK_ERROR, device lost, a validation message, an [error] line or a crash. No load hung:

  • Teleport to Hyrule Field, from the teleport to arrival: 6 and 8 s on A, 6 and 7 s on B, 7 s on B with =2.
  • Teleport to the market: 11 to 14 s on both sides.

Two questions on the diff

  1. gpu/vk/switches.def changes the switch's kind from attempt to hw:
    -SW(HOS_NATIVE_ZSTD, attempt, enum, "off: the game's own zstd decodes its streams", ...)
    +SW(HOS_NATIVE_ZSTD, hw, enum, "the game's zstd streams decoded on the host's libzstd, the virtual core given up meanwhile (1), kept (2) on an Intel integrated GPU", ...)
    
    hw looks right for a default that now follows the GPU. The old row's "off" was out of date on main too, where the default is 2. Could the description say that the switch's kind changes, so a reader of the switch table isn't surprised?
  2. A smaller one, already settled by 095b160b1: at 65769aa3a, the comment over native_zstd_mode in gpu/vk/device_policy.h quoted the Castle Town market's frames over 20 ms 42.5 -> 26 (Ryzen 9 9900X, RTX 4070 SUPER), while the Measurements give 57 -> 29. That comment is gone at the current head, so there is nothing to change. I mention it only in case those numbers are reused elsewhere.

Limits

  • Two runs a side on each scene, and one run of the override.
  • Headless, on one Deck, at a fixed GPU clock.
  • Standing and scripted camera pans only, with no walking or combat.
  • The build is 65769aa3a, not the current head 095b160b1, whose description says it gives every PC the same mode.

zeldaootr

## Steam Deck run: main against this PR, no switches set The Deck gains from the PR's default, and no load hung. Kokiri Forest standing goes from 20.1 to 33.1 fps. The frames of 50 ms or more there fall from about 1,150 to 1 in 120 s. The Castle Town market goes from 17.5 to 20.2 fps, with a third fewer frames of 50 ms or more. Hyrule Field doesn't change while standing, and the camera pans are within run-to-run noise. With `HOS_NATIVE_ZSTD=2` set on this PR's build, it runs as main does, so the switch still wins. **Builds.** Both builds use the same base and translator. Neither side had a switch set, and both used the same prepared shader cache, with no preparation in any run. - A: main `89c3d21ea` (`v3.0.0-75-g89c3d21ea`). - B: the same base plus this PR at `65769aa3a` (`v3.0.0-76-g65769aa3a`), which sits directly on `89c3d21ea`. These runs are of `65769aa3a`. The refactor in `095b160b1` came after them and wasn't run here. **Hardware.** Steam Deck OLED, SteamOS 3.9.5, RADV VANGOGH (Mesa 26.2.0-devel), GPU clock set by hand to 1600 MHz (manual before and after every run), headless 1280x800. **Settings.** Developers' settings: Minimum (`quality_preset=1`), `handheld_profile=0`, Render 50% (`resolution=4`), 1280x800, frame pacing on, uncapped (`frame_rate_cap=6`), V-Sync off, save at the Kokiri start. - Main route: Kokiri Forest standing 120 s, a teleport to Hyrule Field, standing 60 s, 4 camera pans, then standing to the end. - Market: the Castle Town market standing, from 20 s to 140 s after arriving. - Order: A B B A on each scene, then one more B on the main route with `HOS_NATIVE_ZSTD=2` set. **Measures.** Each table gives fps, p99 frame time, the 1% low (1000 / the mean of the slowest 1% of frame times) and the number of frames of 50 ms or more in the window. Each run is shown, with the median in bold. ### Kokiri Forest, standing 120 s | | fps | p99 | 1% low | frames ≥ 50 ms | |---|---|---|---|---| | A main, run 1 | 20.13 | 65.9 ms | 14.15 | 1130 | | A main, run 2 | 20.14 | 64.4 ms | 14.94 | 1162 | | **A median** | **20.1** | **65.2 ms** | **14.5** | **1146** | | B PR, run 1 | 33.04 | 39.3 ms | 23.97 | 1 | | B PR, run 2 | 33.13 | 39.1 ms | 24.26 | 1 | | **B median** | **33.1** | **39.2 ms** | **24.1** | **1** | | B with `HOS_NATIVE_ZSTD=2` | 20.15 | 67.0 ms | 14.54 | 1139 | ### Hyrule Field, standing 60 s after the teleport | | fps | p99 | 1% low | frames ≥ 50 ms | |---|---|---|---|---| | A main, runs | 42.28, 42.60 | 28.3, 28.3 ms | 33.21, 33.74 | 0, 0 | | **A median** | **42.4** | **28.3 ms** | **33.5** | **0** | | B PR, runs | 42.37, 42.49 | 28.3, 28.3 ms | 33.64, 33.74 | 0, 0 | | **B median** | **42.4** | **28.3 ms** | **33.7** | **0** | | B with `=2` | 42.73 | 27.8 ms | 33.97 | 0 | ### Hyrule Field, 4 camera pans (about 44 s) | | fps | p99 | 1% low | frames ≥ 50 ms | |---|---|---|---|---| | A main, runs | 38.82, 40.22 | 56.4, 44.1 ms | 12.40, 15.29 | 26, 13 | | **A median** | **39.5** | **50.3 ms** | **13.8** | **19.5** | | B PR, runs | 37.76, 40.56 | 54.1, 45.7 ms | 15.57, 15.68 | 20, 11 | | **B median** | **39.2** | **49.9 ms** | **15.6** | **15.5** | | B with `=2` | 40.14 | 44.5 ms | 17.95 | 12 | The runs of the two sides overlap here, so the pans show no difference either way. ### Hyrule Field, standing after the pans (about 87 s) | | fps | p99 | 1% low | frames ≥ 50 ms | |---|---|---|---|---| | A main, runs | 45.23, 46.36 | 32.4, 27.8 ms | 26.35, 32.56 | 3, 1 | | **A median** | **45.8** | **30.1 ms** | **29.5** | **2** | | B PR, runs | 49.05, 48.43 | 24.5, 27.1 ms | 37.35, 33.09 | 0, 1 | | **B median** | **48.7** | **25.8 ms** | **35.2** | **0.5** | | B with `=2` | 46.78 | 28.8 ms | 31.50 | 1 | In this window, B's fps is a little higher, and the runs of the two sides don't overlap. ### Castle Town market, standing 120 s | | fps | p99 | 1% low | frames ≥ 50 ms | |---|---|---|---|---| | A main, run 1 | 18.08 | 145.2 ms | 6.15 | 1280 | | A main, run 2 | 16.87 | 159.6 ms | 5.71 | 1390 | | **A median** | **17.5** | **152.4 ms** | **5.9** | **1335** | | B PR, run 1 | 20.08 | 144.1 ms | 6.15 | 839 | | B PR, run 2 | 20.39 | 115.6 ms | 6.83 | 872 | | **B median** | **20.2** | **129.9 ms** | **6.5** | **856** | At the market, fps and the frames of 50 ms or more don't overlap between the sides. The p99 and the 1% low do overlap, and the market's longest stalls (over 100 ms) are on both sides. ### The mode each side logged Each run logged its mode once, at line 115 of the log (logs of 5,400 to 8,800 lines). That is before the first presents line (lines 471 to 481), so the mode was settled before the first frames. - A (all 4 runs): `[hos ParallelDecompThread] zstd: the game's stream decode on the host's libzstd 1.5.7 (HOS_NATIVE_ZSTD=2)` - B (all 4 runs): `[hos ParallelDecompThread] zstd: the game's stream decode on the host's libzstd 1.5.7 (HOS_NATIVE_ZSTD=1, this GPU's default: the core given up while it decodes)` - B with `HOS_NATIVE_ZSTD=2` set: `[hos ParallelDecompThread] zstd: the game's stream decode on the host's libzstd 1.5.7 (HOS_NATIVE_ZSTD=2)`, without "this GPU's default" **The override check.** B with `=2` set matches A in every window: Kokiri 20.15 fps against A's 20.1, and 1139 frames of 50 ms or more against A's 1146. A value set still wins over the GPU's default. **Loads and errors.** All 9 runs exited with code 0. No run logged `VK_ERROR`, device lost, a validation message, an `[error]` line or a crash. No load hung: - Teleport to Hyrule Field, from the teleport to arrival: 6 and 8 s on A, 6 and 7 s on B, 7 s on B with `=2`. - Teleport to the market: 11 to 14 s on both sides. ### Two questions on the diff 1. `gpu/vk/switches.def` changes the switch's kind from `attempt` to `hw`: ``` -SW(HOS_NATIVE_ZSTD, attempt, enum, "off: the game's own zstd decodes its streams", ...) +SW(HOS_NATIVE_ZSTD, hw, enum, "the game's zstd streams decoded on the host's libzstd, the virtual core given up meanwhile (1), kept (2) on an Intel integrated GPU", ...) ``` `hw` looks right for a default that now follows the GPU. The old row's "off" was out of date on main too, where the default is 2. Could the description say that the switch's kind changes, so a reader of the switch table isn't surprised? 2. A smaller one, already settled by `095b160b1`: at `65769aa3a`, the comment over `native_zstd_mode` in `gpu/vk/device_policy.h` quoted `the Castle Town market's frames over 20 ms 42.5 -> 26 (Ryzen 9 9900X, RTX 4070 SUPER)`, while the Measurements give 57 -> 29. That comment is gone at the current head, so there is nothing to change. I mention it only in case those numbers are reused elsewhere. ### Limits - Two runs a side on each scene, and one run of the override. - Headless, on one Deck, at a fixed GPU clock. - Standing and scripted camera pans only, with no walking or combat. - The build is `65769aa3a`, not the current head `095b160b1`, whose description says it gives every PC the same mode. zeldaootr
Owner

Linux results from another PC, for the "linux" item in Still to test: Linux (CachyOS, kernel 7.3), RTX 3090 (NVIDIA 620.x), Ryzen 9 7900X (12 cores), 2560x1440, uncapped, Threaded rendering Auto. This PR @ 095b160b, one build: unset (logs HOS_NATIVE_ZSTD=1, this GPU's default: the core given up while it decodes) against HOS_NATIVE_ZSTD=2. Kokiri Forest then Castle Town Market, each 20 s standing, 15 s walking, 15 s turning; four rounds, the order alternated each round (the PC ran slower as the session went on, so compare within a round). No hang or crash; all loads ended normally.

=2 (main) runs unset (=1) runs median =2 / =1
Market standing fps 90, 84, 78, 78 85, 79, 75, 77 80.7 / 77.9
Market standing p99 ms 13, 16, 20, 18 16, 16, 19, 17 17.2 / 16.8
Market walking fps 78, 78, 65, 76 86, 75, 67, 72 77.0 / 73.5
Market walking p99 ms 21, 19, 24, 20 19, 23, 26, 24 20.8 / 23.8
Market turning fps 96, 88, 92, 88 100, 92, 85, 91 89.9 / 91.9
Market turning p99 ms 17, 20, 18, 18 15, 17, 21, 17 17.9 / 16.7
Kokiri standing fps 103, 96, 92, 87 95, 104, 91, 88 93.9 / 92.7
Kokiri turning fps 100, 89, 89, 88 96, 101, 91, 89 89.4 / 93.3

The Market standing was lower unset in all four rounds (by 1-6%, about -3.5%); walking p99 a little worse, turning p99 a little better; Kokiri even. So on this 12-core Linux PC giving the core up doesn't help and costs a little where the game streams.

A guess at why, not measured: giving the virtual core up pays where the game's virtual cores are contended (the Deck's 4 cores, a busy PC), and costs a re-acquire on each decode where they aren't (12 cores here). If that holds, the default might follow the physical core count (usable_cores, as Threaded rendering's Auto does) rather than the GPU: 1 on few cores, 2 on many. The vcores log lines of both sides would show whether the decode thread waits more for its core unset.

Linux results from another PC, for the "linux" item in Still to test: Linux (CachyOS, kernel 7.3), RTX 3090 (NVIDIA 620.x), Ryzen 9 7900X (12 cores), 2560x1440, uncapped, Threaded rendering Auto. This PR @ 095b160b, one build: unset (logs `HOS_NATIVE_ZSTD=1, this GPU's default: the core given up while it decodes`) against `HOS_NATIVE_ZSTD=2`. Kokiri Forest then Castle Town Market, each 20 s standing, 15 s walking, 15 s turning; four rounds, the order alternated each round (the PC ran slower as the session went on, so compare within a round). No hang or crash; all loads ended normally. | | `=2` (main) runs | unset (`=1`) runs | median `=2` / `=1` | |---|---|---|---| | Market standing fps | 90, 84, 78, 78 | 85, 79, 75, 77 | 80.7 / 77.9 | | Market standing p99 ms | 13, 16, 20, 18 | 16, 16, 19, 17 | 17.2 / 16.8 | | Market walking fps | 78, 78, 65, 76 | 86, 75, 67, 72 | 77.0 / 73.5 | | Market walking p99 ms | 21, 19, 24, 20 | 19, 23, 26, 24 | 20.8 / 23.8 | | Market turning fps | 96, 88, 92, 88 | 100, 92, 85, 91 | 89.9 / 91.9 | | Market turning p99 ms | 17, 20, 18, 18 | 15, 17, 21, 17 | 17.9 / 16.7 | | Kokiri standing fps | 103, 96, 92, 87 | 95, 104, 91, 88 | 93.9 / 92.7 | | Kokiri turning fps | 100, 89, 89, 88 | 96, 101, 91, 89 | 89.4 / 93.3 | The Market standing was lower unset in all four rounds (by 1-6%, about -3.5%); walking p99 a little worse, turning p99 a little better; Kokiri even. So on this 12-core Linux PC giving the core up doesn't help and costs a little where the game streams. A guess at why, not measured: giving the virtual core up pays where the game's virtual cores are contended (the Deck's 4 cores, a busy PC), and costs a re-acquire on each decode where they aren't (12 cores here). If that holds, the default might follow the physical core count (`usable_cores`, as Threaded rendering's Auto does) rather than the GPU: 1 on few cores, 2 on many. The vcores log lines of both sides would show whether the decode thread waits more for its core unset.
Author
Contributor

On Windows with 12 cores, standing in the Market costs nothing with =1, even CPU-bound.

Windows 11, Ryzen 9 9900X, RTX 4070 SUPER; main 2210931c + this PR, no switches besides HOS_NATIVE_ZSTD; Market standing 60 s (from +5 s), one run each:

unset (=1) =2
4K DLSS Quality, uncapped: fps / 1% low / p99 76.5 / 63.8 / 15.1 ms 76.8 / 63.7 / 15.0 ms
480p, uncapped, V-Sync off: fps / 1% low / p99 90.1 / 80.2 / 12.2 ms 89.9 / 79.4 / 12.3 ms

No frame over 20 ms in any of them. The gain here is all in moving (the route in Measurements: frames over 20 ms 57 to 29). So the standing cost on the 7900X may be Linux-specific (the host's pthread emulation of the waits, or the scheduler) rather than the core count. Happy to re-test the conditional version on this PC once it's on the branch.

**On Windows with 12 cores, standing in the Market costs nothing with `=1`, even CPU-bound.** Windows 11, Ryzen 9 9900X, RTX 4070 SUPER; main 2210931c + this PR, no switches besides `HOS_NATIVE_ZSTD`; Market standing 60 s (from +5 s), one run each: | | unset (`=1`) | `=2` | |---|---|---| | 4K DLSS Quality, uncapped: fps / 1% low / p99 | 76.5 / 63.8 / 15.1 ms | 76.8 / 63.7 / 15.0 ms | | 480p, uncapped, V-Sync off: fps / 1% low / p99 | 90.1 / 80.2 / 12.2 ms | 89.9 / 79.4 / 12.3 ms | No frame over 20 ms in any of them. The gain here is all in moving (the route in Measurements: frames over 20 ms 57 to 29). So the standing cost on the 7900X may be Linux-specific (the host's pthread emulation of the waits, or the scheduler) rather than the core count. Happy to re-test the conditional version on this PC once it's on the branch.
Contributor

A caveat on my Steam Deck numbers above: they came from a game folder with three damaged romfs files, and that is where most of the Kokiri and Market cost comes from.

What I found since, on the same Deck:

  • In Kokiri Forest and the Castle Town market, OptimizeChangeBank preloads HyruleField_Child. One model in that preload, Land_FairyFountain_Base_A_01, never loads: its texture Tex/CmnTex_Map_Soil_FairyFountain_Floor_D_Nrm.bntx.zs starts with 12,288 zero bytes in my dump, so it is not a zstd frame. The game decodes the 10.8 MiB model, fails on the texture, lets the handle go and asks again, about 15 times a second, for as long as Link stands there. That is the loader at ~80 % of a core and the decode threads at ~55 % that the Deck's logs showed, and it is what HOS_NATIVE_ZSTD=2 was holding virtual cores for.
  • nx2/nup.py already knows these files ("in the 23.3 GB dumps three of them begin with zeros") and make_game.stand_in_damaged_files puts stand-ins in, but only in a romfs the builder unpacked itself (the .longshot_romfs stamp). My romfs was unpacked by Hookshot, has no stamp, and kept all three: that one, Tex/Rock_WaterTemple_Gate_M_01_Nrm.bntx.zs and Tex/RBake_Scene_GanonStage_G_2_1_d0_t0.bntx.zs. Nothing in the log says so.

With the builder's own stand-ins served through HOS_FS_OVERLAY (the same build, main 2210931cf plus a trace switch, HOS_NATIVE_ZSTD=1 on both sides, Steam Deck OLED, Minimum, Render 50%, uncapped, headless, 60 s standing, two starts a side, interleaved):

damaged files: fps (each start) stand-ins: fps (each start) p99 frames ≥ 50 ms in 60 s loader / decode CPU
Kokiri Forest 30.46, 29.46 44.21, 44.37 47.9, 50.9 → 27.9, 27.4 ms 7, 20 → 0, 0 79 / 55 % → 0 / 0 %
Castle Town market 20.45, 20.32 27.59, 26.53 130.9, 133.0 → 72.0, 84.3 ms 402, 426 → 63, 93 74 / 45 % → 0 / 0 %
Hyrule Field (control) 47.84, 47.94 47.84, 47.28 no change 0 0 / 0 % on both

With the stand-ins the preload finishes in about 10 s and the loader idles, as it does in Hyrule Field.

What this means for this PR, as far as my data goes:

  • The Deck gain I reported here (Kokiri 20.1 → 33.1 fps) is real on a game folder like mine, and one extra run agrees: with the damaged files and =2, Kokiri gave 19.2 fps and 634 frames of 50 ms or more; with =1, about 30. So =1 still protects anyone whose romfs has this problem, and I have no reason to think it costs anything.
  • I have not measured =1 against =2 on a repaired romfs. With the loader idle while standing, I would expect the difference there to be small and to show mainly at area changes. I will run that and post it here.
  • If other Deck numbers for this PR also came from a romfs unpacked by something other than Longshot's builder, they may carry the same loop. A quick check: the first four bytes of romfs/Tex/CmnTex_Map_Soil_FairyFountain_Floor_D_Nrm.bntx.zs should be 28 b5 2f fd, not zeros.

I will open an issue for the missing warning (a romfs without the builder's stamp keeps the damaged files silently).

zeldaootr

**A caveat on my Steam Deck numbers above: they came from a game folder with three damaged romfs files, and that is where most of the Kokiri and Market cost comes from.** What I found since, on the same Deck: - In Kokiri Forest and the Castle Town market, OptimizeChangeBank preloads `HyruleField_Child`. One model in that preload, `Land_FairyFountain_Base_A_01`, never loads: its texture `Tex/CmnTex_Map_Soil_FairyFountain_Floor_D_Nrm.bntx.zs` starts with 12,288 zero bytes in my dump, so it is not a zstd frame. The game decodes the 10.8 MiB model, fails on the texture, lets the handle go and asks again, about 15 times a second, for as long as Link stands there. That is the loader at ~80 % of a core and the decode threads at ~55 % that the Deck's logs showed, and it is what `HOS_NATIVE_ZSTD=2` was holding virtual cores for. - `nx2/nup.py` already knows these files ("in the 23.3 GB dumps three of them begin with zeros") and `make_game.stand_in_damaged_files` puts stand-ins in, but only in a romfs the builder unpacked itself (the `.longshot_romfs` stamp). My romfs was unpacked by Hookshot, has no stamp, and kept all three: that one, `Tex/Rock_WaterTemple_Gate_M_01_Nrm.bntx.zs` and `Tex/RBake_Scene_GanonStage_G_2_1_d0_t0.bntx.zs`. Nothing in the log says so. With the builder's own stand-ins served through `HOS_FS_OVERLAY` (the same build, main 2210931cf plus a trace switch, `HOS_NATIVE_ZSTD=1` on both sides, Steam Deck OLED, Minimum, Render 50%, uncapped, headless, 60 s standing, two starts a side, interleaved): | | damaged files: fps (each start) | stand-ins: fps (each start) | p99 | frames ≥ 50 ms in 60 s | loader / decode CPU | |---|---|---|---|---|---| | Kokiri Forest | 30.46, 29.46 | 44.21, 44.37 | 47.9, 50.9 → 27.9, 27.4 ms | 7, 20 → 0, 0 | 79 / 55 % → 0 / 0 % | | Castle Town market | 20.45, 20.32 | 27.59, 26.53 | 130.9, 133.0 → 72.0, 84.3 ms | 402, 426 → 63, 93 | 74 / 45 % → 0 / 0 % | | Hyrule Field (control) | 47.84, 47.94 | 47.84, 47.28 | no change | 0 | 0 / 0 % on both | With the stand-ins the preload finishes in about 10 s and the loader idles, as it does in Hyrule Field. What this means for this PR, as far as my data goes: - The Deck gain I reported here (Kokiri 20.1 → 33.1 fps) is real on a game folder like mine, and one extra run agrees: with the damaged files and `=2`, Kokiri gave 19.2 fps and 634 frames of 50 ms or more; with `=1`, about 30. So `=1` still protects anyone whose romfs has this problem, and I have no reason to think it costs anything. - I have not measured `=1` against `=2` on a repaired romfs. With the loader idle while standing, I would expect the difference there to be small and to show mainly at area changes. I will run that and post it here. - If other Deck numbers for this PR also came from a romfs unpacked by something other than Longshot's builder, they may carry the same loop. A quick check: the first four bytes of `romfs/Tex/CmnTex_Map_Soil_FairyFountain_Floor_D_Nrm.bntx.zs` should be `28 b5 2f fd`, not zeros. I will open an issue for the missing warning (a romfs without the builder's stamp keeps the damaged files silently). zeldaootr
HumanBean deleted branch perf/native-zstd-give-core 2026-11-20 22:25:13 +00:00
Contributor

HOS_NATIVE_ZSTD=1 against =2 with the damaged romfs files replaced (Steam Deck OLED)

As promised: the earlier Kokiri result (=2 → =1: 20 → 33 fps) was measured on a romfs with three damaged textures. One of them keeps the game's background preloader retrying a 10.8 MB model forever in Kokiri Forest and the Castle Town Market, which costs about 1.3 cores. That loop decodes zstd nonstop, so it is where the zstd mode matters most. This run measures both modes again with the damaged files replaced.

Short answer: with the files replaced, =1 and =2 measure the same within the spread of 4 starts a side in every window. On the damaged data, measured the same day by the same tool, =1 is far ahead (Kokiri +57%, Market +41%). So =1 never measured worse here, and it matters a lot on a romfs like ours. Nothing here argues against the PR's default of 1.

What ran

  • Build: main 89c3d21ea plus this PR at 65769aa3a (logs longshot v3.0.0-76-g65769aa3a). Both arms run the same build. A leaves HOS_NATIVE_ZSTD unset, which logs HOS_NATIVE_ZSTD=1, this GPU's default. B sets HOS_NATIVE_ZSTD=2, which logs HOS_NATIVE_ZSTD=2.
  • Hardware: Steam Deck OLED, SteamOS 3.9.5, RADV VANGOGH, Mesa 26.2.0-devel. GPU clock manual at 1600 MHz, the same before and after. Headless, 1280x800.
  • Settings: the Deck developers' row: Minimum, Render 50%, pacing on, uncapped, V-Sync Auto, frame generation off, HOS_THREAD_TIMES=5. Warm caches. Starts from the Kokiri-start save.
  • Repaired data: both arms read the three replacement files (the ones Longshot's own builder picks, nup.stand_in_for) through HOS_FS_OVERLAY. The switches line of every start lists it. In every window and every start of both arms, the loader thread (OptimizeChangeBank) used 0.1% of a core and the decode threads 0.0%. On the damaged data they used 78–85% and 47–56% in Kokiri and the Market.
  • Route tour3: each start covers Kokiri (45 s stand), then Hyrule Field by teleport (20 s stand, 4 camera pan cycles, 30 s stand) and the Market by teleport (60 s from 20 s after arrival). Every other round visits the Market before the Field. Starts run A B B A.
  • Tool: a local script on the Deck that drives the control bridge. fps comes from the game's present trace.

Repaired data: 4 starts a side

Window =1 (unset) each start median =2 each start median Δ Starts overlap?
Kokiri fps 43.6 / 43.4 / 43.8 / 42.7 43.5 43.2 / 42.5 / 42.8 / 42.7 42.8 -1.7% yes
Field stand 1 fps 42.8 / 39.6 / 42.8 / 40.0 41.4 42.3 / 37.5 / 42.4 / 39.6 40.9 -1.0% yes
Field pans fps 37.4 / 34.8 / 37.1 / 36.5 36.8 36.8 / 33.9 / 35.3 / 33.1 34.6 -6.0% yes
Field stand 2 fps 41.7 / 36.5 / 41.5 / 37.7 39.6 43.8 / 41.4 / 39.4 / 40.6 41.0 +3.4% yes
Market fps 25.9 / 25.3 / 26.4 / 24.4 25.6 26.3 / 26.9 / 28.8 / 25.1 26.6 +4.1% yes
Window p99 ms, =1 → =2 (median) 1% low fps, =1 → =2 (median)
Kokiri 28.2 → 31.4 33.7 → 29.3
Field stand 1 32.2 → 33.8 29.6 → 27.9
Field pans 56.5 → 67.9 14.0 → 12.3
Field stand 2 37.1 → 39.6 23.0 → 21.8
Market 65.7 → 56.2 13.5 → 16.5

All five windows are within the spread. In every window the two arms' starts overlap, and no difference is larger than this job's own spread. The pans lean towards =1: each =2 start is below the =1 start with the same route order, by -6.0% on the medians. The Market leans towards =2 (+4.1%). Neither is resolved with 4 starts a side.

Load times (teleport to the place reached and settled; polled every 1 s after a fixed 3 s, so they resolve about 1 s):

=1 =2
Kokiri → Field 5.5 / 6.8 / 7.8 / 8.8 s (median 7.3) 7.7 / 6.9 / 7.8 / 6.8 s (median 7.3)
→ Market 12.6 / 12.7 / 13.9 / 10.6 s (median 12.7) 10.7 / 12.6 / 11.6 / 12.8 s (median 12.1)

There is no measurable difference in load time either.

Damaged data, same day and tool: 2 starts a side, no overlay

Window =1 each start (median) =2 each start (median) Δ Starts overlap?
Kokiri fps 31.5 / 29.3 (30.4) 19.8 / 18.9 (19.4) -36.3% no
Field stand 1 fps 42.8 / 39.9 (41.4) 42.7 / 38.1 (40.4) -2.3% yes
Field pans fps 37.0 / 33.1 (35.0) 36.1 / 33.3 (34.7) -0.9% yes
Field stand 2 fps 48.6 / 40.1 (44.4) 41.9 / 38.4 (40.2) -9.5% yes
Market fps 23.3 / 21.2 (22.2) 15.8 / 15.6 (15.7) -29.2% no
  • In Kokiri the p99 is 47.5 → 74.7 ms, and frames ≥50 ms go from 0 / 10 to 440 / 529. In the Market the p99 is 78.3 → 101.5 ms.
  • The loader and decode threads were busy in Kokiri and the Market on both arms: 78–85% and 47–56%.
  • In the Field, where the loader is idle, the two modes match here too.
  • Load times: Field 7.8 / 9.1 s against 7.8 / 8.2 s; Market 10.4 / 10.6 s against 12.0 / 10.6 s.

With the retry loop, =2 costs a third of the fps in Kokiri and the Market, with no overlap even at 2 starts a side. With the files repaired, the difference goes away.

What N starts can resolve

The fps differences these numbers can resolve are estimated from 769 earlier starts on this Deck. With 4 starts a side: Kokiri about 6–10%, Field stand 1 about 1–5%, pans about 3–8%, Field stand 2 about 11–14%, Market about 4–12%. With 2 starts a side: about 8–14%, 1–7%, 5–11%, 15–20% and 5–16%.

The job's own spread was 1.9% in Kokiri, 10.1% in Field stand 1, 7.9% in the pans, 11.4% in Field stand 2 and 9.1% in the Market. The Field stands' spread is mostly route order: they are slower when the Field follows the Market. The spread is wide enough to hide the -6% in the pans and the +4% in the Market. By the same estimate, resolving 5% would take about 2–10 starts a side in the pans and 3–22 in the Market. With the spread seen here, expect the top of those ranges.

Limits

  • One Steam Deck OLED and one build; headless, so on-screen pacing is not measured.
  • The stands and pans are scripted. Nothing walks or streams new areas mid-window.
  • The replacement textures are the builder's stand-ins, not the real files. They are the same kind and size, so the cost should match a good dump, but a good dump was not measured.
  • The damaged-data comparison has 2 starts a side. Its Kokiri and Market differences are far outside the spread; its Field differences are within it.

— zeldaootr

## `HOS_NATIVE_ZSTD=1` against `=2` with the damaged romfs files replaced (Steam Deck OLED) As promised: the earlier Kokiri result (=2 → =1: 20 → 33 fps) was measured on a romfs with three damaged textures. One of them keeps the game's background preloader retrying a 10.8 MB model forever in Kokiri Forest and the Castle Town Market, which costs about 1.3 cores. That loop decodes zstd nonstop, so it is where the zstd mode matters most. This run measures both modes again with the damaged files replaced. **Short answer:** with the files replaced, `=1` and `=2` measure the same within the spread of 4 starts a side in every window. On the damaged data, measured the same day by the same tool, `=1` is far ahead (Kokiri +57%, Market +41%). So `=1` never measured worse here, and it matters a lot on a romfs like ours. Nothing here argues against the PR's default of 1. ### What ran - **Build:** main 89c3d21ea plus this PR at 65769aa3a (logs `longshot v3.0.0-76-g65769aa3a`). Both arms run the same build. A leaves `HOS_NATIVE_ZSTD` unset, which logs `HOS_NATIVE_ZSTD=1, this GPU's default`. B sets `HOS_NATIVE_ZSTD=2`, which logs `HOS_NATIVE_ZSTD=2`. - **Hardware:** Steam Deck OLED, SteamOS 3.9.5, RADV VANGOGH, Mesa 26.2.0-devel. GPU clock manual at 1600 MHz, the same before and after. Headless, 1280x800. - **Settings:** the Deck developers' row: Minimum, Render 50%, pacing on, uncapped, V-Sync Auto, frame generation off, `HOS_THREAD_TIMES=5`. Warm caches. Starts from the Kokiri-start save. - **Repaired data:** both arms read the three replacement files (the ones Longshot's own builder picks, `nup.stand_in_for`) through `HOS_FS_OVERLAY`. The switches line of every start lists it. In every window and every start of both arms, the loader thread (OptimizeChangeBank) used 0.1% of a core and the decode threads 0.0%. On the damaged data they used 78–85% and 47–56% in Kokiri and the Market. - **Route `tour3`:** each start covers Kokiri (45 s stand), then Hyrule Field by teleport (20 s stand, 4 camera pan cycles, 30 s stand) and the Market by teleport (60 s from 20 s after arrival). Every other round visits the Market before the Field. Starts run A B B A. - **Tool:** a local script on the Deck that drives the control bridge. fps comes from the game's present trace. ### Repaired data: 4 starts a side | Window | `=1` (unset) each start | median | `=2` each start | median | Δ | Starts overlap? | |---|---|---|---|---|---|---| | Kokiri fps | 43.6 / 43.4 / 43.8 / 42.7 | 43.5 | 43.2 / 42.5 / 42.8 / 42.7 | 42.8 | -1.7% | yes | | Field stand 1 fps | 42.8 / 39.6 / 42.8 / 40.0 | 41.4 | 42.3 / 37.5 / 42.4 / 39.6 | 40.9 | -1.0% | yes | | Field pans fps | 37.4 / 34.8 / 37.1 / 36.5 | 36.8 | 36.8 / 33.9 / 35.3 / 33.1 | 34.6 | -6.0% | yes | | Field stand 2 fps | 41.7 / 36.5 / 41.5 / 37.7 | 39.6 | 43.8 / 41.4 / 39.4 / 40.6 | 41.0 | +3.4% | yes | | Market fps | 25.9 / 25.3 / 26.4 / 24.4 | 25.6 | 26.3 / 26.9 / 28.8 / 25.1 | 26.6 | +4.1% | yes | | Window | p99 ms, `=1` → `=2` (median) | 1% low fps, `=1` → `=2` (median) | |---|---|---| | Kokiri | 28.2 → 31.4 | 33.7 → 29.3 | | Field stand 1 | 32.2 → 33.8 | 29.6 → 27.9 | | Field pans | 56.5 → 67.9 | 14.0 → 12.3 | | Field stand 2 | 37.1 → 39.6 | 23.0 → 21.8 | | Market | 65.7 → 56.2 | 13.5 → 16.5 | All five windows are within the spread. In every window the two arms' starts overlap, and no difference is larger than this job's own spread. The pans lean towards `=1`: each `=2` start is below the `=1` start with the same route order, by -6.0% on the medians. The Market leans towards `=2` (+4.1%). Neither is resolved with 4 starts a side. **Load times** (teleport to the place reached and settled; polled every 1 s after a fixed 3 s, so they resolve about 1 s): | | `=1` | `=2` | |---|---|---| | Kokiri → Field | 5.5 / 6.8 / 7.8 / 8.8 s (median 7.3) | 7.7 / 6.9 / 7.8 / 6.8 s (median 7.3) | | → Market | 12.6 / 12.7 / 13.9 / 10.6 s (median 12.7) | 10.7 / 12.6 / 11.6 / 12.8 s (median 12.1) | There is no measurable difference in load time either. ### Damaged data, same day and tool: 2 starts a side, no overlay | Window | `=1` each start (median) | `=2` each start (median) | Δ | Starts overlap? | |---|---|---|---|---| | Kokiri fps | 31.5 / 29.3 (30.4) | 19.8 / 18.9 (19.4) | -36.3% | no | | Field stand 1 fps | 42.8 / 39.9 (41.4) | 42.7 / 38.1 (40.4) | -2.3% | yes | | Field pans fps | 37.0 / 33.1 (35.0) | 36.1 / 33.3 (34.7) | -0.9% | yes | | Field stand 2 fps | 48.6 / 40.1 (44.4) | 41.9 / 38.4 (40.2) | -9.5% | yes | | Market fps | 23.3 / 21.2 (22.2) | 15.8 / 15.6 (15.7) | -29.2% | no | - In Kokiri the p99 is 47.5 → 74.7 ms, and frames ≥50 ms go from 0 / 10 to 440 / 529. In the Market the p99 is 78.3 → 101.5 ms. - The loader and decode threads were busy in Kokiri and the Market on both arms: 78–85% and 47–56%. - In the Field, where the loader is idle, the two modes match here too. - Load times: Field 7.8 / 9.1 s against 7.8 / 8.2 s; Market 10.4 / 10.6 s against 12.0 / 10.6 s. With the retry loop, `=2` costs a third of the fps in Kokiri and the Market, with no overlap even at 2 starts a side. With the files repaired, the difference goes away. ### What N starts can resolve The fps differences these numbers can resolve are estimated from 769 earlier starts on this Deck. With 4 starts a side: Kokiri about 6–10%, Field stand 1 about 1–5%, pans about 3–8%, Field stand 2 about 11–14%, Market about 4–12%. With 2 starts a side: about 8–14%, 1–7%, 5–11%, 15–20% and 5–16%. The job's own spread was 1.9% in Kokiri, 10.1% in Field stand 1, 7.9% in the pans, 11.4% in Field stand 2 and 9.1% in the Market. The Field stands' spread is mostly route order: they are slower when the Field follows the Market. The spread is wide enough to hide the -6% in the pans and the +4% in the Market. By the same estimate, resolving 5% would take about 2–10 starts a side in the pans and 3–22 in the Market. With the spread seen here, expect the top of those ranges. ### Limits - One Steam Deck OLED and one build; headless, so on-screen pacing is not measured. - The stands and pans are scripted. Nothing walks or streams new areas mid-window. - The replacement textures are the builder's stand-ins, not the real files. They are the same kind and size, so the cost should match a good dump, but a good dump was not measured. - The damaged-data comparison has 2 starts a side. Its Kokiri and Market differences are far outside the spread; its Field differences are within it. — zeldaootr
Some checks reported errors
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Blocked by required conditions
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Blocked by required conditions
CI / Workflow lint (actionlint) (pull_request) Blocked by required conditions
CI / Website build and checks (pull_request) Blocked by required conditions
CI / Conventional Commit title (pull_request) Blocked by required conditions
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Blocked by required conditions
Guide screenshots / Guide images and local UI source review (pull_request) Blocked by required conditions
Third-party parts / As their notes say (pull_request) Blocked by required conditions
Third-party parts / The same as upstream (pull_request) Blocked by required conditions
PR description / Description follows the template (pull_request_target) Successful in 5s
Website / Website on Cloudflare (pull_request_target) Has been skipped
beanstalk/approval approved by llun (reviewed)
beanstalk/any 0/1 pass, 2 error
Some workflows are waiting to be reviewed.
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
5 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!1875
No description provided.