shader: raise v_interp_p1lv_f16 #456

Closed
Loggerten wants to merge 1 commit from upstream-pr/456 into main
Loggerten commented 2026-11-24 03:37:50 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Loggerten on 2026-11-24T03:37:50Z.


What

v_interp_p1lv_f16 (VINTRP 0x343) was the one f16 interpolation first half with no I/O raising: io::raise handled only v_interp_p1ll_f16 and v_interp_p2_f16, so any program using it failed with an interpolation form.

It pairs exactly as p1ll does. The only semantic difference: the P0 coordinate comes from a lane VGPR (v.src[2]) instead of LDS. The lowering recomputes the whole attribute channel from the input element, so nothing on the lowering side needed to change.

Per-opcode semantics cross-checked against the RDNA 2 ISA guide and LLVM's AMDGPU VINTRP definitions.

Verified

  • New test io::tests::lane_value_first_half_pairs_with_f16_second: a p1lv_f16 first half followed by a p2_f16 second half. Panics on main with an interpolation form, passes with this change.
  • cargo test -p victory-shader: 57 passed, 0 failed (56 baseline + 1).
  • cargo fmt --check -p victory-shader clean; cargo clippy -p victory-shader --all-targets no new warnings.
  • cargo xtask policy: 151 files ok.

AI-assisted (Hermes Agent); I reviewed the diff and ran the tests and gates myself.

