Recompiler: the mesh pass-through budget accounts DXC’s vertex chunks #304
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
goal:world-load
good first issue
help wanted
invalid
keep-open
off-goal
question
stale
test-only
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/xcl-dev--xcl!304
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/304/head"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@ryosen0 on GitHub · 2026-11-23 22:50 UTC · original
ryosen0:mesh-split-chunks→main· +125 −6 · 2 files · 4 commits · merged 2026-11-25 01:00 UTCA retail title's NGG transform programs (128 vertices / 128 primitives, 21 params +
SV_ClipDistance0= 352 B per vertex) all failms_6_6with "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_splitdivides 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.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
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 ignoredgpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardware(no wave64)xcl shaders <title> --precompile --only mson 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
gpu_mesh_mode_two_passeson 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 ofverts[80](accounted as 96 = 33792 B, refused by DXC). New testmesh_layout_independent_of_group_countpins the asymmetric case;mesh_split_accounts_vertex_chunksunchanged. Rebased onto9ce2070.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_countnow compiles the whole-record declaration (verts[80], accounted as 96) and asserts DXC refuses it, instead of rebuilding the same interface and assertingverts[3]again;passthrough_split's doc no longer claims a comparison of the two forms it does not make. Full suite on2a2cc6d: 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'sverts[80]refused before dispatch).Regression run
Main
1c87b1d(current main):Head
1ab9ba9: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 on GitHub · 2026-11-23 23:00 UTC · original
Tested
8c7413cmerged ontomain0e946cf(clean merge) on AMD RDNA4: pass, and the new test fails without the fix.Tested
.\scripts\test.ps1: 652 passed, 0 failed, 40 ignored; noSKIPPEDGPU tests on this adapter.XCL_REQUIRE_GPU=wave64,mesh cargo test -p xcl --lib mesh_: 24 passed, 0 failed, includingmesh_split_accounts_vertex_chunks,gpu_mesh_mode_two_passesandgpu_mesh_mode_reads_memory_windows.tests.rsonmain4017f8f(theemit.rschange left out):mesh_split_accounts_vertex_chunksfails at the first split check (left: 5, right: 7), so the test catches the old budget.Not tested
XCL_SAMPLE_*set and no retail title, so nosmoke.ps1regression run and nothing on a real NGG program; NVIDIA and GPUs without mesh shaders.AI use
@likecrank-dotcom on GitHub · 2026-11-23 23:04 UTC · original
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
cargo build --workspace: exit 0, existingfetch_updatedeprecation 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_chunkspassed, including all three DXC compilations (wide 352-byte records, the 320-byte case, and the narrow control).main@0e946cfc68244edee1fba6e0425371f687a05ccd, runtime unchanged;cargo test -p xcl --lib mesh_split_accounts_vertex_chunks -- --nocapture --test-threads=1exits 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_maskandgpu_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 on GitHub · 2026-11-23 23:09 UTC · original
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: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 on GitHub · 2026-11-23 23:15 UTC · original
Tested
8c7413con 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 ignoredSKIPPED(no wave64):gpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardwaregpu::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)main4017f8fon the same machine, same command: 650 passed, 0 failed, 40 ignored, same 2 SKIPPED. The PR's base is9ab7d76;mainhas one more test since, so the same count includes this PR's new test.main4017f8f(git merge-tree), the merge result was not tested.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
AI use: Claude Code with Claude Opus 5.5 (ran the tests and wrote this report).
@PHeitor1 on GitHub · 2026-11-24 00:13 UTC · original
Tested
8c7413cmerged ontomain3516080.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, noXCL_SAMPLE_*.Pass: 671 passed, 0 failed, 41 ignored. SKIPPED: only the 2
no wave64tests (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).
@ryosen0 on GitHub · 2026-11-24 02:22 UTC · original
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 testmesh_layout_independent_of_group_count: 80 vertices / 1 triangle / 22 float4 rows → compactverts[3]declared, count 1, DXC accepts (the old code declaredverts[80], accounted as 96 = 33792 B, refused).mesh_split_accounts_vertex_chunksstill 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.
@Parakeet-Wheat on GitHub · 2026-11-24 03:04 UTC · original · edited 2026-11-24 03:06 UTC
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 used8c7413cand DXC 1.9. Pass, plus two small notes.Tested
x86_64-pc-windows-msvc); DXC 1.8.2502 from Windows SDK 10.0.26100xcl shaders <the retail title's shaders.rpf> --precompile --only ms, release builds, same DXIL cache for both runs:maindd2ae9a: compiled 0, already cached 18545, errors 19 (MS_VS_TransformLit_*,MS_VS_TransformD_*,MS(R)_VS_TransformSkinD_*,MS_VS_MirrorReflection*; 3 distinct HLSL sources, alldxc: error: validation errors)b884f3c: compiled 6, already cached 18558, errors 0.\scripts\test.ps1atb884f3c(debug, clean tree): 686 passed, 0 failed, 41 ignored, exit 0;mesh_split_accounts_vertex_chunksandmesh_layout_independent_of_group_countboth ran and passedgpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardware(no wave64)Notes
mesh_layout_independent_of_group_count: the last block buildsMsInterface { max_vertices: 80, max_primitives: 1, ..ms.clone() }, which is the samemsas above, and assertsverts[3]again. The comment says it shows "the whole-record form is what DXC refuses", but nothing there compiles averts[80]declaration or checks a refusal. It could be dropped, or changed to compile the old whole-record HLSL and assert DXC refuses it.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
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 on GitHub · 2026-11-24 03:18 UTC · original
Tested
b884f3c001bec54273719539f2c3deef49676b78and its parentd3bd51d9172f3b61cbe2a5b2fd3871e946242830, each with the same scratch-only test incrates/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, allXCL_SAMPLE_*variables unset.cargo test -p xcl --lib --locked -j 4 --no-run --message-format=json, then ran the resulting executable withgpu::recomp::tests::gpu_mesh_compact_layout_in_one_group --exact --test-threads=1 --nocapture.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.verts[80], and DXC rejected that output withvertex plus primitive output size is greater than 32768before dispatch. The focused control changes only the selected revision and uses its own shader generator.Not tested
AI use
@ryosen0 on GitHub · 2026-11-24 03:42 UTC · original
Thanks — both nits fixed in
2a2cc6d(tests + one doc line, no behaviour change):mesh_layout_independent_of_group_countnow 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.
@iggyvilla on GitHub · 2026-11-24 05:30 UTC · original
Test report for
b884f3c001bec54273719539f2c3deef49676b78on AMD RDNA2 (native wave64). Note:2a2cc6d(tests + doc line, no behaviour change) was pushed after these runs finished; all results below are fromb884f3c(merge base9ce2070eccf436d7bd38601c90407da447df34f3), clean detached worktrees.Tested
stable-x86_64-pc-windows-msvc; DXCdxcompiler 1.8.2502.11 / dxil 1.8.2502.11(Windows SDK 10.0.26100).--test-threads=1 --nocapture):mesh_split_accounts_vertex_chunksandmesh_layout_independent_of_group_countboth pass (1/1 each) with DXC 1.8.2502.11.cargo build --workspacethencargo test --workspace --no-fail-fast -- --test-threads=4, debug;e2ererun after building the test title): 683 passed, 3 failed, 41 ignored, 0 SKIPPED (both wave64 testsgpu_geometry_wave32_prefix_count_over_a_maskandgpu_wave32_program_in_wave64_hardwareran and passed;gpu_mesh_mode_two_passes,gpu_mesh_mode_reads_memory_windows, andmesh_split_wave64_formalso passed).placed_title_textures_share_vram_and_preserve_pixels(#470, fails alone too) and twoPoisonErrorcascades (d32s8_targets_take_their_own_size_of_video_memory,transitions_apply_when_their_list_is_submitted, fixed by #673). Isolated lib rerun--skip placed_title_textures_share_vram_and_preserve_pixelsat--test-threads=1: 645 passed, 0 failed, 21 ignored.XCL_SPLIT_WAVE64=1):cargo test -p xcl --lib mesh_ -- --test-threads=1(25 passed, 0 failed) andgpu_split_wave64(5 passed, 0 failed).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), includingMS_VS_TransformLit_c22269ee,MS_VS_TransformSkinD_DetailMapsOff_34f92402,MSNC_VS_TransformSkinD_*,MS_VS_MirrorReflectionTransformD_f0a15084, andMSNC_VS_MirrorReflectionTransformSkinD_*(the 352 B / 128-vertex shapes).scripts/smoke.ps1,XCL_NETWORK=0, release builds, clean trees, warm DXIL cache):Base
9ce2070:Head
b884f3c:Both exit
0x0, 0 device removals, 0 crashes, 0ms_6_6/vertex plus primitive output size/ driver-rejection errors;report.jsonon head hastranslated_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
2a2cc6d(tests + doc line).xcl shaders ... --precompile --only ms(DXC-only; already reproduced 19→0 on DXC 1.8.2502 above) andXCL_MS_EVERY=1over all MS programs.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.@NathanTheophile on GitHub · 2026-11-24 07:50 UTC · original
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_6accepts 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 (uint3indices). That makes 96 cases, andfloor(min(256, 32768 / stride) / 32) * 32gives 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 ofpassthrough_max_verticescan 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.
2a2cc6dmerged ontomaina1672ef(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_strippassed;cargo test -p xcl --test gpu_pso_e2e7 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.
@ryosen0 on GitHub · 2026-11-24 07:55 UTC · original
@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 onpassthrough_max_verticesto "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=1on1ab9ba9: 25 passed / 0 failed. No behaviour change, so the regression blocks in the description stand (they name2a2cc6d; 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 twoPoisonErrorcascades fixed by #673), with the isolated rerun clean. The two wave64 GPU tests passing natively on gfx1032, and the split-producer check atXCL_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.
@Curry-976 on GitHub · 2026-11-25 05:01 UTC · original
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 onmain,9ce2070eccf436d7bd38601c90407da447df34f3, back to back.Tested
stable-x86_64-pc-windows-msvc, release, DXC 1.9.2602.17 (Windows SDK 10.0.26100).main67a3735(a descendant of9ce2070that does not touchpassthrough_split):xcl shaders <title>/shaders.rpf --precompilereportserrors 19. All 19 arems_6_6pass-throughs (MS_VS_TransformLit/TransformD/TransformSkin*/MirrorReflection*_Wrapped), each one "vertex plus primitive output size is greater than 32768". The first one declaresverts[78]at 22 float4 rows.XCL_DXIL_CACHE:--precompile --only msgivescompiled 8968, already cached 9596, errors 0(1589 s).scripts/smoke.ps1 -Game <retail title folder> -Seconds 60. Each run had its own emptyXCL_DXIL_CACHE. The base ran first, then the PR:main (
9ce2070, this PR's parent):PR:
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
9ce2070itself: I stopped it for time. The 19 errors above come from67a3735.AI use
@shdann on GitHub · 2026-11-24 00:51 UTC · original · reviewed
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 declaresverts[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 at8c7413cwith OpenAI Codex (GPT-6).