Shaders: heap handles are reused only for the same resource properties #1951
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1953"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from Marvisak/VIctory. Originally posted by RaghavVijayanand on 2026-11-25T01:45:07Z.
Lowering caches one annotated heap handle per block, descriptor load, first dword and sampler flag, but keyed it on the first dword of the resource properties only (kind and UAV bit). Two uses of one descriptor in the same block that differ in the second dword, such as an
image_load(four F32) and an image atomic (one U32) on the same texture UAV, shared whichever handle was annotated first. The later access then ran with the other's component type. The key now holds both dwords.This PR was opened as "64-bit image atomics". Upstream landed its own in
0b35b7fin the meantime, so that part is dropped and only this fix remains, rebased on current main.Test:
valu_tests::a_load_and_an_atomic_of_one_texture_have_their_own_handleslowers animage_loadand 32-bit image atomics of one texture in one block, in both orders. It then checks, in the moduledxc -dumpbinprints, that both a{4098, 1033}and a{4098, 261}handle exist.On this machine, 5 tests fail on current main itself, with or without this change:
descriptor::host::tests::dynamic_slots_are_held_until_releasedmemory::tests::lists_share_a_table_and_copies_keep_their_viewsstride_tests::a_heap_buffer_read_by_element_takes_the_views_stridestride_tests::a_heap_buffer_read_where_no_buffer_view_is_reads_zerossynthetic_tests::gathers_at_a_level_match_the_hardwareEverything else passes, and clippy passes with
-D warnings, with and without--all-features.Imported from Marvisak/VIctory. Originally posted by copilot-pull-request-reviewer[bot] on 2026-11-25T01:45:15Z.
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.
Imported from Marvisak/VIctory. Originally posted by upipibi on 2026-11-25T01:51:46Z.
Overlap note, from reading, not a run: this branch is based on
ffe310e, which predates0b35b7fonmain. That commit already lowers 64-bit image atomics: theR32G32_UINTview with the low dword in R, i64 data,flags::INT64 | ATOMIC64_TYPED | ATOMIC64_HEAP, and theimage_atomics_of_64_bitstest. GitHub reports this PR as conflicting. #1899 was the same case. If something here isn't inmainyet, rebasing it down to that part would keep it reviewable.AI-assisted (Claude Code).
Imported from Marvisak/VIctory. Originally posted by Headache3318 on 2026-11-25T02:01:03Z.
Tested on Linux (Arch, kernel 7.3.5, 3× RTX 4090 driver 620.73.04), Rust 1.98.1 (pinned). PR head
7d9a51bapplied cleanly onto currentmainccfb029.cargo test -p victory-shader --locked: 96 passed, 0 failed, 1 ignored. All tests pass. The new 64-bit image atomic tests are GPU-specific (require dxil.dll/WARP) and are skipped on Linux.cargo clippy -p victory-shader --all-targets -- -D warnings: 2 errors (vs 4 on main). The PR net-reduces clippy errors by fixing unused imports.Not tested: Windows MSVC build, the title itself. AI-assisted.
[PR #1953] Shaders: 64-bit image atomicsto [PR #1953] Shaders: heap handles are reused only for the same resource propertiesImported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T02:18:53Z.
Automated triage for the maintainers.
This pull request no longer merges cleanly into
main(conflicts incrates/victory-shader/src/emit/lower.rs). It will be reviewed once it is rebased onto the currentmain. The earlier verdict (merge candidate) was for an older state ofmain.Generated by Claude Code
Imported from Marvisak/VIctory. Originally posted by catminou4 on 2026-11-25T03:14:09Z.
Review: APPROVED
Tested locally: macOS arm64, rustc 1.98.1, PR head merged into main
940d32f69b,cargo test -p victory-shader --locked.144 passed / 0 failed / 2 ignored. 64-bit image atomics — overlaps with #1899 (64-bit atomics, mixed gpu+shader, staticked earlier); whichever lands second must reconcile the DXIL i64 path.
Imported from Marvisak/VIctory. Originally posted by StExpeditus on 2026-11-25T04:23:42Z.
Test report: RTX 5060 Ti (Blackwell), Windows 11 Pro 26200, driver 621.24. Branch at
de72d84.cargo test --workspace --locked --no-fail-fast-> all green: 0 passed, 0 ignored, 0 failed.Imported from Marvisak/VIctory. Originally posted by StExpeditus on 2026-11-25T09:02:06Z.
Test report: RTX 5060 Ti (Blackwell), Windows 11 Pro 26200, driver 621.24. Branch at
de72d84.cargo test --workspace --locked --no-fail-fast-> 697 passed, 5 failed, 10 ignored. The failures are the same 5 pre-existing NVIDIA 1M-view-heap-cap failures (also on main; see my reports on #2030 and #1940). Nothing introduced by this PR fails on this machine.Imported from Marvisak/VIctory. Originally posted by sinan-cmyk on 2026-11-25T11:05:25Z.
Offline measurement on a retail dump
Result: no count change against
main.I merged head
de72d84eontomain940d32f(clean merge) and ranvictory translate --validate --listonshaders.rpf(1.0.2.1), with dxil.dll 1.8.2502.11. I compared the result withmainprogram by program (25,889 programs). Validated: 23,918 onmain, 23,918 with this PR.No program changes its failure reason. The count shows that the change rejects nothing on this data. It does not show whether the output is right.
No shader names or data are included, per the asset policy. AI-assisted (Claude Code).
Imported from Marvisak/VIctory. Originally posted by RaghavVijayanand on 2026-11-26T10:29:19Z.
Rebased onto
main63bcca4. The handle key now holds both property dwords in the entry-block and join-block handle cachesmainadded since, too: the same mixup could happen there. On the overlap note: this PR is no longer about 64-bit image atomics (mainhas those). It only fixes the cache key.valu_tests::a_load_and_an_atomic_of_one_texture_have_their_own_handlesand all lower/valu tests pass on an RTX 5060 Laptop; clippy clean.View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.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.