Skip to content

D3D12.X: a console MS in the AS slot is translated as the mesh shader it is - #541

Open
ryosen0 wants to merge 7 commits into
xcl-dev:mainfrom
ryosen0:as-slot-ms
Open

ryosen0 wants to merge 7 commits into
xcl-dev:mainfrom
ryosen0:as-slot-ms

Conversation

@ryosen0

@ryosen0 ryosen0 commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

A retail title's minimap pipelines carry their console MS container in the AS subobject with no MS subobject. translated_mesh_stream refused them before (a black screen every run, which was kept as a workaround), and the stand-in path refused them too, for two separate reasons, both fixed here:

  1. fallback_stream built a PS-only stand-in. It decided "mesh" by an MS subobject; these streams have none, so the stand-in had a PS but neither a VS nor an MS and the driver refused it (E_INVALIDARG). go_background returned None and every such pipeline was built in the title's call (NishantParajuli on RTX 5060 Ti, Chrysana on RX 9070 XT: black frames, ~57k pipelines queued; thehollowedone's native fixture: D3D12 message 1022).
  2. The stand-in kept the console's target formats. The title's depth-only mesh pipelines use D16_UNORM_S8_UINT (118); copied as they were, the driver refused the stand-in (E_INVALIDARG, message 685) and those pipelines were also built in the call — the three no stand-in lines Chrysana saw at 52.56 s were this case (NishantParajuli's follow-up, reproduced natively by thehollowedone on ad2118d).

That black screen was the translated mesh shaders failing their ms_6_6 output budget — fixed by the DXC vertex-chunk budget in #304. The slot itself was never the problem. With the budget in place the same shaders translate, the driver accepts the pipelines, and the title keeps rendering.

Stacked on #304; the branch carries its head merge under the change.

What is in it (crates/xcl/src/hle/d3d12x/real.rs)

  • mesh_shader_slots(ms_slot, as_slot) — a console MS container alone in the AS slot becomes the MS to translate and is not an AS any more; a real AS (console or PC), an MS already present, or a PC shader in the AS slot are left as they are. The refusal block is removed. Test a_console_ms_in_the_as_slot_is_the_mesh_shader covers all five cases.
  • The attempt defers a moved MS (dxc::defer under pso_async::lazy), as a console compute pipeline: the title gets a stand-in at once, the worker / first bind translates. Sparse counter log (first 5 + every 1000th). Test a_moved_ms_defers_in_the_attempt_only.
  • fallback_stream: the stand-in of such a stream retypes the AS subobject to MS with the dummy mesh shader and uses the mesh dummy's PS (console_ms_in_as_slot helper). Test the_stand_in_of_a_moved_ms_is_a_mesh_pipeline (fails without the change).
  • fallback_stream: RENDER_TARGET_FORMATS / DEPTH_STENCIL_FORMAT go through device_x::pc_target_format, as the real pipeline's do (118 → 45, 115/86 → 28). Test the_stand_in_of_a_stream_has_the_pcs_target_formats (fails without the change; no DXC or GPU needed).

Tested

  • RTX 3060 Ti 8 GB (wave32), Ryzen 7 9800X3D, driver 32.0.16.1742, Windows 11, release build of 6bd8f64 (rebased onto a1672ef; same changes as 303b346).
  • cargo test --release --workspace --no-fail-fast -- --test-threads=4 on 6bd8f64: 721 passed, 0 failed, 41 ignored (earlier on 303b346, threads=1: 690 passed, 0 failed, 41 ignored) (2 GPU SKIPPED — no wave64 on this adapter). One earlier full run had a single failure in writes_land_after_the_queue (WARP fence timing); it passed isolated and in the clean full rerun — a flake unrelated to this change.
  • 120 s retail run with both fixes (XCL_NETWORK=0 XCL_ACTIVITY=1 XCL_RUN_SECONDS=120, XCL_FRAME_DUMP=240, scripted A presses 16–112): clean exit, steady 60 presents / 2 s, no device removal, 0 no stand-in pipeline lines. First bright capture frame 980 (= main's 980 in the same schedule; the first-fix-only head had 1100). Frames 1700–2660 (t≈57–89 s) are the black world-load window; the title returns to its artwork screen at frame 2900 — no crash, no watchdog stop within 120 s.
  • AMD (wave64/split path): Chrysana verified the first fix on RX 9070 XT (a163648: first lit frame 380, steady 600–720 draws); the second fix is verified natively on NVIDIA (thehollowedone, RTX 3080 Ti) and on this machine by stream-level tests; an AMD re-run of 303b346 is requested in the thread.

Regression run
Main a1672ef (current main at rebase):

xcl-smoke v1
commit: a1672ef21c396d8edc9c4b0e3747f671bd40f528
gpu: NVIDIA GeForce RTX 3060 Ti
title: ScarlettGame
seconds: 90
exit: 0x0
frames shown: 2411 (PresentX 2411)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14489 MB

Head 6bd8f64:

xcl-smoke v1
commit: 6bd8f641040071b8a388c0ec3053c2b1483ddcdf
gpu: NVIDIA GeForce RTX 3060 Ti
title: ScarlettGame
seconds: 90
exit: 0x0
frames shown: 2325 (PresentX 2325)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14720 MB

Both reach the menus at a steady 60 presents / 2 s; the frame-count difference is within run-to-run variance we see between identical builds.

Not tested

AI use
GPT-6.2 Astra (API model selector) in DSH wrote the changes and the tests, ran the builds, tests and runs above, and drafted this description; the human contributor reviewed the diff and the numbers before posting. The two stand-in fixes follow NishantParajuli's diagnoses and proposed diffs, credited in the commit messages and the thread.

@shdann shdann left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This stack still has the mesh-output failure from #304. At emit.rs:4734, an 80-vertex, one-triangle record with 22 float4 output rows computes one group in compact mode. At line 4670, the emitter uses that count to choose the original layout and declares 80 vertices. DXC charges for 96 vertices and rejects the shader because the output exceeds 32,768 bytes. I previously verified this with SDK 10.0.26100 DXC. Please carry the layout choice separately from the dispatch group count before enabling these pipelines. See #304 (review) . Reviewed ce41f94 with OpenAI Codex (GPT-6.2 Sol).

@ghost

ghost commented Nov 24, 2026

Copy link
Copy Markdown

Wave64 hardware run, since Not tested lists it: ce41f94 merged onto main 9ce2070 (clean merge): pass. AMD Radeon RX 9060 XT (RDNA4, native 64-lane waves), driver 32.0.32029.2010; Ryzen 7 5800X3D; Windows 11 Pro 26200; Rust 1.100.0 MSVC; DXC 1.9.2602.17; debug.

  • .\scripts\test.ps1: 686 passed, 0 failed, 41 ignored; no SKIPPED GPU tests, mesh tests included.
  • a_console_ms_in_the_as_slot_is_the_mesh_shader and mesh_split_accounts_vertex_chunks pass.

AI use

  • Claude Code (Claude Opus 5.5) ran the commands and wrote this report from the logs; I checked it before posting.

@futurepro62

Copy link
Copy Markdown

Tested exact head ce41f94 (this PR over #304's 8c7413c) on Blackwell.

Tested

  • NVIDIA GeForce RTX 5070 Ti 16 GB (32-lane waves, mesh shaders), driver 616.64, Ryzen 7 9800X3D, Windows 11 Home 26300, Rust 1.100.0 MSVC, debug. D3D12 debug layer installed.

  • .\scripts\test.ps1 (--test-threads=4): 682 passed, 0 failed, 41 ignored. SKIPPED (no wave64): gpu_geometry_wave32_prefix_count_over_a_mask, gpu_wave32_program_in_wave64_hardware. The new tests passed: hle::d3d12x::real::mesh_slot_tests::a_console_ms_in_the_as_slot_is_the_mesh_shader and Recompiler: the mesh pass-through budget accounts DXC’s vertex chunks #304's gpu::recomp::tests::mesh_split_accounts_vertex_chunks.

  • XCL_REQUIRE_GPU=mesh cargo test -p xcl --lib -- --test-threads=4, repeated with a 180 s limit per run, alternating this head and main 508a0c7:

    passed (642 / 640 tests, 0 failed) hung
    this PR 3 of 7 4 of 7
    main 508a0c7 4 of 5 1 of 5

    Every hang, on both commits, stops at the same four tests ("has been running for over 60 seconds", process idle): gpu_uma_import_check_at_init, gpu_typed_buffer_loads_and_stores, gpu_valu_16_and_64_bit, gpu_valu_float_and_int. Those are the tests and the real::init() → sparse::init path described in D3D12.X: replacing the sparse state deadlocks when the old state still holds placed buffers #344, so I read it as that deadlock, already on main, not something this PR adds. I did not take a stack dump to confirm it. 7 and 5 runs are too few to say whether the PR changes how often it happens.

  • I did not see the 8 parallel failures from the description (gpu_sparse_vram_descriptors_buffers_and_xmem, gpu_wave64_*, poisoned-lock panics): in runs that finished, nothing failed.

Not tested

AI use

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

@ryosen0

ryosen0 commented Nov 24, 2026

Copy link
Copy Markdown
Contributor Author

On the mesh-output budget: fixed in the new head of #304 (this PR is stacked on it). The emitter now chooses the declaration by the vertex budget alone, independently of the dispatch group count, so a record of 80 vertices / 1 triangle / 22 float4 rows declares the compact verts[3] and compiles instead of verts[80] (accounted as 96, 33792 B > 32768 B, refused). New test mesh_layout_independent_of_group_count pins exactly that asymmetric case.

I'll re-run the retail regression here once #304's new head is in, and report the AS-slot minimap pipelines against the corrected budget — that was the failure mode this PR was refused for, so it deserves a fresh measurement rather than the earlier one.

AI use: GPT-6.2 Astra (API model selector) in DSH; the human contributor reviewed it.

@imnicho

imnicho commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

Test report with frame captures, since Not tested lists the visual side: ce41f94 merged onto main 9ce2070 (clean merge), release. On this card the title's frames are black with this PR, from its first screen on; main 9ce2070 alone draws them.

Machine: Intel Core i7-7700K (4 cores / 8 threads), 16 GB RAM, NVIDIA GeForce RTX 5080 16 GB (driver 610.47, 32-lane waves), Windows 10 22H2 (19045), DXC 1.9.2602, rustc 1.100.0. The newer retail title of the README, XCL_NETWORK=0, XCL_FRAME_DUMP=100, one pad press (XCL_PRESS_AT=45:A), one run each.

main 9ce2070, 75 s with this PR, 60 s
frame captures that are not entirely black 11 of 15: every one from frame 420 (~30 s) on 0 of 14 (frames 20 – 1320)
presents in the first 60 s (the log's 2 s activity lines) 1 139 1 402
report.json: translated / failed pipelines 12 / 8 1 012 / 8
"MS … in the AS slot" log lines 39 refused (39 shaders) 1 060 translated as MS (431 shaders)

Not tested: the PR without #304 under it; which of the translated pipelines blackens the frame; a debug-layer run; AMD; the test suite on this head.

AI use: Claude Code with Claude Fable 5.2 ran the builds and runs and wrote this report; every number is from a run on the machine named. No game files or captures are attached.

Update for 24635db (merged onto main f4ce27c, clean merge; same machine and switches, 90 s): still black – all 15 captures (frames 20 – 1420) are the same black frame. 1 499 presents, report.json 614 translated / 8 failed pipelines, and only 5 "translated as MS" lines now (2 shaders, against 1 060 lines at ce41f94), so the deferral is at work but the first screen does not come up within 90 s here. A shader pre-compile was running on the same CPU during this run, so its timing is not comparable with the table above (where main shows its first screen by frame 420); the frames themselves are. I have not tried the stand-in fix proposed above.

@Chrysana

Chrysana commented Nov 24, 2026 •

Copy link
Copy Markdown

Update for 24635db (RX 9070 XT), with @NishantParajuli's stand-in fix tried on AMD: still black at 24635db on this card; with the fix from their comment applied, the title draws again on RDNA4.

Both runs: 24635db (already on main 9ce2070), release, 90 s, XCL_NETWORK=0 XCL_ACTIVITY=1 XCL_FRAME_DUMP=120 XCL_PRESS_A_AT=14,17,21, an empty DXIL cache each (XCL_DXIL_CACHE to a new folder), same saved state.

build captures lit (R+G+B > 30) first lit capture draws per 2 s at the end background_pipelines
24635db 0 of 21 none in 90 s 180 4, 0, 56889
24635db + the fix (applied cleanly, +53 / −1) 17 of 20, 100 % each (the 3 before 16 s are dark, as on main) frame 380 (21.9 s), then every capture 600–720 13, 0, 61227
  • 24635db alone logs no stand-in pipeline (0x80070057) – building this one in the call at 8.77 s, for the AS-slot MS d7c434f73b4b811c (as in NishantParajuli's report).
  • With the fix, those at 8.7 s are gone, but three no stand-in pipeline lines remain at 52.56 s (the line is capped at 3), right before translated as MS for 4b799df70d125a0a, 2e9f2ec40925c4ee and af32492a62fcd9cb. This run pressed A and reached the intro video, which NishantParajuli's no-input runs may not have. Those pipelines were built in the call, but the picture didn't suffer: 60 presents per 2 s around them, and the capture at 55.2 s is lit. main has no no stand-in line in any of my runs.
  • No crash or device removal; no in two passes line with the fix (the menus and the video don't bind one).

Not tested: why those three streams still get no stand-in; the fix's own test on this machine (I ran the title only); a warm-cache run with the fix.

Test report for 3d7604b (this PR over #304's b884f3c, already on main 9ce2070) on AMD RDNA4, with frame captures: on this card the title's frames stay black for the whole run, and the window title showed 57163 pipelines queued. #304 alone does not do this. This matches what imnicho reported on an RTX 5080 for ce41f94, but on AMD and at the new head.

Setup: AMD Radeon RX 9070 XT 16 GB (RDNA4, 64-lane waves), driver 32.0.32015.2008, Ryzen 7 9800X3D, 31 GB RAM, Windows 11 25H2 build 26200.9974, rustc 1.100.0 x86_64-pc-windows-msvc, DXC 1.9.2602.17. Retail title 1.0.2.1, XCL_NETWORK=0 XCL_ACTIVITY=1 XCL_RUN_SECONDS=60 XCL_PRESS_A_AT=14,17,21, release builds, the same saved state for every run.

Tests: cargo test --workspace --no-fail-fast -- --test-threads=4 at 3d7604b: 687 passed, 0 failed, 41 ignored. a_console_ms_in_the_as_slot_is_the_mesh_shader, mesh_layout_independent_of_group_count and mesh_split_accounts_vertex_chunks pass. SKIPPED: the two debug-layer tests (the D3D12 debug layer isn't installed here).

Frames (XCL_FRAME_DUMP=120, share of sampled pixels brighter than R+G+B 30):

build 4–15 s 19–60 s draws per 2 s at the end
main 9ce2070 0 % 100 % from 21 s 1307–1326
#304 b884f3c (on 9ce2070) 0 % 100 % from ~23 s 1242–1261
this PR 3d7604b 0 % 0 % (all 14 captures) 180
  • The window title during the 3d7604b run: compiling shaders: 4 running, 52 done, 57163 pipelines queued. On the other builds it reads 0 running.
  • No in the AS slot – refused line (40 on main). 264 different MS were translated, with 1014 translated as MS lines in 60 s, and two pipeline from the console MS in two passes lines.
  • The title doesn't reach the video's texture reads it reaches on main (no BCPack reads at ~28 s), and peak commit is 12.5–13.2 GB against ~16 GB.
  • ce41f94 merged onto 9ce2070 gave the same: black in every capture, 0 refusals, peak commit 10.6–12.5 GB, 1620–1645 frames.

The smoke check doesn't catch this: the run below shows 60 presents per 2 s, no crash and no device removal while every frame is black.

main 9ce2070:

xcl-smoke v1
commit: 9ce2070eccf436d7bd38601c90407da447df34f3
gpu: AMD Radeon RX 9070 XT
title: retail-title
seconds: 60
exit: 0x0
frames shown: 1536 (PresentX 1536)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 16054 MB

PR:

xcl-smoke v1
commit: 3d7604bb167c9c85c0849782eb6917f57b76b6ec
gpu: AMD Radeon RX 9070 XT
title: retail-title
seconds: 60
exit: 0x0
frames shown: 1595 (PresentX 1596)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 12552 MB

Not tested: why the queue grows (whether the same pipelines are queued again and again); the minimap itself (the run never shows a picture); NVIDIA at 3d7604b; runs longer than 60 s.

AI use: Claude Code with Claude Opus 5.5 built the commits, ran the tests and the title runs, measured the frame captures and the logs, and wrote this report. I read the window title off the screen.

@ryosen0

ryosen0 commented Nov 24, 2026

Copy link
Copy Markdown
Contributor Author

Reproduced the black frames on NVIDIA with your exact setup — thank you for the frame captures, they caught what the smoke block can't. RTX 3060 Ti 8 GB, Ryzen 7 9800X3D, driver 32.0.16.1742, release, XCL_NETWORK=0 XCL_ACTIVITY=1 XCL_RUN_SECONDS=60 XCL_FRAME_DUMP=120 XCL_PRESS_A_AT=14,17,21, same share-of-bright-pixels measure (R+G+B > 30, every 8th texel):

build black frames first bright frame draws per 2 s at the end
main dd2ae9a frames 20–860 (0 %) frame 980 (~39 s), 99.8 % 780
this PR 3d7604b frames 20–980 (0 %) frame 1100 (~44 s), 99.8 % 780
this PR, XCL_LAZY_PSO=0 all 10 captures (0 %) none within 60 s 189–207

So on this card the PR is not black forever — the picture arrives ~5 s later than main's and then renders at the same rate; on your RX 9070 XT it never arrives within 60 s. The eager-build run shows why the window matters: with every AS-slot MS translated synchronously the title's own thread stalls in DXC (15 presents at t=20 s vs 56–60 on the other builds) and the intro never starts in time.

What I think is happening, from the logs:

  • The title creates tens of thousands of these pipelines during boot; on main each is refused in microseconds, with the PR each goes through translation (cached-only attempt + worker build). The 57163 "pipelines queued" is pso_async's lazy queue — those are stand-ins never bound, normal for this title (main has the same queue for its other pipelines), but the PR adds ~1500 distinct MS containers to it (2930 detection lines in my earlier 120 s run = attempt + build per pipeline).
  • The intro/menu transition is delayed by that work, and the delay scales with how long translation takes on the machine. On AMD wave64 the MS programs take the split path (more work per shader), which would explain 60 s never being enough there.

Two things I've done on the branch:

  1. The translated as MS log line moved from the detection (which runs twice per deferred pipeline) to a sparse counter at the build — the 1014/2930-line spam is gone, first 5 + every 1000th.
  2. Measuring whether the translation can be skipped for pipelines the title never binds (the lazy queue already defers the build; the cached-only attempt still translates on the calling thread — that's the part that stalls the title).

I'd rather not merge this as-is given your captures: the refusal on main is load-bearing for boot time. Next step is to make the AS-slot path cost nothing until first bind, then re-run your 60 s capture protocol on both cards. Will report here.

AI use: GPT-6.2 Astra (API model selector) in DSH ran the captures and wrote this comment; the human contributor reviewed it.

@ryosen0

ryosen0 commented Nov 24, 2026

Copy link
Copy Markdown
Contributor Author

Fix pushed: 4b1af01 — the moved MS is now translated when first bound, not in the creation call.

Root cause of the delay your captures caught: the title creates tens of thousands of these pipelines during boot and uses few, and the cached-only attempt translated each one on the title's own thread (translation is the expensive part; the DXIL cache miss was already deferred). On wave64 the split path makes each translation heavier, which is why 60 s was never enough on your card while this RTX 3060 Ti only lost ~5 s.

The attempt now defers a moved MS exactly like a console compute pipeline (dxc::defer under pso_async::lazy): go_background hands the title a stand-in immediately and the worker — or the first bind — runs the translation. The translated as MS log line became a sparse counter at the build (first 5 + every 1000th); the 1014/2930-line spam is gone.

On this machine (RTX 3060 Ti, XCL_NETWORK=0 XCL_ACTIVITY=1 XCL_RUN_SECONDS=60 XCL_FRAME_DUMP=120 XCL_PRESS_A_AT=14,17,21): 7 moved-MS translations in 60 s (was ~1500 attempts), first bright frame 1100 in that run — main's was 980, and a second capture run of the pre-fix build also landed at 1100, so that difference is run-to-run variance, not the fix. A 150 s scripted-input run: 4086 frames, steady 60 presents / 2 s, no crash. Full suite on 4b1af01: 688 passed, 0 failed, 41 ignored (--test-threads=1).

Could you re-run your 60 s capture protocol on 4b1af01? If the frames are still black on the RX 9070 XT I'd want the translated as MS (#n) counter and the window title's queued number from that run — with the deferral the queue should look like main's.

AI use: GPT-6.2 Astra (API model selector) in DSH wrote the fix and the test, ran the captures and wrote this comment; the human contributor reviewed the diff and the numbers.

@ryosen0

ryosen0 commented Nov 24, 2026

Copy link
Copy Markdown
Contributor Author

Test report for 4b1af01 (this PR over #304's b884f3c) on NVIDIA, following the deferral fix for the black-frame delay Chrysana measured on RDNA4.

Setup: RTX 3060 Ti 8 GB (wave32), Ryzen 7 9800X3D, 32 GB RAM, driver 32.0.16.1742, Windows 11, rustc stable x86_64-pc-windows-msvc, release builds, retail title 1.0.2.1.

Tests: cargo test --workspace --no-fail-fast -- --test-threads=1 at 4b1af01: 688 passed, 0 failed, 41 ignored; SKIPPED: the two wave64 GPU tests (no wave64 on this adapter). a_moved_ms_defers_in_the_attempt_only, a_console_ms_in_the_as_slot_is_the_mesh_shader, mesh_layout_independent_of_group_count pass. One earlier full run had a single failure in writes_land_after_the_queue (WARP fence timing, asserts [7, 9] == [7, 9] — a visibility race in the test itself); it passed 3/3 isolated and in the clean full rerun counted above.

Frame captures (XCL_NETWORK=0 XCL_ACTIVITY=1 XCL_RUN_SECONDS=60 XCL_FRAME_DUMP=120 XCL_PRESS_A_AT=14,17,21, share of sampled pixels brighter than R+G+B 30, every 8th texel):

build first bright frame moved-MS translations in 60 s
main dd2ae9a 980 (99.8 %) 0 (refused)
3d7604b (pre-fix) 1100 ~1500 attempts (2930 log lines / 120 s)
4b1af01 1100 7

The ~5 s first-frame difference vs main is within run-to-run variance on this card (a second pre-fix capture run also landed at 1100); the point of the fix is the calling-thread cost, which is what scales on wave64. A 150 s scripted-input run on 4b1af01 (XCL_PRESS_AT A presses through the menus): 4086 frames, steady 60 presents / 2 s to the end, no crash, no device removal.

Not tested: wave64 hardware (Chrysana's re-run of the 60 s capture protocol on 4b1af01 is the one that matters); the minimap's visual content (unattended runs, no screenshot comparison); runs longer than 150 s.

AI use: GPT-6.2 Astra (API model selector) in DSH built the commits, ran the tests and the title runs, measured the frame captures and the logs, and wrote this report; the human contributor reviewed the numbers before posting.

@NishantParajuli

Copy link
Copy Markdown

Test report for head 4b1af01 with frame captures on an RTX 5060 Ti, and the reason the deferral in 4b1af01 does not take effect yet: the stand-in of these streams is refused by the driver, so every one is still built in the title's call. A small fix for that is below; with it the first screen comes up as on main.

What happens at 4b1af01

  • The attempt defers a moved MS and go_background asks standin_stream for a stand-in. fallback_stream decides "mesh" by the presence of an MS subobject. These streams have none (the MS sits in the AS subobject), so it empties the AS (24 => put(&[])) and keeps the plain dummy PS. The stream then holds a PS and neither an MS nor a VS.
  • The driver refuses it: D3D12.X: no stand-in pipeline (0x80070057) – building this one in the call (first at 6.69 s; the line is capped at 3). go_background returns None and dev_create_pipeline_state calls translated_mesh_stream again outside the attempt, on the title's thread.

Fix (on top of 4b1af01): in the stand-in of such a stream the AS subobject becomes an MS with the dummy mesh shader, and the PS is the mesh dummy's. A real AS beside an MS is emptied as before. The test fails without the change (left: [(24, 0, 0), (2, …)]).

diff (crates/xcl/src/hle/d3d12x/real.rs, +53 / -1 with the test)
diff --git a/crates/xcl/src/hle/d3d12x/real.rs b/crates/xcl/src/hle/d3d12x/real.rs
index cfc5d4d..369f3c3 100644
--- a/crates/xcl/src/hle/d3d12x/real.rs
+++ b/crates/xcl/src/hle/d3d12x/real.rs
@@ -4244,6 +4244,42 @@ mod mesh_slot_tests {
         assert!(missed, "the attempt is missed: the caller takes the background path");
         assert!(!crate::gpu::recomp::dxc::defer(), "outside: the build translates");
     }
+
+    /// The stand-in of such a stream is a mesh pipeline: the AS subobject becomes an MS with the
+    /// dummy mesh shader and the PS is the mesh dummy's. (As an AS without a shader the stream
+    /// had a PS alone, which the driver refuses.) A real AS beside an MS stays an AS, emptied.
+    #[test]
+    fn the_stand_in_of_a_console_ms_in_the_as_slot_is_a_mesh_pipeline() {
+        use super::{dummy_mesh, fallback_stream, stream_subobjects};
+        if crate::gpu::recomp::dxc::location().is_err() {
+            crate::gpu::recomp::runner::skip_test("no DXC");
+            return;
+        }
+        let ms = sample(13, &[fssm(&CODE, &[(8, 13)])]);
+        let as_ = sample(14, &[fssm(&CODE, &[(8, 14)])]);
+        let ps = [1u8; 32];
+        let stream = |subs: &[(u32, &[u8])]| -> Vec<u8> {
+            let mut v = Vec::new();
+            for (ty, b) in subs {
+                v.extend_from_slice(&ty.to_le_bytes());
+                v.extend_from_slice(&[0; 4]);
+                v.extend_from_slice(&(b.as_ptr() as u64).to_le_bytes());
+                v.extend_from_slice(&(b.len() as u64).to_le_bytes());
+            }
+            v
+        };
+        // (type, shader pointer, length) of each subobject of the stand-in's stream
+        let stand_in = |s: &[u8]| -> Vec<(u32, usize, usize)> {
+            let desc: [usize; 2] = [s.len(), s.as_ptr() as usize];
+            let (out, _) = unsafe { fallback_stream(desc.as_ptr() as *const u8) }.expect("a stand-in stream");
+            let word = |p: &[u8], k: usize| u64::from_le_bytes(p[8 * k..8 * k + 8].try_into().unwrap()) as usize;
+            stream_subobjects(&out).unwrap().iter().map(|(ty, p)| (*ty, word(p, 0), word(p, 1))).collect()
+        };
+        let (dms, dps) = dummy_mesh().expect("DXC compiles the stand-in mesh shaders");
+        let (dms, dps) = ((dms.as_ptr() as usize, dms.len()), (dps.as_ptr() as usize, dps.len()));
+        assert_eq!(stand_in(&stream(&[(24, &ms), (2, &ps)])), vec![(25, dms.0, dms.1), (2, dps.0, dps.1)]);
+        assert_eq!(stand_in(&stream(&[(24, &as_), (25, &ms), (2, &ps)])), vec![(24, 0, 0), (25, dms.0, dms.1), (2, dps.0, dps.1)]);
+    }
 }
 
 /// CreatePipelineState with a console MS: Some(hr) when it was a console mesh pipeline
@@ -4403,6 +4439,13 @@ unsafe fn translated_gs_pso(this: *mut c_void, d: &D3D12_GRAPHICS_PIPELINE_STATE
     finish_two_pass(this, &out, tp, rs, "GS", riid, ppv)
 }
 
+/// A console MS container in the stream's AS subobject and no MS subobject (`mesh_shader_slots`).
+unsafe fn console_ms_in_as_slot(subs: &[(u32, &[u8])]) -> bool {
+    let shader = |ty: i32| subs.iter().find(|s| s.0 == ty as u32).and_then(|s| payload_shader(s.1));
+    shader(D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_MS.0).is_none()
+        && shader(D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_AS.0).is_some_and(|a| crate::gpu::recomp::pso::is_console(a) && crate::gpu::xbox::parse(a).is_some_and(|sh| sh.stage == "MS"))
+}
+
 /// Rewrite a pipeline state stream with stand-in shaders. None if not possible.
 unsafe fn fallback_stream(desc: *const u8) -> Option<(Vec<u8>, [usize; 2])> {
     let size = *(desc as *const usize);
@@ -4412,7 +4455,12 @@ unsafe fn fallback_stream(desc: *const u8) -> Option<(Vec<u8>, [usize; 2])> {
     }
     let mut buf = std::slice::from_raw_parts(base as *const u8, size).to_vec();
     let d = dummy();
-    let mesh = stream_subobjects(&buf).is_some_and(|subs| subs.iter().any(|s| s.0 == D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_MS.0 as u32));
+    // A console MS alone in the AS slot is the stream's mesh shader (`mesh_shader_slots`), so its
+    // stand-in is a mesh pipeline too, with the dummy MS in that subobject as an MS. Left an AS
+    // without a shader, the stream had a PS and neither an MS nor a VS: the driver refused it
+    // (E_INVALIDARG) and every such pipeline was built in the title's call.
+    let ms_in_as = stream_subobjects(&buf).is_some_and(|subs| console_ms_in_as_slot(&subs));
+    let mesh = ms_in_as || stream_subobjects(&buf).is_some_and(|subs| subs.iter().any(|s| s.0 == D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_MS.0 as u32));
     let dm = if mesh { Some(dummy_mesh()?) } else { None };
     let mut off = 0usize;
     while off + 8 <= size {
@@ -4431,6 +4479,10 @@ unsafe fn fallback_stream(desc: *const u8) -> Option<(Vec<u8>, [usize; 2])> {
             1 => put(&mut buf, &d.vs),
             2 => put(&mut buf, dm.map_or(&d.ps[..], |m| &m.1[..])),
             6 => put(&mut buf, &d.cs),
+            24 if ms_in_as => {
+                buf[off..off + 4].copy_from_slice(&(D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_MS.0 as u32).to_le_bytes());
+                put(&mut buf, &dm?.0)
+            }
             3 | 4 | 5 | 24 => put(&mut buf, &[]),
             25 => put(&mut buf, &dm?.0),
             12 | 19 => buf[at..at + 16].fill(0), // input layout, cached PSO

Tested

  • NVIDIA GeForce RTX 5060 Ti 16 GB (driver 32.0.16.2114, 32-lane waves), Ryzen 7 7700, 31 GB RAM, Windows 11 Pro 26300, rustc 1.100.0 MSVC, DXC 1.8.2502.11 (SDK 10.0.26100), release.
  • Retail title 1.0.2.1, XCL_NETWORK=0 XCL_ACTIVITY=1 XCL_RUN_SECONDS=90 XCL_FRAME_DUMP=60, no input, the same saved state, an empty DXIL cache for each run (XCL_DXIL_CACHE to a new folder), one run each. "Bright": mean of R, G, B over every 20th texel of the capture above 30.
build captures first bright capture draws per 2 s at the end background_pipelines (built, failed, pending) "no stand-in" lines
main 91f9a5e 42 frame 140 (10.7 s) 780 6, 0, 57 817 0
91f9a5e + this PR 4b1af01 43 none in 90 s (frames 20 – 2540 all black) 180 4, 0, 57 161 (658 translated in the call) 3 (capped)
the same + the fix 42 frame 200 (12.7 s) 780 6, 0, 60 747 0
  • So with the fix the title's first screen is one capture (2 s) later than main's and it then draws at main's rate; the 2 930 more pending entries are the stand-ins of AS-slot pipelines the title made and did not bind.
  • cargo test --workspace --no-fail-fast -- --test-threads=4 on 91f9a5e + 4b1af01 + the fix: 697 passed, 0 failed, 41 ignored. SKIPPED (no wave64): gpu_geometry_wave32_prefix_count_over_a_mask, gpu_wave32_program_in_wave64_hardware. mesh_slot_tests: 3 passed (yours two and the_stand_in_of_a_console_ms_in_the_as_slot_is_a_mesh_pipeline).
  • Earlier, on ce41f94 + the same fix (main 9ce2070): empty cache, first screen at about 20 s (16 s on that main). ce41f94 alone showed nothing in an 80 s run with an empty cache nor in the 200 s run after it, and its first screen at 80 s in a third run, with the cache those had filled.

Not tested

AI use
Claude Code (Claude Fable 5.2) found the cause, wrote the change and its test, ran the builds, the tests and the runs above and wrote this comment from the logs; the human contributor reviewed it before posting.

@thehollowedone

thehollowedone commented Nov 24, 2026 •

Copy link
Copy Markdown

Native stand-in check on the rebased head

On 24635db, I reproduced the earlier stand-in rejection with a synthetic stream on the RTX 3080 Ti. The fixture called XCL’s stock standin_stream and the native D3D12 driver. With the console MS container in the AS slot and no MS subobject, the call returned E_INVALIDARG. D3D12 message 1022 reported that the submitted stream specified no VS, CS, or MS. Moving the same synthetic container to the MS slot let the stock stand-in path create the pipeline successfully. The device remained healthy.

The scratch test passed 1/1 with both outcomes asserted. Windows 11 build 26300, RTX 3080 Ti / 621.35, Rust 1.99.1 MSVC, debug with Graphics Tools enabled. cargo test --offline --locked -p xcl --lib scratch_native_moved_mesh_stand_in -- --nocapture --test-threads=1. This checks stand-in creation only. First-bind output, retail captures, and native wave64 remain untested.

Codex with GPT-6.2 Sol wrote the scratch fixture, ran the test, and drafted this update.

Earlier integrated workspace result

Tested

I ran the same serial workspace check on main at f4ce27c and that revision with 4b1af01 integrated cleanly. This baseline includes the recent texture-read, sparse-memory, and write-watch merges.

  • Main: 701 passed, 0 failed, 41 ignored.
  • Integrated tree: 705 passed, 0 failed, 41 ignored. The moved-MS slot and deferral tests passed. The existing synthetic two-pass mesh GPU test passed on both trees.

Both totals include two tests that returned early for lack of native wave64: gpu_geometry_wave32_prefix_count_over_a_mask and gpu_wave32_program_in_wave64_hardware.

cargo build --offline --locked --workspace, then cargo test --offline --locked --workspace --no-fail-fast -- --test-threads=1. RTX 3080 Ti / 621.35, Ryzen 7 9800X3D, Windows 11 build 26300, Rust 1.99.1 MSVC, debug.

Not tested

Retail frame captures, game-specific moved mesh pipelines, or native wave64.

AI use

Codex with GPT-6.2 Sol ran the tests and drafted this report.

@mastrr9

mastrr9 commented Nov 24, 2026

Copy link
Copy Markdown

Code audit + NVIDIA RTX 5080 test run on 24635db4d250ea30631d892c0a94ba35edd9bb65:

Review

Looks clean:

  • Switching mesh_passthrough_for from split == 1 to mv <= cap (emit.rs:4673) fixes the DXC output-budget refusal for low-triangle records whose vertex count exceeds cap.
  • mesh_shader_slots cleanly promotes a lone console MS in the AS slot while leaving real AS / paired MS+AS / PC shaders untouched, and deferring moved MS builds via pso_async::lazy() && dxc::defer() avoids stalling boot on tens of thousands of unused pipelines.

Tested

  • Hardware / OS / toolchain: NVIDIA GeForce RTX 5080 (driver 617.42), AMD Ryzen 7 9800X3D, Windows 11 25H2 (build 26200.9711), rustc 1.100.0 (MSVC), debug build.
  • cargo build --workspace && cargo test --workspace -- --test-threads=4: 688 passed, 0 failed, 41 ignored.
  • New tests mesh_split_accounts_vertex_chunks, mesh_layout_independent_of_group_count, a_console_ms_in_the_as_slot_is_the_mesh_shader, a_moved_ms_defers_in_the_attempt_only: all passed.
  • SKIPPED GPU/D3D12 tests: gpu_geometry_wave32_prefix_count_over_a_mask / gpu_wave32_program_in_wave64_hardware (no wave64), plus 2 D3D12 debug-layer tests (no d3d12SDKLayers.dll).

Not tested

  • Retail title / scripts/smoke.ps1 run (test suite only).
  • AMD / Intel GPUs.

AI use: code review and test run orchestrated with Antigravity (Gemini 4 Neon) on the hardware listed above.

abilliontokens added a commit to abilliontokens/xcl that referenced this pull request Nov 24, 2026
…d in the call

With ivall#541, a stream with a console MS in the AS slot and no MS subobject is
translated as a mesh pipeline. Its stand-in (fallback_stream) still decided
"mesh" from an MS subobject only, so it nulled the AS and kept a plain PS:
no VS and no MS, which the driver refuses (E_INVALIDARG). go_background then
fell back to building each of those pipelines in the title's call.

Measured on a retail title (RTX 5060 Ti, cold DXIL cache, 240 s, same input):
five title threads sat in dev_create_pipeline_state -> translated_mesh_stream
-> dxc::compile at every thread dump, and 2947 programs were compiled. With
the stand-in turned into an MS subobject with the stand-in MS, no title thread
is in DXC at any dump, 804 programs are compiled (the rest wait for their
first bind, as other pipelines do) and translation errors stay at 0.

Assisted-by: Claude Code (Claude Opus 5.5)
@NishantParajuli

Copy link
Copy Markdown

Follow-up to my report above, for @Chrysana's open point ("why those three streams still get no stand-in"): their stand-in keeps a console-only depth format. A second small fix is below; with both, the stand-in refusals of a run into world loading go from over 500 to 4.

What those streams are
I logged the subobjects of every stand-in stream the driver refused (a local diagnostic, not in the diff). With the first fix applied, all of them looked like this:

stand-in stream refused (0x80070057): 0 25 2 3 4 5 8 9 10 21 17 12 14  15[0 0 0 0 0 0 0 0 | 0]  16[76]
  • 15 (RENDER_TARGET_FORMATS): no render target. 16 (DEPTH_STENCIL_FORMAT): 0x76 = 118, the console's D16_UNORM_S8_UINT. They are the title's depth-only mesh pipelines.
  • translated_mesh_stream gives the real pipeline the PC's formats (pc_target_format: 118 → D24_UNORM_S8_UINT). fallback_stream copied the title's as they were, so the driver refused the stand-in, go_background returned None and the pipeline was built in the title's call – the lines you saw at 52.56 s. In an earlier run of mine the same three MS (4b799df70d125a0a, 2e9f2ec40925c4ee, af32492a62fcd9cb) stood next to them.
  • The title makes hundreds of these as its world loads, not three: the no stand-in pipeline line is capped at 3.

Fix (on top of the first one): the stand-in's RENDER_TARGET_FORMATS and DEPTH_STENCIL_FORMAT go through pc_target_format, as the real pipeline's do. The test needs no DXC or GPU.

diff (crates/xcl/src/hle/d3d12x/real.rs, +33 with the test)
diff --git a/crates/xcl/src/hle/d3d12x/real.rs b/crates/xcl/src/hle/d3d12x/real.rs
index 189863d..ed2ef8b 100644
--- a/crates/xcl/src/hle/d3d12x/real.rs
+++ b/crates/xcl/src/hle/d3d12x/real.rs
@@ -4313,6 +4313,29 @@ mod mesh_slot_tests {
         assert_eq!(stand_in(&stream(&[(24, &ms), (2, &ps)])), vec![(25, dms.0, dms.1), (2, dps.0, dps.1)]);
         assert_eq!(stand_in(&stream(&[(24, &as_), (25, &ms), (2, &ps)])), vec![(24, 0, 0), (25, dms.0, dms.1), (2, dps.0, dps.1)]);
     }
+
+    /// The stand-in's target formats are the PC's, as the real pipeline's: the console's
+    /// D16_UNORM_S8_UINT (118) is D24_UNORM_S8_UINT (45) and a B4G4R4A4 target (115) is
+    /// R8G8B8A8 (28). With the console's the driver refuses the stand-in.
+    #[test]
+    fn the_stand_in_of_a_stream_has_the_pcs_target_formats() {
+        use super::{fallback_stream, stream_subobjects};
+        let mut s = Vec::new();
+        // RENDER_TARGET_FORMATS: 8 formats and their number
+        s.extend_from_slice(&15u32.to_le_bytes());
+        for f in [115u32, 28, 0, 0, 0, 0, 0, 0, 2] {
+            s.extend_from_slice(&f.to_le_bytes());
+        }
+        // DEPTH_STENCIL_FORMAT
+        s.extend_from_slice(&16u32.to_le_bytes());
+        s.extend_from_slice(&118u32.to_le_bytes());
+        let desc: [usize; 2] = [s.len(), s.as_ptr() as usize];
+        let (out, _) = unsafe { fallback_stream(desc.as_ptr() as *const u8) }.expect("a stand-in stream");
+        let subs = stream_subobjects(&out).unwrap();
+        let word = |p: &[u8], k: usize| u32::from_le_bytes(p[4 * k..4 * k + 4].try_into().unwrap());
+        assert_eq!((subs[0].0, word(subs[0].1, 0), word(subs[0].1, 1), word(subs[0].1, 8)), (15, 28, 28, 2));
+        assert_eq!((subs[1].0, word(subs[1].1, 0)), (16, 45));
+    }
 }
 
 /// CreatePipelineState with a console MS: Some(hr) when it was a console mesh pipeline
@@ -4518,6 +4541,16 @@ unsafe fn fallback_stream(desc: *const u8) -> Option<(Vec<u8>, [usize; 2])> {
             }
             3 | 4 | 5 | 24 => put(&mut buf, &[]),
             25 => put(&mut buf, &dm?.0),
+            // RENDER_TARGET_FORMATS, DEPTH_STENCIL_FORMAT: the console's formats as the PC's, as
+            // the real pipeline gets them (`translated_mesh_stream`) – with a console-only one
+            // (a retail game's depth-only mesh pipelines: D16_UNORM_S8_UINT) the driver refuses
+            // the stand-in (E_INVALIDARG) and the pipeline is built in the title's call
+            15 | 16 => {
+                for k in 0..if ty == 15 { 8 } else { 1 } {
+                    let f = super::device_x::pc_target_format(u32::from_le_bytes(buf[at + 4 * k..at + 4 * k + 4].try_into().ok()?));
+                    buf[at + 4 * k..at + 4 * k + 4].copy_from_slice(&f.to_le_bytes());
+                }
+            }
             12 | 19 => buf[at..at + 16].fill(0), // input layout, cached PSO
             7 => buf[at..at + 32].fill(0),        // stream output
             _ => {}

Tested

  • The same machine as above (RTX 5060 Ti 16 GB, driver 32.0.16.2114, Ryzen 7 7700, Windows 11 Pro 26300, DXC 1.8.2502.11), release, main f4ce27c + this PR 24635db + both fixes. Retail title 1.0.2.1, XCL_NETWORK=0 XCL_ACTIVITY=1, 110 s, scripted A presses into world loading, the same saved state (first-run setup done). One run each; another process was using the CPU during both, so I give counts only, no timings.
refused stand-in streams background_pipelines (built, failed, pending) translated_pipelines
first fix only over 500 (first at 44 s, #500 at 66 s) 14, 0, 83 480 754 (so about 740 made in the title's call)
both fixes 4 (all at 49 s) 846, 0, 83 392 846 (all in the background)
  • cargo test --workspace --no-fail-fast -- --test-threads=4: 707 passed, 0 failed, 41 ignored; SKIPPED (no wave64): gpu_geometry_wave32_prefix_count_over_a_mask, gpu_wave32_program_in_wave64_hardware. mesh_slot_tests: 4 passed, with the new the_stand_in_of_a_stream_has_the_pcs_target_formats. (The tree also carried two local-only helpers of mine that are not part of either diff: a scripted stick and an optional limit on a draw's wait.)

The 4 that remain are not a stand-in problem

stand-in stream refused (0x80070057): … 15[43 0 0 0 0 0 0 0 | 1]  16[0]

One render target of format 0x43 = 67, R9G9B9E5_SHAREDEXP, which the PC cannot render to. The real pipeline is refused too, right after, once per run here: the driver rejected the mesh pipeline from the console MS (0x80070057). That needs a PC format for the target itself (resource, views and pipeline), so it is a separate change; I have not looked for other pipelines with that format.

Not tested

AI use
Claude Code (Claude Fable 5.2) found the cause, wrote the change and its test, ran the builds, the tests and the runs and wrote this comment from the logs; the human contributor reviewed it before posting.

@ryosen0

ryosen0 commented Nov 24, 2026

Copy link
Copy Markdown
Contributor Author

@NishantParajuli @Chrysana — the stand-in fix is in as ad2118d, and your diagnosis was exactly right.

fallback_stream decided "mesh" by an MS subobject; these streams have none, so the stand-in was a PS with neither a VS nor an MS and the driver refused it (E_INVALIDARG), go_background fell through and every pipeline was built in the call. The stand-in now retypes the AS subobject to MS with the dummy mesh shader and uses the mesh dummy's PS, as @NishantParajuli's diff proposed — kept minimal in fallback_stream (+17 lines with the helper), with the test the_stand_in_of_a_moved_ms_is_a_mesh_pipeline (fails without the change: the output stream still holds (24, empty AS), (2, plain PS)).

Measured on the RTX 3060 Ti (wave32), release ad2118d:

  • 60 s run, XCL_FRAME_DUMP=120, A presses 14/17/21: 0 no stand-in pipeline lines (the refusals that made 24635db build everything in the call), steady 60 presents / 2 s, no device removal. First bright capture frame 980 — main's number in the same schedule, where 24635db had 1100.
  • Full suite cargo test --workspace --no-fail-fast -- --test-threads=1: 689 passed, 0 failed, 41 ignored (2 SKIPPED, no wave64 here).
  • Smoke blocks (main 9ce2070 + head ad2118d) are in the description.

@thehollowedone your native fixture result (message 1022, no VS/CS/MS) matches what the new test asserts on the stream level; the driver-level outcome on your RTX 3080 Ti would be a good cross-check.

@Chrysana could you re-run the RX 9070 XT captures on ad2118d (same empty-cache 90 s setup as your last report)? That is the wave64/split path where 24635db stayed black — the stand-in should now be accepted there too. The three no stand-in lines you saw at 52.56 s were this same refusal (the log caps at 3), so I expect them gone.

AI use: GPT-6.2 Astra (API model selector) in DSH wrote the change and its test, ran the suite and the runs above, and drafted this comment; the human contributor reviewed the diff and the numbers before posting.

@thehollowedone

Copy link
Copy Markdown

Native RTX 3080 Ti cross-check for the requested retest. I ran the same synthetic stream through XCL’s standin_stream and the D3D12 driver on 24635db and ad2118d.

  • A console mesh shader in the AS slot returned E_INVALIDARG with message 1022 on the parent and created a pipeline with zero D3D12 errors on the new head. An explicit MS-slot control passed on both.

  • On the new head, the synthetic depth-only stream also passed with D24_UNORM_S8_UINT. Changing only its format to console value 118 still returned E_INVALIDARG with message 685. This independently reproduces the depth-format follow-up at stand-in creation. The device remained healthy in all cases.

Windows 11 build 26300, RTX 3080 Ti / 621.35, Rust 1.99.1 MSVC, DXC 1.8.2502.11, debug with Graphics Tools enabled. cargo test --offline --locked -p xcl --lib scratch_native_moved_mesh_stand_in -- --nocapture --test-threads=1 passed 1/1 on each revision, zero skips. First-bind rendering and retail use were outside this test. AI-assisted. Codex (GPT-6, exact variant unavailable) wrote and ran the fixture and drafted this reply.

@NishantParajuli

Copy link
Copy Markdown

Thanks for folding the first fix into ad2118d. One thing is still open on that head: the stand-in keeps the console depth format 118, so the title's depth-only mesh pipelines are still built in the call. The diff for it is in my follow-up, and thehollowedone reproduced it on ad2118d just above (E_INVALIDARG, message 685). The three lines at 52.56 s were that case, not the first one.

@thehollowedone

Copy link
Copy Markdown

Confirmed the target-format follow-up on 303b346. The same depth-only stream with console format 118 that failed on ad2118d now creates a native D3D12 pipeline on the RTX 3080 Ti. A separate stream with color format 115 also succeeds. All five cases, including the PC-format and explicit-MS controls, returned S_OK with zero D3D12 errors. The device stayed healthy.

Windows 11 build 26300, RTX 3080 Ti / 621.35, Rust 1.99.1 MSVC, DXC 1.8.2502.11, debug with Graphics Tools. cargo test --offline --locked -p xcl --lib <filter> -- --nocapture --test-threads=1 passed 1/1 each for scratch_native_moved_mesh_stand_in and the_stand_in_of_a_stream_has_the_pcs_target_formats, zero skips. Synthetic pipeline creation only. AI-assisted. Codex (GPT-6, exact variant unavailable) extended and ran the fixture and drafted this reply.

@ryosen0

ryosen0 commented Nov 24, 2026

Copy link
Copy Markdown
Contributor Author

@NishantParajuli the second fix is in as 303b346 — the stand-in's RENDER_TARGET_FORMATS / DEPTH_STENCIL_FORMAT now go through pc_target_format, exactly as your follow-up proposed, with the stream-level test the_stand_in_of_a_stream_has_the_pcs_target_formats (verified it fails without the change: 118 stays 118, 115 stays 115; no DXC/GPU needed).

Measured on the RTX 3060 Ti (wave32), release 303b346:

  • Full suite cargo test --workspace --no-fail-fast -- --test-threads=1: 690 passed, 0 failed, 41 ignored (2 SKIPPED, no wave64).
  • 120 s run with scripted presses into the load window (XCL_FRAME_DUMP=240): 0 no stand-in pipeline lines, steady 60 presents / 2 s, no device removal. The world-load window (t≈57–89 s) is still black in the captures, then the title returns to its artwork screen — no crash within 120 s. First bright frame 980, main's number.
  • Smoke blocks (main 9ce2070 + head 303b346) refreshed in the description; both steady 60/2 s.

@thehollowedone your native pair (message 685 before / S_OK with the mapping) matches the stream-level assertions — if you have a moment, the same fixture on 303b346 end-to-end would close the loop on the driver side.

@Chrysana 303b346 now has both stand-in fixes — an RX 9070 XT re-run of your empty-cache 90 s setup should show the three 52.56 s refusals gone as well; your earlier a163648 captures already confirmed the first fix on the split path.

AI use: GPT-6.2 Astra (API model selector) in DSH wrote the change and its test, ran the suite and the runs above, and drafted this comment; the human contributor reviewed the diff and the numbers before posting.

SavageCore added a commit to SavageCore/xcl that referenced this pull request Nov 25, 2026
…stream PR xcl-dev#541)

Cherry-picked from xcl-dev/xcl PR xcl-dev#541 (commits 70f9185, 48c1517, 7654a2a, 6bd8f64). The recompiler half (xcl-dev#304) is already in upstream main and was skipped. Minimap/world mesh pipelines carry their MS container in the AS subobject; translate it as MS, defer moved MS to first bind, build the stand-in as a mesh pipeline with PC target formats. A straight revert/re-apply cycle showed the pre-present watchdog also hits without this change (poisoned-prefix effect, see LOCAL-AGENTS.md), so it stays in.
@DavidM1911

Copy link
Copy Markdown
Contributor

Verification on RTX 3060 Ti (Windows 11): merge conflict with current main (gpu/recomp/emit.rs, hle/d3d12x/real.rs) — needs a rebase before it can be tested.

@jennydeth

jennydeth commented Nov 25, 2026 •

Copy link
Copy Markdown

RTX 3060 12 GB (wave32), retail title 1.0.2.1 – head 6bd8f64 against its base a1672ef, tested as the branch is (it conflicts with current main, so not rebased)

Result (see update 2 at the end for the world load): the 40 refusals are gone and nothing regressed in the menus. Into the story load the moved MS pipelines are translated, with no frame-rate loss on this card, but 3 no stand-in lines and 1 driver rejection appear at the same moment, and both arms then end in the known +0x23cf683 crash (#846 / #675 / #534).

base a1672ef head 6bd8f64
console shaders in the PSO without a translation 40 0
no stand-in lines 0 0
translated as MS (#n) lines – 0 (deferred to first bind, which did not happen in the menus)
frames / 60 s 1537 1561
presents per 2 s, steady 60 60
draws per 2 s at the end 1260 1260
warnings / errors 73 / 0 33 / 0
device removals / crashes 0 / 0 0 / 0
peak commit 14750 MB 14835 MB (+0.6 %)

Regression run (scripts/smoke.ps1 -Seconds 60 taken from current main, because a1672ef's copy has no -OutDir; the same script for both arms, no input, XCL_NETWORK=0)

Base a1672ef:

xcl-smoke v1
commit: a1672ef21c396d8edc9c4b0e3747f671bd40f528
gpu: NVIDIA GeForce RTX 3060
title: 4a4b54dc
seconds: 60
exit: 0x0
frames shown: 1537 (PresentX 1537)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14750 MB

Head 6bd8f64:

xcl-smoke v1
commit: 6bd8f641040071b8a388c0ec3053c2b1483ddcdf
gpu: NVIDIA GeForce RTX 3060
title: 4a4b54dc
seconds: 60
exit: 0x0
frames shown: 1561 (PresentX 1561)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14835 MB

Head 104 % of base frames, 100.6 % of its peak commit: inside the smoke limits.

Update: 300 s with scripted input (same commits and script, -Seconds 300, XCL_PRESS_A_AT=20,24,…,128 – A every 4 s from 20 s to 128 s, the route used in the comment above)

base a1672ef head 6bd8f64
frames / 300 s 8667 8747 (101 %)
console shaders in the PSO without a translation 40 0
no stand-in / translated as MS (#n) lines 0 / – 0 / 0
warnings / errors 81 / 0 41 / 0
device removals / crashes 0 / 0 0 / 0
peak commit 15270 MB 15252 MB
xcl-smoke v1
commit: a1672ef21c396d8edc9c4b0e3747f671bd40f528
gpu: NVIDIA GeForce RTX 3060
title: 4a4b54dc
seconds: 300
exit: 0x0
frames shown: 8667 (PresentX 8667)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 15270 MB
xcl-smoke v1
commit: 6bd8f641040071b8a388c0ec3053c2b1483ddcdf
gpu: NVIDIA GeForce RTX 3060
title: 4a4b54dc
seconds: 300
exit: 0x0
frames shown: 8747 (PresentX 8747)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 15252 MB

Both arms follow the same path: the presses register from 20 s, draws climb to 1170 per second by ~60 s and then stay flat at exactly that rate to the end, with no DirectStorage traffic after the start. So on this card the A-only route stops on one menu screen and never loads the world, and none of the 40 moved MS pipelines is bound in either arm. On this route I do not see the frame-rate drop reported above (8 771 → 2 650): the head keeps 101 % of base frames. That does not rule the drop out once those pipelines are drawn; the route that reached them there would be needed to check.

Update 2: 600 s into the story load (same commits and script, -Seconds 600, XCL_NETWORK=0). The A-only route above was stuck on Legal Notices: A keeps reopening "Copyright", and "Next" only enables after the photosensitivity page's countdown. A route that gets through on a fresh profile is XCL_PRESS_AT=20:A,24:A,…,56:A,60:DOWN,70:DOWN,72:A,80:A,83:DOWN,85:A,88:DOWN,90:A then A every 5 s. For these two runs the profile already had the first-run flow done (from an earlier run with that route), so both arms went straight from the title screens into the story load, on the same timeline (loading artwork from ~66–70 s).

base a1672ef head 6bd8f64
presents before the end 1919 1974 (103 %)
last present-bearing 2 s window 92 s 94 s
AS slot – refused 40 0
translated as MS (#n) lines (sparse log: first 5, then every 1000th) – 5, at 31.8 s, all MS 2bdc6171bf337731
no stand-in pipeline (0x80070057) – building this one in the call 0 3, at 58.29 s
the driver rejected the mesh pipeline from the console MS (0x80070057) 0 1, at 58.31 s
DirectStorage request failed 16 16
end 0xc0000005 write at 0x0, game_scarlett_master.exe+0x23cf683, 121.0 s the same, 124.0 s
peak commit 29355 MB 30350 MB (103 %)
device removals 0 0
xcl-smoke v1
commit: a1672ef21c396d8edc9c4b0e3747f671bd40f528
gpu: NVIDIA GeForce RTX 3060
title: 4a4b54dc
seconds: 600
exit: 0xc0000005
frames shown: none logged (the run did not reach its end)
presents per 2 s (last 3): 0 0 0
device removals: 0
crashes: 2
peak commit: 29355 MB
xcl-smoke v1
commit: 6bd8f641040071b8a388c0ec3053c2b1483ddcdf
gpu: NVIDIA GeForce RTX 3060
title: 4a4b54dc
seconds: 600
exit: 0xc0000005
frames shown: none logged (the run did not reach its end)
presents per 2 s (last 3): 0 0 0
device removals: 0
crashes: 2
peak commit: 30350 MB

Tested

  • NVIDIA GeForce RTX 3060 12 GB, driver 32.0.16.2101 (32-lane waves only); AMD Ryzen 5 5600X; 32 GB RAM
  • Windows 11 Pro 10.0.26300.9974; Rust 1.100.0 (stable-x86_64-pc-windows-msvc); release builds; DXC 1.9.2609.5 (XCL_DXC_DIR)
  • cargo test --workspace --release --no-fail-fast -- --test-threads=4 on 6bd8f64: 718 passed, 3 failed, 41 ignored. The three are title_textures::tests::placed_title_textures_share_vram_and_preserve_pixels (title_textures.rs:1902), title_textures::tests::transitions_apply_when_their_list_is_submitted (:1464) and vram::tests::d32s8_targets_take_their_own_size_of_video_memory (vram.rs:860), the same three reported above. Each passes alone with --test-threads=1; they fail again in a second -p xcl --lib --test-threads=4 run on the head (677 passed, 3 failed), and fail the same way on the base a1672ef (671 passed, 3 failed). So they come with the branch's old base, not with this PR; current main (06c9f55) passes them on this machine.
  • SKIPPED on this adapter: 2 × no wave64 (gpu_geometry_wave32_prefix_count_over_a_mask, gpu_wave32_program_in_wave64_hardware)

Not tested

  • Gameplay past the +0x23cf683 crash, so whether the translated MS pipelines draw correctly (no screenshot comparison of the minimap); the branch rebased onto current main; AMD / wave64; a cold first-run profile with the new route on both arms.

AI use

  • Claude Code (Claude Opus 5.5) built both commits, ran the tests and the smoke runs on my machine, read the logs and wrote this comment.

@pickles976

Copy link
Copy Markdown

RTX 4060 Laptop / Wine follow-up on the current PR logic (not a clean PR-head run): I ported 6bd8f64 together with #724 onto a local integration tree that already carries the Wine and memory PRs needed for this title. The four real::mesh_slot_tests passed under Wine (4 passed, 0 failed), and the release build completed.

A guarded retail-title run reached 120.6 s before my 7.5 GiB VRAM safety limit stopped it (7,614 MiB reported by NVIDIA, 2,797 MiB system RAM available). It presented frame 2420; the frame was still loading artwork, not the world. The last 300-frame interval was 25.9 fps. There were no crashes, device removals, E_OUTOFMEMORY, or no stand-in pipeline messages. The 40 old mesh pipeline with its MS ... in the AS slot – refused messages seen on the same integration tree before this port became zero. Because XCL_PSO_PRELOAD=1 uses deferred translation and this run did not bind one of the moved pipelines before the guard, I also saw zero translated as MS messages; this run therefore verifies removal of the refusal and stand-in unit behavior, not in-title rendering by a moved MS.

Hardware/runtime: NVIDIA GeForce RTX 4060 Laptop GPU 8 GiB, driver 590.48.1, Linux 6.17, Wine 11, vkd3d-proton 2576c0b4, DXC 1.9.2609.5, Rust 1.98.1 MSVC cross-build. I used OpenAI Codex (GPT-5.6 Sol) to port the conflicting PR, run the tests/title, and inspect the logs and captured frame; I reviewed this report before posting.

JR-Wiederkehr pushed a commit to JR-Wiederkehr/xcl that referenced this pull request Nov 25, 2026
…it is)

The branch carries xcl-dev#304's budget commits, which the tree has already
(merged under other hashes, with a later doc of the measured range).

Conflicts: passthrough_max_vertices keeps the tree's later doc (the
whole measured range); the recompiler tests keep xcl-dev#1984's edge-flag
test next to xcl-dev#304's; translated_mesh_stream keeps the tree's deferral
of every console mesh pipeline in the cached-only attempt (it covers
the moved MS the PR defers, and the attempt's result is not used when
it misses) and adds the PR's sparse log of moved shaders after it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
JR-Wiederkehr pushed a commit to JR-Wiederkehr/xcl that referenced this pull request Nov 25, 2026
gustavsi added a commit to gustavsi/xcl that referenced this pull request Nov 26, 2026
… mesh shader)

Translates the 40 console mesh pipelines that carry their MS container in
the AS slot, preserving lazy stand-in deferral and integer RTV blend
sanitization.

Assisted-by: Antigravity (Gemini 4 Neon)
gustavsi added a commit to gustavsi/xcl that referenced this pull request Nov 26, 2026
…DispatchMesh & ExecuteIndirect)

Enables two-pass mesh execution for DispatchMesh and ExecuteIndirect
(superseding xcl-dev#724), paired with xcl-dev#541 (MS in AS slot). Reconciles
runner.rs, bind.rs, and console_list.rs with xcl-dev#2118, xcl-dev#2404, and xcl-dev#1428.

Assisted-by: Antigravity (Gemini 4 Neon)
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.