Skip to content

D3D12.X: derive canonical two-pass driver blob identities - #1941

Merged
raylitebull merged 2 commits into
xcl-dev:mainfrom
ZekkJJ:upstream/two-pass-cache-identity
Nov 25, 2026
Merged

raylitebull merged 2 commits into
xcl-dev:mainfrom
ZekkJJ:upstream/two-pass-cache-identity

Conversation

@ZekkJJ

@ZekkJJ ZekkJJ commented Nov 24, 2026

Copy link
Copy Markdown
Contributor

Add canonical cache identities for the NGG compute pass and the passthrough mesh graphics pass. The keys cover shaders, static samplers, ABI version, memory-window mode, driver identity and relevant fixed-function fields. Part of #1269. Coordinate the field serializers with #1836 and #902.

Stacked on #1937. Only b5767c305e68b34b0981b3e304f73bce85e9f089 belongs here.

What is in it

  • crates/xcl/src/hle/d3d12x/real/two_pass_identity.rs defines the identities and tests state changes, padding, subobject order and rejection of unsupported state. Runtime callers arrive in the next PR.

Tested

  • NVIDIA GeForce RTX 4060 Laptop GPU (8 GiB), driver 616.56, AMD Ryzen 7 8845HS, 16 GiB RAM, Windows 11 25H2 (26200.9974), Rust 1.98.1 (MSVC x64), Windows SDK 10.0.26100.0 (DXC/DXIL 1.8.2502.11). Debug tests and release smoke builds.
  • cargo build --locked --release -p xcl --jobs 1 succeeded on clean b5767c305e68b34b0981b3e304f73bce85e9f089 and baseline 689f2db477c3c062cf162649781640ef8a977c18.
  • .\scripts\test.ps1 (Cargo build jobs 1, test threads 4) on stack head 024b2e2dc51924965df478fdb4f63fbcae9dc0b2 reported 983 passed, 0 failed, 45 ignored across 21 targets. Explicit runtime SKIPPED markers (23) were 18 no native wave64, 3 refused wave32 per-lane operations, 1 Windows Developer Mode unavailable, 1 no heap windows. Optional sample-backed cases also returned early with their sample variables unset. GPU regressions for TRIANGLE replay and both-pass persistence ran without runtime skips.
  • Four canonical identity unit tests passed on the stack head, covering shader and sampler changes, adapter and driver identity, memory-window mode, padding and rejection of unsupported streams.
  • scripts/smoke.ps1 -Game <retail-folder> -Seconds 60 -Title 'Retail workload A' -Xcl <matching-release-binary> on the same anonymized retail workload. NVIDIA selected with XCL_ADAPTER=nvidia.

Regression run

main

xcl-smoke v1
commit: 689f2db477c3c062cf162649781640ef8a977c18
gpu: NVIDIA GeForce RTX 4060 Laptop GPU
title: Retail workload A
seconds: 60
exit: 0x0
frames shown: 758 (PresentX 758)
presents per 2 s (last 3): 42 37 36
device removals: 0
crashes: 0
peak commit: 15842 MB

PR

xcl-smoke v1
commit: b5767c305e68b34b0981b3e304f73bce85e9f089
gpu: NVIDIA GeForce RTX 4060 Laptop GPU
title: Retail workload A
seconds: 60
exit: 0x0
frames shown: 1036 (PresentX 1037)
presents per 2 s (last 3): 52 60 54
device removals: 0
crashes: 0
peak commit: 15414 MB

Not tested

  • AMD and other driver versions. This infrastructure has no runtime consumer at this head. The retail smoke checks general startup and frame production.

AI use

  • OpenAI Codex (GPT-6, deployment variant unavailable) separated the canonical identity code, adapted its tests, and ran and reviewed validation. The earlier implementation is archived in Google Antigravity; its model is unrecorded.

Use the passthrough mesh shader output topology on both translated MS and GS streams. Exercise cached replay against a synthetic triangle PSO.

Assisted-by: OpenAI Codex (GPT-6)
Hash the final driver inputs by value, with distinct compute and mesh domains and versioned ABI state. Exercise state sensitivity and padding independence without enabling persistence.

Assisted-by: OpenAI Codex (GPT-6)
@raylitebull

Copy link
Copy Markdown
Member

Code review on b5767c3:

  • two_pass_stream_key / two_pass_cs_key in crates/xcl/src/hle/d3d12x/real/two_pass_identity.rs correctly canonicalize subobject order, skip ROOT_SIGNATURE / CACHED_PSO, fail closed on duplicates, unknown subobjects, NumRenderTargets > 8, or non-zero pointer-bearing subobjects (7/12/22), and hash BLEND, RASTERIZER{,1,2}, and DEPTH_STENCIL{,1,2} field-by-field without struct padding. Verified against null::subobject_payload that 9 | 13 | 14 | 16 | 17 | 18 | 20 are all padding-free scalar/2-u32 payloads.
  • CI (Build and test (Windows, no GPU) and PR description) is green and mergeStateStatus is CLEAN.

