Skip to content

Recompiler: the mesh pass-through budget accounts DXC’s vertex chunks - #304

Merged
raylitebull merged 4 commits into
xcl-dev:mainfrom
ryosen0:mesh-split-chunks
Nov 25, 2026
Merged

raylitebull merged 4 commits into
xcl-dev:mainfrom
ryosen0:mesh-split-chunks

Conversation

@ryosen0

@ryosen0 ryosen0 commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

A retail title's NGG transform programs (128 vertices / 128 primitives, 21 params + SV_ClipDistance0 = 352 B per vertex) all fail ms_6_6 with "vertex plus primitive output size is greater than 32768" - 19 programs on our machine (MS_VS_TransformLit/TransformD/TransformSkin*, all the same shape). The pipelines then run without a translated mesh shader.

Root cause: passthrough_split divides the 32768 B budget by the vertex stride, but DXC accounts whole chunks of 32 vertices even when fewer are declared. verts[78] at 352 B is accounted as 96 vertices (33792 B) and refused; the split it computes (5 groups of 26 triangles) is refused for every one of these programs.

Measured the accounting with dxc 1.8.2502 (Windows SDK 10.0.26100) on synthetic mesh shaders: bisected the max vertex count for 1..26 float4 rows - every boundary agrees with floor(min(256, 32768/stride) / 32) * 32 (e.g. 22 rows: 64 verts OK, 65 refused; 21 rows: 96 OK, 97 refused). Primitive indices do not move the boundary at these sizes.

What is in it

  • passthrough_split: the vertex budget is floored to a multiple of 32 (capped at 256). The wide records now go out in 7 groups of 19 triangles, which DXC accepts.
  • test mesh_split_accounts_vertex_chunks: the wide record (the retail shape) splits into 7 groups and compiles; a 20-row record splits into 4 groups of 96 vertices and compiles; a narrow record stays whole. Fails without the change (5 != 7). No GPU needed, only DXC.

Tested

  • Ryzen 7 9800X3D, RTX 3060 Ti 8 GB (driver 32.0.16.1742), 32 GB, Windows 11, rustc 1.100.0-nightly, release
  • cargo test --workspace -- --test-threads=4: 612 passed, 0 failed, 20 ignored (lib, includes the new test); other suites 13+3+1+3+2+7+1+1+2+1+6 passed, 0 failed, 4+12 ignored
  • SKIPPED on this adapter: gpu_geometry_wave32_prefix_count_over_a_mask, gpu_wave32_program_in_wave64_hardware (no wave64)
  • xcl shaders <title> --precompile --only ms on our copy of the title: 19 ms_6_6 errors before (3864 compiled / 14681 cached in that pass); after, the same pass compiles the 6 distinct failing sources with 0 errors (18558 cached)

Not tested

  • AMD GPUs, wave64 hardware
  • the retail title past the first menu with these pipelines active (the smoke runs reach the menu; the transform programs are gameplay shaders)
  • the driver's runtime behaviour of the split groups on RDNA (the split path itself is covered by gpu_mesh_mode_two_passes on this NVIDIA adapter)

Review fix (shdann): the layout is now chosen by the vertex budget alone, independently of the dispatch group count — a record of 80 vertices / 1 triangle / 22 float4 rows declares compact verts[3] (count 1) instead of verts[80] (accounted as 96 = 33792 B, refused by DXC). New test mesh_layout_independent_of_group_count pins the asymmetric case; mesh_split_accounts_vertex_chunks unchanged. Rebased onto 9ce2070.

Tested (new head)

  • cargo build --workspace, cargo test --workspace --no-fail-fast -- --test-threads=1: 686 passed, 0 failed, 41 ignored (2 GPU SKIPPED lines: no wave64 on this adapter). RTX 3060 Ti 8 GB, Ryzen 7 9800X3D, driver 32.0.16.1742, Windows 11.

Review nits (Parakeet-Wheat) addressed in 2a2cc6d (tests + one doc line, no behaviour change): mesh_layout_independent_of_group_count now compiles the whole-record declaration (verts[80], accounted as 96) and asserts DXC refuses it, instead of rebuilding the same interface and asserting verts[3] again; passthrough_split's doc no longer claims a comparison of the two forms it does not make. Full suite on 2a2cc6d: 686 passed, 0 failed, 41 ignored (--test-threads=1, 2 GPU SKIPPED no wave64). Independent confirmation on this head: Parakeet-Wheat's DXC 1.8.2502 precompile (19 errors on main -> 0 here) and CryingLaughing's RTX 4080 GPU fixture (compact layout draws all 1024 pixels identically; the parent's verts[80] refused before dispatch).

Regression run
Main 1c87b1d (current main):

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

Head 1ab9ba9:

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

AI use
GPT-6.2 Astra (API model selector), working as the coding agent in this session: bisected the DXC accounting on this machine, wrote the fix, the test and this description, ran the tests and the smoke runs. The human contributor reviewed the diff and the measurements.

@ghost

ghost commented Nov 23, 2026

Copy link
Copy Markdown

Tested 8c7413c merged onto main 0e946cf (clean merge) on AMD RDNA4: pass, and the new test fails without the fix.

Tested

  • AMD Radeon RX 9060 XT (RDNA4), driver 32.0.32029.2010; Ryzen 7 5800X3D; Windows 11 Pro 26200; Rust 1.100.0; DXC 1.9.2602.17 (SDK 10.0.26100); debug build.
  • .\scripts\test.ps1: 652 passed, 0 failed, 40 ignored; no SKIPPED GPU tests on this adapter.
  • XCL_REQUIRE_GPU=wave64,mesh cargo test -p xcl --lib mesh_: 24 passed, 0 failed, including mesh_split_accounts_vertex_chunks, gpu_mesh_mode_two_passes and gpu_mesh_mode_reads_memory_windows.
  • Negative control: only this PR's tests.rs on main 4017f8f (the emit.rs change left out): mesh_split_accounts_vertex_chunks fails at the first split check (left: 5, right: 7), so the test catches the old budget.

Not tested

  • No XCL_SAMPLE_* set and no retail title, so no smoke.ps1 regression run and nothing on a real NGG program; NVIDIA and GPUs without mesh shaders.

AI use

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

@likecrank-dotcom

Copy link
Copy Markdown

Independent native Windows/NVIDIA validation of #304 at 8c7413c27f2ba0f926d60ba104318c5c3fa38822, using DXC 1.9.2602.17 (rather than the 1.8.2502 compiler in the description).

Tested

  • Ryzen 5 3600, RTX 5060 Ti, NVIDIA 621.14 / 32.0.16.2114, 32 GB RAM; Windows 11 Pro 10.0.26300; Rust 1.100.0 stable MSVC, MSVC 19.44, SDK 10.0.26100.0. Debug builds, isolated target directory.
  • cargo build --workspace: exit 0, existing fetch_update deprecation warning only.
  • cargo test --workspace -- --test-threads=4 --nocapture: exit 0; 652 passed, 0 failed, 40 ignored, across 17 result blocks (lib: 612 passed, 0 failed, 20 ignored).
  • mesh_split_accounts_vertex_chunks passed, including all three DXC compilations (wide 352-byte records, the 320-byte case, and the narrow control).
  • Negative control: only the PR's test-file changes copied onto main@0e946cfc68244edee1fba6e0425371f687a05ccd, runtime unchanged; cargo test -p xcl --lib mesh_split_accounts_vertex_chunks -- --nocapture --test-threads=1 exits 101, 1 failed: left: 5, right: 7. The regression catches the old split count on this DXC version too.

SKIPPED / Not tested
Four explicit skips: gpu_geometry_wave32_prefix_count_over_a_mask and gpu_wave32_program_in_wave64_hardware (no wave64); test_title_draws_with_a_root_signature_under_the_debug_layer (no d3d12SDKLayers.dll); uploads_start_from_each_subresources_state (no D3D12 debug layer, 0x887A002D). No XCL_SAMPLE variables, retail shaders, title/smoke run, AMD/Wine, or gameplay validation. The synthetic mesh paths were tested; the actual title's transform pipelines were not run here.

AI use
Codex prepared the test-only control, executed the commands, and summarized the actual logs. Exact deployed model identifier is not exposed in this session.

@ryosen0

ryosen0 commented Nov 23, 2026

Copy link
Copy Markdown
Contributor Author

Data point from a retail run on our machine (RTX 3060 Ti 8 GB, Ryzen 7 9800X3D, driver 32.0.16.1742): main + this PR is not in the stack, but the same title run with #300 + #294 + #273 (+#208) + #283 (+#252) reached the character loading screen, and its report shows failed_pipelines: 41, all of the form:

mesh pipeline with its MS <hash> in the AS slot - refused

These are the intentional refusals in translated_mesh_stream (real.rs, the minimap pipelines comment), not translation failures - noting it here because the hashes differ from the 19 ms_6_6 output-limit failures this PR fixes, i.e. two separate classes. With this PR the output-limit class is gone on our copy (precompile --only ms: 19 errors -> 0); the AS-slot class remains and is untouched by it.

AI use: GPT-6.2 Astra (API model selector) wrote this comment from our run's report.json; the human contributor observed the run.

@requiemsnkrp

Copy link
Copy Markdown
Contributor

Tested 8c7413c on NVIDIA GeForce RTX 3060 12 GB (driver 32.0.16.1714 / 617.14, 32-lane waves), Ryzen 5 5600X, Windows 11 Pro 25H2 (26200.9974), Rust 1.100.0 (stable-x86_64-pc-windows-msvc), DXC 1.9.2602.17 (Windows SDK), debug: pass.

Tested

  • cargo test --workspace -j 4 --no-fail-fast -- --test-threads=4 --skip test_title_runs_and_game_folder_is_untouched --skip test_title_draws_with_a_root_signature_under_the_debug_layer: 650 passed, 0 failed, 40 ignored
  • SKIPPED (no wave64): gpu_geometry_wave32_prefix_count_over_a_mask, gpu_wave32_program_in_wave64_hardware
  • PR's test: gpu::recomp::tests::mesh_split_accounts_vertex_chunks ... ok (the three pass-through shaders compile as ms_6_6 with DXC 1.9.2602.17; the PR measured with 1.8.2502)
  • main 4017f8f on the same machine, same command: 650 passed, 0 failed, 40 ignored, same 2 SKIPPED. The PR's base is 9ab7d76; main has one more test since, so the same count includes this PR's new test.
  • Tested the head itself; it merges cleanly into main 4017f8f (git merge-tree), the merge result was not tested.
  • Not run here: the two e2e tests that run the test title (test_title_runs_and_game_folder_is_untouched, test_title_draws_with_a_root_signature_under_the_debug_layer): they open the XCL game window and this PC was in use (the 2 "filtered out").

Not tested

  • Retail title regression run (no game copy here).
  • Whether the new test fails without the change (not checked here).

AI use: Claude Code with Claude Opus 5.5 (ran the tests and wrote this report).

@PHeitor1

PHeitor1 commented Nov 24, 2026 •

Copy link
Copy Markdown

Tested 8c7413c merged onto main 3516080.

RTX 5060 Ti 8 GB (Blackwell, 32-lane waves), NVIDIA 621.24, Ryzen 5 5600X, Windows 11 Pro 26300 (native, Graphics Tools + XGameRuntime installed, so the debug-layer tests run), rustc 1.100.0 MSVC, debug, cargo test --workspace --no-fail-fast -- --test-threads=4, no XCL_SAMPLE_*.

Pass: 671 passed, 0 failed, 41 ignored. SKIPPED: only the 2 no wave64 tests (gpu_geometry_wave32_prefix_count_over_a_mask, gpu_wave32_program_in_wave64_hardware). Build clean.

Run and written with Claude Code (Claude Opus 5.5).

@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.

At emit.rs:4721, one group can mean two different things. For 22 float4 rows, 80 maximum vertices, and one triangle, the cap is 64 vertices and the compact triangle fits in one group. The function returns 1. At line 4657 the caller selects the original layout and declares verts[80]. DXC charges for 96 vertices, or 33,792 bytes. I compiled a synthetic ms_6_6 shader with Windows SDK 10.0.26100 DXC: the 80-vertex declaration failed the 32,768-byte check. Changing only the declaration to three vertices compiled. Please select the compact layout from the vertex budget independently of the dispatch group count. A test with these asymmetric limits would cover this case. Reviewed at 8c7413c with OpenAI Codex (GPT-6).

JustDownTV pushed a commit to JustDownTV/xcl that referenced this pull request Nov 24, 2026
… it is

A retail title's minimap pipelines carry their console MS container in the AS
subobject with no MS subobject. They were refused: translated, the title had
rendered nothing from then on. That black screen was the translated mesh
shaders failing their ms_6_6 output budget, fixed by the DXC vertex-chunk
budget (xcl-dev#304); the slot itself was never the problem. With the budget in
place the same shaders translate and the title keeps rendering.

mesh_shader_slots moves the container to the MS slot (and it is not an AS any
more); a real AS, an MS already present, or a PC shader are left as they are.
Unit test covers all five cases.

Assisted-by: DSH (GPT-6.2 Astra)
(cherry picked from commit ce41f94)
A retail title's NGG transform programs (128 vertices / 128 primitives,
21 params + SV_ClipDistance0 = 352 B per vertex) all failed ms_6_6 with
"vertex plus primitive output size is greater than 32768": the split
budget divided 32768 by the stride, but DXC accounts whole chunks of 32
vertices even when fewer are declared - verts[78] at 352 B is accounted
as 96 (33792 B) and refused. Measured with dxc 1.8.2502 on this machine:
every boundary from 9 to 26 float4 rows agrees with the chunk model.

passthrough_split now floors the vertex budget to a multiple of 32
(capped at 256); the wide records go out in 7 groups of 19 triangles
instead of 5 groups of 26 that DXC refuses. Test: the wide record splits
and compiles, a 96-vertex group at 320 B compiles, a narrow record stays
whole; fails without the change (5 != 7).

Assisted-by: DSH (GPT-6.2 Astra)
The emitter picked the whole-record layout from passthrough_split == 1, but
that count is the dispatch's: a record of 80 vertices with 22 float4 rows
does not fit the mesh output budget as a whole (DXC accounts 96 vertices,
33792 B > 32768) while its single triangle's compact copies fit one group,
so the count is 1 and verts[80] was declared and refused. The declaration
now follows the vertex budget independently of the group count; the compact
form covers every record over the budget, including the one-group ones.

