Skip to content

D3D12.X: a new kind of translation error is logged after the first 40 - #1752

Open
tippythetaidum wants to merge 1 commit into
xcl-dev:mainfrom
tippythetaidum:d3d12x/translation-error-kinds
Open

tippythetaidum wants to merge 1 commit into
xcl-dev:mainfrom
tippythetaidum:d3d12x/translation-error-kinds

Conversation

@tippythetaidum

@tippythetaidum tippythetaidum commented Nov 24, 2026 •

Copy link
Copy Markdown

note_translation_error logs, and keeps for report.json, only the first 40 distinct reasons why a pipeline's console shaders got no translation. A retail title's minimap pipelines give 40 refusals of the form "mesh pipeline with its MS in the AS slot – refused", one per shader hash. They use up all 40 places within ~9 s of the start. Nothing that fails after that leaves a line in the log or an entry in report.json.

In a 240 s run on main c160d86 the report counted 4 failed background pipeline builds (background_pipelines: [1186, 4, 57572]) and listed no reason. In a local build of main with the cap lifted, the reason turned out to be the driver rejected the compute PSO with the translated CS (0x8007000e) at 87 s, during world loading. That pipeline's dispatches were then skipped. #1300 adds a log line for that one path (the driver's refusal of a compute PSO). This PR is about the cap itself, so that no new kind of failure is hidden behind 40 of another.

The first 40 reasons are kept as before. Past them, a reason is still logged and kept when its kind is new. The kind is the reason's text with shader hashes (16 hex digits) and plain numbers left out. HRESULTs (0x…) stay in the kind, so a different HRESULT is a different failure. At most 120 reasons are kept.

What is in it

  • crates/xcl/src/hle/d3d12x/real.rs: keep_translation_error() and translation_error_kind(), used by note_translation_error. Tests in translation_error_tests:
    • a_new_kind_of_error_is_kept_after_forty_of_another: fails on main, where the 41st reason is never kept.
    • the_first_forty_reasons_are_kept_as_before.
    • at_most_120_reasons_are_kept.
    • a_kind_leaves_out_hashes_and_numbers_only.

