Recover 12 acyclic wave32 shaders, expand NVIDIA dynamic slots, and add VRAM-tiered MiniVI launcher #1

Closed
github-bot wants to merge 14 commits from gh-pr/1/head into gh-pr/1/base
Owner

@⁠Forkei on GitHub · 2026-11-27 22:50 UTC · original
Forkei:feat/wave32-forward-widen-and-vram-autoscale → main · +3718 −377 · 44 files · 14 commits · closed without merging

Summary

Cleanly rebased on Androtim/MiniVI f3c0c33 (including upstream trustno1-coder/VIctory-NVIDIA 64d4931: water light without dark blocks, F1 instant save, PS4 pads, placed-view padding fix, audio DSP convolutions, early arena reservation, and memory switches), plus Iterations 4–6 visual, shader, VRAM, CPU, HLE memory safety, loader, and launcher improvements.

What this PR adds

  1. Shader Code Table Trimming, HDR/NaN Clamping, Ambient Scrubbing & RDNA 4 Buffer-Size Handle (includes PRs #550, #534, #521, #559):
  2. PSV0 StringTable, Pixel Row Packing, Mesh Row Interp, Array calculateLOD & Wave32 Widening (includes PR #560):
    • Stopped deduplicating arbitrary semantic names in PSV0's string table to match dxil.dll 1.6/1.7 rules, reconciled unused float TEXCOORD inputs sharing a packed pixel row with unused constant/system inputs (SV_IsFrontFace), applied PSV0 output interpolation modes to mesh shaders (HwStage::Ms), emitted undef for unused coordinate channels on array calculateLOD.f32.
    • Recovers 12 acyclic single-wave (group == 64) compute shaders on Wave32 GPUs (hair shadow masks, water volumetrics transmission, particle/decal trails) without widening loop back-edges, and fixed emit_program discarding NEEDS when VICTORY_LOOPS_WAVE stays at wave64 (too_wide, PR #560 regression test included).
  3. x86-64-v3 Baseline, Zero-Copy Single-Flight Shader Cache & GPU Hot-Path Speedups (includes PRs #537, #547, #548, #552, #516, #532, #558, #481, #512, #497, #498):
    • Enables -C target-cpu=x86-64-v3 (AVX2/BMI1/BMI2/FMA) in .cargo/config.toml alongside single-flight zero-copy chunked Cache::get_or_convert_chunks in crates/victory-pipeline/src/cache.rs and shader_cache.rs (while keeping panic=unwind for catch_unwind safety in victory-gpu).
    • Gates D3D12 aliasing barriers on pool::is_pooled(&resource) so committed fallback textures don't hit E_INVALIDARG (0x80070057), gates Counting GlobalAlloc behind #[cfg(feature = "diagnostics")], uses runtime-dispatched AVX2 non-temporal stores (_mm256_stream_si256) for snapshot copies >= 64 KiB, defaults VICTORY_FAULT_UNLOCKED on (=0 to disable) while hoisting soft_runs out of GUARDS.lock(), and scales texspk_cap_ms / VICTORY_TEXTURE_CATCHUP with >12 GiB VRAM headroom and catch-up backlogs.
    • Fixes DLSS render-range handling when a driver override shrinks optimal render size (VICTORY_DLSS_RANGE=0 to disable), enforces VICTORY_WC_NO_BACK_MIN_KB cutoff for VICTORY_WC_BAR=1 (=2 legacy), adds rtx_generation() workstation RTX detection, device method 0x218 loose FSPX compute pipelines + scalar bit ops (PR #506), expanded NVIDIA dynamic slots (262,144 -> 278,528), hot-path scratch allocation removal (PR #498), pipeline wait_once (PR #497), VICTORY_LAZY_COMPARE_MB (PR #501), and VICTORY_WINDOW_GROW=1 (PR #477).
  4. HLE Remap & Loader Safety, Mouse Drag Pause, 1440p UI Scaling, Warm Cache & VICTORY_KEEP_RAM_GB (includes PRs #538, #551, #541, #549, #533, #572, #91, #568):
    • XMemMapPhysicalPages, alias_as, and map_aliases validate all source pages before unmapping destinations.
    • crates/victory-loader: Supports multiple reachable STUBS regions for clzero loops >2 GiB apart (console_insn.rs), uses checked_add on TLS/DIR64 RVAs (prepare.rs), pauses mouse capture/warp while dragging/resizing (lifecycle.rs), updates Series X 1440p UI scaling (native_1440p.rs), makes victory warm inherit victory-settings.txt + play defaults (warm.rs), caps windows_own_runtime_tells_its_version cleanly (main.rs), and adds VICTORY_KEEP_RAM_GB (SetProcessWorkingSetSizeEx hard minimum working set in run.rs / play.rs / play-minivi.ps1 -KeepRamGb).
  5. Launcher, F1 Menu & Restart Path/CWD Preservation (play.rs, menu.rs, scripts/play-minivi.ps1, play-foxhound.ps1, play.ps1, Play-VIctory.cmd — includes PRs #490, #544, #542, #511, #563):
    • Restores character faces by leaving out only heat haze (731a39171b568298) by default, adds HEAT HAZE / FACES F1 menu toggle, stops making Streamline/FSR3 FG swapchains ready when FG is off unless -FrameGenReady / --framegen-ready is requested, defaults VICTORY_CARD_AWAKE=0, keeps VICTORY_HOME / VICTORY_ADAPTER / VICTORY_KEEP_RAM_GB across restarts, and passes VICTORY_MENU_EXE / VICTORY_MENU_CWD across F1 restarts so apostrophes and working directories survive.

Rig Specs Tested On

  • CPU: AMD Ryzen 9 9900X (12 cores / 24 threads)
  • GPU & VRAM: NVIDIA GeForce RTX 5070 Ti (16 GB VRAM)
  • System RAM: 32 GB
  • OS & GPU Driver: Windows 11 (10.0.26300)

Run Settings & Profile

  • Build & Commit SHA: release (x86-64-v3) @ 2bd9eed (rebased onto f3c0c33)
  • Console Profile & Internal Resolution / Scale: series-s / 1080p (native-1080p), plus retail 1440p patch verification
  • Ray Tracing: off
  • Upscaling: DLSS quality
  • Frame Generation: DLSS 4x
  • Launcher Command / Preset & Extra VICTORY_* Overrides: .\scripts\play-minivi.ps1 -Build release -Preset native-1080p -Dlss quality -FrameGen 4x (VICTORY_EARLY_DEPTH=1, VICTORY_NAN_SCRUB=1, VICTORY_HOST_WAVE=32)
  • Scene / Area & Session Length: Full offline shaders.rpf corpus DXIL validation, targeted RTX 5070 Ti PSO validation on RDNA4-touched compute shaders, full cache-minivi shader cache rebuild (25,773 shaders), full workspace clippy & unit tests.

Measurements & Verification

  • victory.exe translate --validate (shaders.rpf, VICTORY_HOST_WAVE=32, SDK 10.0.26100.0 dxil.dll):
    • Vertex+Pixel: 14,247 / 14,247 validated (100%)
    • Compute: 2,668 / 2,682 emitted, 2,668 / 2,668 validated (100%)
    • Mesh: 8,765 / 8,765 emitted, 8,694 / 8,765 validated (zero row-interpolation errors)
    • Targeted --validate --pipelines (f16876929fa64f9f,878933b499cfa14d,a4df980a1c65fdbe): 3 / 3 emitted, validated, and created valid RTX 5070 Ti PSOs.
    • Offline victory.exe shaders cache rebuild (VICTORY_EARLY_DEPTH=1, VICTORY_NAN_SCRUB=1): 25,773 shaders cached cleanly (212 untranslated) in 193 s (down from 211 s prior to x86-64-v3 + zero-copy chunk cache).
  • Crashes / DRED Resets: 0 offline validator/PSO regressions; full x86-64-v3 release binary builds cleanly (2m 27s).
  • Automated Checks:
    • cargo clippy --workspace --all-targets --locked -- -D warnings (and --all-features)
    • cargo test --locked -p xtask (6 passed, 0 failed)
    • cargo test -p victory-shader --locked -- --test-threads=1 (297 passed, 0 failed, 4 ignored)
    • cargo test -p victory-gpu --locked -- --test-threads=1 (464 passed, 0 failed, 37 ignored)
    • Remaining workspace tests (victory 26/26, census 2/2, victory-core 13/13, victory-formats 42/42, victory-game 3/3, victory-hle 185/185 + integration 1/1, victory-loader 49/49 + integration 2/2 + 1/1, victory-pe 36/36, victory-pipeline 12/12)
    • PowerShell AST parse check (play-minivi.ps1, play-foxhound.ps1, play.ps1)
**@⁠Forkei** on GitHub · 2026-11-27 22:50 UTC · [original](https://github.com/Androtim/MiniVI/pull/1) `Forkei:feat/wave32-forward-widen-and-vram-autoscale` → `main` · +3718 −377 · 44 files · 14 commits · closed without merging ## Summary Cleanly rebased on `Androtim/MiniVI` `f3c0c33` (including upstream `trustno1-coder/VIctory-NVIDIA 64d4931`: water light without dark blocks, F1 instant save, PS4 pads, placed-view padding fix, audio DSP convolutions, early arena reservation, and memory switches), plus Iterations 4–6 visual, shader, VRAM, CPU, HLE memory safety, loader, and launcher improvements. ### What this PR adds 1. **Shader Code Table Trimming, HDR/NaN Clamping, Ambient Scrubbing & RDNA 4 Buffer-Size Handle (includes PRs #550, #534, #521, #559):** - [`crates/victory-shader/src/emit/lower.rs`](crates/victory-shader/src/emit/lower.rs): Starts the code constant table after the program's instructions unless a fixed offset reads inside code (preventing RTX 5090 Xid 13 faults and multi-GB driver local-memory bloat on NVIDIA GPUs). - [`crates/victory-shader/src/emit/lower.rs`](crates/victory-shader/src/emit/lower.rs), [`crates/victory-gpu/src/shader_cache.rs`](crates/victory-gpu/src/shader_cache.rs): Clamps pixel float colour outputs to `[-65024, 65024]` (`VICTORY_HDR_CLAMP=0` to disable) to avoid FP16 `+Inf`/tonemapper black blobs/glints. - [`crates/victory-shader/src/emit/lower/amd.rs`](crates/victory-shader/src/emit/lower/amd.rs): Gives uniform buffer `getDimensions` queries an independent non-uniform heap handle (not counted in `nonuniform_handles`), fixing the AMD RDNA 4 `amdxc64` compiler crash on 10 compute shaders (PR #559 / DexNom PR 62). - [`crates/victory-gpu/src/compose.rs`](crates/victory-gpu/src/compose.rs), [`crates/victory-gpu/src/ambient.rs`](crates/victory-gpu/src/ambient.rs): Adds bit-level NaN/Inf-safe saturate (`VICTORY_COMPOSE_NAN=0` to disable) in the two-plane composer and scrubs `NaN`/`Inf`/negative values on both `found` and `was` in `ambient::raise`. 2. **PSV0 StringTable, Pixel Row Packing, Mesh Row Interp, Array `calculateLOD` & Wave32 Widening (includes PR #560):** - Stopped deduplicating arbitrary semantic names in `PSV0`'s string table to match `dxil.dll` 1.6/1.7 rules, reconciled unused float `TEXCOORD` inputs sharing a packed pixel row with unused constant/system inputs (`SV_IsFrontFace`), applied `PSV0` output interpolation modes to mesh shaders (`HwStage::Ms`), emitted `undef` for unused coordinate channels on array `calculateLOD.f32`. - Recovers 12 acyclic single-wave (`group == 64`) compute shaders on Wave32 GPUs (hair shadow masks, water volumetrics transmission, particle/decal trails) without widening loop back-edges, and fixed `emit_program` discarding `NEEDS` when `VICTORY_LOOPS_WAVE` stays at `wave64` (`too_wide`, PR #560 regression test included). 3. **`x86-64-v3` Baseline, Zero-Copy Single-Flight Shader Cache & GPU Hot-Path Speedups (includes PRs #537, #547, #548, #552, #516, #532, #558, #481, #512, #497, #498):** - Enables `-C target-cpu=x86-64-v3` (`AVX2`/`BMI1`/`BMI2`/`FMA`) in [`.cargo/config.toml`](.cargo/config.toml) alongside single-flight zero-copy chunked `Cache::get_or_convert_chunks` in [`crates/victory-pipeline/src/cache.rs`](crates/victory-pipeline/src/cache.rs) and [`shader_cache.rs`](crates/victory-gpu/src/shader_cache.rs) (while keeping `panic=unwind` for `catch_unwind` safety in `victory-gpu`). - Gates D3D12 aliasing barriers on `pool::is_pooled(&resource)` so committed fallback textures don't hit `E_INVALIDARG` (`0x80070057`), gates `Counting` `GlobalAlloc` behind `#[cfg(feature = "diagnostics")]`, uses runtime-dispatched AVX2 non-temporal stores (`_mm256_stream_si256`) for snapshot copies `>= 64 KiB`, defaults `VICTORY_FAULT_UNLOCKED` on (`=0` to disable) while hoisting `soft_runs` out of `GUARDS.lock()`, and scales `texspk_cap_ms` / `VICTORY_TEXTURE_CATCHUP` with >12 GiB VRAM headroom and catch-up backlogs. - Fixes DLSS render-range handling when a driver override shrinks optimal render size (`VICTORY_DLSS_RANGE=0` to disable), enforces `VICTORY_WC_NO_BACK_MIN_KB` cutoff for `VICTORY_WC_BAR=1` (`=2` legacy), adds `rtx_generation()` workstation RTX detection, device method `0x218` loose FSPX compute pipelines + scalar bit ops (PR #506), expanded NVIDIA dynamic slots (`262,144 -> 278,528`), hot-path scratch allocation removal (PR #498), pipeline `wait_once` (PR #497), `VICTORY_LAZY_COMPARE_MB` (PR #501), and `VICTORY_WINDOW_GROW=1` (PR #477). 4. **HLE Remap & Loader Safety, Mouse Drag Pause, 1440p UI Scaling, Warm Cache & `VICTORY_KEEP_RAM_GB` (includes PRs #538, #551, #541, #549, #533, #572, #91, #568):** - `XMemMapPhysicalPages`, `alias_as`, and `map_aliases` validate all source pages before unmapping destinations. - [`crates/victory-loader`](crates/victory-loader/src): Supports multiple reachable `STUBS` regions for `clzero` loops >2 GiB apart (`console_insn.rs`), uses `checked_add` on TLS/DIR64 RVAs (`prepare.rs`), pauses mouse capture/warp while dragging/resizing (`lifecycle.rs`), updates Series X 1440p UI scaling (`native_1440p.rs`), makes `victory warm` inherit `victory-settings.txt` + `play` defaults (`warm.rs`), caps `windows_own_runtime_tells_its_version` cleanly (`main.rs`), and adds `VICTORY_KEEP_RAM_GB` (`SetProcessWorkingSetSizeEx` hard minimum working set in `run.rs` / `play.rs` / `play-minivi.ps1 -KeepRamGb`). 5. **Launcher, F1 Menu & Restart Path/CWD Preservation (`play.rs`, `menu.rs`, `scripts/play-minivi.ps1`, `play-foxhound.ps1`, `play.ps1`, `Play-VIctory.cmd` — includes PRs #490, #544, #542, #511, #563):** - Restores character faces by leaving out only heat haze (`731a39171b568298`) by default, adds **HEAT HAZE / FACES** F1 menu toggle, stops making Streamline/FSR3 FG swapchains ready when FG is off unless `-FrameGenReady` / `--framegen-ready` is requested, defaults `VICTORY_CARD_AWAKE=0`, keeps `VICTORY_HOME` / `VICTORY_ADAPTER` / `VICTORY_KEEP_RAM_GB` across restarts, and passes `VICTORY_MENU_EXE` / `VICTORY_MENU_CWD` across F1 restarts so apostrophes and working directories survive. ## Rig Specs Tested On - **CPU:** AMD Ryzen 9 9900X (12 cores / 24 threads) - **GPU & VRAM:** NVIDIA GeForce RTX 5070 Ti (16 GB VRAM) - **System RAM:** 32 GB - **OS & GPU Driver:** Windows 11 (10.0.26300) ## Run Settings & Profile - **Build & Commit SHA:** `release` (`x86-64-v3`) @ `2bd9eed` (rebased onto `f3c0c33`) - **Console Profile & Internal Resolution / Scale:** `series-s` / `1080p` (`native-1080p`), plus retail `1440p` patch verification - **Ray Tracing:** `off` - **Upscaling:** `DLSS quality` - **Frame Generation:** `DLSS 4x` - **Launcher Command / Preset & Extra `VICTORY_*` Overrides:** `.\scripts\play-minivi.ps1 -Build release -Preset native-1080p -Dlss quality -FrameGen 4x` (`VICTORY_EARLY_DEPTH=1`, `VICTORY_NAN_SCRUB=1`, `VICTORY_HOST_WAVE=32`) - **Scene / Area & Session Length:** Full offline `shaders.rpf` corpus DXIL validation, targeted RTX 5070 Ti PSO validation on RDNA4-touched compute shaders, full `cache-minivi` shader cache rebuild (`25,773` shaders), full workspace clippy & unit tests. ## Measurements & Verification - **`victory.exe translate --validate` (`shaders.rpf`, `VICTORY_HOST_WAVE=32`, SDK `10.0.26100.0` `dxil.dll`):** - Vertex+Pixel: **14,247 / 14,247** validated (**100%**) - Compute: **2,668 / 2,682** emitted, **2,668 / 2,668** validated (**100%**) - Mesh: **8,765 / 8,765** emitted, **8,694 / 8,765** validated (zero row-interpolation errors) - Targeted `--validate --pipelines` (`f16876929fa64f9f,878933b499cfa14d,a4df980a1c65fdbe`): **3 / 3** emitted, validated, and created valid RTX 5070 Ti PSOs. - Offline `victory.exe shaders` cache rebuild (`VICTORY_EARLY_DEPTH=1`, `VICTORY_NAN_SCRUB=1`): **25,773** shaders cached cleanly (`212` untranslated) in **193 s** (down from 211 s prior to `x86-64-v3` + zero-copy chunk cache). - **Crashes / DRED Resets:** `0` offline validator/PSO regressions; full `x86-64-v3` release binary builds cleanly (`2m 27s`). - **Automated Checks:** - [x] `cargo clippy --workspace --all-targets --locked -- -D warnings` (and `--all-features`) - [x] `cargo test --locked -p xtask` (`6 passed, 0 failed`) - [x] `cargo test -p victory-shader --locked -- --test-threads=1` (`297 passed, 0 failed, 4 ignored`) - [x] `cargo test -p victory-gpu --locked -- --test-threads=1` (`464 passed, 0 failed, 37 ignored`) - [x] Remaining workspace tests (`victory` `26/26`, `census` `2/2`, `victory-core` `13/13`, `victory-formats` `42/42`, `victory-game` `3/3`, `victory-hle` `185/185` + integration `1/1`, `victory-loader` `49/49` + integration `2/2` + `1/1`, `victory-pe` `36/36`, `victory-pipeline` `12/12`) - [x] PowerShell AST parse check (`play-minivi.ps1`, `play-foxhound.ps1`, `play.ps1`)
Ports upstream 'trustno1-coder/VIctory-NVIDIA' PR #498 and PR #497 (GPL-3.0) cleanly onto MiniVI 'f3c0c33':
- PR #498: reuse thread-local 'MERGE_WAS' buffer in 'Shadow::relay_merge', single-pass 'send::take', stack '[u64; 2]' array in 'Batch::refresh_front'.
- PR #497: skip repeating 500 ms per-frame waits for slow non-screen pipelines already compiling on background workers ('VICTORY_PIPELINE_WAIT_ONCE=0' restores old behavior).
Ports upstream 'trustno1-coder/VIctory-NVIDIA' PR #506 (GPL-3.0):
- Implements device method 0x218 ('pipeline::create_loose_compute') for compute pipelines passed as loose FSPX parts instead of standard containers ('VICTORY_LOOSE_COMPUTE=0' to disable, 'VICTORY_DUMP_PSO=<dir>' diagnostics).
- Lowers GFX10 scalar instructions 's_pack_*', 's_bitreplicate_b64_b32', and 's_bfm_*' needed by loose compute shaders.
- Adds 'docs/loose-pipelines.md' and unit tests.
Ports upstream 'trustno1-coder/VIctory-NVIDIA' PR #501 and PR #477 (GPL-3.0) and exposes matching options in 'scripts/play-minivi.ps1':
- PR #501 ('host/lazy.rs', 'host.rs', 'host/card_steps.rs'): adds 'VICTORY_LAZY_COMPARE_MB' and 'VICTORY_LAZY_NARROW=1' to compare big card copies (e.g., 174 MB constants heap) only where shaders recently wrote plus a rotating sweep.
- PR #477 ('shadow.rs', 'descriptor/host.rs', 'draw.rs', 'copystat.rs'): adds 'VICTORY_WINDOW_GROW=1' so title-memory windows grow from requested ranges instead of reserving full 4 MiB blocks each (~0.9 GB RAM savings).
- 'scripts/play-minivi.ps1': adds '-LazyCompare' and '-WindowGrow' switches and enables 'f3c0c33' play-mode defaults ('VICTORY_TEXSPK_PASS_MS=8', 'VICTORY_PASSES_HOT=1', 'VICTORY_HELPER_PRIORITY=1' when 'MINIVI_NO_TUNE != 1').
Ported from VIctory-NVIDIA PR #550 (kibagami-nc / desplmfao), PR #534 (Wiktorxd-1 / aki-gta6/aki-runtime), and PR #521 (Wiktorxd-1), GPL-3.0.
Ported from VIctory-NVIDIA PRs #547, #548, #552, #516, #532, and #512 (GPL-3.0).
Ported from VIctory-NVIDIA PRs #538, #551, #541, #549, and #533 (GPL-3.0).
Ported from VIctory-NVIDIA PRs #490, #544, #542, #532, #521, #511, and #512 (GPL-3.0) and harmonized with play-minivi.ps1.
Ported from VIctory-NVIDIA PR #559 (BackseatDrivers-Unbound / DexNom PR 62 / IxMxAMAR) and PR #560 (kibagami-nc), GPL-3.0.
Ported from VIctory-NVIDIA PR #537 (hqjake, GPL-3.0). Keeps panic=unwind for catch_unwind safety in victory-gpu.
Ported from VIctory-NVIDIA PRs #558 (jhon17parizotto-byte), #481 (cloph-dsp), and #563 (ghptc), GPL-3.0.
Ported from VIctory-NVIDIA PRs #572 (kibagami-nc), #91 (Caasares), and #568 (arminkhaleghirod), GPL-3.0.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-01 20:00:49 +00:00
github-bot closed this pull request 2026-12-01 20:00:49 +00:00
Author
Owner

@⁠Androtim on GitHub · 2026-11-28 00:43 UTC · original · edited 2026-11-28 18:46 UTC

Automated triage for the maintainers (not an approval).

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

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-11-28 00:43 UTC · [original](https://github.com/Androtim/MiniVI/pull/1#issuecomment-7231146134) · edited 2026-11-28 18:46 UTC <!-- minivi-triage v1 head=2bd9eed15147b94f548f57a9662f28155c7efcb0 verdict=needs-rebase ci=none at=2026-11-28T18:46:55Z --> Automated triage for the maintainers (not an approval). **Verdict:** `needs-rebase` · **CI (`check`):** `none` 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`)._
Author
Owner

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

Closing as superseded by newer merged/tracked work per #276 (Core Architecture Rewrite Backlog).

**@⁠Androtim** on GitHub · 2026-12-01 01:37 UTC · [original](https://github.com/Androtim/MiniVI/pull/1#issuecomment-7297719329) Closing as superseded by newer merged/tracked work per #276 (Core Architecture Rewrite Backlog).

Pull request closed

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!1
No description provided.