Expand bounded GPU compatibility coverage #83

Closed
github-bot wants to merge 18 commits from gh-pr/83/head into gh-pr/83/base
Owner

@⁠bmjask on GitHub · 2026-11-23 02:01 UTC · original
bmjask:codex/gpu-compatibility → main · +36206 −109 · 36 files · 18 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 rebuilt workspace suite: 619 library tests passed, 16 ignored, 0 failed
  • all integration suites passed, including 6 GPU pipeline 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.

**@⁠bmjask** on GitHub · 2026-11-23 02:01 UTC · [original](https://github.com/xcl-dev/xcl/pull/83) `bmjask:codex/gpu-compatibility` → `main` · +36206 −109 · 36 files · 18 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 rebuilt workspace suite: 619 library tests passed, 16 ignored, 0 failed - all integration suites passed, including 6 GPU pipeline 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.
Validate dispatch limits before allocation and preserve the existing compute path.
Exercise the production console dispatch entry with synthetic GPU pipelines and checked cleanup.
Prepare graphics ABI state before console-specific indexed draws and restore temporary index bindings.
Reject incompatible pipelines before native calls and apply pending draw state after ABI binding.
Synchronize initial pipelines and root arguments across creation, reset, clear-state, and release lifecycles.
Preserve tracked recording state when native reset fails and commit ownership changes only after success.
Record validated coverage, production routing, lifecycle guarantees, and the remaining evidence boundary.
Document the optimized build and release-mode synthetic launcher result.
Document release-mode pipeline and launcher verification.
Document the complete release-mode test result.
Document the redacted evidence and validation gates required before broader production eligibility.
Capture opt-in redacted lifecycle and command evidence with strict caps and failure isolation.
Validate bounded trace schema, sequence, epochs, lifecycle, and categories without exposing raw input.
Adds fail-closed active-list rebind validation, suppresses unscoped release records, and records release trace-to-validator evidence.
Adds bounded close and submission events with fail-closed lifecycle validation and release-level synthetic evidence.
Documents bounded command-list close and queue submission coverage in the runtime evidence contract.
Documents the existing floating-point edge failure and its contributor-owned upstream fix.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:08:48 +00:00
github-bot closed this pull request 2026-11-26 04:08:48 +00:00
Author
Owner

@⁠certified-retart on GitHub · 2026-11-23 08:18 UTC · original

Tested head \385442b5\ on a dual-GPU Windows 10 setup (NVIDIA RTX 5070 + AMD Radeon 9800X3D iGPU) with D3D12 Agility SDK 1.619.1 (#75) so SM 6.6 / wave64 GPU tests run live:

NVIDIA RTX 5070 (\XCL_ADAPTER=0, wave32-only)

  • \xcl\ lib suite: 624 passed, 1 failed, 16 ignored (46 wave64-only GPU tests \SKIPPED\ as expected on NVIDIA).
  • The single failure is \gpu::recomp::mesh_vector::tests::decoded_final_float_math_edges_match_actual_u6\ at \mesh_vector.rs:9072\ (\ssert!(f32::from_bits(actual).is_nan())), which tests \V_FRACT_F32(+inf)\ in register 3 — this looks like the same NVIDIA \min(NaN, 0x3F7FFFFF)\ behavior fixed in #68.

AMD Radeon(TM) Graphics (9800X3D Raphael RDNA2 iGPU, \XCL_ADAPTER=1, wave32..64)

  • Full \xcl\ lib suite hit a **GPU device removal (\
**@⁠certified-retart** on GitHub · 2026-11-23 08:18 UTC · [original](https://github.com/xcl-dev/xcl/pull/83#issuecomment-7095300432) Tested head \385442b5\ on a dual-GPU Windows 10 setup (NVIDIA RTX 5070 + AMD Radeon 9800X3D iGPU) with D3D12 Agility SDK 1.619.1 (\#75\) so SM 6.6 / wave64 GPU tests run live: ### NVIDIA RTX 5070 (\XCL_ADAPTER=0\, wave32-only) - \xcl\ lib suite: **624 passed, 1 failed**, 16 ignored (46 wave64-only GPU tests \SKIPPED\ as expected on NVIDIA). - The single failure is \gpu::recomp::mesh_vector::tests::decoded_final_float_math_edges_match_actual_u6\ at \mesh_vector.rs:9072\ (\ssert!(f32::from_bits(actual).is_nan())\), which tests \V_FRACT_F32(+inf)\ in register 3 — this looks like the same NVIDIA \min(NaN, 0x3F7FFFFF)\ behavior fixed in \#68\. ### AMD Radeon(TM) Graphics (9800X3D Raphael RDNA2 iGPU, \XCL_ADAPTER=1\, wave32..64) - Full \xcl\ lib suite hit a **GPU device removal (\
Author
Owner

@⁠bmjask on GitHub · 2026-11-23 08:36 UTC · original

Confirmed against the current head: the reported NVIDIA V_FRACT_F32(+inf) failure is the existing fract_f clamp behavior, not introduced by this PR. PR #68 contains the exact compare/select correction plus a dedicated live GPU edge-case regression, and is open and mergeable against current main. To avoid duplicating contributor-owned work (and pulling its unrelated barrier change into this branch), this PR should be tested after #68 or rebased once #68 lands.

**@⁠bmjask** on GitHub · 2026-11-23 08:36 UTC · [original](https://github.com/xcl-dev/xcl/pull/83#issuecomment-7095640448) Confirmed against the current head: the reported NVIDIA `V_FRACT_F32(+inf)` failure is the existing `fract_f` clamp behavior, not introduced by this PR. PR #68 contains the exact compare/select correction plus a dedicated live GPU edge-case regression, and is open and mergeable against current main. To avoid duplicating contributor-owned work (and pulling its unrelated barrier change into this branch), this PR should be tested after #68 or rebased once #68 lands.
Author
Owner

@⁠bmjask on GitHub · 2026-11-23 08:37 UTC · original

Thanks for the cross-vendor run. The AMD section of the report appears truncated after “GPU device removal,” so there is not enough evidence yet to identify the failing test or removal reason. If reproducible, please add the first failing test name plus the D3D12 device-removed reason (and whether it also occurs on current main); bounded output is sufficient. That will let us separate a branch regression from an adapter/Agility baseline issue.

**@⁠bmjask** on GitHub · 2026-11-23 08:37 UTC · [original](https://github.com/xcl-dev/xcl/pull/83#issuecomment-7095659774) Thanks for the cross-vendor run. The AMD section of the report appears truncated after “GPU device removal,” so there is not enough evidence yet to identify the failing test or removal reason. If reproducible, please add the first failing test name plus the D3D12 device-removed reason (and whether it also occurs on current main); bounded output is sufficient. That will let us separate a branch regression from an adapter/Agility baseline issue.
Author
Owner

@⁠certified-retart on GitHub · 2026-11-23 10:43 UTC · original

Sorry about the truncated earlier comment — PowerShell double-quoted backtick escaping ate the rest of it. Here are the full details on AMD Radeon(TM) Graphics (Ryzen 7 9800X3D iGPU, RDNA2, wave64) with Agility SDK v620 (XCL_ADAPTER=1, --test-threads=1):

1. Does it happen on current main?

No. On current main (9284dcd), running cargo test -p xcl --lib -- --test-threads=1 on the exact same AMD Radeon iGPU + Agility SDK v620 gives:

  • 393 passed, 0 failed, 16 ignored, 0 skipped, 0 device removals.

All failures and device removals below are specific to PR #83 (bdfc8530, tested locally with the Agility SDK loader from main merged in so the iGPU exposes SM 6.6).

2. First failing test & exact GetDeviceRemovedReason HRESULT

There are two distinct failure classes in gpu::recomp::mesh_epoch_hlsl::tests:

A. GPU device removals (DXGI_ERROR_DEVICE_HUNG, 0x887A0006) — 2 tests

  1. First TDR trigger (reproduces in isolation):
    • gpu::recomp::mesh_epoch_hlsl::tests::descriptor_xy_xyz_xyzw_indexed_forms_convert_and_commit_atomically (mesh_epoch_hlsl.rs:3849)
  2. Second TDR trigger (hit when skipping the first):
    • gpu::recomp::mesh_epoch_hlsl::tests::formatted_vector_buffers_decode_convert_alias_and_commit_atomically_live

On both tests, after WaitForSingleObject:

  • ID3D12Fence::GetCompletedValue() returns 0xffffffffffffffff (u64::MAX)
  • ID3D12Device::GetDeviceRemovedReason() returns HRESULT(0x887A0006) (DXGI_ERROR_DEVICE_HUNG):

    "The GPU will not respond to more commands, most likely because of an invalid command passed by the calling application."

Runner subtlety: runner.rs checks if gpu.fence.GetCompletedValue() < gpu.value, which evaluates to false when D3D12 returns u64::MAX on device removal. Without also checking completed == u64::MAX / GetDeviceRemovedReason(), descriptor_xy_xyz_xyzw_indexed_forms_convert_and_commit_atomically appears to fail with a readback mismatch at mesh_epoch_hlsl.rs:3851 (left: (1065353216, 1065353216), right: (1017159841, 1019265217)), and then the next test (f32_integer_converts_match_cpu_rounding_sdwa_and_wave64, which passes in isolation) and every subsequent GPU test fail in CreateComputePipelineState with DXGI_ERROR_DEVICE_REMOVED (0x887A0005).

B. Non-TDR assertion mismatches (10 tests in mesh_epoch_hlsl)

Skipping only the 2 hanging tests above, cargo test -p xcl --lib gpu::recomp::mesh_epoch_hlsl -- --test-threads=1 finishes cleanly with 45 passed, 10 failed, 0 device removals:

  1. d16_image_load_packs_halves_and_commits_atomically — first failing test in alphabetical order, reproduces in isolation (mesh_epoch_hlsl.rs:3976: left: (0, 0), right: (2147499008, 97280))
  2. d16_image_sample_implicit_and_explicit_zero_lod_match — reproduces in isolation (mesh_epoch_hlsl.rs:4160: left: (1061158912, 0), right: (1061158912, 1061158912))
  3. float_math_family_matches_mature_domains_and_wave64 — reproduces in isolation (mesh_epoch_hlsl.rs:2492: assertion failed: close(at(absolute_lane, 9), input.log2()))
  4. float_remainder_matches_cpu_ordering_edges_and_wave64 (mesh_epoch_hlsl.rs:3124: assertion failed: same(at(absolute_lane, 5), a.ceil()))
  5. fma_mix_modes_match_cpu_fused_edges_and_wave64
  6. scalar_binary64_family_matches_cpu_pairs_aliases_and_wave64
  7. scalar_exec_transforms_match_cpu_masks_and_following_exec_wave64
  8. scalar_get_pc_uses_byte_next_pc_for_two_waves_and_pair_destinations
  9. scalar_hardware_configuration_is_inert_in_bounded_shell_live
  10. transformed_binary_and_scalar_compare_sources_match_wave64 (wave 0 SGPR0 ballot at lane 8)

(Side note: after the recent merges to main, PR #83 also has merge conflicts in crates/xcl/src/gpu/recomp/pso.rs, crates/xcl/src/gpu/recomp/runner.rs, and crates/xcl/src/hle/d3d12x/list_x.rs.)

**@⁠certified-retart** on GitHub · 2026-11-23 10:43 UTC · [original](https://github.com/xcl-dev/xcl/pull/83#issuecomment-7098384806) Sorry about the truncated earlier comment — PowerShell double-quoted backtick escaping ate the rest of it. Here are the full details on **AMD Radeon(TM) Graphics (Ryzen 7 9800X3D iGPU, RDNA2, wave64)** with Agility SDK v620 (`XCL_ADAPTER=1`, `--test-threads=1`): ### 1. Does it happen on current `main`? **No.** On current `main` (`9284dcd`), running `cargo test -p xcl --lib -- --test-threads=1` on the exact same AMD Radeon iGPU + Agility SDK v620 gives: - **393 passed, 0 failed, 16 ignored, 0 skipped, 0 device removals.** All failures and device removals below are specific to PR #83 (`bdfc8530`, tested locally with the Agility SDK loader from `main` merged in so the iGPU exposes SM 6.6). ### 2. First failing test & exact `GetDeviceRemovedReason` HRESULT There are **two distinct failure classes** in `gpu::recomp::mesh_epoch_hlsl::tests`: #### A. GPU device removals (`DXGI_ERROR_DEVICE_HUNG`, `0x887A0006`) — 2 tests 1. **First TDR trigger** (reproduces in isolation): - `gpu::recomp::mesh_epoch_hlsl::tests::descriptor_xy_xyz_xyzw_indexed_forms_convert_and_commit_atomically` (`mesh_epoch_hlsl.rs:3849`) 2. **Second TDR trigger** (hit when skipping the first): - `gpu::recomp::mesh_epoch_hlsl::tests::formatted_vector_buffers_decode_convert_alias_and_commit_atomically_live` On both tests, after `WaitForSingleObject`: - `ID3D12Fence::GetCompletedValue()` returns `0xffffffffffffffff` (`u64::MAX`) - `ID3D12Device::GetDeviceRemovedReason()` returns **`HRESULT(0x887A0006)` (`DXGI_ERROR_DEVICE_HUNG`)**: > *"The GPU will not respond to more commands, most likely because of an invalid command passed by the calling application."* **Runner subtlety:** `runner.rs` checks `if gpu.fence.GetCompletedValue() < gpu.value`, which evaluates to `false` when D3D12 returns `u64::MAX` on device removal. Without also checking `completed == u64::MAX` / `GetDeviceRemovedReason()`, `descriptor_xy_xyz_xyzw_indexed_forms_convert_and_commit_atomically` appears to fail with a readback mismatch at `mesh_epoch_hlsl.rs:3851` (`left: (1065353216, 1065353216), right: (1017159841, 1019265217)`), and then the next test (`f32_integer_converts_match_cpu_rounding_sdwa_and_wave64`, which passes in isolation) and every subsequent GPU test fail in `CreateComputePipelineState` with `DXGI_ERROR_DEVICE_REMOVED` (`0x887A0005`). #### B. Non-TDR assertion mismatches (10 tests in `mesh_epoch_hlsl`) Skipping only the 2 hanging tests above, `cargo test -p xcl --lib gpu::recomp::mesh_epoch_hlsl -- --test-threads=1` finishes cleanly with **45 passed, 10 failed, 0 device removals**: 1. `d16_image_load_packs_halves_and_commits_atomically` — **first failing test in alphabetical order**, reproduces in isolation (`mesh_epoch_hlsl.rs:3976: left: (0, 0), right: (2147499008, 97280)`) 2. `d16_image_sample_implicit_and_explicit_zero_lod_match` — reproduces in isolation (`mesh_epoch_hlsl.rs:4160: left: (1061158912, 0), right: (1061158912, 1061158912)`) 3. `float_math_family_matches_mature_domains_and_wave64` — reproduces in isolation (`mesh_epoch_hlsl.rs:2492: assertion failed: close(at(absolute_lane, 9), input.log2())`) 4. `float_remainder_matches_cpu_ordering_edges_and_wave64` (`mesh_epoch_hlsl.rs:3124: assertion failed: same(at(absolute_lane, 5), a.ceil())`) 5. `fma_mix_modes_match_cpu_fused_edges_and_wave64` 6. `scalar_binary64_family_matches_cpu_pairs_aliases_and_wave64` 7. `scalar_exec_transforms_match_cpu_masks_and_following_exec_wave64` 8. `scalar_get_pc_uses_byte_next_pc_for_two_waves_and_pair_destinations` 9. `scalar_hardware_configuration_is_inert_in_bounded_shell_live` 10. `transformed_binary_and_scalar_compare_sources_match_wave64` (`wave 0 SGPR0 ballot at lane 8`) *(Side note: after the recent merges to `main`, PR #83 also has merge conflicts in `crates/xcl/src/gpu/recomp/pso.rs`, `crates/xcl/src/gpu/recomp/runner.rs`, and `crates/xcl/src/hle/d3d12x/list_x.rs`.)*
Author
Owner

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

The reviewed updates are now in replacement PR #112. GitHub automatically closed this PR when its stale conflicted head was replaced with a clean commit based on current main, and it does not permit reopening a PR after that head-ref recreation. The discussion and AMD report here remain the basis for the follow-up in #112.

**@⁠bmjask** on GitHub · 2026-11-23 12:10 UTC · [original](https://github.com/xcl-dev/xcl/pull/83#issuecomment-7100607510) The reviewed updates are now in replacement PR #112. GitHub automatically closed this PR when its stale conflicted head was replaced with a clean commit based on current `main`, and it does not permit reopening a PR after that head-ref recreation. The discussion and AMD report here remain the basis for the follow-up in #112.

Pull request closed

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