Verify packed RCAS neighbor coordinates by GPU readback #134

Merged
descent81 merged 2 commits from upstream-pr/135 into main 2026-11-21 17:57:05 +00:00
descent81 commented 2026-11-21 16:51:23 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by descent81 on 2026-11-21T16:51:23Z.


<html>

The existing RCAS packed-coordinate test checks whether the generated HLSL preserves both 16-bit halves of a machine-code literal. This PR adds a GPU readback test for the next question: which texel does that HLSL actually fetch?

The fixture fills an 8×8 texture with unique IDs (8*y + x). It passes synthetic gfx1013 instruction bytes through the project's disassembler and translator, executes the translated coordinate and load operations in a D3D11 compute harness, and compares all 64 reads with an independent CPU reference.

Offset Literal Expected ID from (3, 3) RTX 4060 WARP
Left 0x0000ffff 26 26 26
Up 0xffff0000 19 19 19
Upper left 0xffffffff 18 18 18

All 384 comparisons matched across the three offsets and two backends. For the negative control, I changed the upper half of the left-offset literal while keeping the CPU expectation fixed. Both backends then read 18 instead of 26 at the center and reported 55 mismatches out of 64.

The fixture, reproduction instructions, and measured output are in tests/rcas_coordinate_readback/. It exercises the translated RCAS coordinate and load fragment with synthetic inputs; it does not require a game archive or the full upscaler.

</html>
<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6531691067 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/135). Originally posted by [descent81](https://github.com/descent81) on 2026-11-21T16:51:23Z. --- <html> <body> <!--StartFragment--><p><span>The existing RCAS packed-coordinate test checks whether the generated HLSL preserves both 16-bit halves of a machine-code literal. This PR adds a GPU readback test for the next question: which texel does that HLSL actually fetch?</span></p><p><span>The fixture fills an 8×8 texture with unique IDs (</span><code><span>8*y + x</span></code><span>). It passes synthetic gfx1013 instruction bytes through the project's disassembler and translator, executes the translated coordinate and load operations in a D3D11 compute harness, and compares all 64 reads with an independent CPU reference.</span></p> | Offset | Literal | Expected ID from (3, 3) | RTX 4060 | WARP | | --- | --- | ---: | ---: | ---: | | Left | `0x0000ffff` | 26 | 26 | 26 | | Up | `0xffff0000` | 19 | 19 | 19 | | Upper left | `0xffffffff` | 18 | 18 | 18 | <p><span>All 384 comparisons matched across the three offsets and two backends. For the negative control, I changed the upper half of the left-offset literal while keeping the CPU expectation fixed. Both backends then read 18 instead of 26 at the center and reported 55 mismatches out of 64.</span></p><p><span>The fixture, reproduction instructions, and measured output are in </span><code><span>tests/rcas_coordinate_readback/</span></code><span>. It exercises the translated RCAS coordinate and load fragment with synthetic inputs; it does not require a game archive or the full upscaler.</span></p><!--EndFragment--> </body> </html>
upstream-sync closed this pull request 2026-11-24 06:41:29 +00:00
R0Y00 commented 2026-11-24 06:47:40 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-21T17:17:38Z.


Please register the new readback case in the Windows build and CTest, including the WARP positive case and the changed-coordinate negative control. That will let CI repeat the comparison from a clean checkout.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7066365251 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/135#issuecomment-7066365251). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-21T17:17:38Z. --- Please register the new readback case in the Windows build and CTest, including the WARP positive case and the changed-coordinate negative control. That will let CI repeat the comparison from a clean checkout.
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
R0Y00/Xbox2Windows!134
No description provided.