Skip to content

GPU: reject overflowing and non-buffer descriptor spans before shadow… - #1859

Open
VlREX wants to merge 1 commit into
Marvisak:mainfrom
VlREX:fix/checked-buffer-view-spans
Open

VlREX wants to merge 1 commit into
Marvisak:mainfrom
VlREX:fix/checked-buffer-view-spans

Conversation

@VlREX

@VlREX VlREX commented Nov 24, 2026

Copy link
Copy Markdown

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).

@catminou4 catminou4 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@upipibi

upipibi commented Nov 25, 2026

Copy link
Copy Markdown

Ran on Windows 11 with an RTX 3070 (Ampere, driver 616.56), debug build, at 8c77217: cargo test -p victory-gpu --locked gives 79 passed, 2 failed, 1 ignored. The two failures are the NVIDIA heap-cap ones main also has (descriptor::host::tests::dynamic_slots_are_held_until_released and memory::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).

Marvisak commented Nov 25, 2026 •

Copy link
Copy Markdown
Owner

Automated triage for the maintainers.

Merge candidate. This is a recommendation to look, not an approval. It now merges cleanly into main. CI: check passing.

The PR adds checked_view_span in crates/victory-gpu/src/descriptor/host.rs and uses it in buffer_range, unordered_range, buffer_srv, buffer_uav and within. They now refuse spans whose base + FirstElement*element or length overflows. In main that 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 the Buffer union member. Placed descriptors come from title memory, so a non-buffer dimension would otherwise be read as FirstElement/NumElements. The existing within assertions still hold, and the new tests build their placed views correctly. #2541 makes nearly the same change but covers less (not buffer_srv/buffer_uav or within), so this one is the better of the two.


Generated by Claude Code

@VlREX
VlREX force-pushed the fix/checked-buffer-view-spans branch from 8c77217 to 1cc3da3 Compare November 25, 2026 18:26
github-actions Bot added a commit to KevinPratap/VIctory that referenced this pull request Nov 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants