HLE: opt out of Windows 11 Efficiency Mode throttling in use_console_timers #2567
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2569"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from Marvisak/VIctory. Originally posted by Bebrik229 on 2026-11-25T16:03:46Z.
Summary
Extends
victory_hle::runtime::use_console_timers()to also opt out of Windows 11 Efficiency Mode CPU execution-speed throttling (PROCESS_POWER_THROTTLING_EXECUTION_SPEED) alongsidePROCESS_POWER_THROTTLING_IGNORE_TIMER_RESOLUTION.Why
In
use_console_timers(), settingPROCESS_POWER_THROTTLING_IGNORE_TIMER_RESOLUTIONwithStateMask: 0keeps 1 mstimeBeginPeriod(1)timer precision when the window is unfocused, backgrounded, or minimized, but Windows 11 can still throttle process execution speed (EcoQoS/ reduced clocks and E-core scheduling). SettingPROCESS_POWER_THROTTLING_EXECUTION_SPEEDinControlMaskwithStateMask: 0disables execution-speed throttling as well.Setting
VICTORY_EFFICIENCY_MODE=1preserves the previous behavior (leaves execution-speed throttling up to the OS).Changes
crates/victory-hle/src/runtime.rs:efficiency_mode_opt_out(value: Option<&str>) -> bool.PROCESS_POWER_THROTTLING_EXECUTION_SPEEDinPROCESS_POWER_THROTTLING_STATE::ControlMaskunlessVICTORY_EFFICIENCY_MODE=1."0", and"1".Verification
cargo test -p victory-hle --lib runtime::tests: 5 passed, 0 failed (142 filtered out)cargo xtask policy: passed (asset policy: 184 files ok)[PR #2569] HLE: opt out of Windows 11 Efficiency Mode throttling in use_console_…to [PR #2569] HLE: opt out of Windows 11 Efficiency Mode throttling in use_console_timersImported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T19:18:22Z.
Automated triage for the maintainers.
Needs work. This adds
PROCESS_POWER_THROTTLING_EXECUTION_SPEEDto theControlMaskinuse_console_timers(crates/victory-hle/src/runtime.rs) withStateMask0, which opts the process out of EcoQoS. A new switch,VICTORY_EFFICIENCY_MODE=1, turns the opt-out off. The API use is correct. CI:checkpassing.Changes needed:
efficiency_mode_opt_outsits betweenuse_console_timersand its doc comment. The comment now documents the helper, anduse_console_timersgets a second, overlapping doc. Please keep the doc onuse_console_timersand extend it.let execution = if efficiency_mode_opt_out(std::env::var(...)...line is wider than rustfmt allows.Generated by Claude Code
Imported from Marvisak/VIctory. Originally posted by Kajanos on 2026-11-26T00:07:26Z.
Windows 11 / NVIDIA test run, head
098bdbe59amerged ontomain63bcca43c6.Setup: Windows 11 Home build 26300, RTX 5080, NVIDIA 621.40, rustc 1.98.1 MSVC, VS 2022 Build Tools, Windows SDK 10.0.26100 (
dxil.dllfrom the SDK).cargo test --locked -p victory-hle: 152 passed, 1 failed.lifecycle::tests::showing_a_title_window_shows_its_stand_in, and it also fails onmainin this run. The tests ran over SSH, i.e. in session 0 with no interactive desktop, so the window can't be shown. On the desktop session the same test passes onmain(12/12lifecycle). This PR doesn't touch lifecycle.Not run: the retail title, clippy, and other crates.
AI-assisted (Claude Code)
Imported from Marvisak/VIctory. Originally posted by cloph-dsp on 2026-11-27T13:32:19Z.
Independent local verification of PR #2569 (HLE: opt out of Windows 11 Efficiency Mode throttling in use_console_timers).
cargo test --locked,CARGO_BUILD_JOBS=2, per-worktreeCARGO_TARGET_DIR=D:\Victory-Contrib\target-2569-watch.098bdbe59a4887f904f25de8a4e73c1572c99f0f, merge base67e8ae1401df112248aed36d0024483181b718b7.cargo test --locked -p victory-hle --lib -- --exact runtime::tests::efficiency_mode_opt_out_defaults_on_and_respects_env --test-threads=1 --quietgit grep -F -c 'runtime::tests::efficiency_mode_opt_out_defaults_on_and_respects_env' 67e8ae14 -- crates/victory-hle/src→ 0 hits (exit 1).git diff --check 67e8ae14 HEADclean (exit 0).Only the named synthetic test was replayed; no real Windows 11 Efficiency Mode behaviour was exercised. GPU/driver: N/A for this CPU-only HLE test. AI-assisted (Hy4 flash). No game data, assets, extracted shaders, DRM or decrypt used.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.