HLE: opt out of Windows 11 Efficiency Mode throttling in use_console_timers #2569
No reviewers
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Marvisak--VIctory!2569
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-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?
@Bebrik229 on GitHub · 2026-11-25 16:03 UTC · original
Bebrik229:hle/win11-efficiency-mode→main· +24 −1 · 1 files · 1 commits · openSummary
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)@Marvisak on GitHub · 2026-11-25 19:18 UTC · original
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
@Kajanos on GitHub · 2026-11-26 00:07 UTC · original
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)
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.