Skip to content

D3D12.X: isolate rendering artifacts by shader hash - #1827

Open
mokkamokacaffe wants to merge 4 commits into
xcl-dev:mainfrom
mokkamokacaffe:debug/shader-draw-isolation
Open

mokkamokacaffe wants to merge 4 commits into
xcl-dev:mainfrom
mokkamokacaffe:debug/shader-draw-isolation

Conversation

@mokkamokacaffe

@mokkamokacaffe mokkamokacaffe commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

Add a runtime diagnostic for reducing a visible rendering artifact to the translated vertex or pixel shader that produces it. XCL_TRACE_FRAME reports shader hashes; XCL_DEBUG_SKIP_SHADERS suppresses selected hashes so candidates can be bisected without changing translation.

What is in it

  • Parse nonzero hexadecimal shader hashes from XCL_DEBUG_SKIP_SHADERS and suppress matching translated graphics draws.
  • Cover direct, indexed and graphics ExecuteIndirect draws while leaving compute dispatches unchanged.
  • Count diagnostic skips with the existing skipped-draw activity counter and log matching VS/PS hashes.
  • Add parser regression coverage and document the trace-and-bisect workflow.

Tested

  • On cea3f4fa, the Windows workspace passed 2,741 tests (49 ignored). On predecessor 62197903, JJAutoCompare verified the hash-list parser on Intel Arc A770, and Toons29 ran a paired 60-second retail smoke on RX 9070. The AMD smoke used default settings. Intel report · AMD blocks

  • frenziedcoder tested predecessor 0dd553221d98937d52c60747517014f673e7a728 on NVIDIA GeForce RTX 5080 16 GB, driver 617.14, Windows 11 Pro 25H2, rustc 1.100.0 and DXC 1.8.2502.11.

  • cargo build --workspace && cargo test --workspace -- --test-threads=4: 960 passed, 0 failed, 43 ignored.

  • debug_shader_hash_list_ignores_bad_and_zero_entries: passed.

  • git diff --check: passed.

Regression run

Conflict repair on pinned main 0fe06eb, PR head cea3f4f. Workspace: 2,741 passed, 0 failed, 49 ignored, 27 explicit SKIPPED lines. The focused hash-list regression passed separately. The default smoke did not exercise shader suppression. Both release smokes used separate empty XCL caches and XCL_PREPARE=0 on the same RTX 4080 SUPER. OpenAI Codex reconciled the changes, ran validation, and prepared this update.

Main

xcl-smoke v1
commit: 0fe06eb0f05459007ebfffc67bb9983acb3a832d
gpu: NVIDIA GeForce RTX 4080 SUPER
title: retail-local
seconds: 60
exit: 0x0
frames shown: 1584 (PresentX 1584)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 16004 MB

PR

xcl-smoke v1
commit: cea3f4fa1ae79e7a956cea6394c0495d1e9f2cfe
gpu: NVIDIA GeForce RTX 4080 SUPER
title: retail-local
seconds: 60
exit: 0x0
frames shown: 1618 (PresentX 1618)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 15885 MB

Earlier regression evidence (historical):

main:

xcl-smoke v1
commit: c4d37bec1bb4286eb373aea963404a23f13401fa
gpu: NVIDIA GeForce RTX 5080
title: 16b5e5d4
seconds: 60
exit: 0x0
frames shown: 1653 (PresentX 1653)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14599 MB

PR:

xcl-smoke v1
commit: 0dd553221d98937d52c60747517014f673e7a728
gpu: NVIDIA GeForce RTX 5080
title: 16b5e5d4
seconds: 60
exit: 0x0
frames shown: 1651 (PresentX 1651)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14598 MB

Not tested

  • World-load rendering; the smoke pair stopped at the start screen.
  • AMD execution on the repaired head and visual artifact isolation with shader suppression enabled.
  • The requested D3D12 debug layer was unavailable on the test machine, so that run is not debug-layer evidence.

AI use

  • OpenAI Codex inspected the supplied video and current draw-submission paths, implemented the diagnostic and tests, and drafted the original description.
  • Claude Code ran the independent Windows/NVIDIA suite and smoke pair and drafted the posted report; the contributor checked it.

@frenziedcoder

frenziedcoder commented Nov 24, 2026 •

Copy link
Copy Markdown

NVIDIA test report for 0dd5532: full suite green, its own test debug_shader_hash_list_ignores_bad_and_zero_entries passes, and a clean smoke pair on the retail title (1651 vs 1653 frames).

