Fix/typed image atomic int64 #705

Closed
Abhishek-Sood wants to merge 7 commits from upstream-pr/705 into main
Abhishek-Sood commented 2026-11-24 07:08:07 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Abhishek-Sood on 2026-11-24T07:08:07Z.


No description provided.

<!-- greyfinch-sync:Marvisak/VIctory:issue:6576571656 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/705). Originally posted by [Abhishek-Sood](https://github.com/Abhishek-Sood) on 2026-11-24T07:08:07Z. --- _No description provided._
LAKSHYA-cmd-tech commented 2026-11-24 08:02:41 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by LAKSHYA-cmd-tech on 2026-11-24T07:41:58Z.

Review: APPROVED


Tested and verified on Windows 11 MSVC (Rust 1.98.1). \image_atomics_64_bit_lower_with_typed_int64_flag\ passes along with the full 70 unit tests in \ ictory-shader.

  • \dmask\ matching correctly distinguishes 32-bit (1/3) vs 64-bit (3/0xF cmpswap) atomic payloads.
  • Correctly sets \ lags::INT64 | flags::ATOMIC_INT64_ON_TYPED_RESOURCE\ with DXIL SFI0 feature bit \
<!-- greyfinch-sync:Marvisak/VIctory:review:6035399025 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/705#pullrequestreview-6035399025). Originally posted by [LAKSHYA-cmd-tech](https://github.com/LAKSHYA-cmd-tech) on 2026-11-24T07:41:58Z. **Review:** APPROVED --- Tested and verified on Windows 11 MSVC (Rust 1.98.1). \image_atomics_64_bit_lower_with_typed_int64_flag\ passes along with the full 70 unit tests in \ ictory-shader\. - \dmask\ matching correctly distinguishes 32-bit (1/3) vs 64-bit (3/0xF cmpswap) atomic payloads. - Correctly sets \ lags::INT64 | flags::ATOMIC_INT64_ON_TYPED_RESOURCE\ with DXIL SFI0 feature bit \
Abhishek-Sood commented 2026-11-24 08:02:46 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Abhishek-Sood on 2026-11-24T07:15:19Z.


The change adds 64-bit typed-image atomic lowering, including arithmetic, bitwise, min/max, swap, and compare-exchange operations. It also handles packing and unpacking 64-bit values across VGPR pairs, adds the required DXIL feature flags, and includes a regression test for the new lowering path.

What this change does
Adds lowering for 64-bit typed image atomic operations: add, subtract, bitwise operations, min/max, swap, and compare-exchange.
Packs pairs of 32-bit VGPR values into DXIL 64-bit integers and splits returned values back into register pairs.
Declares the required 64-bit integer and typed-resource atomic feature flags.
Adds a shader-lowering regression test covering the 64-bit typed-image atomic path.

Files changed
crates/victory-shader/src/emit/lower.rs — 64-bit value packing and typed-image atomic lowering.
crates/victory-shader/src/emit/shader.rs — required shader feature-flag mapping.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7124788379 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/705#issuecomment-7124788379). Originally posted by [Abhishek-Sood](https://github.com/Abhishek-Sood) on 2026-11-24T07:15:19Z. --- The change adds 64-bit typed-image atomic lowering, including arithmetic, bitwise, min/max, swap, and compare-exchange operations. It also handles packing and unpacking 64-bit values across VGPR pairs, adds the required DXIL feature flags, and includes a regression test for the new lowering path. What this change does Adds lowering for 64-bit typed image atomic operations: add, subtract, bitwise operations, min/max, swap, and compare-exchange. Packs pairs of 32-bit VGPR values into DXIL 64-bit integers and splits returned values back into register pairs. Declares the required 64-bit integer and typed-resource atomic feature flags. Adds a shader-lowering regression test covering the 64-bit typed-image atomic path. Files changed crates/victory-shader/src/emit/lower.rs — 64-bit value packing and typed-image atomic lowering. crates/victory-shader/src/emit/shader.rs — required shader feature-flag mapping.
catminou4 commented 2026-11-24 09:06:01 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by catminou4 on 2026-11-24T08:04:03Z.

Review: COMMENTED


Heads-up: this no longer merges cleanly with current main (7374bfb) — textual conflict in crates/victory-shader/src/emit/lower.rs. Needs a rebase.

Head itself is green on macOS 26 arm64, rustc 1.98.1 (cargo test -p victory-shader: 57 passed / 0 failed against its own base, +1 ungated test).

<!-- greyfinch-sync:Marvisak/VIctory:review:6035633744 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/705#pullrequestreview-6035633744). Originally posted by [catminou4](https://github.com/catminou4) on 2026-11-24T08:04:03Z. **Review:** COMMENTED --- Heads-up: this no longer merges cleanly with current main (`7374bfb`) — textual conflict in `crates/victory-shader/src/emit/lower.rs`. Needs a rebase. Head itself is green on macOS 26 arm64, rustc 1.98.1 (`cargo test -p victory-shader`: 57 passed / 0 failed against its own base, +1 ungated test).
catminou4 commented 2026-11-24 09:06:01 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by catminou4 on 2026-11-24T09:05:27Z.

Review: APPROVED


Re-checked after the rebase: merges cleanly with current main (8e79c80), and cargo test -p victory-shader --locked on macOS arm64 / rustc 1.98.1 → 71 passed / 0 failed (1 ignored, the Windows-only execution suite).

Static pass on the lowering: the dmask/cmpswap width table ((1,false)|(3,true) → 32-bit, (3,false)|(0xF,true) → 64-bit, anything else refused) is consistent, pack64 zero-extends both dwords before the shift/or, and the new ATOMIC_INT64_ON_TYPED_RESOURCE flag maps to SFI feature bit 0x40_0000 alongside the existing INT64 → 0x8000 path. Refusing unsupported widths instead of silently truncating is the right call.

Windows-side execution (the valu_tests/image_tests suites and the DXIL validator) is covered by the new CI; nothing in the diff is macOS-visible beyond the unit tests above.

<!-- greyfinch-sync:Marvisak/VIctory:review:6036376628 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/705#pullrequestreview-6036376628). Originally posted by [catminou4](https://github.com/catminou4) on 2026-11-24T09:05:27Z. **Review:** APPROVED --- Re-checked after the rebase: merges cleanly with current main (`8e79c80`), and `cargo test -p victory-shader --locked` on macOS arm64 / rustc 1.98.1 → **71 passed / 0 failed** (1 ignored, the Windows-only execution suite). Static pass on the lowering: the `dmask`/`cmpswap` width table (`(1,false)|(3,true)` → 32-bit, `(3,false)|(0xF,true)` → 64-bit, anything else refused) is consistent, `pack64` zero-extends both dwords before the shift/or, and the new `ATOMIC_INT64_ON_TYPED_RESOURCE` flag maps to SFI feature bit `0x40_0000` alongside the existing `INT64` → `0x8000` path. Refusing unsupported widths instead of silently truncating is the right call. Windows-side execution (the `valu_tests`/`image_tests` suites and the DXIL validator) is covered by the new CI; nothing in the diff is macOS-visible beyond the unit tests above.
justr4mzi commented 2026-11-24 10:03:38 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by justr4mzi on 2026-11-24T09:06:51Z.


Tested PR #705 (92ed309d) on Windows 11 with an AMD Radeon RX 6700 XT (RDNA2), Rust 1.98.1 (x86_64-pc-windows-msvc), and dxil.dll from Windows SDK 10.0.26100.0, against main (02f404e) as negative control.

victory translate --validate (full game shader set, 26,599 containers / 26,148 programs)

Build VS/PS (emitted / validated) CS (emitted / validated) MS (emitted / validated) 64-bit image atomic refusals Flags must match usage. validator errors
main (02f404e, negative control) 12,236 / 12,160 1,440 / 1,417 8,163 / 8,101 653 0
PR #705 (92ed309) 12,754 / 12,160 1,442 / 1,417 8,163 / 8,101 0 520
  • All 653 emit: a 64-bit image atomic refusals are cleared, emitting 520 extra programs (518 VS/PS + 2 CS; the remaining 133 programs advance to downstream refusals such as scalar memory read as data 604 -> 708 and barycentrics read directly 13 -> 36).
  • However, all 520 newly emitted programs fail dxil.dll validation with validator: error: Flags must match usage., resulting in +0 validated shaders (12,160 VS/PS and 1,417 CS unchanged).
  • Root cause from inspection of crates/victory-shader/src/emit/shader.rs in 92ed309: the PR sets ATOMIC_INT64_ON_TYPED_RESOURCE (1 << 27 / SFI0 0x40_0000), but programs accessing UAVs through ResourceDescriptorHeap[] also require the heap-resource int64 atomic flag (1 << 32 / SFI0 0x1000_0000). Note also that 92ed309 includes #696 and #706 in its branch history ahead of current main (02f404e).

Build and checks

  • cargo clippy -p victory-shader --lib: clean.
  • cargo xtask policy: 152 files ok.
  • cargo build --release -p victory: succeeded.
  • cargo test -p victory-shader -- --test-threads=1 and --all-targets: failed to compile test target on pre-existing main issue #719 (lowers(&words) missing rsrc2 argument at lower.rs:7021), unrelated to this PR.
  • No game data included; the title itself was not launched.

AI-assisted analysis and test execution (reviewed locally).

<!-- greyfinch-sync:Marvisak/VIctory:comment:7126976140 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/705#issuecomment-7126976140). Originally posted by [justr4mzi](https://github.com/justr4mzi) on 2026-11-24T09:06:51Z. --- Tested PR #705 (`92ed309d`) on Windows 11 with an AMD Radeon RX 6700 XT (RDNA2), Rust 1.98.1 (`x86_64-pc-windows-msvc`), and `dxil.dll` from Windows SDK `10.0.26100.0`, against `main` (`02f404e`) as negative control. ### `victory translate --validate` (full game shader set, 26,599 containers / 26,148 programs) | Build | VS/PS (emitted / validated) | CS (emitted / validated) | MS (emitted / validated) | `64-bit image atomic` refusals | `Flags must match usage.` validator errors | |---|---|---|---|---|---| | `main` (`02f404e`, negative control) | 12,236 / 12,160 | 1,440 / 1,417 | 8,163 / 8,101 | 653 | 0 | | PR #705 (`92ed309`) | 12,754 / **12,160** | 1,442 / **1,417** | 8,163 / 8,101 | 0 | **520** | - All 653 `emit: a 64-bit image atomic` refusals are cleared, emitting 520 extra programs (518 VS/PS + 2 CS; the remaining 133 programs advance to downstream refusals such as `scalar memory read as data` 604 -> 708 and `barycentrics read directly` 13 -> 36). - However, **all 520 newly emitted programs fail `dxil.dll` validation** with `validator: error: Flags must match usage.`, resulting in **+0 validated shaders** (`12,160` VS/PS and `1,417` CS unchanged). - Root cause from inspection of `crates/victory-shader/src/emit/shader.rs` in `92ed309`: the PR sets `ATOMIC_INT64_ON_TYPED_RESOURCE` (`1 << 27` / `SFI0` `0x40_0000`), but programs accessing UAVs through `ResourceDescriptorHeap[]` also require the heap-resource int64 atomic flag (`1 << 32` / `SFI0` `0x1000_0000`). Note also that `92ed309` includes `#696` and `#706` in its branch history ahead of current `main` (`02f404e`). ### Build and checks - `cargo clippy -p victory-shader --lib`: clean. - `cargo xtask policy`: `152 files ok`. - `cargo build --release -p victory`: succeeded. - `cargo test -p victory-shader -- --test-threads=1` and `--all-targets`: failed to compile test target on pre-existing `main` issue `#719` (`lowers(&words)` missing `rsrc2` argument at `lower.rs:7021`), unrelated to this PR. - No game data included; the title itself was not launched. *AI-assisted analysis and test execution (reviewed locally).*
dcastell1 commented 2026-11-24 11:04:09 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by dcastell1 on 2026-11-24T10:16:26Z.


This does not build on current main@ffe310e, so it needs a rebase:

error[E0061]: this function takes 4 arguments but 3 arguments were supplied
   --> crates\victory-shader\src\emit\lower.rs:7524:23
7524 |     let res = resource::track(&p, &native.layout, native.stage).unwrap();
     |                  ^^^^^^^^^^^^^^^------------------------------- argument #4 of type `Option<&structure::Structured>` is missing
error: could not compile `victory-shader` (lib test) due to 1 previous error

The PR is based on 8e79c80; resource::track gained the structured-access argument in between (that is #709's subject), so the branch predates it. Nothing else was run.

Environment: Windows 11 10.0.26300, NVIDIA GeForce RTX 5090 (driver 621.24), Rust 1.98.1, MSVC 14.44.35207, debug build, patch applied clean. AI-assisted (opencode).

<!-- greyfinch-sync:Marvisak/VIctory:comment:7128552112 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/705#issuecomment-7128552112). Originally posted by [dcastell1](https://github.com/dcastell1) on 2026-11-24T10:16:26Z. --- This does not build on current `main@ffe310e`, so it needs a rebase: ``` error[E0061]: this function takes 4 arguments but 3 arguments were supplied --> crates\victory-shader\src\emit\lower.rs:7524:23 7524 | let res = resource::track(&p, &native.layout, native.stage).unwrap(); | ^^^^^^^^^^^^^^^------------------------------- argument #4 of type `Option<&structure::Structured>` is missing error: could not compile `victory-shader` (lib test) due to 1 previous error ``` The PR is based on `8e79c80`; `resource::track` gained the structured-access argument in between (that is #709's subject), so the branch predates it. Nothing else was run. Environment: Windows 11 10.0.26300, NVIDIA GeForce RTX 5090 (driver 621.24), Rust 1.98.1, MSVC 14.44.35207, debug build, patch applied clean. AI-assisted (opencode).
pablogonz12 commented 2026-11-24 11:04:28 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by pablogonz12 on 2026-11-24T11:01:50Z.


Same result as I measured on #539, which covers the same 64-bit image atomics. Over the world's shaders (751 programs dumped from a run into the world, re-translated offline), this PR translates the same 4 extra pixel programs (670/751, none lost). Under vkd3d-proton (dxil-spirv 34f0ff8) all 4 fail spirv-val (OpAtomicUMin with a non-integer result type) unless #177's handle-key change is in as well. Details and numbers in my comment on #539.

Setup: RX 9070 XT, RADV (Mesa 26.3.1), CachyOS, vkd3d-proton master 30b0eb9.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7129562022 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/705#issuecomment-7129562022). Originally posted by [pablogonz12](https://github.com/pablogonz12) on 2026-11-24T11:01:50Z. --- Same result as I measured on #539, which covers the same 64-bit image atomics. Over the world's shaders (751 programs dumped from a run into the world, re-translated offline), this PR translates the same 4 extra pixel programs (670/751, none lost). Under vkd3d-proton (dxil-spirv `34f0ff8`) all 4 fail `spirv-val` (`OpAtomicUMin` with a non-integer result type) unless #177's handle-key change is in as well. Details and numbers in my comment on #539. Setup: RX 9070 XT, RADV (Mesa 26.3.1), CachyOS, vkd3d-proton master `30b0eb9`.
ErRusso commented 2026-11-24 12:04:29 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by ErRusso on 2026-11-24T11:19:18Z.


Audit: ✅ Looks good — verified & tested

Reviewed this PR as part of an audit of mergeable PRs.

  • Scope: crates/victory-shader/src/emit/lower.rs + shader.rs (+176/-26). Adds 64-bit typed image atomics: dmask=3 → atomicBinOp.i64, dmask=0xF (cmpswap) → atomicCompareExchange.i64, packing/unpacking the value through VGPR pairs via the new pack64/split64 helpers. Sets the DXIL feature bits INT64, ATOMIC_INT64_ON_TYPED_RESOURCE, and ATOMIC_INT64_ON_DESCRIPTOR_HEAP_RESOURCE.
  • Merges cleanly into main.
  • Tests: image_atomics_64_bit_lower_with_typed_int64_flag → passed. The test builds both a 64-bit add and cmpswap MIMG shader, lowers them, and asserts all three feature bits are present in the emitted DXIL SFI0 flags.
  • Correctness review: the width matrix (1/3 for 32-bit, 3/0xF for 64-bit, cmpswap takes twice the dwords) and the .glc old-value handling for the hi dword are handled correctly. comp is derived from width (0x105 vs 0x107), and sub negates the full i64.

No issues found. Nice, well-scoped feature with proper feature-bit declaration.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7129946066 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/705#issuecomment-7129946066). Originally posted by [ErRusso](https://github.com/ErRusso) on 2026-11-24T11:19:18Z. --- ## Audit: ✅ Looks good — verified & tested Reviewed this PR as part of an audit of mergeable PRs. - **Scope:** `crates/victory-shader/src/emit/lower.rs` + `shader.rs` (+176/-26). Adds 64-bit typed image atomics: `dmask=3` → `atomicBinOp.i64`, `dmask=0xF` (cmpswap) → `atomicCompareExchange.i64`, packing/unpacking the value through VGPR pairs via the new `pack64`/`split64` helpers. Sets the DXIL feature bits `INT64`, `ATOMIC_INT64_ON_TYPED_RESOURCE`, and `ATOMIC_INT64_ON_DESCRIPTOR_HEAP_RESOURCE`. - **Merges cleanly** into `main`. - **Tests:** `image_atomics_64_bit_lower_with_typed_int64_flag` → **passed**. The test builds both a 64-bit add and cmpswap MIMG shader, lowers them, and asserts all three feature bits are present in the emitted DXIL SFI0 flags. - **Correctness review:** the width matrix (1/3 for 32-bit, 3/0xF for 64-bit, cmpswap takes twice the dwords) and the `.glc` old-value handling for the hi dword are handled correctly. `comp` is derived from width (`0x105` vs `0x107`), and `sub` negates the full i64. No issues found. Nice, well-scoped feature with proper feature-bit declaration.
h0useadv commented 2026-11-24 13:02:09 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by h0useadv on 2026-11-24T12:36:57Z.


Offline coverage on main ffe310e (full retail shader pack, victory translate --validate, programs matched one by one): +520 programs validate, 0 newly fail; a 64-bit image atomic 653 → 0. #305, #539 and #705 give exactly the same 520 programs, so on coverage they're interchangeable and the choice can rest on review alone. Stacked with #180 and the lane-mask branch from #653: +1,193, 0 regressions. Full table: https://github.com/Marvisak/VIctory/issues/293#issuecomment-7131677641

AI-assisted (Claude Code). Counts only, no game data.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7131685405 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/705#issuecomment-7131685405). Originally posted by [h0useadv](https://github.com/h0useadv) on 2026-11-24T12:36:57Z. --- Offline coverage on `main` `ffe310e` (full retail shader pack, `victory translate --validate`, programs matched one by one): **+520 programs validate, 0 newly fail**; `a 64-bit image atomic` 653 → 0. #305, #539 and #705 give exactly the same 520 programs, so on coverage they're interchangeable and the choice can rest on review alone. Stacked with #180 and the lane-mask branch from #653: +1,193, 0 regressions. Full table: https://github.com/Marvisak/VIctory/issues/293#issuecomment-7131677641 AI-assisted (Claude Code). Counts only, no game data.
bittertea0323 commented 2026-11-24 15:04:01 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by bittertea0323 on 2026-11-24T14:24:17Z.


Verified offline: the class is gone and 518 more programs emit DXIL

Applied the branch's two-file diff on ffe310e + local diag changes; same container dump
(26,503 containers / 26,084 programs), same host, both runs.

metric before after
emit: a 64-bit image atomic 653 0
vertex+pixel programs emitting DXIL 12252 / 14027 12770 / 14027
compute programs emitting DXIL 1443 / 2582 1445 / 2582
mesh programs emitting DXIL 8214 / 8713 8214 / 8713
emit: a scalar memory read as data 771 875

+518 vertex/pixel programs reaching DXIL is the largest single-patch gain we have measured
offline so far.

One thing to know before merge: a scalar memory read as data rose by 104. That is the next
failure being exposed, not a regression — those programs used to stop at the atomic and now
translate far enough to hit something else. It does mean this class (875) becomes the top
remaining blocker once #705 lands, so it is the natural next thing to attack.

Repro: cargo build --release -p victory then victory translate <container dump>; nothing
else in the failure table moved.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7134317777 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/705#issuecomment-7134317777). Originally posted by [bittertea0323](https://github.com/bittertea0323) on 2026-11-24T14:24:17Z. --- ## Verified offline: the class is gone and 518 more programs emit DXIL Applied the branch's two-file diff on `ffe310e` + local diag changes; same container dump (26,503 containers / 26,084 programs), same host, both runs. | metric | before | after | |---|---|---| | `emit: a 64-bit image atomic` | 653 | **0** | | vertex+pixel programs emitting DXIL | 12252 / 14027 | **12770 / 14027** | | compute programs emitting DXIL | 1443 / 2582 | 1445 / 2582 | | mesh programs emitting DXIL | 8214 / 8713 | 8214 / 8713 | | `emit: a scalar memory read as data` | 771 | 875 | +518 vertex/pixel programs reaching DXIL is the largest single-patch gain we have measured offline so far. One thing to know before merge: `a scalar memory read as data` rose by 104. That is the *next* failure being exposed, not a regression — those programs used to stop at the atomic and now translate far enough to hit something else. It does mean this class (875) becomes the top remaining blocker once #705 lands, so it is the natural next thing to attack. Repro: `cargo build --release -p victory` then `victory translate <container dump>`; nothing else in the failure table moved.
dpalacios69 commented 2026-11-24 16:05:02 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by dpalacios69 on 2026-11-24T15:07:55Z.


Independent check of the current head ee037b0 on Linux (cargo test -p victory-shader --locked; no GPU). It already contains main (ffe310e).

The tests do not compile. resource::track takes a fourth argument on main (lanes: Option<&Structured>, resource.rs:147), and one test still calls it with three: error[E0061]: this function takes 4 arguments but 3 arguments were supplied at crates/victory-shader/src/emit/lower.rs:7524:23. The other calls in the file already pass Some(&st); this one needs the same. cargo clippy -p victory-shader --lib is clean.

For anyone choosing between the three 64-bit image atomics PRs (#305, #539, #705; they conflict in pairs in lower.rs and shader.rs), what I could verify statically on ffe310e:

  • All three lower the same 11 operations (add, sub, and, or, xor, smin, smax, umin, umax, swap, cmpswap) as i64 (0x107), and all three set the same two feature bits (1 << 27 and 1 << 32) under different names: #305 ATOMIC_INT64_ON_TYPED_RESOURCE / ATOMIC_INT64_ON_HEAP_RESOURCE, #705 ..._ON_TYPED_RESOURCE / ..._ON_DESCRIPTOR_HEAP_RESOURCE, #539 ATOMIC_INT64_TYPED / ATOMIC_INT64_HEAP. None of these exists on main yet.
  • #305 sets both bits together and unconditionally (lower.rs:5707-5708); #705 sets the heap bit only when a heap handle is used (:5580).
  • Tests: #305 and #705 add one test each; #539 adds none. #539 creates its own heap handle, which sidesteps a cache collision with the float view that #177 also addresses.

Only the first point is a defect in this PR; the rest is information for whoever decides the order. AI-assisted; no game data.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7135509375 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/705#issuecomment-7135509375). Originally posted by [dpalacios69](https://github.com/dpalacios69) on 2026-11-24T15:07:55Z. --- Independent check of the current head `ee037b0` on Linux (`cargo test -p victory-shader --locked`; no GPU). It already contains `main` (`ffe310e`). **The tests do not compile.** `resource::track` takes a fourth argument on `main` (`lanes: Option<&Structured>`, `resource.rs:147`), and one test still calls it with three: `error[E0061]: this function takes 4 arguments but 3 arguments were supplied` at `crates/victory-shader/src/emit/lower.rs:7524:23`. The other calls in the file already pass `Some(&st)`; this one needs the same. `cargo clippy -p victory-shader --lib` is clean. For anyone choosing between the three 64-bit image atomics PRs (#305, #539, #705; they conflict in pairs in `lower.rs` and `shader.rs`), what I could verify statically on `ffe310e`: - All three lower the same 11 operations (add, sub, and, or, xor, smin, smax, umin, umax, swap, cmpswap) as `i64` (`0x107`), and all three set the same two feature bits (`1 << 27` and `1 << 32`) under different names: #305 `ATOMIC_INT64_ON_TYPED_RESOURCE` / `ATOMIC_INT64_ON_HEAP_RESOURCE`, #705 `..._ON_TYPED_RESOURCE` / `..._ON_DESCRIPTOR_HEAP_RESOURCE`, #539 `ATOMIC_INT64_TYPED` / `ATOMIC_INT64_HEAP`. None of these exists on `main` yet. - #305 sets both bits together and unconditionally (`lower.rs:5707-5708`); #705 sets the heap bit only when a heap handle is used (`:5580`). - Tests: #305 and #705 add one test each; #539 adds none. #539 creates its own heap handle, which sidesteps a cache collision with the float view that #177 also addresses. Only the first point is a defect in this PR; the rest is information for whoever decides the order. AI-assisted; no game data.
bittertea0323 commented 2026-11-24 16:05:04 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by bittertea0323 on 2026-11-24T15:11:34Z.


Useful: the tree you measured is not the tree we measured, which narrows the regression.

Our A/B in this thread ran on 4efabc4 (the head at the time), and there
cargo test --offline -p victory-shader --lib compiled and ran: 129 passed, 15 failed, 1 ignored.
(The 15 failures are all "no SM 6.6 hardware device; skipped" — environmental, this host has no
device available to those GPU numerical tests at that moment, and they are unrelated to #705.)

So resource::track still took three arguments at 4efabc4. The arity change to four
(lanes: Option<&Structured>) came in with main's later commits, and the stale call at
lower.rs:7524 is wherever #705's branch stopped tracking main. Rebased on
ee037b0's base it will need that fourth argument like the other call sites in the file.

Our offline numbers (653 → 0, +518 vertex/pixel programs) stand for 4efabc4; they should not
change if the rebase is mechanical, but I have not measured ee037b0.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7135610703 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/705#issuecomment-7135610703). Originally posted by [bittertea0323](https://github.com/bittertea0323) on 2026-11-24T15:11:34Z. --- Useful: the tree you measured is not the tree we measured, which narrows the regression. Our A/B in this thread ran on `4efabc4` (the head at the time), and there `cargo test --offline -p victory-shader --lib` **compiled and ran**: 129 passed, 15 failed, 1 ignored. (The 15 failures are all "no SM 6.6 hardware device; skipped" — environmental, this host has no device available to those GPU numerical tests at that moment, and they are unrelated to #705.) So `resource::track` still took three arguments at `4efabc4`. The arity change to four (`lanes: Option<&Structured>`) came in with `main`'s later commits, and the stale call at `lower.rs:7524` is wherever #705's branch stopped tracking `main`. Rebased on `ee037b0`'s base it will need that fourth argument like the other call sites in the file. Our offline numbers (653 → 0, +518 vertex/pixel programs) stand for `4efabc4`; they should not change if the rebase is mechanical, but I have not measured `ee037b0`.
Abhishek-Sood commented 2026-11-24 16:05:08 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Abhishek-Sood on 2026-11-24T15:16:51Z.


can anyone tell whats the final benchmarks or the bottlenecks that we are currently encountering or at ? i need some clear info

<!-- greyfinch-sync:Marvisak/VIctory:comment:7135759790 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/705#issuecomment-7135759790). Originally posted by [Abhishek-Sood](https://github.com/Abhishek-Sood) on 2026-11-24T15:16:51Z. --- can anyone tell whats the final benchmarks or the bottlenecks that we are currently encountering or at ? i need some clear info
dpalacios69 commented 2026-11-24 16:05:09 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by dpalacios69 on 2026-11-24T15:20:45Z.


@Abhishek-Sood there is no official benchmark yet, but the picture is fairly clear from the README status and the testers' runs in #71. Summary, with the sources:

Where it stands (README, 2026-11-23). Menus, intro video and loading run at 30 fps. The world is reached but frames take 0.5-1.8 s and most of the scene is dark or missing.

Bottlenecks, in order of how much they block:

  1. The GPU hangs shortly after entering the world on NVIDIA (TDR, DEVICE_HUNG). Measured causes: translated loops running to the 2^20 cap (a lower VICTORY_SHADER_LOOP_LIMIT keeps the run alive: h0useadv, Machad3x), unbounded root SRVs (#493 alone: 19 min in the world vs ~20 s on main on an RTX 4090), and wave64 compute on 32-lane GPUs (#189). Sunkiller-qc's merge order is the best map of this.
  2. Shaders that don't translate, so draws are dropped. README: mesh 8,191/8,506, vertex/pixel 10,617/12,346, compute 1,643/2,539. 64-bit image atomics are listed as missing, which is what your PR is about; bittertea0323's A/B measured 653 refused programs going to 0 on 4efabc4.
  3. Slow frames even when the device survives (0.1-1.5 fps in the tester runs), mostly from those loops and compute passes.

For #705 itself, the next step is small: the current head ee037b0 already contains main, but the test at lower.rs:7524 still calls resource::track with 3 arguments (it takes 4 now, resource.rs:147), so cargo test -p victory-shader doesn't compile. Passing Some(&st) like the other calls fixes it. #305 and #539 cover the same ground and conflict with yours, so it may be worth asking which one the maintainer wants to land.

AI-assisted; no game data.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7135868160 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/705#issuecomment-7135868160). Originally posted by [dpalacios69](https://github.com/dpalacios69) on 2026-11-24T15:20:45Z. --- @Abhishek-Sood there is no official benchmark yet, but the picture is fairly clear from the README status and the testers' runs in #71. Summary, with the sources: **Where it stands (README, 2026-11-23).** Menus, intro video and loading run at 30 fps. The world is reached but frames take 0.5-1.8 s and most of the scene is dark or missing. **Bottlenecks, in order of how much they block:** 1. **The GPU hangs shortly after entering the world on NVIDIA** (TDR, `DEVICE_HUNG`). Measured causes: translated loops running to the 2^20 cap (a lower `VICTORY_SHADER_LOOP_LIMIT` keeps the run alive: [h0useadv](https://github.com/Marvisak/VIctory/issues/71#issuecomment-7133909214), [Machad3x](https://github.com/Marvisak/VIctory/issues/71#issuecomment-7133316962)), unbounded root SRVs (#493 alone: 19 min in the world vs ~20 s on `main` on an RTX 4090), and wave64 compute on 32-lane GPUs (#189). [Sunkiller-qc's merge order](https://github.com/Marvisak/VIctory/issues/71#issuecomment-7133102027) is the best map of this. 2. **Shaders that don't translate, so draws are dropped.** README: mesh 8,191/8,506, vertex/pixel 10,617/12,346, compute 1,643/2,539. 64-bit image atomics are listed as missing, which is what your PR is about; [bittertea0323's A/B](https://github.com/Marvisak/VIctory/pull/705#issuecomment-7135610703) measured 653 refused programs going to 0 on `4efabc4`. 3. **Slow frames** even when the device survives (0.1-1.5 fps in the tester runs), mostly from those loops and compute passes. **For #705 itself**, the next step is small: the current head `ee037b0` already contains `main`, but the test at `lower.rs:7524` still calls `resource::track` with 3 arguments (it takes 4 now, `resource.rs:147`), so `cargo test -p victory-shader` doesn't compile. Passing `Some(&st)` like the other calls fixes it. #305 and #539 cover the same ground and conflict with yours, so it may be worth asking which one the maintainer wants to land. AI-assisted; no game data.
muhammed-aksoy commented 2026-11-24 18:05:37 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by muhammed-aksoy on 2026-11-24T17:16:28Z.


I tested ee037b0 on Windows 11 with Rust 1.98.1 and the Windows SDK DXIL validator. With the following test-fixture change in crates/victory-shader/src/emit/lower.rs, the serial shader suite passed 121 tests, with zero failures and one ignored.

-            let res = resource::track(&p, &native.layout, native.stage).unwrap();
+            let res = resource::track(&p, &native.layout, native.stage, None).unwrap();

None preserves the original fixture's tracking behavior. This run used synthetic inputs. AI-assisted.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7138948103 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/705#issuecomment-7138948103). Originally posted by [muhammed-aksoy](https://github.com/muhammed-aksoy) on 2026-11-24T17:16:28Z. --- I tested `ee037b0` on Windows 11 with Rust 1.98.1 and the Windows SDK DXIL validator. With the following test-fixture change in `crates/victory-shader/src/emit/lower.rs`, the serial shader suite passed 121 tests, with zero failures and one ignored. ```diff - let res = resource::track(&p, &native.layout, native.stage).unwrap(); + let res = resource::track(&p, &native.layout, native.stage, None).unwrap(); ``` `None` preserves the original fixture's tracking behavior. This run used synthetic inputs. AI-assisted.
alexdeliu commented 2026-11-24 18:05:43 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by alexdeliu on 2026-11-24T17:24:09Z.


Merged onto main @ ffe310eb, this PR (ee037b0c) no longer compiles its tests. crates/victory-shader/src/emit/lower.rs:7524 calls resource::track with 3 arguments. Since 6638098c it takes a 4th, lanes: Option<&Structured>; main's tests pass Some(&st) with let st = structure::structure(&p).unwrap();.

Checked with CI's steps (both clippy runs with -D warnings, cargo test --workspace) on Windows 11, AMD RX 9070. Every open PR: https://gist.github.com/alexdeliu/ef9ef0ebc1776ff104b5aa8eaea18e87

<!-- greyfinch-sync:Marvisak/VIctory:comment:7139139586 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/705#issuecomment-7139139586). Originally posted by [alexdeliu](https://github.com/alexdeliu) on 2026-11-24T17:24:09Z. --- Merged onto `main` @ `ffe310eb`, this PR (`ee037b0c`) no longer compiles its tests. `crates/victory-shader/src/emit/lower.rs:7524` calls `resource::track` with 3 arguments. Since 6638098c it takes a 4th, `lanes: Option<&Structured>`; main's tests pass `Some(&st)` with `let st = structure::structure(&p).unwrap();`. <sub>Checked with CI's steps (both clippy runs with `-D warnings`, `cargo test --workspace`) on Windows 11, AMD RX 9070. Every open PR: https://gist.github.com/alexdeliu/ef9ef0ebc1776ff104b5aa8eaea18e87</sub>
upstream-sync closed this pull request 2026-11-25 01:04:51 +00:00
Marvisak commented 2026-11-25 01:07:50 +00:00 (Migrated from github.com)

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


Automated triage for the maintainers. Closing because this change is already in main, or main has since replaced the code it patches.

Empty description; the same 64-bit image atomics as #305, which are in main.

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:7148537064 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/705#issuecomment-7148537064). Originally posted by [Marvisak](https://github.com/Marvisak) on 2026-11-25T00:27:55Z. --- Automated triage for the maintainers. Closing because this change is already in `main`, or `main` has since replaced the code it patches. Empty description; the same 64-bit image atomics as #305, which are in main. 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!705
No description provided.