<!-- greyfinch-sync:Marvisak/VIctory:issue:6574053048 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/456). Originally posted by [Loggerten](https://github.com/Loggerten) on 2026-11-24T03:37:50Z. --- ## What `v_interp_p1lv_f16` (VINTRP 0x343) was the one f16 interpolation first half with no I/O raising: `io::raise` handled only `v_interp_p1ll_f16` and `v_interp_p2_f16`, so any program using it failed with `an interpolation form`. It pairs exactly as `p1ll` does. The only semantic difference: the P0 coordinate comes from a lane VGPR (`v.src[2]`) instead of LDS. The lowering recomputes the whole attribute channel from the input element, so nothing on the lowering side needed to change. Per-opcode semantics cross-checked against the RDNA 2 ISA guide and LLVM's AMDGPU VINTRP definitions. ## Verified - New test `io::tests::lane_value_first_half_pairs_with_f16_second`: a `p1lv_f16` first half followed by a `p2_f16` second half. Panics on main with `an interpolation form`, passes with this change. - `cargo test -p victory-shader`: 57 passed, 0 failed (56 baseline + 1). - `cargo fmt --check -p victory-shader` clean; `cargo clippy -p victory-shader --all-targets` no new warnings. - `cargo xtask policy`: 151 files ok. AI-assisted (Hermes Agent); I reviewed the diff and ran the tests and gates myself.
towiice commented 2026-11-24 06:53:09 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by towiice on 2026-11-24T03:51:40Z.

Review: COMMENTED


Tested:

  • Hardware: NVIDIA GeForce GTX 1650 SUPER (Turing TU116, 4 GB VRAM, 32-wide subgroups / wave32, driver 610.88), Windows 11 x64 (26H2 / 10.0.26300), toolchain stable-x86_64-pc-windows-gnullvm (llvm-mingw 23.1.6).
  • Test command: cargo +stable-x86_64-pc-windows-gnullvm test -p victory-shader
  • Result: 70 passed, 0 failed (6.63 s).
    • Verified io::tests::lane_value_first_half_pairs_with_f16_second passes cleanly. Raising v_interp_p1lv_f16 with lane VGPR source correctly completes the f16 interpolation half pairs without regressions.
<!-- greyfinch-sync:Marvisak/VIctory:review:6033389668 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/456#pullrequestreview-6033389668). Originally posted by [towiice](https://github.com/towiice) on 2026-11-24T03:51:40Z. **Review:** COMMENTED --- **Tested:** - Hardware: NVIDIA GeForce GTX 1650 SUPER (Turing TU116, 4 GB VRAM, 32-wide subgroups / wave32, driver 610.88), Windows 11 x64 (26H2 / 10.0.26300), toolchain `stable-x86_64-pc-windows-gnullvm` (llvm-mingw 23.1.6). - Test command: `cargo +stable-x86_64-pc-windows-gnullvm test -p victory-shader` - Result: **70 passed, 0 failed** (6.63 s). - Verified `io::tests::lane_value_first_half_pairs_with_f16_second` passes cleanly. Raising `v_interp_p1lv_f16` with lane VGPR source correctly completes the f16 interpolation half pairs without regressions.
mercuryVM commented 2026-11-24 06:53:09 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by mercuryVM on 2026-11-24T06:23:24Z.

Review: APPROVED


Tested 4b8a1ca on Windows 11, RTX 5070, MSVC: cargo test --workspace --no-fail-fast passes (265 passed, 0 failed). victory translate <title exe> --validate --pipelines gives the same counts before and after: 12 of 12 programs emitted, 12 validated, 12 pipelines. These programs have no f16 interpolation pairs.

  • The pairing code treats p1lv_f16 exactly like p1ll_f16 (attribute from src[0], I from src[1]), and the new test shows a p1lv + p2_f16 pair raised as one perspective-center interpolation.
  • One assumption worth stating in the comment: the lowering rebuilds the channel from the input element, so it ignores the P0 the program supplied in src[2]. That is correct when the VGPR holds the attribute's own P0, which is the normal use (an earlier v_interp_mov/LDS read). A program that puts a different base in that VGPR would be translated as if it had not. If that matters, checking that src[2] traces back to the same attribute's P0 and refusing otherwise would keep it exact.

AI-assisted (Claude Code).

<!-- greyfinch-sync:Marvisak/VIctory:review:6034621366 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/456#pullrequestreview-6034621366). Originally posted by [mercuryVM](https://github.com/mercuryVM) on 2026-11-24T06:23:24Z. **Review:** APPROVED --- Tested 4b8a1ca on Windows 11, RTX 5070, MSVC: `cargo test --workspace --no-fail-fast` passes (265 passed, 0 failed). `victory translate <title exe> --validate --pipelines` gives the same counts before and after: 12 of 12 programs emitted, 12 validated, 12 pipelines. These programs have no f16 interpolation pairs. - The pairing code treats `p1lv_f16` exactly like `p1ll_f16` (attribute from `src[0]`, I from `src[1]`), and the new test shows a `p1lv` + `p2_f16` pair raised as one perspective-center interpolation. - One assumption worth stating in the comment: the lowering rebuilds the channel from the input element, so it ignores the `P0` the program supplied in `src[2]`. That is correct when the VGPR holds the attribute's own P0, which is the normal use (an earlier `v_interp_mov`/LDS read). A program that puts a different base in that VGPR would be translated as if it had not. If that matters, checking that `src[2]` traces back to the same attribute's P0 and refusing otherwise would keep it exact. AI-assisted (Claude Code).
DaviTostes commented 2026-11-24 06:55:30 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by DaviTostes on 2026-11-24T03:42:33Z.


Verified 4b8a1ca on Arch Linux x86_64 (rustc 1.98.1, cargo test -p victory-shader): 57 passed, 0 failed, 0 ignored.

Not covered: f16 interpolation on a real GPU and title shaders (no game data here).

<!-- greyfinch-sync:Marvisak/VIctory:comment:7121346290 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/456#issuecomment-7121346290). Originally posted by [DaviTostes](https://github.com/DaviTostes) on 2026-11-24T03:42:33Z. --- Verified `4b8a1ca` on **Arch Linux x86_64** (rustc 1.98.1, `cargo test -p victory-shader`): **57 passed, 0 failed, 0 ignored**. Not covered: f16 interpolation on a real GPU and title shaders (no game data here).
LocranKing commented 2026-11-24 06:55:40 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by LocranKing on 2026-11-24T04:18:28Z.


Tested on Windows 11 + retail shaders.rpf (1.0.2.1) using victory translate --validate.

Tested

  • Commit: 4b8a1ca (pr-456, clean tree)
  • Environment: Windows 11 Home Build 26200, AMD Ryzen 5 5500, 31.8 GB RAM, Rust 1.98.1 (x86_64-pc-windows-msvc), Windows SDK 10.0.26100.0 dxil.dll
  • cargo xtask policy: asset policy: 151 files ok
  • cargo test --workspace: 265 passed, 0 failed, 4 ignored
  • victory translate <shaders.rpf> --validate (diag build): 26084 / 26084 translated; 12272 VS/PS emitted (12172 validated), 1693 CS emitted (1670 validated), 8191 MS emitted (8129 validated) — counts unchanged vs main d2a4bae.

Not tested: Live GPU / WARP execution.

AI use: Antigravity (Gemini 4 Hydrogen) ran the checks and victory translate --validate and drafted this report from the command outputs.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7121898261 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/456#issuecomment-7121898261). Originally posted by [LocranKing](https://github.com/LocranKing) on 2026-11-24T04:18:28Z. --- Tested on Windows 11 + retail `shaders.rpf` (1.0.2.1) using `victory translate --validate`. **Tested** - Commit: `4b8a1ca` (`pr-456`, clean tree) - Environment: Windows 11 Home Build 26200, AMD Ryzen 5 5500, 31.8 GB RAM, Rust `1.98.1` (`x86_64-pc-windows-msvc`), Windows SDK `10.0.26100.0` `dxil.dll` - `cargo xtask policy`: `asset policy: 151 files ok` - `cargo test --workspace`: **265 passed, 0 failed, 4 ignored** - `victory translate <shaders.rpf> --validate` (`diag` build): `26084 / 26084` translated; `12272` VS/PS emitted (`12172` validated), `1693` CS emitted (`1670` validated), `8191` MS emitted (`8129` validated) — counts unchanged vs `main` `d2a4bae`. **Not tested:** Live GPU / WARP execution. **AI use:** Antigravity (`Gemini 4 Hydrogen`) ran the checks and `victory translate --validate` and drafted this report from the command outputs.
catminou4 commented 2026-11-24 13:01:19 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by catminou4 on 2026-11-24T12:32:47Z.

Review: APPROVED


Minimal, correct extension of the existing v_interp_p1ll_f16 pairing to v_interp_p1lv_f16. Both match arms in raise() and Halves now accept the lane-value first half, and the comment accurately notes the only difference (P0 from v.src[2] lane VGPR instead of the local data share) doesn't affect what the pair needs — site, attribute, I.

The new test pins the pairing end-to-end: v_interp_p1lv_f16 + v_interp_p2_f16 produce one Interp::Interpolated with PerspectiveCenter barycentric and the right attribute/row. Verified locally: test-merge with current main (ffe310e) clean; cargo test -p victory-shader --locked (macOS arm64, rustc 1.98.1) → 97 passed / 0 failed / 1 ignored.

<!-- greyfinch-sync:Marvisak/VIctory:review:6039245231 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/456#pullrequestreview-6039245231). Originally posted by [catminou4](https://github.com/catminou4) on 2026-11-24T12:32:47Z. **Review:** APPROVED --- Minimal, correct extension of the existing `v_interp_p1ll_f16` pairing to `v_interp_p1lv_f16`. Both match arms in `raise()` and `Halves` now accept the lane-value first half, and the comment accurately notes the only difference (P0 from `v.src[2]` lane VGPR instead of the local data share) doesn't affect what the pair needs — site, attribute, I. The new test pins the pairing end-to-end: `v_interp_p1lv_f16` + `v_interp_p2_f16` produce one `Interp::Interpolated` with `PerspectiveCenter` barycentric and the right attribute/row. Verified locally: test-merge with current main (`ffe310e`) clean; `cargo test -p victory-shader --locked` (macOS arm64, rustc 1.98.1) → **97 passed / 0 failed / 1 ignored**.
upstream-sync closed this pull request 2026-11-25 00:05:28 +00:00
Marvisak commented 2026-11-25 00:06:57 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T00:03:01Z.


Automated triage for the maintainers. Closing because by our reading the change is incorrect or would break something that works today.

Raises v_interp_p1lv_f16 exactly like p1ll, but per the RDNA2 ISA its P0 is the VGPR operand S2 (a lane value), not the attribute's P0; the PR drops that operand, so a correct refusal becomes a silently wrong interpolation. No evidence the title uses the instruction.

If this is mistaken, reply here with what was missed (or push a change and say so) and it will be looked at again. Thank you for the contribution.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7148081564 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/456#issuecomment-7148081564). Originally posted by [Marvisak](https://github.com/Marvisak) on 2026-11-25T00:03:01Z. --- Automated triage for the maintainers. Closing because by our reading the change is incorrect or would break something that works today. Raises v_interp_p1lv_f16 exactly like p1ll, but per the RDNA2 ISA its P0 is the VGPR operand S2 (a lane value), not the attribute's P0; the PR drops that operand, so a correct refusal becomes a silently wrong interpolation. No evidence the title uses the instruction. If this is mistaken, reply here with what was missed (or push a change and say so) and it will be looked at again. Thank you for the contribution.

Pull request closed

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
Marvisak/VIctory!456
No description provided.