fix(gpu,shader): prepare head blend-shape map early and exempt face LDS bounds (#276) #381

Merged
Androtim merged 1 commit from upstream-pr/381 into main 2026-12-04 04:21:45 +00:00
Androtim commented 2026-12-03 08:51:05 +00:00 (Migrated from github.com)

Imported from Androtim/MiniVI. Originally posted by Androtim on 2026-12-03T08:51:05Z.


Root Cause

  • Cold-cache missing character head (61e54e90adccaf6a): Compute program \61e54e90adccaf6a\ builds character heads' blend-shape mappings in a single one-shot dispatch at character load. Because it was missing from \scene_input()\ in \crates/victory-gpu/src/pipeline/make.rs, cold-cache launches queued it behind ~1,000 world shaders past the 80 ms per-frame wait budget, dropping that dispatch and leaving character heads missing. Warm-cache runs on the unchanged binary already compiled \61e54e90adccaf6a\ early and rendered the full head cleanly, proving the four unlowered Wave64 compute shaders were unrelated.
  • Cutscene face LDS clamping (FACE_PROGRAMS): 25 face network and blend-shape normal-reconstruction compute programs index group-shared memory past the size declared in their native headers; clamping them under \VICTORY_LDS_BOUNDS\ zeroes their output.

Changes

  • \crates/victory-gpu/src/pipeline/make.rs: Add \HEAD_BLEND_SHAPE_MAP\ (\61e54e90adccaf6a) to \scene_input()\ (adapted from \TrustNo1/Darner, GPL-3.0) + \ he_head_blend_shape_map_is_made_at_creation\ test.
  • \crates/victory-shader/src/emit/mod.rs, \crates/victory-shader/src/emit/lower.rs, \crates/victory-shader/src/emit/lower_tests.rs: Add \FACE_PROGRAMS\ (25 exact hashes, adapted from \TrustNo1/Darner, GPL-3.0) and \VICTORY_LDS_BOUNDS_EXEMPT\ (exact 16-hex hashes, \ll, or \
<!-- greyfinch-sync:Androtim/MiniVI:issue:5623125879 --> Imported from [Androtim/MiniVI](https://github.com/Androtim/MiniVI/pull/381). Originally posted by [Androtim](https://github.com/Androtim) on 2026-12-03T08:51:05Z. --- ### Root Cause - **Cold-cache missing character head (61e54e90adccaf6a):** Compute program \61e54e90adccaf6a\ builds character heads' blend-shape mappings in a single one-shot dispatch at character load. Because it was missing from \scene_input()\ in \crates/victory-gpu/src/pipeline/make.rs\, cold-cache launches queued it behind ~1,000 world shaders past the 80 ms per-frame wait budget, dropping that dispatch and leaving character heads missing. Warm-cache runs on the unchanged binary already compiled \61e54e90adccaf6a\ early and rendered the full head cleanly, proving the four unlowered Wave64 compute shaders were unrelated. - **Cutscene face LDS clamping (FACE_PROGRAMS):** 25 face network and blend-shape normal-reconstruction compute programs index group-shared memory past the size declared in their native headers; clamping them under \VICTORY_LDS_BOUNDS\ zeroes their output. ### Changes - \crates/victory-gpu/src/pipeline/make.rs\: Add \HEAD_BLEND_SHAPE_MAP\ (\61e54e90adccaf6a\) to \scene_input()\ (adapted from \TrustNo1/Darner\, GPL-3.0) + \ he_head_blend_shape_map_is_made_at_creation\ test. - \crates/victory-shader/src/emit/mod.rs\, \crates/victory-shader/src/emit/lower.rs\, \crates/victory-shader/src/emit/lower_tests.rs\: Add \FACE_PROGRAMS\ (25 exact hashes, adapted from \TrustNo1/Darner\, GPL-3.0) and \VICTORY_LDS_BOUNDS_EXEMPT\ (exact 16-hex hashes, \ll\, or \
Androtim commented 2026-12-03 09:03:15 +00:00 (Migrated from github.com)

Imported from Androtim/MiniVI. Originally posted by Androtim on 2026-12-03T09:03:15Z.


Read-only static audit of 4d35a2bb (CI check PASS): VERIFIED CLEAN (0 [P0], 0 [P1]).

  • pipeline/make.rs: adds HEAD_BLEND_SHAPE_MAP (61e54e90adccaf6a) to scene_input() with unit test verifying creation-time priority.
  • victory-shader/src/emit/{mod.rs,lower.rs}: adds FACE_PROGRAMS (25 exact 16-hex hashes) and VICTORY_LDS_BOUNDS_EXEMPT (default FACE_PROGRAMS, 0 opt-out, exact 16-hex validation) scoped via emit::translate's with_program() guard.
  • shader_cache.rs: adds VICTORY_LDS_BOUNDS_EXEMPT to TRANSLATOR_ENV_KEYS and bumps SHADER_CACHE_VERSION 2 -> 3 with unit tests.

Holding auto-merge solely for the GPU visual verification note (the PR description appears truncated mid-sentence at or \): once cold-cache head rendering + 0 crashes/DRED verification is posted (or manual green-light given), this is ready to merge immediately.

<!-- greyfinch-sync:Androtim/MiniVI:comment:7373107984 --> Imported from [Androtim/MiniVI](https://github.com/Androtim/MiniVI/pull/381#issuecomment-7373107984). Originally posted by [Androtim](https://github.com/Androtim) on 2026-12-03T09:03:15Z. --- Read-only static audit of `4d35a2bb` (**CI `check` PASS**): **VERIFIED CLEAN (0 `[P0]`, 0 `[P1]`)**. - `pipeline/make.rs`: adds `HEAD_BLEND_SHAPE_MAP` (`61e54e90adccaf6a`) to `scene_input()` with unit test verifying creation-time priority. - `victory-shader/src/emit/{mod.rs,lower.rs}`: adds `FACE_PROGRAMS` (25 exact 16-hex hashes) and `VICTORY_LDS_BOUNDS_EXEMPT` (default `FACE_PROGRAMS`, `0` opt-out, exact 16-hex validation) scoped via `emit::translate`'s `with_program()` guard. - `shader_cache.rs`: adds `VICTORY_LDS_BOUNDS_EXEMPT` to `TRANSLATOR_ENV_KEYS` and bumps `SHADER_CACHE_VERSION` `2 -> 3` with unit tests. Holding auto-merge solely for the GPU visual verification note (the PR description appears truncated mid-sentence at `or \`): once cold-cache head rendering + `0` crashes/DRED verification is posted (or manual green-light given), this is ready to merge immediately.
Androtim commented 2026-12-03 19:32:50 +00:00 (Migrated from github.com)

Imported from Androtim/MiniVI. Originally posted by Androtim on 2026-12-03T19:32:50Z.


Marking triage: needs rebase after #402 (158fba11) merged onto main (SHADER_CACHE_VERSION bumped 2 -> 3 in shader_cache.rs; rebase should bump 3 -> 4). Audit Pass #23 was already clean — once rebased with green CI + cold-cache GPU head check, ready to merge!

<!-- greyfinch-sync:Androtim/MiniVI:comment:7389864285 --> Imported from [Androtim/MiniVI](https://github.com/Androtim/MiniVI/pull/381#issuecomment-7389864285). Originally posted by [Androtim](https://github.com/Androtim) on 2026-12-03T19:32:50Z. --- Marking `triage: needs rebase` after `#402` (`158fba11`) merged onto `main` (`SHADER_CACHE_VERSION` bumped `2 -> 3` in `shader_cache.rs`; rebase should bump `3 -> 4`). Audit Pass #23 was already clean — once rebased with green CI + cold-cache GPU head check, ready to merge!
Androtim commented 2026-12-03 20:02:25 +00:00 (Migrated from github.com)

Imported from Androtim/MiniVI. Originally posted by Androtim on 2026-12-03T20:02:25Z.


Automated triage for the maintainers (not an approval).

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

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:7390621862 --> Imported from [Androtim/MiniVI](https://github.com/Androtim/MiniVI/pull/381#issuecomment-7390621862). Originally posted by [Androtim](https://github.com/Androtim) on 2026-12-03T20:02:25Z. --- <!-- minivi-triage v1 head=4d35a2bb3a816659ade214b119c046a08a57d1aa verdict=needs-rebase ci=passing at=2026-12-03T20:03:04Z --> Automated triage for the maintainers (not an approval). **Verdict:** `needs-rebase` · **CI (`check`):** `passing` 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`)._
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!381
No description provided.