What is still needed before merge:

  1. Independent AMD verification (tests + smoke), since current coverage is NVIDIA-only (RTX 4060 Laptop).
  2. Optional cleanup: #1937 (2c95f01) is now on main, so rebasing onto main will drop the already-merged two_pass_mesh_stream hunks (though Git currently reports MERGEABLE).

@futurepro62

futurepro62 commented Nov 25, 2026 •

Copy link
Copy Markdown

Full-suite run, since this PR has no test report yet. Tested exact head b5767c3 (on its base 9492f43).

Tested

  • NVIDIA GeForce RTX 5070 Ti 16 GB (Blackwell, 32-lane waves only, mesh shaders), driver 621.40, Ryzen 7 9800X3D, Windows 11 Home 26300, Rust 1.100.0 MSVC, DXC + dxil.dll 1.9.2602.17 (Windows SDK 10.0.26100), debug, D3D12 debug layer installed.
  • cargo build --workspace, then XCL_REQUIRE_GPU=mesh cargo test --workspace -- --test-threads=4 --skip heap_window_out_of_memory_falls_back_to_the_switch_form --skip gpu::recomp::lower_dxil::tests::f16_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::integer_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::f64_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::const_and_null_mask_operands_agree_with_hlsl_on_the_gpu --skip gpu::dxil::fuzz_tests: 970 passed, 0 failed, 43 ignored. SKIPPED (no wave64): a_2d_or_3d_group_agrees_with_the_hlsl_path_on_the_gpu, a_per_lane_2d_or_3d_group_runs_on_the_gpu, coalesced_guarded_runs_agree_with_the_hlsl_path_on_the_gpu, cross_lane_reads_agree_with_the_hlsl_path_on_the_gpu, gpu_geometry_wave32_prefix_count_over_a_mask, gpu_wave32_program_in_wave64_hardware, the_wave64_lowering_agrees_with_the_hlsl_path_on_the_gpu.
  • The new tests ran and passed: canonical_stream_key_distinguishes_state_samplers_and_driver, canonical_stream_key_normalizes_padding_and_rejects_pointer_subobjects, two_pass_keys_cover_mem_windows_invalid_counts_and_duplicates, two_pass_cs_key_changes_with_samplers_and_driver.
  • Same head on the AMD Radeon integrated GPU (iGPU) of the Ryzen 7 9800X3D (RDNA2, XCL_ADAPTER=radeon), cargo test --workspace -- --test-threads=4 --skip gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1: 979 passed, 0 failed, 45 ignored. SKIPPED: f16_programs_on_the_gpu (f16 arithmetic, wave32, per-lane form: refused (unsupported V_MUL_F16 (its gpu: direct RDNA2 -> DXIL backend (no HLSL / DXC), behind XCL_DIRECT_DXIL #1426 semantics differ from the console's))), f16_programs_on_the_gpu (f16 arithmetic, wave64, per-lane form: refused (unsupported V_MUL_F16 (its gpu: direct RDNA2 -> DXIL backend (no HLSL / DXC), behind XCL_DIRECT_DXIL #1426 semantics differ from the console's))), f16_programs_on_the_gpu (f16 packed, wave32, per-lane form: refused (unsupported V_PK_MUL_F16: VOP3 modifiers (its gpu: direct RDNA2 -> DXIL backend (no HLSL / DXC), behind XCL_DIRECT_DXIL #1426 semantics differ from the console's))), f16_programs_on_the_gpu (f16 packed, wave64, per-lane form: refused (unsupported V_PK_MUL_F16: VOP3 modifiers (its gpu: direct RDNA2 -> DXIL backend (no HLSL / DXC), behind XCL_DIRECT_DXIL #1426 semantics differ from the console's))), f32_programs_on_the_gpu (f32 conversions, wave32, per-lane form: refused (unsupported V_CVT_F16_F32 (its gpu: direct RDNA2 -> DXIL backend (no HLSL / DXC), behind XCL_DIRECT_DXIL #1426 semantics differ from the console's))), f32_programs_on_the_gpu (f32 conversions, wave64, per-lane form: refused (unsupported V_CVT_F16_F32 (its gpu: direct RDNA2 -> DXIL backend (no HLSL / DXC), behind XCL_DIRECT_DXIL #1426 semantics differ from the console's))), heap_window_out_of_memory_falls_back_to_the_switch_form (no heap windows).
  • --skip leaves out tests that fail on main 7994cd1 too, not because of this PR. On NVIDIA: heap_window_out_of_memory_falls_back_to_the_switch_form (Tests: heap_window_out_of_memory_falls_back_to_the_switch_form fails under XCL_REQUIRE_GPU=mesh (opt-in skip counted as missing coverage) #1651), the four gpu::recomp::lower_dxil::tests::*_programs_on_the_gpu tests and const_and_null_mask_operands_agree_with_hlsl_on_the_gpu (follow-up on #1651) fail because runner::skip_test turns their skips into failures under XCL_REQUIRE_GPU=mesh, and gpu::dxil::fuzz_tests seeds 70, 545, 1019 and 1507 fail CreateComputePipelineState with E_OUTOFMEMORY on this card (drivers 616.64 and 621.40). On AMD: fuzz_validate_and_gpu_1 fails on seed 540 (res[833] 0x7 vs CPU 0x6). The AMD run does not set XCL_REQUIRE_GPU.

Not tested

  • a release build, a game (test run only).

AI use

  • Claude Code (Claude Opus 5.5) ran the tests and wrote this report. I checked it before posting.

@JJAutoCompare

Copy link
Copy Markdown

PR #1941 verification on STOR-WINLAB

D3D12.X: derive canonical two-pass driver blob identities

  • PR head b5767c305e68b34b0981b3e304f73bce85e9f089, fetched from origin refs/pull/1941/head. The detached checkout was clean before and after testing.
  • origin/main at fetch time was 3da2abb81606df622610e009f0430de99aa9881c. git merge-tree --write-tree origin/main HEAD exited 0 and produced tree f43a7b13523b7666af3d46ee418c4ae9cbe1cfd8.
  • The assigned L:\XclTooling\neon-slot-1 directory contained no checkout. The run reused the thread’s existing detached checkout and used the assigned L: slot for Cargo output, temporary files, and logs.

Tested

  • AMD Ryzen 7 3800X, Intel Arc A770 16 GiB (driver 32.0.101.9175, waves 8–32, DoublePrecisionFloatShaderOps=0), and Windows 11 Enterprise Evaluation build 26200.9974. Rust 1.100.0 (0ef1bc386 2026-11-09) and DXC/DXIL 1.9.2609.5. Cargo dev/test profiles with debug info and incremental compilation disabled.
  • cargo build --workspace and cargo test --workspace --no-run both exited 0 outside the GPU lock.
  • cargo test -p xcl --lib hle::d3d12x::real::two_pass_identity::tests -- --show-output exited 0. All four PR tests passed, with 0 failed, 0 ignored, and 0 reported skips.
  • cargo test --workspace --no-fail-fast -- --test-threads=4 --show-output completed in one pass under the Arc A770 lock via Invoke-ArcTest.ps1. Cargo exited 101 with 955 passed, 25 failed, 45 ignored across 20 harness summaries. Libtest’s pass count includes early-returning tests. There were 25 SKIPPED records across 15 test names. Those skipped cases provide no coverage. Full log: L:\XclTooling\neon-slot-1\tmp\pr1941-suite.log.

Failures

CreateComputePipelineState returned 0x80070057 in these 20 tests. The four fuzz tests stopped at seeds 2, 506, 1003, and 1501 respectively.

gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_0
gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1
gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_2
gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_3
gpu::dxil::ops_tests::doubles_match_cpu
gpu::dxil::ops_tests::groupshared_barrier_and_atomics_run
gpu::dxil::round_tests::gpu_direct_f32_round_modes_dynamic_and_denormals
gpu::dxil::round_tests::gpu_direct_f32_round_modes_static
gpu::recomp::lower_dxil::tests::f64_programs_on_the_gpu
gpu::recomp::tests::gpu_clamp_and_omod_per_instruction
gpu::recomp::tests::gpu_f64_class_compare
gpu::recomp::tests::gpu_f64_compares_with_nan
gpu::recomp::tests::gpu_f64_literal_high_word
gpu::recomp::tests::gpu_f64_math_random
gpu::recomp::tests::gpu_f64_roots
gpu::recomp::tests::gpu_f64_rounding_and_conversions
gpu::recomp::tests::gpu_float_compares_random
gpu::recomp::tests::gpu_frexp_f64_exp_and_mant
gpu::recomp::tests::gpu_ldexp_f64
gpu::recomp::tests::gpu_rndne_f64
  • gpu::recomp::tests::gpu_nonfused_mad_and_mac_prevent_fma_contraction — The fused v_fma_f32 overflow control returned infinity instead of the expected finite value.
  • gpu::recomp::tests::gpu_ps_image_sample_offset_implicit_lod_between_mips — Pixel (0,0) was 25.609375, expected 26.
  • gpu::recomp::tests::gpu_valu_16_and_64_bit — v_add_f16 failed to preserve lane 0’s high half.
  • gpu::recomp::tests::gpu_wave64_ps_whole_wave_reductions — The waterfall-read pixel was [2, 217, 2], expected [2, 216, 2].
  • test_title_runs_and_game_folder_is_untouched — The dynamic depth-bias check (Split wave64: masks read only lane by lane stay in their half #94) rendered the top-right pixel blue instead of green after RSSetDepthBiasX(-1000.5).

Reported skips

SKIPPED gpu::recomp::lower::tests::a_2d_or_3d_group_agrees_with_the_hlsl_path_on_the_gpu: no wave64
SKIPPED gpu::recomp::lower::tests::cross_lane_reads_agree_with_the_hlsl_path_on_the_gpu: no wave64
SKIPPED gpu::recomp::lower::tests::coalesced_guarded_runs_agree_with_the_hlsl_path_on_the_gpu: no wave64
SKIPPED gpu::recomp::lower::tests::the_wave64_lowering_agrees_with_the_hlsl_path_on_the_gpu: no wave64
SKIPPED gpu::recomp::lower_dxil::tests::a_per_lane_2d_or_3d_group_runs_on_the_gpu: no wave64
SKIPPED gpu::recomp::lower_dxil::tests::f16_programs_on_the_gpu: f16 arithmetic, wave32, per-lane form: refused (unsupported V_MUL_F16 (its #1426 semantics differ from the console's))
SKIPPED gpu::recomp::lower_dxil::tests::f16_programs_on_the_gpu: f16 arithmetic, wave64: no wave64
SKIPPED gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu: f32 arithmetic, wave64: no wave64
SKIPPED gpu::recomp::lower_dxil::tests::f16_programs_on_the_gpu: f16 packed, wave32, per-lane form: refused (unsupported V_PK_MUL_F16: VOP3 modifiers (its #1426 semantics differ from the console's))
SKIPPED gpu::recomp::lower_dxil::tests::f16_programs_on_the_gpu: f16 packed, wave64: no wave64
SKIPPED gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu: f32 compares, wave64: no wave64
SKIPPED gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu: f32 conversions, wave32, per-lane form: refused (unsupported V_CVT_F16_F32 (its #1426 semantics differ from the console's))
SKIPPED gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu: f32 conversions, wave64: no wave64
SKIPPED gpu::recomp::lower_dxil::tests::integer_programs_on_the_gpu: integer arithmetic, wave64: no wave64
SKIPPED gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu: f32 rounding, wave64: no wave64
SKIPPED gpu::recomp::lower_dxil::tests::integer_programs_on_the_gpu: integer carries, wave64: no wave64
SKIPPED gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu: f32 transcendentals, wave64: no wave64
SKIPPED gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu: f32 three-source, wave64: no wave64
SKIPPED gpu::recomp::tests::gpu_geometry_wave32_prefix_count_over_a_mask: no wave64
SKIPPED gpu::recomp::tests::gpu_wave32_program_in_wave64_hardware: no wave64
SKIPPED shaders::tests::pso_measurement_compiles_an_exact_synthetic_record: cannot disable the driver cache (Windows Developer Mode is required): The application requested an operation that depends on an SDK component that is missing or mismatched. (0x887A002D)
SKIPPED placed_title_textures_share_vram_and_preserve_pixels: tiled tier < 2
SKIPPED test_title_draws_with_a_root_signature_under_the_debug_layer: no d3d12SDKLayers.dll
SKIPPED heap_window_out_of_memory_falls_back_to_the_switch_form: no heap windows
SKIPPED uploads_start_from_each_subresources_state: no D3D12 debug layer (The application requested an operation that depends on an SDK component that is missing or mismatched. (0x887A002D))

Not tested

Retail-title smoke comparison on main and PR head, a main-branch workspace baseline for attributing the observed failures, game samples gated by XCL_SAMPLE_*, and other GPU architectures. This revision adds the identity helpers and unit tests. The stacked driver-cache integration was outside this run.

AI use

T3 Code / Codex (gpt-6.2-sol) ran the build and tests and drafted this report. Coordinator #2 (T3 Code / Antigravity, gemini-4-neon) verified the counts against pr1941-suite.log and published this report.

@raylitebull
raylitebull merged commit fdb45db into xcl-dev:main Nov 25, 2026
3 checks passed
@DavidM1911

Copy link
Copy Markdown
Contributor

Verification on RTX 3060 Ti (Windows 11), branch merged with current main:

Thanks!

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.

5 participants