shader: cover all 256 scalar codes in ir::unspill table #28

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

@⁠Androtim on GitHub · 2026-11-28 08:47 UTC · original
Androtim:feat/iter43-ir-scalar-code-bounds → main · +18 −1 · 1 files · 1 commits · closed without merging

Summary

Port fxceless/victory-fork 2f3f399 (PR #1495) into crates/victory-shader/src/ir.rs:

  • Widens used from [false; 128] to [false; 256] inside unspill() so Reg::S(c) codes >= 128 (constants / NULL) encountered during scalar-parking analysis cannot index past the end of the table and panic.
  • Adds unit regression test ir::tests::scalar_codes_past_the_registers_do_not_panic.

Rig Specs Tested On

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

Run Settings & Profile

  • Build & Commit SHA: release @ c2e1988 (targeted shader IR unit-test & static build verification; no runtime behavior change for shaders already within bounds)
  • Console Profile & Internal Resolution / Scale: N/A (unit-tested shader IR fix; full CI suite runs victory-shader + victory-gpu on windows-latest)
  • Ray Tracing: N/A
  • Upscaling: N/A
  • Frame Generation: N/A
  • Launcher Command / Preset & Extra VICTORY_* Overrides: N/A
  • Scene / Area & Session Length: N/A

Measurements & Verification

  • Base FPS (without Frame Gen): N/A (unit-tested shader IR bounds fix)
  • Frame-Gen FPS (if enabled): N/A
  • VRAM / RAM Usage: N/A
  • Crashes / DRED Resets: N/A
  • Automated Checks:
    • cargo +1.98.1-x86_64-pc-windows-gnu run -p xtask -- policy (asset 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 victory-gpu/diagnostics -- -D warnings (0 warnings)
    • cargo +1.98.1-x86_64-pc-windows-gnu test -p victory-shader --lib ir::tests (11 passed; 0 failed, including scalar_codes_past_the_registers_do_not_panic)
    • Plain release build cargo +1.98.1-x86_64-pc-windows-gnu build --release -p victory (objdump -p: 0 non-system MinGW DLLs)
**@⁠Androtim** on GitHub · 2026-11-28 08:47 UTC · [original](https://github.com/Androtim/MiniVI/pull/28) `Androtim:feat/iter43-ir-scalar-code-bounds` → `main` · +18 −1 · 1 files · 1 commits · closed without merging ## Summary Port `fxceless/victory-fork` `2f3f399` (PR #1495) into `crates/victory-shader/src/ir.rs`: - Widens `used` from `[false; 128]` to `[false; 256]` inside `unspill()` so `Reg::S(c)` codes `>= 128` (constants / `NULL`) encountered during scalar-parking analysis cannot index past the end of the table and panic. - Adds unit regression test `ir::tests::scalar_codes_past_the_registers_do_not_panic`. ## Rig Specs Tested On - **CPU:** 13th Gen Intel(R) Core(TM) i7-13700F - **GPU & VRAM:** NVIDIA GeForce RTX 4060 Ti (8 GiB VRAM) - **System RAM:** 32 GiB - **OS & GPU Driver:** Windows 11 Home (Build 26300), NVIDIA Driver 32.0.16.2124 ## Run Settings & Profile - **Build & Commit SHA:** `release` @ `c2e1988` (targeted shader IR unit-test & static build verification; no runtime behavior change for shaders already within bounds) - **Console Profile & Internal Resolution / Scale:** N/A (unit-tested shader IR fix; full CI suite runs `victory-shader` + `victory-gpu` on `windows-latest`) - **Ray Tracing:** N/A - **Upscaling:** N/A - **Frame Generation:** N/A - **Launcher Command / Preset & Extra `VICTORY_*` Overrides:** N/A - **Scene / Area & Session Length:** N/A ## Measurements & Verification - **Base FPS (without Frame Gen):** N/A (unit-tested shader IR bounds fix) - **Frame-Gen FPS (if enabled):** N/A - **VRAM / RAM Usage:** N/A - **Crashes / DRED Resets:** N/A - **Automated Checks:** - [x] `cargo +1.98.1-x86_64-pc-windows-gnu run -p xtask -- policy` (`asset 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 victory-gpu/diagnostics -- -D warnings` (`0` warnings) - [x] `cargo +1.98.1-x86_64-pc-windows-gnu test -p victory-shader --lib ir::tests` (`11 passed; 0 failed`, including `scalar_codes_past_the_registers_do_not_panic`) - [x] Plain release build `cargo +1.98.1-x86_64-pc-windows-gnu build --release -p victory` (`objdump -p`: `0` non-system MinGW DLLs)
Port fxceless/victory-fork 2f3f399 (PR #1495): widen used from [false; 128] to [false; 256] in crates/victory-shader/src/ir.rs unspill() so scalar destination/operand codes >= 128 (inline constants / NULL) alongside v_writelane_b32 parking do not panic out of bounds, and add regression test ir::tests::scalar_codes_past_the_registers_do_not_panic.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-01 20:03:05 +00:00
github-bot closed this pull request 2026-12-01 20:03:05 +00:00
Author
Owner

@⁠Androtim on GitHub · 2026-11-28 10:04 UTC · original

Automated triage for the maintainers (not an approval).

Verdict: proposed-close · CI (check): passing

Technical Review

  • Change (crates/victory-shader/src/ir.rs, unspill): Widens used from [false; 128] to [false; 256] so Reg::S(c) => used[usize::from(c)] = true (line 336) cannot panic on u8 scalar codes >= 128 (constants / NULL).
  • Safety check: used is only read in plan at lines 544–546 (for c in (0..105).chain(108..=123) { free[c] = !used[c]; }), so widening the array does not alter scratch-register allocation or behavior for in-bounds shaders.
  • Test coverage: Adds ir::tests::scalar_codes_past_the_registers_do_not_panic, which pairs v_writelane_b32 v1, s0, 0 (PARK) with three wave32/wave64 instruction encodings through build(&code, wave64, 256). CI is passing.

Verdict: Proposed Close (Duplicate of #8)

The patch itself is clean and minimal, and does not require a local GPU test, but it duplicates open PR #8 (Iter 23: Fix scalar code bounds panic in ir::unspill), which targets the same bounds panic in ir::unspill. Recommend closing one of #8 or #28 depending on which branch/history is preferred for merge.


Generated with Antigravity CLI (agy).

**@⁠Androtim** on GitHub · 2026-11-28 10:04 UTC · [original](https://github.com/Androtim/MiniVI/pull/28#issuecomment-7237652962) <!-- minivi-triage v1 head=c2e19887ded7754431d486a485bd6055e1e3540d verdict=proposed-close ci=passing at=2026-11-28T10:04:51Z --> Automated triage for the maintainers (not an approval). **Verdict:** `proposed-close` · **CI (`check`):** `passing` ### Technical Review - **Change (`crates/victory-shader/src/ir.rs`, `unspill`)**: Widens `used` from `[false; 128]` to `[false; 256]` so `Reg::S(c) => used[usize::from(c)] = true` (line 336) cannot panic on `u8` scalar codes `>= 128` (constants / `NULL`). - **Safety check**: `used` is only read in `plan` at lines 544–546 (`for c in (0..105).chain(108..=123) { free[c] = !used[c]; }`), so widening the array does not alter scratch-register allocation or behavior for in-bounds shaders. - **Test coverage**: Adds `ir::tests::scalar_codes_past_the_registers_do_not_panic`, which pairs `v_writelane_b32 v1, s0, 0` (`PARK`) with three wave32/wave64 instruction encodings through `build(&code, wave64, 256)`. CI is passing. ### Verdict: Proposed Close (Duplicate of #8) The patch itself is clean and minimal, and does not require a local GPU test, but it duplicates open PR #8 (`Iter 23: Fix scalar code bounds panic in ir::unspill`), which targets the same bounds panic in `ir::unspill`. Recommend closing one of #8 or #28 depending on which branch/history is preferred for merge. --- _Generated with Antigravity CLI (`agy`)._
Author
Owner

@⁠Androtim on GitHub · 2026-11-28 21:18 UTC · original

Closing as superseded duplicate of merged PR #8.

**@⁠Androtim** on GitHub · 2026-11-28 21:18 UTC · [original](https://github.com/Androtim/MiniVI/pull/28#issuecomment-7245918852) Closing as superseded duplicate of merged PR #8.

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