GPU: rectangle vertices are read from title memory through the kernel at submission #2294
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2296"
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 denkencar-sketch on 2026-11-25T10:05:26Z.
Summary
Rectangle vertices were read from title memory with a raw slice at submission. The title may unmap the vertex buffer between the draw and the submission, and the slice then faulted. They are now read through the kernel and rectangles of unmapped vertices are skipped. The allocation is bounded by the earlier
shadow::find.Testing
Test
rectangles_of_unmapped_vertices_are_skippedcrashes (0xc0000005) with the old raw slice and passes with this change.cargo test --workspace --lockedpasses apart from known flakes:modules::dstorage::tests::a_page_list_filled_after_its_request_startsfails now and then onmaintoo, and so does a parallel-run flake invictory-gpu's lib tests (watch::anddescriptor::host::tests, 2 of 40 runs on pristinemain).Not tried: a run in the game. Known nits: a failed read leaves stale scratch, and a
Vecis made per draw.AI-assisted.
Imported from Marvisak/VIctory. Originally posted by catminou4 on 2026-11-25T10:19:13Z.
Review: COMMENTED
Rectangle vertices read from title memory through the copy (expand_title_rects). Static review only: victory-gpu/victory-hle are Windows-only (D3D12/windows-sys); not compiled or tested on this macOS arm64 host. rustc 1.98.1.
Imported from Marvisak/VIctory. Originally posted by DenRakEiw on 2026-11-25T14:56:50Z.
Review: APPROVED
Verified against
origin/main(940d32f) on Windows 11 + NVIDIA GeForce RTX 5090 and WARP:cargo test -p victory-gpu draw::tests: 6/6 passed on RTX 5090, 6/6 passed on WARP (includingrectangles_of_unmapped_vertices_are_skipped).cargo clippy -p victory-gpu --all-targets -- -D warnings: 0 warnings.cargo xtask policy: 183 files ok.Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).
Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T14:53:44Z.
Automated triage for the maintainers.
Thanks for the rebase. Reviewed at
e3e9124, which merges cleanly. CI: passing.In
crates/victory-gpu/src/draw.rs,State::rectanglesused to read the title's vertices with a raw slice in its deferred closure. It now calls the newexpand_title_rects, which copies them throughhost::read_into(ReadProcessMemory) first. A vertex buffer the title unmapped before submission therefore skips the expansion instead of faulting. The size is still bounded by theshadow::findand buffer-size checks made at record time. The new test protects a page withPAGE_NOACCESSto exercise the failing path.One optional improvement, which you already list as a known nit: on a failed read the scratch keeps whatever it held before, possibly an earlier list's vertices. Zeroing
dstwould turn those rectangles into degenerate triangles rather than stale geometry.Verdict: merge candidate (a recommendation to look, not an approval). CI: passing.
Generated by Claude Code
Imported from Marvisak/VIctory. Originally posted by fuzeofficlal on 2026-11-26T15:22:44Z.
Review: APPROVED
Reviewed
crates/victory-gpu/src/draw.rsate3e9124dmerged ontoorigin/main(63bcca43) and verified on RTX 5090 and WARP (VICTORY_D3D12_WARP=1) withVICTORY_D3D12_DEBUG=1.Safety & bounds audit
State::rectangles(draw.rs:1636) now delegates submission-time expansion toexpand_title_rects(draw.rs:2023), copyingn * 3 * stridebytes throughcrate::host::read_into(ReadProcessMemory) and returning early if the title unmapped the vertex pages between record and submission instead of faulting on a raw slice dereference.stride > 0,u64::from(first + count) * stride <= u64::from(v.size),shadow::find(from, rects * 3 * stride), andlist.scratch(rects * 6 * stride)) bound both the temporary buffer and scratch slice sizes cleanly.Verification
cargo run -p xtask -- policy: 191 files ok.cargo clippy -p victory-gpu --all-targets -- -D warnings(default and--all-features): clean.draw::withVICTORY_D3D12_DEBUG=1: 21/21 passed on RTX 5090 and 21/21 passed on WARP (--features diagnostics), includingrectangles_of_unmapped_vertices_are_skipped(draw.rs:2058).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.