GPU: rectangle vertices are read from title memory through the kernel at submission #2296
No reviewers
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Marvisak--VIctory!2296
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-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?
@denkencar-sketch on GitHub · 2026-11-25 10:05 UTC · original
denkencar-sketch:fix/draw-003→main· +44 −11 · 1 files · 1 commits · openSummary
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.
@Marvisak on GitHub · 2026-11-25 14:53 UTC · original · edited 2026-11-26 03:20 UTC
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
@catminou4 on GitHub · 2026-11-25 10:19 UTC · original · reviewed
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.
@DenRakEiw on GitHub · 2026-11-25 14:56 UTC · original · approved these changes
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).
@fuzeofficlal on GitHub · 2026-11-26 15:22 UTC · original · approved these changes
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.