Tested

  • NVIDIA GeForce RTX 5080 16 GB (driver 32.0.16.2114, 32-lane waves), AMD Ryzen 7 9800X3D, 31 GB RAM + 32 GB page file, Windows 11 Home 26200, rustc 1.97.1. Release build for the title runs, debug for the tests.
  • cargo test --workspace --no-fail-fast -- --test-threads=4 on cf84f9b: 963 passed, 0 failed, 43 ignored.
  • main c4d37be: 958 passed, 1 failed, 43 ignored. The failure is test_title_draws_with_a_root_signature_under_the_debug_layer: its test title made no progress for 10 min and I ended it. That test passed on main 6c89285 on this machine, so it is intermittent here. It did not hang on this PR's head.
  • SKIPPED: 22 lines, the same on main c4d37be:
    • 18 are no wave64: the wave64 variants in gpu::recomp::lower / lower_dxil, plus gpu_geometry_wave32_prefix_count_over_a_mask and gpu_wave32_program_in_wave64_hardware.
    • 3 are per-lane forms refused (… #1426 semantics differ from the console's), in lower_dxil::tests::f16_programs_on_the_gpu / f32_programs_on_the_gpu.
    • 1 is heap_window_out_of_memory_falls_back_to_the_switch_form (no heap windows).
  • Retail title, 240 s, XCL_NETWORK=0 XCL_ACTIVITY=1 XCL_RUN_SECONDS=240, XCL_PRESS_A_AT every 4 s from 16 to 120 s, on 947c2d3. That is the same change before its rebase onto c4d37be. The run ended at 240 s with no crash. No build failed (background_pipelines: [1697, 0, 57066], 0 DXC failures), so the run produced no reason past the first 40, and it does not show the new path in use.

Regression run
main c4d37be:

xcl-smoke v1
commit: c4d37bec1bb4286eb373aea963404a23f13401fa
gpu: NVIDIA GeForce RTX 5080
title: 8b0daefa
seconds: 60
exit: 0x0
frames shown: 1278 (PresentX 1279)
presents per 2 s (last 3): 28 24 60
device removals: 0
crashes: 0
peak commit: 27825 MB

this PR cf84f9b:

xcl-smoke v1
commit: cf84f9b37db1a0cd4aa0c4e9a7a4b46fd27d5373
gpu: NVIDIA GeForce RTX 5080
title: 8b0daefa
seconds: 60
exit: 0x0
frames shown: 1305 (PresentX 1306)
presents per 2 s (last 3): 12 26 44
device removals: 0
crashes: 0
peak commit: 30137 MB

Run back to back, main first. Within 60 s the title's own progress varies between runs, and peak commit follows it. An earlier pair at 6c89285 / 947c2d3 had main 1510 frames / 15459 MB and this change 1296 / 27039 MB. A second pair at the same commits had main 1353 / 25937 MB and this change 1631 / 15277 MB.

Not tested

  • AMD / native wave64, Linux / Wine.
  • A run on this branch in which a pipeline fails after the first 40 reasons. That case is covered only by the unit tests. The failure it would show was seen with a local cap-lifted build of main, as described above.

AI use

  • Claude Code, Claude Opus 5.5: found the hidden failure with a local diagnostic build, wrote the code, the tests and this description, and ran the builds, tests and title runs listed above. The account owner directed the work.

🤖 Generated with Claude Code

@tippythetaidum
tippythetaidum marked this pull request as ready for review November 24, 2026 20:17
@futurepro62

futurepro62 commented Nov 24, 2026 •

Copy link
Copy Markdown

Full-suite run, since this PR has no test report yet. Tested exact head 947c2d3 (on its base 6c89285).

Tested

  • NVIDIA GeForce RTX 5070 Ti 16 GB (Blackwell, 32-lane waves only, mesh shaders), driver 616.64, 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 pso_measurement_compiles_an_exact_synthetic_record: 866 passed, 0 failed, 42 ignored. SKIPPED (no wave64): gpu_geometry_wave32_prefix_count_over_a_mask, gpu_wave32_program_in_wave64_hardware.
  • The new tests ran and passed: a_new_kind_of_error_is_kept_after_forty_of_another, the_first_forty_reasons_are_kept_as_before, at_most_120_reasons_are_kept, a_kind_leaves_out_hashes_and_numbers_only.
  • Same head on the AMD Radeon integrated GPU (iGPU) of the Ryzen 7 9800X3D (RDNA2, XCL_ADAPTER=radeon), cargo test --workspace -- --test-threads=4: 867 passed, 0 failed, 42 ignored. SKIPPED: heap_window_out_of_memory_falls_back_to_the_switch_form (no heap windows).
  • Two tests were skipped with --skip on NVIDIA. Both fail on main 7f7e768 too, not because of this PR: under XCL_REQUIRE_GPU=mesh, runner::skip_test turns their skips into failures. heap_window_out_of_memory_falls_back_to_the_switch_form skips when XCL_HEAP_WINDOWS is unset (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), and shaders::tests::pso_measurement_compiles_an_exact_synthetic_record skips because Developer Mode is off on this PC (it cannot disable the driver cache). The AMD run does not set XCL_REQUIRE_GPU, so there both just print SKIPPED.

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.

note_translation_error logs, and keeps for report.json, only the first
40 distinct reasons. A retail title's 40 "MS in the AS slot" refusals,
one per shader hash, use them up within ~9 s of starting, so nothing
that fails later leaves a trace. In a 240 s run on main c160d86
(RTX 5080) the report counted 4 failed background pipeline builds and
listed no reason; with the cap lifted locally, the reason was the
driver's E_OUTOFMEMORY for a translated compute PSO at world loading,
whose dispatches were then skipped.

The first 40 reasons are kept as before. Past them, a reason is still
logged and kept when its kind is new: its text with shader hashes
(16 hex digits) and plain numbers left out. HRESULTs stay in the kind.
At most 120 reasons are kept.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@tippythetaidum
tippythetaidum force-pushed the d3d12x/translation-error-kinds branch from 947c2d3 to cf84f9b Compare November 24, 2026 21:47
@tippythetaidum

Copy link
Copy Markdown
Author

Rebased onto main c4d37be. The head is now cf84f9b, with the same change and no conflicts.

On cf84f9b, RTX 5080, cargo test --workspace --no-fail-fast -- --test-threads=4: 963 passed, 0 failed, 43 ignored (main c4d37be: 958 passed, 1 failed, 43 ignored; the failure is the intermittent test_title_draws_with_a_root_signature_under_the_debug_layer hang, described in Tested). A new back-to-back smoke pair against c4d37be is in the description: 1305 frames / 30137 MB against main's 1278 / 27825 MB, no crash or device removal.

Claude Code, Claude Opus 5.5 wrote this update; the account owner directed the work.

@DavidM1911

Copy link
Copy Markdown
Contributor

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

  • cargo test -p xcl --lib: all passed, 0 failed, ~23 ignored. (Intermittent single-test flake under parallel scheduling; clean on single-threaded rerun — same flake seen on unmodified main.)

Thanks!

@tippythetaidum

Copy link
Copy Markdown
Author

Status update before I step away from XCL work.

  • cf84f9b still merges cleanly into main 426a5a7 (git merge-tree --write-tree exit 0). On main, note_translation_error still keeps only the first 40 distinct reasons (g.len() < 40).
  • 79fde18 (merged) now logs a huge compute program's driver refusal itself. That covers the case that led me here. This PR still covers every other kind of failure that comes after the first 40: CS translation errors, other driver refusals, and mesh / stream refusals.

I won't be iterating on this PR. Maintainers can push to the branch: please rebase, adjust or close it as you see fit.

Claude Code, Claude Opus 5.5 wrote this comment; the account owner directed the work.

Osanchez pushed a commit to Osanchez/xcl that referenced this pull request Nov 26, 2026
Commit:   cf84f9b
Reviewer: Claude Code (Claude Opus 5.5), Opus worker, full read (clean)
Review:   sha256 8b8d1a9aea4f2b0293a09e1c5fa68bae6dc76003eb609535ffef28f080202b2f
@Foniass

Foniass commented Dec 1, 2026

Copy link
Copy Markdown
Collaborator

Triage (#1607) – head cf84f9b

No open or merged PR makes the same change; note_translation_error on main still stops at 40 reasons. #1300 (mentioned in the description) logs one specific driver refusal and does not change the cap.
keep_translation_error / translation_error_kind do what the title says, and the tests cover the 40 / new-kind / 120 limits. One limitation: a hash written with a 0x prefix (18 characters) is not stripped from the kind.
Recommendation: keep open.

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

@fromthemoonx

fromthemoonx commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor

merge-check
base: b2b1f10
head: cf84f9b
merge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2906 passed, 0 failed, 51 ignored; SKIPPED: 25 (22 no wave64, 2 no heap windows, 1 no GPU_UPLOAD heaps), same set as base alone (2902 passed, 0 failed, 51 ignored); failing: none
review: no correctness problem found after reading the whole diff (1 file, +88 -1). The first 40 distinct reasons are kept as before; past them a reason is kept only when its kind (hashes of 16 hex digits and plain numbers replaced by #) is new, up to 120.

  • The 4 new tests in translation_error_tests pass 3 of 3 runs (CPU-only).
  • Mutation: keep_translation_error back to main's rule (stop at 40) fails a_new_kind_of_error_is_kept_after_forty_of_another and at_most_120_reasons_are_kept. Good.
  • Minor, not a blocker: a reason whose text carries an instruction offset or other 0x… value (e.g. gpu/dxil/cfg.rs:56 +{off:#x}: cannot decode) keeps it in the kind, so each offset is a new kind. Scratch test: 200 CS: +0x…: cannot decode (X) reasons after 40 others filled all 80 extra places (120 kept), so a later new kind would be hidden again, as on main at 40. I did not check whether such reasons reach note_translation_error on main. If it matters, a test with such a reason would show it; any fix must keep HRESULTs like (0x8007000e) distinct, as the PR intends.
  • No retail title on this machine: the change was not checked on a real title's log or report.json.
    performance: reasoned, not measured: the kind is computed only for a new reason once 40 are kept (each call then recomputes the kinds of up to 120 kept strings under the lock), on the pipeline-translation failure path only. report.json can list up to 80 more reasons.
    verdict: safe to merge
    hardware / tool and model: RTX 3060 12 GB (610.88), Ryzen 7 5700X, Windows 11 Pro 26300 / Claude Code (Claude Opus 5.5)

@github-actions github-actions Bot added area:d3d12 D3D12.X runtime, command lists, resources, sparse memory gpu:both Code affects both AMD and NVIDIA GPUs (scope tag; see needs:*-test for remaining checks) needs-1st-check Passes gates; needs first independent merge-check (#3041) needs:amd-test Needs a test report or merge-check on an AMD GPU needs:nvidia-test Needs a test report or merge-check on an NVIDIA GPU needs-2nd-check Has 1 safe merge-check; needs second independent check (#3041) and removed needs-1st-check Passes gates; needs first independent merge-check (#3041) needs:nvidia-test Needs a test report or merge-check on an NVIDIA GPU labels Dec 1, 2026
@vasanex

vasanex commented Dec 2, 2026

Copy link
Copy Markdown

merge-check claim
head: cf84f9b

@vasanex

vasanex commented Dec 2, 2026

Copy link
Copy Markdown

merge-check
base: 1c8b551
head: cf84f9b
merge: clean (merged tree afecf512, git diff --check clean)
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2913 passed, 0 failed, 51 ignored; SKIPPED: 25 (22 no wave64, 2 no heap windows, 1 cannot disable the driver cache), the same set as on the base; failing: none. Base alone, same machine: 2909 passed, 0 failed, 51 ignored. The four new tests in translation_error_tests pass.
review: whole diff read (one file, real.rs, +88/-1). No finding that should stop it. The first 40 distinct reasons are kept exactly as before; past them a reason is kept only when its kind (the text with 16-digit hex words and plain numbers replaced) is new, up to 120 in all, so the list and report.json stay bounded. translation_error_kind keeps 0x... HRESULTs because the x makes the word neither all digits nor 16 hex digits. Small points: past 40 entries each new error computes the kind of every kept entry under the TRANSLATE_ERRORS lock (at most 120 short strings, on a failure path only); a 16-letter word made of a-f only would count as a hash, which the last test names.
performance: none by default on the success path; on a translation failure past the 40th, a scan of at most 120 short strings. Reasoned, not measured. Logging only, no title run.
verdict: safe to merge
hardware / tool and model: NVIDIA GeForce RTX 3080 10 GB (driver 621.40), AMD Ryzen 9 7950X, Windows 11 Pro 26200, rustc 1.100.0, debug / Claude Code with Claude Fable 5.2. Run and posted without a human check of each point.

@github-actions github-actions Bot added ready-to-merge Has 2 independent safe merge-checks on current head (#3041) and removed needs-2nd-check Has 1 safe merge-check; needs second independent check (#3041) needs:amd-test Needs a test report or merge-check on an AMD GPU labels Dec 2, 2026
@ClosetPie107

Copy link
Copy Markdown

Linux / AMD RDNA4 (RADV, Wine + vkd3d-proton): full test suite on cf84f9b

Merged onto main 5eaadb54 (clean merge) and compared with main run twice on the same machine.

Setup

  • AMD Radeon RX 9070 16 GB (RDNA4, RADV GFX1201, Mesa 26.3.1), Ryzen 5 9600X, 30 GiB RAM, CachyOS (kernel 7.3.7)
  • Wine 11.23 (system), stock vkd3d-proton v3.1-83-gcae8353ed and DXVK dxgi.dll from GE-Proton11-16, DXC 1.9.2609.5
  • Debug build, cross-compiled for x86_64-pc-windows-msvc with cargo-xwin; test binaries run under Wine

Tested: cargo xwin test --workspace --target x86_64-pc-windows-msvc --no-fail-fast -- --test-threads=4 --skip <31 tests>

passed failed ignored
main 5eaadb54 2769 177 52
this PR merged 2773 177 52
  • Tests that fail with this PR and pass on main: none.
  • Tests this PR adds: 4 of 4 pass (a_new_kind_of_error_is_kept_after_forty_of_another, the_first_forty_reasons_are_kept_as_before, at_most_120_reasons_are_kept, a_kind_leaves_out_hashes_and_numbers_only).
About the failures on main and the 31 skipped tests (same for every PR in this batch)
  • Most of main's 177 failures under Wine come from Linux (Wine + vkd3d-proton): a retail game reaches what main reaches on Windows; the obstacle is replaced vtables — proposal: proxies #175: once a test has set up the real device, vkd3d-proton refuses the command allocators XCL adopts (d3d12_command_list_Reset: Invalid command allocator), and later tests get E_INVALIDARG (0x80070057). Running vkd3d-proton master with its vtable check taken out, hle::d3d12x::sparse::tests goes from 106 passed / 38 failed to 144 / 0.
  • The 31 skipped tests make vkd3d-proton's dxil-spirv call std::terminate() (Cannot reliably convert LLVM pointer type, we cannot differentiate between Function and Private), which kills the whole test binary. They are the split-wave64, dispatch-chain and bridged-mask GPU tests, gpu_compute_mode_dispatch_abi, gpu_compute_thread_limits_leave_the_lanes_past_them_out, the two gpu_mesh_mode_* tests, and console_wave64_compute_through_the_pso_hook_dispatch_and_read_back, plus serialize_root_signature_strips_console_flags_and_preserves_pc_flags, whose null descriptor vkd3d-proton dereferences. The dxil-spirv ones crash the same way with vkd3d-proton master (f8c1cae8, dxil-spirv 93ab44c5).
  • main was run twice: same counts, same failure set. SKIPPED lines (same as main): no heap windows (2), no D3D12 debug layer (2-3), driver cache control not implemented in vkd3d-proton (1).

Not tested: Windows, NVIDIA, a retail title / scripts/smoke.ps1, a review of the diff. This is a test report, not a merge-check.

AI use: omp (Claude Opus 5.5) merged, built and ran the suites on this machine, compared the results with main, and drafted this report. The user asked for it to be posted.

@throny throny added needs:amd-test Needs a test report or merge-check on an AMD GPU needs:title-run Runtime change: needs a merge-check with a real title run into the world (#3041) and removed ready-to-merge Has 2 independent safe merge-checks on current head (#3041) labels Dec 2, 2026
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 goal:world-load Bears on the retail title getting past world loading gpu:both Code affects both AMD and NVIDIA GPUs (scope tag; see needs:*-test for remaining checks) needs:amd-test Needs a test report or merge-check on an AMD GPU needs:title-run Runtime change: needs a merge-check with a real title run into the world (#3041)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants