GPU: reject overflowing and non-buffer descriptor spans before shadow… #1857
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1859"
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 VlREX on 2026-11-24T23:37:22Z.
Unify checked GPU buffer descriptor span arithmetic across SRV/UAV materialization, bindless address discovery and host bounds validation. Reject arithmetic overflow, empty ranges and incompatible buffer dimensions before shadow lookup. Independent BigInt reference verification: 10,368 cases, zero disagreements. Three Rust regression tests included. Native compilation and GPU validation pending. Complementary to #635 and #402. AI-assisted (ChatGPT).
Imported from Marvisak/VIctory. Originally posted by catminou4 on 2026-11-24T23:47:43Z.
Review: COMMENTED
Static review only: victory-gpu is Windows-only (D3D12/windows_sys) — nothing compiles or runs on macOS; source review of the diff.
Overflowing and non-buffer descriptor spans rejected before shader…: validation hardening on descriptor span arithmetic — overflow checks are the right call.
Imported from Marvisak/VIctory. Originally posted by upipibi on 2026-11-25T00:10:58Z.
Ran on Windows 11 with an RTX 3070 (Ampere, driver 616.56), debug build, at
8c77217:cargo test -p victory-gpu --lockedgives 79 passed, 2 failed, 1 ignored. The two failures are the NVIDIA heap-cap onesmainalso has (descriptor::host::tests::dynamic_slots_are_held_until_releasedandmemory::tests::lists_share_a_table_and_copies_keep_their_views, #1744), so there is nothing new on this hardware. Not run: a title.AI-assisted (Claude Code).
Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T07:26:07Z.
Automated triage for the maintainers.
Merge candidate. This is a recommendation to look, not an approval. It now merges cleanly into
main. CI:checkpassing.The PR adds
checked_view_spanincrates/victory-gpu/src/descriptor/host.rsand uses it inbuffer_range,unordered_range,buffer_srv,buffer_uavandwithin. They now refuse spans whosebase + FirstElement*elementor length overflows. Inmainthat panics in debug builds and wraps to unrelated title memory in release. They also refuse SRV/UAV descriptions whose dimension is not BUFFER before reading theBufferunion member. Placed descriptors come from title memory, so a non-buffer dimension would otherwise be read as FirstElement/NumElements. The existingwithinassertions still hold, and the new tests build their placed views correctly. #2541 makes nearly the same change but covers less (notbuffer_srv/buffer_uavorwithin), so this one is the better of the two.Generated by Claude Code
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.