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

Manually merged
github merged 2 commits from github-bot/gh-414 into gh-pr/414/base 2026-12-04 02:30:29 +00:00 AGit
Owner

@⁠Androtim on GitHub · 2026-12-04 00:54 UTC · original
Androtim:perf/ecoqos-tearing-hwrt-unmap-and-sl-dedup → main · +523 −59 · 8 files · 2 commits · merged 2026-12-04 02:25 UTC

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** on GitHub · 2026-12-04 00:54 UTC · [original](https://github.com/Androtim/MiniVI/pull/414) `Androtim:perf/ecoqos-tearing-hwrt-unmap-and-sl-dedup` → `main` · +523 −59 · 8 files · 2 commits · merged 2026-12-04 02:25 UTC ## 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)
Port three verified GPL-3.0 performance and stability improvements:

1. EcoQoS throttling opt-out fallback & triple-buffered ALLOW_TEARING swapchain
   Ported from ReTerryDavis/ReVIctory (GPL-3.0), commit ea1c5709c10f5687197fc83d6383726b273fbe7f (ea1c570):
   - Retry SetProcessInformation(ProcessPowerThrottling) with EXECUTION_SPEED-only if IGNORE_TIMER_RESOLUTION is rejected, keep display/system awake via SetThreadExecutionState, and log power_unthrottled.
   - Default flip-discard swapchain to 3 buffers (VICTORY_SWAPCHAIN_BUFFERS clamps 2..=4), disable Alt+Enter exclusive fullscreen via DXGI_MWA_NO_ALT_ENTER across all swapchain paths (plain, Streamline DLSS-G, present-hooked, FSR 3), and guard DXGI_PRESENT_ALLOW_TEARING on sync_interval == 0 with runtime fallback.

2. Gather page-mapping copy unmapped pages for single-pass HW-RT table eviction
   Ported from TrustNo1/Darner (GPL-3.0, https://git.gtahub.st/TrustNo1/Darner), commit 775a0c7 (PR #92):
   - Add hwrt::title_memory_freed_many with joined_spans/in_spans and predicate-based MeshletCache::forget.
   - Gather unmapped ranges in watch::title_memory_freed_gathered around xmem::map_aliases (VICTORY_HW_RT_FREED_GATHERED=0 disables) so each HW-RT table is walked once per copy batch instead of per page.

3. Deduplicate repeated Streamline log messages
   Ported from TrustNo1/Darner (GPL-3.0, https://git.gtahub.st/TrustNo1/Darner), commit 3e6c82f (#111):
   - Strip leading bracketed timestamp/tid prefixes and log each distinct Streamline error/warning on first occurrence and every 1000th occurrence with count, bounded at 4096 distinct keys.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-04 00:56:28 +00:00
Author
Owner

@⁠Androtim on GitHub · 2026-12-04 01:01 UTC · original

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** on GitHub · 2026-12-04 01:01 UTC · [original](https://github.com/Androtim/MiniVI/pull/414#issuecomment-7397407543) 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.
github-bot force-pushed github-bot/gh-414 from 2b03060b59 to 443998ff58 2026-12-04 01:50:29 +00:00 Compare
Author
Owner

@⁠Androtim on GitHub · 2026-12-04 02:01 UTC · original

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** on GitHub · 2026-12-04 02:01 UTC · [original](https://github.com/Androtim/MiniVI/pull/414#issuecomment-7398484596) 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.
Author
Owner

@⁠Androtim on GitHub · 2026-12-04 02:02 UTC · original

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).

**@⁠Androtim** on GitHub · 2026-12-04 02:02 UTC · [original](https://github.com/Androtim/MiniVI/pull/414#issuecomment-7398500870) <!-- 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`)._
github-bot force-pushed github-bot/gh-414 from 443998ff58 to de85aa595a 2026-12-04 02:07:59 +00:00 Compare
github-bot changed target branch from main to gh-pr/414/base 2026-12-04 02:30:25 +00:00
github manually merged commit de85aa595a into gh-pr/414/base 2026-12-04 02:30:29 +00:00
This discussion has been locked. Commenting is limited to contributors.
No reviewers
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.

Dependencies

No dependencies set

Reference
github/Androtim--MiniVI!414
No description provided.