Skip to content

gpu: test packed light decoding across the HDR range - #77

Merged
simnJS merged 1 commit into
mainfrom
gpu/hdr-standin-extremes
Nov 25, 2026
Merged

simnJS merged 1 commit into
mainfrom
gpu/hdr-standin-extremes

Conversation

@fogydes

@fogydes fogydes commented Nov 25, 2026

Copy link
Copy Markdown
Collaborator

What and why

Extend the existing forced R9G9B9E5-to-RGBA16F GPU regression to cover the shared-exponent maximum (65,408), minimum positive value (2^-24), and zero, preserving alpha one. The original GPU cases exercise values at or below one; the CPU conversion already covers every exponent/mantissa.

Expected binary16 words are independent literals. Check the packed source bits before the decoded samples so an R32_FLOAT clear changing the payload cannot hide a conversion error. Sample several texels, retain the existing ordering/replay checks, and report the adapter selected by the device's LUID and the forced host format.

Part of: #55. The production reader-list decode and native-versus-stand-in expectation fixes are already on main; this adds coverage and hardware evidence only.

Depends on: none.

Area

crates/xtp-gpu/src/resource.rs, existing test module only. No production behavior or configuration changes.

Tests

  • cargo xtask pr-check passes on my machine.
  • New or changed behaviour has tests that need no game files.
  • Ran on a title: no.

Both the reported format-view regression and the extended forced-stand-in regression passed on WARP and an NVIDIA GeForce RTX 5050 Laptop GPU, driver 621.40 (Windows 32.0.16.2140). The device's LUID resolved to vendor 0x10de/device 0x2dd8. The forced texture format is RGBA16F (10); maximum, minimum, zero and alpha-one assertions passed with exact expected words.

Both targeted regressions also passed under the strict serial WARP debug layer. The full WARP PR check passed all six steps with normal workspace threading, including both warnings-denied Clippy configurations. Sources were touched and compilation paths and branch-specific output verified. A separate reviewer checked the expected encodings, source payloads, readback offsets, adapter identification and cleanup. These synthetic tests do not establish the cause of a dark world frame.

Provenance

  • I wrote all of this change myself for XTP, or it only moves code already in XTP.
  • Some of it comes from elsewhere. Each source, its licence and the files concerned are listed here, and every licence is compatible with GPL-3.0-or-later:

AI assistance: Codex wrote and independently reviewed the synthetic test extension and ran the checks. Expected encodings were calculated independently of the production converter. No external implementation or title data was copied.

Checklist

  • No game data, keys, console SDK code or headers, and nothing that circumvents DRM (asset policy).
  • No code copied from xcl or AnyPS5.
  • I agree to license this contribution under GPL-3.0-or-later.
  • Title and every commit follow <area>: <summary>; one topic; under 400 changed lines.
  • Docs updated where behavior, commands or variables changed (test-only coverage; production behavior is unchanged).

@simnJS simnJS left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The expected binary16 words check out against the shader, and keeping blue = 256 so the R32 payload stays normal is a nice touch.

Nits for a follow-up:

  • make the adapter lookup skip instead of unwrap();
  • update the doc comment;
  • maybe cover green's max.

Approving, and I'll merge.

@simnJS
simnJS merged commit 37d5eb8 into main Nov 25, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/gpu touches crates/xtp-gpu size/S 10 to 99 changed lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants