perf(host): the game's nn::os::YieldThread gives up its virtual core only, not the processor (HOS_OS_YIELD=1 as before) #1663

Merged
HumanBean merged 3 commits from GummiNaomi/Longshot:perf/os-yield-vcore-only into main 2026-11-18 22:02:37 +00:00
Member

Type: perf · Risk: medium · Tested on: Windows 11, RTX 4070 SUPER, Ryzen 9 9950X3D (SMT off) · Needs: a build of this head; a Steam Deck or another CPU of 4 cores; Linux; Intel and AMD CPUs with SMT

Stacked on #1661 (the in-run A/B tool): its first commit is that PR's; this PR is the second commit.

TL;DR

The game gives way to other threads after every small job, thousands of times a frame. Longshot did that twice: it handed over the game's own core, then asked Windows to switch threads too, which costs kernel time on every call. This PR keeps only the first hand-over, which is what the game asks for. Standing in Castle Town's market with the game on 4 cores, frames were 2.1 % and 1.7 % shorter (two in-run A/Bs, both intervals clear of zero); on 16 cores no difference.

Breakdown

  • Who it helps: players on CPUs of 4 to 6 cores, where the game's threads share the processors: likely the Steam Deck too (not measured there).
  • What was wrong: each of the game's yields also called SwitchToThread, and on 4 cores the job threads spent about as long inside it as running.
  • What changes: nn::os::YieldThread gives up the game's virtual core only; HOS_OS_YIELD=1 brings the processor's yield back.
  • What does not change: which game thread runs next (the virtual cores decide that, as before); 16-core PCs (no difference measured); saves, options, caches.
  • How it was checked: in-run A/Bs (HOS_AB) on 4 and 16 cores in the market, two runs each, on a tree 93 commits behind this main; a test that reads the wiring.
  • What is still open: a build of this head, a Steam Deck, Linux, CPUs with SMT.
  • Risk: medium: every game thread's yield changes; a thread that yields in a loop now keeps its processor until its time slice ends.

Why

OoT's job system yields (nn::os::YieldThread) after every job and every actor callback. Longshot answered each yield in two steps: hos_vcore_yield(), which hands the game's virtual core to a waiting game thread of equal or better priority (what the console's yield does), then Windows' SwitchToThread(). On a PC of 4 cores standing in Castle Town's market, a Windows profile counted the six BaseProc executor threads at 107 % of a core: 45.5 % running and 51.6 % inside SwitchToThread, handing the processor to another thread and taking it back. Over all the job threads that was about three quarters of one of the four processors, spent in the kernel. With few cores every processor is busy, so that time comes out of the frame.

What changed

The game's yield keeps its virtual core hand-over and drops the processor's: a game thread that was waiting for the core still gets it, and Windows still moves threads between processors at the end of their time slices.

  • host: host/hos_thread.c os_yield() and HLE(_ZN2nn2os11YieldThreadEv): SwitchToThread() only with HOS_OS_YIELD=1. The switch is read through hos_ab_value, so HOS_AB may flip it between two yields (nothing is kept between yields).
  • docs: the HOS_OS_YIELD=1 row in docs/development.md beside the virtual-core rows; the row in gpu/vk/switches.def.
  • tests: tests/test_hos_ab.py's list of wired switches gains HOS_OS_YIELD.

Measurements

Verdict: faster on 4 cores: frame time -2.1 % and -1.7 % (95 % intervals -3.0 to -1.3 % and -2.9 to -0.5 %), frames of 16.7 ms or more down 5 points; on 16 cores no difference (intervals around 0).

Hardware: Windows 11, RTX 4070 SUPER (NVIDIA 617.42), Ryzen 9 9950X3D with SMT off, 32 GB
Scene: Castle Town's market (child), standing after a debug teleport from the kokiri-start save; output 2560x1440, uncapped (HOS_FPS_MAX=1000), no window (HOS_HEADLESS=1). "4 cores": the game kept to cores 8-11 (affinity 0xF00, HOS_CACHE_CORES=0); "16 cores": no affinity, the game on the 8 cores of the 96 MB L3 by default
Method: in-run A/Bs (HOS_AB=<switch>,3,130: 3 s periods after 130 s), about 160 s standing, RX_VK_FRAME_TRACE=1; scripts/ab_summary.py on each trace (transitions left out, a bootstrap of whole periods for the interval); two runs each
How to reproduce: 4 cores HOS_AB=HOS_OS_YIELD=1,3,130 on this PR (side 1 is the old way); the runs also had RX_VK_ASTC_BC_ALL=1 RX_VK_IMAGE_BLOCK_MB=32 RX_VK_LOAD=create RX_VK_BC_LAYERS=8 RX_VK_LATE_FIX=0 HOS_THREAD_TIMES=5

Baseline: both sides of each run come from one build, main @ 54a42715 (93 commits before this PR's base) with the 18 Nov changes, before they were rebased onto main @ 10de79fb as separate PRs; the switch flipped every 3 s within the run. On 4 cores that build's default was the old yield and side 1 this PR's; on 16 cores (a later build of the same tree) the default was this PR's and side 1 the old.

Before (the old yield, SwitchToThread): build @ 54a42715 After (virtual core only, this PR's way): the same runs @ 54a42715 Δ (95 % interval)
4 cores, run a: mean frame 15.704 ms 15.367 ms -0.337 ms (-0.471 to -0.205)
4 cores, run b: mean frame 16.005 ms 15.741 ms -0.264 ms (-0.462 to -0.077)
4 cores, frames >= 16.7 ms (a / b) 22.0 / 28.5 % 16.5 / 23.4 % -5.5 / -5.0 points
16 cores, run a: mean frame 13.617 ms 13.619 ms +0.002 ms (-0.046 to +0.049)
16 cores, run b: mean frame 13.875 ms 13.866 ms -0.009 ms (-0.141 to +0.123)
4 cores, run a: ab: HOS_OS_YIELD=0 against its normal value, 3.0 s periods after 130 s: side 0 (normal) 2922 frames, 15.704 ms a frame (63.7 fps); side 1 (the A/B's value) 2813 frames, 15.367 ms a frame (65.1 fps); side 1 -2.14 % frame time; 636 frames in transitions left out
  side 1 - side 0: mean -0.337 ms (-2.14 %, fps +2.19 %), median -0.320 ms, p99 -0.525 ms, >=16.7 ms -5.5 points
  95 % interval of the mean's difference: -0.471 to -0.205 ms (-3.00 to -1.31 %): side 1 is faster
4 cores, run b: ab: HOS_OS_YIELD=0 against its normal value, 3.0 s periods after 130 s: side 0 (normal) 2024 frames, 16.005 ms a frame (62.5 fps); side 1 (the A/B's value) 1973 frames, 15.793 ms a frame (63.3 fps); side 1 -1.32 % frame time; 451 frames in transitions left out
  side 1 - side 0: mean -0.264 ms (-1.65 %, fps +1.68 %), median -0.260 ms, p99 -0.069 ms, >=16.7 ms -5.0 points
  95 % interval of the mean's difference: -0.462 to -0.077 ms (-2.89 to -0.48 %): side 1 is faster
16 cores, run a: ab: HOS_OS_YIELD=1 against its normal value, 3.0 s periods after 130 s: side 0 (normal) 3175 frames, 13.618 ms a frame (73.4 fps); side 1 (the A/B's value) 3159 frames, 13.628 ms a frame (73.4 fps); side 1 +0.07 % frame time; 701 frames in transitions left out
  95 % interval of the mean's difference: -0.049 to +0.046 ms (-0.36 to +0.34 %): no difference shown (the interval holds 0)
16 cores, run b: ab: HOS_OS_YIELD=1 against its normal value, 3.0 s periods after 130 s: side 0 (normal) 3177 frames, 13.869 ms a frame (72.1 fps); side 1 (the A/B's value) 3122 frames, 13.845 ms a frame (72.2 fps); side 1 -0.17 % frame time; 711 frames in transitions left out
  95 % interval of the mean's difference: -0.123 to +0.141 ms (-0.89 to +1.02 %): no difference shown (the interval holds 0)

(The 4-core runs' A/B value was HOS_OS_YIELD=0 because that build's switch had the old way as its default; the 16-core runs' was =1. Side 1 is the A/B's value in each.)

Flags and settings

One switch added; the new behaviour is the default.

Flag What it is Before this PR After this PR Effect Helps / doesn't help / untested Recommendation
HOS_OS_YIELD the game's yields also give up the processor (no switch: always) unset: virtual core only =1 brings SwitchToThread back helps on 4 cores (-2 %), no difference on 16; untested on SMT CPUs, the Deck, Linux on for everyone (unset)

Testing

Tested: in the game, at 93 commits behind this base: the A/Bs above, on 4 and 16 cores, every run to its end with 0 errors and the market drawn in its screenshots. On this head: python -I -B tests/test_hos_ab.py --cc clang passes; the checks that read the changed files failed only where they fail on main on this PC (run on this branch before its rebase onto main's last 11 commits, which merged without a conflict; after it, tests/test_hos_ab.py passes again).

Not tested: a build of this exact head; Linux (SwitchToThread is sched_yield there); CPUs with SMT (two threads a core); a Steam Deck.

Must be tested:

  • Windows, any GPU: build this head, stand in Castle Town's market with HOS_AB=HOS_OS_YIELD=1,3,60 RX_VK_FRAME_TRACE=1 for three minutes, expecting the log's ab: HOS_OS_YIELD=1 line and scripts/ab_summary.py to show side 1 (the old way) no faster (by hand: me)
  • steamdeck: the same A/B in the market at handheld settings, expecting side 1 no faster (Test Farm: @Beanstalk steamdeck, stand in Castle Town's market 3 minutes with HOS_AB=HOS_OS_YIELD=1,3,60 and RX_VK_FRAME_TRACE=1, then scripts/ab_summary.py on the trace)
  • linux, a desktop CPU with SMT: the same A/B, expecting no slower side 0 (Test Farm: @Beanstalk linux, the same A/B)

Risks

What could break: a game thread that yields in a loop waiting for another thread to run on the same processor now waits until its time slice ends instead of handing the processor over at once. The virtual cores already hand the game's core over, and none of the runs above stalled, but on a CPU with fewer processors than the game's busy threads (2 cores) this is untested.

Turning it off: HOS_OS_YIELD=1.

Compatibility: nothing changes for saves, options or caches.

Checklist

Everyone

  • One topic.
  • The title is a Conventional Commit (type(scope): description) of the status line's type.
  • Why gives the reason plainly and links the issues that fit (the tracker searched).
  • Tested on my own PC where it runs (in the game, for a change the game runs), as Testing's Tested says; what can't be run by hand is in Testing's Not testable by hand, with why. (In the game 93 commits back; this head not built yet.)
  • Measurements has a verdict, or one line saying why there is nothing to measure.
  • Nothing gets worse that I know of: any cost (speed, latency, memory, a setup that worked before) is measured and in Risks.
  • Testing names what was tested, what wasn't, and what must still be tested, where and how.
  • Rebased on current main.
  • python -I -B tests/run_all.py passes (any failure that also fails on main is named). (The changed files' checks on this PC; failures are main's own here.)
  • No game files, dumps, build output or generated files.
  • third_party/ untouched (a new folder with a PROVENANCE.md instead).
  • The license is OK: GPL-3.0-or-later, nothing incompatible and nothing decompiled.

When it applies

  • AI assistance recorded with Assisted-by: / Co-Authored-By: trailers.
  • Numbers from the same PC, scene and settings, at least 2 interleaved runs each, the median reported.
  • Switches documented (docs/development.md; the README for a menu row) and shipped at their recommended value.
  • A check under tests/ that reads changed source updated in this PR, not weakened.
  • Host code builds on both Windows (llvm-mingw) and Linux, with UTF-8 paths. (Not built on Linux yet: Must be tested.)
  • Docs updated.

🤖 Generated with Claude Code

**Type:** perf · **Risk:** medium · **Tested on:** Windows 11, RTX 4070 SUPER, Ryzen 9 9950X3D (SMT off) · **Needs:** a build of this head; a Steam Deck or another CPU of 4 cores; Linux; Intel and AMD CPUs with SMT Stacked on #1661 (the in-run A/B tool): its first commit is that PR's; this PR is the second commit. ## TL;DR The game gives way to other threads after every small job, thousands of times a frame. Longshot did that twice: it handed over the game's own core, then asked Windows to switch threads too, which costs kernel time on every call. This PR keeps only the first hand-over, which is what the game asks for. Standing in Castle Town's market with the game on 4 cores, frames were 2.1 % and 1.7 % shorter (two in-run A/Bs, both intervals clear of zero); on 16 cores no difference. ## Breakdown - **Who it helps:** players on CPUs of 4 to 6 cores, where the game's threads share the processors: likely the Steam Deck too (not measured there). - **What was wrong:** each of the game's yields also called `SwitchToThread`, and on 4 cores the job threads spent about as long inside it as running. - **What changes:** `nn::os::YieldThread` gives up the game's virtual core only; `HOS_OS_YIELD=1` brings the processor's yield back. - **What does not change:** which game thread runs next (the virtual cores decide that, as before); 16-core PCs (no difference measured); saves, options, caches. - **How it was checked:** in-run A/Bs (`HOS_AB`) on 4 and 16 cores in the market, two runs each, on a tree 93 commits behind this main; a test that reads the wiring. - **What is still open:** a build of this head, a Steam Deck, Linux, CPUs with SMT. - **Risk:** medium: every game thread's yield changes; a thread that yields in a loop now keeps its processor until its time slice ends. ## Why OoT's job system yields (`nn::os::YieldThread`) after every job and every actor callback. Longshot answered each yield in two steps: `hos_vcore_yield()`, which hands the game's virtual core to a waiting game thread of equal or better priority (what the console's yield does), then Windows' `SwitchToThread()`. On a PC of 4 cores standing in Castle Town's market, a Windows profile counted the six BaseProc executor threads at 107 % of a core: 45.5 % running and 51.6 % inside `SwitchToThread`, handing the processor to another thread and taking it back. Over all the job threads that was about three quarters of one of the four processors, spent in the kernel. With few cores every processor is busy, so that time comes out of the frame. ## What changed The game's yield keeps its virtual core hand-over and drops the processor's: a game thread that was waiting for the core still gets it, and Windows still moves threads between processors at the end of their time slices. - host: `host/hos_thread.c` `os_yield()` and `HLE(_ZN2nn2os11YieldThreadEv)`: `SwitchToThread()` only with `HOS_OS_YIELD=1`. The switch is read through `hos_ab_value`, so `HOS_AB` may flip it between two yields (nothing is kept between yields). - docs: the `HOS_OS_YIELD=1` row in `docs/development.md` beside the virtual-core rows; the row in `gpu/vk/switches.def`. - tests: `tests/test_hos_ab.py`'s list of wired switches gains `HOS_OS_YIELD`. ## Measurements **Verdict:** faster on 4 cores: frame time -2.1 % and -1.7 % (95 % intervals -3.0 to -1.3 % and -2.9 to -0.5 %), frames of 16.7 ms or more down 5 points; on 16 cores no difference (intervals around 0). Hardware: Windows 11, RTX 4070 SUPER (NVIDIA 617.42), Ryzen 9 9950X3D with SMT off, 32 GB Scene: Castle Town's market (child), standing after a debug teleport from the `kokiri-start` save; output 2560x1440, uncapped (`HOS_FPS_MAX=1000`), no window (`HOS_HEADLESS=1`). "4 cores": the game kept to cores 8-11 (affinity 0xF00, `HOS_CACHE_CORES=0`); "16 cores": no affinity, the game on the 8 cores of the 96 MB L3 by default Method: in-run A/Bs (`HOS_AB=<switch>,3,130`: 3 s periods after 130 s), about 160 s standing, `RX_VK_FRAME_TRACE=1`; `scripts/ab_summary.py` on each trace (transitions left out, a bootstrap of whole periods for the interval); two runs each How to reproduce: 4 cores `HOS_AB=HOS_OS_YIELD=1,3,130` on this PR (side 1 is the old way); the runs also had `RX_VK_ASTC_BC_ALL=1 RX_VK_IMAGE_BLOCK_MB=32 RX_VK_LOAD=create RX_VK_BC_LAYERS=8 RX_VK_LATE_FIX=0 HOS_THREAD_TIMES=5` Baseline: both sides of each run come from one build, main @ 54a42715 (93 commits before this PR's base) with the 18 Nov changes, before they were rebased onto main @ 10de79fb as separate PRs; the switch flipped every 3 s within the run. On 4 cores that build's default was the old yield and side 1 this PR's; on 16 cores (a later build of the same tree) the default was this PR's and side 1 the old. | | Before (the old yield, `SwitchToThread`): build @ 54a42715 | After (virtual core only, this PR's way): the same runs @ 54a42715 | Δ (95 % interval) | |---|---|---|---| | 4 cores, run a: mean frame | 15.704 ms | 15.367 ms | -0.337 ms (-0.471 to -0.205) | | 4 cores, run b: mean frame | 16.005 ms | 15.741 ms | -0.264 ms (-0.462 to -0.077) | | 4 cores, frames >= 16.7 ms (a / b) | 22.0 / 28.5 % | 16.5 / 23.4 % | -5.5 / -5.0 points | | 16 cores, run a: mean frame | 13.617 ms | 13.619 ms | +0.002 ms (-0.046 to +0.049) | | 16 cores, run b: mean frame | 13.875 ms | 13.866 ms | -0.009 ms (-0.141 to +0.123) | ``` 4 cores, run a: ab: HOS_OS_YIELD=0 against its normal value, 3.0 s periods after 130 s: side 0 (normal) 2922 frames, 15.704 ms a frame (63.7 fps); side 1 (the A/B's value) 2813 frames, 15.367 ms a frame (65.1 fps); side 1 -2.14 % frame time; 636 frames in transitions left out side 1 - side 0: mean -0.337 ms (-2.14 %, fps +2.19 %), median -0.320 ms, p99 -0.525 ms, >=16.7 ms -5.5 points 95 % interval of the mean's difference: -0.471 to -0.205 ms (-3.00 to -1.31 %): side 1 is faster 4 cores, run b: ab: HOS_OS_YIELD=0 against its normal value, 3.0 s periods after 130 s: side 0 (normal) 2024 frames, 16.005 ms a frame (62.5 fps); side 1 (the A/B's value) 1973 frames, 15.793 ms a frame (63.3 fps); side 1 -1.32 % frame time; 451 frames in transitions left out side 1 - side 0: mean -0.264 ms (-1.65 %, fps +1.68 %), median -0.260 ms, p99 -0.069 ms, >=16.7 ms -5.0 points 95 % interval of the mean's difference: -0.462 to -0.077 ms (-2.89 to -0.48 %): side 1 is faster 16 cores, run a: ab: HOS_OS_YIELD=1 against its normal value, 3.0 s periods after 130 s: side 0 (normal) 3175 frames, 13.618 ms a frame (73.4 fps); side 1 (the A/B's value) 3159 frames, 13.628 ms a frame (73.4 fps); side 1 +0.07 % frame time; 701 frames in transitions left out 95 % interval of the mean's difference: -0.049 to +0.046 ms (-0.36 to +0.34 %): no difference shown (the interval holds 0) 16 cores, run b: ab: HOS_OS_YIELD=1 against its normal value, 3.0 s periods after 130 s: side 0 (normal) 3177 frames, 13.869 ms a frame (72.1 fps); side 1 (the A/B's value) 3122 frames, 13.845 ms a frame (72.2 fps); side 1 -0.17 % frame time; 711 frames in transitions left out 95 % interval of the mean's difference: -0.123 to +0.141 ms (-0.89 to +1.02 %): no difference shown (the interval holds 0) ``` (The 4-core runs' A/B value was `HOS_OS_YIELD=0` because that build's switch had the old way as its default; the 16-core runs' was `=1`. Side 1 is the A/B's value in each.) ### Flags and settings One switch added; the new behaviour is the default. | Flag | What it is | Before this PR | After this PR | Effect | Helps / doesn't help / untested | Recommendation | |---|---|---|---|---|---|---| | `HOS_OS_YIELD` | the game's yields also give up the processor | (no switch: always) | unset: virtual core only | `=1` brings `SwitchToThread` back | helps on 4 cores (-2 %), no difference on 16; untested on SMT CPUs, the Deck, Linux | on for everyone (unset) | ## Testing **Tested:** in the game, at 93 commits behind this base: the A/Bs above, on 4 and 16 cores, every run to its end with 0 errors and the market drawn in its screenshots. On this head: `python -I -B tests/test_hos_ab.py --cc clang` passes; the checks that read the changed files failed only where they fail on main on this PC (run on this branch before its rebase onto main's last 11 commits, which merged without a conflict; after it, `tests/test_hos_ab.py` passes again). **Not tested:** a build of this exact head; Linux (`SwitchToThread` is `sched_yield` there); CPUs with SMT (two threads a core); a Steam Deck. **Must be tested:** - Windows, any GPU: build this head, stand in Castle Town's market with `HOS_AB=HOS_OS_YIELD=1,3,60 RX_VK_FRAME_TRACE=1` for three minutes, expecting the log's `ab: HOS_OS_YIELD=1` line and `scripts/ab_summary.py` to show side 1 (the old way) no faster (by hand: me) - steamdeck: the same A/B in the market at handheld settings, expecting side 1 no faster (Test Farm: @Beanstalk steamdeck, stand in Castle Town's market 3 minutes with HOS_AB=HOS_OS_YIELD=1,3,60 and RX_VK_FRAME_TRACE=1, then scripts/ab_summary.py on the trace) - linux, a desktop CPU with SMT: the same A/B, expecting no slower side 0 (Test Farm: @Beanstalk linux, the same A/B) ## Risks **What could break:** a game thread that yields in a loop waiting for another thread to run on the same processor now waits until its time slice ends instead of handing the processor over at once. The virtual cores already hand the game's core over, and none of the runs above stalled, but on a CPU with fewer processors than the game's busy threads (2 cores) this is untested. **Turning it off:** `HOS_OS_YIELD=1`. **Compatibility:** nothing changes for saves, options or caches. ## Checklist ### Everyone - [x] One topic. - [x] The title is a Conventional Commit (`type(scope): description`) of the status line's type. - [x] Why gives the reason plainly and links the issues that fit (the tracker searched). - [ ] Tested on my own PC where it runs (in the game, for a change the game runs), as Testing's Tested says; what can't be run by hand is in Testing's Not testable by hand, with why. (In the game 93 commits back; this head not built yet.) - [x] Measurements has a verdict, or one line saying why there is nothing to measure. - [x] Nothing gets worse that I know of: any cost (speed, latency, memory, a setup that worked before) is measured and in Risks. - [x] Testing names what was tested, what wasn't, and what must still be tested, where and how. - [x] Rebased on current `main`. - [x] `python -I -B tests/run_all.py` passes (any failure that also fails on `main` is named). (The changed files' checks on this PC; failures are main's own here.) - [x] No game files, dumps, build output or generated files. - [x] `third_party/` untouched (a new folder with a `PROVENANCE.md` instead). - [x] The license is OK: GPL-3.0-or-later, nothing incompatible and nothing decompiled. ### When it applies - [x] AI assistance recorded with `Assisted-by:` / `Co-Authored-By:` trailers. - [x] Numbers from the same PC, scene and settings, at least 2 interleaved runs each, the median reported. - [x] Switches documented (docs/development.md; the README for a menu row) and shipped at their recommended value. - [x] A check under `tests/` that reads changed source updated in this PR, not weakened. - [ ] Host code builds on both Windows (llvm-mingw) and Linux, with UTF-8 paths. (Not built on Linux yet: Must be tested.) - [x] Docs updated. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Two runs of the same build differ by a few fps, more than the 2-5 % a change is often
worth. HOS_AB=<switch>=<value>[,<seconds>[,<warm-up seconds>]] measures both sides in
one run: after the warm-up the switch alternates every period between its normal value
and <value>, and each frame is counted for its side.

- host/hos_ab.c: the plan's parser, the flip thread, hos_ab_value (one relaxed load
  with no A/B), the host's sums by side logged at the close.
- MkwVkHost.ab_frame (MKWVK_API_VERSION 34): the frame trace's ab_side column.
- scripts/ab_summary.py: per side, the difference and a 95 % interval by a bootstrap of
  whole periods; transitions, the warm-up and a cut-short last period left out.
- HOS_COLLECT_WIDE is the first wired switch (the pages a walk finds are the same
  either way).
- tests/test_hos_ab.py: parser, schedule, frames, the cheap path, the sums, the wired
  switch flipping at every walk, ab_summary.py, broken variants of both.

Assisted-by: Claude Code
Co-Authored-By: Claude Opus 5.5 <[email protected]>
test: the Windows stop test stands in for hos_ab_end in the close chain
Some checks failed
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been skipped
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been skipped
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been skipped
Third-party parts / The same as upstream (pull_request) Has been skipped
Website / Website on Cloudflare (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 7s
PR description / Description follows the template (pull_request_target) Failing after 9s
Guide screenshots / Guide images and local UI source review (pull_request) Failing after 11s
CI / Workflow lint (actionlint) (pull_request) Successful in 12s
Third-party parts / As their notes say (pull_request) Successful in 13s
Website / Website on Cloudflare (pull_request_target) Has been skipped
1d168e1ae5
hos_close_finish logs the A/B sums (hos_ab_end) after the close work and before
the log flush; the stop test compiles that chain over its own stand-ins.

Assisted-by: Claude Code
Co-Authored-By: Claude Opus 5.5 <[email protected]>
perf(host): the game's nn::os::YieldThread gives up its virtual core only, not the processor (HOS_OS_YIELD=1 as before)
Some checks failed
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been skipped
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been skipped
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been skipped
Third-party parts / The same as upstream (pull_request) Has been skipped
Website / Website on Cloudflare (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 13s
PR description / Description follows the template (pull_request_target) Failing after 20s
CI / Workflow lint (actionlint) (pull_request) Successful in 23s
Guide screenshots / Guide images and local UI source review (pull_request) Failing after 21s
Third-party parts / As their notes say (pull_request) Successful in 20s
Website / Website on Cloudflare (pull_request_target) Has been skipped
eb38e62044
OoT yields after every job and actor callback. Each yield gave up the virtual core
(hos_vcore_yield) and then the processor (SwitchToThread). On a PC of 4 cores in Castle
Town's market, the job threads' CPU time was about their running time plus their time
inside SwitchToThread: kernel time handing the processor over and back. The virtual
core's hand-over is what the game's yield asks for; the OS still moves threads at the
end of their time slices.

In-run A/Bs (HOS_AB) standing in the market: on 4 cores frame time -2.1 % and -1.7 %
without the OS yield; on 16 cores no difference. HOS_OS_YIELD=1 brings the old way
back; HOS_AB may flip it.

Assisted-by: Claude Code
Co-Authored-By: Claude Opus 5.5 <[email protected]>
HumanBean deleted branch perf/os-yield-vcore-only 2026-11-18 22:02:38 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
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!1663
No description provided.