shader: gate modules that call xbox.* intrinsics — the AMD compiler faults at a fixed offset #578

Open
opened 2026-11-22 14:14:33 +00:00 by MoonYueya · 9 comments
MoonYueya commented 2026-11-22 14:14:33 +00:00 (Migrated from github.com)
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by MoonYueya on 2026-11-22T14:14:33Z.


Question

should dxil_retarget.py refuse modules that still call xbox.* intrinsics on AMD adapters, and is the intrinsic lowering in #250's follow-up the intended route for them?

Evidence so far

Windows 11 build 26300; AMD Radeon integrated (1002:164e), driver 32.0.11024.2, amdxc64.dll 8.18.10.0489; RTX 3080 32.0.16.1742; WARP. Attribution: vectored exception handler, no d3d12sdklayers.dll.

Whole DXBC containers as compute PSOs, one process each, 52 from a packaged DLL: on AMD the 43 whose DXIL declares xbox.* external functions terminate with 0xC0000005 at amdxc64+0x2034D4 (43/43, one offset); the 9 without them return S_OK. Replacing only the DXIL chunk swaps the outcome, 4/4. Re-serializing the RTS0 chunk, or dropping it for an explicit root signature, still faults at the same offset; NVIDIA takes the same bytes 51/52 (one unrelated 1024-thread container faults inside nvwgf2umx) and WARP passes all. Clearing 0x03000000 is a precondition: with flags intact, desktop returns E_FAIL before compiling, so the bits cannot be told apart behaviourally.

Completion condition

S1: report the intrinsic set from dxil_retarget.py, no behaviour change; green on ctest --preset dev --no-tests=error -R 'dxil_retarget|shader_metadata|dxcontainer_part_offsets' -V with the new case. S2: on an AMD adapter, refuse to submit such a module and record why; the fixture reports the refusal instead of faulting the runner. S3, once lowering exists: route these modules there and drop the gate. We can supply the per-container table as a fixture and review patches.

Required environment

Windows x64, a physical AMD GPU for S2, no game files.

Checklist

  • The task can be reproduced with public or source-built inputs.
    Not ticked: S1 and S2 can be checked with a synthetic module, but the fault itself was observed on console-compiled modules. Desktop dxc cannot emit xbox.* declarations, so a public repro would need a hand-built bitcode module. We can help build one.
  • I did not include game files, dumps, distribution links or credentials.

Drafted with AI assistance; numbers independently re-checked.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6543402195 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/584). Originally posted by [MoonYueya](https://github.com/MoonYueya) on 2026-11-22T14:14:33Z. --- ### Question should `dxil_retarget.py` refuse modules that still call `xbox.*` intrinsics on AMD adapters, and is the intrinsic lowering in #250's follow-up the intended route for them? ### Evidence so far Windows 11 build 26300; AMD Radeon integrated (1002:164e), driver 32.0.11024.2, amdxc64.dll 8.18.10.0489; RTX 3080 32.0.16.1742; WARP. Attribution: vectored exception handler, no `d3d12sdklayers.dll`. Whole DXBC containers as compute PSOs, one process each, 52 from a packaged DLL: on AMD the 43 whose DXIL declares `xbox.*` external functions terminate with `0xC0000005` at `amdxc64+0x2034D4` (43/43, one offset); the 9 without them return S_OK. Replacing only the DXIL chunk swaps the outcome, 4/4. Re-serializing the RTS0 chunk, or dropping it for an explicit root signature, still faults at the same offset; NVIDIA takes the same bytes 51/52 (one unrelated 1024-thread container faults inside nvwgf2umx) and WARP passes all. Clearing `0x03000000` is a precondition: with flags intact, desktop returns E_FAIL before compiling, so the bits cannot be told apart behaviourally. ### Completion condition S1: report the intrinsic set from `dxil_retarget.py`, no behaviour change; green on `ctest --preset dev --no-tests=error -R 'dxil_retarget|shader_metadata|dxcontainer_part_offsets' -V` with the new case. S2: on an AMD adapter, refuse to submit such a module and record why; the fixture reports the refusal instead of faulting the runner. S3, once lowering exists: route these modules there and drop the gate. We can supply the per-container table as a fixture and review patches. ### Required environment Windows x64, a physical AMD GPU for S2, no game files. ### Checklist - [ ] The task can be reproduced with public or source-built inputs. Not ticked: S1 and S2 can be checked with a synthetic module, but the fault itself was observed on console-compiled modules. Desktop dxc cannot emit `xbox.*` declarations, so a public repro would need a hand-built bitcode module. We can help build one. - [x] I did not include game files, dumps, distribution links or credentials. Drafted with AI assistance; numbers independently re-checked.
R0Y00 commented 2026-11-24 06:48:33 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-22T14:34:10Z.


The Windows submission rule will apply across adapters. Check the final module and reject unresolved Xbox intrinsic calls before PSO submission, reporting the intrinsic names. A module whose calls have been removed or lowered under a defined contract can proceed after validation.

A read-only inventory can land first. Please distinguish declarations, actual calls, and names found only in metadata. For the gate, use source-built synthetic inputs with a recording submission stub: unresolved calls should result in zero submissions, while ordinary or validated lowered modules should submit. An unused declaration or a metadata name alone should not trigger refusal.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7080641509 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/584#issuecomment-7080641509). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-22T14:34:10Z. --- The Windows submission rule will apply across adapters. Check the final module and reject unresolved Xbox intrinsic calls before PSO submission, reporting the intrinsic names. A module whose calls have been removed or lowered under a defined contract can proceed after validation. A read-only inventory can land first. Please distinguish declarations, actual calls, and names found only in metadata. For the gate, use source-built synthetic inputs with a recording submission stub: unresolved calls should result in zero submissions, while ordinary or validated lowered modules should submit. An unused declaration or a metadata name alone should not trigger refusal.
MoonYueya commented 2026-11-24 06:48:33 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by MoonYueya on 2026-11-22T14:56:12Z.


Thanks, that's clear. We'll take the read-only inventory first. The plan:

  • Report xbox.* names in three groups: declared, actually called, and seen only in metadata.
  • No change to submission behaviour.
  • Tests use source-built synthetic modules only, one case per group.

We'll open a PR here. The gate with a recording submission stub can follow in a separate PR once the inventory lands, unless someone else wants that part.

Drafted with AI assistance.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7080917781 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/584#issuecomment-7080917781). Originally posted by [MoonYueya](https://github.com/MoonYueya) on 2026-11-22T14:56:12Z. --- Thanks, that's clear. We'll take the read-only inventory first. The plan: - Report `xbox.*` names in three groups: declared, actually called, and seen only in metadata. - No change to submission behaviour. - Tests use source-built synthetic modules only, one case per group. We'll open a PR here. The gate with a recording submission stub can follow in a separate PR once the inventory lands, unless someone else wants that part. Drafted with AI assistance.
MoonYueya commented 2026-11-24 06:48:34 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by MoonYueya on 2026-11-22T15:19:10Z.


Progress: the inventory is on MoonYueya:shader-xbox-intrinsic-inventory. It sorts names into declarations, actual calls and metadata string values; named-metadata keys such as !xbox.compiler.options are left out. Before opening the PR we're doing two things: running it over the 52 console-compiled BVH modules we measured earlier, to check that it finds the same split of 43 with calls and 9 without; and running the ctest -R 'dxil_retarget|shader_metadata|dxcontainer_part_offsets' set from a full build. The PR follows once both pass.

Drafted with AI assistance.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7081211134 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/584#issuecomment-7081211134). Originally posted by [MoonYueya](https://github.com/MoonYueya) on 2026-11-22T15:19:10Z. --- Progress: the inventory is on MoonYueya:shader-xbox-intrinsic-inventory. It sorts names into declarations, actual calls and metadata string values; named-metadata keys such as `!xbox.compiler.options` are left out. Before opening the PR we're doing two things: running it over the 52 console-compiled BVH modules we measured earlier, to check that it finds the same split of 43 with calls and 9 without; and running the `ctest -R 'dxil_retarget|shader_metadata|dxcontainer_part_offsets'` set from a full build. The PR follows once both pass. Drafted with AI assistance.
MoonYueya commented 2026-11-24 06:48:34 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by MoonYueya on 2026-11-22T15:36:43Z.


S1 is up as #608: a read-only inventory, no behaviour change. The dev-preset ctest set (dxil_retarget|shader_metadata|dxcontainer_part_offsets) passes 6/6 from a full build. We also cross-checked it against the 52 modules in docs/experiments.md; it reproduces the 43/9 split there.

Drafted with AI assistance.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7081436789 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/584#issuecomment-7081436789). Originally posted by [MoonYueya](https://github.com/MoonYueya) on 2026-11-22T15:36:43Z. --- S1 is up as #608: a read-only inventory, no behaviour change. The dev-preset ctest set (`dxil_retarget|shader_metadata|dxcontainer_part_offsets`) passes 6/6 from a full build. We also cross-checked it against the 52 modules in `docs/experiments.md`; it reproduces the 43/9 split there. Drafted with AI assistance.
MoonYueya commented 2026-11-24 06:48:44 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by MoonYueya on 2026-11-22T20:30:12Z.


S2 is up as #690. It checks the module dxil_retarget.py would submit with --pso-probe and refuses it while it still calls an xbox.* symbol that nothing has reported as lowered. A refused module names the calls and is never submitted. Declarations and metadata-only names pass, and @descent81's !0 = !{!"call void @xbox.text()"} line from #608 is a negative control. Without --probe there is no disassembly, so the result is recorded as NOT_CHECKED and nothing is submitted. S3, routing these modules to a lowering, remains open here.

Drafted with AI assistance.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7085317320 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/584#issuecomment-7085317320). Originally posted by [MoonYueya](https://github.com/MoonYueya) on 2026-11-22T20:30:12Z. --- S2 is up as #690. It checks the module `dxil_retarget.py` would submit with `--pso-probe` and refuses it while it still calls an `xbox.*` symbol that nothing has reported as lowered. A refused module names the calls and is never submitted. Declarations and metadata-only names pass, and @descent81's `!0 = !{!"call void @xbox.text()"}` line from #608 is a negative control. Without `--probe` there is no disassembly, so the result is recorded as `NOT_CHECKED` and nothing is submitted. S3, routing these modules to a lowering, remains open here. Drafted with AI assistance.
R0Y00 commented 2026-11-24 06:48:48 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-22T21:58:22Z.


S2 merged in #690 at efc986b. The retargeter now blocks executable xbox.* calls before starting the Windows compute-PSO probe on every adapter, reports the names, and fails closed when the final module has not been disassembled. The regression confirms zero submissions for live calls or missing inventory and one submission after the call is gone. S3 stays open for a verified lowering and revalidation of the transformed module.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7086452672 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/584#issuecomment-7086452672). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-22T21:58:22Z. --- S2 merged in #690 at `efc986b`. The retargeter now blocks executable `xbox.*` calls before starting the Windows compute-PSO probe on every adapter, reports the names, and fails closed when the final module has not been disassembled. The regression confirms zero submissions for live calls or missing inventory and one submission after the call is gone. S3 stays open for a verified lowering and revalidation of the transformed module.
MoonYueya commented 2026-11-24 06:49:23 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by MoonYueya on 2026-11-23T17:25:47Z.


For the record: S2 is on main as you noted (efc986b, #690), and the gap reported in #733 — the gate still admitted aliases, stores and bitcast-spelled calls — is closed by #734, which blocks every form that reaches an xbox.* builtin rather than only a direct call, and merged on 2026-11-23T03:00Z as 81cf1e3. With that, the gate fails closed for live calls and for a missing inventory, and submits exactly once after the call is gone — the regression you described.

We are not following S3 (a verified lowering plus revalidation of the transformed module). Doing it honestly needs a working lowering for these intrinsics, which we do not have, so that stage is better served on your side.

AI-assisted.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7108644603 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/584#issuecomment-7108644603). Originally posted by [MoonYueya](https://github.com/MoonYueya) on 2026-11-23T17:25:47Z. --- For the record: S2 is on main as you noted (`efc986b`, #690), and the gap reported in #733 — the gate still admitted aliases, stores and bitcast-spelled calls — is closed by #734, which blocks every form that reaches an `xbox.*` builtin rather than only a direct call, and merged on 2026-11-23T03:00Z as `81cf1e3`. With that, the gate fails closed for live calls and for a missing inventory, and submits exactly once after the call is gone — the regression you described. We are not following S3 (a verified lowering plus revalidation of the transformed module). Doing it honestly needs a working lowering for these intrinsics, which we do not have, so that stage is better served on your side. _AI-assisted._
triggered02 commented 2026-11-26 05:02:27 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by triggered02 on 2026-11-26T04:38:31Z.


This thread has been waiting on a maintainer decision since @MoonYueya said their side is not following S3 (the occupied-slot work is elsewhere; this is the AMD xbox.* compiler-fault question). Recording the state precisely so it can be decided rather than drifting.

What main does today (S2, from #690 and #734): ools/dxil_retarget.py refuses a module that still executes an xbox.* call or whose final-module inventory is missing � it blocks the executable form before the Windows compute-PSO probe, reports the symbol names, and fails closed when the module could not be disassembled (dxil_retarget.py:630, :977, with DEFAULT_DROP_METADATA = ('xbox.compiler.options',)). Your evidence stands: on AMD the 43/52 modules that declare xbox.* terminate at mdxc64+0x2034D4 while the 9 without them return S_OK. The gate turns a driver crash into a refusal, but it does not make those modules usable.

S3 (verified lowering + revalidation) is the only way those 43 become dispatchable, and nobody has taken it.

Decision needed from @R0Y00 � one of:

  1. Keep S3 open as maintainer-tracked work with a named transform target (e.g. lower xbox.* builtins to desktop DXIL/HLSL equivalents, then revalidate the transformed module through dxil_retarget + the compute-PSO probe on AMD and WARP). Needs a claim and an intended lowering list.
  2. Close as not-planned: the gate fails closed, no crash, and the compute path already refuses cleanly � record the crash evidence in docs/experiments.md and move on; reopen if a title program must dispatch such a module.
  3. Defer: keep open under #874/#870 as a GPU task with no owner until the compute census shows the affected modules are on a displayed path.

My read: the 43/52 ratio makes this real work, not a hypothetical, but it is not blocking any current PR, and the gate already prevents the crash. If the answer is (1), I can scope the lowering list from the module names the gate prints and land it as a separate instrumented probe first.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7182773586 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/584#issuecomment-7182773586). Originally posted by [triggered02](https://github.com/triggered02) on 2026-11-26T04:38:31Z. --- This thread has been waiting on a maintainer decision since @MoonYueya said their side is not following S3 (the occupied-slot work is elsewhere; this is the AMD xbox.* compiler-fault question). Recording the state precisely so it can be decided rather than drifting. **What main does today** (S2, from #690 and #734): ools/dxil_retarget.py refuses a module that still executes an xbox.* call or whose final-module inventory is missing � it blocks the executable form before the Windows compute-PSO probe, reports the symbol names, and fails closed when the module could not be disassembled (dxil_retarget.py:630, :977, with DEFAULT_DROP_METADATA = ('xbox.compiler.options',)). Your evidence stands: on AMD the 43/52 modules that declare xbox.* terminate at mdxc64+0x2034D4 while the 9 without them return S_OK. The gate turns a driver crash into a refusal, but it does not make those modules usable. **S3 (verified lowering + revalidation)** is the only way those 43 become dispatchable, and nobody has taken it. **Decision needed from @R0Y00** � one of: 1. **Keep S3 open as maintainer-tracked work** with a named transform target (e.g. lower xbox.* builtins to desktop DXIL/HLSL equivalents, then revalidate the transformed module through dxil_retarget + the compute-PSO probe on AMD and WARP). Needs a claim and an intended lowering list. 2. **Close as not-planned**: the gate fails closed, no crash, and the compute path already refuses cleanly � record the crash evidence in docs/experiments.md and move on; reopen if a title program must dispatch such a module. 3. **Defer**: keep open under #874/#870 as a GPU task with no owner until the compute census shows the affected modules are on a displayed path. My read: the 43/52 ratio makes this real work, not a hypothetical, but it is not blocking any current PR, and the gate already prevents the crash. If the answer is (1), I can scope the lowering list from the module names the gate prints and land it as a separate instrumented probe first.
R0Y00 commented 2026-11-26 05:02:29 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-26T04:58:22Z.


Defer S3 until a concrete required call is identified, and keep the existing final-module gate on all desktop adapters. S1 and S2 landed through #690 and #734. The 43/52 result is one published hardware comparison, so it does not establish which calls the current startup path needs. If a relevant call is found, scope a first patch to that named intrinsic, compare against independently established semantics in a source-built dispatch, and check every output word on WARP and the affected AMD adapter. The gate should still refuse unresolved calls or missing inventory before PSO creation. A lowered and revalidated module may proceed through the existing gate. No need to remove it or plan a bulk intrinsic rewrite.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7183064385 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/584#issuecomment-7183064385). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-26T04:58:22Z. --- Defer S3 until a concrete required call is identified, and keep the existing final-module gate on all desktop adapters. S1 and S2 landed through #690 and #734. The 43/52 result is one published hardware comparison, so it does not establish which calls the current startup path needs. If a relevant call is found, scope a first patch to that named intrinsic, compare against independently established semantics in a source-built dispatch, and check every output word on WARP and the affected AMD adapter. The gate should still refuse unresolved calls or missing inventory before PSO creation. A lowered and revalidated module may proceed through the existing gate. No need to remove it or plan a bulk intrinsic rewrite.
Sign in to join this conversation.
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#578
No description provided.