xg: move the provider to the 26100 ABI #476

Merged
csj0oe merged 18 commits from upstream-pr/476 into main 2026-11-29 21:04:37 +00:00
csj0oe commented 2026-11-29 13:24:28 +00:00 (Migrated from github.com)

Imported from brcly/TuxBox. Originally posted by csj0oe on 2026-11-29T13:24:28Z.


What this changes

The XG provider now speaks the 26100 ABI only. The previous 19041 compatibility path is gone: the provider's export table, ordinals, descriptor sizes and layout rules all follow the 26100 contract.

This supersedes the earlier layout-comparison scope of this branch. That work is still here; the branch now carries the full migration.

ABI surface

  • 27-export table with the 26100 ordinals, including XGCreateBVHComputer, XGDecodeDCCSurface, XGShuffleTextureBufferForDirectStorage and XGValidateDescriptor.
  • XG_BUFFER_DESC moved to 24 bytes; the buffer differential passes 967 complete layouts and HRESULTs.
  • Depth swizzle 24, the depth image word-5 bit 31, metadata only for ≤8-byte elements, the 4 KiB UAV swizzle 21, and 0x100000 keeps BGRX.
  • 64 KiB packed-mip bank markers, including the packed tail mips.

Layout rules fixed against the console

  • Colour-metadata plane fields and every MSAA sample offset.
  • UAV-only 64 KiB choice by mip-0 size: a UAV-only texture uses the 64 KiB swizzle when mip 0 needs more than 65536 unpadded bytes (a BC element counts as one 4×4 block); exactly 65536 stays on 4 KiB. Only mip 0 is compared.
  • 4 KiB UAV X variant (swizzle 21 plus the bank bits), and the X bank folded into the slice-local offset for tail mips.
  • A failed address query leaves the bit output untouched.

Verification

  • xg-library differential against the supplied 26100 Xbox DLL: 0 differing bytes, guest exits 0 with its PASS receipt, hash 0x91c28273c3161610.
  • xg-provider suite (xg-dcc, xg-library, xg-addresses, xg-formats): all pass.
  • xg-texture-uav2d differential: 2,964 layouts and 34,632 addresses pass.
  • xg native controls and d3d12-placement: pass.
  • python tuxbox.py check --no-gpu: all eight steps pass.
  • New regression tests and evidence records accompany each rule; -p tuxbox-xg is now wired into CI and the check script.

Not covered

  • No NVIDIA run. All of the above ran on an AMD RX 7600. Shared code needs a run on both vendors.
  • No full game launch on this branch; the XG work was measured through the differential and the provider suites.
  • The branch is based on an older main and currently conflicts with it; it needs a rebase before merge.
<!-- greyfinch-sync:brcly/TuxBox:issue:5551141677 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/pull/476). Originally posted by [csj0oe](https://github.com/csj0oe) on 2026-11-29T13:24:28Z. --- ## What this changes The XG provider now speaks the 26100 ABI only. The previous 19041 compatibility path is gone: the provider's export table, ordinals, descriptor sizes and layout rules all follow the 26100 contract. This supersedes the earlier layout-comparison scope of this branch. That work is still here; the branch now carries the full migration. ### ABI surface - 27-export table with the 26100 ordinals, including `XGCreateBVHComputer`, `XGDecodeDCCSurface`, `XGShuffleTextureBufferForDirectStorage` and `XGValidateDescriptor`. - `XG_BUFFER_DESC` moved to 24 bytes; the buffer differential passes 967 complete layouts and HRESULTs. - Depth swizzle `24`, the depth image word-5 bit 31, metadata only for ≤8-byte elements, the 4 KiB UAV swizzle `21`, and `0x100000` keeps BGRX. - 64 KiB packed-mip bank markers, including the packed tail mips. ### Layout rules fixed against the console - Colour-metadata plane fields and every MSAA sample offset. - UAV-only 64 KiB choice by mip-0 size: a UAV-only texture uses the 64 KiB swizzle when mip 0 needs more than 65536 unpadded bytes (a BC element counts as one 4×4 block); exactly 65536 stays on 4 KiB. Only mip 0 is compared. - 4 KiB UAV X variant (swizzle 21 plus the bank bits), and the X bank folded into the slice-local offset for tail mips. - A failed address query leaves the bit output untouched. ## Verification - `xg-library` differential against the supplied 26100 Xbox DLL: **0 differing bytes**, guest exits 0 with its PASS receipt, hash `0x91c28273c3161610`. - `xg-provider` suite (`xg-dcc`, `xg-library`, `xg-addresses`, `xg-formats`): all pass. - `xg-texture-uav2d` differential: 2,964 layouts and 34,632 addresses pass. - `xg` native controls and `d3d12-placement`: pass. - `python tuxbox.py check --no-gpu`: all eight steps pass. - New regression tests and evidence records accompany each rule; `-p tuxbox-xg` is now wired into CI and the check script. ## Not covered - **No NVIDIA run.** All of the above ran on an AMD RX 7600. Shared code needs a run on both vendors. - No full game launch on this branch; the XG work was measured through the differential and the provider suites. - The branch is based on an older `main` and currently conflicts with it; it needs a rebase before merge.
brcly commented 2026-11-29 14:56:54 +00:00 (Migrated from github.com)

Imported from brcly/TuxBox. Originally posted by brcly on 2026-11-29T14:56:54Z.


We ran the GPU checks this PR was missing. Three of the xg-provider guest gates fail with it, on both cards.

Tree: main at 090cf6ce with this PR (xg: accept pitched descriptors and report swizzle pattern info) merged, in a fresh worktree. python tuxbox.py check, GE-Proton11-14.

Card Result
NVIDIA RTX (10de:2705, 620.x) 185 pass; fails xg-library (exit code 19), xg-addresses (exit code 1), xg-formats (exit code 1)
AMD Radeon 610M (1002:13c0, RADV) 184 pass; the same three fail
  • Every other step passed, including the CPU suites, the translator GPU checks and Lanes.
  • On main alone (same card, same prefix), tuxbox.py verify --only xg-provider passes all four gates. With this PR, xg-dcc still passes and the other three fail again. They all run the xg_xs.dll this PR changes.
  • None of the three printed its PASS receipt, and I didn't capture the guests' own failure text.

xg-library expects xg-library PASS depth=516 descriptors=375 ... typed_images=880 map_targets=1474 msaa_depth=384. xg-formats expects formats=78 layouts=156 element-addresses=9231018. My guess, not checked: the tail-mip swizzle mode (1 → 5), the MipTailOffsetElements packing or the BC microtile change alters what these guests compare against, either a real regression or receipts that now need updating. Either way the guests in examples/ and the receipts in project_tuxbox/verify.py need to agree with the new layouts, with the reason stated.

To reproduce: python tuxbox.py verify --only xg-provider --output <dir> --backend proton --proton <proton> --adapter <id> --prefix <prefix>.

<!-- greyfinch-sync:brcly/TuxBox:comment:7257699842 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/pull/476#issuecomment-7257699842). Originally posted by [brcly](https://github.com/brcly) on 2026-11-29T14:56:54Z. --- We ran the GPU checks this PR was missing. Three of the `xg-provider` guest gates fail with it, on both cards. **Tree:** `main` at `090cf6ce` with this PR (`xg: accept pitched descriptors and report swizzle pattern info`) merged, in a fresh worktree. `python tuxbox.py check`, GE-Proton11-14. | Card | Result | |---|---| | NVIDIA RTX (`10de:2705`, 620.x) | 185 pass; fails `xg-library` (exit code 19), `xg-addresses` (exit code 1), `xg-formats` (exit code 1) | | AMD Radeon 610M (`1002:13c0`, RADV) | 184 pass; the same three fail | - Every other step passed, including the CPU suites, the translator GPU checks and Lanes. - On `main` alone (same card, same prefix), `tuxbox.py verify --only xg-provider` passes all four gates. With this PR, `xg-dcc` still passes and the other three fail again. They all run the `xg_xs.dll` this PR changes. - None of the three printed its PASS receipt, and I didn't capture the guests' own failure text. `xg-library` expects `xg-library PASS depth=516 descriptors=375 ... typed_images=880 map_targets=1474 msaa_depth=384`. `xg-formats` expects `formats=78 layouts=156 element-addresses=9231018`. My guess, not checked: the tail-mip swizzle mode (1 → 5), the `MipTailOffsetElements` packing or the BC microtile change alters what these guests compare against, either a real regression or receipts that now need updating. Either way the guests in `examples/` and the receipts in `project_tuxbox/verify.py` need to agree with the new layouts, with the reason stated. To reproduce: `python tuxbox.py verify --only xg-provider --output <dir> --backend proton --proton <proton> --adapter <id> --prefix <prefix>`.
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
brcly/TuxBox!476
No description provided.