GPU: read small buffer diagnostics via read_into instead of VirtualQuery #2142
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!2142
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-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?
@fuzeofficlal on GitHub · 2026-11-25 05:55 UTC · original
fuzeofficlal:fix/gpu-describe-small-read-into-913→main· +219 −6 · 1 files · 1 commits · openProblem
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.
@Marvisak on GitHub · 2026-11-25 11:23 UTC · original · edited 2026-11-26 01:21 UTC
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.