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

Closed
Forkei wants to merge 0 commits from upstream-pr/1 into main
Forkei commented 2026-11-27 22:50:39 +00:00 (Migrated from github.com)

Imported from Androtim/MiniVI. Originally posted by Forkei on 2026-11-27T22:50:39Z.


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)
<!-- greyfinch-sync:Androtim/MiniVI:issue:5534106024 --> Imported from [Androtim/MiniVI](https://github.com/Androtim/MiniVI/pull/1). Originally posted by [Forkei](https://github.com/Forkei) on 2026-11-27T22:50:39Z. --- ## 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`)
Androtim commented 2026-11-28 00:43:35 +00:00 (Migrated from github.com)

Imported from Androtim/MiniVI. Originally posted by Androtim on 2026-11-28T00:43:35Z.


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

<!-- greyfinch-sync:Androtim/MiniVI:comment:7231146134 --> Imported from [Androtim/MiniVI](https://github.com/Androtim/MiniVI/pull/1#issuecomment-7231146134). Originally posted by [Androtim](https://github.com/Androtim) on 2026-11-28T00:43:35Z. --- <!-- 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`)._
Androtim commented 2026-12-01 01:37:56 +00:00 (Migrated from github.com)

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


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

<!-- greyfinch-sync:Androtim/MiniVI:comment:7297719329 --> Imported from [Androtim/MiniVI](https://github.com/Androtim/MiniVI/pull/1#issuecomment-7297719329). Originally posted by [Androtim](https://github.com/Androtim) on 2026-12-01T01:37:56Z. --- Closing as superseded by newer merged/tracked work per #276 (Core Architecture Rewrite Backlog).

Pull request closed

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