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.

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

Labels

goal:world-load Bears on the retail title getting past world loading

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants