[BUNDLE] Computed barycentrics: #453 merged with #176 and #1293, stacked on #1492 #1503

Closed
MamaLeVrai wants to merge 86 commits from upstream-pr/1504 into main
MamaLeVrai commented 2026-11-24 18:34:01 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by MamaLeVrai on 2026-11-24T18:34:01Z.


A merge resolution for one PR. #453 (pixel barycentrics through SV_Barycentrics, computed interpolation) gains 182 programs in #1247's benchmark (the "computed barycentrics" wall, 207 programs) and conflicts with two PRs of the stack, #176 and #1293, in the same interpolation code. This is that PR merged onto the stack #1319, #1402 and #1492, with the conflicts resolved and tested. Every head is merged unchanged onto main plus #1492, and the result is built and tested together.

For reviewers and for anyone verifying with an agent (Claude, Codex, a person): this is a [BUNDLE] PR. The re-verification commands are below, so one run covers all of it.

What is inside

PR Author Head Title
#453 AntoninMichelq 88b34a447 Shaders: pixel barycentrics through SV_Barycentrics (values and computed interpolation) (+182 programs in #1247)

Changes made while bundling

No change inside #453. The conflicts, nine hunks in three files, and what each became:

  • io.rs, the pairing (Halves::pair): #1293 finds the barycentric of a pair by following plain v_mov_b32 copies (self.barycentric(j, &mut copied)) and refuses what it cannot find (an interpolation with computed barycentrics). #453 turns that refusal into a result: kind is None when i or j is computed, and the halves are then recorded one by one (Interp::Weighted). Resolution: #453's Option flow, with #1293's copy-following lookup in both places (self.barycentric(j, &mut copied) and self.barycentric(i, &mut copied)), and #1293's checks (the first half must exist; a copy needs an unchanged EXEC) kept as they are. vgpr_copy (#1293) and push_pair (#453) are both kept.
  • io.rs, tests: both PRs' tests are kept. Two assertions of #1293's interpolation_follows_agreeing_phis_and_rejects_mismatched_or_modified_copies had to change: they asserted that a computed i (a phi that passes i on one arm and j on the other, and a negated v_mov_b32 copy) is refused with an interpolation with computed barycentrics. With #453 that is the case being supported, so they now expect Interp::Weighted halves. The assertion that a negated accumulator copy is refused is unchanged.
  • emit/lower.rs, interp: #176 reads the packing of a 16-bit input from self.half_inputs, and #453 rewrote the same lines to read it from the stage data and added a total closure (the evaluated channel plus the first half's result). Resolution: self.half_inputs (#176) for the packing, and #453's f16 test and total closure after it. #176's map is the one that also pairs rows the stage data does not list, which is what #176 is for, so it is the one to keep; #453's total closure only needs the (pack2, second row) pair, which it also returns.
  • emit/lower.rs, phi data joins: #453 evaluates a computed barycentric lazily before a data phi reads it (lazy_barycentric), and the stack adds the ballot handling for mask dwords just after. Both stay, #453's first.
  • emit/lower.rs, free functions: linear and interp_mode (#453) and divergent_barriers (#587) are all kept.
  • emit/shader.rs: the BARYCENTRICS feature bit (#453) next to the two ATOMIC_INT64 ones (#305).

Verification

Windows 11, RX 6950 XT, Rust 1.98.1 (the pinned toolchain):

Check Result
cargo clippy --workspace --all-targets --locked -- -D warnings clean
cargo clippy --workspace --all-targets --all-features --locked -- -D warnings clean
cargo test --workspace --locked 391 passed, 0 failed, 6 ignored (main: 342 passed, 6 ignored)

The title was not run, so this says nothing about in-game effect. No game data is used or committed.

Re-verify in one go

git fetch https://github.com/MamaLeVrai/VIctory.git bundle/computed-barycentrics
git checkout FETCH_HEAD
cargo clippy --workspace --all-targets --locked -- -D warnings
cargo clippy --workspace --all-targets --all-features --locked -- -D warnings
cargo test --workspace --locked

To confirm that no component PR moved since this was built, compare each Head above with gh pr view <n> --repo Marvisak/VIctory --json headRefOid. If one differs, the branch needs a rebuild: merge the new head in the same order.

If this lands

The component heads are in the history unchanged, so each PR's commits and authorship are kept and GitHub should mark them merged. Merging them one by one instead works too, with the exceptions noted above.

AI-assisted (Claude Code); no game data.

🤖 Generated with Claude Code

<!-- greyfinch-sync:Marvisak/VIctory:issue:6588757401 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1504). Originally posted by [MamaLeVrai](https://github.com/MamaLeVrai) on 2026-11-24T18:34:01Z. --- **A merge resolution for one PR.** #453 (pixel barycentrics through SV_Barycentrics, computed interpolation) gains 182 programs in #1247's benchmark (the "computed barycentrics" wall, 207 programs) and conflicts with two PRs of the stack, #176 and #1293, in the same interpolation code. This is that PR merged onto the stack #1319, #1402 and #1492, with the conflicts resolved and tested. Every head is merged unchanged onto `main` plus #1492, and the result is built and tested together. > For reviewers and for anyone verifying with an agent (Claude, Codex, a person): this is a `[BUNDLE]` PR. The re-verification commands are below, so one run covers all of it. ## What is inside | PR | Author | Head | Title | |---|---|---|---| | #453 | AntoninMichelq | `88b34a447` | Shaders: pixel barycentrics through SV_Barycentrics (values and computed interpolation) (+182 programs in #1247) | ## Changes made while bundling No change inside #453. The conflicts, nine hunks in three files, and what each became: - **`io.rs`, the pairing** (`Halves::pair`): #1293 finds the barycentric of a pair by following plain `v_mov_b32` copies (`self.barycentric(j, &mut copied)`) and refuses what it cannot find (`an interpolation with computed barycentrics`). #453 turns that refusal into a result: `kind` is `None` when i or j is computed, and the halves are then recorded one by one (`Interp::Weighted`). Resolution: #453's `Option` flow, with #1293's copy-following lookup in both places (`self.barycentric(j, &mut copied)` and `self.barycentric(i, &mut copied)`), and #1293's checks (the first half must exist; a copy needs an unchanged EXEC) kept as they are. `vgpr_copy` (#1293) and `push_pair` (#453) are both kept. - **`io.rs`, tests**: both PRs' tests are kept. Two assertions of #1293's `interpolation_follows_agreeing_phis_and_rejects_mismatched_or_modified_copies` had to change: they asserted that a computed i (a phi that passes i on one arm and j on the other, and a negated `v_mov_b32` copy) is refused with `an interpolation with computed barycentrics`. With #453 that is the case being supported, so they now expect `Interp::Weighted` halves. The assertion that a negated accumulator copy is refused is unchanged. - **`emit/lower.rs`, `interp`**: #176 reads the packing of a 16-bit input from `self.half_inputs`, and #453 rewrote the same lines to read it from the stage data and added a `total` closure (the evaluated channel plus the first half's result). Resolution: `self.half_inputs` (#176) for the packing, and #453's `f16` test and `total` closure after it. #176's map is the one that also pairs rows the stage data does not list, which is what #176 is for, so it is the one to keep; #453's `total` closure only needs the `(pack2, second row)` pair, which it also returns. - **`emit/lower.rs`, phi data joins**: #453 evaluates a computed barycentric lazily before a data phi reads it (`lazy_barycentric`), and the stack adds the ballot handling for mask dwords just after. Both stay, #453's first. - **`emit/lower.rs`, free functions**: `linear` and `interp_mode` (#453) and `divergent_barriers` (#587) are all kept. - **`emit/shader.rs`**: the `BARYCENTRICS` feature bit (#453) next to the two `ATOMIC_INT64` ones (#305). ## Verification Windows 11, RX 6950 XT, Rust 1.98.1 (the pinned toolchain): | Check | Result | |---|---| | `cargo clippy --workspace --all-targets --locked -- -D warnings` | clean | | `cargo clippy --workspace --all-targets --all-features --locked -- -D warnings` | clean | | `cargo test --workspace --locked` | 391 passed, 0 failed, 6 ignored (`main`: 342 passed, 6 ignored) | The title was not run, so this says nothing about in-game effect. No game data is used or committed. ## Re-verify in one go ```powershell git fetch https://github.com/MamaLeVrai/VIctory.git bundle/computed-barycentrics git checkout FETCH_HEAD cargo clippy --workspace --all-targets --locked -- -D warnings cargo clippy --workspace --all-targets --all-features --locked -- -D warnings cargo test --workspace --locked ``` To confirm that no component PR moved since this was built, compare each `Head` above with `gh pr view <n> --repo Marvisak/VIctory --json headRefOid`. If one differs, the branch needs a rebuild: merge the new head in the same order. ## If this lands The component heads are in the history unchanged, so each PR's commits and authorship are kept and GitHub should mark them merged. Merging them one by one instead works too, with the exceptions noted above. AI-assisted (Claude Code); no game data. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
copilot-pull-request-reviewer[bot commented 2026-11-24 19:03:43 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by copilot-pull-request-reviewer[bot] on 2026-11-24T18:34:14Z.

Review: COMMENTED


Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

<!-- greyfinch-sync:Marvisak/VIctory:review:6045126336 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1504#pullrequestreview-6045126336). Originally posted by [copilot-pull-request-reviewer[bot]](https://github.com/copilot-pull-request-reviewer%5Bbot%5D) on 2026-11-24T18:34:14Z. **Review:** COMMENTED --- Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
sinan-cmyk commented 2026-11-24 19:04:29 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by sinan-cmyk on 2026-11-24T18:54:23Z.


Offline measurement on a retail dump

Result: +226 programs over #1492, 0 programs lost.

Method: the same as #1247. I ran victory translate --validate --list on shaders.rpf (1.0.2.1), with dxil.dll 1.8.2502.11, and compared the results program by program (25,889 programs).

Build Validated Change Lost
main ffe310e 21,724
#1492 head c1e74a3 23,381 +1,657 vs main 29 vs main (from #98, see #1492)
this PR, head 0f3e062 23,607 +226 vs #1492 0 vs #1492

What this PR gains on top of #1492:

Failure on #1492 Gained
an interpolation with computed barycentrics 194
barycentrics read directly 32

Programs that still fail but now fail later:

  • 8 move to "an opaque lane mask"
  • 4 move to "a lane mask read as data"
  • 1 moves to "an interpolation copy with a changed execution mask"
  • 1 moves to "a descriptor's address or format read as data"
  • 3 now fail in the validator with "out of bound coord must be undef". #1247 reported the same error for #453.

These counts show only that programs translate and pass the validator. They do not show that the output is correct. No shader names or data are included, per the asset policy. AI-assisted (Claude Code).

<!-- greyfinch-sync:Marvisak/VIctory:comment:7141317339 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1504#issuecomment-7141317339). Originally posted by [sinan-cmyk](https://github.com/sinan-cmyk) on 2026-11-24T18:54:23Z. --- ### Offline measurement on a retail dump **Result: +226 programs over #1492, 0 programs lost.** Method: the same as #1247. I ran `victory translate --validate --list` on `shaders.rpf` (1.0.2.1), with dxil.dll 1.8.2502.11, and compared the results program by program (25,889 programs). | Build | Validated | Change | Lost | |---|---|---|---| | `main` ffe310e | 21,724 | | | | #1492 head c1e74a3 | 23,381 | +1,657 vs `main` | 29 vs `main` (from #98, see #1492) | | this PR, head 0f3e062 | 23,607 | **+226** vs #1492 | **0** vs #1492 | What this PR gains on top of #1492: | Failure on #1492 | Gained | |---|---| | an interpolation with computed barycentrics | 194 | | barycentrics read directly | 32 | **Programs that still fail but now fail later:** - 8 move to "an opaque lane mask" - 4 move to "a lane mask read as data" - 1 moves to "an interpolation copy with a changed execution mask" - 1 moves to "a descriptor's address or format read as data" - 3 now fail in the validator with "out of bound coord must be undef". #1247 reported the same error for #453. These counts show only that programs translate and pass the validator. They do not show that the output is correct. No shader names or data are included, per the asset policy. AI-assisted (Claude Code).
MamaLeVrai commented 2026-11-24 20:03:02 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by MamaLeVrai on 2026-11-24T19:10:24Z.


Rebuilt on the new #1492 (without #98, see there): head 9ed1660. The resolution of #453's conflicts is the same, applied as a patch on the new base, and the tree differs from the previous head (0f3e062) only in wave.rs, by the removal of #98's change. Clippy (both runs) and cargo test --workspace pass (391 passed, 6 ignored). The measurement above was on the previous head. AI-assisted (Claude Code); no game data.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7141705724 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1504#issuecomment-7141705724). Originally posted by [MamaLeVrai](https://github.com/MamaLeVrai) on 2026-11-24T19:10:24Z. --- Rebuilt on the new #1492 (without #98, see there): head `9ed1660`. The resolution of #453's conflicts is the same, applied as a patch on the new base, and the tree differs from the previous head (`0f3e062`) only in `wave.rs`, by the removal of #98's change. Clippy (both runs) and `cargo test --workspace` pass (391 passed, 6 ignored). The measurement above was on the previous head. AI-assisted (Claude Code); no game data.
upstream-sync closed this pull request 2026-11-25 01:06:45 +00:00
Marvisak commented 2026-11-25 01:08:15 +00:00 (Migrated from github.com)

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


Automated triage for the maintainers. Closing because this pull request re-packages other open pull requests. Each of those is reviewed on its own, so a bundle cannot be merged.

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:7148780347 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1504#issuecomment-7148780347). Originally posted by [Marvisak](https://github.com/Marvisak) on 2026-11-25T00:41:45Z. --- Automated triage for the maintainers. Closing because this pull request re-packages other open pull requests. Each of those is reviewed on its own, so a bundle cannot be merged. 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!1503
No description provided.