Support isolated P10 reads on pixel shader inputs #2038

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

@⁠DoubleD17 on GitHub · 2026-11-25 03:51 UTC · original
DoubleD17:port/fxceless-439 → main · +301 −2 · 4 files · 1 commits · closed without merging

Isolated P10 reads in v_interp_mov_f32 now lower to the difference between vertex 1 and vertex 0 for eligible generic float32 pixel inputs. Preserve the input signature and the existing modes for P0 and coordinate pairs. Reject conflicting interpolation modes on the same row. Four focused tests passed on Windows x64 with DXIL validation using SDK 10.0.26100.0. On D3D12 WARP (DXGI 1414:008C), the packed VS/PS synthetic draw read back 0.5 for P10 and 0.25 for P0. Draw validation covers an unclipped synthetic triangle in host vertex order.

Adapted from fxceless/victory-fork #439.

AI-assisted.

**@⁠DoubleD17** on GitHub · 2026-11-25 03:51 UTC · [original](https://github.com/Marvisak/VIctory/pull/2038) `DoubleD17:port/fxceless-439` → `main` · +301 −2 · 4 files · 1 commits · closed without merging Isolated P10 reads in v_interp_mov_f32 now lower to the difference between vertex 1 and vertex 0 for eligible generic float32 pixel inputs. Preserve the input signature and the existing modes for P0 and coordinate pairs. Reject conflicting interpolation modes on the same row. Four focused tests passed on Windows x64 with DXIL validation using SDK 10.0.26100.0. On D3D12 WARP (DXGI 1414:008C), the packed VS/PS synthetic draw read back 0.5 for P10 and 0.25 for P0. Draw validation covers an unclipped synthetic triangle in host vertex order. Adapted from [fxceless/victory-fork #439](https://github.com/fxceless/victory-fork/pull/439). AI-assisted.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:52:30 +00:00
github-bot closed this pull request 2026-11-26 04:52:30 +00:00
Author
Owner

@⁠jeremygold02 on GitHub · 2026-11-25 04:02 UTC · original

Triage verdict — Keep for the tested generic float32 inputs (8c498ab)

Evidence

  • @⁠DoubleD17's patch lowers isolated P10 to the difference between the first two host vertex attributes while retaining P0, packed input linkage, and the rejection for incompatible live interpolation. The existing review covers the default tests. I checked the opt-in render path separately. Opt-in draw

Checks and limits

  • On WARP, the opt-in packed VS/PS draw returned P10 = 0.5 and P0 = 0.25. A disposable variant moved the first vertex behind the near plane while keeping the sampled pixel covered. Both values stayed the same and DXIL validation accepted both variants.
  • This adds coverage for clipping on a triangle using host vertex order. It leaves console strip ordering and rectangle-list decomposition open. The host rectangle path emits two triangles with different second vertices, so the same subtraction need not produce the same coefficient on both halves. Rectangle emission

Next step

  • Keep the scope explicit. Before claiming rectangle or strip parity, compare asymmetric vertex attributes against a console reference across both constituent triangles.

This verification was AI-assisted.

**@⁠jeremygold02** on GitHub · 2026-11-25 04:02 UTC · [original](https://github.com/Marvisak/VIctory/pull/2038#issuecomment-7152476911) **Triage verdict — Keep for the tested generic float32 inputs** (`8c498ab`) **Evidence** - @⁠DoubleD17's patch lowers isolated P10 to the difference between the first two host vertex attributes while retaining P0, packed input linkage, and the rejection for incompatible live interpolation. The existing review covers the default tests. I checked the opt-in render path separately. [Opt-in draw](https://github.com/Marvisak/VIctory/blob/8c498abd25f5310e19b9c21aa3ad4c9c4e0a5ae4/crates/victory-shader/src/emit/mod.rs#L1353) **Checks and limits** - On WARP, the opt-in packed VS/PS draw returned P10 = 0.5 and P0 = 0.25. A disposable variant moved the first vertex behind the near plane while keeping the sampled pixel covered. Both values stayed the same and DXIL validation accepted both variants. - This adds coverage for clipping on a triangle using host vertex order. It leaves console strip ordering and rectangle-list decomposition open. The host rectangle path emits two triangles with different second vertices, so the same subtraction need not produce the same coefficient on both halves. [Rectangle emission](https://github.com/Marvisak/VIctory/blob/8c498abd25f5310e19b9c21aa3ad4c9c4e0a5ae4/crates/victory-shader/src/emit/rect.rs#L48-L67) **Next step** - Keep the scope explicit. Before claiming rectangle or strip parity, compare asymmetric vertex attributes against a console reference across both constituent triangles. This verification was AI-assisted.
Author
Owner

@⁠upipibi on GitHub · 2026-11-25 04:30 UTC · original

Ran on Windows 11 with an RTX 3070 (Ampere, driver 616.56), debug build, at 8c498ab. victory-shader: 247 passed, 3 failed, 4 ignored; the 3 non-ignored isolated_p10_* tests pass. I also ran the ignored one: isolated_p10_and_p0_draw_with_a_packed_signature passes with --ignored (Windows SDK DXC, the DXIL validator and WARP are on this machine). The 3 failures are #1744's NVIDIA failures on main. Same as main on this hardware. Not run: a title.

AI-assisted (Claude Code).

**@⁠upipibi** on GitHub · 2026-11-25 04:30 UTC · [original](https://github.com/Marvisak/VIctory/pull/2038#issuecomment-7152906422) Ran on Windows 11 with an RTX 3070 (Ampere, driver 616.56), debug build, at `8c498ab`. `victory-shader`: 247 passed, 3 failed, 4 ignored; the 3 non-ignored `isolated_p10_*` tests pass. I also ran the ignored one: `isolated_p10_and_p0_draw_with_a_packed_signature` passes with `--ignored` (Windows SDK DXC, the DXIL validator and WARP are on this machine). The 3 failures are #1744's NVIDIA failures on `main`. Same as `main` on this hardware. Not run: a title. AI-assisted (Claude Code).
Author
Owner

@⁠andrewpozdnakov7-jpg on GitHub · 2026-11-25 05:38 UTC · original

The P10 path also covers standalone P20 with one change: select vertex 2 instead of vertex 1 before subtracting P0. 665452c extends the same generic float32 path in one commit on 8c498abd25f5310e19b9c21aa3ad4c9c4e0a5ae4.

On that exact head, the extended packed-signature WARP draw read back P10 = 0.5 and stopped at P20 with "a non-provoking vertex value". With the commit, all three shaders passed DXIL validation and the draw read back P10 = 0.5, P20 = -0.125 and P0 = 0.25. Both coefficient selectors also pass the packed-signature and incompatible-live-interpolation tests. The draw uses an unclipped triangle in host vertex order.

The full forced-WARP shader suite reported 247 passed, 3 failed and 4 ignored on both builds. The gather, lane-permute and edge-flagged triangle failures were shared. Strict shader Clippy and staged asset policy passed.

**@⁠andrewpozdnakov7-jpg** on GitHub · 2026-11-25 05:38 UTC · [original](https://github.com/Marvisak/VIctory/pull/2038#issuecomment-7153992189) The P10 path also covers standalone P20 with one change: select vertex 2 instead of vertex 1 before subtracting P0. [665452c](https://github.com/andrewpozdnakov7-jpg/VIctory/commit/665452cb44bacd7404cf6888bda0020e9e8db3d5) extends the same generic float32 path in one commit on 8c498abd25f5310e19b9c21aa3ad4c9c4e0a5ae4. On that exact head, the extended packed-signature WARP draw read back P10 = 0.5 and stopped at P20 with "a non-provoking vertex value". With the commit, all three shaders passed DXIL validation and the draw read back P10 = 0.5, P20 = -0.125 and P0 = 0.25. Both coefficient selectors also pass the packed-signature and incompatible-live-interpolation tests. The draw uses an unclipped triangle in host vertex order. The full forced-WARP shader suite reported 247 passed, 3 failed and 4 ignored on both builds. The gather, lane-permute and edge-flagged triangle failures were shared. Strict shader Clippy and staged asset policy passed.
Author
Owner

@⁠Marvisak on GitHub · 2026-11-25 09:19 UTC · original

Automated triage for the maintainers.

Needs work.

emit/lower.rs now lowers a v_interp_mov_f32 of P10 (Interp::Vertex { vertex: 0 }, previously refused as "a non-provoking vertex value") on an unpacked generic float32 input to attributeAtVertex(1) - attributeAtVertex(0) in the new isolated_p10, marks the input used with constant interpolation, sets the SFI0 barycentrics feature (flags::BARYCENTRICS, 0x2_0000, correct bit and no collision with the existing flags), and rejects a row that another live read needs in a different mode. The code is careful and the tests cover the signature, PSV and the conflict case.

What it needs:

  • Evidence and motivation. This changes shader semantics with no stated reference. P10 = P1 - P0 matches the public RDNA ISA description of parameter interpolation, so please cite that, and say how many title programs translate reports with "a non-provoking vertex value" today and how many this clears.
  • Vertex order. The result is only right when the host's vertex 0/1 match the console's P0/P1. That holds for the tested unclipped triangle list in host order, but not obviously for strips or for rectangle lists, which emit/rect.rs splits into two triangles with different second vertices (raised in the earlier review). Before, these shaders failed to translate; now they would produce silently wrong values for such draws. Either show parity for those cases or document the limitation with a shortcut: note at isolated_p10.
  • P20 (665452c, offered in the comments with WARP results) fits the same path; consider folding it in. #1738 covers P10/P20 for rows that are also interpolated; the two should agree on vertex order.

CI: passing (check).


Generated by Claude Code

**@⁠Marvisak** on GitHub · 2026-11-25 09:19 UTC · [original](https://github.com/Marvisak/VIctory/pull/2038#issuecomment-7158169015) <!-- victory-triage v1 head=8c498abd25f5310e19b9c21aa3ad4c9c4e0a5ae4 verdict=needs-work at=2026-11-25T09:18:56Z --> Automated triage for the maintainers. **Needs work.** `emit/lower.rs` now lowers a `v_interp_mov_f32` of P10 (`Interp::Vertex { vertex: 0 }`, previously refused as "a non-provoking vertex value") on an unpacked generic float32 input to `attributeAtVertex(1) - attributeAtVertex(0)` in the new `isolated_p10`, marks the input used with constant interpolation, sets the SFI0 barycentrics feature (`flags::BARYCENTRICS`, `0x2_0000`, correct bit and no collision with the existing flags), and rejects a row that another live read needs in a different mode. The code is careful and the tests cover the signature, PSV and the conflict case. What it needs: - **Evidence and motivation.** This changes shader semantics with no stated reference. P10 = P1 - P0 matches the public RDNA ISA description of parameter interpolation, so please cite that, and say how many title programs `translate` reports with "a non-provoking vertex value" today and how many this clears. - **Vertex order.** The result is only right when the host's vertex 0/1 match the console's P0/P1. That holds for the tested unclipped triangle list in host order, but not obviously for strips or for rectangle lists, which `emit/rect.rs` splits into two triangles with different second vertices (raised in the earlier review). Before, these shaders failed to translate; now they would produce silently wrong values for such draws. Either show parity for those cases or document the limitation with a `shortcut:` note at `isolated_p10`. - P20 (`665452c`, offered in the comments with WARP results) fits the same path; consider folding it in. #1738 covers P10/P20 for rows that are also interpolated; the two should agree on vertex order. CI: passing (`check`). --- _Generated by [Claude Code](https://claude.ai/code)_
Author
Owner

@⁠andrewpozdnakov7-jpg on GitHub · 2026-11-25 10:04 UTC · original

Your refreshed head documents the ISA and the vertex-order constraint. I ported the isolated P20 follow-up to that exact head, 30b0692c77, and added clipped triangles to the packed-signature draw. 8b8c90d

On 30b0692 with the same test, P10 reads 0.5 with and without clipping, and P20 stops at “a non-provoking vertex value”. With the follow-up, P10, P20 and P0 validate and read 0.5, -0.125 and 0.25 respectively for both triangles. All four focused tests passed on WARP. The full WARP shader run went from 245 passed, 5 failed, 4 ignored to 247 passed, 3 failed, 4 ignored. The gather, lane-permute and edge-flag failures were present on both builds. Clippy and repository policy passed.

The shortcut still documents the open vertex-order question for strips and rectangles. AMD's definition of P20 as P2 - P0 is in section 12.2 of the RDNA 3 ISA.

Please preserve the Git author if you take the follow-up. If the code or test is folded into your commit, please add:

Co-authored-by: andrewpozdnakov7-jpg [email protected]

AI-assisted. Synthetic tests only.

**@⁠andrewpozdnakov7-jpg** on GitHub · 2026-11-25 10:04 UTC · [original](https://github.com/Marvisak/VIctory/pull/2038#issuecomment-7159187319) Your refreshed head documents the ISA and the vertex-order constraint. I ported the isolated P20 follow-up to that exact head, 30b0692c77560738defe848fadfa73174f809da7, and added clipped triangles to the packed-signature draw. [8b8c90d](https://github.com/andrewpozdnakov7-jpg/VIctory/commit/8b8c90d8f25f65b93166df297914d2a758479d5b) On 30b0692 with the same test, P10 reads 0.5 with and without clipping, and P20 stops at “a non-provoking vertex value”. With the follow-up, P10, P20 and P0 validate and read 0.5, -0.125 and 0.25 respectively for both triangles. All four focused tests passed on WARP. The full WARP shader run went from 245 passed, 5 failed, 4 ignored to 247 passed, 3 failed, 4 ignored. The gather, lane-permute and edge-flag failures were present on both builds. Clippy and repository policy passed. The shortcut still documents the open vertex-order question for strips and rectangles. AMD's definition of P20 as P2 - P0 is in section 12.2 of the [RDNA 3 ISA](https://docs.amd.com/api/khub/documents/UkT_UPQL21KfKAMUBFnZTw/content). Please preserve the Git author if you take the follow-up. If the code or test is folded into your commit, please add: Co-authored-by: andrewpozdnakov7-jpg <[email protected]> AI-assisted. Synthetic tests only.
Author
Owner

@⁠sinan-cmyk on GitHub · 2026-11-25 10:29 UTC · original

Offline measurement on a retail dump

Result: no count change against main.

I merged head 30b0692c onto main 940d32f (clean merge) and ran victory translate --validate --list on shaders.rpf (1.0.2.1), with dxil.dll 1.8.2502.11. I compared the result with main program by program (25,889 programs). Validated: 23,918 on main, 23,918 with this PR.

No program changes its failure reason. The count shows that the change rejects nothing on this data. It does not show whether the output is right.

No shader names or data are included, per the asset policy. AI-assisted (Claude Code).

**@⁠sinan-cmyk** on GitHub · 2026-11-25 10:29 UTC · [original](https://github.com/Marvisak/VIctory/pull/2038#issuecomment-7159774377) ### Offline measurement on a retail dump **Result: no count change against `main`.** I merged head 30b0692c onto `main` 940d32f (clean merge) and ran `victory translate --validate --list` on `shaders.rpf` (1.0.2.1), with dxil.dll 1.8.2502.11. I compared the result with `main` program by program (25,889 programs). Validated: 23,918 on `main`, 23,918 with this PR. No program changes its failure reason. The count shows that the change rejects nothing on this data. It does not show whether the output is right. No shader names or data are included, per the asset policy. AI-assisted (Claude Code).

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