Handle upload allocation failures and bound ray-tracing scans #625

Merged
cnuonr merged 2 commits from upstream-pr/625 into main 2026-11-29 00:24:48 +00:00
cnuonr commented 2026-11-28 01:57:05 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by cnuonr on 2026-11-28T01:57:05Z.


Problem

A failed commit of an early upload reservation removes its address from the pool even though Windows still holds the reservation. Subsequent uploads can no longer retry it. An unrepresentable block-rounded length also panics in the allocator. The process-heap fallback uses an infallible allocation even though callers already handle a missing upload.

The ray-tracing address scan also treats adjacent occupied blocks as a single upload. It reads into the next allocation and into padding beyond the requested byte count.

Changes

  • Keep the early reservation until its commit succeeds.
  • Check block rounding for both the reserved pool and upload arenas.
  • Allocate the heap fallback with a fallible reservation and preserve zero initialization.
  • Track each upload's initialized end in the arena so address scans stop at that upload's boundary.

Verification

cargo test --locked -p victory-gpu --lib upload::tests passed all 9 tests on Windows. A simulated commit failure, the two rounding-overflow cases, and both scan-boundary cases fail on the original implementation. The heap fallback test checks zero initialization and rejection of an unrepresentable capacity. The tests use generated data.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:issue:5535583500 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/625). Originally posted by [cnuonr](https://github.com/cnuonr) on 2026-11-28T01:57:05Z. --- ## Problem A failed commit of an early upload reservation removes its address from the pool even though Windows still holds the reservation. Subsequent uploads can no longer retry it. An unrepresentable block-rounded length also panics in the allocator. The process-heap fallback uses an infallible allocation even though callers already handle a missing upload. The ray-tracing address scan also treats adjacent occupied blocks as a single upload. It reads into the next allocation and into padding beyond the requested byte count. ## Changes - Keep the early reservation until its commit succeeds. - Check block rounding for both the reserved pool and upload arenas. - Allocate the heap fallback with a fallible reservation and preserve zero initialization. - Track each upload's initialized end in the arena so address scans stop at that upload's boundary. ## Verification `cargo test --locked -p victory-gpu --lib upload::tests` passed all 9 tests on Windows. A simulated commit failure, the two rounding-overflow cases, and both scan-boundary cases fail on the original implementation. The heap fallback test checks zero initialization and rejection of an unrepresentable capacity. The tests use generated data.
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
trustno1-coder/VIctory-NVIDIA!625
No description provided.