Repository navigation
Preserve NaN in HDR diagnostic captures - #2052
Conversation
|
I checked the saved PNGs at For R16G16B16A16_FLOAT, R11G11B10_FLOAT and R16_FLOAT, a positive NaN changed from white to black. For R16G16_FLOAT it changed from yellow to black (the missing blue channel is zero). The four controls (+infinity, 0.5, zero and one) kept their original RGB bytes. I checked the PNG header, chunk CRCs and decompressed scanline. I also compared every input to both float helpers against Python's binary16 decoder, left-aligning the 5- and 6-bit mantissas for the unsigned formats. Base had 2,046 mismatches out of 65,536 half encodings, 31/1,024 for the 5-bit mantissa and 63/2,048 for the 6-bit mantissa. The PR had zero in all three sets. NaNs were compared by classification; all other outputs were compared as f32 bits. AI-assisted. These checks cover the CPU capture path through PNG output; GPU readback was outside the test. |
catminou4
left a comment
There was a problem hiding this comment.
Static review only: victory-gpu is Windows-only (D3D12/windows_sys) — nothing compiles or runs on macOS; source review of the diff.
NaN preserved in HDR diagnostic captures — diagnostic-path correctness; pairs with #1994's denormal handling theme.
DenRakEiw
left a comment
There was a problem hiding this comment.
Verified locally merged onto origin/main (940d32f, Windows 11 x64, Rust 1.98.1 MSVC):
cargo test -p victory-gpu --features diagnostics --lib capture::— passed (includinghalf_classifies_special_and_finite_values,packed_float_classifies_special_and_finite_values, andhdr_targets_render_nan_and_infinity_as_distinct_channel_values)cargo clippy -p victory-gpu --features diagnostics --all-targets— 0 warningscargo xtask policy— ok (183 files ok)
Clean classification and distinct rendering of NaN and infinity values in HDR diagnostic captures. Looks good.
AI-assisted (Gemini 4 Neon).
|
Automated triage for the maintainers. This fixes a decoding bug in the diagnostic texture dumper. In I worked through the new tests by hand: the bit patterns and expected bytes (including 0.5 → 127 at the p99 scale of 1.0) are right, and they check against the encoding rather than against what the code happens to output. The change only affects debug captures and does not change emulation behaviour. No other open PR changes these helpers. CI: passing ( Recommending a look, not approving. Generated by Claude Code |
(cherry picked from commit 5cc48e9) Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Preserve NaN when decoding HDR capture channels with exponent 31 and a nonzero mantissa. The existing conversion maps NaN to zero and positive infinity to 255 in the RGBA buffer.
Synthetic CPU tests on Windows 11 x64 with Rust 1.98.1 MSVC passed two of five cases on the base with the same fixture and five of five on candidate 86ac6c7. They cover both affected formats through RGBA conversion. The fixture stops at the RGBA buffer and does not exercise PNG output or GPU execution.
AI-assisted.