fix(hle/kernel): apply title priority cap when restoring startup priority raises (#282) #377

Merged
RUIZ-Enrique-25002136 merged 1 commit from upstream-pr/377 into main 2026-12-03 08:02:57 +00:00
RUIZ-Enrique-25002136 commented 2026-12-03 07:52:33 +00:00 (Migrated from github.com)

Imported from Androtim/MiniVI. Originally posted by RUIZ-Enrique-25002136 on 2026-12-03T07:52:33Z.


Summary

Applies the post-window cap = true rule and VICTORY_TITLE_PRIORITY_MAX cap (held_at) when give_back_startup_raises() restores thread priorities at the end of a VICTORY_STARTUP_PRIORITIES window, rather than passing raw asked values directly to SetThreadPriority.

Addresses #282 (Pass #8 [P2] #1).

Changes

  • crates/victory-hle/src/modules/kernel.rs:
    • Added startup_restore_priority(asked, max) computing held_at(title_priority(asked, false, true), max).
    • Updated give_back_startup_raises() to apply startup_restore_priority(asked, p_max).
    • Added unit test startup_restore_priority_respects_cap_and_priority_max.

Rig Specs Tested On

  • CPU: Linux workstation (x86_64)
  • GPU & VRAM: N/A (Windows-only victory-hle crate; full clippy & tests verified on GitHub Actions windows-latest CI)
  • System RAM: N/A
  • OS & GPU Driver: Linux (x86_64) — Windows x86_64-pc-windows-msvc CI verifies compilation, clippy, and unit tests

Run Settings & Profile

  • Build & Commit SHA: rebased on origin/main
  • Console Profile & Internal Resolution / Scale: N/A
  • Ray Tracing: N/A
  • Upscaling: N/A
  • Frame Generation: N/A
  • Launcher Command / Preset & Extra VICTORY_* Overrides: N/A
  • Scene / Area & Session Length: N/A

Measurements & Verification

  • Base FPS (without Frame Gen): N/A
  • Frame-Gen FPS (if enabled): N/A
  • VRAM / RAM Usage: N/A
  • Crashes / DRED Resets: N/A
  • Automated Checks:
    • cargo clippy --workspace --all-targets --locked -- -D warnings (verified on GitHub Actions windows-latest CI)
    • cargo clippy --workspace --all-targets --all-features --locked -- -D warnings (verified on GitHub Actions windows-latest CI)
    • cargo test --locked -p xtask -> 8 passed, 0 failed
    • cargo xtask policy -> asset policy: 349 files ok
    • cargo test --workspace --exclude victory-gpu --exclude victory-shader --locked (verified on GitHub Actions windows-latest CI)
<!-- greyfinch-sync:Androtim/MiniVI:issue:5622300954 --> Imported from [Androtim/MiniVI](https://github.com/Androtim/MiniVI/pull/377). Originally posted by [RUIZ-Enrique-25002136](https://github.com/RUIZ-Enrique-25002136) on 2026-12-03T07:52:33Z. --- ## Summary Applies the post-window `cap = true` rule and `VICTORY_TITLE_PRIORITY_MAX` cap (`held_at`) when `give_back_startup_raises()` restores thread priorities at the end of a `VICTORY_STARTUP_PRIORITIES` window, rather than passing raw `asked` values directly to `SetThreadPriority`. Addresses #282 (Pass #8 `[P2]` #1). ### Changes - **`crates/victory-hle/src/modules/kernel.rs`:** - Added `startup_restore_priority(asked, max)` computing `held_at(title_priority(asked, false, true), max)`. - Updated `give_back_startup_raises()` to apply `startup_restore_priority(asked, p_max)`. - Added unit test `startup_restore_priority_respects_cap_and_priority_max`. ## Rig Specs Tested On - **CPU:** Linux workstation (`x86_64`) - **GPU & VRAM:** N/A (Windows-only `victory-hle` crate; full clippy & tests verified on GitHub Actions `windows-latest` CI) - **System RAM:** N/A - **OS & GPU Driver:** Linux (`x86_64`) — Windows `x86_64-pc-windows-msvc` CI verifies compilation, clippy, and unit tests ## Run Settings & Profile - **Build & Commit SHA:** rebased on `origin/main` - **Console Profile & Internal Resolution / Scale:** N/A - **Ray Tracing:** N/A - **Upscaling:** N/A - **Frame Generation:** N/A - **Launcher Command / Preset & Extra `VICTORY_*` Overrides:** N/A - **Scene / Area & Session Length:** N/A ## Measurements & Verification - **Base FPS (without Frame Gen):** N/A - **Frame-Gen FPS (if enabled):** N/A - **VRAM / RAM Usage:** N/A - **Crashes / DRED Resets:** N/A - **Automated Checks:** - [ ] `cargo clippy --workspace --all-targets --locked -- -D warnings` (verified on GitHub Actions `windows-latest` CI) - [ ] `cargo clippy --workspace --all-targets --all-features --locked -- -D warnings` (verified on GitHub Actions `windows-latest` CI) - [x] `cargo test --locked -p xtask` -> 8 passed, 0 failed - [x] `cargo xtask policy` -> `asset policy: 349 files ok` - [ ] `cargo test --workspace --exclude victory-gpu --exclude victory-shader --locked` (verified on GitHub Actions `windows-latest` CI)
Sign in to join this conversation.
No reviewers
No labels
No milestone
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.

Reference
Androtim/MiniVI!377
No description provided.