Accept round-toward-zero RGB9E5 stores on the native RCAS path #129
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/130"
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 R0Y00/Xbox2Windows. Originally posted by danielradosa on 2026-11-21T16:46:23Z.
Change
The native RCAS check accepted a stored RGB9E5 word only if it matched nearest-even or round-to-nearest. The integrated AMD Radeon(TM) Graphics of a Ryzen 5 7600 (RDNA 2, vendor
1002, device164e, driver32.0.21045.29003) reports typed UAV stores for RGB9E5. That makes it the first physical adapter I know of to take the native path here: the RTX 4060 in the same PC, and the RTX 4060 Laptop in the docs, take the packed path, and before this the native path had only run on WARP. Its stores round the mantissas toward zero, soffx_provider_loop_hardwarefailed on the first input where the rules differ:Texel 1 is (1, 511.5, 7.25) × 2⁻²⁴. Nearest-even gives exponent 1 and mantissas (0, 256, 4). The adapter stored exponent 0 and (1, 511, 7), which is the round-toward-zero encoding.
The D3D11.3 functional spec does not require nearest-even here. Section 19.3.2.2 (FLOAT -> RGBE) says conversion "should be done with nearest even. Round to nearest is allowed", and notes that hardware does not perform this conversion. Section 3.2.2 says "Round-to-zero must be used during conversion to another float format." The native check now also accepts a round-toward-zero word and reports how many texels needed each alternative (
native_half_up,native_toward_zero). A store that mixes the two alternatives fails. The packed path still requires nearest-even. Refs #1, where I reported the failure.Verification
A one-off local dump of all 1,024 stored words, classified against the three encoders (not part of this PR):
On both adapters, the SRV loads decode every stored word exactly.
Windows 11 build 26300.9974, MSVC 19.51.36256, debug layer enabled. The integrated GPU was selected with
XBOX2WINDOWS_ADAPTERfrom #116. Each line below isffx_provider_loop_hardware(or_warp):mainatfd1ff2anative_toward_zero=317; the forced packed context passes with 0Full suite on this branch, default adapter: 75 passed, 2 skipped (
bvh_wave64_*), 0 failed. All 22_hardwaretests on the Radeon: 21 passed;dxr_update_hardwarefails with the 1-ULP distance that #112 addresses.Evidence and follow-up
Open question: the Xbox Series X GPU is also RDNA 2. If its native RGB9E5 stores also round toward zero, the packed fallback, which rounds to nearest-even in the shared HLSL helpers, can differ from the console by one mantissa step and in its exponent choice. Nothing here measures the console, so this stays a hypothesis.
AI-assisted.
Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-21T16:46:33Z.
Codex Review Summary: ✅ Completed
This comment shows the latest Codex review activity on this pull request.
67b7f08ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.
Imported from R0Y00/Xbox2Windows. Originally posted by denn0x on 2026-11-21T17:33:52Z.
RDNA 4 data point for the native RCAS path. On the RX 9070 XT,
ffx_provider_loop_hardwaretakes format 67 and rounds toward zero on the same 317 texels. I ran #125 and #130 on the same input, which is the comparison asked for on #125.mainffx_provider_loop_hardwareffx_provider_loop_warpmainat245b207RCAS texel=1 field=4 expected=08120000 actual=001ffe01native_half_up=0 mismatches=0for formats 67 and 42737dec0native_half_up=0 native_toward_zero=317 mismatches=0; format 42native_toward_zero=0 mismatches=023bbb2dnative_trunc=317 mismatches=0; format 42native_trunc=0 mismatches=0Every run reports
debug_errors=0 debug_warnings=0. Both PRs fix the failure here and count the same 317 texels. The Ryzen 5 7600 iGPU in #130 (RDNA 2, driver 32.0.21045.29003) gave the same first mismatch and the same 317. That makes two AMD architectures on two driver branches that store round-toward-zero on this path. The console is still unmeasured.AI-assisted (Claude Code); run locally on the configuration above.