Diagnostics: capture RGBA32 unsigned targets #2565

Open
andrewpozdnakov7-jpg wants to merge 2 commits from upstream-pr/2567 into main
andrewpozdnakov7-jpg commented 2026-11-25 15:59:21 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by andrewpozdnakov7-jpg on 2026-11-25T15:59:21Z.


R32G32B32A32_UINT has a 16-byte texel layout, but the diagnostic capture converter returns None, so there is no PNG for these targets. Decode R, G, and B as unsigned 32-bit values and use the existing diagnostic color scaling and opaque PNG alpha.

The same two pitched synthetic rows return None on 67e8ae1 and produce RGB (255, 127, 0) and (0, 63, 255) on the patch. The fixture includes the high unsigned bit and sentinel values in source alpha and row padding.

Validation: diagnostics capture tests, strict GPU Clippy, and the staged asset policy.

DXGI format definitions · Coordination claim

If you cherry-pick or rebase this commit, please retain its Git author. If you fold the change into another commit, please add Co-authored-by: andrewpozdnakov7-jpg <[email protected]>.

AI-assisted. Verification used synthetic readback data.

<!-- greyfinch-sync:Marvisak/VIctory:issue:5494719417 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2567). Originally posted by [andrewpozdnakov7-jpg](https://github.com/andrewpozdnakov7-jpg) on 2026-11-25T15:59:21Z. --- `R32G32B32A32_UINT` has a 16-byte texel layout, but the diagnostic capture converter returns `None`, so there is no PNG for these targets. Decode R, G, and B as unsigned 32-bit values and use the existing diagnostic color scaling and opaque PNG alpha. The same two pitched synthetic rows return `None` on `67e8ae1` and produce RGB `(255, 127, 0)` and `(0, 63, 255)` on the patch. The fixture includes the high unsigned bit and sentinel values in source alpha and row padding. Validation: diagnostics capture tests, strict GPU Clippy, and the staged asset policy. [DXGI format definitions](https://learn.microsoft.com/en-us/windows/win32/api/dxgiformat/ne-dxgiformat-dxgi_format) · [Coordination claim](https://github.com/Marvisak/VIctory/issues/1633#issuecomment-7167314115) If you cherry-pick or rebase this commit, please retain its Git author. If you fold the change into another commit, please add `Co-authored-by: andrewpozdnakov7-jpg <[email protected]>`. AI-assisted. Verification used synthetic readback data.
Marvisak commented 2026-11-25 20:06:10 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T19:20:35Z.


Automated triage for the maintainers.

Merge candidate. This is a recommendation to look, not an approval. The PR adds DXGI format 3 (R32G32B32A32_UINT, 16-byte texels) to capture::to_rgba in crates/victory-gpu/src/capture.rs. RGB is decoded as unsigned integers and scaled like the other non-8-bit formats, so these targets get a PNG instead of being skipped. The new commit (035adfa) only moves the test into mod tests, next to unorm16_and_xr_bias_targets_decode_as_their_formats. The code is unchanged from the head reviewed before, and the expected bytes still follow from the existing scaling with a 20-byte row pitch.

Reply to the author: thanks, the nit is addressed.

CI: check passed (Windows).


Generated by Claude Code

<!-- greyfinch-sync:Marvisak/VIctory:comment:7172163013 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2567#issuecomment-7172163013). Originally posted by [Marvisak](https://github.com/Marvisak) on 2026-11-25T19:20:35Z. --- <!-- victory-triage v1 head=035adfa3a51332164b4a6640ad91624408783496 verdict=merge-candidate at=2026-11-25T20:18:54Z --> Automated triage for the maintainers. **Merge candidate.** This is a recommendation to look, not an approval. The PR adds DXGI format 3 (`R32G32B32A32_UINT`, 16-byte texels) to `capture::to_rgba` in `crates/victory-gpu/src/capture.rs`. RGB is decoded as unsigned integers and scaled like the other non-8-bit formats, so these targets get a PNG instead of being skipped. The new commit (`035adfa`) only moves the test into `mod tests`, next to `unorm16_and_xr_bias_targets_decode_as_their_formats`. The code is unchanged from the head reviewed before, and the expected bytes still follow from the existing scaling with a 20-byte row pitch. **Reply to the author:** thanks, the nit is addressed. CI: `check` passed (Windows). --- _Generated by [Claude Code](https://claude.ai/code)_
andrewpozdnakov7-jpg commented 2026-11-25 20:06:17 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by andrewpozdnakov7-jpg on 2026-11-25T19:32:35Z.


Addressed the test placement request. The existing RGBA32 UINT regression now sits in capture::tests beside unorm16_and_xr_bias_targets_decode_as_their_formats. All three capture module tests passed with diagnostics enabled, including the moved regression. Commit 035adfa

<!-- greyfinch-sync:Marvisak/VIctory:comment:7172441324 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2567#issuecomment-7172441324). Originally posted by [andrewpozdnakov7-jpg](https://github.com/andrewpozdnakov7-jpg) on 2026-11-25T19:32:35Z. --- Addressed the [test placement request](https://github.com/Marvisak/VIctory/pull/2567#issuecomment-7172163013). The existing RGBA32 UINT regression now sits in capture::tests beside unorm16_and_xr_bias_targets_decode_as_their_formats. All three capture module tests passed with diagnostics enabled, including the moved regression. [Commit 035adfa](https://github.com/Marvisak/VIctory/pull/2567/commits/035adfa3a51332164b4a6640ad91624408783496)
futurepro62 commented 2026-11-26 01:04:20 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by futurepro62 on 2026-11-26T01:00:36Z.


Full-suite run on NVIDIA, since this PR has no test report yet. Tested exact head 035adfa (on its base 67e8ae1).

Tested

  • NVIDIA GeForce RTX 5070 Ti 16 GB (Blackwell, 32-lane waves only, mesh shaders), driver 621.40, Ryzen 7 9800X3D, Windows 11 Home 26300, Rust 1.98.1 MSVC (pinned), dxil.dll from Windows SDK 10.0.26100 (the loader's default), debug.
  • cargo build --workspace --locked, then cargo test --workspace --locked --no-fail-fast -- --test-threads=4 --skip emit::memory_tests::heap_direct_texture_reads_mark_their_heap_index --skip descriptor::host::tests::dynamic_slots_are_held_until_released --skip memory::tests::lists_share_a_table_and_copies_keep_their_views --skip emit::stride_tests::a_heap_buffer_read_by_element_takes_the_views_stride --skip emit::stride_tests::a_heap_buffer_read_where_no_buffer_view_is_reads_zeros --skip emit::synthetic_tests::gathers_at_a_level_match_the_hardware: 773 passed, 0 failed, 9 ignored.
  • rgba32_uint_captures_keep_rgb_and_ignore_source_alpha only builds with the diagnostics feature, so the run above doesn't include it; it passes in cargo test -p victory-gpu --lib --locked --features diagnostics (same skips).
  • --skip leaves out tests that fail on main 63bcca4 on this card too, not because of this PR: heap_direct_texture_reads_mark_their_heap_index ends the victory-shader test process with 0xc0000005 (#2571), so without the skip the rest of that crate never reports; dynamic_slots_are_held_until_released, lists_share_a_table_and_copies_keep_their_views and the two stride_tests hit the 1,000,000-view heap cap of NVIDIA drivers (#1835, #2317); gathers_at_a_level_match_the_hardware fails on lane 0 (#1744).

Not tested

  • AMD (the tests take the default adapter), a release build, the title (test run only).

AI use

  • Claude Code (Claude Opus 5.5) ran the tests and wrote this report. I checked it before posting.
<!-- greyfinch-sync:Marvisak/VIctory:comment:7179334401 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2567#issuecomment-7179334401). Originally posted by [futurepro62](https://github.com/futurepro62) on 2026-11-26T01:00:36Z. --- Full-suite run on NVIDIA, since this PR has no test report yet. Tested exact head `035adfa` (on its base `67e8ae1`). **Tested** - NVIDIA GeForce RTX 5070 Ti 16 GB (Blackwell, 32-lane waves only, mesh shaders), driver 621.40, Ryzen 7 9800X3D, Windows 11 Home 26300, Rust 1.98.1 MSVC (pinned), `dxil.dll` from Windows SDK 10.0.26100 (the loader's default), debug. - `cargo build --workspace --locked`, then `cargo test --workspace --locked --no-fail-fast -- --test-threads=4 --skip emit::memory_tests::heap_direct_texture_reads_mark_their_heap_index --skip descriptor::host::tests::dynamic_slots_are_held_until_released --skip memory::tests::lists_share_a_table_and_copies_keep_their_views --skip emit::stride_tests::a_heap_buffer_read_by_element_takes_the_views_stride --skip emit::stride_tests::a_heap_buffer_read_where_no_buffer_view_is_reads_zeros --skip emit::synthetic_tests::gathers_at_a_level_match_the_hardware`: **773 passed, 0 failed, 9 ignored**. - `rgba32_uint_captures_keep_rgb_and_ignore_source_alpha` only builds with the `diagnostics` feature, so the run above doesn't include it; it passes in `cargo test -p victory-gpu --lib --locked --features diagnostics` (same skips). - `--skip` leaves out tests that fail on main `63bcca4` on this card too, not because of this PR: `heap_direct_texture_reads_mark_their_heap_index` ends the `victory-shader` test process with `0xc0000005` (#2571), so without the skip the rest of that crate never reports; `dynamic_slots_are_held_until_released`, `lists_share_a_table_and_copies_keep_their_views` and the two `stride_tests` hit the 1,000,000-view heap cap of NVIDIA drivers (#1835, #2317); `gathers_at_a_level_match_the_hardware` fails on lane 0 (#1744). **Not tested** - AMD (the tests take the default adapter), a release build, the title (test run only). **AI use** - Claude Code (Claude Opus 5.5) ran the tests and wrote this report. I checked it before posting.
cloph-dsp commented 2026-11-26 23:07:50 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by cloph-dsp on 2026-11-26T23:07:50Z.


Independent local verification of PR #2567 (035adfa), from Windows with Rust 1.100.0/MSVC (repo pins 1.98.1) and per-worktree CARGO_TARGET_DIR, CARGO_BUILD_JOBS=2, no game data.

  • cargo test --locked -p victory-gpu --lib --features diagnostics -- --exact capture::tests::rgba32_uint_captures_keep_rgb_and_ignore_source_alpha → test result: ok. 1 passed; 0 failed; 199 filtered out, exit 0. capture is gated behind #[cfg(all(windows, feature = "diagnostics"))], so --features diagnostics is required.
  • git diff --check against merge base 67e8ae1 → clean (exit 0).
  • Negative control: git grep for rgba32_uint_captures_keep_rgb_and_ignore_source_alpha on origin/main found no match, so the regression test is added by this PR.

This adds a Windows/MSVC 1.100 data point alongside the existing NVIDIA full-suite report. Only the synthetic capture unit test was replayed; no real GPU capture or title target was used. AI-assisted (Hy4 flash). GPU/driver: N/A for this CPU-only capture-decode test. No game data.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7205279905 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2567#issuecomment-7205279905). Originally posted by [cloph-dsp](https://github.com/cloph-dsp) on 2026-11-26T23:07:50Z. --- Independent local verification of PR #2567 (`035adfa`), from Windows with Rust 1.100.0/MSVC (repo pins 1.98.1) and per-worktree `CARGO_TARGET_DIR`, `CARGO_BUILD_JOBS=2`, no game data. - `cargo test --locked -p victory-gpu --lib --features diagnostics -- --exact capture::tests::rgba32_uint_captures_keep_rgb_and_ignore_source_alpha` → `test result: ok. 1 passed; 0 failed; 199 filtered out`, exit 0. `capture` is gated behind `#[cfg(all(windows, feature = "diagnostics"))]`, so `--features diagnostics` is required. - `git diff --check` against merge base `67e8ae1` → clean (exit 0). - Negative control: `git grep` for `rgba32_uint_captures_keep_rgb_and_ignore_source_alpha` on `origin/main` found no match, so the regression test is added by this PR. This adds a Windows/MSVC 1.100 data point alongside the existing NVIDIA full-suite report. Only the synthetic capture unit test was replayed; no real GPU capture or title target was used. AI-assisted (Hy4 flash). GPU/driver: N/A for this CPU-only capture-decode test. No game data.
Dukestar69 commented 2026-11-26 23:27:53 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Dukestar69 on 2026-11-26T23:27:53Z.

Review: APPROVED


LGTM — verified on Windows against origin/main (63bcca4).

  • Decoding RGBA32_UINT diagnostic capture targets passes cleanly with both default and --features diagnostics builds.
  • cargo test -p victory-gpu --lib --features diagnostics capture:: -- --test-threads=1: all passed.
  • cargo clippy -p victory-gpu --all-targets -- -D warnings (default + --features diagnostics): clean.
  • cargo xtask policy: 191 files ok.

Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).

<!-- greyfinch-sync:Marvisak/VIctory:review:6081456945 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2567#pullrequestreview-6081456945). Originally posted by [Dukestar69](https://github.com/Dukestar69) on 2026-11-26T23:27:53Z. **Review:** APPROVED --- LGTM — verified on Windows against `origin/main` (`63bcca4`). - Decoding `RGBA32_UINT` diagnostic capture targets passes cleanly with both default and `--features diagnostics` builds. - `cargo test -p victory-gpu --lib --features diagnostics capture:: -- --test-threads=1`: all passed. - `cargo clippy -p victory-gpu --all-targets -- -D warnings` (default + `--features diagnostics`): clean. - `cargo xtask policy`: 191 files ok. Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).
fuzeofficlal commented 2026-11-26 23:50:24 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by fuzeofficlal on 2026-11-26T23:50:24Z.

Review: APPROVED


Looks good — clean, focused addition for DXGI_FORMAT_R32G32B32A32_UINT (3) captures.

Checked crates/victory-gpu/src/capture.rs:665-666 and capture.rs:861-875 against the full readback and decoding path:

  • 16 bytes per texel matches 1..=2 (R32G32B32A32_TYPELESS/FLOAT) and crate::resource::element(3), and capture::read_back imposes no format filter that blocks it.
  • Decoding RGB as u32_at(b, i) as f32 with color (grey == false) 99th-percentile scaling handles all-zero (black), constant non-zero (white), u32::MAX (finite f32), and ignores source alpha cleanly.
  • Merges cleanly onto current main (63bcca43) alongside r32_integer_to_rgba (42 | 43), passing cargo clippy --features diagnostics --tests -- -D warnings and all 12 capture:: tests.

Verification (035adfa3):

  • cargo xtask policy and cargo clippy -p victory-gpu (default and --features diagnostics, --tests -- -D warnings): passed.
  • capture::tests:: (3/3) and merged-with-main capture:: (12/12): passed on both hardware GPU and WARP.
  • Live GPU readback probe uploading a DXGI_FORMAT_R32G32B32A32_UINT 2x2 texture through capture::read_back (RowPitch = 256) and to_rgba: decoded exact expected RGBA output on both hardware GPU and WARP with VICTORY_D3D12_DEBUG=1 (zero Debug Layer errors).
<!-- greyfinch-sync:Marvisak/VIctory:review:6081685135 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2567#pullrequestreview-6081685135). Originally posted by [fuzeofficlal](https://github.com/fuzeofficlal) on 2026-11-26T23:50:24Z. **Review:** APPROVED --- Looks good — clean, focused addition for `DXGI_FORMAT_R32G32B32A32_UINT` (`3`) captures. Checked `crates/victory-gpu/src/capture.rs:665-666` and `capture.rs:861-875` against the full readback and decoding path: - 16 bytes per texel matches `1..=2` (`R32G32B32A32_TYPELESS`/`FLOAT`) and `crate::resource::element(3)`, and `capture::read_back` imposes no format filter that blocks it. - Decoding RGB as `u32_at(b, i) as f32` with color (`grey == false`) 99th-percentile scaling handles all-zero (black), constant non-zero (white), `u32::MAX` (finite `f32`), and ignores source alpha cleanly. - Merges cleanly onto current `main` (`63bcca43`) alongside `r32_integer_to_rgba` (`42 | 43`), passing `cargo clippy --features diagnostics --tests -- -D warnings` and all 12 `capture::` tests. Verification (`035adfa3`): - `cargo xtask policy` and `cargo clippy -p victory-gpu` (default and `--features diagnostics`, `--tests -- -D warnings`): passed. - `capture::tests::` (3/3) and merged-with-`main` `capture::` (12/12): passed on both hardware GPU and WARP. - Live GPU readback probe uploading a `DXGI_FORMAT_R32G32B32A32_UINT` 2x2 texture through `capture::read_back` (`RowPitch = 256`) and `to_rgba`: decoded exact expected RGBA output on both hardware GPU and WARP with `VICTORY_D3D12_DEBUG=1` (zero Debug Layer errors).
andrewpozdnakov7-jpg commented 2026-11-27 00:10:30 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by andrewpozdnakov7-jpg on 2026-11-27T00:10:30Z.


@cloph-dsp Thanks for checking the CPU conversion. I ran the readback path on this PR's exact head 035adfa with a real D3D12 R32G32B32A32_UINT 2×2 texture and a 256-byte row pitch. The fixture fills both rows with distinct high-bit RGB values, varies source alpha, and puts a sentinel in the upload padding.

The PR returned all four expected RGBA pixels in three fresh WARP processes. The identical fixture on main (63bcca4) completed the GPU copy but returned no converted pixels in all three processes. The four capture tests pass on the PR with the fixture, as do strict clippy checks with default and all features and the asset-policy check.

The test-only commit is ready to pick up. Maintainers can cherry-pick it with its Git author or keep Co-authored-by: andrewpozdnakov7-jpg if folding it into another commit. The GPU here was WARP.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7206235280 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2567#issuecomment-7206235280). Originally posted by [andrewpozdnakov7-jpg](https://github.com/andrewpozdnakov7-jpg) on 2026-11-27T00:10:30Z. --- @cloph-dsp Thanks for checking the CPU conversion. I ran the readback path on this PR's exact head `035adfa` with a real D3D12 `R32G32B32A32_UINT` 2×2 texture and a 256-byte row pitch. The fixture fills both rows with distinct high-bit RGB values, varies source alpha, and puts a sentinel in the upload padding. The PR returned all four expected RGBA pixels in three fresh WARP processes. The identical fixture on `main` (`63bcca4`) completed the GPU copy but returned no converted pixels in all three processes. The four capture tests pass on the PR with the fixture, as do strict clippy checks with default and all features and the asset-policy check. The [test-only commit](https://github.com/andrewpozdnakov7-jpg/VIctory/commit/0364295f71bd0855501ffc515a174ed94d763e42) is ready to pick up. Maintainers can cherry-pick it with its Git author or keep `Co-authored-by: andrewpozdnakov7-jpg` if folding it into another commit. The GPU here was WARP.
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/2567:upstream-pr/2567'
git switch 'upstream-pr/2567'

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.

git switch 'main'
git merge --no-ff 'upstream-pr/2567'
git switch 'upstream-pr/2567'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/2567'
git switch 'upstream-pr/2567'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/2567'
git switch 'main'
git merge --squash 'upstream-pr/2567'
git switch 'main'
git merge --ff-only 'upstream-pr/2567'
git switch 'main'
git merge 'upstream-pr/2567'
git push origin 'main'
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
Marvisak/VIctory!2565
No description provided.