Expand bounded GPU compatibility coverage #112

Closed
github-bot wants to merge 1 commit from gh-pr/112/head into gh-pr/112/base
Owner

@⁠bmjask on GitHub · 2026-11-23 12:10 UTC · original
bmjask:codex/gpu-compatibility → main · +36237 −119 · 35 files · 1 commits · closed without merging

Summary

  • complete bounded scalar, vector, memory, image, lane, and control-flow compatibility for the measured validation corpus
  • add structural descriptor validation and deterministic aggregate coverage reporting
  • add validation-only two-wave scheduling, checked per-slot lowering, and checked two-pass recording prerequisites
  • add checked guest-to-host read-only mapping and bounded scalar, buffer, image, sampling, and gather operations
  • move validation vector state to checked buffer-backed scratch while preserving fail-closed production eligibility
  • add transformed SDWA/DPP sources, relative vector access, compact image forms, and formatted buffer loads
  • connect console dispatch to the existing checked compute-to-mesh two-pass recorder when translated pipeline metadata is present
  • reject out-of-range compute and mesh group counts before command-list borrowing or ABI allocation
  • add opt-in redacted pipeline diagnostics for validation tests

Verification

  • full serial workspace suite: 771 library tests passed, 18 ignored, 0 failed
  • all integration suites passed, including 6 GPU pipeline tests, 2 compute GPU tests, and 2 end-to-end tests
  • aggregate decoder survey: 9,282/9,282 programs decoded and structurally validated, with 0 decode failures and 0 unsupported opcodes/forms
  • aggregate validation-shell survey: 9,282/9,282 accepted, 0 rejected, with empty rejection and first-unlowered histograms
  • measured validation per-slot vector coverage: 5,556,444/5,556,444 decoded instructions (100%)
  • measured validation per-slot scalar coverage: 1,868,367/1,868,367 decoded instructions (100%)
  • live Wave64 tests cover two-wave scheduling, fault isolation, buffer-backed state, control flow, rendezvous, lane and relative operations, transformed sources, arithmetic, checked memory, buffer/image loads, point sampling, and four-tap gathers
  • production routing tests exercise the actual console dispatch entry, zero-work behavior, checked limits, command ordering, shared result binding, and existing compute fallback
  • a non-zero synthetic GPU route invokes the actual console entry, captures graphics constants, prepares process UMA, executes both passes, and verifies shared records plus rendered pixels
  • route console-specific indexed draws through translated graphics ABI binding, fail closed for two-pass metadata, and restore temporary index state
  • a live indexed-draw test verifies shader-observed graphics constants, rendered geometry, and restored native index bindings
  • unify standard draw and graphics-indirect preparation so ABI binding precedes pending draw state and two-pass pipelines fail closed before native calls
  • a live standard-draw test verifies actual graphics arguments and the ABI-before-draw-state ordering
  • synchronize bound pipelines and root arguments across command-list creation, reset, clear-state, and release while preserving in-flight UMA ownership
  • make command-list reset transactional so native failure preserves tracked recording state and successful reset transfers ownership exactly once
  • define a fail-closed, privacy-preserving runtime evidence contract for any future expansion of real-program eligibility
  • add an opt-in bounded structural JSONL sink with pseudonymous identifiers, fixed categories, strict caps, and latched I/O failure isolation
  • add an offline fail-closed trace validator for schema, bounds, sequence, epochs, lifecycle, outcomes, and categories
  • validate a release runtime trace end to end, including exact active-list rebind epochs and suppression of unscoped release hooks
  • trace command-list close and queue submission ordering across ordinary, copy, wrapper, and internal kickoff paths, rejecting submit-before-close and commands-after-close
  • public diff, paths, and commit metadata scanned for local paths, logs, retired labels, and identifying asset names

Current boundary

The measured validation compatibility shell is corpus-complete. The explicit two-pass console dispatch route is now connected for translated pipelines with checked metadata, while ordinary translated compute dispatch remains unchanged. Broader production eligibility and title-specific dispatch derivation remain fail-closed where executable/runtime evidence is unavailable.

Notes

This is compatibility-layer work only. It contains no protected content, keys, package decryption, or title-specific data.

Review follow-up

  • integrated current main, including the existing cross-vendor arithmetic and device-removal fixes
  • made the routed draw fence wait use the shared device-removal-aware path
  • prepare indexed draws before temporary native index state changes and preserve fail-closed rejection tracing
  • independently reviewed the indexed-draw change and reran the full workspace serially
