Decode RGB9E5 in diagnostic PNG captures #2588

Open
github-bot wants to merge 1 commit from github-bot/gh-2588 into main AGit
Owner

@⁠DoubleD17 on GitHub · 2026-11-25 16:18 UTC · original
DoubleD17:fix/capture-rgb9e5 → main · +29 −0 · 1 files · 1 commits · open

The diagnostic capture path skips DXGI format 67 (R9G9B9E5_SHAREDEXP) because the converter has no decoder for it. Decode the three 9-bit RGB mantissas and their shared exponent before applying the existing diagnostic color scale. The change preserves the new RGBA8 statistics on main.

On Windows x64 with Rust 1.98.1 MSVC, cargo test --offline --locked -p victory-gpu --features diagnostics --lib capture:: passed 2/3 on main with the same fixture and 3/3 on 6ff69a38e445206b0cb9f3abc1eb876c8a70ba83. The cases cover shared-exponent changes across padded rows and an R32_UINT grayscale control. The asset policy check passed. A prior independent D3D12 WARP check observed format 67 and a 256-byte row pitch for 1×2 typed textures with no flags, render-target flags, and UAV flags. That check covers texture creation and footprint layout. The CPU test reaches the RGBA buffer passed to the PNG encoder.

AI-assisted.

**@⁠DoubleD17** on GitHub · 2026-11-25 16:18 UTC · [original](https://github.com/Marvisak/VIctory/pull/2588) `DoubleD17:fix/capture-rgb9e5` → `main` · +29 −0 · 1 files · 1 commits · open The diagnostic capture path skips DXGI format 67 (R9G9B9E5_SHAREDEXP) because the converter has no decoder for it. Decode the three 9-bit RGB mantissas and their shared exponent before applying the existing diagnostic color scale. The change preserves the new RGBA8 statistics on main. On Windows x64 with Rust 1.98.1 MSVC, `cargo test --offline --locked -p victory-gpu --features diagnostics --lib capture::` passed 2/3 on main with the same fixture and 3/3 on `6ff69a38e445206b0cb9f3abc1eb876c8a70ba83`. The cases cover shared-exponent changes across padded rows and an R32_UINT grayscale control. The asset policy check passed. A prior independent D3D12 WARP check observed format 67 and a 256-byte row pitch for 1×2 typed textures with no flags, render-target flags, and UAV flags. That check covers texture creation and footprint layout. The CPU test reaches the RGBA buffer passed to the PNG encoder. AI-assisted.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 05:09:50 +00:00
Author
Owner

@⁠cloph-dsp on GitHub · 2026-11-25 17:06 UTC · original

Independent verification (claim on #1633, comment 7168884733), Windows/MSVC, Rust/Cargo 1.100.0, no game data, AI-assisted (Hy4 flash).

At the current head cb11b4c the reported clippy site already uses the suggested form: crates/victory-gpu/src/capture.rs:875 is rgba.as_chunks::<4>().0, so the original chunks_exact_to_as_chunks failure is already addressed in the PR. The only current check run is check = pass (https://github.com/Marvisak/VIctory/actions/runs/45658864591/job/139362911132).

Local results:

  • cargo check --locked -p victory-gpu --all-targets --all-features — finished cleanly; only pre-existing deprecation warnings in object.rs (fetch_update).
  • cargo test --locked -p victory-gpu --features diagnostics --lib rgb9e5_tests -- --test-threads=1 — 1 passed / 199 filtered.
  • cargo test --locked -p victory-gpu --features diagnostics --lib capture::tests::crc_matches_the_png_check_value -- --exact --test-threads=1 — 1 passed / 199 filtered.
  • Negative control on origin/main 13f91ca: the rgb9e5 test does not exist (0 tests for the same filter).

Limitation: this machine's cargo 1.100.0 is a direct binary with no clippy component and no rustup, so I could not rerun strict clippy locally; the compile check and CI green status are the evidence. No files changed, no competing PR.

**@⁠cloph-dsp** on GitHub · 2026-11-25 17:06 UTC · [original](https://github.com/Marvisak/VIctory/pull/2588#issuecomment-7169022506) Independent verification (claim on #1633, comment 7168884733), Windows/MSVC, Rust/Cargo 1.100.0, no game data, AI-assisted (Hy4 flash). At the current head cb11b4c the reported clippy site already uses the suggested form: `crates/victory-gpu/src/capture.rs:875` is `rgba.as_chunks::<4>().0`, so the original `chunks_exact_to_as_chunks` failure is already addressed in the PR. The only current check run is `check` = pass (https://github.com/Marvisak/VIctory/actions/runs/45658864591/job/139362911132). Local results: - `cargo check --locked -p victory-gpu --all-targets --all-features` — finished cleanly; only pre-existing deprecation warnings in `object.rs` (`fetch_update`). - `cargo test --locked -p victory-gpu --features diagnostics --lib rgb9e5_tests -- --test-threads=1` — 1 passed / 199 filtered. - `cargo test --locked -p victory-gpu --features diagnostics --lib capture::tests::crc_matches_the_png_check_value -- --exact --test-threads=1` — 1 passed / 199 filtered. - Negative control on `origin/main` 13f91ca: the rgb9e5 test does not exist (0 tests for the same filter). Limitation: this machine's cargo 1.100.0 is a direct binary with no clippy component and no rustup, so I could not rerun strict clippy locally; the compile check and CI green status are the evidence. No files changed, no competing PR.
Author
Owner

@⁠Marvisak on GitHub · 2026-11-25 22:19 UTC · original

Automated triage for the maintainers.

Merge candidate (small, diagnostics only). capture::to_rgba returned None for format 67 (R9G9B9E5_SHAREDEXP), so captures of such targets had no PNG. The new arm decodes it as the public DXGI format defines it: three 9-bit mantissas scaled by 2^(e - 15 - 9), with the 5-bit exponent in bits 27..31. I checked the test values by hand: 0x81010100 gives (1, 0.5, 0.25), and the expected bytes follow from the existing max scaling. No other arm covers 67, and no open PR adds the same thing.

CI: check passing. Merges cleanly into current main. A recommendation to look at it, not an approval.


Generated by Claude Code

**@⁠Marvisak** on GitHub · 2026-11-25 22:19 UTC · [original](https://github.com/Marvisak/VIctory/pull/2588#issuecomment-7176229355) <!-- victory-triage v1 head=cb11b4c1b79cf81ac37a3f8bc19090add5ce6e61 verdict=merge-candidate at=2026-11-25T22:19:40Z --> Automated triage for the maintainers. **Merge candidate (small, diagnostics only).** `capture::to_rgba` returned `None` for format 67 (`R9G9B9E5_SHAREDEXP`), so captures of such targets had no PNG. The new arm decodes it as the public DXGI format defines it: three 9-bit mantissas scaled by `2^(e - 15 - 9)`, with the 5-bit exponent in bits 27..31. I checked the test values by hand: `0x81010100` gives (1, 0.5, 0.25), and the expected bytes follow from the existing max scaling. No other arm covers 67, and no open PR adds the same thing. CI: `check` passing. Merges cleanly into current `main`. A recommendation to look at it, not an approval. --- _Generated by [Claude Code](https://claude.ai/code)_
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/2588/head:github-bot/gh-2588'
git switch 'github-bot/gh-2588'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-2588'
git switch 'github-bot/gh-2588'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-2588'
git switch 'github-bot/gh-2588'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-2588'
git switch 'main'
git merge --squash 'github-bot/gh-2588'
git switch 'main'
git merge --ff-only 'github-bot/gh-2588'
git switch 'main'
git merge 'github-bot/gh-2588'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No reviewers
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.

Dependencies

No dependencies set

Reference
github/Marvisak--VIctory!2588
No description provided.