GPU diagnostics: count texture data without row padding #2526
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/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?
Imported from Marvisak/VIctory. Originally posted by andrewpozdnakov7-jpg on 2026-11-25T15:21:02Z.
The 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]
Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T16:15:02Z.
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
Imported from Marvisak/VIctory. Originally posted by andrewpozdnakov7-jpg on 2026-11-25T16:45:59Z.
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]
Imported from Marvisak/VIctory. Originally posted by andrewpozdnakov7-jpg on 2026-11-25T22:28:39Z.
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]
Imported from Marvisak/VIctory. Originally posted by fuzeofficlal on 2026-11-26T00:35:59Z.
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.
Imported from Marvisak/VIctory. Originally posted by cloph-dsp on 2026-11-27T08:21:35Z.
Independent CPU-only verification of PR #2528 (GPU diagnostics texture padding).
CARGO_TARGET_DIR(D:\Victory-Contrib\target-2528-verify),CARGO_BUILD_JOBS=2.0e48cc8cf3a372986c74e6c25263d4470f49aabe, merge basef3578e38.cargo test --locked -p victory-gpu --lib --features diagnostics -- draw::tests::written_texture_probe_counts_texels_without_row_padding --exact --test-threads=1 --quiet->1 passed; 0 failed; 0 ignored; 0 measured; 244 filtered out, exit 0.git grep -Ffor the new test name on basef3578e3returned no hits (test absent on base).git diff --check f3578e3 HEADexit 0 (clean).--features diagnosticsis required because the test is gated by#[cfg(feature = "diagnostics")].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.