GPU diagnostics: count texture data without row padding #2528
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!2528
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2528"
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?
@andrewpozdnakov7-jpg on GitHub · 2026-11-25 15:21 UTC · original
andrewpozdnakov7-jpg:codex1/probe-texture-rows→main· +58 −5 · 1 files · 3 commits · openThe diagnostic probe reads the first slice of a 1D or 3D UAV texture after a dispatch. Its dword count and sample values came from pitched rows, so padding changed the denominator and could appear in the sample.
Count the unpadded bytes of each row and stop the mapped span at the last texel. A final partial dword is zero-extended. D3D12 footprint row size and pitch
The same synthetic test uses a 2 × 2 R32 layout with 256-byte row pitch, three nonzero values, and sentinel bytes in the padding. The original counting logic from
67e8ae1401reports 127 of 128 dwords set.ca477f2reports 3 of 4 and returns all four texels in order. It also passes the unpadded final-row and partial-dword cases.Windows/WARP serial GPU suite passed with 199 passed and 1 ignored under both D3D12 debug flag settings. Strict GPU Clippy in both modes and the asset policy passed. AI-assisted. The change affects diagnostic statistics.
Coordination claim
Please preserve the Git author when reapplying the change. If you fold the code or test into another commit, please add this trailer.
Co-authored-by: andrewpozdnakov7-jpg [email protected]
@Marvisak on GitHub · 2026-11-25 16:15 UTC · original · edited 2026-11-26 00:24 UTC
Automated triage for the maintainers.
Merge candidate. Re-reviewed after the rebase (
0e48cc8, merges cleanly into currentmain). The diagnostics probe for 1D/3D UAV textures after a dispatch (State::probe_writtenincrates/victory-gpu/src/draw.rs) now reads from the footprint's offset and stops at the last texel.written_texture_wordscounts only each row's unpadded bytes and zero-extends a final partial dword, so row padding no longer inflates the dword count or appears in the sample. The span length(rows - 1) * pitch + row_bytesis bounded by the readback footprint, andelementhandles block-compressed rows. The change is diagnostics-only (behindfeature = "diagnostics"), and the unit test covers padded rows, an unpadded final row and a partial dword. CI:checkpassing.Generated by Claude Code
@andrewpozdnakov7-jpg on GitHub · 2026-11-25 16:45 UTC · original
Updated the branch for
67e8ae1401. The same native Windows test gets 127 of 128 nonzero dwords from the old counting logic and 3 of 4 after the patch. The test checks all four texels, the unpadded final row and a partial dword. Serial Windows/WARP GPU suite 199 passed and 1 ignored in both debug flag settings. Strict GPU Clippy in both modes and policy passed.Updated commit
If you fold the change or test into another commit, please preserve the Git author or add this trailer.
Co-authored-by: andrewpozdnakov7-jpg [email protected]
@andrewpozdnakov7-jpg on GitHub · 2026-11-25 22:28 UTC · original
I resolved the test-module conflict with #1778 and kept both fixtures in 0e48cc8.
The same synthetic 256-byte-pitch fixture run with the unchanged counting logic in
f3578e3counts 127 of 128 dwords set. The update counts 3 of 4 without including row padding, preserves the four sample values, and passes the short final-row and partial-dword controls. The upstream sampler-heap test also passes.Both serial Windows/WARP GPU suites passed with 244 tests and one ignored. GPU Clippy with and without diagnostics and asset policy passed.
Please retain the Git author when carrying the fix or tests. If folded into another commit, please add this trailer.
Co-authored-by: andrewpozdnakov7-jpg [email protected]
@fuzeofficlal on GitHub · 2026-11-26 00:35 UTC · original
Code review and hardware + WARP verification at head
0e48cc8cf3a3merged cleanly ontomain(63bcca43c6a0):#[cfg(feature = "diagnostics")]probe_writtenincrates/victory-gpu/src/draw.rs. Computingrows = Height.div_ceil(block)androw_bytes = Width.div_ceil(block) * elementviaresource::elementhandles both 4x4 block-compressed and uncompressed formats, and sizing the mapped slice to(rows - 1) * pitch + row_bytesremoves 256-byte row-pitch padding noise and avoids reading past the end of subresource 0's readback buffer.written_texture_wordsslices each row torow[..row_bytes], zero-pads partial trailing<4-byte rows without bleeding across rows, and safely returnsNonefor formats not covered byresource::element.VICTORY_D3D12_DEBUG=1, Rust 1.98.1):cargo xtask policy:191 files okcargo clippy --locked -p victory-gpu --tests -- -D warnings(default +--features diagnostics): 0 warningsdraw::tests(VICTORY_D3D12_DEBUG=1): 20/20 passed--features diagnostics,VICTORY_D3D12_DEBUG=1,draw::tests): 21/21 passed (includingwritten_texture_probe_counts_texels_without_row_padding)--features diagnostics,VICTORY_D3D12_DEBUG=1,draw::tests): 21/21 passedLooks clean and ready to merge.
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.