Upstream: 31 conflicting fixes ported by hand (stacked on #653) #716

Open
coderanonymus wants to merge 149 commits from upstream-pr/716 into main
coderanonymus commented 2026-11-25 05:27:01 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by coderanonymus on 2026-11-25T05:27:01Z.


Stacked on #653, which brings over the 113 upstream fixes that apply cleanly. Please merge that one first; this PR's own commits are the 34 after it.

Rebased on main (a26859f)

Rebased with #653 onto a26859f. The port of 4ab20fc (indirect budget charged in record order) is dropped. a26859f rewrote the same clamp shader, and I won't merge two rewrites of it without a run. Everything else applied. Clippy passes with and without --all-features on a clean build, Linux tests (263) pass, and so does the asset policy.

Why

#653 left out the upstream commits that conflict with the fork. Most of those are fixes inside code the fork rewrote. This PR ports them by hand, so the fork has them without a full upstream merge.

What

  • 31 commits, one per upstream commit.
    • Each keeps its upstream author and names its upstream sha (cherry picked from or ported from).
    • Each has a Port notes paragraph saying what differed on the fork and how it was resolved.
    • By area: GPU 13, shaders 11, loader/app/input 7.
  • Already in the fork, so not ported: 705a2f6 (micro-tile runs), 12eba49 (whole-wave EXEC constants), f821cb9 (parallel library loads), f47ebd8 (cache invalidations as no-ops), 1e923ad (WAVE_OPS for lane_bit), 4e60ea3 (indirect drop before clamp), 42363ab and ccfb029 (shader tests skip without a GPU). The fork has each in its own form; the reviewers checked each claim.
  • Three commits of mine:
    • The asset policy check failed with all ports together. emit/lower.rs reached 525,703 bytes, past its 512 KiB limit, so repository_passes_policy failed. Its test module moves to emit/lower/tests.rs. The move is byte-for-byte, apart from one level of indentation (checked with diff). Upstream has started splitting emit/lower/ the same way.
    • Shaders, host waves of 32 that don't exchange. A console wave64 program can run there as two halves, and lane_bit then tests the low dword in both host waves. atom() now refuses an opaque mask there, and a constant one unless its two dwords are equal. The ported v_cndmask_b32 change refuses its own paths the same way. The atom() hole was already on main, for example a compare ANDed with a constant feeding a select. Test: a_constant_select_mask_on_host_halves_is_refused, with five cases, all of which translated (wrongly) or reached the wrong path before.
    • The ported mesh test now says why it skipped a device, as the other skip sites do.

How it was made and reviewed

Ultracode workflow:

  • One agent per upstream commit (or chain of dependent commits), each in its own worktree.
  • A skeptic reviewed every port, and one repair round followed where needed. 4 ports were approved after repair. 2 were rejected, and I fixed them by hand:
    • copy-no-region: a wrong comment.
    • the v_cndmask_b32 constant masks: the half-wave miscompile above.
  • The stacked branch then had a fresh review of the two fixed ports, plus three area reviewers looking for interactions between the ports.
  • That review found the atom() hole, fixed above, and two small slips, fixed in the last commit. It found no other interactions between ports.

Some of these ports may overlap open fork PRs, judged by title only: #165 (Staging::detile), #325 (frame waits), #97 (DirectStorage page 0; d09f3aa itself was left out for that reason).

Verification

  • cargo clippy --workspace --all-targets --locked -- -D warnings, and the same with --all-features, for x86_64-pc-windows-msvc (cross-checked from Linux): clean on the stacked branch.
  • Linux tests: victory-shader 194 pass, 3 ignored. xtask passes, including the asset policy. formats, core, pipeline and game pass.
  • Not run: the Windows and GPU tests, or the game. Several ports add Windows tests (crash log, title copies, DRED breadcrumbs, upload scratch, mesh primitives). Those were type-checked, and their reviewers reasoned through them against the fork's code. Their first real run will be CI on Windows.

No game data used; the game isn't named in the tree.

Ported (upstream sha, author)
  • f5cb5ff Capture startup breakpoint diagnostics (Peter Bonanni)
  • a3acc87 Check the required startup archive before executing Series 1.0.2.1 (Peter Bonanni)
  • e5b7159 Shaders: walk a lane-mask diagram once in vars and given (TG0000)
  • 810f442 GPU: a frame wait takes its tick before it sleeps (Manuel Pérez)
  • 882664e GPU: keep the frame wait's tick for the diagnostics log (Manuel Pérez)
  • 64484b4 Input: apply VICTORY_KEYS to a connected host pad too (Alpaca-exe)
  • 7f00a62 Crash reports: name the host's CPU and Windows build (Duff)
  • b58d198 GPU: copy into title memory without asking for its region first (jsthope)
  • 3f5eff5 input: with no device, previous and next readings walk every device in time order (b000m)
  • 691236d GPU: align appended input-element offsets like D3D12 (JFIREonFIRE)
  • 6526965 GPU: find a list in the DRED breadcrumbs by its name, not only its pointer (OpenBot)
  • 8a358e3 GPU: find the lists in the DRED breadcrumbs by position when the debug layer hides them (OpenBot)
  • 52d528b GPU: match a breadcrumb node's name followed by the debug layer's note; drop the position fallback (OpenBot)
  • c430b1d Shaders: tbuffer_load_format_d16 loads pack two 16-bit channels per VGPR (Duff)
  • 645391b Shaders: a normalized buffer format's ends load as exactly 1.0 and -1.0 (Duff)
  • f177aae Shaders: cap BDD memo table and bail out early on overflow (Yaekai)
  • 5d6889e Shaders: lower v_sad_u8, v_sad_hi_u8, v_sad_u16, v_sad_u32 and v_msad_u8 (Rareuncommon)
  • 67c4f53 victory-shader: resolve Structured::other and constant masks in v_cndmask_b32 (bartikele)
  • 59035de GPU: grow per-list upload scratch on demand (Launch)
  • 100de0e Shader tests: a skipped device says why it was skipped (skl)
  • e52777a GPU list: bind initial pipeline state in create_list and create_list_x (给伊莉雅补魔)
  • f096774 GPU: throttle failed swap-chain creation and resize (Aws)
  • 4fc9d70 GPU: keep Staging::detile inside the staging buffer and harden committed() (HailLucifer666)
  • c0228d9 victory-shader: mask mesh primitive vertex indices to 9 bits (drop edge flags) (tjthebigbearcat-hub)
  • 13185f5 GPU: GetDeviceRemovedReason reports the host device's state instead of E_NOTIMPL (BastienRdz)
  • e29391f Shaders: honor op_sel, omod and clamp on v_interp_p2_f16 (Calvix2k)
  • 0601955 Shaders: a helper lane's v_readfirstlane reads its own value (Vax)
  • ed0dbfd GPU: copy title writes under ranges a submission's shaders write (Kevin Pratap Sidhu)
  • 146dfef gfx10: resolve the opcode name once, at decode time (pes7)
  • 0de9efc Loader: clzero loops in one exception; rdpru (Maledetto)
  • 514927d Loader: tests for the clzero loop edge cases (Maledetto)

🤖 Generated with Claude Code

<!-- greyfinch-sync:fxceless/victory-fork:issue:6597868288 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/716). Originally posted by [coderanonymus](https://github.com/coderanonymus) on 2026-11-25T05:27:01Z. --- Stacked on #653, which brings over the 113 upstream fixes that apply cleanly. Please merge that one first; this PR's own commits are the 34 after it. ## Rebased on main (a26859f) Rebased with #653 onto a26859f. The port of 4ab20fc (indirect budget charged in record order) is dropped. a26859f rewrote the same clamp shader, and I won't merge two rewrites of it without a run. Everything else applied. Clippy passes with and without `--all-features` on a clean build, Linux tests (263) pass, and so does the asset policy. ## Why #653 left out the upstream commits that conflict with the fork. Most of those are fixes inside code the fork rewrote. This PR ports them by hand, so the fork has them without a full upstream merge. ## What - **31 commits, one per upstream commit.** - Each keeps its upstream author and names its upstream sha (`cherry picked from` or `ported from`). - Each has a *Port notes* paragraph saying what differed on the fork and how it was resolved. - By area: GPU 13, shaders 11, loader/app/input 7. - **Already in the fork, so not ported:** 705a2f6 (micro-tile runs), 12eba49 (whole-wave EXEC constants), f821cb9 (parallel library loads), f47ebd8 (cache invalidations as no-ops), 1e923ad (WAVE_OPS for `lane_bit`), 4e60ea3 (indirect drop before clamp), 42363ab and ccfb029 (shader tests skip without a GPU). The fork has each in its own form; the reviewers checked each claim. - **Three commits of mine:** - **The asset policy check failed with all ports together.** `emit/lower.rs` reached 525,703 bytes, past its 512 KiB limit, so `repository_passes_policy` failed. Its test module moves to `emit/lower/tests.rs`. The move is byte-for-byte, apart from one level of indentation (checked with diff). Upstream has started splitting `emit/lower/` the same way. - **Shaders, host waves of 32 that don't exchange.** A console wave64 program can run there as two halves, and `lane_bit` then tests the low dword in both host waves. `atom()` now refuses an opaque mask there, and a constant one unless its two dwords are equal. The ported `v_cndmask_b32` change refuses its own paths the same way. The `atom()` hole was already on `main`, for example a compare ANDed with a constant feeding a select. Test: `a_constant_select_mask_on_host_halves_is_refused`, with five cases, all of which translated (wrongly) or reached the wrong path before. - The ported mesh test now says why it skipped a device, as the other skip sites do. ## How it was made and reviewed Ultracode workflow: - One agent per upstream commit (or chain of dependent commits), each in its own worktree. - A skeptic reviewed every port, and one repair round followed where needed. 4 ports were approved after repair. 2 were rejected, and I fixed them by hand: - copy-no-region: a wrong comment. - the `v_cndmask_b32` constant masks: the half-wave miscompile above. - The stacked branch then had a fresh review of the two fixed ports, plus three area reviewers looking for interactions between the ports. - That review found the `atom()` hole, fixed above, and two small slips, fixed in the last commit. It found no other interactions between ports. Some of these ports may overlap open fork PRs, judged by title only: #165 (`Staging::detile`), #325 (frame waits), #97 (DirectStorage page 0; d09f3aa itself was left out for that reason). ## Verification - `cargo clippy --workspace --all-targets --locked -- -D warnings`, and the same with `--all-features`, for `x86_64-pc-windows-msvc` (cross-checked from Linux): clean on the stacked branch. - Linux tests: victory-shader 194 pass, 3 ignored. xtask passes, including the asset policy. formats, core, pipeline and game pass. - **Not run:** the Windows and GPU tests, or the game. Several ports add Windows tests (crash log, title copies, DRED breadcrumbs, upload scratch, mesh primitives). Those were type-checked, and their reviewers reasoned through them against the fork's code. Their first real run will be CI on Windows. No game data used; the game isn't named in the tree. <details><summary>Ported (upstream sha, author)</summary> - f5cb5ff Capture startup breakpoint diagnostics (Peter Bonanni) - a3acc87 Check the required startup archive before executing Series 1.0.2.1 (Peter Bonanni) - e5b7159 Shaders: walk a lane-mask diagram once in vars and given (TG0000) - 810f442 GPU: a frame wait takes its tick before it sleeps (Manuel Pérez) - 882664e GPU: keep the frame wait's tick for the diagnostics log (Manuel Pérez) - 64484b4 Input: apply VICTORY_KEYS to a connected host pad too (Alpaca-exe) - 7f00a62 Crash reports: name the host's CPU and Windows build (Duff) - b58d198 GPU: copy into title memory without asking for its region first (jsthope) - 3f5eff5 input: with no device, previous and next readings walk every device in time order (b000m) - 691236d GPU: align appended input-element offsets like D3D12 (JFIREonFIRE) - 6526965 GPU: find a list in the DRED breadcrumbs by its name, not only its pointer (OpenBot) - 8a358e3 GPU: find the lists in the DRED breadcrumbs by position when the debug layer hides them (OpenBot) - 52d528b GPU: match a breadcrumb node's name followed by the debug layer's note; drop the position fallback (OpenBot) - c430b1d Shaders: tbuffer_load_format_d16 loads pack two 16-bit channels per VGPR (Duff) - 645391b Shaders: a normalized buffer format's ends load as exactly 1.0 and -1.0 (Duff) - f177aae Shaders: cap BDD memo table and bail out early on overflow (Yaekai) - 5d6889e Shaders: lower v_sad_u8, v_sad_hi_u8, v_sad_u16, v_sad_u32 and v_msad_u8 (Rareuncommon) - 67c4f53 victory-shader: resolve Structured::other and constant masks in v_cndmask_b32 (bartikele) - 59035de GPU: grow per-list upload scratch on demand (Launch) - 100de0e Shader tests: a skipped device says why it was skipped (skl) - e52777a GPU list: bind initial pipeline state in create_list and create_list_x (给伊莉雅补魔) - f096774 GPU: throttle failed swap-chain creation and resize (Aws) - 4fc9d70 GPU: keep Staging::detile inside the staging buffer and harden committed() (HailLucifer666) - c0228d9 victory-shader: mask mesh primitive vertex indices to 9 bits (drop edge flags) (tjthebigbearcat-hub) - 13185f5 GPU: GetDeviceRemovedReason reports the host device's state instead of E_NOTIMPL (BastienRdz) - e29391f Shaders: honor op_sel, omod and clamp on v_interp_p2_f16 (Calvix2k) - 0601955 Shaders: a helper lane's v_readfirstlane reads its own value (Vax) - ed0dbfd GPU: copy title writes under ranges a submission's shaders write (Kevin Pratap Sidhu) - 146dfef gfx10: resolve the opcode name once, at decode time (pes7) - 0de9efc Loader: clzero loops in one exception; rdpru (Maledetto) - 514927d Loader: tests for the clzero loop edge cases (Maledetto) </details> 🤖 Generated with [Claude Code](https://claude.com/claude-code)
chatgpt-codex-connector[bot commented 2026-11-25 06:06:37 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by chatgpt-codex-connector[bot] on 2026-11-25T05:27:07Z.


Codex Review Summary: ❌ Failed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ❌ Failed 2026-11-25T05:27:05.268972Z
We couldn’t complete this review. Comment @codex review to try again.
ef4e8a9 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

<!-- greyfinch-sync:fxceless/victory-fork:comment:7153787820 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/716#issuecomment-7153787820). Originally posted by [chatgpt-codex-connector[bot]](https://github.com/chatgpt-codex-connector%5Bbot%5D) on 2026-11-25T05:27:07Z. --- <!-- codex-pull-request-review-summary --> <!-- codex-review-state:v1 {"code_review":{"commit_sha":"ef4e8a90d55b487ef30da4ff61ca9be9c238b8ac","has_any_findings":true,"has_unresolved_findings":true,"status":"failed"},"security_review":{"commit_sha":null,"has_any_findings":null,"has_unresolved_findings":null,"status":null}} --> <details> <summary><strong>Codex Review Summary</strong>: ❌ Failed</summary> This comment shows the latest Codex review activity on this pull request. | Review | Status | Commit | Review trigger | | --- | --- | --- | --- | | 📝 **Code Review** | ❌ **Failed** <relative-time datetime="2026-11-25T05:27:05.268972Z">2026-11-25T05:27:05.268972Z</relative-time><br/>We couldn’t complete this review. Comment `@codex review` to try again. | `ef4e8a9` | PR opened | <details> <summary>ℹ️ About Codex in GitHub</summary> <br/> [Your team has set up Codex to review pull requests in this repo](https://chatgpt.com/codex/cloud/settings/general). Reviews are triggered when you - Open a pull request for review - Mark a draft as ready - Comment "@codex review" or "@codex security review". Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. </details> </details>
chatgpt-codex-connector[bot commented 2026-11-25 06:06:37 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by chatgpt-codex-connector[bot] on 2026-11-25T05:27:09Z.


You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

<!-- greyfinch-sync:fxceless/victory-fork:comment:7153788352 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/716#issuecomment-7153788352). Originally posted by [chatgpt-codex-connector[bot]](https://github.com/chatgpt-codex-connector%5Bbot%5D) on 2026-11-25T05:27:09Z. --- You have reached your Codex usage limits for code reviews. You can see your limits in the [Codex usage dashboard](https://chatgpt.com/codex/cloud/settings/usage).
JRamos1993 commented 2026-11-25 07:06:16 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by JRamos1993 on 2026-11-25T06:28:39Z.


Offline check on the retail shader pack: no program gained or lost, but 17,346 programs' DXIL changes. So this changes code in most of the title's shaders, and needs an in-game look before it lands.

Setup: RTX 5090, Windows 11. victory translate --validate --list over the title's full shader pack (26,084 programs), main 310c6eb against this head (with #653 under it), with a local DXIL hash on each validated line.

main this PR
validated 25,382 25,382 (none new, none lost)
DXIL changed among those 17,346

A sample of 3 changed programs, dxc -dumpbin with SSA numbers normalized:

  • 4, 36 and 70 lines differ.
  • Mostly extra and / select / icmp, and in one, 20 dx.op.isHelperLane calls.
  • So these are real code changes, not only encoding (unlike the 59 in #215). They look like the helper-lane handling ported from upstream.
  • Since #653 alone changes nothing on this pack, these come from the 32 hand-ported fixes here.

I have not checked what the changes do in game.

AI use: Claude Code with Claude Opus 5.5 ran the pack, compared the dumps and wrote this. Nothing from the title is in it.

<!-- greyfinch-sync:fxceless/victory-fork:comment:7154829891 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/716#issuecomment-7154829891). Originally posted by [JRamos1993](https://github.com/JRamos1993) on 2026-11-25T06:28:39Z. --- **Offline check on the retail shader pack: no program gained or lost, but 17,346 programs' DXIL changes. So this changes code in most of the title's shaders, and needs an in-game look before it lands.** **Setup:** RTX 5090, Windows 11. `victory translate --validate --list` over the title's full shader pack (26,084 programs), `main` `310c6eb` against this head (with #653 under it), with a local DXIL hash on each validated line. | | `main` | this PR | |---|---|---| | validated | 25,382 | 25,382 (none new, none lost) | | DXIL changed among those | | **17,346** | **A sample of 3 changed programs**, `dxc -dumpbin` with SSA numbers normalized: - 4, 36 and 70 lines differ. - Mostly extra `and` / `select` / `icmp`, and in one, 20 `dx.op.isHelperLane` calls. - So these are real code changes, not only encoding (unlike the 59 in #215). They look like the helper-lane handling ported from upstream. - Since #653 alone changes nothing on this pack, these come from the 32 hand-ported fixes here. I have not checked what the changes do in game. AI use: Claude Code with Claude Opus 5.5 ran the pack, compared the dumps and wrote this. Nothing from the title is in it.
upstream-sync changed title from [PR #716] Upstream: 32 conflicting fixes ported by hand (stacked on #653) to [PR #716] Upstream: 31 conflicting fixes ported by hand (stacked on #653) 2026-11-25 08:08:47 +00:00
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/716:upstream-pr/716'
git switch 'upstream-pr/716'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/716'
git switch 'upstream-pr/716'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/716'
git switch 'upstream-pr/716'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/716'
git switch 'main'
git merge --squash 'upstream-pr/716'
git switch 'main'
git merge --ff-only 'upstream-pr/716'
git switch 'main'
git merge 'upstream-pr/716'
git push origin 'main'
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
fxceless/victory-fork!716
No description provided.