Tested

  • NVIDIA GeForce RTX 5080 16 GB (driver 617.14, 32-lane waves), AMD Ryzen 7 9800X3D, 64 GB, Windows 11 Pro 25H2 (26200.9974), rustc 1.100.0 stable-x86_64-pc-windows-msvc, DXC 1.8.2502.11 (SDK 10.0.26100.0). Exact head 0dd553221d98937d52c60747517014f673e7a728, no local changes.
  • cargo build --workspace && cargo test --workspace -- --test-threads=4 (debug): 960 passed, 0 failed, 43 ignored; the PR's own test debug_shader_hash_list_ignores_bad_and_zero_entries passes. SKIPPED: gpu::recomp::lower::tests::a_2d_or_3d_group_agrees_with_the_hlsl_path_on_the_gpu (no wave64), gpu::recomp::lower::tests::coalesced_guarded_runs_agree_with_the_hlsl_path_on_the_gpu (no wave64), gpu::recomp::lower::tests::cross_lane_reads_agree_with_the_hlsl_path_on_the_gpu (no wave64), gpu::recomp::lower::tests::the_wave64_lowering_agrees_with_the_hlsl_path_on_the_gpu (no wave64), gpu::recomp::lower_dxil::tests::a_per_lane_2d_or_3d_group_runs_on_the_gpu (no wave64), gpu::recomp::lower_dxil::tests::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))), gpu::recomp::lower_dxil::tests::f16_programs_on_the_gpu (f16 arithmetic, wave64: no wave64), 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 gpu: direct RDNA2 -> DXIL backend (no HLSL / DXC), behind XCL_DIRECT_DXIL #1426 semantics differ from the console's))), gpu::recomp::lower_dxil::tests::f16_programs_on_the_gpu (f16 packed, wave64: no wave64), gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu (f32 arithmetic, wave64: no wave64), gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu (f32 compares, wave64: no wave64), gpu::recomp::lower_dxil::tests::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))), gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu (f32 conversions, wave64: no wave64), gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu (f32 rounding, wave64: no wave64), gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu (f32 three-source, wave64: no wave64), gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu (f32 transcendentals, wave64: no wave64), gpu::recomp::lower_dxil::tests::f64_programs_on_the_gpu (f64, wave64: no wave64), gpu::recomp::lower_dxil::tests::integer_programs_on_the_gpu (integer arithmetic, wave64: no wave64), gpu::recomp::lower_dxil::tests::integer_programs_on_the_gpu (integer carries, wave64: no wave64), gpu_geometry_wave32_prefix_count_over_a_mask (no wave64), gpu_wave32_program_in_wave64_hardware (no wave64), heap_window_out_of_memory_falls_back_to_the_switch_form (no heap windows).
  • test_title_draws_with_a_root_signature_under_the_debug_layer reports ok, but this machine has no D3D12 debug layer (debug layer requested but unavailable … (0x887A002D)), so it ran without the layer and is no evidence either way.

Regression run (scripts/smoke.ps1 -Seconds 60, release, the retail title of #505 at its start screen; XCL_PSO_PRELOAD=0 for both builds, because this machine's preload list holds the program of #1307)

base (c4d37be, this PR's merge base with main):

xcl-smoke v1
commit: c4d37bec1bb4286eb373aea963404a23f13401fa
gpu: NVIDIA GeForce RTX 5080
title: 16b5e5d4
seconds: 60
exit: 0x0
frames shown: 1653 (PresentX 1653)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14599 MB

this PR:

xcl-smoke v1
commit: 0dd553221d98937d52c60747517014f673e7a728
gpu: NVIDIA GeForce RTX 5080
title: 16b5e5d4
seconds: 60
exit: 0x0
frames shown: 1651 (PresentX 1651)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14598 MB

Not tested: the world load (the smoke runs stop at the start screen, so code that only runs later is not exercised there); AMD.

AI use: Claude Code (Claude Opus 5.5) built and ran the tests and smoke runs on my machine and wrote this report; I checked it.

@DavidM1911

Copy link
Copy Markdown
Contributor

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

Thanks!

@JJAutoCompare

Copy link
Copy Markdown

PR #1827 — D3D12.X: isolate rendering artifacts by shader hash

  • Repository xcl-dev/xcl. Tested the live fetched refs/pull/1827/head at 62197903bc41af638f862be81882eb34af72a3c5 in a clean detached checkout.
  • Fetched origin/main at aaa093657bd96a146c05c0c1a9b61149fe761453. git merge-tree --write-tree origin/main HEAD exited 0 and produced tree d96913e71f067fe2a57c6e07bfed61d4405965aa.

What is in it

  • crates/xcl/src/hle/d3d12x/bind.rs adds XCL_DEBUG_SKIP_SHADERS filtering by translated VS/PS hash for graphics draws, including indirect draws, and a unit test for parsing the hash list. README.md documents usage.

Tested

  • STOR-WINLAB, Intel Arc A770 16 GiB, driver 32.0.101.9175, wave range 8–32, DoublePrecisionFloatShaderOps=0. AMD Ryzen 7 3800X, Windows 11 Enterprise Evaluation build 26200.9974.
  • rustc 1.100.0 (0ef1bc386 2026-11-09). Unoptimized dev/test profiles with debug info and incremental compilation disabled. Loaded DXC/DXIL 1.9.2609.5 (DXC revision 01b62ad4).
  • cargo build --workspace and cargo test --workspace --no-run both succeeded outside the GPU lock.
  • cargo test -p xcl --lib debug_shader_hash_list_ignores_bad_and_zero_entries -- --show-output passed outside the GPU lock (1 passed, 0 failed, 0 ignored, 0 skips).
  • cargo test --workspace --no-fail-fast -- --test-threads=4 --show-output ran once under L:/XclTooling/Invoke-ArcTest.ps1 with XCL_ADAPTER=A770. Cargo exited 101. Across 20 test summaries, libtest reported 941 passed, 19 failed, 43 ignored. The log also contains 25 SKIPPED entries, including skipped cases inside tests. Exclude those cases from coverage.
  • Of the 18 library failures, 14 reported CreateComputePipelineState returning 0x80070057. Four assertions failed in FMA contraction, implicit texture LOD, v_add_f16 high-half preservation, and wave64 pixel-shader reductions. The integration failure was test_title_runs_and_game_folder_is_untouched, where the dynamic depth-bias check via RSSetDepthBiasX returned blue where it expected green.
  • Full output is in L:\XclTooling\neon-slot-5\tmp\pr1827-suite.log.

Skip log

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::integer_programs_on_the_gpu: integer arithmetic, 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::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

  • Baseline suite on main, retail-title smoke runs on either revision, shader suppression with XCL_DEBUG_SKIP_SHADERS enabled, sample-data paths that require XCL_SAMPLE_*, and other GPU vendors. The merge-tree check tested mergeability. The suite ran on the PR head.

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 pr1827-suite.log and published this report.

@Toons29

Toons29 commented Nov 25, 2026

Copy link
Copy Markdown

Regression run of 62197903 on the retail title, for this PR's Regression run section. Both blocks are from scripts/smoke.ps1 as printed, not edited: main on 1a0bbe3a, this PR on its head commit with no uncommitted changes, same title and time.

xcl-smoke v1
commit: 1a0bbe3a2ba91ea8f5b6fc29130a053868d3c9e6
gpu: AMD Radeon RX 9070
title: 34df7c50
seconds: 60
exit: 0x0
frames shown: 1628 (PresentX 1628)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14561 MB
xcl-smoke v1
commit: 62197903bc41af638f862be81882eb34af72a3c5
gpu: AMD Radeon RX 9070
title: 34df7c50
seconds: 60
exit: 0x0
frames shown: 1630 (PresentX 1630)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14817 MB

Against the limits in CONTRIBUTING.md: 100 % of main's frames, 102 % of its peak commit, no crash, no device removal.

AMD Radeon RX 9070 (RDNA4, driver 32.0.32029.2010), Ryzen 7 7800X3D, 32 GB, Windows 11 build 26300, Rust 1.100.0, cargo build --release -p xcl, 60 s, XCL_NETWORK=0. This is a regression check only: it does not show whether the run reaches the code this PR changes.

AI use: Claude Code (Claude Opus 5.5) built both trees and ran scripts/smoke.ps1; a script posted this right after the run, with both blocks exactly as printed.

@mokkamokacaffe mokkamokacaffe left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updating README

@DavidM1911

Copy link
Copy Markdown
Contributor

Re-verification on RTX 3060 Ti (Windows 11), new head merged with current main:

  • cargo test -p xcl --lib: all passed, 0 failed, 27 ignored. The earlier merge conflict is resolved.

Thanks!

— Devin

@github-actions github-actions Bot added area:d3d12 D3D12.X runtime, command lists, resources, sparse memory area:docs-ci Documentation, scripts, workflows, repo governance gpu:both Code affects both AMD and NVIDIA GPUs (scope tag; see needs:*-test for remaining checks) labels Nov 29, 2026
@Foniass

Foniass commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

Triage (#1607) – head cea3f4f

Overlaps with #3509, which adds XCL_SKIP_PS (skip direct and indirect draws by console pixel-shader hash) together with pixel history. This PR skips by VS or PS hash. It is the same diagnostic idea, built differently.
Problem: bind.rs:debug_skip_shader_draw looks the hashes up with real::pso_shaders. For graphics pipelines, PSO_SHADERS is filled only when XCL_TRACE_FRAME, XCL_GPU_PROFILE or GPU times are on (translated_graphics_pso_once). With XCL_DEBUG_SKIP_SHADERS alone, nothing is skipped and nothing is logged. #3509 records the hashes whenever its list is set (keeps_shaders). Either record them when the variable is set, or say in the README that XCL_TRACE_FRAME=1 must stay on.
Recommendation: keep open.

AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:d3d12 D3D12.X runtime, command lists, resources, sparse memory area:docs-ci Documentation, scripts, workflows, repo governance gpu:both Code affects both AMD and NVIDIA GPUs (scope tag; see needs:*-test for remaining checks)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants