Iter 26: DXGI ALLOW_TEARING immediate present and underwater shader 926c46bab3b86bd6 recovery #11

Merged
Androtim merged 1 commit from upstream-pr/11 into main 2026-11-28 21:17:21 +00:00
Androtim commented 2026-11-28 03:38:16 +00:00 (Migrated from github.com)

Imported from Androtim/MiniVI. Originally posted by Androtim on 2026-11-28T03:38:16Z.


Summary

Ports DXGI ALLOW_TEARING immediate presentation and the LOOPS_OFF wave64 underwater compute shader fallback from trustno1-coder/VIctory-NVIDIA (8fc2254), while keeping zero merge conflicts with open PRs #2–#10 (note: the play.rs and host/menu.rs pieces of b4e1b08/8fc2254 are deferred until PR #5 merges).

  1. DXGI immediate presentation (crates/victory-gpu/src/host.rs):
    • Queries IDXGIFactory5::CheckFeatureSupport(DXGI_FEATURE_PRESENT_ALLOW_TEARING) unless VICTORY_TEARING=0, passes DXGI_SWAP_CHAIN_FLAG_ALLOW_TEARING at swap-chain creation and ResizeBuffers, and presents with DXGI_PRESENT_ALLOW_TEARING (eliminating vblank wait rounding in foreground independent-flip windows).
    • If any Present(..., DXGI_PRESENT_ALLOW_TEARING) call returns an error, automatically falls back to DXGI_PRESENT(0) for the rest of the run and logs once.
    • Added unit test host::tests::tearing_chain_flags_match_support.
  2. Underwater shader 926c46bab3b86bd6 recovery (crates/victory-shader/src/emit/mod.rs):
    • emit() now retries a failing loops_wave compute shader once with LOOPS_OFF enabled via an RAII LoopsOffGuard (resetting thread-local state safely on return/unwind).
    • Offline verification recovers water_shading:CS_TransmissionVolumetricsSubmerged_bbfb2953_Wrapped (#926c46bab3b86bd6), emitting 1cd47a933c4cc838, validating with dxil.dll 10.0.22000.0, and building a D3D12 compute PSO on RTX 4060 Ti.
    • Live smoke test confirms 926c46bab3b86bd6 no longer fails at boot (untranslated_total=1, critical_fails=0).

Rig Specs Tested On

  • CPU: Intel Core i7-13700F (13th Gen)
  • GPU & VRAM: NVIDIA GeForce RTX 4060 Ti (8 GiB VRAM)
  • System RAM: 32 GiB (33,304,932 KiB)
  • OS & GPU Driver: Windows 11 Home 10.0.26300 / NVIDIA Driver 32.0.16.2124

Run Settings & Profile

  • Build & Commit SHA: diag & release (RUSTFLAGS='-C link-self-contained=yes') @ 0be1878 (feat/iter26-dxgi-tearing-and-underwater-fallback)
  • Console Profile & Internal Resolution / Scale: series-s (unattended launch smoke test via verify-live.ps1)
  • Ray Tracing: Standard preset (VICTORY_EARLY_DEPTH=1, unattended menu/intro only)
  • Upscaling: DLSS quality (VICTORY_DLSS=1, VICTORY_DLSS_MODE=quality, Streamline loaded)
  • Frame Generation: off
  • Launcher Command / Preset & Extra VICTORY_* Overrides:
    • Unattended smoke test: D:\victory-build\minivi\diag\victory.exe run --execute --console series-s ... via verify-live.ps1.
    • Offline real shader check: VICTORY_HOST_MAX_WAVE=32 VICTORY_WAVE_WHY=1 VICTORY_TRANSLATE_ONLY=926c46bab3b86bd6 victory.exe translate ... --validate --pipelines --list.
  • Scene / Area & Session Length: Unattended 35s smoke test (11 draws/frame, 3 active windows) + offline 926c46bab3b86bd6 translation/validation/PSO verification (interactive underwater diving was not playtested here).

Measurements & Verification

  • Base FPS (without Frame Gen): 30.0 fps (33.3 ms/frame) in unattended smoke test (11 draws/frame, 0 dropped), logged swap chain: frames shown as soon as presented ... tearing=true
  • Frame-Gen FPS (if enabled): N/A (off)
  • VRAM / RAM Usage: 610 indexed textures / 181 MB uploaded, 0 passed over unmapped
  • Crashes / DRED Resets: 0 (verify-live.ps1 7/7 [PASS], critical_fails=0, untranslated_total=1, non_system_mingw_dlls=0 on both release and diag)
  • Automated Checks:
    • cargo +1.98.1-x86_64-pc-windows-gnu run -p xtask -- policy (294 files ok)
    • cargo +1.98.1-x86_64-pc-windows-gnu test -p xtask (6 passed; 0 failed)
    • cargo +1.98.1-x86_64-pc-windows-gnu clippy --workspace --all-targets -- -D warnings (0 warnings)
    • cargo +1.98.1-x86_64-pc-windows-gnu clippy --workspace --all-targets --features diagnostics -- -D warnings (0 warnings)
    • cargo +1.98.1-x86_64-pc-windows-gnu test -p victory-shader -- --test-threads=1 wave64_tests (12 passed; 0 failed)
    • cargo +1.98.1-x86_64-pc-windows-gnu test -p victory-gpu -- --test-threads=1 (449 passed; 0 failed; 36 ignored, including host::tests::tearing_chain_flags_match_support)
    • Full victory-shader run (deferred to GitHub Actions CI due to pre-existing local Windows SDK 10.0.22000.0\x64\dxil.dll PSV0 rejections on 3 untouched tests)
<!-- greyfinch-sync:Androtim/MiniVI:issue:5536303662 --> Imported from [Androtim/MiniVI](https://github.com/Androtim/MiniVI/pull/11). Originally posted by [Androtim](https://github.com/Androtim) on 2026-11-28T03:38:16Z. --- ## Summary Ports DXGI `ALLOW_TEARING` immediate presentation and the `LOOPS_OFF` wave64 underwater compute shader fallback from `trustno1-coder/VIctory-NVIDIA` (`8fc2254`), while keeping zero merge conflicts with open PRs `#2`–`#10` (note: the `play.rs` and `host/menu.rs` pieces of `b4e1b08`/`8fc2254` are deferred until PR `#5` merges). 1. **DXGI immediate presentation (`crates/victory-gpu/src/host.rs`):** - Queries `IDXGIFactory5::CheckFeatureSupport(DXGI_FEATURE_PRESENT_ALLOW_TEARING)` unless `VICTORY_TEARING=0`, passes `DXGI_SWAP_CHAIN_FLAG_ALLOW_TEARING` at swap-chain creation and `ResizeBuffers`, and presents with `DXGI_PRESENT_ALLOW_TEARING` (eliminating vblank wait rounding in foreground independent-flip windows). - If any `Present(..., DXGI_PRESENT_ALLOW_TEARING)` call returns an error, automatically falls back to `DXGI_PRESENT(0)` for the rest of the run and logs once. - Added unit test `host::tests::tearing_chain_flags_match_support`. 2. **Underwater shader `926c46bab3b86bd6` recovery (`crates/victory-shader/src/emit/mod.rs`):** - `emit()` now retries a failing `loops_wave` compute shader once with `LOOPS_OFF` enabled via an RAII `LoopsOffGuard` (resetting thread-local state safely on return/unwind). - Offline verification recovers `water_shading:CS_TransmissionVolumetricsSubmerged_bbfb2953_Wrapped` (`#926c46bab3b86bd6`), emitting `1cd47a933c4cc838`, validating with `dxil.dll 10.0.22000.0`, and building a D3D12 compute PSO on RTX 4060 Ti. - Live smoke test confirms `926c46bab3b86bd6` no longer fails at boot (`untranslated_total=1`, `critical_fails=0`). ## Rig Specs Tested On - **CPU:** Intel Core i7-13700F (13th Gen) - **GPU & VRAM:** NVIDIA GeForce RTX 4060 Ti (8 GiB VRAM) - **System RAM:** 32 GiB (`33,304,932` KiB) - **OS & GPU Driver:** Windows 11 Home `10.0.26300` / NVIDIA Driver `32.0.16.2124` ## Run Settings & Profile - **Build & Commit SHA:** `diag` & `release` (`RUSTFLAGS='-C link-self-contained=yes'`) @ `0be1878` (`feat/iter26-dxgi-tearing-and-underwater-fallback`) - **Console Profile & Internal Resolution / Scale:** `series-s` (unattended launch smoke test via `verify-live.ps1`) - **Ray Tracing:** Standard preset (`VICTORY_EARLY_DEPTH=1`, unattended menu/intro only) - **Upscaling:** `DLSS quality` (`VICTORY_DLSS=1`, `VICTORY_DLSS_MODE=quality`, `Streamline` loaded) - **Frame Generation:** `off` - **Launcher Command / Preset & Extra `VICTORY_*` Overrides:** - Unattended smoke test: `D:\victory-build\minivi\diag\victory.exe run --execute --console series-s ...` via `verify-live.ps1`. - Offline real shader check: `VICTORY_HOST_MAX_WAVE=32 VICTORY_WAVE_WHY=1 VICTORY_TRANSLATE_ONLY=926c46bab3b86bd6 victory.exe translate ... --validate --pipelines --list`. - **Scene / Area & Session Length:** Unattended 35s smoke test (`11 draws/frame`, 3 active windows) + offline `926c46bab3b86bd6` translation/validation/PSO verification (interactive underwater diving was **not** playtested here). ## Measurements & Verification - **Base FPS (without Frame Gen):** `30.0 fps` (`33.3 ms/frame`) in unattended smoke test (`11 draws/frame`, `0 dropped`), logged `swap chain: frames shown as soon as presented ... tearing=true` - **Frame-Gen FPS (if enabled):** N/A (`off`) - **VRAM / RAM Usage:** `610` indexed textures / `181 MB` uploaded, `0` passed over unmapped - **Crashes / DRED Resets:** `0` (`verify-live.ps1` `7/7 [PASS]`, `critical_fails=0`, `untranslated_total=1`, `non_system_mingw_dlls=0` on both `release` and `diag`) - **Automated Checks:** - [x] `cargo +1.98.1-x86_64-pc-windows-gnu run -p xtask -- policy` (`294 files ok`) - [x] `cargo +1.98.1-x86_64-pc-windows-gnu test -p xtask` (`6 passed; 0 failed`) - [x] `cargo +1.98.1-x86_64-pc-windows-gnu clippy --workspace --all-targets -- -D warnings` (`0 warnings`) - [x] `cargo +1.98.1-x86_64-pc-windows-gnu clippy --workspace --all-targets --features diagnostics -- -D warnings` (`0 warnings`) - [x] `cargo +1.98.1-x86_64-pc-windows-gnu test -p victory-shader -- --test-threads=1 wave64_tests` (`12 passed; 0 failed`) - [x] `cargo +1.98.1-x86_64-pc-windows-gnu test -p victory-gpu -- --test-threads=1` (`449 passed; 0 failed; 36 ignored`, including `host::tests::tearing_chain_flags_match_support`) - [ ] Full `victory-shader` run (deferred to GitHub Actions CI due to pre-existing local Windows SDK `10.0.22000.0\x64\dxil.dll` PSV0 rejections on 3 untouched tests)
Androtim commented 2026-11-28 03:42:34 +00:00 (Migrated from github.com)

Imported from Androtim/MiniVI. Originally posted by Androtim on 2026-11-28T03:42:34Z.


CI passed cleanly: https://github.com/Androtim/MiniVI/actions/runs/46103814315

Verified checks on 0be1878:

  • GitHub Actions CI: check SUCCESS
  • xtask policy (294 files ok) & xtask test (6 passed)
  • clippy default & diagnostics (0 warnings)
  • victory-shader wave64_tests (12 passed) & victory-gpu (449 passed; 0 failed)
  • Standalone release & diag builds (non_system_mingw_dlls=0)
  • Offline check: water_shading:CS_TransmissionVolumetricsSubmerged (#926c46bab3b86bd6) emitted, validated with dxil.dll, and built D3D12 PSO on RTX 4060 Ti (WAVE-LOOPS left out)
  • Live smoke test (verify-live.ps1): 7/7 [PASS], tearing=true, untranslated_total=1, critical_fails=0, 30.0 fps, 0 DRED
<!-- greyfinch-sync:Androtim/MiniVI:comment:7233302997 --> Imported from [Androtim/MiniVI](https://github.com/Androtim/MiniVI/pull/11#issuecomment-7233302997). Originally posted by [Androtim](https://github.com/Androtim) on 2026-11-28T03:42:34Z. --- CI passed cleanly: https://github.com/Androtim/MiniVI/actions/runs/46103814315 Verified checks on `0be1878`: - GitHub Actions CI: `check` **SUCCESS** - `xtask policy` (294 files ok) & `xtask test` (6 passed) - `clippy` default & `diagnostics` (0 warnings) - `victory-shader` `wave64_tests` (12 passed) & `victory-gpu` (449 passed; 0 failed) - Standalone `release` & `diag` builds (`non_system_mingw_dlls=0`) - Offline check: `water_shading:CS_TransmissionVolumetricsSubmerged` (`#926c46bab3b86bd6`) emitted, validated with `dxil.dll`, and built D3D12 PSO on RTX 4060 Ti (`WAVE-LOOPS left out`) - Live smoke test (`verify-live.ps1`): 7/7 `[PASS]`, `tearing=true`, `untranslated_total=1`, `critical_fails=0`, 30.0 fps, 0 DRED
Androtim commented 2026-11-28 04:03:16 +00:00 (Migrated from github.com)

Imported from Androtim/MiniVI. Originally posted by Androtim on 2026-11-28T04:03:16Z.


Automated triage for the maintainers (not an approval).

Verdict: needs-gpu-test · CI (check): passing

Review Summary

CI is passing, and both changes in this PR are clean, well-scoped, and sound:

  1. DXGI ALLOW_TEARING immediate present (crates/victory-gpu/src/host.rs)

    • tearing() queries IDXGIFactory5::CheckFeatureSupport(DXGI_FEATURE_PRESENT_ALLOW_TEARING) using a BOOL-sized output unless VICTORY_TEARING=0.
    • Presenter persists the swap-chain creation flag (tearing) and passes chain_flags(p.tearing) to both CreateSwapChainForHwnd (and streamline::fsr::swap_chain via &desc) and ResizeBuffers, satisfying DXGI's requirement that ALLOW_TEARING flags stay consistent across resizes.
    • Present(0, DXGI_PRESENT_ALLOW_TEARING) gracefully falls back to Present(0, DXGI_PRESENT(0)) and disables presents_tearing for the rest of the run if a tearing present is refused, with one-shot warning logs.
    • Unit test host::tests::tearing_chain_flags_match_support covers chain_flags.
  2. Wave64 LOOPS_OFF compute fallback (crates/victory-shader/src/emit/mod.rs)

    • emit() splits out emit_once() and retries once with thread-local LOOPS_OFF enabled when emit_once() returns Err(ShaderError::Unsupported { .. }) and loops_wave(native) is active.
    • LoopsOffGuard restores the prior LOOPS_OFF value on Drop (panic- and reentrancy-safe), and emit_once() clears thread-local lower::take_needs() at entry so retry state stays clean.
    • If the fallback also fails, the original error (first) is preserved.

Why Local GPU Testing Is Needed

Because this PR modifies D3D12 swap-chain presentation (ALLOW_TEARING / ResizeBuffers / Present) and wave64 compute shader emission (926c46bab3b86bd6), and the PR's unattended smoke test ran with frame generation off and without interactive underwater diving, a local real-GPU test is warranted before merging:

  • Verify interactive underwater diving renders cleanly without white flares (confirming 926c46bab3b86bd6 behavior in-game).
  • Verify foreground windowed ALLOW_TEARING present, window resizing (ResizeBuffers), VICTORY_TEARING=0 fallback, and compatibility with DLSS/FSR3 frame generation swap chains if enabled.

Generated with Antigravity CLI (agy).

<!-- greyfinch-sync:Androtim/MiniVI:comment:7233637630 --> Imported from [Androtim/MiniVI](https://github.com/Androtim/MiniVI/pull/11#issuecomment-7233637630). Originally posted by [Androtim](https://github.com/Androtim) on 2026-11-28T04:03:16Z. --- <!-- minivi-triage v1 head=0be18787dd625220538626d650466017257f1eef verdict=needs-gpu-test ci=passing at=2026-11-28T04:03:42Z --> Automated triage for the maintainers (not an approval). **Verdict:** `needs-gpu-test` · **CI (`check`):** `passing` ### Review Summary CI is passing, and both changes in this PR are clean, well-scoped, and sound: 1. **DXGI `ALLOW_TEARING` immediate present (`crates/victory-gpu/src/host.rs`)** - `tearing()` queries `IDXGIFactory5::CheckFeatureSupport(DXGI_FEATURE_PRESENT_ALLOW_TEARING)` using a `BOOL`-sized output unless `VICTORY_TEARING=0`. - `Presenter` persists the swap-chain creation flag (`tearing`) and passes `chain_flags(p.tearing)` to both `CreateSwapChainForHwnd` (and `streamline::fsr::swap_chain` via `&desc`) and `ResizeBuffers`, satisfying DXGI's requirement that `ALLOW_TEARING` flags stay consistent across resizes. - `Present(0, DXGI_PRESENT_ALLOW_TEARING)` gracefully falls back to `Present(0, DXGI_PRESENT(0))` and disables `presents_tearing` for the rest of the run if a tearing present is refused, with one-shot warning logs. - Unit test `host::tests::tearing_chain_flags_match_support` covers `chain_flags`. 2. **Wave64 `LOOPS_OFF` compute fallback (`crates/victory-shader/src/emit/mod.rs`)** - `emit()` splits out `emit_once()` and retries once with thread-local `LOOPS_OFF` enabled when `emit_once()` returns `Err(ShaderError::Unsupported { .. })` and `loops_wave(native)` is active. - `LoopsOffGuard` restores the prior `LOOPS_OFF` value on `Drop` (panic- and reentrancy-safe), and `emit_once()` clears thread-local `lower::take_needs()` at entry so retry state stays clean. - If the fallback also fails, the original error (`first`) is preserved. ### Why Local GPU Testing Is Needed Because this PR modifies D3D12 swap-chain presentation (`ALLOW_TEARING` / `ResizeBuffers` / `Present`) and wave64 compute shader emission (`926c46bab3b86bd6`), and the PR's unattended smoke test ran with frame generation off and without interactive underwater diving, a local real-GPU test is warranted before merging: - Verify interactive underwater diving renders cleanly without white flares (confirming `926c46bab3b86bd6` behavior in-game). - Verify foreground windowed `ALLOW_TEARING` present, window resizing (`ResizeBuffers`), `VICTORY_TEARING=0` fallback, and compatibility with DLSS/FSR3 frame generation swap chains if enabled. --- _Generated with Antigravity CLI (`agy`)._
Androtim commented 2026-11-28 21:11:10 +00:00 (Migrated from github.com)

Imported from Androtim/MiniVI. Originally posted by Androtim on 2026-11-28T21:11:10Z.


Real-GPU Playtest Report (Combined Build 1 Stack — RT OFF)

Tested in combined Build 1 (origin/main + Build 1 PRs #2, #3, #4, #6, #7, #9, #10, #11, #12, #14, #15, #18, #19, #22, #25, #26, #27, #33, #34, #36, #40, #43, #44, #46) on NVIDIA GeForce RTX 4060 Ti (8 GB), Windows, Series S (quality-720p, DLSS Quality):

  • Duration & Stability: 21-minute open-world session (1a-build1-world.log) — 0 crashes, 0 DRED resets, clean exit.
  • Performance: 28.2 fps (35.4 ms/frame) mid-run, 16.9 fps (59.3 ms/frame, 4,446 draws/frame) in heavy scene.
  • Key Subsystems Verified in Logs:
    • Swap chain / tearing: tearing=true, 0 refused presents.
    • Underwater compute (926c46bab3b86bd6): Translated and built host PSO cleanly.
    • Descriptor slots (VICTORY_THIN_GATE): Active (0 no free dynamic descriptor slots warnings).
    • VRAM & texture pool: Bounded at 6,934 MB in use (33 texture blocks = 2,112 MB, 1,036 MB free), 0 bogus POOL: errors.
    • DLSS: 16,577 upscalings (0 failed).
  • Visual observation during heavy initial streaming: Character top briefly appeared solid black while 8,802 textures were still queued / 206 non-RT draws dropped without a host pipeline; no D3D12 errors.
<!-- greyfinch-sync:Androtim/MiniVI:comment:7245833931 --> Imported from [Androtim/MiniVI](https://github.com/Androtim/MiniVI/pull/11#issuecomment-7245833931). Originally posted by [Androtim](https://github.com/Androtim) on 2026-11-28T21:11:10Z. --- ### Real-GPU Playtest Report (Combined Build 1 Stack — RT OFF) Tested in combined Build 1 (`origin/main` + Build 1 PRs `#2, #3, #4, #6, #7, #9, #10, #11, #12, #14, #15, #18, #19, #22, #25, #26, #27, #33, #34, #36, #40, #43, #44, #46`) on **NVIDIA GeForce RTX 4060 Ti (8 GB), Windows, Series S (`quality-720p`, DLSS Quality)**: - **Duration & Stability:** **21-minute** open-world session (`1a-build1-world.log`) — **0 crashes, 0 DRED resets**, clean exit. - **Performance:** `28.2 fps` (`35.4 ms/frame`) mid-run, `16.9 fps` (`59.3 ms/frame`, `4,446` draws/frame) in heavy scene. - **Key Subsystems Verified in Logs:** - **Swap chain / tearing:** `tearing=true`, `0` refused presents. - **Underwater compute (`926c46bab3b86bd6`):** Translated and built host PSO cleanly. - **Descriptor slots (`VICTORY_THIN_GATE`):** Active (`0` `no free dynamic descriptor slots` warnings). - **VRAM & texture pool:** Bounded at `6,934 MB` in use (`33` texture blocks = `2,112 MB`, `1,036 MB` free), `0` bogus `POOL:` errors. - **DLSS:** `16,577` upscalings (`0` failed). - **Visual observation during heavy initial streaming:** Character top briefly appeared solid black while `8,802` textures were still queued / `206` non-RT draws dropped without a host pipeline; no D3D12 errors.
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!11
No description provided.