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

Merged
mint17 merged 1 commit from upstream-pr/696 into main 2026-11-29 00:24:47 +00:00
mint17 commented 2026-11-28 03:38:22 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by mint17 on 2026-11-28T03:38:22Z.


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).
<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:issue:5536304313 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/696). Originally posted by [mint17](https://github.com/mint17) on 2026-11-28T03:38:22Z. --- 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).
Dukestar69 commented 2026-11-28 04:47:40 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by Dukestar69 on 2026-11-28T04:47:40Z.

Review: APPROVED


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).

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:review:6095871371 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/696#pullrequestreview-6095871371). Originally posted by [Dukestar69](https://github.com/Dukestar69) on 2026-11-28T04:47:40Z. **Review:** APPROVED --- 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).
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
trustno1-coder/VIctory-NVIDIA!696
No description provided.