mesh_layout_independent_of_group_count covers the asymmetric limits (80
vertices, 1 triangle, 22 rows): compact declaration, count 1, DXC accepts.
Found in review by shdann (PR xcl-dev#304).

Assisted-by: DSH (GPT-6.2 Astra)
@ryosen0

ryosen0 commented Nov 24, 2026

Copy link
Copy Markdown
Contributor Author

Both points addressed:

Layout vs dispatch count — fixed in the new head: the declaration now follows the vertex budget alone (compact whenever the record's whole vertices exceed the chunk-accounted cap), independently of passthrough_split, which stays the dispatch count. Your exact asymmetric case is the new test mesh_layout_independent_of_group_count: 80 vertices / 1 triangle / 22 float4 rows → compact verts[3] declared, count 1, DXC accepts (the old code declared verts[80], accounted as 96 = 33792 B, refused). mesh_split_accounts_vertex_chunks still passes unchanged (128/128 → 7 groups of 19, etc.).

Thank you for the synthetic-shader verification — that made the fix precise instead of a guess.

AI use: GPT-6.2 Astra (API model selector) in DSH wrote the fix and the test; the human contributor reviewed them.

ryosen0 added a commit to ryosen0/xcl that referenced this pull request Nov 24, 2026
… it is

A retail title's minimap pipelines carry their console MS container in the AS
subobject with no MS subobject. They were refused: translated, the title had
rendered nothing from then on. That black screen was the translated mesh
shaders failing their ms_6_6 output budget, fixed by the DXC vertex-chunk
budget (xcl-dev#304); the slot itself was never the problem. With the budget in
place the same shaders translate and the title keeps rendering.

mesh_shader_slots moves the container to the MS slot (and it is not an AS any
more); a real AS, an MS already present, or a PC shader are left as they are.
Unit test covers all five cases.

Assisted-by: DSH (GPT-6.2 Astra)
@Parakeet-Wheat

Parakeet-Wheat commented Nov 24, 2026 •

Copy link
Copy Markdown

Tested the new head b884f3c (after the layout fix) with DXC 1.8.2502, the compiler the measurements in the description were made with. The earlier reports here used 8c7413c and DXC 1.9. Pass, plus two small notes.

Tested

  • NVIDIA GeForce RTX 3070 (8 GB, 32-lane waves), driver 610.88; AMD Ryzen 5 5600X; Windows 11 build 26300; Rust 1.95.0 stable (x86_64-pc-windows-msvc); DXC 1.8.2502 from Windows SDK 10.0.26100
  • xcl shaders <the retail title's shaders.rpf> --precompile --only ms, release builds, same DXIL cache for both runs:
    • main dd2ae9a: compiled 0, already cached 18545, errors 19 (MS_VS_TransformLit_*, MS_VS_TransformD_*, MS(R)_VS_TransformSkinD_*, MS_VS_MirrorReflection*; 3 distinct HLSL sources, all dxc: error: validation errors)
    • this PR b884f3c: compiled 6, already cached 18558, errors 0
  • .\scripts\test.ps1 at b884f3c (debug, clean tree): 686 passed, 0 failed, 41 ignored, exit 0; mesh_split_accounts_vertex_chunks and mesh_layout_independent_of_group_count both ran and passed
  • SKIPPED on this adapter: gpu_geometry_wave32_prefix_count_over_a_mask, gpu_wave32_program_in_wave64_hardware (no wave64)

Notes

  • Nit, mesh_layout_independent_of_group_count: the last block builds MsInterface { max_vertices: 80, max_primitives: 1, ..ms.clone() }, which is the same ms as above, and asserts verts[3] again. The comment says it shows "the whole-record form is what DXC refuses", but nothing there compiles a verts[80] declaration or checks a refusal. It could be dropped, or changed to compile the old whole-record HLSL and assert DXC refuses it.
  • Nit, passthrough_split's doc says "whichever costs fewer groups", but the function does not compare the two; it returns 1 when the record fits, otherwise the split count.

Not tested

  • The retail title in play with these pipelines active (these are gameplay shaders; I didn't run the game on this head).
  • AMD / wave64 hardware.

AI use: Claude Code with Claude Opus 5.5 ran the builds, the precompile and the tests, and drafted this comment. I checked each point before posting.

AI-assisted (Claude Code).

@CryingLaughing

Copy link
Copy Markdown

Tested

  • Head b884f3c001bec54273719539f2c3deef49676b78 and its parent d3bd51d9172f3b61cbe2a5b2fd3871e946242830, each with the same scratch-only test in crates/xcl/src/gpu/recomp/tests.rs. NVIDIA GeForce RTX 4080, driver 621.01, Intel Core i5-13600K, Windows 11 25H2 build 26200.9974, Rust 1.100.0 MSVC x64, Windows SDK DXC 1.8.2502.11, debug. XCL_ADAPTER=4080, XCL_REQUIRE_GPU=mesh, all XCL_SAMPLE_* variables unset.
  • Built each revision with cargo test -p xcl --lib --locked -j 4 --no-run --message-format=json, then ran the resulting executable with gpu::recomp::tests::gpu_mesh_compact_layout_in_one_group --exact --test-threads=1 --nocapture.
  • The fixture used two synthetic records, each with 80 vertices, 22 float4 rows per vertex, and a single triangle referencing vertices 5, 42, and 79. With the compact verts[3] output on the PR head, the GPU passed 1/1 with zero skips. The whole-record control used the same records and a narrower pixel signature. All 1,024 RGBA32F pixels matched between the two layouts, including the two distinct triangle colors and the untouched background sample. Both readbacks matched all 14,090 record words.
  • The exact parent failed 0/1 on the same fixture. It generated verts[80], and DXC rejected that output with vertex plus primitive output size is greater than 32768 before dispatch. The focused control changes only the selected revision and uses its own shader generator.

Not tested

  • A full workspace run on this head, other GPUs, release builds, or retail titles.

AI use

  • OpenAI Codex (GPT-6 family, exact variant unavailable) prepared the scratch fixture, ran the checks, and drafted this report.

gustavsi added a commit to gustavsi/xcl that referenced this pull request Nov 24, 2026
…dget

Combines the 32-vertex chunk mesh output budget (upstream PR xcl-dev#304) with console-numbered MS subobject handling (upstream PR xcl-dev#630):
- emit.rs: account for DXC's 32-vertex chunk sizing in passthrough_max_vertices and select single vs split pass-through layout by vertex budget.
- real.rs: treat a console MS container at subobject 24 (with no PC MS at 25) as the stream's MS, rewrite subobject 24 to 25 in fallback_stream with the stand-in MS, and defer compilation via pso_async::lazy().

Verified on Linux (GE-Proton11-14, RX 9060 XT): 7/7 targeted tests pass (including gpu_mesh_mode_two_passes and console_ms_stream_tests); GTA VI 75 s run shows 0 AS-slot refusals, translation_errors=[], 937/937 frames at 30.0 FPS.
Review nits (Parakeet-Wheat): mesh_layout_independent_of_group_count ended with a block that rebuilt the same MsInterface and asserted verts[3] again; it now compiles the whole-record declaration (verts[80], accounted as 96: 33792 B) and asserts DXC refuses it. passthrough_split's doc claimed a comparison of the two forms it does not make; the doc now states what it does. Tests only plus a doc line; no behaviour change.

Assisted-by: DSH (GPT-6.2 Astra)
@ryosen0

ryosen0 commented Nov 24, 2026

Copy link
Copy Markdown
Contributor Author

Thanks — both nits fixed in 2a2cc6d (tests + one doc line, no behaviour change):

  • mesh_layout_independent_of_group_count now does what its comment said: it takes the compact HLSL, substitutes the whole-record declaration (verts[80], accounted as 96 vertices: 33792 B) and asserts DXC refuses it — the redundant rebuild-and-assert block is gone.
  • passthrough_split's doc no longer claims it compares the two forms; it states what it does (fits -> 1, else the split count).

Full suite on 2a2cc6d: 686 passed, 0 failed, 41 ignored (--test-threads=1, 2 GPU SKIPPED no wave64); smoke re-run on the new head is in the description. And thank you for the DXC 1.8.2502 precompile pass — 19 errors on main -> 0 here matches our measurement exactly, on a different card and driver. @CryingLaughing's RTX 4080 fixture (pixel-identical compact vs whole-record draws, parent refused before dispatch) closes the GPU-side question on this head too.

AI use: GPT-6.2 Astra (API model selector) in DSH made the changes and ran the tests; the human contributor reviewed the diff.

ryosen0 added a commit to ryosen0/xcl that referenced this pull request Nov 24, 2026
… it is

A retail title's minimap pipelines carry their console MS container in the AS
subobject with no MS subobject. They were refused: translated, the title had
rendered nothing from then on. That black screen was the translated mesh
shaders failing their ms_6_6 output budget, fixed by the DXC vertex-chunk
budget (xcl-dev#304); the slot itself was never the problem. With the budget in
place the same shaders translate and the title keeps rendering.

mesh_shader_slots moves the container to the MS slot (and it is not an AS any
more); a real AS, an MS already present, or a PC shader are left as they are.
Unit test covers all five cases.

Assisted-by: DSH (GPT-6.2 Astra)
gustavsi added a commit to gustavsi/xcl that referenced this pull request Nov 24, 2026
…dget

Combines the 32-vertex chunk mesh output budget (upstream PR ivall#304) with console-numbered MS subobject handling (upstream PR ivall#630):
- emit.rs: account for DXC's 32-vertex chunk sizing in passthrough_max_vertices and select single vs split pass-through layout by vertex budget.
- real.rs: treat a console MS container at subobject 24 (with no PC MS at 25) as the stream's MS, rewrite subobject 24 to 25 in fallback_stream with the stand-in MS, and defer compilation via pso_async::lazy().

Verified on Linux (GE-Proton11-14, RX 9060 XT): 7/7 targeted tests pass (including gpu_mesh_mode_two_passes and console_ms_stream_tests); a retail title 75 s run shows 0 AS-slot refusals, translation_errors=[], 937/937 frames at 30.0 FPS.
@upipibi upipibi mentioned this pull request Nov 24, 2026
gustavsi added a commit to gustavsi/xcl that referenced this pull request Nov 24, 2026
…dget

Combines the 32-vertex chunk mesh output budget (upstream PR ivall#304) with console-numbered MS subobject handling (upstream PR ivall#630):
- emit.rs: account for DXC's 32-vertex chunk sizing in passthrough_max_vertices and select single vs split pass-through layout by vertex budget.
- real.rs: treat a console MS container at subobject 24 (with no PC MS at 25) as the stream's MS, rewrite subobject 24 to 25 in fallback_stream with the stand-in MS, and defer compilation via pso_async::lazy().

Verified on Linux (GE-Proton11-14, RX 9060 XT): 7/7 targeted tests pass (including gpu_mesh_mode_two_passes and console_ms_stream_tests); a retail title 75 s run shows 0 AS-slot refusals, translation_errors=[], 937/937 frames at 30.0 FPS.
gustavsi added a commit to gustavsi/xcl that referenced this pull request Nov 24, 2026
…dget

Combines the 32-vertex chunk mesh output budget (upstream PR xcl-dev#304) with console-numbered MS subobject handling (upstream PR xcl-dev#630):
- emit.rs: account for DXC's 32-vertex chunk sizing in passthrough_max_vertices and select single vs split pass-through layout by vertex budget.
- real.rs: treat a console MS container at subobject 24 (with no PC MS at 25) as the stream's MS, rewrite subobject 24 to 25 in fallback_stream with the stand-in MS, and defer compilation via pso_async::lazy().

Verified on Linux (GE-Proton11-14, RX 9060 XT): 7/7 targeted tests pass (including gpu_mesh_mode_two_passes and console_ms_stream_tests); a retail title 75 s run shows 0 AS-slot refusals, translation_errors=[], 937/937 frames at 30.0 FPS.
@iggyvilla

Copy link
Copy Markdown
Contributor

Test report for b884f3c001bec54273719539f2c3deef49676b78 on AMD RDNA2 (native wave64). Note: 2a2cc6d (tests + doc line, no behaviour change) was pushed after these runs finished; all results below are from b884f3c (merge base 9ce2070eccf436d7bd38601c90407da447df34f3), clean detached worktrees.

Tested

  • GPU: AMD Radeon RX 6650 XT (RDNA2, gfx1032, 8146 MiB VRAM), driver 32.0.21045.29003; CPU: AMD Ryzen 7 5700X, 32 GB RAM; Windows 11 Home build 26300; Rust 1.100.0 stable-x86_64-pc-windows-msvc; DXC dxcompiler 1.8.2502.11 / dxil 1.8.2502.11 (Windows SDK 10.0.26100).
  • New DXC tests (--test-threads=1 --nocapture): mesh_split_accounts_vertex_chunks and mesh_layout_independent_of_group_count both pass (1/1 each) with DXC 1.8.2502.11.
  • Whole suite (cargo build --workspace then cargo test --workspace --no-fail-fast -- --test-threads=4, debug; e2e rerun after building the test title): 683 passed, 3 failed, 41 ignored, 0 SKIPPED (both wave64 tests gpu_geometry_wave32_prefix_count_over_a_mask and gpu_wave32_program_in_wave64_hardware ran and passed; gpu_mesh_mode_two_passes, gpu_mesh_mode_reads_memory_windows, and mesh_split_wave64_form also passed).
  • Split producer check (XCL_SPLIT_WAVE64=1): cargo test -p xcl --lib mesh_ -- --test-threads=1 (25 passed, 0 failed) and gpu_split_wave64 (5 passed, 0 failed).
  • Real retail MS+PS pipelines through the D3D12.X PSO hook (XCL_SAMPLE_RPF=...\shaders.rpf, cargo test -p xcl --test gpu_pso_e2e retail_mesh_pipelines_through_the_hook -- --exact --nocapture --test-threads=1):
    • XCL_MS_EVERY=1500: 7 / 7 passed (39.44 s).
    • XCL_MS_EVERY=200: 46 / 46 passed, 0 failed (915.34 s), including MS_VS_TransformLit_c22269ee, MS_VS_TransformSkinD_DetailMapsOff_34f92402, MSNC_VS_TransformSkinD_*, MS_VS_MirrorReflectionTransformD_f0a15084, and MSNC_VS_MirrorReflectionTransformSkinD_* (the 352 B / 128-vertex shapes).
  • 60 s smokes (scripts/smoke.ps1, XCL_NETWORK=0, release builds, clean trees, warm DXIL cache):

Base 9ce2070:

xcl-smoke v1
commit: 9ce2070eccf436d7bd38601c90407da447df34f3
gpu: AMD Radeon RX 6650 XT
title: GTA6.Xbox.v1.0.2.1-CYBERLEEK
seconds: 60
exit: 0x0
frames shown: 591 (PresentX 595)
presents per 2 s (last 3): 0 1 0
device removals: 0
crashes: 0
peak commit: 12015 MB

Head b884f3c:

xcl-smoke v1
commit: b884f3c001bec54273719539f2c3deef49676b78
gpu: AMD Radeon RX 6650 XT
title: GTA6.Xbox.v1.0.2.1-CYBERLEEK
seconds: 60
exit: 0x0
frames shown: 923 (PresentX 923)
presents per 2 s (last 3): 18 19 18
device removals: 0
crashes: 0
peak commit: 15988 MB

Both exit 0x0, 0 device removals, 0 crashes, 0 ms_6_6 / vertex plus primitive output size / driver-rejection errors; report.json on head has translated_pipelines: 6, failed_pipelines: 0, translation_errors: 40 (all the expected minimap AS-slot refusals). The frame-count difference reflects which loading/menu phase each 60 s run ended in and is not an fps claim.

Not tested

  • Follow-up commit 2a2cc6d (tests + doc line).
  • Full-pack xcl shaders ... --precompile --only ms (DXC-only; already reproduced 19→0 on DXC 1.8.2502 above) and XCL_MS_EVERY=1 over all MS programs.
  • Gameplay past the menus / visual verification of the transform pipelines.
  • Head merged onto current main, or other GPUs / drivers / DXC versions.

AI use
opencode with DeepSeek V4.1 Flash (opencode-go/deepseek-v4.1-flash) built the worktrees, ran the tests and smokes, and wrote the report.

gustavsi added a commit to gustavsi/xcl that referenced this pull request Nov 24, 2026
…dget

Combines the 32-vertex chunk mesh output budget (upstream PR xcl-dev#304) with console-numbered MS subobject handling (upstream PR xcl-dev#630):
- emit.rs: account for DXC's 32-vertex chunk sizing in passthrough_max_vertices and select single vs split pass-through layout by vertex budget.
- real.rs: treat a console MS container at subobject 24 (with no PC MS at 25) as the stream's MS, rewrite subobject 24 to 25 in fallback_stream with the stand-in MS, and defer compilation via pso_async::lazy().

Verified on Linux (GE-Proton11-14, RX 9060 XT): 7/7 targeted tests pass (including gpu_mesh_mode_two_passes and console_ms_stream_tests); a retail title 75 s run shows 0 AS-slot refusals, translation_errors=[], 937/937 frames at 30.0 FPS.
RyanFrancoSCStudent referenced this pull request in RyanFrancoSCStudent/xcl Nov 24, 2026
Apply upstream ivall/xcl PR #541 including #304, by ryosen0 (303b34608e23264fbda310d7cd6c40ab2f0eb037), to current main. Retain upstream regression tests. No Windows build or GPU tests performed here.

Assisted-by: ChatGPT (GPT-6.2)
ryosen0 added a commit to ryosen0/xcl that referenced this pull request Nov 24, 2026
The emitter picked the whole-record layout from passthrough_split == 1, but
that count is the dispatch's: a record of 80 vertices with 22 float4 rows
does not fit the mesh output budget as a whole (DXC accounts 96 vertices,
33792 B > 32768) while its single triangle's compact copies fit one group,
so the count is 1 and verts[80] was declared and refused. The declaration
now follows the vertex budget independently of the group count; the compact
form covers every record over the budget, including the one-group ones.

mesh_layout_independent_of_group_count covers the asymmetric limits (80
vertices, 1 triangle, 22 rows): compact declaration, count 1, DXC accepts.
Found in review by shdann (PR xcl-dev#304).

Assisted-by: DSH (GPT-6.2 Astra)
ryosen0 added a commit to ryosen0/xcl that referenced this pull request Nov 24, 2026
… it is

A retail title's minimap pipelines carry their console MS container in the AS
subobject with no MS subobject. They were refused: translated, the title had
rendered nothing from then on. That black screen was the translated mesh
shaders failing their ms_6_6 output budget, fixed by the DXC vertex-chunk
budget (xcl-dev#304); the slot itself was never the problem. With the budget in
place the same shaders translate and the title keeps rendering.

mesh_shader_slots moves the container to the MS slot (and it is not an AS any
more); a real AS, an MS already present, or a PC shader are left as they are.
Unit test covers all five cases.

Assisted-by: DSH (GPT-6.2 Astra)
gustavsi added a commit to gustavsi/xcl that referenced this pull request Nov 24, 2026
…dget

Combines the 32-vertex chunk mesh output budget (upstream PR ivall#304) with console-numbered MS subobject handling (upstream PR ivall#630):
- emit.rs: account for DXC's 32-vertex chunk sizing in passthrough_max_vertices and select single vs split pass-through layout by vertex budget.
- real.rs: treat a console MS container at subobject 24 (with no PC MS at 25) as the stream's MS, rewrite subobject 24 to 25 in fallback_stream with the stand-in MS, and defer compilation via pso_async::lazy().

Verified on Linux (GE-Proton11-14, RX 9060 XT): 7/7 targeted tests pass (including gpu_mesh_mode_two_passes and console_ms_stream_tests); a retail title 75 s run shows 0 AS-slot refusals, translation_errors=[], 937/937 frames at 30.0 FPS.
@NathanTheophile

Copy link
Copy Markdown

The rule holds over the whole range a pass-through can reach, not only rows 9–26. I bisected the largest vertex count ms_6_6 accepts with DXC 1.8.2502.11 (Windows SDK 10.0.26100), for 1–32 float4 rows per vertex (SV_Position included; a PS reads at most 31 inputs, so 32 is the ceiling) and 1, 128 and 256 primitives (uint3 indices). That makes 96 cases, and floor(min(256, 32768 / stride) / 32) * 32 gives exactly DXC's boundary in every one: not merely a safe bound, so no vertex budget is lost. The primitive count does not move it, even at 256 with rows ≤ 8. If you want, the doc of passthrough_max_vertices can say "1 to 32 float4 rows, up to 256 primitives" instead of "from 9 to 26".

The synthetic shaders were float4 elements only. Clip / cull distances declared narrower than a row were not measured; the formula counts them as full rows, which can only overestimate.

Tested: RTX 4060 Laptop GPU (driver 32.0.16.1687), i7-13650HX, Windows 11 25H2 (26200), Rust 1.100.0 MSVC, debug. 2a2cc6d merged onto main a1672ef (clean merge): cargo test -p xcl --lib -- --test-threads=1 mesh_ 25 passed, 0 failed (both new tests, gpu_mesh_mode_two_passes, gpu_mesh_mode_reads_memory_windows); gpu_geometry_mode_es_gs_strip passed; cargo test -p xcl --test gpu_pso_e2e 7 passed. No retail data.

AI use: Claude Code (Claude Opus 5.5) wrote the DXC bisection script, ran it and the tests, and drafted this comment; I checked the numbers before posting.

NathanTheophile bisected DXC's ms_6_6 acceptance boundary over 96 cases (1-32 float4 rows, up to 256 primitives): the formula matches exactly everywhere, not only rows 9-26. Doc-only; narrower clip/cull rows count as full rows (overestimate only).

Assisted-by: DSH (GPT-6.2 Astra)
@ryosen0

ryosen0 commented Nov 24, 2026

Copy link
Copy Markdown
Contributor Author

@NathanTheophile Thank you — a 96-case bisect that shows the formula is DXC's exact boundary (not just a safe bound) across the whole reachable range is exactly the evidence the doc line was missing. Taken: head is now 1ab9ba9, a doc-only commit widening the comment on passthrough_max_vertices to "1 to 32 float4 rows, up to 256 primitives", crediting your bisect, and noting the clip/cull caveat (narrower declared rows count as full rows here, which can only overestimate).

cargo test --release -p xcl --lib mesh_ -- --test-threads=1 on 1ab9ba9: 25 passed / 0 failed. No behaviour change, so the regression blocks in the description stand (they name 2a2cc6d; the new commit touches only the comment — I'll refresh the head block if the checks ask for it).

@iggyvilla Thanks for the RDNA2 wave64 report — and for pinning the 3 failures as pre-existing on that card (placed_title_textures_share_vram_and_preserve_pixels #470 plus the two PoisonError cascades fixed by #673), with the isolated rerun clean. The two wave64 GPU tests passing natively on gfx1032, and the split-producer check at XCL_SPLIT_WAVE64=1, are coverage this machine can't produce.

AI use: GPT-6.2 Astra (API model selector) in DSH made the doc edit, ran the tests, and drafted this comment; the human contributor reviewed before posting.

gustavsi added a commit to gustavsi/xcl that referenced this pull request Nov 24, 2026
…dget

Combines the 32-vertex chunk mesh output budget (upstream PR xcl-dev#304) with console-numbered MS subobject handling (upstream PR xcl-dev#630):
- emit.rs: account for DXC's 32-vertex chunk sizing in passthrough_max_vertices and select single vs split pass-through layout by vertex budget.
- real.rs: treat a console MS container at subobject 24 (with no PC MS at 25) as the stream's MS, rewrite subobject 24 to 25 in fallback_stream with the stand-in MS, and defer compilation via pso_async::lazy().

Verified on Linux (GE-Proton11-14, RX 9060 XT): 7/7 targeted tests pass (including gpu_mesh_mode_two_passes and console_ms_stream_tests); a retail title 75 s run shows 0 AS-slot refusals, translation_errors=[], 937/937 frames at 30.0 FPS.
@raylitebull
raylitebull merged commit e7ca4ea into xcl-dev:main Nov 25, 2026
2 of 3 checks passed
@Curry-976

Copy link
Copy Markdown

Test report for this PR's head 1ab9ba97620257bbeb54d307b8b98fc2f4943b3c. The repository's git transport refused fetches today, so I rebuilt the four commits from the API diffs and metadata; the rebuilt head has the same SHA. I also ran smoke runs against its parent on main, 9ce2070eccf436d7bd38601c90407da447df34f3, back to back.

Tested

  • NVIDIA GeForce RTX 4050 Laptop GPU (driver 32.0.16.1742, 32-lane waves), Intel Core i5-12450HX, 24 GB RAM, Windows 11 26300, Rust 1.100.0 stable-x86_64-pc-windows-msvc, release, DXC 1.9.2602.17 (Windows SDK 10.0.26100).
  • main 67a3735 (a descendant of 9ce2070 that does not touch passthrough_split): xcl shaders <title>/shaders.rpf --precompile reports errors 19. All 19 are ms_6_6 pass-throughs (MS_VS_TransformLit/TransformD/TransformSkin*/MirrorReflection*_Wrapped), each one "vertex plus primitive output size is greater than 32768". The first one declares verts[78] at 22 float4 rows.
  • This head, with an empty XCL_DXIL_CACHE: --precompile --only ms gives compiled 8968, already cached 9596, errors 0 (1589 s).
  • scripts/smoke.ps1 -Game <retail title folder> -Seconds 60. Each run had its own empty XCL_DXIL_CACHE. The base ran first, then the PR:

main (9ce2070, this PR's parent):

xcl-smoke v1
commit: 9ce2070eccf436d7bd38601c90407da447df34f3
gpu: NVIDIA GeForce RTX 4050 Laptop GPU
title: mon jeu
seconds: 60
exit: 0x0
frames shown: 454 (PresentX 454)
presents per 2 s (last 3): 14 15 14
device removals: 0
crashes: 0
peak commit: 15447 MB

PR:

xcl-smoke v1
commit: 1ab9ba97620257bbeb54d307b8b98fc2f4943b3c
gpu: NVIDIA GeForce RTX 4050 Laptop GPU
title: mon jeu
seconds: 60
exit: 0x0
frames shown: 469 (PresentX 469)
presents per 2 s (last 3): 13 13 13
device removals: 0
crashes: 0
peak commit: 15519 MB

The PR reaches 103.3 % of the base's frames and 100.5 % of its peak commit, with no device removal and no crash. These are one run each, and the frame rate on this laptop varies from run to run.

Not tested

  • The precompile on 9ce2070 itself: I stopped it for time. The 19 errors above come from 67a3735.
  • The test suite on this head.
  • Gameplay with the transform programs in use: the 60 s runs do not reach them.
  • AMD GPUs.

AI use

  • Claude Code (Claude Opus 5.5) ran the commands above on this machine and wrote this report.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.