Upstream: 10 fixes taken from upstream's rewrite commits (stacked on #716) #767

Open
coderanonymus wants to merge 160 commits from upstream-pr/767 into main
coderanonymus commented 2026-11-25 06:52:38 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by coderanonymus on 2026-11-25T06:52:38Z.


Stacked on #716, which is stacked on #653. This PR's own commits are the 11 after #716.

Rebased on main (a26859f)

Rebased with #653 and #716 onto a26859f. The owner's two newest commits already do two of the pieces, so they're dropped here, together with the three commits that only supported them:

  • byte-copied descriptor records mirrored at submission (a26859f, from #305);
  • the shader cache keyed on the translator's source and switches (8dd30ab).

A read-only review checked every remaining commit against the owner's two commits for duplicates and clashes, and found none. Heap constant buffers as raw views now meet the owner's byte-copy sync: every CBV record the sync mirrors becomes a buffer slot that heap_buffers makes and refreshes. Before, it was nulled. That's more correct, at a cost not yet measured.

Clippy passes with and without --all-features on a clean build, Linux tests (274) pass, and so does the asset policy.

Why

Upstream's maintainer landed large commits that re-implement parts of this fork's own work in upstream's way: title memory through a page table, FidelityFX, view copies, the shader pack. They can't be merged here. A read-only triage of each one still found specific fixes inside them that the fork lacks. This PR takes those pieces, each rewritten for the fork's design.

What

Each commit says which upstream commit it is "ported in part" from, keeps the upstream author, and has a Port notes paragraph.

Shaders

  • Cube samples with gradients (image_sample_d/_d_cl on a cube):
    • The level was 1.44 times too high. DXIL's Log is already base 2, and the fork multiplied it by LOG2_E.
    • _cl read its clamp but never applied it.
  • s_min/s_max now set SCC from their compare (RDNA2: whether the first operand was chosen), not from result != 0. v_cmp_f/v_cmp_tru lower to constants.
  • Pixel programs that kill lanes and then export several targets (alpha-tested MRT) were refused whole ("a conditional export"). Exports before a discarding done export now translate. Level queries skip the slice coordinate.
  • Register-relative moves (v_movrel*) reach only what a proven upper bound on M0 allows (upstream's range.rs). Programs that keep descriptor dwords or masks above a small indexed array are no longer refused.
  • A lane mask with lanes outside the block, read as a number (for example s_not of a ballot) is computed from its scalar op, not refused.
  • image_gather4_l through a clamp-to-black-border sampler: a texel outside the view reads 0, as on the console. The fork clamped it to the edge texel, so meshlets at the screen edge culled against the wrong depth.
  • Tests: upstream's instruction-semantics and control-flow test files, fitted to the fork's harness. They are Windows-only GPU tests.

GPU

  • Constant buffers in the title's view-heap slots are raw views. They read zeros when not 256-byte aligned on the host, and were not refreshed.
  • A stream pipeline's last subobject is read only if the stream holds all of it.
  • Host copy refresh: a host copy is refreshed once per submission until a title write. Later lists in the same submission no longer copy it again.

Mine, from the stack's review

  • The semantics tests no longer list as known defects two bugs this stack fixed: s_min/s_max SCC and v_cmp_f/v_cmp_tru. Their checks now run.

Left out

Two pieces were rejected after their repair round, and I didn't take them:

  • The buffer guard from d71c388 (a computed heap index landing on a texture slot). The port also sent constant buffer slots to a null view, so reads that work today would return zeros.
  • Phi-edge liveness from a7fc47a. The code holds up, but it claimed a refusal it doesn't give. Getting this one right needs more work than one round.

How it was made and reviewed

Ultracode workflow:

  • One agent per piece, each in its own worktree, given the triage's notes.
  • A skeptic reviewed each piece, with one repair round where needed.
  • The stack then got a static review for interactions: between the shader pieces, between the GPU pieces, and with #668's SHADER_HEAPS lock. The lock review found that the heap sync takes SHADER_HEAPS under submitted, then leaf locks only, so the order stays acyclic with #668. The two branches merge cleanly.

Verification

Checked in a dedicated worktree with fresh target directories:

  • cargo clippy --workspace --all-targets --locked -- -D warnings, and the same with --all-features, for x86_64-pc-windows-msvc: clean.
  • Linux tests: 274 pass in all, victory-shader among them. xtask passes, including the asset policy (emit/lower.rs is under its 512 KiB). formats, core, pipeline and game pass.
  • Every shader piece has a Linux test that fails without it.
  • Not run: the Windows and GPU tests, or the game. The GPU pieces and the new GPU tests were type-checked and reasoned through, not executed. None of this is verified on screen.

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

🤖 Generated with Claude Code

<!-- greyfinch-sync:fxceless/victory-fork:issue:6598981596 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/767). Originally posted by [coderanonymus](https://github.com/coderanonymus) on 2026-11-25T06:52:38Z. --- Stacked on #716, which is stacked on #653. This PR's own commits are the 11 after #716. ## Rebased on main (a26859f) Rebased with #653 and #716 onto a26859f. The owner's two newest commits already do two of the pieces, so they're dropped here, together with the three commits that only supported them: - byte-copied descriptor records mirrored at submission (a26859f, from #305); - the shader cache keyed on the translator's source and switches (8dd30ab). A read-only review checked every remaining commit against the owner's two commits for duplicates and clashes, and found none. Heap constant buffers as raw views now meet the owner's byte-copy sync: every CBV record the sync mirrors becomes a buffer slot that `heap_buffers` makes and refreshes. Before, it was nulled. That's more correct, at a cost not yet measured. Clippy passes with and without `--all-features` on a clean build, Linux tests (274) pass, and so does the asset policy. ## Why Upstream's maintainer landed large commits that re-implement parts of this fork's own work in upstream's way: title memory through a page table, FidelityFX, view copies, the shader pack. They can't be merged here. A read-only triage of each one still found specific fixes inside them that the fork lacks. This PR takes those pieces, each rewritten for the fork's design. ## What Each commit says which upstream commit it is "ported in part" from, keeps the upstream author, and has a *Port notes* paragraph. **Shaders** - **Cube samples with gradients (`image_sample_d`/`_d_cl` on a cube):** - The level was 1.44 times too high. DXIL's Log is already base 2, and the fork multiplied it by LOG2_E. - `_cl` read its clamp but never applied it. - **`s_min`/`s_max`** now set SCC from their compare (RDNA2: whether the first operand was chosen), not from `result != 0`. **`v_cmp_f`/`v_cmp_tru`** lower to constants. - **Pixel programs that kill lanes and then export several targets** (alpha-tested MRT) were refused whole ("a conditional export"). Exports before a discarding done export now translate. Level queries skip the slice coordinate. - **Register-relative moves** (`v_movrel*`) reach only what a proven upper bound on M0 allows (upstream's `range.rs`). Programs that keep descriptor dwords or masks above a small indexed array are no longer refused. - **A lane mask with lanes outside the block, read as a number** (for example `s_not` of a ballot) is computed from its scalar op, not refused. - **`image_gather4_l` through a clamp-to-black-border sampler:** a texel outside the view reads 0, as on the console. The fork clamped it to the edge texel, so meshlets at the screen edge culled against the wrong depth. - **Tests:** upstream's instruction-semantics and control-flow test files, fitted to the fork's harness. They are Windows-only GPU tests. **GPU** - **Constant buffers in the title's view-heap slots** are raw views. They read zeros when not 256-byte aligned on the host, and were not refreshed. - **A stream pipeline's last subobject** is read only if the stream holds all of it. - **Host copy refresh:** a host copy is refreshed once per submission until a title write. Later lists in the same submission no longer copy it again. **Mine, from the stack's review** - The semantics tests no longer list as known defects two bugs this stack fixed: `s_min`/`s_max` SCC and `v_cmp_f`/`v_cmp_tru`. Their checks now run. ## Left out Two pieces were rejected after their repair round, and I didn't take them: - **The buffer guard from d71c388** (a computed heap index landing on a texture slot). The port also sent constant buffer slots to a null view, so reads that work today would return zeros. - **Phi-edge liveness from a7fc47a.** The code holds up, but it claimed a refusal it doesn't give. Getting this one right needs more work than one round. ## How it was made and reviewed Ultracode workflow: - One agent per piece, each in its own worktree, given the triage's notes. - A skeptic reviewed each piece, with one repair round where needed. - The stack then got a static review for interactions: between the shader pieces, between the GPU pieces, and with #668's `SHADER_HEAPS` lock. The lock review found that the heap sync takes `SHADER_HEAPS` under `submitted`, then leaf locks only, so the order stays acyclic with #668. The two branches merge cleanly. ## Verification Checked in a dedicated worktree with fresh target directories: - `cargo clippy --workspace --all-targets --locked -- -D warnings`, and the same with `--all-features`, for `x86_64-pc-windows-msvc`: clean. - Linux tests: 274 pass in all, victory-shader among them. xtask passes, including the asset policy (`emit/lower.rs` is under its 512 KiB). formats, core, pipeline and game pass. - Every shader piece has a Linux test that fails without it. - **Not run:** the Windows and GPU tests, or the game. The GPU pieces and the new GPU tests were type-checked and reasoned through, not executed. None of this is verified on screen. No game data used; the game isn't named in the tree. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
chatgpt-codex-connector[bot commented 2026-11-25 07:06:18 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by chatgpt-codex-connector[bot] on 2026-11-25T06:52:48Z.


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-25T06:52:44.507729Z
We couldn’t complete this review. Comment @codex review to try again.
c15c1d4 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:7155254255 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/767#issuecomment-7155254255). Originally posted by [chatgpt-codex-connector[bot]](https://github.com/chatgpt-codex-connector%5Bbot%5D) on 2026-11-25T06:52:48Z. --- <!-- codex-pull-request-review-summary --> <!-- codex-review-state:v1 {"code_review":{"commit_sha":"c15c1d4d2b9e67906ca568db264f884a793c9b1a","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-25T06:52:44.507729Z">2026-11-25T06:52:44.507729Z</relative-time><br/>We couldn’t complete this review. Comment `@codex review` to try again. | `c15c1d4` | 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 07:06:18 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by chatgpt-codex-connector[bot] on 2026-11-25T06:52:50Z.


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:7155254799 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/767#issuecomment-7155254799). Originally posted by [chatgpt-codex-connector[bot]](https://github.com/chatgpt-codex-connector%5Bbot%5D) on 2026-11-25T06:52:50Z. --- 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).
upstream-sync changed title from [PR #767] Upstream: 12 fixes taken from upstream's rewrite commits (stacked on #716) to [PR #767] Upstream: 10 fixes taken from upstream's rewrite commits (stacked on #716) 2026-11-25 08:08:48 +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/767:upstream-pr/767'
git switch 'upstream-pr/767'

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/767'
git switch 'upstream-pr/767'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/767'
git switch 'upstream-pr/767'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/767'
git switch 'main'
git merge --squash 'upstream-pr/767'
git switch 'main'
git merge --ff-only 'upstream-pr/767'
git switch 'main'
git merge 'upstream-pr/767'
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!767
No description provided.