shader(lower): pass undef for unused array/1D calculateLOD coords #76

Manually merged
github merged 1 commit from gh-pr/76/head into gh-pr/76/base 2026-12-01 20:07:02 +00:00
Owner

@⁠Androtim on GitHub · 2026-11-29 04:14 UTC · original
Androtim:feat/iter76-div-fixup-and-array-lod → main · +103 −2 · 2 files · 1 commits · merged 2026-11-29 07:06 UTC

Summary

Extracts the remaining non-conflicting calculateLOD fix from the earlier consolidated shader branch (note: _div_fixup_f32 zero/infinity priority from commit 7ee9045 is already on main via PR #18, and the signature/mesh-interpolation changes are untouched so there is zero overlap with PR #63):

  • calculateLOD out-of-bounds/array coords (crates/victory-shader/src/emit/lower.rs): Sets c1 = undef for 1D arrays (kind == 6) and c2 = undef for 1D/2D arrays (kind == 6 | 7) in dx.op.calculateLOD.f32, matching DXIL validation requirements where array slice coordinates are omitted from LOD coordinate arguments.
  • Regression test (crates/victory-shader/src/emit/mod.rs): Adds rray_calculate_lod_passes_undef_for_slice_coord covering image_get_lod on Texture2DArray (dim=5) with DXIL validation.

Rig Specs Tested On

  • CPU: Intel Core i7-13700F
  • GPU & VRAM: NVIDIA GeForce RTX 4060 Ti (8 GiB VRAM)
  • System RAM: 32 GiB
  • OS & GPU Driver: Windows 11 Build 26300, NVIDIA driver 32.0.16.2124

Run Settings & Profile

  • Build & Commit SHA: plain --release & --features diagnostics @ $sha
  • Console Profile & Internal Resolution / Scale: series-s — quality (
**@⁠Androtim** on GitHub · 2026-11-29 04:14 UTC · [original](https://github.com/Androtim/MiniVI/pull/76) `Androtim:feat/iter76-div-fixup-and-array-lod` → `main` · +103 −2 · 2 files · 1 commits · merged 2026-11-29 07:06 UTC ## Summary Extracts the remaining non-conflicting calculateLOD fix from the earlier consolidated shader branch (note: _div_fixup_f32 zero/infinity priority from commit 7ee9045 is already on main via PR #18, and the signature/mesh-interpolation changes are untouched so there is zero overlap with PR #63): - **calculateLOD out-of-bounds/array coords (crates/victory-shader/src/emit/lower.rs):** Sets c1 = undef for 1D arrays (kind == 6) and c2 = undef for 1D/2D arrays (kind == 6 | 7) in dx.op.calculateLOD.f32, matching DXIL validation requirements where array slice coordinates are omitted from LOD coordinate arguments. - **Regression test (crates/victory-shader/src/emit/mod.rs):** Adds rray_calculate_lod_passes_undef_for_slice_coord covering image_get_lod on Texture2DArray (dim=5) with DXIL validation. ## Rig Specs Tested On - **CPU:** Intel Core i7-13700F - **GPU & VRAM:** NVIDIA GeForce RTX 4060 Ti (8 GiB VRAM) - **System RAM:** 32 GiB - **OS & GPU Driver:** Windows 11 Build 26300, NVIDIA driver 32.0.16.2124 ## Run Settings & Profile - **Build & Commit SHA:** plain --release & --features diagnostics @ $sha - **Console Profile & Internal Resolution / Scale:** series-s — quality (
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-01 20:07:01 +00:00
github manually merged commit 6d853e3af5 into gh-pr/76/base 2026-12-01 20:07:02 +00:00
Author
Owner

@⁠Androtim on GitHub · 2026-11-29 04:15 UTC · original · edited 2026-11-29 05:03 UTC

Automated triage for the maintainers (not an approval).

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

Review Summary

Logic and scope look clean and well-targeted:

  • crates/victory-shader/src/emit/lower.rs (op == 81 / dx.op.calculateLOD.f32): Properly masks out the array slice coordinate with undef for Texture1DArray (kind == 6, setting c1 and c2 to undef) and Texture2DArray (kind == 7, setting c2 to undef). Non-array 1D/2D dimensions already initialize unused slots of cs to fu (undef), 3D passes all three spatial coordinates, and cubes (kind == 5) are already rejected at line 12312.
  • crates/victory-shader/src/emit/mod.rs (array_calculate_lod_passes_undef_for_slice_coord): Adds a focused regression test for image_get_lod on a 2D array (dim=5) with optional DXIL validation matching the existing test pattern.
  • No overlap with other open PRs (e.g. #75, #77). CI is passing.

Minor Nits (non-blocking)

  • let fu = self.s.m.undef(f32t); shadows the identical let fu = self.s.m.undef(self.s.t.f32); already in scope at line 12248 of crates/victory-shader/src/emit/lower.rs.
  • array_calculate_lod_passes_undef_for_slice_coord is placed inside mod atomic_tests in crates/victory-shader/src/emit/mod.rs rather than a dedicated/general emit test module.

Next Step

Because this modifies emitted DXIL shader lowering (calculateLOD.f32) and Validator::load is skipped if dxil.dll is unavailable in CI, a quick local Windows/GPU validation + smoke test is recommended before merging.


Generated with Antigravity CLI (agy).

**@⁠Androtim** on GitHub · 2026-11-29 04:15 UTC · [original](https://github.com/Androtim/MiniVI/pull/76#issuecomment-7250545860) · edited 2026-11-29 05:03 UTC <!-- minivi-triage v1 head=6d853e3af5b0359bd02b86f08b79228507143ca8 verdict=needs-gpu-test ci=passing at=2026-11-29T05:03:35Z --> Automated triage for the maintainers (not an approval). **Verdict:** `needs-gpu-test` · **CI (`check`):** `passing` ### Review Summary Logic and scope look clean and well-targeted: - **`crates/victory-shader/src/emit/lower.rs` (`op == 81` / `dx.op.calculateLOD.f32`)**: Properly masks out the array slice coordinate with `undef` for `Texture1DArray` (`kind == 6`, setting `c1` and `c2` to `undef`) and `Texture2DArray` (`kind == 7`, setting `c2` to `undef`). Non-array 1D/2D dimensions already initialize unused slots of `cs` to `fu` (`undef`), 3D passes all three spatial coordinates, and cubes (`kind == 5`) are already rejected at line 12312. - **`crates/victory-shader/src/emit/mod.rs` (`array_calculate_lod_passes_undef_for_slice_coord`)**: Adds a focused regression test for `image_get_lod` on a 2D array (`dim=5`) with optional DXIL validation matching the existing test pattern. - **No overlap** with other open PRs (e.g. #75, #77). CI is passing. ### Minor Nits (non-blocking) - `let fu = self.s.m.undef(f32t);` shadows the identical `let fu = self.s.m.undef(self.s.t.f32);` already in scope at line 12248 of `crates/victory-shader/src/emit/lower.rs`. - `array_calculate_lod_passes_undef_for_slice_coord` is placed inside `mod atomic_tests` in `crates/victory-shader/src/emit/mod.rs` rather than a dedicated/general emit test module. ### Next Step Because this modifies emitted DXIL shader lowering (`calculateLOD.f32`) and `Validator::load` is skipped if `dxil.dll` is unavailable in CI, a quick local Windows/GPU validation + smoke test is recommended before merging. --- _Generated with Antigravity CLI (`agy`)._
Author
Owner

@⁠Androtim on GitHub · 2026-11-29 06:58 UTC · original

Completed local shader/DXIL validation and live 75s Series S GPU verification on 6d853e3 (pr76-div-fixup-array-lod):

  • cargo test -p victory-shader --lib --locked -- array_calculate_lod_passes_undef_for_slice_coord --nocapture: 1 passed; 0 failed (dxil.dll present in Windows Kits 10.0.22000.0\x64).
  • Live 75s Series S RTX 4060 Ti 8 GiB run: 11/11 gates PASS
    • Median FPS: 11.55 fps (86.6 ms, vs 8.9 fps baseline, +2.65 fps)
    • Max VRAM: 5758 MB / 6642 MB budget (over=0 MB, vs 5864 MB baseline, -106 MB)
    • Waiting textures: 3467 (vs 7121 baseline) | mapped() stall rate: 8.27 ms/s
    • Shader translation: untranslated=1 | Crashes / host texture errors: 0 / 0
    • Visually inspected 24 captured frames (frame-7830.png, frame-7918.png, median luma 103.43, edge energy 7.1, 0.0% near-black/magenta): clean daylight rendering with no artifacts.
**@⁠Androtim** on GitHub · 2026-11-29 06:58 UTC · [original](https://github.com/Androtim/MiniVI/pull/76#issuecomment-7252180638) Completed local shader/DXIL validation and live 75s Series S GPU verification on `6d853e3` (`pr76-div-fixup-array-lod`): - `cargo test -p victory-shader --lib --locked -- array_calculate_lod_passes_undef_for_slice_coord --nocapture`: **1 passed; 0 failed** (`dxil.dll` present in Windows Kits `10.0.22000.0\x64`). - Live 75s Series S RTX 4060 Ti 8 GiB run: **11/11 gates PASS** - Median FPS: `11.55 fps` (`86.6 ms`, vs `8.9 fps` baseline, `+2.65 fps`) - Max VRAM: `5758 MB` / `6642 MB` budget (`over=0 MB`, vs `5864 MB` baseline, `-106 MB`) - Waiting textures: `3467` (vs `7121` baseline) | `mapped()` stall rate: `8.27 ms/s` - Shader translation: `untranslated=1` | Crashes / host texture errors: `0` / `0` - Visually inspected 24 captured frames (`frame-7830.png`, `frame-7918.png`, median luma `103.43`, edge energy `7.1`, `0.0%` near-black/magenta): clean daylight rendering with no artifacts.
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!76
No description provided.