GPU: read small buffer diagnostics via read_into instead of VirtualQuery #2140
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2142"
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 fuzeofficlal on 2026-11-25T05:55:31Z.
Problem
While
6d021feswitcheddescribe()'sView::Constantpath tohost::read_into, thesmallclosure added right above it in7000573(crates/victory-gpu/src/draw.rs) still queriestexture::committed(VirtualQuery) and constructsstd::slice::from_raw_partsover live title memory for<= 64-byte buffer SRV and UAV views. That walks pool regions on every noted draw/dispatch, leaves a TOCTOU window against concurrent unmapping or page-guard changes, and passes(null, 0)tofrom_raw_partswhenat == 0 && len == 0.Changes
4..=64-byte buffer SRV/UAV spans into a 64-byte stack buffer viacrate::host::read_into(omitting empty and sub-dword< 4-byte spans), eliminatingVirtualQueryandunsafeslice construction.draw::tests::describe_reads_small_buffers_without_faulting_on_unmapped_memoryunderdiagnosticscovering unaligned SRV/UAV float formatting, boundary lengths (0,2,6,64,68), and reserved/unmapped page boundaries.Closes #913.
Imported from Marvisak/VIctory. Originally posted by DenRakEiw on 2026-11-25T06:02:46Z.
Review: APPROVED
Verified locally merged onto
origin/main(940d32f, Windows 11 x64, Rust 1.98.1 MSVC):cargo test -p victory-gpu --features diagnostics --lib describe_reads_small_buffers_without_faulting_on_unmapped_memory— passedcargo clippy -p victory-gpu --all-targetsand--features diagnostics --all-targets— 0 warningscargo xtask policy— ok (183 files ok)Clean replacement of
VirtualQuerywithread_intofor small buffer diagnostics, verified against unmapped memory without faulting. Looks good.AI-assisted (Gemini 4 Neon).
Imported from Marvisak/VIctory. Originally posted by catminou4 on 2026-11-25T06:33:05Z.
Review: COMMENTED
Static review only: victory-gpu is Windows-only (D3D12/windows_sys) — nothing compiles or runs on macOS; source review of the diff.
Small buffer diagnostics via read_into instead of VirtualQuery — diagnostic path change; pairs with the diagnostics cluster (#2110, #1972).
Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T11:23:57Z.
Automated triage for the maintainers.
Merge candidate. It is rebased onto current
main(one commit,c994126) and merges cleanly. It fixes #913, a diagnostics-only path. Indescribeincrates/victory-gpu/src/draw.rs, thesmallclosure no longer checkstexture::committedand then builds a slice over live title memory. Instead, it copies 4 to 64 bytes into a stack buffer throughhost::read_into, the same waymainalready reads theView::Constantpath just below. That closes the window between the check and the read, and it drops the(null, 0)slice case. The only visible change: spans under 4 bytes now print nothing instead of= []. The new test (diagnostics, Windows) covers unaligned SRV/UAV reads, the 0/2/6/64/68-byte limits, and a view that crosses into a reserved but uncommitted page.CI: passing (
check). Recommending a look, not approving.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.