D3D12.X: draw eligible console mesh programs as native mesh shaders behind XCL_NATIVE_MESH #3327

Open
KDenKC wants to merge 3 commits from upstream-pr/3327 into main
KDenKC commented 2026-11-29 08:29:21 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by KDenKC on 2026-11-29T08:29:21Z.


Part of C4 in #3011. In our RTX 5090 measurements, two-pass mesh work took about 40–48% of GPU frame time. This adds an experimental native mesh path that avoids the separate NGG compute pass, record buffer and inter-pass barrier for eligible draws. Enable it with XCL_NATIVE_MESH=1. The default is off.

Rebased onto main 078358a0; the head is now d10821a3 (was 1e65e6a2). The three commits applied without conflicts; the first and the third are unchanged (same patch-ids as 511d4d01 and 1e65e6a2), the second carries the same real.rs resolution as before (translated_mesh_stream_once reads the render-target formats from stream_rt_formats; this PR keeps only let state_start = out.0.len(); there).

A native wave64 translator from Kalmarv will follow as a PR stacked on this one.

What is in it

  • b9365b46 (was 511d4d01) adds the native entry in gpu/recomp/native_mesh.rs and emit.rs. It reuses XCL's instruction lowering for a single 32-lane hardware wave with lane-owned triangle vertices and primitives, supported exports and bounded output. gpu/recomp/pso.rs compiles the candidate. The GPU fixture in gpu/recomp/tests.rs compares native and two-pass pixels.
  • e1c7bf4f (was 39a39796) adds the optional native PSO in hle/d3d12x/real.rs. D3D12 must accept the mesh and pixel signatures together. Unsupported programs and rejected native PSOs fall back to the existing two-pass PSO.
  • hle/d3d12x/bind.rs records one native DispatchMesh for an eligible direct draw. Eligible plain mesh ExecuteIndirect keeps the existing GPU bounds pass and forwards the title's original count buffer to the native call. This slice changes the HLSL translator source identity, so affected HLSL cache entries rebuild once.

Tested

At the head d10821a3 (on main 078358a0), RTX 5090 32 GB, driver 621.40, Ryzen 7 9800X3D, Windows 11 Pro build 26200.9974, Rust 1.99.1, debug:

  • cargo build --workspace: passed.
  • cargo test -p xcl --lib native_mesh: 3 passed, 0 failed, 0 skipped (gpu_native_mesh_matches_two_pass, gpu_native_mesh_indirect_preserves_legal_dimensions, native_mesh_output_budget_includes_alignment_and_row_limit).
  • cargo test --workspace --no-fail-fast -- --test-threads=4: 3007 passed, 2 failed, 52 ignored. SKIPPED: 25 (22 no wave64, 2 no heap windows, 1 cannot disable the driver cache). The 2 failures are uma_driver::tests::a_refused_gpu_upload_segment_becomes_custom and uma_driver::tests::mixed_window_keeps_its_bytes_and_the_gpu_sees_every_segment; rerun alone (cargo test -p xcl --lib uma_driver::tests:: -- --test-threads=1) all 8 uma_driver tests pass, on this head and on main 078358a0 alike. During part of the 4-thread run the same GPU was running a retail-title session.

Earlier heads:

At the rebased head 1e65e6a2, RTX 5090 32 GB, driver 621.40, Ryzen 7 9800X3D, Windows 11 Pro build 26200.9974, Rust 1.99.1, debug: cargo build --workspace passed; cargo test -p xcl --lib -- native_mesh --nocapture --test-threads=4: 3 passed, 0 failed, 0 skipped (gpu_native_mesh_matches_two_pass, gpu_native_mesh_indirect_preserves_legal_dimensions, native_mesh_output_budget_includes_alignment_and_row_limit); -- mesh: 60 passed, 0 failed.

At 1e65e6a2 on the RTX 3090 VM (NVIDIA 621.24, Intel Core i7-10700T, Windows 11 build 26300.9974, Rust 1.99.1, debug), against main 6bfb5c51 on the same machine: cargo test --workspace --no-fail-fast -- --test-threads=4: 2894 passed, 5 failed, 51 ignored (main: 2891 passed, 5 failed, 51 ignored; the 3 more are this PR's native_mesh tests). The same 5 failures on both, main's own: title_textures::tests::placed_title_textures_share_vram_and_preserve_pixels, the 3 stream_recheck_* tests, e2e test_title_runs_and_game_folder_is_untouched. SKIPPED: 11 on both (7 no wave64, 3 no debug layer, 1 no heap windows). On both commits the lib binary died with an access violation in the 4-thread run, and its counts are from the runner's 1-thread rerun of it; the run leaves out the 3 uma_driver coherent-window remake tests, as above.

Before the rebase:

RTX 3090 VM, NVIDIA 621.24, Intel Core i7-10700T, Windows 11 build 26300.9974, Rust 1.99.1, DXC 1.9.2602.17. Tested at bf7f7e8296760f08b7387ab406f1b60814e1db2a, then the follow-up below at 427330b54638ce7eb7ee14e3b577087a4af4d6e9.

  • cargo build --workspace passed in debug.
  • cargo test -p xcl --lib --no-run and cargo test -p xcl --lib --release --no-run passed.
  • cargo test -p xcl --lib -- native_mesh --nocapture --test-threads=1 passed 2/2, with 0 skipped. The eligible triangle produced identical pixels on the native and two-pass paths. The ineligible fixture was rejected by the native entry and drew the same pixels through two passes.
  • cargo test --workspace --no-fail-fast -- --test-threads=4 at 427330b5: 2603 passed, 5 failed, 49 ignored. SKIPPED: 30 (21 no wave64, 3 refused f16/f32 per-lane forms, 3 no debug layer, 2 no heap windows, 1 driver cache cannot be disabled). The run leaves out the 3 uma_driver coherent-window remake tests that kill the lib binary on 621.x. The 5 failures are main's own (they fail on main fa204595 on this machine): title_textures::tests::placed_title_textures_share_vram_and_preserve_pixels, the 3 stream_recheck_* tests, e2e test_title_runs_and_game_folder_is_untouched.

Regression run

Pending for the head d10821a3: the pair needs a rig run on the RTX 5090 and follows here. The blocks below are from 427330b5, two rebases ago, and show the default path (native mesh off) unchanged then.

RTX 5090 32 GB, driver 621.24, Ryzen 7 9800X3D, the retail title, 200 s each, scripts/smoke.ps1 with preparation on (-Prep), normal priority and default worker counts, XCL_NATIVE_MESH unset (the native path off, as by default) in both runs. Both runs started from a copy of the same cache (made by an earlier run of main fa204595) and used this machine's usual settings (XCL_UMA_WINDOWS=16, XCL_UMA_DRIVER=mixed:1536:1792, XCL_COHERENT_MB=4095, XCL_DIRECT_DXIL=1, XCL_HEAP_WINDOWS=1, XCL_HUGE_PSO_CONCURRENCY=3). So this pair shows the default path unchanged, not the native path.

main fa204595:

xcl-smoke v1
commit: fa204595a488c60c6c5f905244f0172072c9c2a9
gpu: NVIDIA GeForce RTX 5090
title: 9cc6a39e
seconds: 200
exit: 0x0
frames shown: 2258 (PresentX 2258)
presents per 2 s (last 3): 0 0 0
device removals: 0
crashes: 0
peak commit: 34835 MB

this head 427330b5:

xcl-smoke v1
commit: 427330b54638ce7eb7ee14e3b577087a4af4d6e9
gpu: NVIDIA GeForce RTX 5090
title: 9cc6a39e
seconds: 200
exit: 0x0
frames shown: 2187 (PresentX 2187)
presents per 2 s (last 3): 0 0 0
device removals: 0
crashes: 0
peak commit: 35964 MB
  • 1e65e6a2 (was 427330b5), the follow-up after review (triangle-index budget in the output check, legal multidimensional counts above 65,535 groups kept, rejected arguments reported through the existing feedback, native draws in the timing and watch logs): RTX 3090 VM, debug workspace build, cargo test -p xcl --lib --no-run debug and release, -- native_mesh: 3 passed, 0 failed, 0 skipped.

Not tested

With XCL_NATIVE_MESH=1 and Kalmarv's wave64 translator (#3656) on top, which makes the retail title's mesh programs eligible, the device is removed in the native ExecuteIndirect path (bind.rs: the argument-rewrite pass, then the native mesh stage and the PC ExecuteIndirect), three runs out of three; our report with the DRED lines: https://github.com/xcl-dev/xcl/pull/3656#issuecomment-7363569473. On this PR alone no program of the title is eligible (below), so nothing reaches that path, and the default (off) is unaffected.

No mesh program of the retail title is eligible yet: on an RTX 4090 all 171 that reached the preflight are wave64 groups of 128 threads with 128 vertices and 128 primitives (https://github.com/xcl-dev/xcl/pull/3327#issuecomment-7255841480), and this slice takes one wave32 with one vertex and primitive per lane. So in the title it changes nothing even when switched on; the next slice (128-thread native groups) is needed for that. Also not tested: runtime indirect count handling, AMD, Intel, wave64/C2 interplay.

AI use

  • Claude Code (Claude Opus 5.5, Claude Sonnet 5.5), Codex (GPT-6.2-Sol), Antigravity (Gemini 4 Neon, Gemini 4 Hydrogen): an agent swarm wrote, tested, reviewed and described this change.

Generated with Claude Code

https://claude.ai/code/session_013oPUFCA9W9F8Qb5MPK33bR

<!-- greyfinch-sync:ivall/xcl:issue:5549019117 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3327). Originally posted by [KDenKC](https://github.com/KDenKC) on 2026-11-29T08:29:21Z. --- Part of C4 in #3011. In our RTX 5090 measurements, two-pass mesh work took about 40–48% of GPU frame time. This adds an experimental native mesh path that avoids the separate NGG compute pass, record buffer and inter-pass barrier for eligible draws. Enable it with `XCL_NATIVE_MESH=1`. The default is off. Rebased onto `main` `078358a0`; the head is now `d10821a3` (was `1e65e6a2`). The three commits applied without conflicts; the first and the third are unchanged (same patch-ids as `511d4d01` and `1e65e6a2`), the second carries the same `real.rs` resolution as before (`translated_mesh_stream_once` reads the render-target formats from `stream_rt_formats`; this PR keeps only `let state_start = out.0.len();` there). A native wave64 translator from Kalmarv will follow as a PR stacked on this one. **What is in it** - `b9365b46` (was `511d4d01`) adds the native entry in `gpu/recomp/native_mesh.rs` and `emit.rs`. It reuses XCL's instruction lowering for a single 32-lane hardware wave with lane-owned triangle vertices and primitives, supported exports and bounded output. `gpu/recomp/pso.rs` compiles the candidate. The GPU fixture in `gpu/recomp/tests.rs` compares native and two-pass pixels. - `e1c7bf4f` (was `39a39796`) adds the optional native PSO in `hle/d3d12x/real.rs`. D3D12 must accept the mesh and pixel signatures together. Unsupported programs and rejected native PSOs fall back to the existing two-pass PSO. - `hle/d3d12x/bind.rs` records one native `DispatchMesh` for an eligible direct draw. Eligible plain mesh `ExecuteIndirect` keeps the existing GPU bounds pass and forwards the title's original count buffer to the native call. This slice changes the HLSL translator source identity, so affected HLSL cache entries rebuild once. **Tested** At the head `d10821a3` (on `main` `078358a0`), RTX 5090 32 GB, driver 621.40, Ryzen 7 9800X3D, Windows 11 Pro build 26200.9974, Rust 1.99.1, debug: - `cargo build --workspace`: passed. - `cargo test -p xcl --lib native_mesh`: 3 passed, 0 failed, 0 skipped (`gpu_native_mesh_matches_two_pass`, `gpu_native_mesh_indirect_preserves_legal_dimensions`, `native_mesh_output_budget_includes_alignment_and_row_limit`). - `cargo test --workspace --no-fail-fast -- --test-threads=4`: 3007 passed, 2 failed, 52 ignored. SKIPPED: 25 (22 no wave64, 2 no heap windows, 1 cannot disable the driver cache). The 2 failures are `uma_driver::tests::a_refused_gpu_upload_segment_becomes_custom` and `uma_driver::tests::mixed_window_keeps_its_bytes_and_the_gpu_sees_every_segment`; rerun alone (`cargo test -p xcl --lib uma_driver::tests:: -- --test-threads=1`) all 8 `uma_driver` tests pass, on this head and on `main` `078358a0` alike. During part of the 4-thread run the same GPU was running a retail-title session. Earlier heads: At the rebased head `1e65e6a2`, RTX 5090 32 GB, driver 621.40, Ryzen 7 9800X3D, Windows 11 Pro build 26200.9974, Rust 1.99.1, debug: `cargo build --workspace` passed; `cargo test -p xcl --lib -- native_mesh --nocapture --test-threads=4`: 3 passed, 0 failed, 0 skipped (`gpu_native_mesh_matches_two_pass`, `gpu_native_mesh_indirect_preserves_legal_dimensions`, `native_mesh_output_budget_includes_alignment_and_row_limit`); `-- mesh`: 60 passed, 0 failed. At `1e65e6a2` on the RTX 3090 VM (NVIDIA 621.24, Intel Core i7-10700T, Windows 11 build 26300.9974, Rust 1.99.1, debug), against `main` `6bfb5c51` on the same machine: `cargo test --workspace --no-fail-fast -- --test-threads=4`: 2894 passed, 5 failed, 51 ignored (`main`: 2891 passed, 5 failed, 51 ignored; the 3 more are this PR's `native_mesh` tests). The same 5 failures on both, `main`'s own: `title_textures::tests::placed_title_textures_share_vram_and_preserve_pixels`, the 3 `stream_recheck_*` tests, e2e `test_title_runs_and_game_folder_is_untouched`. SKIPPED: 11 on both (7 no wave64, 3 no debug layer, 1 no heap windows). On both commits the lib binary died with an access violation in the 4-thread run, and its counts are from the runner's 1-thread rerun of it; the run leaves out the 3 `uma_driver` coherent-window remake tests, as above. Before the rebase: RTX 3090 VM, NVIDIA 621.24, Intel Core i7-10700T, Windows 11 build 26300.9974, Rust 1.99.1, DXC 1.9.2602.17. Tested at `bf7f7e8296760f08b7387ab406f1b60814e1db2a`, then the follow-up below at `427330b54638ce7eb7ee14e3b577087a4af4d6e9`. - `cargo build --workspace` passed in debug. - `cargo test -p xcl --lib --no-run` and `cargo test -p xcl --lib --release --no-run` passed. - `cargo test -p xcl --lib -- native_mesh --nocapture --test-threads=1` passed 2/2, with 0 skipped. The eligible triangle produced identical pixels on the native and two-pass paths. The ineligible fixture was rejected by the native entry and drew the same pixels through two passes. - `cargo test --workspace --no-fail-fast -- --test-threads=4` at `427330b5`: 2603 passed, 5 failed, 49 ignored. SKIPPED: 30 (21 no wave64, 3 refused f16/f32 per-lane forms, 3 no debug layer, 2 no heap windows, 1 driver cache cannot be disabled). The run leaves out the 3 `uma_driver` coherent-window remake tests that kill the lib binary on 621.x. The 5 failures are main's own (they fail on main `fa204595` on this machine): `title_textures::tests::placed_title_textures_share_vram_and_preserve_pixels`, the 3 `stream_recheck_*` tests, e2e `test_title_runs_and_game_folder_is_untouched`. **Regression run** Pending for the head `d10821a3`: the pair needs a rig run on the RTX 5090 and follows here. The blocks below are from `427330b5`, two rebases ago, and show the default path (native mesh off) unchanged then. RTX 5090 32 GB, driver 621.24, Ryzen 7 9800X3D, the retail title, 200 s each, `scripts/smoke.ps1` with preparation on (`-Prep`), normal priority and default worker counts, `XCL_NATIVE_MESH` unset (the native path off, as by default) in both runs. Both runs started from a copy of the same cache (made by an earlier run of `main` `fa204595`) and used this machine's usual settings (`XCL_UMA_WINDOWS=16`, `XCL_UMA_DRIVER=mixed:1536:1792`, `XCL_COHERENT_MB=4095`, `XCL_DIRECT_DXIL=1`, `XCL_HEAP_WINDOWS=1`, `XCL_HUGE_PSO_CONCURRENCY=3`). So this pair shows the default path unchanged, not the native path. main `fa204595`: ``` xcl-smoke v1 commit: fa204595a488c60c6c5f905244f0172072c9c2a9 gpu: NVIDIA GeForce RTX 5090 title: 9cc6a39e seconds: 200 exit: 0x0 frames shown: 2258 (PresentX 2258) presents per 2 s (last 3): 0 0 0 device removals: 0 crashes: 0 peak commit: 34835 MB ``` this head `427330b5`: ``` xcl-smoke v1 commit: 427330b54638ce7eb7ee14e3b577087a4af4d6e9 gpu: NVIDIA GeForce RTX 5090 title: 9cc6a39e seconds: 200 exit: 0x0 frames shown: 2187 (PresentX 2187) presents per 2 s (last 3): 0 0 0 device removals: 0 crashes: 0 peak commit: 35964 MB ``` - `1e65e6a2` (was `427330b5`), the follow-up after review (triangle-index budget in the output check, legal multidimensional counts above 65,535 groups kept, rejected arguments reported through the existing feedback, native draws in the timing and watch logs): RTX 3090 VM, debug workspace build, `cargo test -p xcl --lib --no-run` debug and release, `-- native_mesh`: 3 passed, 0 failed, 0 skipped. **Not tested** With `XCL_NATIVE_MESH=1` and Kalmarv's wave64 translator (#3656) on top, which makes the retail title's mesh programs eligible, the device is removed in the native `ExecuteIndirect` path (`bind.rs`: the argument-rewrite pass, then the native mesh stage and the PC `ExecuteIndirect`), three runs out of three; our report with the DRED lines: https://github.com/xcl-dev/xcl/pull/3656#issuecomment-7363569473. On this PR alone no program of the title is eligible (below), so nothing reaches that path, and the default (off) is unaffected. No mesh program of the retail title is eligible yet: on an RTX 4090 all 171 that reached the preflight are wave64 groups of 128 threads with 128 vertices and 128 primitives (https://github.com/xcl-dev/xcl/pull/3327#issuecomment-7255841480), and this slice takes one wave32 with one vertex and primitive per lane. So in the title it changes nothing even when switched on; the next slice (128-thread native groups) is needed for that. Also not tested: runtime indirect count handling, AMD, Intel, wave64/C2 interplay. **AI use** - Claude Code (Claude Opus 5.5, Claude Sonnet 5.5), Codex (GPT-6.2-Sol), Antigravity (Gemini 4 Neon, Gemini 4 Hydrogen): an agent swarm wrote, tested, reviewed and described this change. Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_013oPUFCA9W9F8Qb5MPK33bR
minimalhipster990 commented 2026-11-29 12:28:46 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by minimalhipster990 on 2026-11-29T12:28:46Z.


Retail title on RTX 4090: no mesh program passes the native preflight at 427330b5. With XCL_NATIVE_MESH=1, all 176 mesh programs the title created in a 360 s run were logged as using two passes (requires one wave32 and at most one vertex and primitive per lane). No native DispatchMesh or native ExecuteIndirect was recorded. A local diagnostic build logged the interface values behind that refusal. In that run, all 171 programs that reached the preflight were wave64, 128 threads per group, 128 max vertices and 128 max primitives, so each one fails all four conditions. The two courtyard programs from #2092 are among them: bf5a7665d0c6631a (19 parameters) and edff79282d37adb0 (18).

Applying fits_output to those interfaces at 128/128, 154 of the 171 would fit the 32 KiB output budget (14 parameters or fewer). The other 17 would not, including the two above. This is arithmetic on the logged interfaces; no larger native entry was built or tried.

Tested

  • RTX 4090, NVIDIA 621.40, Windows 11 build 26300, Rust 1.99.1, DXC 1.9.2602.17. Clean release build of 427330b54638ce7eb7ee14e3b577087a4af4d6e9 (--locked).
  • XCL_REQUIRE_GPU=mesh cargo test --release --locked -p xcl --lib -- native_mesh --nocapture --test-threads=1: 3 passed, 0 failed, 0 ignored, no SKIPPED.
  • One executable, the same save and a verified copy of the same XCL cache (4,575 files), 360 s each. XCL_NATIVE_MESH unset: 2,065 frames shown. XCL_NATIVE_MESH=1: 2,050 frames shown. Both exited 0 with no device removal. Process commit at the end was 40,668 vs 43,371 MB. Both runs ended on loading artwork, so this pair compares no world scene and no GPU frame time. With no eligible program, it only shows that the refused attempt costs no visible frame rate.
  • The diagnostic build was the same head plus one log line in the refusal branch of native_mesh::preflight, run from an empty cache. It was used only for the interface values above.

Not tested: the full workspace suite, a world scene, GPU timings, and any native draw on this title, since none was eligible.

AI use: Claude Code (Claude Opus 5.5) built both executables, ran the tests and replays, and wrote this report. The person running these tests asked for it.

<!-- greyfinch-sync:ivall/xcl:comment:7255841480 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3327#issuecomment-7255841480). Originally posted by [minimalhipster990](https://github.com/minimalhipster990) on 2026-11-29T12:28:46Z. --- **Retail title on RTX 4090: no mesh program passes the native preflight at `427330b5`.** With `XCL_NATIVE_MESH=1`, all 176 mesh programs the title created in a 360 s run were logged as `using two passes (requires one wave32 and at most one vertex and primitive per lane)`. No native `DispatchMesh` or native `ExecuteIndirect` was recorded. A local diagnostic build logged the interface values behind that refusal. In that run, all 171 programs that reached the preflight were **wave64, 128 threads per group, 128 max vertices and 128 max primitives**, so each one fails all four conditions. The two courtyard programs from #2092 are among them: `bf5a7665d0c6631a` (19 parameters) and `edff79282d37adb0` (18). Applying `fits_output` to those interfaces at 128/128, 154 of the 171 would fit the 32 KiB output budget (14 parameters or fewer). The other 17 would not, including the two above. This is arithmetic on the logged interfaces; no larger native entry was built or tried. **Tested** - RTX 4090, NVIDIA 621.40, Windows 11 build 26300, Rust 1.99.1, DXC 1.9.2602.17. Clean release build of `427330b54638ce7eb7ee14e3b577087a4af4d6e9` (`--locked`). - `XCL_REQUIRE_GPU=mesh cargo test --release --locked -p xcl --lib -- native_mesh --nocapture --test-threads=1`: 3 passed, 0 failed, 0 ignored, no SKIPPED. - One executable, the same save and a verified copy of the same XCL cache (4,575 files), 360 s each. `XCL_NATIVE_MESH` unset: 2,065 frames shown. `XCL_NATIVE_MESH=1`: 2,050 frames shown. Both exited 0 with no device removal. Process commit at the end was 40,668 vs 43,371 MB. Both runs ended on loading artwork, so this pair compares no world scene and no GPU frame time. With no eligible program, it only shows that the refused attempt costs no visible frame rate. - The diagnostic build was the same head plus one log line in the refusal branch of `native_mesh::preflight`, run from an empty cache. It was used only for the interface values above. **Not tested:** the full workspace suite, a world scene, GPU timings, and any native draw on this title, since none was eligible. AI use: Claude Code (Claude Opus 5.5) built both executables, ran the tests and replays, and wrote this report. The person running these tests asked for it.
KDenKC commented 2026-11-29 12:31:02 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by KDenKC on 2026-11-29T12:31:02Z.


@minimalhipster990 thank you, this is exactly the number we did not have (our own Not tested listed "the number of eligible programs in the title"). So as it stands this PR draws no mesh program of the retail title natively: the preflight takes one wave32 with one vertex and primitive per lane, and the title's programs are wave64 groups of 128 threads with 128 vertices and 128 primitives. Those still fit D3D12's mesh limits (128 threads, 256 vertices / primitives), so the next slice is a native group of 128 threads that runs each console wave64 as two hardware waves, the way the two-pass path already splits them, plus the 32 KiB output check at 128/128 (your 154 of 171 that fit).

I'm moving this back to draft and will say in the description what it covers today (the entry and draw path, tested on our fixtures) and what it does not (any retail program). The 17 that do not fit the output budget stay on two passes either way.

AI use: an agent swarm: Claude Opus 5.5, Claude Sonnet 5.5, GPT-6.2-Sol, Gemini 4 Neon and Gemini 3.8 Flash.

<!-- greyfinch-sync:ivall/xcl:comment:7255868703 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3327#issuecomment-7255868703). Originally posted by [KDenKC](https://github.com/KDenKC) on 2026-11-29T12:31:02Z. --- @minimalhipster990 thank you, this is exactly the number we did not have (our own Not tested listed "the number of eligible programs in the title"). So as it stands this PR draws no mesh program of the retail title natively: the preflight takes one wave32 with one vertex and primitive per lane, and the title's programs are wave64 groups of 128 threads with 128 vertices and 128 primitives. Those still fit D3D12's mesh limits (128 threads, 256 vertices / primitives), so the next slice is a native group of 128 threads that runs each console wave64 as two hardware waves, the way the two-pass path already splits them, plus the 32 KiB output check at 128/128 (your 154 of 171 that fit). I'm moving this back to draft and will say in the description what it covers today (the entry and draw path, tested on our fixtures) and what it does not (any retail program). The 17 that do not fit the output budget stay on two passes either way. AI use: an agent swarm: Claude Opus 5.5, Claude Sonnet 5.5, GPT-6.2-Sol, Gemini 4 Neon and Gemini 3.8 Flash.
Aniseto commented 2026-11-29 13:19:02 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Aniseto on 2026-11-29T13:19:02Z.


Ran the native mesh shader tests at 427330b5 on an NVIDIA Blackwell desktop part.

System

  • GPU: NVIDIA GeForce RTX 5070 Ti (Blackwell, 32-lane waves only, mesh shaders), driver 32.0.16.2140 (621.40)
  • CPU: Intel Core i5-12400F, 64 GB RAM
  • OS: Windows 11 Pro build 26200 x64
  • Toolchain: rustc 1.100.0 (0ef1bc386 2026-11-09), MSVC 14.44.35207, DXC 1.9.2609.5
  • Build: debug

Results

  • XCL_ADAPTER=NVIDIA cargo test -p xcl --lib native_mesh -- --test-threads=1: 3 passed, 0 failed, 0 ignored. No SKIPPED line in this run.

What this adds
All three native-mesh tests pass on a real 32-lane NVIDIA part: the eligible triangle produces the same pixels through the native and two-pass paths, and the ineligible program is rejected by the native entry and still draws through two passes. The author tested on an RTX 3090 and reports that no retail mesh program is eligible yet; this adds a Blackwell datapoint for the synthetic fixtures, not a title speed-up claim.

Not tested
A retail title, a paired smoke run, the full workspace suite, AMD and Intel GPUs, native wave64 hosts, Wine, release profile, game data.

AI-assisted (OpenCode), model: DeepSeek V4.1 Flash Free - ran the commands above on this machine and wrote this report; no game data was used.

<!-- greyfinch-sync:ivall/xcl:comment:7256447927 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3327#issuecomment-7256447927). Originally posted by [Aniseto](https://github.com/Aniseto) on 2026-11-29T13:19:02Z. --- Ran the native mesh shader tests at `427330b5` on an NVIDIA Blackwell desktop part. **System** - GPU: NVIDIA GeForce RTX 5070 Ti (Blackwell, 32-lane waves only, mesh shaders), driver 32.0.16.2140 (621.40) - CPU: Intel Core i5-12400F, 64 GB RAM - OS: Windows 11 Pro build 26200 x64 - Toolchain: rustc 1.100.0 (0ef1bc386 2026-11-09), MSVC 14.44.35207, DXC 1.9.2609.5 - Build: debug **Results** - `XCL_ADAPTER=NVIDIA cargo test -p xcl --lib native_mesh -- --test-threads=1`: 3 passed, 0 failed, 0 ignored. No SKIPPED line in this run. **What this adds** All three native-mesh tests pass on a real 32-lane NVIDIA part: the eligible triangle produces the same pixels through the native and two-pass paths, and the ineligible program is rejected by the native entry and still draws through two passes. The author tested on an RTX 3090 and reports that no retail mesh program is eligible yet; this adds a Blackwell datapoint for the synthetic fixtures, not a title speed-up claim. **Not tested** A retail title, a paired smoke run, the full workspace suite, AMD and Intel GPUs, native wave64 hosts, Wine, release profile, game data. AI-assisted (OpenCode), model: **DeepSeek V4.1 Flash Free** - ran the commands above on this machine and wrote this report; no game data was used.
Foniass commented 2026-12-01 09:12:34 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T09:12:34Z.


Review (head 427330b5, diff read, not a merge-check; draft, conflicts with main (one trivial hunk in real.rs ~9939)):

  • Almost nothing qualifies. The preflight (native_mesh.rs ~9) needs exactly one wave32 group and refuses any program that reads v5 (~32), XCL's only per-group identity, so an eligible program can't tell its groups apart. try_native_mesh (real.rs ~9642) needs the wave range to be exactly 32, so AMD and Intel never qualify. Testers on the PR found 0 of 171-176 retail programs eligible. As it stands that's ~440 lines that change no retail program; the description should say what comes next (v5 through SV_GroupID?) for it to pay off.
  • It rebuilds every user's translated cache once. The emit.rs changes and the new TRANSLATOR_SOURCES entry change the translator's cache identity for everyone, not only the affected entries the description mentions (from reading).
  • Nit: ~26 refuses every store and atomic, not only shared memory, so its message is misleading. It errs on the safe side.

Fine: with XCL_NATIVE_MESH unset nothing changes (native stays empty; the SCALE_ARGS_HLSL edit at bind.rs ~3116 is equivalent when split != 0). The limits are right: at most 32 vertices and primitives, a 32 KiB output budget, no shared memory, and float position and parameters only. Null or out-of-range primitives become degenerate. Dispatch dimensions are checked (~3382). Only plain DispatchMesh signatures take the native path, a refused translation or pipeline keeps the two-pass path, and the GPU test compares pixels and skips on wave64 adapters. It overlaps #3350 (yours) in the HLSL mesh entry; #3504 is another approach.

AI review: Claude Code (Claude Opus 5.5), posted by Foniass without a human check of each point.

<!-- greyfinch-sync:ivall/xcl:comment:7306369125 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3327#issuecomment-7306369125). Originally posted by [Foniass](https://github.com/Foniass) on 2026-12-01T09:12:34Z. --- Review (head 427330b5, diff read, not a merge-check; draft, conflicts with main (one trivial hunk in `real.rs` ~9939)): - **Almost nothing qualifies.** The preflight (`native_mesh.rs` ~9) needs exactly one wave32 group and refuses any program that reads v5 (~32), XCL's only per-group identity, so an eligible program can't tell its groups apart. `try_native_mesh` (`real.rs` ~9642) needs the wave range to be exactly 32, so AMD and Intel never qualify. Testers on the PR found 0 of 171-176 retail programs eligible. As it stands that's ~440 lines that change no retail program; the description should say what comes next (v5 through `SV_GroupID`?) for it to pay off. - **It rebuilds every user's translated cache once.** The `emit.rs` changes and the new `TRANSLATOR_SOURCES` entry change the translator's cache identity for everyone, not only the affected entries the description mentions (from reading). - Nit: ~26 refuses every store and atomic, not only shared memory, so its message is misleading. It errs on the safe side. Fine: with `XCL_NATIVE_MESH` unset nothing changes (`native` stays empty; the `SCALE_ARGS_HLSL` edit at `bind.rs` ~3116 is equivalent when `split != 0`). The limits are right: at most 32 vertices and primitives, a 32 KiB output budget, no shared memory, and float position and parameters only. Null or out-of-range primitives become degenerate. Dispatch dimensions are checked (~3382). Only plain DispatchMesh signatures take the native path, a refused translation or pipeline keeps the two-pass path, and the GPU test compares pixels and skips on wave64 adapters. It overlaps #3350 (yours) in the HLSL mesh entry; #3504 is another approach. AI review: Claude Code (Claude Opus 5.5), posted by Foniass without a human check of each point.
Foniass commented 2026-12-01 09:49:10 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T09:49:10Z.


Triage (#1607) – head 1e65e6a

No open or merged PR emits console mesh programs as native D3D12 mesh shaders. #3350 (same author) and #2092 change the two-pass path instead. The path is opt-in (XCL_NATIVE_MESH=1) and limited to hardware that runs only wave32 (try_native_mesh). native_mesh::preflight turns down programs that store, use atomics or LDS, or use VGPR 5. Anything turned down falls back to two passes. No problems found in the diff. The PR now merges cleanly into main. Its Build and test check still fails on 1e65e6a2, in two uma_driver tests (a_refused_gpu_upload_segment_becomes_custom, mixed_window_keeps_its_bytes_and_the_gpu_sees_every_segment) in a file the PR does not touch.
Recommendation: keep open.

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

<!-- greyfinch-sync:ivall/xcl:comment:7307252148 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3327#issuecomment-7307252148). Originally posted by [Foniass](https://github.com/Foniass) on 2026-12-01T09:49:10Z. --- **Triage (#1607)** – head 1e65e6a No open or merged PR emits console mesh programs as native D3D12 mesh shaders. #3350 (same author) and #2092 change the two-pass path instead. The path is opt-in (`XCL_NATIVE_MESH=1`) and limited to hardware that runs only wave32 (`try_native_mesh`). `native_mesh::preflight` turns down programs that store, use atomics or LDS, or use VGPR 5. Anything turned down falls back to two passes. No problems found in the diff. The PR now merges cleanly into main. Its `Build and test` check still fails on 1e65e6a2, in two `uma_driver` tests (`a_refused_gpu_upload_segment_becomes_custom`, `mixed_window_keeps_its_bytes_and_the_gpu_sees_every_segment`) in a file the PR does not touch. Recommendation: keep open. AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.
Kalmarv commented 2026-12-02 03:28:44 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Kalmarv on 2026-12-02T03:28:44Z.


Hey @KDenKC and @throny — confirming the pairing plan for #3011 (C4):

  • #3327 lands the runtime/PSO/ExecuteIndirect/two-pass-fallback plumbing cleanly first (thank you @KDenKC for the rebase onto main).
  • We'll stack our direct-DXIL native Wave64 ms_6_6 translator + packed PS ISG1 / MS OSG1 narrowing (plus the Blackwell Wave64 mesh Partner::Barrier fix) directly on top of #3327 as its own follow-up PR, so both halves stay focused, reviewable, and properly credited.
  • Once that follow-up PR is up, @KDenKC will run the mesh tests + RTX 5090 in-world A/B alongside our RTX 5070 Ti verification.
<!-- greyfinch-sync:ivall/xcl:comment:7333920914 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3327#issuecomment-7333920914). Originally posted by [Kalmarv](https://github.com/Kalmarv) on 2026-12-02T03:28:44Z. --- Hey @KDenKC and @throny — confirming the pairing plan for #3011 (C4): - **#3327** lands the runtime/PSO/`ExecuteIndirect`/two-pass-fallback plumbing cleanly first (thank you @KDenKC for the rebase onto `main`). - We'll stack our **direct-DXIL native Wave64 `ms_6_6` translator + packed PS `ISG1` / MS `OSG1` narrowing** (plus the Blackwell Wave64 mesh `Partner::Barrier` fix) directly on top of #3327 as its own follow-up PR, so both halves stay focused, reviewable, and properly credited. - Once that follow-up PR is up, @KDenKC will run the mesh tests + RTX 5090 in-world A/B alongside our RTX 5070 Ti verification.
KDenKC commented 2026-12-02 03:30:04 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by KDenKC on 2026-12-02T03:30:04Z.


@Kalmarv sounds good, that's the plan on our side too. #3327 stays rebased on main (head 1e65e6a2, mesh tests 3/3 on the RTX 5090, suite on the 3090 in its description), so your follow-up has a stable base. When your PR is up we'll review it, run the mesh tests and the in-world A/B on the 5090 and post the numbers there. Your loyal testing minion is standing by.

AI use: an agent swarm: Claude Opus 5.5, Claude Sonnet 5.5, GPT-6.2-Sol, Gemini 4 Neon and Gemini 4 Hydrogen.

<!-- greyfinch-sync:ivall/xcl:comment:7333943412 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3327#issuecomment-7333943412). Originally posted by [KDenKC](https://github.com/KDenKC) on 2026-12-02T03:30:04Z. --- @Kalmarv sounds good, that's the plan on our side too. #3327 stays rebased on `main` (head `1e65e6a2`, mesh tests 3/3 on the RTX 5090, suite on the 3090 in its description), so your follow-up has a stable base. When your PR is up we'll review it, run the mesh tests and the in-world A/B on the 5090 and post the numbers there. Your loyal testing minion is standing by. AI use: an agent swarm: Claude Opus 5.5, Claude Sonnet 5.5, GPT-6.2-Sol, Gemini 4 Neon and Gemini 4 Hydrogen.
Foniass commented 2026-12-03 03:15:07 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Foniass on 2026-12-03T03:15:07Z.


Follow-up review of d10821a3, since 1e65e6a2 (code reading only, not a merge-check; draft) · no new findings

In short: Since the triage of 1e65e6a, this push only rebases onto main. The one textual change follows main's TwoPassPso construction, which now takes chain_rs.unwrap_or(rs) for compute_rs; this PR's native: Default::default() field is added there. The other two commits are identical (git range-diff). Nothing new, and nothing blocks it.

Checked and fine
  • The earlier triage found no problems in the diff, and the code is unchanged apart from that one constructor.
  • The path is still opt-in (XCL_NATIVE_MESH=1), limited to hardware that runs only wave32. Anything native_mesh::preflight turns down falls back to two passes.

Written by Claude Code (Claude Opus 5.5) and posted by Foniass without a human check of each point.

<!-- greyfinch-sync:ivall/xcl:comment:7366364534 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3327#issuecomment-7366364534). Originally posted by [Foniass](https://github.com/Foniass) on 2026-12-03T03:15:07Z. --- **Follow-up review** of `d10821a3`, since `1e65e6a2` (code reading only, not a merge-check; draft) · no new findings **In short:** Since the triage of `1e65e6a`, this push only rebases onto `main`. The one textual change follows `main`'s `TwoPassPso` construction, which now takes `chain_rs.unwrap_or(rs)` for `compute_rs`; this PR's `native: Default::default()` field is added there. The other two commits are identical (`git range-diff`). Nothing new, and nothing blocks it. <details><summary>Checked and fine</summary> - The earlier triage found no problems in the diff, and the code is unchanged apart from that one constructor. - The path is still opt-in (`XCL_NATIVE_MESH=1`), limited to hardware that runs only wave32. Anything `native_mesh::preflight` turns down falls back to two passes. </details> <sub>Written by Claude Code (Claude Opus 5.5) and posted by Foniass without a human check of each point.</sub>
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/3327:upstream-pr/3327'
git switch 'upstream-pr/3327'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/3327'
git switch 'upstream-pr/3327'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/3327'
git switch 'upstream-pr/3327'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/3327'
git switch 'main'
git merge --squash 'upstream-pr/3327'
git switch 'main'
git merge --ff-only 'upstream-pr/3327'
git switch 'main'
git merge 'upstream-pr/3327'
git push origin 'main'
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
xcl-dev/xcl!3327
No description provided.