Skip to content

Expand bounded GPU compatibility coverage - #35

Closed
bmjask wants to merge 1 commit into
xcl-dev:mainfrom
bmjask:codex/gpu-compatibility
Closed

bmjask wants to merge 1 commit into
xcl-dev:mainfrom
bmjask:codex/gpu-compatibility

Conversation

@bmjask

@bmjask bmjask commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • expand bounded scalar, vector, memory, image, lane, and control-flow compatibility
  • add structural descriptor validation and deterministic aggregate coverage reporting
  • add validation-only two-wave scheduling, checked per-slot lowering, buffer-backed state layouts, and dormant two-pass recording prerequisites
  • add checked guest-to-host read-only region mapping for validation memory loads
  • preserve fail-closed production eligibility and resource bounds

Verification

  • full rebuilt workspace suite: 564 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
  • measured validation per-slot vector coverage: 5,556,432/5,556,444 decoded instructions (approximately 99.9998%)
  • measured validation per-slot scalar coverage: 1,868,367/1,868,367 decoded instructions (100%)
  • the latest aggregate survey accepted 0/9,282 whole-program shells; every first unlowered operation is now in the memory family
  • live Wave64 tests cover scalar operations, two-wave scheduling, fault isolation, buffer state, control flow, local-memory rendezvous, lane operations, comparisons, conversions, carry masks, arithmetic, and checked read-only mapping
  • public diff, paths, and commit metadata scanned for local paths, logs, retired labels, and identifying asset names

Current boundary

The validation shell remains deliberately disconnected from production eligibility. The latest aggregate survey reports 2,766 programs blocked by the current group-shared state limit and 6,516 by unsupported per-slot lowering. Every observed scalar operation is covered; the first remaining unlowered family is Memory for all 9,282 programs. Memory-family slot lowering and the shared-state limit are the next measured blockers. Deterministic redacted memory-frequency reporting identifies scalar-buffer, vector-buffer, and scalar loads as the dominant remaining families. Only 12 decoded relative-move vector instructions remain outside per-slot vector lowering. A checked buffer-backed vector-register layout exists as a disconnected prerequisite, but the epoch shell still needs an atomic migration of its vector access sites before relative moves or shared-state-limited programs can be enabled safely. Production activation and dispatch parameters remain unavailable without the missing executable/runtime evidence.

Notes

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

@bmjask
bmjask force-pushed the codex/gpu-compatibility branch 5 times, most recently from 7539fec to b04846c Compare November 22, 2026 20:31
@bmjask
bmjask force-pushed the codex/gpu-compatibility branch 2 times, most recently from be26661 to 8ba5d1a Compare November 22, 2026 20:48
@grahamster2

Copy link
Copy Markdown
Collaborator

Ran this on the two GPUs it's meant for, merged onto current main plus #41 to pick the adapter, cargo test --workspace --release --no-fail-fast, with XCL_SAMPLE_RPF set to a retail shaders.rpf.

RTX 3080 (D3D12 wave range 32..32, mesh tier 1): 546 passed, 2 failed. The 2 failures are the existing wave64-MS ones (retail_mesh_pipelines_through_the_hook 0 / 7, and the mesh half of the background-build test), the same as on main. Most of the new wave64 coverage doesn't actually run there, though:

  • The validation epoch shell (mesh_epoch_hlsl.rs, validation_epoch_hlsl) is [WaveSize(64)] [numthreads(128,1,1)] and reads lanes through WaveReadLaneAt(.., source < 64), so it's a native-wave64 form. Its 19 GPU checks compile it and then return early on !wave64_supported(), and libtest counts them as passed. The same goes for gpu_vector_relative_source_destination_moves (behind gpu_ready()) and the wave64 parts of mesh_program / mesh_slot.
  • The mesh-dispatch tests (mesh_dispatch, mesh_lane, mesh_reduce, mesh_scalar, mesh_vgpr, mesh_vector, mesh_memory, ...) do run on it and pass. No device removal or TDR.

So on NVIDIA nothing runs a two-wave epoch yet. I don't think that's a problem for a validation-only PR, but the PR text ("live Wave64 tests cover two-wave scheduling ...") could say these need a wave64 adapter. I've proposed on #42 that such skips get printed and counted.

