Repository navigation
Fix/typed image atomic int64 - #705
Abhishek-Sood wants to merge 7 commits into
Conversation
|
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 Files changed |
LAKSHYA-cmd-tech
left a comment
There was a problem hiding this comment.
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 \
catminou4
left a comment
There was a problem hiding this comment.
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).
92d6d41 to
92ed309
Compare
catminou4
left a comment
There was a problem hiding this comment.
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.
|
Tested PR #705 (
|
| 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 atomicrefusals are cleared, emitting 520 extra programs (518 VS/PS + 2 CS; the remaining 133 programs advance to downstream refusals such asscalar memory read as data604 -> 708 andbarycentrics read directly13 -> 36). - However, all 520 newly emitted programs fail
dxil.dllvalidation withvalidator: error: Flags must match usage., resulting in +0 validated shaders (12,160VS/PS and1,417CS unchanged). - Root cause from inspection of
crates/victory-shader/src/emit/shader.rsin92ed309: the PR setsATOMIC_INT64_ON_TYPED_RESOURCE(1 << 27/SFI00x40_0000), but programs accessing UAVs throughResourceDescriptorHeap[]also require the heap-resource int64 atomic flag (1 << 32/SFI00x1000_0000). Note also that92ed309includes#696and#706in its branch history ahead of currentmain(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=1and--all-targets: failed to compile test target on pre-existingmainissue#719(lowers(&words)missingrsrc2argument atlower.rs:7021), unrelated to this PR.- No game data included; the title itself was not launched.
AI-assisted analysis and test execution (reviewed locally).
|
This does not build on current The PR is based on 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). |
|
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 Setup: RX 9070 XT, RADV (Mesa 26.3.1), CachyOS, vkd3d-proton master |
Audit: ✅ Looks good — verified & testedReviewed this PR as part of an audit of mergeable PRs.
No issues found. Nice, well-scoped feature with proper feature-bit declaration. |
|
Offline coverage on AI-assisted (Claude Code). Counts only, no game data. |
The DXIL of a 64-bit image atomic (Marvisak#705) sets the typed and heap int64 atomic feature bits. The host pipeline now reads the module's SFI0 mask and refuses it (logged once) unless OPTIONS9 and OPTIONS11 report the support, instead of failing in pipeline creation on another GPU. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Verified offline: the class is gone and 518 more programs emit DXILApplied the branch's two-file diff on
+518 vertex/pixel programs reaching DXIL is the largest single-patch gain we have measured One thing to know before merge: Repro: |
|
Independent check of the current head The tests do not compile. For anyone choosing between the three 64-bit image atomics PRs (#305, #539, #705; they conflict in pairs in
Only the first point is a defect in this PR; the rest is information for whoever decides the order. AI-assisted; no game data. |
|
Useful: the tree you measured is not the tree we measured, which narrows the regression. Our A/B in this thread ran on So Our offline numbers (653 → 0, +518 vertex/pixel programs) stand for |
|
can anyone tell whats the final benchmarks or the bottlenecks that we are currently encountering or at ? i need some clear info |
|
@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:
For #705 itself, the next step is small: the current head AI-assisted; no game data. |
Taken from Marvisak#705 because a real run refuses them seven times (latest dump, 'a 64-bit image atomic is not supported'). The change adds ATOMIC_INT64_ON_TYPED_RESOURCE and ATOMIC_INT64_ON_DESCRIPTOR_HEAP_RESOURCE to the shader flags and maps them to SFI0 bits 22 and 24, which is what DXC's ShaderFeatureInfo calls AtomicInt64OnTypedResource and AtomicInt64OnDescriptorHeapResource. Their own test asserts both bits after lowering. Merged by hand: one conflict block where the PR's side was empty (its test had already landed), and one test call site that needed the lanes argument the tracker gained. Gate: both Clippy commands, 656 passed / 14 ignored / 0 failed, policy 193 files, fmt clean. Applied as the net diff of upstream PR Marvisak#705 (head ee037b0).
- the net change of Marvisak#705 on current main - tests of this and of Marvisak#694 pass the lane structure argument resource::track now takes
|
I tested - let res = resource::track(&p, &native.layout, native.stage).unwrap();
+ let res = resource::track(&p, &native.layout, native.stage, None).unwrap();
|
|
Merged onto Checked with CI's steps (both clippy runs with |
|
Automated triage for the maintainers. Closing because this change is already in 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. |
No description provided.