fix(hle): opt out of Windows efficiency mode throttling in console timers #3269
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3271"
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 legayclightning22 on 2026-11-26T15:18:59Z.
Summary
Updates
use_console_timersincrates/victory-hle/src/runtime.rsso the process opts out of Windows Efficiency Mode throttling by default, keeping timer resolution and frame pacing consistent when unfocused.Changes
ControlMasktoPROCESS_POWER_THROTTLING_EXECUTION_SPEED | PROCESS_POWER_THROTTLING_IGNORE_TIMER_RESOLUTIONand keepStateMaskat0by default to opt out of efficiency throttling.VICTORY_EFFICIENCY_MODE=1support to opt back into efficiency throttling when desired.SetProcessInformationcalls viatracinginstead of panicking, and add a unit test for the power-throttling mask logic.Verification
cargo check -p victory-hle --all-targetscargo clippy --locked -p victory-hle --all-targets -- -D warningscargo test -p victory-hle --libcargo xtask policyImported from Marvisak/VIctory. Originally posted by Dukestar69 on 2026-11-26T15:51:36Z.
Review: APPROVED
Reviewed the diff and verified locally on Windows 11 x64:
PROCESS_POWER_THROTTLING_EXECUTION_SPEEDalongsidePROCESS_POWER_THROTTLING_IGNORE_TIMER_RESOLUTION(with opt-inVICTORY_EFFICIENCY_MODE=1andVICTORY_HIDDEN_WINDOW=1) and logging warnings whenSetProcessInformation/timeBeginPeriodfail is clean and well-tested.cargo test -p victory-hle --lib modules::lifecycle:: -- --test-threads=1: 14 passed, 0 failed (includinghidden_window_mode_leaves_normal_windows_aloneandhidden_window_mode_moves_and_hides_window_without_touching_size).cargo test -p victory-hle --lib runtime:: -- --test-threads=1: 5 passed, 0 failed (includingefficiency_mode_controls_power_throttling_state).cargo clippy -p victory-hle --all-targets -- -D warnings: clean.cargo xtask policy: 191 files ok.Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).
Imported from Marvisak/VIctory. Originally posted by Jackster on 2026-11-26T22:48:35Z.
Windows 11,
63bcca4+ this PR:cargo test -p victory-hle lifecycle::: 14 passed / 0 failed.hidden_window_mode(filter): 2 passed —hidden_window_mode_leaves_normal_windows_alone,hidden_window_mode_moves_and_hides_window_without_touching_size.runtime::tests::efficiency_mode_controls_power_throttling_state: 1 passed.cargo clippy -p victory-hle --all-targets -- -D warnings: clean.The two window tests drive
apply_hidden_window_modedirectly, so no window is created; the efficiency-mode test is#[cfg(windows)]and runs here. Synthetic only. AI-assisted.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.