shader: seed POPS collision wave_id, decode f16 inline floats, and exclude root constants as bases #696

Manually merged
github merged 1 commit from github-bot/gh-696 into main 2026-11-29 00:28:00 +00:00 AGit
Owner

@⁠mint17 on GitHub · 2026-11-28 03:38 UTC · original
mint17:fix/shader-pops-f16-root-const → main · +503 −7 · 3 files · 1 commits · merged 2026-11-29 00:24 UTC

Ports three shader translation correctness fixes (adapted from Marvisak/VIctory 7ac1f54d83, f3578e386e, 88daba427b and our merged TaynanGT/Vice-Tay#229) into crates/victory-shader:

Changes

  1. POPS collision wave_id seed (Marvisak#2395 — emit/lower.rs): Seeds pops_collision SGPR inputs with 1 << 16 (wave_id = 1, collision_id = 0, overlap bit clear) so inactive lanes leave the wrap-around wait loop on the first pass instead of stalling/TDRing.
  2. Half-precision (f16) inline float decoding in wave simulation (Marvisak#2493 — emit/lower.rs, emit/wave.rs): Widens lower::inline_f16 to pub(super) and decodes Operand::Const(240..=248) through it in wave::simulate so v_add_f16 does not treat inline f16 float constants as zero identity.
  3. Root constants as offsets (Marvisak#2154 — resource.rs): Excludes RootType::Constants from Tracer::sum base classification and checks s.base before rejecting two-dynamic-term addresses so root constant dword 0 works as a dynamic offset while 64-bit constant pointers still classify as MEMORY.

(No manual cache version bump is needed because VIctory-NVIDIA hashes crates/victory-shader/src/** automatically in build.rs.)

Verification

  • cargo test --locked -p victory-shader -- --test-threads=1 (297 passed, 0 failed) + --doc passed, including all four new regression tests:
    • emit::lower::tests::pops_wait_loop_exits_immediately_for_inactive_lanes (WARP draw + DXIL validation)
    • emit::wave::tests::v_add_f16_inline_float_constants_are_not_zero_identity
    • resource::tests::root_constant_zero_offsets_tables_and_root_descriptors
    • resource::tests::root_constant_zero_offsets_emit_to_dxil
  • Zero Clippy warnings in all modified files (default and --all-features) and cargo test --locked -p xtask passed (6 passed, 0 failed, including asset policy & file-size limits).
  • Verified with synthetic shader/WARP/DXIL tests only (no game files).
**@⁠mint17** on GitHub · 2026-11-28 03:38 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/696) `mint17:fix/shader-pops-f16-root-const` → `main` · +503 −7 · 3 files · 1 commits · merged 2026-11-29 00:24 UTC Ports three shader translation correctness fixes (adapted from `Marvisak/VIctory` `7ac1f54d83`, `f3578e386e`, `88daba427b` and our merged `TaynanGT/Vice-Tay#229`) into `crates/victory-shader`: ### Changes 1. **POPS collision `wave_id` seed (`Marvisak#2395` — `emit/lower.rs`):** Seeds `pops_collision` SGPR inputs with `1 << 16` (`wave_id = 1`, `collision_id = 0`, overlap bit clear) so inactive lanes leave the wrap-around wait loop on the first pass instead of stalling/TDRing. 2. **Half-precision (`f16`) inline float decoding in wave simulation (`Marvisak#2493` — `emit/lower.rs`, `emit/wave.rs`):** Widens `lower::inline_f16` to `pub(super)` and decodes `Operand::Const(240..=248)` through it in `wave::simulate` so `v_add_f16` does not treat inline `f16` float constants as zero identity. 3. **Root constants as offsets (`Marvisak#2154` — `resource.rs`):** Excludes `RootType::Constants` from `Tracer::sum` base classification and checks `s.base` before rejecting two-dynamic-term addresses so root constant dword 0 works as a dynamic offset while 64-bit constant pointers still classify as `MEMORY`. *(No manual cache version bump is needed because `VIctory-NVIDIA` hashes `crates/victory-shader/src/**` automatically in `build.rs`.)* ### Verification - `cargo test --locked -p victory-shader -- --test-threads=1` (**297 passed, 0 failed**) + `--doc` passed, including all four new regression tests: - `emit::lower::tests::pops_wait_loop_exits_immediately_for_inactive_lanes` (WARP draw + DXIL validation) - `emit::wave::tests::v_add_f16_inline_float_constants_are_not_zero_identity` - `resource::tests::root_constant_zero_offsets_tables_and_root_descriptors` - `resource::tests::root_constant_zero_offsets_emit_to_dxil` - Zero Clippy warnings in all modified files (default and `--all-features`) and `cargo test --locked -p xtask` passed (6 passed, 0 failed, including asset policy & file-size limits). - Verified with synthetic shader/WARP/DXIL tests only (no game files).
Port three shader translation correctness fixes (from Marvisak/VIctory
7ac1f54d83, f3578e386e, 88daba427b and our merged Vice-Tay #229) into
crates/victory-shader:

- Seed pops_collision SGPR inputs with 1 << 16 (wave_id = 1, collision_id = 0,
  overlap clear) so inactive lanes leave the wrap-around wait loop on the
  first pass (Marvisak#2395).
- Decode Operand::Const(240..=248) via super::lower::inline_f16 when
  simulating v_add_f16 in wave.rs instead of treating inline f16 constants
  as zero (Marvisak#2493).
- Exclude RootType::Constants from Tracer::sum base matching and check
  s.base before rejecting two-dynamic-term sums so root constant dword 0
  acts as an offset while 64-bit constant pointers still classify as MEMORY
  (Marvisak#2154).
- Add four regression tests (including WARP draw + DXIL validation for POPS).
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-28 03:43:39 +00:00
Author
Owner

@⁠Dukestar69 on GitHub · 2026-11-28 04:47 UTC · original · approved these changes

LGTM — verified on Windows (RTX 5090):

  • cargo test -p victory-shader --lib resource:: (40/40), emit::wave:: (10/10, including v_add_f16_inline_float_constants_are_not_zero_identity), and emit::tests:: (22/22) all passed
  • cargo clippy -p victory-shader --lib -- -D warnings passed with 0 warnings
  • cargo xtask policy passed (294 files ok)

Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).

**@⁠Dukestar69** on GitHub · 2026-11-28 04:47 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/696#pullrequestreview-6095871371) · **approved these changes** LGTM — verified on Windows (RTX 5090): - `cargo test -p victory-shader --lib resource::` (40/40), `emit::wave::` (10/10, including `v_add_f16_inline_float_constants_are_not_zero_identity`), and `emit::tests::` (22/22) all passed - `cargo clippy -p victory-shader --lib -- -D warnings` passed with 0 warnings - `cargo xtask policy` passed (`294 files ok`) Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).
github-bot referenced this pull request from a commit 2026-11-29 00:27:22 +00:00
github manually merged commit fd52970545 into main 2026-11-29 00:28:00 +00:00
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/trustno1-coder--VIctory-NVIDIA!696
No description provided.