Radeon RDNA2 iGPU (Ryzen 5 7600X, driver 24.30.66; wave 32..64, no mesh shaders): 479 passed, 69 failed.

  • 66 fail with CreatePipelineState (mesh): The parameter is incorrect (unwrap on the runner's mesh draw): 26 in mesh_vector, 15 mesh_scalar, 14 mesh_memory, 5 mesh_dispatch, 2 mesh_alloc_export, and 1 each in mesh_export, mesh_lane, mesh_reduce, mesh_vgpr. These tests need a check like mesh_ready() in recomp/tests.rs (runner::mesh_shaders_supported(), added in Run the GPU tests on any adapter: XCL_ADAPTER, mesh-shader check, the test title's device from d3d12_xs #41; on main the runner doesn't read MeshShaderTier yet).

  • 3 are real numeric differences on this native-wave64 adapter (none of them uses mesh), probably worth a look since this is the only kind of hardware where the epoch shell runs:

    • float_math_family_matches_mature_domains_and_wave64: close(at(absolute_lane, 9), input.log2()) fails (mesh_epoch_hlsl.rs:2095)
    • fma_mix_modes_match_cpu_fused_edges_and_wave64: got 0x51517E00, expected 0x5151FE00 (:2324)
    • global_load_last_dword_succeeds_and_oob_preserves_destination: got 0xA5A55A5A, expected the preserved 0x51515151 (:2586)

    I haven't dug into these. The OOB one looks like the destination isn't preserved when the load is refused, or the bound check passes on this driver. Happy to run a patched branch on either GPU if that helps.

main + #41 on the same iGPU passes everything (354 passed).

@bmjask
bmjask force-pushed the codex/gpu-compatibility branch 8 times, most recently from 11803c0 to 83e26c6 Compare November 22, 2026 21:43
@Foniass

Foniass commented Nov 22, 2026

Copy link
Copy Markdown
Contributor

Tested on RTX 5070 Ti only (Blackwell, driver 32.0.16.2114, D3D12 wave range 32..32, mesh tier 1). The RDNA2 iGPU on this machine is disabled, so it wasn't tested. The branch was merged onto main 521ec08 (clean merge) and run with cargo test --workspace --release --no-fail-fast -- --test-threads=4, no XCL_SAMPLE_* set. Hardware details are in #42.

passed failed ignored
main 521ec08 367 0 34
main + #35 574 1 36
  • The PR adds 210 tests, and every existing test still passes. There was no TDR and no device removal.
  • New failure, reproducible when run alone: mesh_vector::tests::decoded_final_float_math_edges_match_actual_u6 (mesh_vector.rs:9072). Register 3 is v_fract_f32 of +inf. The CPU model (value - value.floor(), :3434) expects NaN; the GPU gives 0x7F800000 (+inf). The stage-B lowering emits frac(x) (mesh_vector.rs:4159), and on this driver frac(+inf) is +inf. Other forms I tried there:
    • x - floor(x) also gives +inf (it ends up as the same frc).
    • min(x - floor(x), asfloat(0x3F7FFFFFu)), the form of fract_f in emit.rs, gives 0x3F7FFFFF, because min returns the non-NaN operand.
    • (isinf(x) ? asfloat(0x7FC00000u) : frac(x)) passes, and all 218 mesh_ tests then pass on the 5070 Ti.
  • What runs on NVIDIA: 41 tests return through gpu_ready() (main has 40; the new one is gpu_vector_relative_source_destination_moves). Another 29 compile their HLSL and then return on !wave64_supported() without a message: 28 in mesh_epoch_hlsl.rs, 1 in mesh_epoch_vgpr_buffer.rs. main now has runner::skip_test (GPU tests that cannot run on the adapter say so: SKIPPED lines, a count in scripts/test.ps1, XCL_REQUIRE_GPU (#42) #51), which would make these show up as SKIPPED after a rebase. The mesh-dispatch families (mesh_vector, mesh_scalar, mesh_memory, …) do run here.

@bmjask
bmjask force-pushed the codex/gpu-compatibility branch 9 times, most recently from e0390f7 to a9c66e1 Compare November 23, 2026 01:42
@bmjask
bmjask force-pushed the codex/gpu-compatibility branch from a9c66e1 to 657fac5 Compare November 23, 2026 01:48
@bmjask bmjask closed this Nov 23, 2026
@bmjask
bmjask deleted the codex/gpu-compatibility branch November 23, 2026 02:00
ivall added a commit that referenced this pull request Nov 23, 2026
…ommandListsX, big pipelines in the background

The frame clock fired one event type per deadline; a title scheduling the origin and
type 2 at the same offset waited on type 2 for ever after two frames. Now every type
due fires. Newer console layout: queue #35 is ExecuteCommandListsX, list #61 is
ExecuteIndirect (the shift by two from #59 on). Bottom-of-pipe writes into memory the
GPU does not see are done by the CPU after the queue's work, waits there read it on the
CPU. Compute pipelines of 256 KB of DXIL or more are built in the background (2 at a
time), a bind of one not started builds it itself. DXC -O1 from 1 MB of HLSL.
`xcl shaders --precompile --pipelines` warms the driver's cache.
oni-swr added a commit to oni-swr/xcl that referenced this pull request Nov 26, 2026
A shared stand-in (`standin::shell`) is a Rust object, not a D3D12Core
pipeline. Device xcl-dev#34 MakeResident and xcl-dev#35 Evict keep the PC layout for
console code and had no override, so a stand-in pipeline in the title's
object array reached the driver as `*mut Shell`.

Both are overridden now. Microsoft's MakeResident / Evict support
residency changes on descriptor heaps, heaps, committed resources and
query heaps only; a pipeline state is ID3D12Pageable but not among them,
so the pipeline behind a stand-in is no valid entry either. Each shell
is left out of the array: the driver gets the other objects in order, in
a copy (the title's array is left as it is), and its HRESULT is returned
as it is. A call with stand-ins only returns S_OK without a driver call.
Arrays without a stand-in (empty, null, supported objects) go as they are.
Nothing builds or waits for a lazy pipeline.

The other entry points named in xcl-dev#2455 are not reachable by title code on
main: device xcl-dev#46 SetResidencyPriority and xcl-dev#51 EnqueueMakeResident are
console extensions there (a logged S_OK stub), xcl-dev#44 is the console's
CreatePlacedResourceX (no native pipeline library for StorePipeline),
and xcl-dev#12 CreateCommandList goes to `create_command_list_pc`, which
resolves the initial pipeline.

Fixes xcl-dev#2455

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants