fix(linux): the replay's reserved core is a performance core on Intel's hybrid CPUs #2805

Closed
github-sync wants to merge 1 commit from github/pr/2805 into main
Owner

@PedroFlaminio opened this pull request on GitHub · 2026-11-12 14:34 UTC · original
Merged on GitHub in 262f561402

On Linux, the core kept for the replay thread is always the last one, and on Intel's hybrid CPUs that is an efficiency core: Windows already picks the last performance core. This makes Linux choose the same way.

What changed

  • host/hos_thread.c: on Linux, hos_reserved_cpus reads the performance cores' logical processors from /sys/devices/cpu_core/cpus (the kernel's hybrid PMU list; the efficiency cores are in cpu_atom) and passes them to the existing pick_reserved_core as the fast class, as Windows does with EfficiencyClass. Without that file (CPUs of one kind, AMD, older kernels) the last core is kept, as before. The log says which choice was made.
  • parse_cpu_list: a small cpulist parser (0-7, 0-11,16-19).
  • tests/test_reserved_core.py: the parser's cases, Core Ultra 7 265KF / i7-12700K / i5-1235U shapes from cpulists, and a check that hos_reserved_cpus still asks last_fastest_core on Linux.

Measured: on a Core Ultra 7 265KF (P-cores 0-7, E-cores 8-19) the log showed vk: reserved core mask (fallback): 0x80000 (logical processor 19, an E-core). This change picks 0x80 (logical processor 7). I checked the same mask by hand first with HOS_RESERVE_CORE_MASK=80: in Hyrule Field the frame rate did not change measurably on this machine (RTX 3060, CPU-bound there with ~9.5 ms of memory sync a frame), so this is a correctness fix for hybrid CPUs on Linux; the comment above pick_reserved_core has the i7-13700K numbers (48.7 fps on an E-core, 60 on a P-core) from Windows.

Tests: python -I -B tests/run_all.py on Linux: 425 passed, 3 failed, 67 skipped. The 3 failures (test_updater_asset_digest, test_bake_portability, test_builder_log_read_only) fail the same way on main without this change. hos_thread.c was syntax-checked with clang; I did not build the full game with this commit.

🤖 Generated with Claude Code

> [@PedroFlaminio](https://github.com/PedroFlaminio) opened this pull request on GitHub · 2026-11-12 14:34 UTC · [original](https://github.com/NotRexed/Hookshot/pull/2805) > **Merged on GitHub** in https://git.magicbean.dev/MagicBeanDev/Hookshot/commit/262f561402da0a3338ca52776706df1fb0a3f23e On Linux, the core kept for the replay thread is always the last one, and on Intel's hybrid CPUs that is an efficiency core: Windows already picks the last performance core. This makes Linux choose the same way. **What changed** - `host/hos_thread.c`: on Linux, `hos_reserved_cpus` reads the performance cores' logical processors from `/sys/devices/cpu_core/cpus` (the kernel's hybrid PMU list; the efficiency cores are in `cpu_atom`) and passes them to the existing `pick_reserved_core` as the fast class, as Windows does with `EfficiencyClass`. Without that file (CPUs of one kind, AMD, older kernels) the last core is kept, as before. The log says which choice was made. - `parse_cpu_list`: a small cpulist parser (`0-7`, `0-11,16-19`). - `tests/test_reserved_core.py`: the parser's cases, Core Ultra 7 265KF / i7-12700K / i5-1235U shapes from cpulists, and a check that `hos_reserved_cpus` still asks `last_fastest_core` on Linux. **Measured:** on a Core Ultra 7 265KF (P-cores 0-7, E-cores 8-19) the log showed `vk: reserved core mask (fallback): 0x80000` (logical processor 19, an E-core). This change picks `0x80` (logical processor 7). I checked the same mask by hand first with `HOS_RESERVE_CORE_MASK=80`: in Hyrule Field the frame rate did not change measurably on this machine (RTX 3060, CPU-bound there with ~9.5 ms of memory sync a frame), so this is a correctness fix for hybrid CPUs on Linux; the comment above `pick_reserved_core` has the i7-13700K numbers (48.7 fps on an E-core, 60 on a P-core) from Windows. **Tests:** `python -I -B tests/run_all.py` on Linux: 425 passed, 3 failed, 67 skipped. The 3 failures (`test_updater_asset_digest`, `test_bake_portability`, `test_builder_log_read_only`) fail the same way on main without this change. `hos_thread.c` was syntax-checked with clang; I did not build the full game with this commit. 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- github-sync:item:2805 -->
On Linux the replay kept the last core, which on Intel's hybrid CPUs is an
efficiency core (a Core Ultra 7 265KF's logical processor 19). Windows already
picks the last performance core by EfficiencyClass. On Linux the performance
cores are now read from /sys/devices/cpu_core/cpus and pick_reserved_core
chooses as on Windows; without that file (CPUs of one kind, AMD, older
kernels) the last core is kept, as before.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-sync closed this pull request 2026-11-12 17:59:28 +00:00
Commenting is not possible because the repository is archived.
No description provided.