**@⁠bmjask** on GitHub · 2026-11-23 12:10 UTC · [original](https://github.com/xcl-dev/xcl/pull/112) `bmjask:codex/gpu-compatibility` → `main` · +36237 −119 · 35 files · 1 commits · closed without merging ## Summary - complete bounded scalar, vector, memory, image, lane, and control-flow compatibility for the measured validation corpus - add structural descriptor validation and deterministic aggregate coverage reporting - add validation-only two-wave scheduling, checked per-slot lowering, and checked two-pass recording prerequisites - add checked guest-to-host read-only mapping and bounded scalar, buffer, image, sampling, and gather operations - move validation vector state to checked buffer-backed scratch while preserving fail-closed production eligibility - add transformed SDWA/DPP sources, relative vector access, compact image forms, and formatted buffer loads - connect console dispatch to the existing checked compute-to-mesh two-pass recorder when translated pipeline metadata is present - reject out-of-range compute and mesh group counts before command-list borrowing or ABI allocation - add opt-in redacted pipeline diagnostics for validation tests ## Verification - full serial workspace suite: 771 library tests passed, 18 ignored, 0 failed - all integration suites passed, including 6 GPU pipeline tests, 2 compute GPU tests, and 2 end-to-end tests - aggregate decoder survey: 9,282/9,282 programs decoded and structurally validated, with 0 decode failures and 0 unsupported opcodes/forms - aggregate validation-shell survey: 9,282/9,282 accepted, 0 rejected, with empty rejection and first-unlowered histograms - measured validation per-slot vector coverage: 5,556,444/5,556,444 decoded instructions (100%) - measured validation per-slot scalar coverage: 1,868,367/1,868,367 decoded instructions (100%) - live Wave64 tests cover two-wave scheduling, fault isolation, buffer-backed state, control flow, rendezvous, lane and relative operations, transformed sources, arithmetic, checked memory, buffer/image loads, point sampling, and four-tap gathers - production routing tests exercise the actual console dispatch entry, zero-work behavior, checked limits, command ordering, shared result binding, and existing compute fallback - a non-zero synthetic GPU route invokes the actual console entry, captures graphics constants, prepares process UMA, executes both passes, and verifies shared records plus rendered pixels - route console-specific indexed draws through translated graphics ABI binding, fail closed for two-pass metadata, and restore temporary index state - a live indexed-draw test verifies shader-observed graphics constants, rendered geometry, and restored native index bindings - unify standard draw and graphics-indirect preparation so ABI binding precedes pending draw state and two-pass pipelines fail closed before native calls - a live standard-draw test verifies actual graphics arguments and the ABI-before-draw-state ordering - synchronize bound pipelines and root arguments across command-list creation, reset, clear-state, and release while preserving in-flight UMA ownership - make command-list reset transactional so native failure preserves tracked recording state and successful reset transfers ownership exactly once - define a fail-closed, privacy-preserving runtime evidence contract for any future expansion of real-program eligibility - add an opt-in bounded structural JSONL sink with pseudonymous identifiers, fixed categories, strict caps, and latched I/O failure isolation - add an offline fail-closed trace validator for schema, bounds, sequence, epochs, lifecycle, outcomes, and categories - validate a release runtime trace end to end, including exact active-list rebind epochs and suppression of unscoped release hooks - trace command-list close and queue submission ordering across ordinary, copy, wrapper, and internal kickoff paths, rejecting submit-before-close and commands-after-close - public diff, paths, and commit metadata scanned for local paths, logs, retired labels, and identifying asset names ## Current boundary The measured validation compatibility shell is corpus-complete. The explicit two-pass console dispatch route is now connected for translated pipelines with checked metadata, while ordinary translated compute dispatch remains unchanged. Broader production eligibility and title-specific dispatch derivation remain fail-closed where executable/runtime evidence is unavailable. ## Notes This is compatibility-layer work only. It contains no protected content, keys, package decryption, or title-specific data. ## Review follow-up - integrated current main, including the existing cross-vendor arithmetic and device-removal fixes - made the routed draw fence wait use the shared device-removal-aware path - prepare indexed draws before temporary native index state changes and preserve fail-closed rejection tracing - independently reviewed the indexed-draw change and reran the full workspace serially
Reconcile the compatibility work with current main, retain fail-closed command routing, and make routed fence waits device-removal-aware.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:10:37 +00:00
github-bot closed this pull request 2026-11-26 04:10:37 +00:00
Author
Owner

@⁠bmjask on GitHub · 2026-11-23 12:10 UTC · original

Follow-up to the cross-vendor report on #83:

  • This head is based directly on current main, so it includes the existing arithmetic, Wave64, and device-removal fixes that were absent from the previously tested head.
  • The PR-specific routed draw wait now uses the shared device-removal-aware fence helper instead of treating u64::MAX as completion.
  • The indexed-draw merge path now prepares and rejects before any temporary native index-buffer mutation; an independent review approved the change.
  • On the available RTX 4090, both reported TDR-triggering tests and all ten reported mesh_epoch_hlsl mismatch tests pass live.
  • Full serial verification passes: 771 library tests passed, 18 ignored, 0 failed, plus every workspace integration suite.

The AMD result still needs confirmation on the reporting hardware. Please retest commit 74fa504 with XCL_ADAPTER=1 and --test-threads=1, starting with the two former TDR tests and the mesh_epoch_hlsl subset. If anything remains, the first failing test and device-removed reason are sufficient.

**@⁠bmjask** on GitHub · 2026-11-23 12:10 UTC · [original](https://github.com/xcl-dev/xcl/pull/112#issuecomment-7100608071) Follow-up to the cross-vendor report on #83: - This head is based directly on current `main`, so it includes the existing arithmetic, Wave64, and device-removal fixes that were absent from the previously tested head. - The PR-specific routed draw wait now uses the shared device-removal-aware fence helper instead of treating `u64::MAX` as completion. - The indexed-draw merge path now prepares and rejects before any temporary native index-buffer mutation; an independent review approved the change. - On the available RTX 4090, both reported TDR-triggering tests and all ten reported `mesh_epoch_hlsl` mismatch tests pass live. - Full serial verification passes: 771 library tests passed, 18 ignored, 0 failed, plus every workspace integration suite. The AMD result still needs confirmation on the reporting hardware. Please retest commit `74fa504` with `XCL_ADAPTER=1` and `--test-threads=1`, starting with the two former TDR tests and the `mesh_epoch_hlsl` subset. If anything remains, the first failing test and device-removed reason are sufficient.
Author
Owner

@⁠ivall on GitHub · 2026-11-23 12:55 UTC · original

Thanks for the effort, but I'm closing this one – it can't be merged in this form. The reasons, so a follow-up can land:

1. Size and shape. One commit, 36 000 lines in 35 files. ~31 000 of them are a second translator for mesh programs (mesh_vector 9 100 lines, mesh_epoch_hlsl 5 800, mesh_memory 4 800, mesh_program 3 900, mesh_scalar, mesh_slot, …). Nothing outside tests uses it: none of these modules is reachable from hle/ / pso.rs / runner.rs, and the description itself says production eligibility stays "fail-closed". The existing recompiler already translates all 9 282 MS programs of the retail pack in full and the titles draw with them (see #67 / #94 for the 32-lane form). A parallel, unused translator is code we would have to maintain and keep in step with the real one without anything gaining from it.

2. It hangs AMD GPUs. The cross-vendor report on #83 shows DXGI_ERROR_DEVICE_HUNG from two of its live tests and ten mismatches on an RDNA2 iGPU; the follow-up was verified only on an RTX 4090. The maintainer's machine is AMD (RX 9070), and a hung device there has needed reboots before, so I'm not running that suite on speculation.

3. Runtime changes mixed in. bind.rs (860 lines), list_x.rs, real.rs change the draw / dispatch / reset paths every title goes through, plus a structural-trace event on every draw and a trace-validate command and evidence-contract document. Changes there are checked against real titles (Minecraft, XDefiant, Unicorn Overlord, Fortnite) – they need to come as small PRs that each say what visible problem they fix.

What would be welcome instead, each as its own PR with a test, on current main:

  • the group-count range check before command-list borrowing (if it fixes something a title does);
  • the draw-path fixes (indexed-draw index state, reset transactionality) – one PR, with the title it was seen in;
  • host_io for the loader's own file reads, if you have a case current main gets wrong (a console drive letter equal to the game's drive was already fixed in 61c6be8).

Thanks again – sorry this isn't the answer you hoped for.

**@⁠ivall** on GitHub · 2026-11-23 12:55 UTC · [original](https://github.com/xcl-dev/xcl/pull/112#issuecomment-7101805208) Thanks for the effort, but I'm closing this one – it can't be merged in this form. The reasons, so a follow-up can land: **1. Size and shape.** One commit, 36 000 lines in 35 files. ~31 000 of them are a second translator for mesh programs (`mesh_vector` 9 100 lines, `mesh_epoch_hlsl` 5 800, `mesh_memory` 4 800, `mesh_program` 3 900, `mesh_scalar`, `mesh_slot`, …). Nothing outside tests uses it: none of these modules is reachable from `hle/` / `pso.rs` / `runner.rs`, and the description itself says production eligibility stays "fail-closed". The existing recompiler already translates all 9 282 MS programs of the retail pack in full and the titles draw with them (see #67 / #94 for the 32-lane form). A parallel, unused translator is code we would have to maintain and keep in step with the real one without anything gaining from it. **2. It hangs AMD GPUs.** The cross-vendor report on #83 shows `DXGI_ERROR_DEVICE_HUNG` from two of its live tests and ten mismatches on an RDNA2 iGPU; the follow-up was verified only on an RTX 4090. The maintainer's machine is AMD (RX 9070), and a hung device there has needed reboots before, so I'm not running that suite on speculation. **3. Runtime changes mixed in.** `bind.rs` (860 lines), `list_x.rs`, `real.rs` change the draw / dispatch / reset paths every title goes through, plus a structural-trace event on every draw and a `trace-validate` command and evidence-contract document. Changes there are checked against real titles (Minecraft, XDefiant, Unicorn Overlord, Fortnite) – they need to come as small PRs that each say what visible problem they fix. **What would be welcome instead**, each as its own PR with a test, on current `main`: - the group-count range check before command-list borrowing (if it fixes something a title does); - the draw-path fixes (indexed-draw index state, reset transactionality) – one PR, with the title it was seen in; - `host_io` for the loader's own file reads, if you have a case current `main` gets wrong (a console drive letter equal to the game's drive was already fixed in 61c6be8). Thanks again – sorry this isn't the answer you hoped for.
Author
Owner

@⁠ivall on GitHub · 2026-11-23 13:00 UTC · original

I did run it after all – #112 (74fa504) merged into current main (f311ca5, clean merge), RX 9070 (RDNA4), Windows 11, inbox D3D12:

  • cargo test -p xcl --lib --skip mesh_epoch_hlsl: 714 passed, 1 failed – mesh_memory::tests::gpu_matches_cpu_through_bounded_u6_validation: thread 0, v22 left 1051372202, right 1051372203 (1 ulp; the test wants bit-exact GPU = CPU).
  • mesh_epoch_hlsl one at a time, the two tests that hung the RDNA2 iGPU skipped: 45 passed, 10 failed – the same ten as in the #83 report (d16_image_load_packs_halves…, d16_image_sample_implicit_and_explicit_zero_lod_match, float_math_family…, float_remainder…, fma_mix_modes…, scalar_binary64_family…, scalar_exec_transforms…, scalar_get_pc_uses_byte_next_pc…, scalar_hardware_configuration_is_inert…, transformed_binary_and_scalar_compare_sources…). The two hanging tests I did not run (a hung device on this machine has needed reboots).
  • XDefiant with it: black screen at first, then the title screen; only 42 new DXIL programs compiled, but the frame rate during that phase fell to ~23 fps (main: ~40–50 fps at the same point). Not investigated further.

So on AMD the new suite is not green either. The decision above stands; the small, focused PRs suggested there are still welcome.

**@⁠ivall** on GitHub · 2026-11-23 13:00 UTC · [original](https://github.com/xcl-dev/xcl/pull/112#issuecomment-7101918992) I did run it after all – #112 (74fa504) merged into current `main` (f311ca5, clean merge), RX 9070 (RDNA4), Windows 11, inbox D3D12: - `cargo test -p xcl --lib --skip mesh_epoch_hlsl`: **714 passed, 1 failed** – `mesh_memory::tests::gpu_matches_cpu_through_bounded_u6_validation`: `thread 0, v22` left `1051372202`, right `1051372203` (1 ulp; the test wants bit-exact GPU = CPU). - `mesh_epoch_hlsl` one at a time, the two tests that hung the RDNA2 iGPU skipped: **45 passed, 10 failed** – the same ten as in the #83 report (`d16_image_load_packs_halves…`, `d16_image_sample_implicit_and_explicit_zero_lod_match`, `float_math_family…`, `float_remainder…`, `fma_mix_modes…`, `scalar_binary64_family…`, `scalar_exec_transforms…`, `scalar_get_pc_uses_byte_next_pc…`, `scalar_hardware_configuration_is_inert…`, `transformed_binary_and_scalar_compare_sources…`). The two hanging tests I did not run (a hung device on this machine has needed reboots). - XDefiant with it: black screen at first, then the title screen; only 42 new DXIL programs compiled, but the frame rate during that phase fell to ~23 fps (`main`: ~40–50 fps at the same point). Not investigated further. So on AMD the new suite is not green either. The decision above stands; the small, focused PRs suggested there are still welcome.

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No description provided.