perf(gpu,hle): EcoQoS opt-out fallback, triple-buffered tearing swapchain, batched HW-RT unmap, and Streamline log dedup #414

Merged
Androtim merged 2 commits from upstream-pr/414 into main 2026-12-04 02:25:20 +00:00
Androtim commented 2026-12-04 00:54:10 +00:00 (Migrated from github.com)

Imported from Androtim/MiniVI. Originally posted by Androtim on 2026-12-04T00:54:10Z.


Summary

Ports three verified GPL-3.0 performance and stability improvements:

  1. Windows 11 EcoQoS throttling opt-out fallback & triple-buffered ALLOW_TEARING swapchain (crates/victory-hle/src/runtime.rs, crates/victory-gpu/src/host.rs)

    • Attribution: Ported from ReTerryDavis/ReVIctory (GPL-3.0), commit ea1c5709c10f5687197fc83d6383726b273fbe7f (ea1c570).
    • Retries SetProcessInformation(ProcessPowerThrottling) with PROCESS_POWER_THROTTLING_EXECUTION_SPEED-only when PROCESS_POWER_THROTTLING_IGNORE_TIMER_RESOLUTION is rejected (e.g., pre-Windows 11 22H2), calls SetThreadExecutionState(ES_CONTINUOUS | ES_DISPLAY_REQUIRED | ES_SYSTEM_REQUIRED) to keep system/display active, and logs power_unthrottled while preserving VICTORY_EFFICIENCY_MODE=1.
    • Defaults flip-discard swapchains to triple buffering (BUFFERS = 3, configurable via VICTORY_SWAPCHAIN_BUFFERS clamped to 2..=4), disables DXGI Alt+Enter exclusive fullscreen across all swapchain paths (DXGI_MWA_NO_ALT_ENTER) so ALLOW_TEARING, Streamline DLSS-G, present-hooked DLSS, and FSR 3 proxies stay in windowed/borderless mode, and guards DXGI_PRESENT_ALLOW_TEARING on sync_interval == 0 with existing runtime fallback to DXGI_PRESENT(0) on refusal.
  2. Single-pass batched HW-RT table eviction for page-mapping copies (crates/victory-gpu/src/hwrt.rs, crates/victory-gpu/src/hwrt/decoders.rs, crates/victory-gpu/src/watch.rs, crates/victory-gpu/src/lib.rs, crates/victory-hle/src/modules/xmem.rs)

    • Attribution: Ported from TrustNo1/Darner (GPL-3.0, https://git.gtahub.st/TrustNo1/Darner), commit 775a0c7 (PR #92).
    • Adds hwrt::title_memory_freed_many with joined_spans/in_spans and predicate-based MeshletCache::forget.
    • Gathers unmapped ranges in watch::title_memory_freed_gathered around xmem::map_aliases (VICTORY_HW_RT_FREED_GATHERED=0 disables) so as_map, recording_tlas, hidden structures, waiting queue, BLAS LRU, decoded_ibs, and validated_ibs are each walked once per page-mapping copy batch instead of once per unmapped page.
  3. Streamline log message deduplication (crates/victory-gpu/src/streamline.rs)

    • Attribution: Ported from TrustNo1/Darner (GPL-3.0, https://git.gtahub.st/TrustNo1/Darner), commit 3e6c82f (#111).
    • Strips leading bracketed timestamp/thread-ID prefixes (message_key) and logs repeated Streamline errors/warnings on the 1st occurrence and every 1000th occurrence with count (bounded at 4096 distinct keys), preventing per-frame error floods (e.g., out of VRAM (39)) from stalling disk I/O.

Verification

  • cargo +1.98.1-x86_64-pc-windows-gnu check --workspace: passed cleanly with zero errors/warnings.
  • Focused unit tests (all passed):
    • victory-hle: runtime::tests::power_throttling_masks_opt_out_of_ecoqos_with_fallback, modules::xmem::tests::batched_copies_that_cannot_be_served_change_nothing (6 passed, 0 failed)
    • victory-gpu:
      • host::spare::swap_chain_buffers_defaults_to_triple_buffered_and_clamps_override
      • host::spare::tearing_chain_and_present_flags_respect_dxgi_contract
      • hwrt::tests::freed_ranges_joined_name_what_each_alone_names
      • hwrt::tests::freed_gathered_defaults_on_and_disables_on_zero
      • hwrt::decoders::tests::* (including MeshletCache::forget predicate)
      • watch::ask_holds::freed_gathered_batches_nested_unmaps_until_outermost_scope_ends
      • streamline::tests::a_repeated_streamline_message_is_logged_first_then_every_thousandth
      • streamline::tests::streamline_log_deduper_bounds_distinct_keys
        (13 passed across both test runs, 0 failed)
<!-- greyfinch-sync:Androtim/MiniVI:issue:5637950815 --> Imported from [Androtim/MiniVI](https://github.com/Androtim/MiniVI/pull/414). Originally posted by [Androtim](https://github.com/Androtim) on 2026-12-04T00:54:10Z. --- ## Summary Ports three verified `GPL-3.0` performance and stability improvements: 1. **Windows 11 EcoQoS throttling opt-out fallback & triple-buffered `ALLOW_TEARING` swapchain** (`crates/victory-hle/src/runtime.rs`, `crates/victory-gpu/src/host.rs`) - **Attribution:** Ported from `ReTerryDavis/ReVIctory` (`GPL-3.0`), commit `ea1c5709c10f5687197fc83d6383726b273fbe7f` (`ea1c570`). - Retries `SetProcessInformation(ProcessPowerThrottling)` with `PROCESS_POWER_THROTTLING_EXECUTION_SPEED`-only when `PROCESS_POWER_THROTTLING_IGNORE_TIMER_RESOLUTION` is rejected (e.g., pre-Windows 11 22H2), calls `SetThreadExecutionState(ES_CONTINUOUS | ES_DISPLAY_REQUIRED | ES_SYSTEM_REQUIRED)` to keep system/display active, and logs `power_unthrottled` while preserving `VICTORY_EFFICIENCY_MODE=1`. - Defaults flip-discard swapchains to triple buffering (`BUFFERS = 3`, configurable via `VICTORY_SWAPCHAIN_BUFFERS` clamped to `2..=4`), disables DXGI `Alt+Enter` exclusive fullscreen across all swapchain paths (`DXGI_MWA_NO_ALT_ENTER`) so `ALLOW_TEARING`, Streamline DLSS-G, present-hooked DLSS, and FSR 3 proxies stay in windowed/borderless mode, and guards `DXGI_PRESENT_ALLOW_TEARING` on `sync_interval == 0` with existing runtime fallback to `DXGI_PRESENT(0)` on refusal. 2. **Single-pass batched HW-RT table eviction for page-mapping copies** (`crates/victory-gpu/src/hwrt.rs`, `crates/victory-gpu/src/hwrt/decoders.rs`, `crates/victory-gpu/src/watch.rs`, `crates/victory-gpu/src/lib.rs`, `crates/victory-hle/src/modules/xmem.rs`) - **Attribution:** Ported from `TrustNo1/Darner` (`GPL-3.0`, `https://git.gtahub.st/TrustNo1/Darner`), commit `775a0c7` (PR #92). - Adds `hwrt::title_memory_freed_many` with `joined_spans`/`in_spans` and predicate-based `MeshletCache::forget`. - Gathers unmapped ranges in `watch::title_memory_freed_gathered` around `xmem::map_aliases` (`VICTORY_HW_RT_FREED_GATHERED=0` disables) so `as_map`, `recording_tlas`, hidden structures, waiting queue, BLAS LRU, `decoded_ibs`, and `validated_ibs` are each walked once per page-mapping copy batch instead of once per unmapped page. 3. **Streamline log message deduplication** (`crates/victory-gpu/src/streamline.rs`) - **Attribution:** Ported from `TrustNo1/Darner` (`GPL-3.0`, `https://git.gtahub.st/TrustNo1/Darner`), commit `3e6c82f` (#111). - Strips leading bracketed timestamp/thread-ID prefixes (`message_key`) and logs repeated Streamline errors/warnings on the 1st occurrence and every 1000th occurrence with count (bounded at 4096 distinct keys), preventing per-frame error floods (e.g., `out of VRAM (39)`) from stalling disk I/O. ## Verification - `cargo +1.98.1-x86_64-pc-windows-gnu check --workspace`: passed cleanly with zero errors/warnings. - Focused unit tests (all passed): - `victory-hle`: `runtime::tests::power_throttling_masks_opt_out_of_ecoqos_with_fallback`, `modules::xmem::tests::batched_copies_that_cannot_be_served_change_nothing` (6 passed, 0 failed) - `victory-gpu`: - `host::spare::swap_chain_buffers_defaults_to_triple_buffered_and_clamps_override` - `host::spare::tearing_chain_and_present_flags_respect_dxgi_contract` - `hwrt::tests::freed_ranges_joined_name_what_each_alone_names` - `hwrt::tests::freed_gathered_defaults_on_and_disables_on_zero` - `hwrt::decoders::tests::*` (including `MeshletCache::forget` predicate) - `watch::ask_holds::freed_gathered_batches_nested_unmaps_until_outermost_scope_ends` - `streamline::tests::a_repeated_streamline_message_is_logged_first_then_every_thousandth` - `streamline::tests::streamline_log_deduper_bounds_distinct_keys` (13 passed across both test runs, 0 failed)
Androtim commented 2026-12-04 01:01:59 +00:00 (Migrated from github.com)

Imported from Androtim/MiniVI. Originally posted by Androtim on 2026-12-04T01:01:59Z.


Triage (47cecb8c, CI queued):

  • Clean, 100% title-neutral 3-part perf/stability port (+485/-51, 8 files, zero opt-in toggles): Windows 11 EcoQoS throttling opt-out fallback + SetThreadExecutionState (runtime.rs), triple-buffered ALLOW_TEARING swapchain + DXGI_MWA_NO_ALT_ENTER (host.rs), batched HW-RT title_memory_freed_many (hwrt.rs/watch.rs/xmem.rs, VICTORY_HW_RT_FREED_GATHERED=0 kill-switch), and Streamline log dedup (streamline.rs).
  • Holding auto-merge for green CI + Gate 2 Audit (#282) + Gate 3 plain---release A/B (verifying ALLOW_TEARING + DLSS/FSR/FG proxy compatibility & VICTORY_HW_RT=1 unmap path).
  • Overlap note: touches host.rs & streamline.rs (shared with #413 & #415) — merge sequentially.
<!-- greyfinch-sync:Androtim/MiniVI:comment:7397407543 --> Imported from [Androtim/MiniVI](https://github.com/Androtim/MiniVI/pull/414#issuecomment-7397407543). Originally posted by [Androtim](https://github.com/Androtim) on 2026-12-04T01:01:59Z. --- Triage (`47cecb8c`, CI queued): - Clean, 100% title-neutral 3-part perf/stability port (`+485/-51`, 8 files, **zero opt-in toggles**): Windows 11 EcoQoS throttling opt-out fallback + `SetThreadExecutionState` (`runtime.rs`), triple-buffered `ALLOW_TEARING` swapchain + `DXGI_MWA_NO_ALT_ENTER` (`host.rs`), batched HW-RT `title_memory_freed_many` (`hwrt.rs`/`watch.rs`/`xmem.rs`, `VICTORY_HW_RT_FREED_GATHERED=0` kill-switch), and Streamline log dedup (`streamline.rs`). - Holding auto-merge for green CI + **Gate 2 Audit (`#282`)** + **Gate 3 plain-`--release` A/B** (verifying `ALLOW_TEARING` + DLSS/FSR/FG proxy compatibility & `VICTORY_HW_RT=1` unmap path). - *Overlap note:* touches `host.rs` & `streamline.rs` (shared with `#413` & `#415`) — merge sequentially.
Androtim commented 2026-12-04 02:01:11 +00:00 (Migrated from github.com)

Imported from Androtim/MiniVI. Originally posted by Androtim on 2026-12-04T02:01:11Z.


Marking triage: needs rebase after #415 (e2cbc10b) merged onto main (overlapping crates/victory-gpu/src/host.rs). Once rebased cleanly with green CI, ready for Gate 2 + Gate 3 GPU A/B.

<!-- greyfinch-sync:Androtim/MiniVI:comment:7398484596 --> Imported from [Androtim/MiniVI](https://github.com/Androtim/MiniVI/pull/414#issuecomment-7398484596). Originally posted by [Androtim](https://github.com/Androtim) on 2026-12-04T02:01:11Z. --- Marking `triage: needs rebase` after `#415` (`e2cbc10b`) merged onto `main` (overlapping `crates/victory-gpu/src/host.rs`). Once rebased cleanly with green CI, ready for Gate 2 + Gate 3 GPU A/B.
Androtim commented 2026-12-04 02:02:06 +00:00 (Migrated from github.com)

Imported from Androtim/MiniVI. Originally posted by Androtim on 2026-12-04T02:02:06Z.


Automated triage for the maintainers (not an approval).

Verdict: needs-rebase · CI (check): passing

This PR no longer merges cleanly into main.

To change the verdict: Rebase onto current main and resolve conflicts; CI and triage will run again automatically.


Generated with Antigravity CLI (agy).

<!-- greyfinch-sync:Androtim/MiniVI:comment:7398500870 --> Imported from [Androtim/MiniVI](https://github.com/Androtim/MiniVI/pull/414#issuecomment-7398500870). Originally posted by [Androtim](https://github.com/Androtim) on 2026-12-04T02:02:06Z. --- <!-- minivi-triage v1 head=443998ff5881cd1d3ba0854977c38999dccfa39a verdict=needs-rebase ci=passing at=2026-12-04T02:02:45Z --> Automated triage for the maintainers (not an approval). **Verdict:** `needs-rebase` · **CI (`check`):** `passing` This PR no longer merges cleanly into `main`. **To change the verdict:** Rebase onto current `main` and resolve conflicts; CI and triage will run again automatically. --- _Generated with Antigravity CLI (`agy`)._
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!414
No description provided.