Recompiler: direct-DXIL Wave64 native ms_6_6 mesh translator and packed PS ISG1/MS OSG1 #3656

Open
Kalmarv wants to merge 5 commits from upstream-pr/3656 into main
Kalmarv commented 2026-12-02 04:08:48 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Kalmarv on 2026-12-02T04:08:48Z.


Stacked on #3327 (builds on @KDenKC's runtime/PSO/ExecuteIndirect native mesh plumbing for #3011 C4; stacked onto #3327 d10821a30 on origin/main 078358a05, keeping #3327's 3 commits intact below our 2 logical commits). Waiting on @KDenKC's RTX 5090 re-test at e2a4128c6 and planned split into smaller PRs once #3327 lands.

Adds direct RDNA2 → ms_6_6 DXIL lowering for 1-pass Wave64 console mesh shaders (64/128 threads, up to 128 vertices and 128 primitives, zero HLSL and zero DXC compilation) plus console-register-preserving PS ISG1 / MS OSG1 signature packing, wired behind #3327's opt-in XCL_NATIVE_MESH=1 flag.

What is in it

  • Direct-DXIL Wave64 ms_6_6 translator (1ed29f44b — crates/xcl/src/gpu/dxil/native_mesh.rs, native_mesh_tests.rs, mask_exchange.rs, kernel.rs, lanes.rs, lower.rs, lower_gfx.rs, lower_mem.rs, graphics.rs, mod.rs):
    • Runs 64-lane console waves sequentially in a 64-thread (2 x wave32) mesh group (1 or 2 waves), keeping lane-owned vertex/primitive exports in private storage (MeshTarget::Native) and sharing GS_ALLOC_REQ counts via xcl_counts[6] within the 28 KiB ms_6_6 TGSM limit and 32 KiB vertex+primitive output budget (including 12 * max_primitives index bytes).
    • Double-buffered groupshared cross-half exchange (Partner::Barrier, 4 * xslot words, 1 GroupMemoryBarrierWithGroupSync per exchange, zero spin loops, lazy xcl_xs allocation) with forward half-divergence taint analysis integrated with mask_exchange::plan_for_barrier (plain whole-live demand + compare batching without idioms::local_votes or idioms::uniform_reads, which assume half-local EXECZ branches / non-barrier-gated read_first_lane_uniform and are unsafe under Partner::Barrier).
    • Uniform branches emit zero agree_cond barriers; divergent barrier-reaching branches agree with CondAgree::All (EXECZ/VCCZ), CondAgree::Any (EXECNZ/VCCNZ/loop-cap), or CondAgree::Half0 (SCC0/SCC1).
    • is_barrier_inst tracks V_DIV_SCALE_F32 alongside other mask-producing ops while excluding scalar-only mask_exchange::uniform_compare (which lowers as sel(cond, exec, 0) without exchanging and propagates scalar + EXEC taint in taint_step).
    • Post-lowering check_unplanned_barrier runs unconditionally (debug and release alike), returning Err so any BarrierPlan mismatch fails closed to two-pass rather than emitting an untracked barrier.
    • GS_ALLOC_REQ epilogue prefers wave 0's nonzero allocation and falls back to wave 1 instead of zeroing the meshlet on wave-1 mismatch; omits unused SV_PrimitiveID when the linked PS does not declare it, guards nv == 0 => np = 0 before SetMeshOutputCounts, and limits the string-table name-offset signature tiebreaker in graphics.rs to Stage::Mesh and explicit .at(...) (PixelPacked) signatures so default Stage::Vertex/Stage::Pixel signatures keep the original (register, mask.trailing_zeros()) sort.
    • Adds packed_user_layout shared by Entry::PixelPacked and native_mesh::translate_with_packing so console-shared registers pack into dense rows 1..=K grouped by (register, type_class) separating U32, I32, F32, and F16/other, while keeping standard Stage::Pixel / VS / two-pass / HLSL paths unpacked. Maps MS→PS element lanes directly by element offset and adjusts lower_gfx::interp_gfx for start_chan offsets and typed zero on OOB channel reads.
    • Default translator output (XCL_NATIVE_MESH=0) is unchanged: TRANSLATOR_VERSION stays 12 and module/opt.rs has zero diff vs main (on the runtime side, bind.rs also runs nonzero_window_va in prepare_two_pass_stage, appends two zeroed slice_base/total_cap words to SCALE_ARGS_HLSL, and binds slot u5 to consts in emit_scaled_args_rewrite_from).
  • Runtime / PSO wiring and sliced indirect dispatch (e2a4128c6 — crates/xcl/src/gpu/recomp/pso.rs, crates/xcl/src/hle/d3d12x/bind.rs, crates/xcl/src/hle/d3d12x/real.rs):
    • Caches Stage::NativeMesh and Stage::PixelPacked in RAM and on disk isolated from two-pass Stage::Mesh and unpacked Stage::Pixel.
    • Extends TwoPassPso::native with NativeMeshPso { pso, rs, linear_gid } so Wave64 native mesh PSOs carry combined PS+MS static-sampler root signatures and linear group IDs (direct DispatchMesh slicing via IO_MESH_GROUP_BASE, and indirect ExecuteIndirect slicing across multiple 65,535-group SCALE_ARGS_HLSL slices with IO_MESH_GROUP_BASE = k * 65535 instead of clamping and dropping upper meshlets, flushing deferred two-pass draws before stage and scratch preparation on Direct lists and tracking per-slice scratch state across block rollovers), while preserving #3327's single-wave32 path and draw-time two-pass fallback.
    • Calls PC ExecuteIndirect directly on the rewritten scratch buffer with (0, 0) for the count buffer (matching two-pass, since SCALE_ARGS_HLSL already applies any count buffer through the UMA window and emit_scaled_args_rewrite_from already transitions scaled from UNORDERED_ACCESS to INDIRECT_ARGUMENT, avoiding redundant transitions on the global ARGUMENT_ORDER buffer across concurrent queues), binds all 6 root UAVs (u0..u5) of abi_root_signature(dev, false) in emit_scaled_args_rewrite_from, and filters zero window VAs in prepare_two_pass_stage.
  • Tests (native_mesh.rs, native_mesh_tests.rs, lower_gfx.rs, pso.rs, bind.rs):
    • CPU/DXC 1.9 validation tests for Wave64 ms_6_6, Partner::Barrier, ds_bpermute, barrier-safe mask planning (local_votes disabled, uniform_reads disabled, uniform_compare taint propagation), release check_unplanned_barrier fail-closed rejection, uniform vs divergent barrier agreement (CondAgree::All on tainted EXECZ), V_DIV_SCALE_F32, mixed U32/I32/F16/F32 packed signature separation, 12 * max_primitives output-budget rejection, cache isolation, linear slicing, per-slice scratch state rollover, and 6-slot ABI views.
    • GPU parity tests verifying Wave64 + Partner::Barrier + packed PS (gpu_direct_dxil_native_mesh_wave64_matches_two_pass), half-1-only tainted EXECZ branch + wave-0/wave-1 GS_ALLOC_REQ mismatch + mismatched MS/PS element lane packing (gpu_direct_dxil_native_mesh_half1_branch_wave_alloc_and_mismatched_lanes), and sliced indirect native mesh past 65,535 groups (gpu_native_mesh_indirect_slices_past_65535).
  • Credit to @KDenKC for the #3327 foundation and RTX 5090 testing/DRED triage, and to @Decodere and @Foniass for the review findings.

Tested

  • Hardware & toolchain: AMD Ryzen 9 9950X 16-Core, Windows 11 Pro 10.0.26200.0, NVIDIA GeForce RTX 5070 Ti (driver 610.74), rustc 1.99.0 (b940084d7 2026-09-28), DXC 1.9.2609.5.
  • cargo build --release -p xcl and cargo test --workspace --no-run on e2a4128c6: succeeded.
  • .\scripts\test.ps1 (full workspace build, bench compile-check, and test suite on e2a4128c6): 3,031 passed, 0 failed, 52 ignored across 44 test binaries (all 24 native_mesh tests passed; GPU tests skipped on this wave32-only adapter: 24 total — 22 no wave64, 2 no heap windows opt-in).
  • Prior direct_dxil_native_mesh_history_census on 07e3c32f3 (identical barrier-analysis / lowering logic): 9,374/9,887 mesh shaders translated and validated with val_errs=0 and 0 debug assertion failures (507 rejected on output budget, 6 rejected on LDS).
  • D3D12 Debug Layer + GPU-Based Validation (GBV) on RTX 5070 Ti: ran the 1-slice indirect MS+PS pipeline through 2-slice SCALE_ARGS_HLSL → ExecuteIndirect with shader-visible descriptor heaps bound (0 D3D12 errors, 0 GBV errors, no device removal).
  • Live 60 s retail title smokes on base 078358a05 vs e2a4128c6: default run matched base (1,695 vs 1,695 frames, 17,231 vs 17,123 MB peak commit, 0 removals, 0 crashes); opt-in XCL_NATIVE_MESH=1 ran cleanly with 1,707 frames (PresentX 1707), 60 60 61 presents per 2 s, 16,689 MB peak commit, 0 removals, and 0 crashes.

Regression run
Base (origin/main 078358a05):

xcl-smoke v1
commit: 078358a058f7ba5d16690dba8dc4e55d2c88ae0a
gpu: NVIDIA GeForce RTX 5070 Ti
title: ea3b5e4d
seconds: 60
exit: 0x0
frames shown: 1695 (PresentX 1695)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 17123 MB

PR default (XCL_NATIVE_MESH unset):

xcl-smoke v1
commit: e2a4128c6166d61a3f256cc0952bb5af51ecac90
gpu: NVIDIA GeForce RTX 5070 Ti
title: ea3b5e4d
seconds: 60
exit: 0x0
frames shown: 1695 (PresentX 1695)
presents per 2 s (last 3): 60 61 60
device removals: 0
crashes: 0
peak commit: 17231 MB

PR opt-in (XCL_NATIVE_MESH=1):

xcl-smoke v1
commit: e2a4128c6166d61a3f256cc0952bb5af51ecac90
gpu: NVIDIA GeForce RTX 5070 Ti
title: ea3b5e4d
seconds: 60
exit: 0x0
frames shown: 1707 (PresentX 1707)
presents per 2 s (last 3): 60 60 61
device removals: 0
crashes: 0
peak commit: 16689 MB

Not tested

  • Native wave64 hardware adapters (AMD RDNA / Intel): try_native_mesh gates on wave32 hardware (so wave64 adapters never exercise the runtime native path), while wave32 adapters (this RTX 5070 Ti) skip the 22 wave64-only GPU tests and 2 opt-in heap-window tests — neither adapter alone covers both the runtime native path and the wave64 test suite.
  • Extended in-world gameplay beyond the 60 s intro/menu smoke, in-world GPU-time speedup (gpu_profile vs two-pass), in-world visual comparison against two-pass, and RTX 5090 re-test at e2a4128c6 (pending @KDenKC).
  • Mesh shaders that use LDS or memory stores/atomics (intentionally rejected to two-pass fallback).

AI use

  • Antigravity (Gemini 4 Neon): rebased/restacked onto #3327 d10821a30 (origin/main 078358a05), implemented the Wave64 direct-DXIL native mesh translator, review fixes, barrier-planning / sliced indirect fixes (e2a4128c6), and 72-column wrapped 2-commit stack (1ed29f44b + e2a4128c6), added regression unit/DXIL/GPU tests, and ran build, corpus audit, GBV, test, and base+PR smoke verification.
<!-- greyfinch-sync:ivall/xcl:issue:5599647586 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3656). Originally posted by [Kalmarv](https://github.com/Kalmarv) on 2026-12-02T04:08:48Z. --- > **Stacked on #3327** (builds on @KDenKC's runtime/PSO/ExecuteIndirect native mesh plumbing for #3011 C4; stacked onto #3327 `d10821a30` on `origin/main` `078358a05`, keeping #3327's 3 commits intact below our 2 logical commits). Waiting on @KDenKC's RTX 5090 re-test at `e2a4128c6` and planned split into smaller PRs once #3327 lands. Adds direct RDNA2 → `ms_6_6` DXIL lowering for 1-pass Wave64 console mesh shaders (64/128 threads, up to 128 vertices and 128 primitives, zero HLSL and zero DXC compilation) plus console-register-preserving PS `ISG1` / MS `OSG1` signature packing, wired behind #3327's opt-in `XCL_NATIVE_MESH=1` flag. **What is in it** - **Direct-DXIL Wave64 `ms_6_6` translator** (`1ed29f44b` — `crates/xcl/src/gpu/dxil/native_mesh.rs`, `native_mesh_tests.rs`, `mask_exchange.rs`, `kernel.rs`, `lanes.rs`, `lower.rs`, `lower_gfx.rs`, `lower_mem.rs`, `graphics.rs`, `mod.rs`): - Runs 64-lane console waves sequentially in a 64-thread (`2 x wave32`) mesh group (`1` or `2` waves), keeping lane-owned vertex/primitive exports in private storage (`MeshTarget::Native`) and sharing `GS_ALLOC_REQ` counts via `xcl_counts[6]` within the 28 KiB `ms_6_6` TGSM limit and 32 KiB vertex+primitive output budget (including `12 * max_primitives` index bytes). - Double-buffered groupshared cross-half exchange (`Partner::Barrier`, `4 * xslot` words, 1 `GroupMemoryBarrierWithGroupSync` per exchange, zero spin loops, lazy `xcl_xs` allocation) with forward half-divergence taint analysis integrated with `mask_exchange::plan_for_barrier` (plain whole-live demand + compare batching without `idioms::local_votes` or `idioms::uniform_reads`, which assume half-local `EXECZ` branches / non-barrier-gated `read_first_lane_uniform` and are unsafe under `Partner::Barrier`). - Uniform branches emit zero `agree_cond` barriers; divergent barrier-reaching branches agree with `CondAgree::All` (`EXECZ`/`VCCZ`), `CondAgree::Any` (`EXECNZ`/`VCCNZ`/loop-cap), or `CondAgree::Half0` (`SCC0`/`SCC1`). - `is_barrier_inst` tracks `V_DIV_SCALE_F32` alongside other mask-producing ops while excluding scalar-only `mask_exchange::uniform_compare` (which lowers as `sel(cond, exec, 0)` without exchanging and propagates scalar + `EXEC` taint in `taint_step`). - Post-lowering `check_unplanned_barrier` runs unconditionally (debug and release alike), returning `Err` so any `BarrierPlan` mismatch fails closed to two-pass rather than emitting an untracked barrier. - `GS_ALLOC_REQ` epilogue prefers wave 0's nonzero allocation and falls back to wave 1 instead of zeroing the meshlet on wave-1 mismatch; omits unused `SV_PrimitiveID` when the linked PS does not declare it, guards `nv == 0 => np = 0` before `SetMeshOutputCounts`, and limits the string-table name-offset signature tiebreaker in `graphics.rs` to `Stage::Mesh` and explicit `.at(...)` (`PixelPacked`) signatures so default `Stage::Vertex`/`Stage::Pixel` signatures keep the original `(register, mask.trailing_zeros())` sort. - Adds `packed_user_layout` shared by `Entry::PixelPacked` and `native_mesh::translate_with_packing` so console-shared registers pack into dense rows `1..=K` grouped by `(register, type_class)` separating `U32`, `I32`, `F32`, and `F16`/other, while keeping standard `Stage::Pixel` / VS / two-pass / HLSL paths unpacked. Maps MS→PS element lanes directly by element offset and adjusts `lower_gfx::interp_gfx` for `start_chan` offsets and typed zero on OOB channel reads. - Default translator output (`XCL_NATIVE_MESH=0`) is unchanged: `TRANSLATOR_VERSION` stays `12` and `module/opt.rs` has zero diff vs `main` (on the runtime side, `bind.rs` also runs `nonzero_window_va` in `prepare_two_pass_stage`, appends two zeroed `slice_base`/`total_cap` words to `SCALE_ARGS_HLSL`, and binds slot `u5` to `consts` in `emit_scaled_args_rewrite_from`). - **Runtime / PSO wiring and sliced indirect dispatch** (`e2a4128c6` — `crates/xcl/src/gpu/recomp/pso.rs`, `crates/xcl/src/hle/d3d12x/bind.rs`, `crates/xcl/src/hle/d3d12x/real.rs`): - Caches `Stage::NativeMesh` and `Stage::PixelPacked` in RAM and on disk isolated from two-pass `Stage::Mesh` and unpacked `Stage::Pixel`. - Extends `TwoPassPso::native` with `NativeMeshPso { pso, rs, linear_gid }` so Wave64 native mesh PSOs carry combined PS+MS static-sampler root signatures and linear group IDs (direct `DispatchMesh` slicing via `IO_MESH_GROUP_BASE`, and indirect `ExecuteIndirect` slicing across multiple 65,535-group `SCALE_ARGS_HLSL` slices with `IO_MESH_GROUP_BASE = k * 65535` instead of clamping and dropping upper meshlets, flushing deferred two-pass draws before stage and scratch preparation on Direct lists and tracking per-slice scratch state across block rollovers), while preserving #3327's single-wave32 path and draw-time two-pass fallback. - Calls PC `ExecuteIndirect` directly on the rewritten scratch buffer with `(0, 0)` for the count buffer (matching two-pass, since `SCALE_ARGS_HLSL` already applies any count buffer through the UMA window and `emit_scaled_args_rewrite_from` already transitions `scaled` from `UNORDERED_ACCESS` to `INDIRECT_ARGUMENT`, avoiding redundant transitions on the global `ARGUMENT_ORDER` buffer across concurrent queues), binds all 6 root UAVs (`u0..u5`) of `abi_root_signature(dev, false)` in `emit_scaled_args_rewrite_from`, and filters zero window VAs in `prepare_two_pass_stage`. - **Tests** (`native_mesh.rs`, `native_mesh_tests.rs`, `lower_gfx.rs`, `pso.rs`, `bind.rs`): - CPU/DXC 1.9 validation tests for Wave64 `ms_6_6`, `Partner::Barrier`, `ds_bpermute`, barrier-safe mask planning (`local_votes` disabled, `uniform_reads` disabled, `uniform_compare` taint propagation), release `check_unplanned_barrier` fail-closed rejection, uniform vs divergent barrier agreement (`CondAgree::All` on tainted `EXECZ`), `V_DIV_SCALE_F32`, mixed `U32`/`I32`/`F16`/`F32` packed signature separation, `12 * max_primitives` output-budget rejection, cache isolation, linear slicing, per-slice scratch state rollover, and 6-slot ABI views. - GPU parity tests verifying Wave64 + `Partner::Barrier` + packed PS (`gpu_direct_dxil_native_mesh_wave64_matches_two_pass`), half-1-only tainted `EXECZ` branch + wave-0/wave-1 `GS_ALLOC_REQ` mismatch + mismatched MS/PS element lane packing (`gpu_direct_dxil_native_mesh_half1_branch_wave_alloc_and_mismatched_lanes`), and sliced indirect native mesh past 65,535 groups (`gpu_native_mesh_indirect_slices_past_65535`). - Credit to @KDenKC for the #3327 foundation and RTX 5090 testing/DRED triage, and to @Decodere and @Foniass for the review findings. **Tested** - Hardware & toolchain: AMD Ryzen 9 9950X 16-Core, Windows 11 Pro 10.0.26200.0, NVIDIA GeForce RTX 5070 Ti (driver 610.74), `rustc 1.99.0 (b940084d7 2026-09-28)`, DXC `1.9.2609.5`. - `cargo build --release -p xcl` and `cargo test --workspace --no-run` on `e2a4128c6`: succeeded. - `.\scripts\test.ps1` (full workspace build, bench compile-check, and test suite on `e2a4128c6`): 3,031 passed, 0 failed, 52 ignored across 44 test binaries (all 24 `native_mesh` tests passed; GPU tests skipped on this wave32-only adapter: 24 total — 22 `no wave64`, 2 `no heap windows` opt-in). - Prior `direct_dxil_native_mesh_history_census` on `07e3c32f3` (identical barrier-analysis / lowering logic): `9,374/9,887` mesh shaders translated and validated with `val_errs=0` and `0` debug assertion failures (`507` rejected on output budget, `6` rejected on LDS). - D3D12 Debug Layer + GPU-Based Validation (GBV) on RTX 5070 Ti: ran the 1-slice indirect MS+PS pipeline through 2-slice `SCALE_ARGS_HLSL` → `ExecuteIndirect` with shader-visible descriptor heaps bound (`0` D3D12 errors, `0` GBV errors, no device removal). - Live 60 s retail title smokes on base `078358a05` vs `e2a4128c6`: default run matched base (`1,695` vs `1,695` frames, `17,231` vs `17,123` MB peak commit, 0 removals, 0 crashes); opt-in `XCL_NATIVE_MESH=1` ran cleanly with `1,707` frames (`PresentX 1707`), `60 60 61` presents per 2 s, `16,689` MB peak commit, 0 removals, and 0 crashes. **Regression run** Base (`origin/main` `078358a05`): ``` xcl-smoke v1 commit: 078358a058f7ba5d16690dba8dc4e55d2c88ae0a gpu: NVIDIA GeForce RTX 5070 Ti title: ea3b5e4d seconds: 60 exit: 0x0 frames shown: 1695 (PresentX 1695) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 17123 MB ``` PR default (`XCL_NATIVE_MESH` unset): ``` xcl-smoke v1 commit: e2a4128c6166d61a3f256cc0952bb5af51ecac90 gpu: NVIDIA GeForce RTX 5070 Ti title: ea3b5e4d seconds: 60 exit: 0x0 frames shown: 1695 (PresentX 1695) presents per 2 s (last 3): 60 61 60 device removals: 0 crashes: 0 peak commit: 17231 MB ``` PR opt-in (`XCL_NATIVE_MESH=1`): ``` xcl-smoke v1 commit: e2a4128c6166d61a3f256cc0952bb5af51ecac90 gpu: NVIDIA GeForce RTX 5070 Ti title: ea3b5e4d seconds: 60 exit: 0x0 frames shown: 1707 (PresentX 1707) presents per 2 s (last 3): 60 60 61 device removals: 0 crashes: 0 peak commit: 16689 MB ``` **Not tested** - Native wave64 hardware adapters (AMD RDNA / Intel): `try_native_mesh` gates on wave32 hardware (so wave64 adapters never exercise the runtime native path), while wave32 adapters (this RTX 5070 Ti) skip the 22 wave64-only GPU tests and 2 opt-in heap-window tests — neither adapter alone covers both the runtime native path and the wave64 test suite. - Extended in-world gameplay beyond the 60 s intro/menu smoke, in-world GPU-time speedup (`gpu_profile` vs two-pass), in-world visual comparison against two-pass, and RTX 5090 re-test at `e2a4128c6` (pending @KDenKC). - Mesh shaders that use LDS or memory stores/atomics (intentionally rejected to two-pass fallback). **AI use** - Antigravity (Gemini 4 Neon): rebased/restacked onto #3327 `d10821a30` (`origin/main` `078358a05`), implemented the Wave64 direct-DXIL native mesh translator, review fixes, barrier-planning / sliced indirect fixes (`e2a4128c6`), and 72-column wrapped 2-commit stack (`1ed29f44b` + `e2a4128c6`), added regression unit/DXIL/GPU tests, and ran build, corpus audit, GBV, test, and base+PR smoke verification.
KDenKC commented 2026-12-02 06:07:54 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by KDenKC on 2026-12-02T06:07:54Z.


@Kalmarv thanks for #3656 (and #3662). Here's what we're running on the RTX 5090 right now and what we'll report back.

What we're testing. Both of your PRs together on our tree (our window/alias fixes plus our diagnostics), with XCL_NATIVE_MESH=1, on the 16-window layout (XCL_HEAP_WINDOWS=1 XCL_UMA_WINDOWS=16), each arm on its own fully prepared shader cache plus a warm-up, so the numbers aren't compile stalls. Before that, a straight A/B of #3656 against #3327 as you rebased it (0ccba721 vs eafe8ae8), same env and length; arm A is done, arm B is running.

Why #3662 matters to us. It matches what our measurements showed: in our runs the title's builder dispatches run in full (hundreds of thousands, none on a stand-in), yet a GPU-side counter we added to the node test reads 0 node tests for the whole run, and the top-level headers the traversal reads never show a node. "Builds land outside the 64 KiB the views map" fits that exactly, and the same counter should tell us directly whether rays start testing nodes with your hook.

What we'll report (on #3656 for the mesh side, on #3662 for the builder side), from the same runs:

  • presents/s and frame time in the world, and GPU time per frame for the mesh passes (native vs two-pass);
  • how many mesh pipelines went native vs stayed two-pass, and any pipeline the native path refused;
  • node tests / box and triangle hits from the counter, and whether the walked top-level headers fill in;
  • peak commit and VRAM, device removals and crashes, plus anything that looks wrong in the picture.

If there's a metric you'd rather see, or a switch you want set for these runs, say so and we'll include it.

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:7336667678 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3656#issuecomment-7336667678). Originally posted by [KDenKC](https://github.com/KDenKC) on 2026-12-02T06:07:54Z. --- @Kalmarv thanks for #3656 (and #3662). Here's what we're running on the RTX 5090 right now and what we'll report back. **What we're testing.** Both of your PRs together on our tree (our window/alias fixes plus our diagnostics), with `XCL_NATIVE_MESH=1`, on the 16-window layout (`XCL_HEAP_WINDOWS=1 XCL_UMA_WINDOWS=16`), each arm on its own fully prepared shader cache plus a warm-up, so the numbers aren't compile stalls. Before that, a straight A/B of #3656 against #3327 as you rebased it (`0ccba721` vs `eafe8ae8`), same env and length; arm A is done, arm B is running. **Why #3662 matters to us.** It matches what our measurements showed: in our runs the title's builder dispatches run in full (hundreds of thousands, none on a stand-in), yet a GPU-side counter we added to the node test reads **0 node tests for the whole run**, and the top-level headers the traversal reads never show a node. "Builds land outside the 64 KiB the views map" fits that exactly, and the same counter should tell us directly whether rays start testing nodes with your hook. **What we'll report** (on #3656 for the mesh side, on #3662 for the builder side), from the same runs: - presents/s and frame time in the world, and GPU time per frame for the mesh passes (native vs two-pass); - how many mesh pipelines went native vs stayed two-pass, and any pipeline the native path refused; - node tests / box and triangle hits from the counter, and whether the walked top-level headers fill in; - peak commit and VRAM, device removals and crashes, plus anything that looks wrong in the picture. If there's a metric you'd rather see, or a switch you want set for these runs, say so and we'll include it. AI use: an agent swarm: Claude Opus 5.5, Claude Sonnet 5.5, GPT-6.2-Sol, Gemini 4 Neon and Gemini 4 Hydrogen.
KDenKC commented 2026-12-02 06:11:57 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by KDenKC on 2026-12-02T06:11:57Z.


@Kalmarv first A/B result for #3656 on the RTX 5090: native mesh is active (371 of 394 mesh pipelines) and runs without removals, but it breaks the picture in our test scene and is ~4–5 % slower than the two-pass path.

Setup. Arm A 0ccba721 (#3327 rebased, as in your stack) vs arm B eafe8ae8 (#3656), both with XCL_NATIVE_MESH=1, XCL_HEAP_WINDOWS=1 XCL_UMA_WINDOWS=16, XCL_SKIP_CS=95cc13288a27a96e (the known compact-form fault, skipped in both arms), each on its own fully prepared shader cache plus a 4-minute warm-up, then one measured run of ~531 s uptime (same save, same scripted input, same world time). RTX 5090, driver 621.24, Windows 11.

A (two-pass) B (#3656 native)
mesh pipelines native / two-pass 0 / 395 (all refused by #3327's wave32 preflight) 371 / 23, 0 rejected
world fps (presents over the same world time) 7.2 (4,613 presents) 6.8 (4,419 presents)
stalls > 1 s 1 (2 s) 0
peak commit / peak local VRAM 39,228 / 19,217 MB 39,967 / 19,477 MB
device removals / crashes 0 / 0 0 / 0

GPU time (our per-call timestamps, 16 frames each; not the same scene moment, so treat it as a profile, not a like-for-like frame): summed over the top-ranked calls, mesh work was 16.6 ms/frame two-pass in A vs 25.8 ms/frame native (+2.4 two-pass) in B; compute ~15–16 ms in both. Top native MS calls in B: 0196b080 1.90 ms/frame (24 calls/frame), 7f9e22f1 1.89 ms/frame (72 calls/frame), 0b802b4c 1.49 ms/frame (90 calls/frame); top two-pass in A: 71161c3b 1.41 ms/frame (126 calls/frame).

Picture: a clear regression with #3656. In arm B all 43 saved frames of the first interior scene (every 61st present, 1850 to 4412) show the same damage: a large solid black area over the centre of the view where the window frame, the building outside and the character should be, and big diagonal black/grey triangles across the left wall and the lower right. Arm A, same scene and frames, draws the window frame, the lit sliver of the building and the character's outline normally (its window is dark only because that tree lacks the separate window fix). It looks like native mesh groups emitting a few huge wrong triangles that cover the screen, rather than missing ones; the two-pass path on the same shaders draws them correctly. On top of that, the native wave64 MS currently cost more GPU time than the two-pass pair for the same work on Blackwell.

Possible reasons, from reading the diff (hypotheses, not measured): for speed, a 128-thread console MS seems to run its two waves one after the other inside one 64-thread group (half the parallelism of the two-pass compute pass), every cross-half exchange is a group barrier, and the per-lane export staging array may spill. For the picture, we're checking whether it's the case where the two waves' GS_ALLOC_REQ counts disagree, or the indirect path past 65,535 groups (no split there, while the direct path slices); a short code review with those points follows separately.

Next on our side: the same stack with #3662 on our tree (with the node-test counter), results on #3662. If you want a specific switch or a per-shader timing for the native MS, tell us which.

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:7336742414 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3656#issuecomment-7336742414). Originally posted by [KDenKC](https://github.com/KDenKC) on 2026-12-02T06:11:57Z. --- @Kalmarv first A/B result for #3656 on the RTX 5090: native mesh is **active** (371 of 394 mesh pipelines) and runs without removals, but it **breaks the picture** in our test scene and is **~4–5 % slower** than the two-pass path. **Setup.** Arm A `0ccba721` (#3327 rebased, as in your stack) vs arm B `eafe8ae8` (#3656), both with `XCL_NATIVE_MESH=1`, `XCL_HEAP_WINDOWS=1 XCL_UMA_WINDOWS=16`, `XCL_SKIP_CS=95cc13288a27a96e` (the known compact-form fault, skipped in both arms), each on its own fully prepared shader cache plus a 4-minute warm-up, then one measured run of ~531 s uptime (same save, same scripted input, same world time). RTX 5090, driver 621.24, Windows 11. | | A (two-pass) | B (#3656 native) | |---|---|---| | mesh pipelines native / two-pass | 0 / 395 (all refused by #3327's wave32 preflight) | **371 / 23**, 0 rejected | | world fps (presents over the same world time) | 7.2 (4,613 presents) | 6.8 (4,419 presents) | | stalls > 1 s | 1 (2 s) | 0 | | peak commit / peak local VRAM | 39,228 / 19,217 MB | 39,967 / 19,477 MB | | device removals / crashes | 0 / 0 | 0 / 0 | **GPU time** (our per-call timestamps, 16 frames each; not the same scene moment, so treat it as a profile, not a like-for-like frame): summed over the top-ranked calls, mesh work was 16.6 ms/frame two-pass in A vs **25.8 ms/frame native** (+2.4 two-pass) in B; compute ~15–16 ms in both. Top native MS calls in B: `0196b080` 1.90 ms/frame (24 calls/frame), `7f9e22f1` 1.89 ms/frame (72 calls/frame), `0b802b4c` 1.49 ms/frame (90 calls/frame); top two-pass in A: `71161c3b` 1.41 ms/frame (126 calls/frame). **Picture: a clear regression with #3656.** In arm B all 43 saved frames of the first interior scene (every 61st present, 1850 to 4412) show the same damage: a large solid black area over the centre of the view where the window frame, the building outside and the character should be, and big diagonal black/grey triangles across the left wall and the lower right. Arm A, same scene and frames, draws the window frame, the lit sliver of the building and the character's outline normally (its window is dark only because that tree lacks the separate window fix). It looks like native mesh groups emitting a few huge wrong triangles that cover the screen, rather than missing ones; the two-pass path on the same shaders draws them correctly. On top of that, the native wave64 MS currently cost more GPU time than the two-pass pair for the same work on Blackwell. **Possible reasons, from reading the diff (hypotheses, not measured):** for speed, a 128-thread console MS seems to run its two waves one after the other inside one 64-thread group (half the parallelism of the two-pass compute pass), every cross-half exchange is a group barrier, and the per-lane export staging array may spill. For the picture, we're checking whether it's the case where the two waves' GS_ALLOC_REQ counts disagree, or the indirect path past 65,535 groups (no split there, while the direct path slices); a short code review with those points follows separately. Next on our side: the same stack with #3662 on our tree (with the node-test counter), results on #3662. If you want a specific switch or a per-shader timing for the native MS, tell us which. AI use: an agent swarm: Claude Opus 5.5, Claude Sonnet 5.5, GPT-6.2-Sol, Gemini 4 Neon and Gemini 4 Hydrogen.
KDenKC commented 2026-12-02 06:24:40 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by KDenKC on 2026-12-02T06:24:40Z.


A note for later, so it doesn't get lost (not a request for this PR): once #3656 draws correctly and is tuned, a natural next step we'd like to work on is running a 128-thread console mesh program's two 64-lane waves in parallel on the native path. As we read the diff (unconfirmed, correct us), wave 0 and then wave 1 run one after the other inside one 64-thread D3D12 group; launching the group at 128 threads instead (each console wave as two 32-lane warps, exchanging through group-shared memory only where the program needs it) fits the 128-thread / 128-vertex / 128-primitive shape every mesh program of this title has, and should recover the parallelism the two-pass compute pass has today. Happy to take it on with you when the time comes.

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:7336982642 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3656#issuecomment-7336982642). Originally posted by [KDenKC](https://github.com/KDenKC) on 2026-12-02T06:24:40Z. --- A note for later, so it doesn't get lost (not a request for this PR): once #3656 draws correctly and is tuned, a natural next step we'd like to work on is running a 128-thread console mesh program's **two 64-lane waves in parallel** on the native path. As we read the diff (unconfirmed, correct us), wave 0 and then wave 1 run one after the other inside one 64-thread D3D12 group; launching the group at 128 threads instead (each console wave as two 32-lane warps, exchanging through group-shared memory only where the program needs it) fits the 128-thread / 128-vertex / 128-primitive shape every mesh program of this title has, and should recover the parallelism the two-pass compute pass has today. Happy to take it on with you when the time comes. 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-02 08:36:17 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Foniass on 2026-12-02T08:36:17Z.


Review (head eafe8ae8, diff read, not a merge-check):

  • Too big to review, and stacked on an open PR. The first three commits (783e94c6a, 1b3bdfa1c, 0ccba721e) are #3327, still open. This PR's own commits are f0518e855 (+1863/-31) and eafe8ae82 (+984/-75), about 2,850 lines, well past the ~800 where CONTRIBUTING asks why it cannot be split; the description doesn't say. Possible split along the commits: (1) the two shared DXIL changes below, each with a test; (2) plumbing nothing calls yet: Partner::Barrier / agree_cond (lanes.rs), MeshTarget::Native (lower.rs, lower_mem.rs), Lw::new_native_mesh (kernel.rs); (3) the translator dxil/native_mesh.rs with its CPU/DXC tests (the *_census tests in a later diagnostics PR); (4) packed_user_layout, Entry::PixelPacked and the PixelPacked / NativeMesh cache entries (lower_gfx.rs, kernel.rs, pso.rs); (5) the runtime wiring: NativeMeshPso, the wave64 branch of try_native_mesh (real.rs), linear group slices with split = 1 (bind.rs), and the GPU parity test.
  • Two changes are on by default, not behind XCL_NATIVE_MESH. module/opt.rs ~112: createHandleFromHeap and annotateHandle calls are now merged only within a block (Cse::Block) instead of across blocks (Cse::Dom), for every direct-DXIL shader on every GPU, compute included. It matches the RDNA4 rule already on main at opt.rs ~736, so it may be a real fix, but no test fails without it. graphics.rs ~617: sig_part now sorts the signature rows of every VS, PS and MS by (stream, register, order of first name appearance) instead of (register, first column); by reading this matches DXC's order, but no added test fails on main's order. The description presents both as part of the native mesh work rather than default-path changes; they need their own tests and their own PR.
  • The new code only runs on GPUs with 32-lane waves only. try_native_mesh refuses any adapter unless WaveLaneCountMin == 32 && WaveLaneCountMax == 32 (real.rs ~9873), so XCL_NATIVE_MESH=1 does nothing on AMD RDNA (32-64) and Intel. The only GPU test comparing the output with the two-pass path skips whenever wave64 is supported (native_mesh.rs ~1475), so the maintainer's RDNA4 merge run exercises none of it. The claim that the halves cannot deadlock at a barrier (Partner::Barrier plus agree_cond, both halves taking half 0's branch decision) rests on one 60 s run on an RTX 5070 Ti; no test feeds the two halves differing branch conditions.
  • No measured gain, and an unexplained change in the default run. With XCL_NATIVE_MESH=1 the smoke shows 1698 frames vs 1708 with it off (both 60/60/60): no visible benefit for ~2,850 lines. With the feature off the PR's run shows 1708 vs main's 1387 (+23 %), which the description doesn't explain; it may be cache warm-up or the default-path changes above.

Fine (by reading): the feature is off by default (XCL_NATIVE_MESH=1, wave32-only adapters, skipped while DXC compiles are deferred or pipeline libraries are built). Every failure returns Err and keeps the two-pass pipeline (translation errors, translator panics caught at join, packed-PS failure falls back to unpacked PS + unpacked MS, PSO refusal, draw-time bind failure). MS outputs and PS inputs get their packed layout from the same function on the same ISG1. The new watch ring kinds 9 and 10 fit the 4-bit field, and the cache keys keep packed/unpacked PS and native/two-pass MS apart. Textual conflict with #3655 (kernel.rs, real.rs).

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

<!-- greyfinch-sync:ivall/xcl:comment:7339675684 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3656#issuecomment-7339675684). Originally posted by [Foniass](https://github.com/Foniass) on 2026-12-02T08:36:17Z. --- Review (head eafe8ae8, diff read, not a merge-check): - **Too big to review, and stacked on an open PR.** The first three commits (783e94c6a, 1b3bdfa1c, 0ccba721e) are #3327, still open. This PR's own commits are f0518e855 (+1863/-31) and eafe8ae82 (+984/-75), about 2,850 lines, well past the ~800 where CONTRIBUTING asks why it cannot be split; the description doesn't say. Possible split along the commits: (1) the two shared DXIL changes below, each with a test; (2) plumbing nothing calls yet: `Partner::Barrier` / `agree_cond` (`lanes.rs`), `MeshTarget::Native` (`lower.rs`, `lower_mem.rs`), `Lw::new_native_mesh` (`kernel.rs`); (3) the translator `dxil/native_mesh.rs` with its CPU/DXC tests (the `*_census` tests in a later diagnostics PR); (4) `packed_user_layout`, `Entry::PixelPacked` and the `PixelPacked` / `NativeMesh` cache entries (`lower_gfx.rs`, `kernel.rs`, `pso.rs`); (5) the runtime wiring: `NativeMeshPso`, the wave64 branch of `try_native_mesh` (`real.rs`), linear group slices with `split = 1` (`bind.rs`), and the GPU parity test. - **Two changes are on by default, not behind `XCL_NATIVE_MESH`.** `module/opt.rs` ~112: `createHandleFromHeap` and `annotateHandle` calls are now merged only within a block (`Cse::Block`) instead of across blocks (`Cse::Dom`), for every direct-DXIL shader on every GPU, compute included. It matches the RDNA4 rule already on main at `opt.rs` ~736, so it may be a real fix, but no test fails without it. `graphics.rs` ~617: `sig_part` now sorts the signature rows of every VS, PS and MS by (stream, register, order of first name appearance) instead of (register, first column); by reading this matches DXC's order, but no added test fails on main's order. The description presents both as part of the native mesh work rather than default-path changes; they need their own tests and their own PR. - **The new code only runs on GPUs with 32-lane waves only.** `try_native_mesh` refuses any adapter unless `WaveLaneCountMin == 32 && WaveLaneCountMax == 32` (`real.rs` ~9873), so `XCL_NATIVE_MESH=1` does nothing on AMD RDNA (32-64) and Intel. The only GPU test comparing the output with the two-pass path skips whenever wave64 is supported (`native_mesh.rs` ~1475), so the maintainer's RDNA4 merge run exercises none of it. The claim that the halves cannot deadlock at a barrier (`Partner::Barrier` plus `agree_cond`, both halves taking half 0's branch decision) rests on one 60 s run on an RTX 5070 Ti; no test feeds the two halves differing branch conditions. - **No measured gain, and an unexplained change in the default run.** With `XCL_NATIVE_MESH=1` the smoke shows 1698 frames vs 1708 with it off (both 60/60/60): no visible benefit for ~2,850 lines. With the feature off the PR's run shows 1708 vs main's 1387 (+23 %), which the description doesn't explain; it may be cache warm-up or the default-path changes above. Fine (by reading): the feature is off by default (`XCL_NATIVE_MESH=1`, wave32-only adapters, skipped while DXC compiles are deferred or pipeline libraries are built). Every failure returns `Err` and keeps the two-pass pipeline (translation errors, translator panics caught at join, packed-PS failure falls back to unpacked PS + unpacked MS, PSO refusal, draw-time bind failure). MS outputs and PS inputs get their packed layout from the same function on the same `ISG1`. The new watch ring kinds 9 and 10 fit the 4-bit field, and the cache keys keep packed/unpacked PS and native/two-pass MS apart. Textual conflict with #3655 (`kernel.rs`, `real.rs`). AI review: Claude Code (Claude Opus 5.5), posted by Foniass without a human check of each point.
Decodere commented 2026-12-02 08:49:13 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Decodere on 2026-12-02T08:49:13Z.


Diff review (head eafe8ae82, read-only code review — not a test report):

Impressive engineering bringing direct-DXIL Wave64 ms_6_6 and packed PS/MS signatures to 371/394 native pipelines with zero device removals. Reading the full diff (+3231/-98 across 22 files) turned up 6 concrete issues that help explain both the rendering artifacts and the mesh GPU-time regression reported on RTX 5090:

  1. [CRITICAL] agree_cond forces half 1 to take half 0's branch decision AND inserts extra barriers on every barrier-reaching branch/loop (crates/xcl/src/gpu/dxil/lanes.rs:774-786, crates/xcl/src/gpu/dxil/native_mesh.rs:375-386, :908-910):

    • agree_cond computes agreed = self.sel(self.upper, o, v) (lanes.rs:784). Whenever half 0 and half 1 disagree on a branch condition, half 1 silently discards its own condition and follows half 0 — which can skip half 1's vertex/primitive exports (leaving zeroed (0,0,0,0) positions) or execute with mismatched EXEC.
    • analyze_barriers (native_mesh.rs:375-386) marks every branch whose post-dominator region reaches any barrier (including already-uniform S_CBRANCH_EXECZ/S_CBRANCH_SCC synchronized by mask_exchange), adding redundant GroupMemoryBarrierWithGroupSync() exchanges inside hot branches and loops. Combined with serial wave 0 -> wave 1 execution in 64 threads and a thread-private alloca record array (native_mesh.rs:680) that spills to local memory, this directly contributes to the ~55% mesh GPU-time regression (16.6 -> 25.8 ms/frame).
  2. [CRITICAL] is_barrier_inst omits V_DIV_SCALE_F32 (crates/xcl/src/gpu/dxil/native_mesh.rs:83-137, :665; crates/xcl/src/gpu/dxil/lower_valu.rs:1078-1081; crates/xcl/src/gpu/dxil/kernel.rs:855):
    is_barrier_inst lists V_DIV_SCALE_F64 (native_mesh.rs:117) but omits V_DIV_SCALE_F32, which calls self.write_mask(&sdst, f) (lower_valu.rs:1081) and emits a cross-half exchange whenever sdst is whole-live. If a shader has V_DIV_SCALE_F32 as its only exchange, needs_barrier stays false (native_mesh.rs:665) and lw.partner stays Partner::Missing (kernel.rs:855, silently returning 0); if inside an un-agreed branch, it can deadlock the barrier.

  3. [CRITICAL] GS_ALLOC_REQ wave-0/wave-1 mismatch drops entire meshlets (crates/xcl/src/gpu/dxil/native_mesh.rs:939-957):
    When both wave 0 and wave 1 execute GS_ALLOC_REQ with differing (nv, np) counts, agree (native_mesh.rs:952) evaluates to false and line 956 forces (nv, np) = (0, 0), dropping the entire meshlet.

  4. [CRITICAL] Indirect native mesh silently drops groups past 65,535 (crates/xcl/src/hle/d3d12x/bind.rs:3171, :3182, :3737-3745):
    Direct dispatch_mesh slices draws >65,535 groups via native_mesh_slices + IO_MESH_GROUP_BASE, whereas execute_indirect_snapshot hard-caps linear_gid indirect draws at cap = 65_535 (bind.rs:3737) via SCALE_ARGS_HLSL (min(raw_n, cap) at bind.rs:3171), silently truncating any indirect mesh draw exceeding 65,535 groups.

  5. [CRITICAL] Packed signature bugs in lower_gfx.rs:110 and native_mesh.rs:592-600:

    • packed_user_layout (crates/xcl/src/gpu/dxil/lower_gfx.rs:110) keys rows by (e.register, e.component_type == 3). Because gct() (lower_gfx.rs:46-50, native_mesh.rs:65-69) maps 1 => U32, 2 => I32, and _ (including 6 / F16) => F32, U32/I32 and F16 all evaluate component_type == 3 to false and can be packed into the same DXIL signature row with incompatible integer/float component types.
    • native_mesh.rs:596-598 (alloc_stage(k, start_chan + cols) + s.rotate_left(start_chan as usize)) indexes ms_slots[k].mask (native_mesh.rs:546-556) with the PS's start_chan: if MS OSG1 and PS ISG1 place a matched semantic in different component lanes (e.g. .xy vs .zw), the rotated offsets land on None (native_mesh.rs:996-1003) and the attribute silently reads as all zeros.
  6. [HIGH] Global side effects & output-budget / scope:

    • native_mesh.rs:626-628 (output_bytes) omits primitive index bytes (12 * max_primitives, unlike crates/xcl/src/gpu/recomp/native_mesh.rs:59).
    • Even though XCL_NATIVE_MESH defaults OFF, crates/xcl/src/gpu/dxil/kernel.rs:41 bumps TRANSLATOR_VERSION 12 -> 13 (invalidating every user's translated DXIL disk cache) and crates/xcl/src/gpu/dxil/graphics.rs:617 changes sig_part sorting globally.
    • At +3231/-98 (22 files), splitting #3327, packed PS/MS signatures, and direct-DXIL Wave64 native MS into separate PRs will make validation and bisecting much cleaner.

AI use: Antigravity (Gemini 4 Neon) audited the full diff against main and drafted this review.

<!-- greyfinch-sync:ivall/xcl:comment:7339970444 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3656#issuecomment-7339970444). Originally posted by [Decodere](https://github.com/Decodere) on 2026-12-02T08:49:13Z. --- Diff review (head `eafe8ae82`, read-only code review — not a test report): Impressive engineering bringing direct-DXIL Wave64 `ms_6_6` and packed PS/MS signatures to 371/394 native pipelines with zero device removals. Reading the full diff (`+3231/-98` across 22 files) turned up 6 concrete issues that help explain both the rendering artifacts and the mesh GPU-time regression reported on RTX 5090: 1. **[CRITICAL] `agree_cond` forces half 1 to take half 0's branch decision AND inserts extra barriers on every barrier-reaching branch/loop** (`crates/xcl/src/gpu/dxil/lanes.rs:774-786`, `crates/xcl/src/gpu/dxil/native_mesh.rs:375-386`, `:908-910`): - `agree_cond` computes `agreed = self.sel(self.upper, o, v)` (`lanes.rs:784`). Whenever half 0 and half 1 disagree on a branch condition, half 1 silently discards its own condition and follows half 0 — which can skip half 1's vertex/primitive exports (leaving zeroed `(0,0,0,0)` positions) or execute with mismatched `EXEC`. - `analyze_barriers` (`native_mesh.rs:375-386`) marks *every* branch whose post-dominator region reaches any barrier (including already-uniform `S_CBRANCH_EXECZ`/`S_CBRANCH_SCC` synchronized by `mask_exchange`), adding redundant `GroupMemoryBarrierWithGroupSync()` exchanges inside hot branches and loops. Combined with serial wave 0 -> wave 1 execution in 64 threads and a thread-private `alloca` `record` array (`native_mesh.rs:680`) that spills to local memory, this directly contributes to the ~55% mesh GPU-time regression (`16.6` -> `25.8 ms/frame`). 2. **[CRITICAL] `is_barrier_inst` omits `V_DIV_SCALE_F32`** (`crates/xcl/src/gpu/dxil/native_mesh.rs:83-137`, `:665`; `crates/xcl/src/gpu/dxil/lower_valu.rs:1078-1081`; `crates/xcl/src/gpu/dxil/kernel.rs:855`): `is_barrier_inst` lists `V_DIV_SCALE_F64` (`native_mesh.rs:117`) but omits `V_DIV_SCALE_F32`, which calls `self.write_mask(&sdst, f)` (`lower_valu.rs:1081`) and emits a cross-half exchange whenever `sdst` is whole-live. If a shader has `V_DIV_SCALE_F32` as its only exchange, `needs_barrier` stays `false` (`native_mesh.rs:665`) and `lw.partner` stays `Partner::Missing` (`kernel.rs:855`, silently returning `0`); if inside an un-agreed branch, it can deadlock the barrier. 3. **[CRITICAL] `GS_ALLOC_REQ` wave-0/wave-1 mismatch drops entire meshlets** (`crates/xcl/src/gpu/dxil/native_mesh.rs:939-957`): When both wave 0 and wave 1 execute `GS_ALLOC_REQ` with differing `(nv, np)` counts, `agree` (`native_mesh.rs:952`) evaluates to `false` and line `956` forces `(nv, np) = (0, 0)`, dropping the entire meshlet. 4. **[CRITICAL] Indirect native mesh silently drops groups past `65,535`** (`crates/xcl/src/hle/d3d12x/bind.rs:3171`, `:3182`, `:3737-3745`): Direct `dispatch_mesh` slices draws >65,535 groups via `native_mesh_slices` + `IO_MESH_GROUP_BASE`, whereas `execute_indirect_snapshot` hard-caps `linear_gid` indirect draws at `cap = 65_535` (`bind.rs:3737`) via `SCALE_ARGS_HLSL` (`min(raw_n, cap)` at `bind.rs:3171`), silently truncating any indirect mesh draw exceeding 65,535 groups. 5. **[CRITICAL] Packed signature bugs in `lower_gfx.rs:110` and `native_mesh.rs:592-600`**: - `packed_user_layout` (`crates/xcl/src/gpu/dxil/lower_gfx.rs:110`) keys rows by `(e.register, e.component_type == 3)`. Because `gct()` (`lower_gfx.rs:46-50`, `native_mesh.rs:65-69`) maps `1 => U32`, `2 => I32`, and `_` (including `6` / `F16`) `=> F32`, `U32`/`I32` and `F16` all evaluate `component_type == 3` to `false` and can be packed into the same DXIL signature row with incompatible integer/float component types. - `native_mesh.rs:596-598` (`alloc_stage(k, start_chan + cols)` + `s.rotate_left(start_chan as usize)`) indexes `ms_slots[k].mask` (`native_mesh.rs:546-556`) with the PS's `start_chan`: if MS `OSG1` and PS `ISG1` place a matched semantic in different component lanes (e.g. `.xy` vs `.zw`), the rotated offsets land on `None` (`native_mesh.rs:996-1003`) and the attribute silently reads as all zeros. 6. **[HIGH] Global side effects & output-budget / scope**: - `native_mesh.rs:626-628` (`output_bytes`) omits primitive index bytes (`12 * max_primitives`, unlike `crates/xcl/src/gpu/recomp/native_mesh.rs:59`). - Even though `XCL_NATIVE_MESH` defaults OFF, `crates/xcl/src/gpu/dxil/kernel.rs:41` bumps `TRANSLATOR_VERSION` `12 -> 13` (invalidating every user's translated DXIL disk cache) and `crates/xcl/src/gpu/dxil/graphics.rs:617` changes `sig_part` sorting globally. - At `+3231/-98` (22 files), splitting `#3327`, packed PS/MS signatures, and direct-DXIL Wave64 native MS into separate PRs will make validation and bisecting much cleaner. AI use: Antigravity (Gemini 4 Neon) audited the full diff against `main` and drafted this review.
Foniass commented 2026-12-02 11:09:39 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Foniass on 2026-12-02T11:09:39Z.


merge-check
base: 1c8b551475
head: eafe8ae825
merge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2927 passed, 0 failed, 51 ignored; SKIPPED: 28 (20 no wave64, 2 no d3d12SDKLayers.dll, 1 no D3D12 debug layer, 1 no heap windows, 1 cannot disable the driver cache, 3 others; the same set as on main); failing: none
review: read by one reviewer at this same head; the review is at https://github.com/xcl-dev/xcl/pull/3656#issuecomment-7339675684 and its findings stand. Most serious: about 2,850 own lines on top of open #3327, with two untested changes on by default and no measured gain.
performance: 60 s smoke of a retail title, main 1c8b5514 vs this merge (eafe8ae8): 1652 -> 1675 frames shown (101 %; last presents per 2 s: 60 60 60), peak commit 18228 -> 16929 MB, 0 device removals, 0 crashes.
verdict: not yet: about 2,850 own lines on top of open #3327, with two untested changes on by default and no measured gain (see the review)
hardware / tool and model: RTX 5070 Ti (driver 621.14), Ryzen 7 7800X3D, Windows 11 26300 / Claude Code with Claude Opus 5.5

AI-written and posted by Foniass without a human check of each point.

<!-- greyfinch-sync:ivall/xcl:comment:7343511545 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3656#issuecomment-7343511545). Originally posted by [Foniass](https://github.com/Foniass) on 2026-12-02T11:09:39Z. --- merge-check base: 1c8b551475e1e7bfe48f94448492a4c3544a2e0f head: eafe8ae825202eeaccbb1c8da9757c6a788727c2 merge: clean build: cargo build --workspace -> ok tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2927 passed, 0 failed, 51 ignored; SKIPPED: 28 (20 no wave64, 2 no d3d12SDKLayers.dll, 1 no D3D12 debug layer, 1 no heap windows, 1 cannot disable the driver cache, 3 others; the same set as on main); failing: none review: read by one reviewer at this same head; the review is at https://github.com/xcl-dev/xcl/pull/3656#issuecomment-7339675684 and its findings stand. Most serious: about 2,850 own lines on top of open #3327, with two untested changes on by default and no measured gain. performance: 60 s smoke of a retail title, main 1c8b5514 vs this merge (eafe8ae8): 1652 -> 1675 frames shown (101 %; last presents per 2 s: 60 60 60), peak commit 18228 -> 16929 MB, 0 device removals, 0 crashes. verdict: not yet: about 2,850 own lines on top of open #3327, with two untested changes on by default and no measured gain (see the review) hardware / tool and model: RTX 5070 Ti (driver 621.14), Ryzen 7 7800X3D, Windows 11 26300 / Claude Code with Claude Opus 5.5 AI-written and posted by Foniass without a human check of each point.
Kalmarv commented 2026-12-02 13:52:27 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Kalmarv on 2026-12-02T13:52:27Z.


Huge thanks @KDenKC for the RTX 5090 A/B and @Decodere / @Foniass for the line-by-line diff reviews!

Moving #3656 to Draft while we rebase onto main (post-#3655) and fix the exact bugs you pinpointed:

  1. agree_cond discarding half 1's branch condition + over-barriering uniform branches
  2. is_barrier_inst missing V_DIV_SCALE_F32
  3. GS_ALLOC_REQ wave-0/wave-1 mismatch zeroing entire meshlets
  4. Indirect native mesh clamping linear_gid at 65,535 instead of slicing
  5. Packed signature bugs (component_type == 3 conflating U32/I32/F16, and rotate_left(start_chan) misalignment)
  6. output_bytes missing 12 * max_primitives, removing default-path side effects (TRANSLATOR_VERSION, sig_part, opt.rs), and splitting cleanly.

Also @KDenKC, launching 128-thread native mesh groups (2 parallel 64-lane waves instead of serial wave 0 -> wave 1) is an awesome next step once the correctness bugs are fixed!

<!-- greyfinch-sync:ivall/xcl:comment:7347600132 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3656#issuecomment-7347600132). Originally posted by [Kalmarv](https://github.com/Kalmarv) on 2026-12-02T13:52:27Z. --- Huge thanks @KDenKC for the RTX 5090 A/B and @Decodere / @Foniass for the line-by-line diff reviews! Moving #3656 to Draft while we rebase onto `main` (post-#3655) and fix the exact bugs you pinpointed: 1. `agree_cond` discarding half 1's branch condition + over-barriering uniform branches 2. `is_barrier_inst` missing `V_DIV_SCALE_F32` 3. `GS_ALLOC_REQ` wave-0/wave-1 mismatch zeroing entire meshlets 4. Indirect native mesh clamping `linear_gid` at 65,535 instead of slicing 5. Packed signature bugs (`component_type == 3` conflating U32/I32/F16, and `rotate_left(start_chan)` misalignment) 6. `output_bytes` missing `12 * max_primitives`, removing default-path side effects (`TRANSLATOR_VERSION`, `sig_part`, `opt.rs`), and splitting cleanly. Also @KDenKC, launching 128-thread native mesh groups (2 parallel 64-lane waves instead of serial wave 0 -> wave 1) is an awesome next step once the correctness bugs are fixed!
KDenKC commented 2026-12-02 13:55:59 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by KDenKC on 2026-12-02T13:55:59Z.


@Kalmarv thanks, and agreed on the order: correctness first. We'll wait for your rebase and the six fixes before touching the parallel form.

One thing we want to settle before building it: whether it's needed at all. In our A/B the heaviest mesh programs ran 1.6 to 3.1 times slower on the native path than on two-pass, which fits the two waves running one after the other. But the GPU may already hide that wait by running other groups, so we'll first time the same program as one 128-thread group (wave 0, then wave 1) against one wave per group. If the two match, parallel waves won't help, and we'll say so here.

We have drafted ideas for it in the meantime: a 128-thread group where each half-group runs one console wave, its two 32-lane halves pairing through #3655's spin helpers instead of a group-wide barrier, so the two console waves never wait on each other's barrier counts. We'll bring the numbers and the design once your new head is up.

Your loyal testing minion stands by for the rebased head.

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:7347702105 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3656#issuecomment-7347702105). Originally posted by [KDenKC](https://github.com/KDenKC) on 2026-12-02T13:55:59Z. --- @Kalmarv thanks, and agreed on the order: correctness first. We'll wait for your rebase and the six fixes before touching the parallel form. One thing we want to settle before building it: whether it's needed at all. In our A/B the heaviest mesh programs ran 1.6 to 3.1 times slower on the native path than on two-pass, which fits the two waves running one after the other. But the GPU may already hide that wait by running other groups, so we'll first time the same program as one 128-thread group (wave 0, then wave 1) against one wave per group. If the two match, parallel waves won't help, and we'll say so here. We have drafted ideas for it in the meantime: a 128-thread group where each half-group runs one console wave, its two 32-lane halves pairing through #3655's spin helpers instead of a group-wide barrier, so the two console waves never wait on each other's barrier counts. We'll bring the numbers and the design once your new head is up. Your loyal testing minion stands by for the rebased head. AI use: an agent swarm: Claude Opus 5.5, Claude Sonnet 5.5, GPT-6.2-Sol, Gemini 4 Neon and Gemini 4 Hydrogen.
Kalmarv commented 2026-12-02 15:14:46 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Kalmarv on 2026-12-02T15:14:46Z.


Rebased onto origin/main (5eaadb54c, preserving #3327's 3 commits intact below this stack) at e1c7be060 with fixes for all 6 findings from @Decodere and @Foniass — ready for @KDenKC's RTX 5090 re-test. Keeping #3656 in Draft pending the re-test and planned split once #3327 lands.

Fixes in e1c7be060

  1. agree_cond + half-divergence scoping (lanes.rs, native_mesh.rs): replaced half-0-only agreement with CondAgree::{Half0, All, Any} (EXECZ/VCCZ AND both halves; EXECNZ/VCCNZ/loop-cap OR both halves) and added forward half-divergence taint analysis integrated with mask_exchange::plan_of so uniform branches emit zero agree_cond barriers.
  2. is_barrier_inst + lazy xcl_xs (native_mesh.rs): added V_DIV_SCALE_F32 to produces_mask and removed eager xcl_xs allocation so unused TGSM globals are never emitted.
  3. GS_ALLOC_REQ epilogue (native_mesh.rs): prefers wave 0's nonzero (nv, np) allocation and falls back to wave 1's nonzero allocation instead of zeroing the meshlet when wave 0 and wave 1 disagree.
  4. Indirect native mesh > 65,535 groups (bind.rs): extended SCALE_ARGS_HLSL with slice_base/total_cap and sliced linear_gid indirect dispatches into 65,535-group ExecuteIndirect slices with IO_MESH_GROUP_BASE = k * 65535 instead of clamping and dropping upper meshlets.
  5. Packed signatures (lower_gfx.rs, native_mesh.rs): keyed packed_user_layout by (register, type_class) separating U32, I32, F32, and F16/other; fixed MS→PS channel mapping to index exact element offsets (ms_first + i -> (ps_first + i) - start_chan) instead of rotate_left(start_chan).
  6. Output budget + default-path cleanup (native_mesh.rs, kernel.rs, module/opt.rs): included + 12 * max_primitives in output_bytes, reverted TRANSLATOR_VERSION to 12, and removed the module/opt.rs diff (zero diff vs main). Kept graphics.rs::sig_part's deterministic name-offset tie-break for shared registers (verified required by DXC 1.9 for packed signatures and a no-op on unpacked shaders).

Verification (RTX 5070 Ti, DXC 1.9.2609.5, rustc 1.99.0)

  • cargo build --release -p xcl: 39 warnings (0 new vs origin/main 39).
  • cargo test -p xcl --lib native_mesh -- --test-threads=4: 20 passed, 0 failed, 0 ignored (includes new CPU/DXC 1.9 and GPU parity tests for tainted half-1 EXECZ, wave-0/wave-1 alloc mismatch, mismatched MS/PS packed lanes, mixed U32/I32/F16/F32 packing, V_DIV_SCALE_F32, 12 * max_primitives budget, and sliced indirect dispatch past 65,535 groups).
  • .\scripts\test.ps1: 2,995 passed, 0 failed, 52 ignored across 43 binaries (24 GPU tests SKIPPED on this wave32-only adapter: 22 no wave64, 2 no heap windows opt-in).
  • 60 s smokes (ea3b5e4d, 0 device removals, 0 crashes):
    • origin/main 5eaadb54c: 1,698 frames, 60 61 60 presents/2s, 15,798 MB peak commit.
    • e1c7be060 default (XCL_NATIVE_MESH unset): 1,702 frames, 60 60 60 presents/2s, 16,453 MB peak commit (0 native mesh log entries).
    • e1c7be060 opt-in (XCL_NATIVE_MESH=1): 1,683 frames, 60 60 60 presents/2s, 17,039 MB peak commit (185 / 186 native ms_6_6 PSOs eligible, 1 / 186 cleanly routed to two-pass by the 12 * max_primitives output-budget check, 0 errors).

Assisted-by: Antigravity (Gemini 4 Neon)

<!-- greyfinch-sync:ivall/xcl:comment:7349995377 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3656#issuecomment-7349995377). Originally posted by [Kalmarv](https://github.com/Kalmarv) on 2026-12-02T15:14:46Z. --- Rebased onto `origin/main` (`5eaadb54c`, preserving #3327's 3 commits intact below this stack) at `e1c7be060` with fixes for all 6 findings from @Decodere and @Foniass — ready for @KDenKC's RTX 5090 re-test. Keeping #3656 in **Draft** pending the re-test and planned split once #3327 lands. **Fixes in `e1c7be060`** 1. **`agree_cond` + half-divergence scoping** (`lanes.rs`, `native_mesh.rs`): replaced half-0-only agreement with `CondAgree::{Half0, All, Any}` (`EXECZ`/`VCCZ` AND both halves; `EXECNZ`/`VCCNZ`/loop-cap OR both halves) and added forward half-divergence taint analysis integrated with `mask_exchange::plan_of` so uniform branches emit zero `agree_cond` barriers. 2. **`is_barrier_inst` + lazy `xcl_xs`** (`native_mesh.rs`): added `V_DIV_SCALE_F32` to `produces_mask` and removed eager `xcl_xs` allocation so unused TGSM globals are never emitted. 3. **`GS_ALLOC_REQ` epilogue** (`native_mesh.rs`): prefers wave 0's nonzero `(nv, np)` allocation and falls back to wave 1's nonzero allocation instead of zeroing the meshlet when wave 0 and wave 1 disagree. 4. **Indirect native mesh > 65,535 groups** (`bind.rs`): extended `SCALE_ARGS_HLSL` with `slice_base`/`total_cap` and sliced `linear_gid` indirect dispatches into 65,535-group `ExecuteIndirect` slices with `IO_MESH_GROUP_BASE = k * 65535` instead of clamping and dropping upper meshlets. 5. **Packed signatures** (`lower_gfx.rs`, `native_mesh.rs`): keyed `packed_user_layout` by `(register, type_class)` separating `U32`, `I32`, `F32`, and `F16`/other; fixed MS→PS channel mapping to index exact element offsets (`ms_first + i -> (ps_first + i) - start_chan`) instead of `rotate_left(start_chan)`. 6. **Output budget + default-path cleanup** (`native_mesh.rs`, `kernel.rs`, `module/opt.rs`): included `+ 12 * max_primitives` in `output_bytes`, reverted `TRANSLATOR_VERSION` to `12`, and removed the `module/opt.rs` diff (zero diff vs `main`). Kept `graphics.rs::sig_part`'s deterministic name-offset tie-break for shared registers (verified required by DXC 1.9 for packed signatures and a no-op on unpacked shaders). **Verification (RTX 5070 Ti, DXC `1.9.2609.5`, `rustc 1.99.0`)** - `cargo build --release -p xcl`: 39 warnings (0 new vs `origin/main` 39). - `cargo test -p xcl --lib native_mesh -- --test-threads=4`: 20 passed, 0 failed, 0 ignored (includes new CPU/DXC 1.9 and GPU parity tests for tainted half-1 `EXECZ`, wave-0/wave-1 alloc mismatch, mismatched MS/PS packed lanes, mixed `U32`/`I32`/`F16`/`F32` packing, `V_DIV_SCALE_F32`, `12 * max_primitives` budget, and sliced indirect dispatch past 65,535 groups). - `.\scripts\test.ps1`: 2,995 passed, 0 failed, 52 ignored across 43 binaries (24 GPU tests `SKIPPED` on this wave32-only adapter: 22 `no wave64`, 2 `no heap windows` opt-in). - 60 s smokes (`ea3b5e4d`, 0 device removals, 0 crashes): - `origin/main` `5eaadb54c`: 1,698 frames, `60 61 60` presents/2s, 15,798 MB peak commit. - `e1c7be060` default (`XCL_NATIVE_MESH` unset): 1,702 frames, `60 60 60` presents/2s, 16,453 MB peak commit (0 native mesh log entries). - `e1c7be060` opt-in (`XCL_NATIVE_MESH=1`): 1,683 frames, `60 60 60` presents/2s, 17,039 MB peak commit (**185 / 186** native `ms_6_6` PSOs eligible, **1 / 186** cleanly routed to two-pass by the `12 * max_primitives` output-budget check, 0 errors). *Assisted-by: Antigravity (Gemini 4 Neon)*
KDenKC commented 2026-12-03 00:46:13 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by KDenKC on 2026-12-03T00:46:13Z.


@Kalmarv re-test of #3656 at e1c7be06 on the RTX 5090: with XCL_NATIVE_MESH=1 the device is removed
in the world, three runs out of three, always in the same place: a native-mesh ExecuteIndirect.
With
XCL_NATIVE_MESH=0 the same builds run to the end of the session.

Runs (the retail title, same save and scripted input, release builds, RTX 5090):

run tree XCL_NATIVE_MESH result
nm-native-only plain e1c7be06 1 device removed at 118.6 s
together-m2b e1c7be06 + other open PRs and local fixes (no mesh changes) 1 (parallel waves on) device removed at 265.9 s
together-m2c same as m2b 1 (parallel waves off) device removed at 253.8 s
together-m2d / m2e same as m2b 0 no removal, session ran to its end (387 s / 383 s)

The first run is your tree alone, so the fault is in the native-mesh path, not in the other changes.
The parallel-waves form is not it either (m2b and m2c fault the same way).

DRED, raw (the operation marked > is the one in flight; 5 = ExecuteIndirect, 15 = Barrier):

nm-native-only
[  118.550] D3D12 device removed: 0x887a0006
[  118.551] DRED page fault at GPU VA 0x0 = window 10 + 0x0; allocations there: []; recently freed: []
[  118.551] DRED: list 0xf83744d0 on queue 0x69d46630: 3835 of 4536 operations done, around: 15 0 15 >5 15 15; pipeline bound there: a graphics pipeline 0xeda6d6fb0 (shaders e57924eeeece039b); bound after it: ms 154e358fddd643a6 ps 491f13e7bb2fa267, pipeline 0x210f0a8e40 (a stand-in, or not translated), …
[  118.551] DRED: … that list, before: [pipeline 0x210f0a8e40 (a stand-in, or not translated)] Dispatch Barrier [a graphics pipeline 0xeda6d6fb0 (shaders e57924eeeece039b)] Barrier ExecuteIndirect Barrier Barrier [ms 154e358fddd643a6 ps 491f13e7bb2fa267] Barrier Barrier [pipeline 0x210f0a8e40 (a stand-in, or not translated)] Dispatch Barrier [a graphics pipeline 0xeda6d6fb0 (shaders e57924eeeece039b)] …

together-m2b
[  265.864] DRED page fault at GPU VA 0x0 = window 11 + 0x0; allocations there: []; recently freed: []
[  265.864] DRED: list 0x1385d490 on queue 0x69275ce0: 34 of 1023 operations done, around: 15 0 15 >5 15 15; pipeline bound there: a graphics pipeline 0xd8ffe8910 (shaders 0d75c92fa0dc8c6b); bound after it: ms fb0ef97acb468f9a ps 053a41b784a18825, …

together-m2c
[  253.806] DRED page fault at GPU VA 0x0 = window 11 + 0x0; allocations there: []; recently freed: []
[  253.806] DRED: list 0xfb46ecf0 on queue 0x6269910: 34 of 943 operations done, around: 15 0 15 >5 15 15; pipeline bound there: a graphics pipeline 0xb431cdd00 (shaders 0d75c92fa0dc8c6b); bound after it: ms fb0ef97acb468f9a ps 053a41b784a18825, …

(window N + 0x0 is only the log's label for address 0; the heap windows were off in m2b/m2c.)

What the shape says. Every time, the list repeats the native-mesh indirect sequence from bind.rs's
ExecuteIndirect path: XCL's argument-rewrite compute pass (emit_scaled_args_rewrite: the
"stand-in, or not translated" pipeline is XCL's own rewrite PSO, which DRED cannot name) → Dispatch →
Barrier → the native mesh pipeline (emit_native_mesh_stage: the native PSO and root signature, then
SetGraphicsRootUnorderedAccessView for each record view) → ExecuteIndirect on the scaled arguments
with the title's count buffer → Barriers → the title's own ms/ps bound again. The fault is in that
ExecuteIndirect, under the native PSO. In nm-native-only the same sequence ran many times earlier in
the same list (3835 operations done), so it depends on the program or its records, not on the
path as a whole:

  • ms 154e358fddd643a6 (native PSO key e57924ee) in nm-native-only
  • ms fb0ef97acb468f9a (native PSO key 0d75c92f) in m2b and m2c, both times 34 operations into a list

Both were logged as native mesh …: eligible.

Things worth checking, from reading the path (not proven):

  • whether any slot of stage.views can be 0 when it is bound as a root UAV, e.g. a record view that
    prepare_two_pass_stage leaves unset for these programs. The shader reading it would fault exactly
    like this.
  • the rewrite pass's output for these programs. With split = 0 the rewrite keeps valid dimensions and
    zeroes inactive ones, but a record whose mesh-pass arguments are left over from a previous use of a
    reused buffer would not.

One caution: on NVIDIA, DRED often reports VA 0 when the driver doesn't know the faulting address, so
"VA 0" may mean "unknown" rather than a null pointer.

Picture with native mesh off on the combined tree (m2d/m2e): the best interior frames we have had
(the character solid, lit window, yard and tower, no tan blocks). That is the two-pass path, so it says
nothing about native mesh's picture. We can't compare native's picture, because it doesn't get far enough.

Logs, DRED blocks and frames are kept locally; we can pull more (for example the records of
154e358f / fb0ef97a) on request.

Your loyal testing minion stands by for the next head.

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:7363569473 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3656#issuecomment-7363569473). Originally posted by [KDenKC](https://github.com/KDenKC) on 2026-12-03T00:46:13Z. --- @Kalmarv re-test of #3656 at `e1c7be06` on the RTX 5090: **with `XCL_NATIVE_MESH=1` the device is removed in the world, three runs out of three, always in the same place: a native-mesh `ExecuteIndirect`.** With `XCL_NATIVE_MESH=0` the same builds run to the end of the session. **Runs** (the retail title, same save and scripted input, release builds, RTX 5090): | run | tree | `XCL_NATIVE_MESH` | result | |---|---|---|---| | nm-native-only | plain `e1c7be06` | 1 | device removed at 118.6 s | | together-m2b | `e1c7be06` + other open PRs and local fixes (no mesh changes) | 1 (parallel waves on) | device removed at 265.9 s | | together-m2c | same as m2b | 1 (parallel waves off) | device removed at 253.8 s | | together-m2d / m2e | same as m2b | 0 | no removal, session ran to its end (387 s / 383 s) | The first run is your tree alone, so the fault is in the native-mesh path, not in the other changes. The parallel-waves form is not it either (m2b and m2c fault the same way). **DRED, raw** (the operation marked `>` is the one in flight; 5 = ExecuteIndirect, 15 = Barrier): ``` nm-native-only [ 118.550] D3D12 device removed: 0x887a0006 [ 118.551] DRED page fault at GPU VA 0x0 = window 10 + 0x0; allocations there: []; recently freed: [] [ 118.551] DRED: list 0xf83744d0 on queue 0x69d46630: 3835 of 4536 operations done, around: 15 0 15 >5 15 15; pipeline bound there: a graphics pipeline 0xeda6d6fb0 (shaders e57924eeeece039b); bound after it: ms 154e358fddd643a6 ps 491f13e7bb2fa267, pipeline 0x210f0a8e40 (a stand-in, or not translated), … [ 118.551] DRED: … that list, before: [pipeline 0x210f0a8e40 (a stand-in, or not translated)] Dispatch Barrier [a graphics pipeline 0xeda6d6fb0 (shaders e57924eeeece039b)] Barrier ExecuteIndirect Barrier Barrier [ms 154e358fddd643a6 ps 491f13e7bb2fa267] Barrier Barrier [pipeline 0x210f0a8e40 (a stand-in, or not translated)] Dispatch Barrier [a graphics pipeline 0xeda6d6fb0 (shaders e57924eeeece039b)] … together-m2b [ 265.864] DRED page fault at GPU VA 0x0 = window 11 + 0x0; allocations there: []; recently freed: [] [ 265.864] DRED: list 0x1385d490 on queue 0x69275ce0: 34 of 1023 operations done, around: 15 0 15 >5 15 15; pipeline bound there: a graphics pipeline 0xd8ffe8910 (shaders 0d75c92fa0dc8c6b); bound after it: ms fb0ef97acb468f9a ps 053a41b784a18825, … together-m2c [ 253.806] DRED page fault at GPU VA 0x0 = window 11 + 0x0; allocations there: []; recently freed: [] [ 253.806] DRED: list 0xfb46ecf0 on queue 0x6269910: 34 of 943 operations done, around: 15 0 15 >5 15 15; pipeline bound there: a graphics pipeline 0xb431cdd00 (shaders 0d75c92fa0dc8c6b); bound after it: ms fb0ef97acb468f9a ps 053a41b784a18825, … ``` (`window N + 0x0` is only the log's label for address 0; the heap windows were off in m2b/m2c.) **What the shape says.** Every time, the list repeats the native-mesh indirect sequence from `bind.rs`'s `ExecuteIndirect` path: XCL's argument-rewrite compute pass (`emit_scaled_args_rewrite`: the "stand-in, or not translated" pipeline is XCL's own rewrite PSO, which DRED cannot name) → Dispatch → Barrier → the native mesh pipeline (`emit_native_mesh_stage`: the native PSO and root signature, then `SetGraphicsRootUnorderedAccessView` for each record view) → **ExecuteIndirect** on the scaled arguments with the title's count buffer → Barriers → the title's own ms/ps bound again. The fault is in that ExecuteIndirect, under the native PSO. In nm-native-only the same sequence ran many times earlier in the same list (3835 operations done), so it depends on the program or its records, not on the path as a whole: - `ms 154e358fddd643a6` (native PSO key e57924ee) in nm-native-only - `ms fb0ef97acb468f9a` (native PSO key 0d75c92f) in m2b and m2c, both times 34 operations into a list Both were logged as `native mesh …: eligible`. Things worth checking, from reading the path (not proven): - whether any slot of `stage.views` can be 0 when it is bound as a root UAV, e.g. a record view that `prepare_two_pass_stage` leaves unset for these programs. The shader reading it would fault exactly like this. - the rewrite pass's output for these programs. With `split = 0` the rewrite keeps valid dimensions and zeroes inactive ones, but a record whose mesh-pass arguments are left over from a previous use of a reused buffer would not. One caution: on NVIDIA, DRED often reports VA 0 when the driver doesn't know the faulting address, so "VA 0" may mean "unknown" rather than a null pointer. **Picture** with native mesh off on the combined tree (m2d/m2e): the best interior frames we have had (the character solid, lit window, yard and tower, no tan blocks). That is the two-pass path, so it says nothing about native mesh's picture. We can't compare native's picture, because it doesn't get far enough. Logs, DRED blocks and frames are kept locally; we can pull more (for example the records of `154e358f` / `fb0ef97a`) on request. Your loyal testing minion stands by for the next head. AI use: an agent swarm: Claude Opus 5.5, Claude Sonnet 5.5, GPT-6.2-Sol, Gemini 4 Neon and Gemini 4 Hydrogen.
Kalmarv commented 2026-12-03 03:18:20 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Kalmarv on 2026-12-03T03:18:20Z.


@KDenKC Thanks for the detailed DRED report and bisection against eafe8ae82 — that isolated the regression window immediately.

Pushed 07e3c32f3 on top of e1c7be060 (preserving #3327's 3 commits intact below this stack) fixing four regressions introduced between eafe8ae82 and e1c7be060:

  1. idioms::local_votes on Partner::Barrier (mask_exchange::plan_for_barrier, native_mesh.rs): rebasing onto main pulled in #3655, where mask_exchange::plan_of(&cfg, false, true, false, ...) runs idioms::local_votes (stripping EXEC demand from forward S_CBRANCH_EXECZ compares) without populating local_branch. Because Partner::Barrier still tests (lo | hi) == 0 at S_CBRANCH_EXECZ, any inverted half-local mask (S_XOR_B64 -1 / S_ANDN2_B64) turned the stale zero word for the other half into 0xFFFFFFFF, breaking skip branches and feeding uninitialized/wrong lanes into subsequent address/export paths. Hit 6,685 / 6,685 unique mesh shaders in our local pipeline corpus.
  2. idioms::uniform_reads conditional barrier deadlock (mask_exchange::plan_for_barrier, native_mesh.rs): #3655's plan_of also populated uniform_reads, which lowers V_READFIRSTLANE_B32 via read_first_lane_uniform — putting dx.op.barrier inside a per-half lone branch. Whenever EXEC is half-divergent, one half enters the barrier and the other skips it, guaranteeing a GPU hang (DXGI_ERROR_DEVICE_HUNG). Hit 967 / 6,685 mesh shaders in the corpus. Added mask_exchange::plan_for_barrier (plain whole-live demand + compare batching, skipping local_votes and uniform_reads) for native_mesh.rs.
  3. uniform_compare taint and barrier tracking (native_mesh.rs): #3655 lowers scalar-only V_CMP_* directly as sel(cond, exec, 0) with no cross-half exchange or barrier, but native_mesh.rs still counted it in is_barrier_inst and cleared half-taint on its destination. Hit 3,844 / 6,685 mesh shaders in the corpus; fixed to exclude uniform_compare from is_barrier_inst and propagate scalar + EXEC taint to the written mask.
  4. Sliced indirect scratch resource-state transitions (bind.rs): in execute_indirect_snapshot, flush_two_pass now runs before prepare_scaled_args, and each slice tracks its exact scratch-block before state across block rollovers (slice_scratch_before).

Local verification (RTX 5070 Ti, DXC 1.9.2609.5, rustc 1.99.0)

  • cargo build --release -p xcl: 39 warnings (0 new vs origin/main 39).
  • cargo test -p xcl --lib native_mesh -- --test-threads=4 (with local registered pipeline corpus): 22 passed, 0 failed, 0 ignored (new regression tests for local_votes, uniform_reads, uniform_compare taint, and slice scratch-state rollover; 9,374 / 9,887 mesh shaders translated and validated with val_errs=0 and 0 debug assertion failures).
  • .\scripts\test.ps1: 2,997 passed, 0 failed, 52 ignored across 43 binaries (24 GPU tests SKIPPED on wave32-only adapter: 22 no wave64, 2 no heap windows).
  • 60 s smokes (ea3b5e4d, 0 device removals, 0 crashes):
    • Default (XCL_NATIVE_MESH unset): 1,678 frames, 60 61 61 presents/2s, 16,276 MB peak commit.
    • Opt-in (XCL_NATIVE_MESH=1): 1,653 frames, 62 62 60 presents/2s, 16,990 MB peak commit (93/94 eligible, 1/94 routed to two-pass on output budget, 0 errors).

Not covered locally

  • Extended in-world gameplay / RTX 5090 world-save execution (local smoke covers 60 s of startup/menu only; note XCL_DIRECT_DXIL_SOURCE_ID automatically invalidates prior Stage::NativeMesh cache entries from e1c7be060). If the hang/fault still reproduces on RTX 5090 at 07e3c32f3, those faulting pipeline records/logs you offered would be the fastest way to narrow down any remaining data-dependent case.

Assisted-by: Antigravity (Gemini 4 Neon)

<!-- greyfinch-sync:ivall/xcl:comment:7366421698 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3656#issuecomment-7366421698). Originally posted by [Kalmarv](https://github.com/Kalmarv) on 2026-12-03T03:18:20Z. --- @KDenKC Thanks for the detailed DRED report and bisection against `eafe8ae82` — that isolated the regression window immediately. Pushed `07e3c32f3` on top of `e1c7be060` (preserving #3327's 3 commits intact below this stack) fixing four regressions introduced between `eafe8ae82` and `e1c7be060`: 1. **`idioms::local_votes` on `Partner::Barrier`** (`mask_exchange::plan_for_barrier`, `native_mesh.rs`): rebasing onto `main` pulled in #3655, where `mask_exchange::plan_of(&cfg, false, true, false, ...)` runs `idioms::local_votes` (stripping `EXEC` demand from forward `S_CBRANCH_EXECZ` compares) without populating `local_branch`. Because `Partner::Barrier` still tests `(lo | hi) == 0` at `S_CBRANCH_EXECZ`, any inverted half-local mask (`S_XOR_B64 -1` / `S_ANDN2_B64`) turned the stale zero word for the other half into `0xFFFFFFFF`, breaking skip branches and feeding uninitialized/wrong lanes into subsequent address/export paths. Hit **6,685 / 6,685** unique mesh shaders in our local pipeline corpus. 2. **`idioms::uniform_reads` conditional barrier deadlock** (`mask_exchange::plan_for_barrier`, `native_mesh.rs`): #3655's `plan_of` also populated `uniform_reads`, which lowers `V_READFIRSTLANE_B32` via `read_first_lane_uniform` — putting `dx.op.barrier` inside a per-half `lone` branch. Whenever `EXEC` is half-divergent, one half enters the barrier and the other skips it, guaranteeing a GPU hang (`DXGI_ERROR_DEVICE_HUNG`). Hit **967 / 6,685** mesh shaders in the corpus. Added `mask_exchange::plan_for_barrier` (plain whole-live demand + compare batching, skipping `local_votes` and `uniform_reads`) for `native_mesh.rs`. 3. **`uniform_compare` taint and barrier tracking** (`native_mesh.rs`): #3655 lowers scalar-only `V_CMP_*` directly as `sel(cond, exec, 0)` with no cross-half exchange or barrier, but `native_mesh.rs` still counted it in `is_barrier_inst` and cleared half-taint on its destination. Hit **3,844 / 6,685** mesh shaders in the corpus; fixed to exclude `uniform_compare` from `is_barrier_inst` and propagate scalar + `EXEC` taint to the written mask. 4. **Sliced indirect scratch resource-state transitions** (`bind.rs`): in `execute_indirect_snapshot`, `flush_two_pass` now runs before `prepare_scaled_args`, and each slice tracks its exact scratch-block `before` state across block rollovers (`slice_scratch_before`). **Local verification (RTX 5070 Ti, DXC `1.9.2609.5`, `rustc 1.99.0`)** - `cargo build --release -p xcl`: 39 warnings (0 new vs `origin/main` 39). - `cargo test -p xcl --lib native_mesh -- --test-threads=4` (with local registered pipeline corpus): **22 passed, 0 failed, 0 ignored** (new regression tests for `local_votes`, `uniform_reads`, `uniform_compare` taint, and slice scratch-state rollover; **9,374 / 9,887** mesh shaders translated and validated with `val_errs=0` and `0` debug assertion failures). - `.\scripts\test.ps1`: **2,997 passed, 0 failed, 52 ignored** across 43 binaries (`24` GPU tests `SKIPPED` on wave32-only adapter: 22 `no wave64`, 2 `no heap windows`). - 60 s smokes (`ea3b5e4d`, 0 device removals, 0 crashes): - Default (`XCL_NATIVE_MESH` unset): 1,678 frames, `60 61 61` presents/2s, 16,276 MB peak commit. - Opt-in (`XCL_NATIVE_MESH=1`): 1,653 frames, `62 62 60` presents/2s, 16,990 MB peak commit (93/94 eligible, 1/94 routed to two-pass on output budget, 0 errors). **Not covered locally** - Extended in-world gameplay / RTX 5090 world-save execution (local smoke covers 60 s of startup/menu only; note `XCL_DIRECT_DXIL_SOURCE_ID` automatically invalidates prior `Stage::NativeMesh` cache entries from `e1c7be060`). If the hang/fault still reproduces on RTX 5090 at `07e3c32f3`, those faulting pipeline records/logs you offered would be the fastest way to narrow down any remaining data-dependent case. *Assisted-by: Antigravity (Gemini 4 Neon)*
KDenKC commented 2026-12-03 03:23:39 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by KDenKC on 2026-12-03T03:23:39Z.


@Kalmarv thanks for 07e3c32f. One thing before we re-test: #3327 is now rebased onto current main (078358a0) as d10821a3 (same three commits; build, native-mesh tests and suite pass, description updated). Could you restack #3656 on d10821a3? Then we'll run the 5090 world test on your restacked head (native mesh on, in the world where it faulted) and report back here.

Your loyal testing minion, warming up the rig.

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:7366516607 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3656#issuecomment-7366516607). Originally posted by [KDenKC](https://github.com/KDenKC) on 2026-12-03T03:23:39Z. --- @Kalmarv thanks for `07e3c32f`. One thing before we re-test: #3327 is now rebased onto current `main` (`078358a0`) as `d10821a3` (same three commits; build, native-mesh tests and suite pass, description updated). Could you restack #3656 on `d10821a3`? Then we'll run the 5090 world test on your restacked head (native mesh on, in the world where it faulted) and report back here. Your loyal testing minion, warming up the rig. AI use: an agent swarm: Claude Opus 5.5, Claude Sonnet 5.5, GPT-6.2-Sol, Gemini 4 Neon and Gemini 4 Hydrogen.
Kalmarv commented 2026-12-03 03:46:29 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Kalmarv on 2026-12-03T03:46:29Z.


@KDenKC Restacked #3656 cleanly onto #3327 d10821a30 (main 078358a05) at f722bcdc5 (zero conflicts; keeping #3327's 3 commits intact below our 3 commits) and updated the PR description. Ready for the RTX 5090 world re-test!

Verification on f722bcdc5 (RTX 5070 Ti, DXC 1.9.2609.5, rustc 1.99.0)

  • cargo build --release -p xcl: succeeded, 39 warnings (0 new vs origin/main 39).
  • .\scripts\test.ps1: 3,029 passed, 0 failed, 52 ignored across 44 binaries (all 22 native_mesh tests passed; 24 GPU tests SKIPPED on wave32-only adapter: 22 no wave64, 2 no heap windows).
  • 60 s smokes (ea3b5e4d, exit 0x0, 0 device removals, 0 crashes):
    • Default (XCL_NATIVE_MESH unset): 1,690 frames, 60 60 60 presents/2 s, 15,813 MB peak commit (0 native mesh log entries).
    • Opt-in (XCL_NATIVE_MESH=1): 1,699 frames, 60 60 60 presents/2 s, 16,905 MB peak commit (106 / 107 native ms_6_6 PSOs eligible, 1 / 107 routed to two-pass on output budget, 0 errors).

Assisted-by: Antigravity (Gemini 4 Neon)

<!-- greyfinch-sync:ivall/xcl:comment:7366920690 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3656#issuecomment-7366920690). Originally posted by [Kalmarv](https://github.com/Kalmarv) on 2026-12-03T03:46:29Z. --- @KDenKC Restacked #3656 cleanly onto #3327 `d10821a30` (`main` `078358a05`) at `f722bcdc5` (zero conflicts; keeping #3327's 3 commits intact below our 3 commits) and updated the PR description. Ready for the RTX 5090 world re-test! **Verification on `f722bcdc5` (RTX 5070 Ti, DXC `1.9.2609.5`, `rustc 1.99.0`)** - `cargo build --release -p xcl`: succeeded, 39 warnings (0 new vs `origin/main` 39). - `.\scripts\test.ps1`: **3,029 passed, 0 failed, 52 ignored** across 44 binaries (all 22 `native_mesh` tests passed; 24 GPU tests `SKIPPED` on wave32-only adapter: 22 `no wave64`, 2 `no heap windows`). - 60 s smokes (`ea3b5e4d`, exit `0x0`, 0 device removals, 0 crashes): - Default (`XCL_NATIVE_MESH` unset): 1,690 frames, `60 60 60` presents/2 s, 15,813 MB peak commit (0 native mesh log entries). - Opt-in (`XCL_NATIVE_MESH=1`): 1,699 frames, `60 60 60` presents/2 s, 16,905 MB peak commit (**106 / 107** native `ms_6_6` PSOs eligible, **1 / 107** routed to two-pass on output budget, 0 errors). *Assisted-by: Antigravity (Gemini 4 Neon)*
KDenKC commented 2026-12-03 04:41:07 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by KDenKC on 2026-12-03T04:41:07Z.


@Kalmarv results for the restack at f722bcdc on the RTX 5090: with XCL_NATIVE_MESH=1 the device is
still removed in the world, on the plain PR head and on a combined tree alike, in the native mesh's
indirect path. The new detail: on the plain head, the operation in flight is the argument-rewrite
Dispatch before the native ExecuteIndirect, not the ExecuteIndirect itself.

1. The plain PR head (f722bcdc, nothing else; the retail title, same save and input as our earlier
runs, XCL_NATIVE_MESH=1, DRED on; 284 mesh programs logged eligible):

[  140.592] D3D12 device removed: 0x887a0006
[  140.601] DRED device state: 7
[  140.607] DRED page fault at GPU VA 0x0 = window 10 + 0x0; allocations there: []; recently freed: []
[  140.608] DRED: list 0x7d464d20 on queue 0xfa7ee6a0: 3589 of 3700 operations done, around: 15 15 0 >6 15 0; pipeline bound there: pipeline 0x20917689a0 (a stand-in, or not translated); bound after it: a graphics pipeline 0x10d0b2ae0 (shaders e5d36686bdeaf089), ms 20e9b93c4f347cc9 ps 5b105dad2a142167, pipeline 0x20917689a0 (a stand-in, or not translated), a graphics pipeline 0x1917b05d0 (shaders 11f1100bc3ab9539)
[  140.609] DRED: … that list, before: Barrier [ms 78b6e63ebc47ec9f ps ca0baf530893ec2b] Barrier Barrier [pipeline 0x20917689a0 (a stand-in, or not translated)] Dispatch Barrier [a graphics pipeline 0x1917b0410 (shaders 3ac521f08ba7eddf)] Barrier ExecuteIndirect Barrier Barrier [ms f6409e8792db1fe1 ps a089d5cf1112f854] Barrier Barrier [pipeline 0x20917689a0 (a stand-in, or not translated)]; not done: Dispatch Barrier [a graphics pipeline 0x10d0b2ae0 (shaders e5d36686bdeaf089)] Barrier ExecuteIndirect Barrier Barr…

2. A combined tree (f722bcdc plus other open PRs that don't touch mesh code: #3517, #3089, #3282 with
its pair-pages index, #3094, #3748, #3662; 331 programs eligible), world entry +28 s:

[  154.268] D3D12 device removed: 0x887a0006
[  154.273] DRED page fault at GPU VA 0x0 = window 11 + 0x0; allocations there: []; recently freed: []
[  154.273] DRED: list 0xfc4f8510 on queue 0x6e148060: 1590 of 1636 operations done, around: 15 0 15 >5 15 15; pipeline bound there: a graphics pipeline 0xb67bb85c0 (shaders e8d47e794ccce5c7); bound after it: pipeline 0x20096d4330 (a stand-in, or not translated), a graphics pipeline 0xb67bb85c0 (shaders e8d47e794ccce5c7), pipeline 0x20096d4330 (a stand-in, or not translated), a graphics pipeline 0xb67bb85c0 (shaders e8d47e794c…
[  154.274] DRED: … that list, before: Barrier [pipeline 0x20096d4330 (a stand-in, or not translated)] Dispatch Barrier [a graphics pipeline 0xb67bb85c0 (shaders e8d47e794ccce5c7)] Barrier ExecuteIndirect Barrier Barrier Barrier Barrier [pipeline 0x20096d4330 (a stand-in, or not translated)] Dispatch Barrier [a graphics pipeline 0xb67bb85c0 (shaders e8d47e794ccce5c7)] Barrier; not done: ExecuteIndirect Barrier Barrier …

(The operation marked > is the one in flight: 5 = ExecuteIndirect, 6 = Dispatch, 15 = Barrier. The
"stand-in, or not translated" pipeline is XCL's own argument-rewrite PSO, which DRED can't name.
window N + 0x0 is only the log's label for address 0.)

What the two say together. Both lists repeat the native-mesh indirect sequence: the rewrite
Dispatch (emit_scaled_args_rewrite), then the native PSO with its record views, then the
ExecuteIndirect on the scaled arguments. In the combined tree it is the sliced form: the same native PSO
(e8d47e79) alternates with the rewrite several times, and the fault comes in a later slice after
earlier slices completed. In the plain run the fault comes one step earlier, in the rewrite Dispatch
itself. That pass reads the title's indirect commands (src) and, with a count buffer, the count
(cnt) through root views. A VA-0 fault there points at one of those addresses being 0 for this draw
(or at the slice's rewrite writing past its scaled-argument buffer), rather than at the native mesh
program. What to look at: how commands_at / count_at resolve for the faulting draw (the title's
argument and count buffers through the GPU views), and what changes per slice (group_base, the
slice's dst offset). Same caution as before: on NVIDIA, DRED's VA 0 can mean "address unknown", and
the operation shown in flight is the first one not completed, which may lag the fault by one.

With XCL_NATIVE_MESH=0 the combined tree ran clean to the end (no removal, 5.6 fps).

Your loyal testing minion stands by for the next head.

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:7367931870 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3656#issuecomment-7367931870). Originally posted by [KDenKC](https://github.com/KDenKC) on 2026-12-03T04:41:07Z. --- @Kalmarv results for the restack at `f722bcdc` on the RTX 5090: with `XCL_NATIVE_MESH=1` the device is still removed in the world, on the plain PR head and on a combined tree alike, in the native mesh's indirect path. The new detail: on the plain head, the operation in flight is the argument-rewrite `Dispatch` before the native `ExecuteIndirect`, not the `ExecuteIndirect` itself. **1. The plain PR head** (`f722bcdc`, nothing else; the retail title, same save and input as our earlier runs, `XCL_NATIVE_MESH=1`, DRED on; 284 mesh programs logged `eligible`): ``` [ 140.592] D3D12 device removed: 0x887a0006 [ 140.601] DRED device state: 7 [ 140.607] DRED page fault at GPU VA 0x0 = window 10 + 0x0; allocations there: []; recently freed: [] [ 140.608] DRED: list 0x7d464d20 on queue 0xfa7ee6a0: 3589 of 3700 operations done, around: 15 15 0 >6 15 0; pipeline bound there: pipeline 0x20917689a0 (a stand-in, or not translated); bound after it: a graphics pipeline 0x10d0b2ae0 (shaders e5d36686bdeaf089), ms 20e9b93c4f347cc9 ps 5b105dad2a142167, pipeline 0x20917689a0 (a stand-in, or not translated), a graphics pipeline 0x1917b05d0 (shaders 11f1100bc3ab9539) [ 140.609] DRED: … that list, before: Barrier [ms 78b6e63ebc47ec9f ps ca0baf530893ec2b] Barrier Barrier [pipeline 0x20917689a0 (a stand-in, or not translated)] Dispatch Barrier [a graphics pipeline 0x1917b0410 (shaders 3ac521f08ba7eddf)] Barrier ExecuteIndirect Barrier Barrier [ms f6409e8792db1fe1 ps a089d5cf1112f854] Barrier Barrier [pipeline 0x20917689a0 (a stand-in, or not translated)]; not done: Dispatch Barrier [a graphics pipeline 0x10d0b2ae0 (shaders e5d36686bdeaf089)] Barrier ExecuteIndirect Barrier Barr… ``` **2. A combined tree** (`f722bcdc` plus other open PRs that don't touch mesh code: #3517, #3089, #3282 with its pair-pages index, #3094, #3748, #3662; 331 programs `eligible`), world entry +28 s: ``` [ 154.268] D3D12 device removed: 0x887a0006 [ 154.273] DRED page fault at GPU VA 0x0 = window 11 + 0x0; allocations there: []; recently freed: [] [ 154.273] DRED: list 0xfc4f8510 on queue 0x6e148060: 1590 of 1636 operations done, around: 15 0 15 >5 15 15; pipeline bound there: a graphics pipeline 0xb67bb85c0 (shaders e8d47e794ccce5c7); bound after it: pipeline 0x20096d4330 (a stand-in, or not translated), a graphics pipeline 0xb67bb85c0 (shaders e8d47e794ccce5c7), pipeline 0x20096d4330 (a stand-in, or not translated), a graphics pipeline 0xb67bb85c0 (shaders e8d47e794c… [ 154.274] DRED: … that list, before: Barrier [pipeline 0x20096d4330 (a stand-in, or not translated)] Dispatch Barrier [a graphics pipeline 0xb67bb85c0 (shaders e8d47e794ccce5c7)] Barrier ExecuteIndirect Barrier Barrier Barrier Barrier [pipeline 0x20096d4330 (a stand-in, or not translated)] Dispatch Barrier [a graphics pipeline 0xb67bb85c0 (shaders e8d47e794ccce5c7)] Barrier; not done: ExecuteIndirect Barrier Barrier … ``` (The operation marked `>` is the one in flight: 5 = ExecuteIndirect, 6 = Dispatch, 15 = Barrier. The "stand-in, or not translated" pipeline is XCL's own argument-rewrite PSO, which DRED can't name. `window N + 0x0` is only the log's label for address 0.) **What the two say together.** Both lists repeat the native-mesh indirect sequence: the rewrite `Dispatch` (`emit_scaled_args_rewrite`), then the native PSO with its record views, then the `ExecuteIndirect` on the scaled arguments. In the combined tree it is the sliced form: the same native PSO (`e8d47e79`) alternates with the rewrite several times, and the fault comes in a later slice after earlier slices completed. In the plain run the fault comes one step earlier, in the rewrite `Dispatch` itself. That pass reads the title's indirect commands (`src`) and, with a count buffer, the count (`cnt`) through root views. A VA-0 fault there points at one of those addresses being 0 for this draw (or at the slice's rewrite writing past its scaled-argument buffer), rather than at the native mesh program. What to look at: how `commands_at` / `count_at` resolve for the faulting draw (the title's argument and count buffers through the GPU views), and what changes per slice (`group_base`, the slice's `dst` offset). Same caution as before: on NVIDIA, DRED's VA 0 can mean "address unknown", and the operation shown in flight is the first one not completed, which may lag the fault by one. With `XCL_NATIVE_MESH=0` the combined tree ran clean to the end (no removal, 5.6 fps). Your loyal testing minion stands by for the next head. AI use: an agent swarm: Claude Opus 5.5, Claude Sonnet 5.5, GPT-6.2-Sol, Gemini 4 Neon and Gemini 4 Hydrogen.
Kalmarv commented 2026-12-03 06:16:43 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Kalmarv on 2026-12-03T06:16:43Z.


@KDenKC Thanks for the detailed DRED logs and A/B against XCL_NATIVE_MESH=0 — that narrowed this down quickly. Pushed 86f25b22d on top of f722bcdc5 (fast-forward, keeping #3327's 3 commits intact below this stack) with three fixes targeting the indirect-dispatch / VA-0 path.

What we checked locally

  • Audited all 6,685 unique mesh shaders in our local pipeline corpus for barrier-site coverage (ex_over = 0, ex_under = 0, zero missing uses_ops, zero untracked glc sites). The 1-slice indirect MS+PS pipeline from the plain-PR DRED has zero loops, stores, images, LDS, agreed_branches, or uniform_compare sites, and ran cleanly on RTX 5070 Ti under the D3D12 Debug Layer + GPU-Based Validation (GBV) through multi-slice SCALE_ARGS_HLSL → ExecuteIndirect with 0 D3D12/GBV errors and no device removal.
  • Note that DRED's window 10 + 0x0 / window 11 + 0x0 label is real.rs matching va == 0 against the first unopened UMA_WINDOW_VAS[k] == 0 slot (WindowKind::None).

Fixes in 86f25b22d

  1. Drop untracked count_buf in native-mesh PC ExecuteIndirect (bind.rs, execute_indirect_snapshot): pass (0, 0) instead of (count_buf, count_off) to PC ExecuteIndirect, matching two-pass (SCALE_ARGS_HLSL already reads any count buffer through the UMA window and zeroes commands past the live count, whereas the title's PC buffer state is unknown here).
  2. Bind all 6 root UAVs of abi_root_signature(dev, false) in emit_scaled_args_rewrite_from (bind.rs): previously only u0..u4 were bound; two-pass pre-populated u5 via tp.compute, whereas native-mesh lists have no prior two-pass compute bind, leaving root slot 5 at 0x0 after SetComputeRootSignature.
  3. Reject unopened UMA windows (buf == 0 / va == 0) (real.rs, uma_window_buffer_gpu & uma_va_of; bind.rs, prepare_two_pass_stage): return None / fall back to a nonzero VA instead of handing out 0 + offset.

Verification on 86f25b22d (RTX 5070 Ti, DXC 1.9.2609.5, rustc 1.99.0)

  • cargo build --release -p xcl: succeeded, 39 warnings (0 new vs origin/main 39).
  • .\scripts\test.ps1: 3,031 passed, 0 failed, 52 ignored across 44 binaries (all 23 native_mesh tests passed; 24 GPU tests SKIPPED on wave32-only adapter: 22 no wave64, 2 no heap windows).
  • 60 s smokes (ea3b5e4d, exit 0x0, 0 device removals, 0 crashes):
    • Default (XCL_NATIVE_MESH unset): 1,694 frames, 60 60 60 presents/2 s, 17,721 MB peak commit.
    • Opt-in (XCL_NATIVE_MESH=1): 1,698 frames, 60 60 60 presents/2 s, 17,072 MB peak commit (201 / 202 native ms_6_6 PSOs eligible, 1 / 202 routed to two-pass on output budget, 0 errors).

Not covered locally: we cannot reproduce the RTX 5090 in-world save directly here (only the 60 s smoke and synthetic GBV runs). If 86f25b22d still hits a VA-0 page fault in-world on RTX 5090, the most useful next signal would be the faulting indirect draw's commands_at / count_at UMA window + args and whether XCL_HEAP_WINDOWS=1 vs 0 changes the fault address/window.

Assisted-by: Antigravity (Gemini 4 Neon)

<!-- greyfinch-sync:ivall/xcl:comment:7369656714 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3656#issuecomment-7369656714). Originally posted by [Kalmarv](https://github.com/Kalmarv) on 2026-12-03T06:16:43Z. --- @KDenKC Thanks for the detailed DRED logs and A/B against `XCL_NATIVE_MESH=0` — that narrowed this down quickly. Pushed `86f25b22d` on top of `f722bcdc5` (fast-forward, keeping #3327's 3 commits intact below this stack) with three fixes targeting the indirect-dispatch / VA-0 path. **What we checked locally** - Audited all 6,685 unique mesh shaders in our local pipeline corpus for barrier-site coverage (`ex_over = 0`, `ex_under = 0`, zero missing `uses_ops`, zero untracked `glc` sites). The 1-slice indirect MS+PS pipeline from the plain-PR DRED has zero loops, stores, images, LDS, `agreed_branches`, or `uniform_compare` sites, and ran cleanly on RTX 5070 Ti under the D3D12 Debug Layer + GPU-Based Validation (GBV) through multi-slice `SCALE_ARGS_HLSL` → `ExecuteIndirect` with 0 D3D12/GBV errors and no device removal. - Note that DRED's `window 10 + 0x0` / `window 11 + 0x0` label is `real.rs` matching `va == 0` against the first unopened `UMA_WINDOW_VAS[k] == 0` slot (`WindowKind::None`). **Fixes in `86f25b22d`** 1. **Drop untracked `count_buf` in native-mesh PC `ExecuteIndirect`** (`bind.rs`, `execute_indirect_snapshot`): pass `(0, 0)` instead of `(count_buf, count_off)` to PC `ExecuteIndirect`, matching two-pass (`SCALE_ARGS_HLSL` already reads any count buffer through the UMA window and zeroes commands past the live count, whereas the title's PC buffer state is unknown here). 2. **Bind all 6 root UAVs of `abi_root_signature(dev, false)` in `emit_scaled_args_rewrite_from`** (`bind.rs`): previously only `u0..u4` were bound; two-pass pre-populated `u5` via `tp.compute`, whereas native-mesh lists have no prior two-pass compute bind, leaving root slot 5 at `0x0` after `SetComputeRootSignature`. 3. **Reject unopened UMA windows (`buf == 0` / `va == 0`)** (`real.rs`, `uma_window_buffer_gpu` & `uma_va_of`; `bind.rs`, `prepare_two_pass_stage`): return `None` / fall back to a nonzero VA instead of handing out `0 + offset`. **Verification on `86f25b22d` (RTX 5070 Ti, DXC `1.9.2609.5`, `rustc 1.99.0`)** - `cargo build --release -p xcl`: succeeded, 39 warnings (0 new vs `origin/main` 39). - `.\scripts\test.ps1`: **3,031 passed, 0 failed, 52 ignored** across 44 binaries (all 23 `native_mesh` tests passed; 24 GPU tests `SKIPPED` on wave32-only adapter: 22 `no wave64`, 2 `no heap windows`). - 60 s smokes (`ea3b5e4d`, exit `0x0`, 0 device removals, 0 crashes): - Default (`XCL_NATIVE_MESH` unset): 1,694 frames, `60 60 60` presents/2 s, 17,721 MB peak commit. - Opt-in (`XCL_NATIVE_MESH=1`): 1,698 frames, `60 60 60` presents/2 s, 17,072 MB peak commit (**201 / 202** native `ms_6_6` PSOs eligible, **1 / 202** routed to two-pass on output budget, 0 errors). **Not covered locally**: we cannot reproduce the RTX 5090 in-world save directly here (only the 60 s smoke and synthetic GBV runs). If `86f25b22d` still hits a VA-0 page fault in-world on RTX 5090, the most useful next signal would be the faulting indirect draw's `commands_at` / `count_at` UMA window + args and whether `XCL_HEAP_WINDOWS=1` vs `0` changes the fault address/window. *Assisted-by: Antigravity (Gemini 4 Neon)*
Foniass commented 2026-12-03 07:35:12 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Foniass on 2026-12-03T07:35:12Z.


merge-check
base: 078358a058
head: 86f25b22d0
merge: clean
build: ok
tests: 3031 passed, 0 failed, 52 ignored; 28 skipped, the same as on main
review: 1 high, 8 medium, 2 nits (below)
performance: 60 s smoke run: 1669 → 1659 frames (99 % of main), peak commit 17577 → 17338 MB, no device removal, no crash
title run: retail title on the RTX 5070 Ti (driver 621.14), into the world by scripted presses: 227 s there, 0 device removals, 0 crashes, 4.5 presents/s; run with XCL_SKIP_CS=95cc13288a27a96e (the NVIDIA hang at the end of loading, #3541) and NVIDIA's 2048 MB shader heap (#2590)
verdict: not yet: 1 blocking finding (critical or high, below); also PR description is red
hardware / tool and model: RTX 5070 Ti (driver 621.14), Ryzen 7 7800X3D, Windows 11 26300 / Claude Code with Claude Opus 5.5


In short: The push adds one commit (86f25b22) on top of f722bcdc: native-mesh ExecuteIndirect no longer passes the title's count buffer, the scale-args rewrite binds all six root UAVs, and UMA lookups reject windows with no buffer. These changes look correct, but none of the findings from my earlier review is fixed, and the UMA guards change shared default-path helpers in a native-mesh PR. The carried #3327 draft commits still block merging.

High

  1. Still carries #3327's draft commits. The bottom three commits (b9365b466, e1c7bf4ff, d10821a30) are #3327's current head d10821a30, and #3327 is still an open draft. Merging this PR would merge #3327's unreviewed draft work with it. Wait for #3327 to land and rebase onto main, or take those commits out.

Medium

  1. Own part is about 4,000 lines. d10821a30..86f25b22 changes 13 files (+3,847/-158). native_mesh.rs alone is 2,462 lines, and the new commit adds 50 more. That is far over the ~800-line limit, past which CONTRIBUTING.md asks for a reason it cannot be split. The description says a split is planned. Split it before merge: translator behind the flag with its tests, packed signatures, runtime wiring, then the UMA guards on their own.
  2. Barrier plan check is debug-only. native_mesh.rs ~1282 checks that BarrierPlan never misses an emitted barrier only with debug_assertions. ~1473 runs DXIL validation only under test/debug. Release builds can ship a native mesh shader whose barrier plan is wrong, which would hang or corrupt the picture. Make the check part of the release path and fall back to two-pass on a mismatch.
  3. Signature-row sort changes for every shader and duplicates #3339. graphics.rs ~618 sorts the signature rows of every graphics signature by (stream, register, name position), not only native mesh / PixelPacked ones. The description says the default path is untouched, which holds only when all registers are distinct. This also overlaps the open #3339 (packed SV_ClipDistance/SV_CullDistance). Limit the sort to packed signatures or leave the fix to #3339.
  4. Zero-VA guards are a separate default-path change. 86f25b22 changes uma_window_buffer_gpu and uma_va_of (real.rs ~565-580). Default-path code calls them: buffer copies and writes (list_x.rs ~3941, ~4203, ~4261, ~4345), the indirect count guard (indirect_guard.rs ~306) and title compute binds (bind.rs ~5524). The logic is right, but it only matters when sparse::init (sparse.rs ~3411) failed to open the sparse and view windows. It has nothing to do with native mesh. The tests cover only the two new helpers, not the functions. Move it to its own PR with a test that drives uma_va_of / uma_window_buffer_gpu with an unopened window.
  5. Default-run peak commit 1.9 GB higher in the author's smoke. The author's smoke shows 15,798 MB on main 5eaadb54c and 17,721 MB at 86f25b22 with XCL_NATIVE_MESH unset (112 %, under the 125 % limit), while the description says the default path is untouched. The main run is on a commit 76 commits older than the PR's base 078358a05, so the gap may come from main. Compare main and the PR on the same base before calling the default path unchanged.
  6. No measured gain. The opt-in run shows 1,698 frames and the default run 1,694, both capped at 60 presents per 2 s. There is no GPU-time or frame-time number showing that the native path is faster than two-pass. Add a measurement, for example gpu_profile IndirectNativeMesh against two-pass on the same scene.
  7. Opt-in picture and RTX 5090 device removal not shown fixed. The author's 60 s opt-in smoke on an RTX 5070 Ti now shows 0 device removals. But nothing shows the picture is right with XCL_NATIVE_MESH=1, and the description says the RTX 5090 re-test that found the device removal is still pending. Add a visual check (screenshot or dump compared with two-pass) and the 5090 result.
  8. Conflicts with open #3681 in bind.rs. git merge-tree of 86f25b22 with #3681's head b0819749 ("bound scratch for sliced indirect mesh draws") conflicts in crates/xcl/src/hle/d3d12x/bind.rs. Both change the sliced indirect mesh scratch handling. Coordinate which lands first and rebase the other.

Nit

  1. Native path cannot be checked on wave64 hardware. try_native_mesh only takes the native path on wave32 hardware, so wave64 machines (the maintainer's AMD RDNA4 batch run) never run it. The 22 wave64 GPU parity tests skipped on the author's wave32 card. Neither run covers both the parity tests and the runtime path. Say so under Not tested, or make the parity tests run on wave32.
  2. Doc comment of make_scaled_args_buffer now sits on slice_scratch_before. bind.rs ~3275-3284: the comment "The arguments of max commands at UMA address src..." still sits above slice_scratch_before, run together with its own comment. Move it back above make_scaled_args_buffer (~3342).
Checked and fine
  • pull/3656/head is 86f25b22, and the only change since f722bcdc is one commit on top of it; the six commits below are unchanged
  • Dropping count_buf from the native-mesh ExecuteIndirect (bind.rs ~3847) is safe: count_source needs count_at whenever count_buf != 0, SCALE_ARGS_HLSL turns commands past the live count into zero-group dispatches (~3163, ~3176), and the two-pass call passes 0, 0 the same way
  • Binding u5 in emit_scaled_args_rewrite_from is valid: abi_root_signature has six root UAVs (pso.rs ~2197), and slot 5 gets the always-valid consts address on both the native and the default two-pass rewrite
  • nonzero_window_va in prepare_two_pass_stage (bind.rs ~3115) uses the same nonzero filter main already uses for compute window views (bind.rs ~5536)
  • The new commit deletes or weakens no assertions and adds two unit tests
  • 86f25b22 merges into current main without conflicts
How this was tested
  • Merged onto main 078358a0, then cargo build --workspace and cargo test --workspace --no-fail-fast -- --test-threads=4.
  • The skipped GPU tests are those this card can't run (no wave64 on NVIDIA, no D3D12 debug layer, and similar).
  • scripts/smoke.ps1: 60 s of a retail title on main 078358a0 and on this merge; presents per 2 s at the end: 60 60 60.
  • Title run: the release build of this merge launched the retail title with XCL_RUN_SECONDS=300 and scripted A presses counted from the first frame (XCL_PRESS_BASE=frame, #3712) into the world from an existing save; time in the world is counted from the first in-world draw call to the end of the run.

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

<!-- greyfinch-sync:ivall/xcl:comment:7371176503 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3656#issuecomment-7371176503). Originally posted by [Foniass](https://github.com/Foniass) on 2026-12-03T07:35:12Z. --- merge-check base: 078358a058f7ba5d16690dba8dc4e55d2c88ae0a head: 86f25b22d0a54a50197197e901eec3a590720942 merge: clean build: ok tests: 3031 passed, 0 failed, 52 ignored; 28 skipped, the same as on main review: 1 high, 8 medium, 2 nits (below) performance: 60 s smoke run: 1669 → 1659 frames (99 % of main), peak commit 17577 → 17338 MB, no device removal, no crash title run: retail title on the RTX 5070 Ti (driver 621.14), into the world by scripted presses: 227 s there, 0 device removals, 0 crashes, 4.5 presents/s; run with `XCL_SKIP_CS=95cc13288a27a96e` (the NVIDIA hang at the end of loading, #3541) and NVIDIA's 2048 MB shader heap (#2590) verdict: not yet: 1 blocking finding (critical or high, below); also `PR description` is red hardware / tool and model: RTX 5070 Ti (driver 621.14), Ryzen 7 7800X3D, Windows 11 26300 / Claude Code with Claude Opus 5.5 --- **In short:** The push adds one commit (86f25b22) on top of f722bcdc: native-mesh ExecuteIndirect no longer passes the title's count buffer, the scale-args rewrite binds all six root UAVs, and UMA lookups reject windows with no buffer. These changes look correct, but none of the findings from my earlier review is fixed, and the UMA guards change shared default-path helpers in a native-mesh PR. The carried #3327 draft commits still block merging. #### High 1. **Still carries #3327's draft commits.** The bottom three commits (b9365b466, e1c7bf4ff, d10821a30) are #3327's current head d10821a30, and #3327 is still an open draft. Merging this PR would merge #3327's unreviewed draft work with it. Wait for #3327 to land and rebase onto main, or take those commits out. #### Medium 2. **Own part is about 4,000 lines.** d10821a30..86f25b22 changes 13 files (+3,847/-158). native_mesh.rs alone is 2,462 lines, and the new commit adds 50 more. That is far over the ~800-line limit, past which CONTRIBUTING.md asks for a reason it cannot be split. The description says a split is planned. Split it before merge: translator behind the flag with its tests, packed signatures, runtime wiring, then the UMA guards on their own. 3. **Barrier plan check is debug-only.** native_mesh.rs ~1282 checks that BarrierPlan never misses an emitted barrier only with debug_assertions. ~1473 runs DXIL validation only under test/debug. Release builds can ship a native mesh shader whose barrier plan is wrong, which would hang or corrupt the picture. Make the check part of the release path and fall back to two-pass on a mismatch. 4. **Signature-row sort changes for every shader and duplicates #3339.** graphics.rs ~618 sorts the signature rows of every graphics signature by (stream, register, name position), not only native mesh / PixelPacked ones. The description says the default path is untouched, which holds only when all registers are distinct. This also overlaps the open #3339 (packed SV_ClipDistance/SV_CullDistance). Limit the sort to packed signatures or leave the fix to #3339. 5. **Zero-VA guards are a separate default-path change.** 86f25b22 changes uma_window_buffer_gpu and uma_va_of (real.rs ~565-580). Default-path code calls them: buffer copies and writes (list_x.rs ~3941, ~4203, ~4261, ~4345), the indirect count guard (indirect_guard.rs ~306) and title compute binds (bind.rs ~5524). The logic is right, but it only matters when sparse::init (sparse.rs ~3411) failed to open the sparse and view windows. It has nothing to do with native mesh. The tests cover only the two new helpers, not the functions. Move it to its own PR with a test that drives uma_va_of / uma_window_buffer_gpu with an unopened window. 6. **Default-run peak commit 1.9 GB higher in the author's smoke.** The author's smoke shows 15,798 MB on main 5eaadb54c and 17,721 MB at 86f25b22 with XCL_NATIVE_MESH unset (112 %, under the 125 % limit), while the description says the default path is untouched. The main run is on a commit 76 commits older than the PR's base 078358a05, so the gap may come from main. Compare main and the PR on the same base before calling the default path unchanged. 7. **No measured gain.** The opt-in run shows 1,698 frames and the default run 1,694, both capped at 60 presents per 2 s. There is no GPU-time or frame-time number showing that the native path is faster than two-pass. Add a measurement, for example gpu_profile IndirectNativeMesh against two-pass on the same scene. 8. **Opt-in picture and RTX 5090 device removal not shown fixed.** The author's 60 s opt-in smoke on an RTX 5070 Ti now shows 0 device removals. But nothing shows the picture is right with XCL_NATIVE_MESH=1, and the description says the RTX 5090 re-test that found the device removal is still pending. Add a visual check (screenshot or dump compared with two-pass) and the 5090 result. 9. **Conflicts with open #3681 in bind.rs.** git merge-tree of 86f25b22 with #3681's head b0819749 ("bound scratch for sliced indirect mesh draws") conflicts in crates/xcl/src/hle/d3d12x/bind.rs. Both change the sliced indirect mesh scratch handling. Coordinate which lands first and rebase the other. #### Nit 10. **Native path cannot be checked on wave64 hardware.** try_native_mesh only takes the native path on wave32 hardware, so wave64 machines (the maintainer's AMD RDNA4 batch run) never run it. The 22 wave64 GPU parity tests skipped on the author's wave32 card. Neither run covers both the parity tests and the runtime path. Say so under Not tested, or make the parity tests run on wave32. 11. **Doc comment of make_scaled_args_buffer now sits on slice_scratch_before.** bind.rs ~3275-3284: the comment "The arguments of `max` commands at UMA address `src`..." still sits above slice_scratch_before, run together with its own comment. Move it back above make_scaled_args_buffer (~3342). <details><summary>Checked and fine</summary> - pull/3656/head is 86f25b22, and the only change since f722bcdc is one commit on top of it; the six commits below are unchanged - Dropping count_buf from the native-mesh ExecuteIndirect (bind.rs ~3847) is safe: count_source needs count_at whenever count_buf != 0, SCALE_ARGS_HLSL turns commands past the live count into zero-group dispatches (~3163, ~3176), and the two-pass call passes 0, 0 the same way - Binding u5 in emit_scaled_args_rewrite_from is valid: abi_root_signature has six root UAVs (pso.rs ~2197), and slot 5 gets the always-valid consts address on both the native and the default two-pass rewrite - nonzero_window_va in prepare_two_pass_stage (bind.rs ~3115) uses the same nonzero filter main already uses for compute window views (bind.rs ~5536) - The new commit deletes or weakens no assertions and adds two unit tests - 86f25b22 merges into current main without conflicts </details> <details><summary>How this was tested</summary> - Merged onto main `078358a0`, then `cargo build --workspace` and `cargo test --workspace --no-fail-fast -- --test-threads=4`. - The skipped GPU tests are those this card can't run (no wave64 on NVIDIA, no D3D12 debug layer, and similar). - `scripts/smoke.ps1`: 60 s of a retail title on main `078358a0` and on this merge; presents per 2 s at the end: 60 60 60. - Title run: the release build of this merge launched the retail title with `XCL_RUN_SECONDS=300` and scripted A presses counted from the first frame (`XCL_PRESS_BASE=frame`, #3712) into the world from an existing save; time in the world is counted from the first in-world draw call to the end of the run. </details> <sub>Written by Claude Code (Claude Opus 5.5) and posted by Foniass without a human check of each point.</sub>
Kalmarv commented 2026-12-03 08:11:15 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Kalmarv on 2026-12-03T08:11:15Z.


@Foniass Thanks for the thorough merge-check! Pushed 938b9e311 on top of 86f25b22d (fast-forward) addressing the actionable review findings and re-ran the base smoke on 078358a05:

Addressed in 938b9e311 & updated PR description

  • #3 (Barrier plan check debug-only): check_unplanned_barrier in native_mesh.rs now runs unconditionally in release builds too (checking both start_b[insts_before..] and newly created blocks) and returns Err so any mismatch fails closed to two-pass instead of shipping an untracked barrier; added unplanned_barrier_is_rejected_even_in_release. (Kept DXC validate::validate at line ~1473 under cfg!(any(test, debug_assertions)) matching kernel.rs:963 so release builds do not require dxil.dll; CreatePipelineState already rejects invalid DXIL to two-pass.)
  • #4 (Signature-row sort scope / #3339 overlap): sig_part in graphics.rs now gates the string-table name-offset tiebreaker on stage == Stage::Mesh || p.iter().any(|e| e.e.place.is_some()), leaving all default Stage::Vertex and Stage::Pixel signatures (including #3339's auto-packed SV_ClipDistance/SV_CullDistance) on the exact original (register, mask.trailing_zeros()) sort.
  • #5 (real.rs default-path UMA helpers): Reverted the uma_window_buffer_gpu / uma_va_of change from #3656 so this PR does not modify shared default-path UMA helpers (will open a separate small PR with a test driving uma_va_of / uma_window_buffer_gpu directly). Kept the bind.rs indirect count_buf / 6-slot ABI / nonzero_window_va fixes.
  • #6 (Base smoke commit mismatch): Replaced the stale 5eaadb54c base block with a fresh 60 s smoke on exact base 078358a05 (1,695 frames, 17,123 MB peak commit vs PR default 1,711 frames, 17,033 MB peak commit — -90 MB).
  • #10 (Not tested wave64 coverage) & #11 (misplaced doc comment): Clarified the wave32/wave64 coverage split under Not tested, and moved make_scaled_args_buffer's doc comment back above make_scaled_args_buffer in bind.rs.

Still open / Draft status

  • #1 & #2 (#3327 draft commits & ~4k size) & #9 (#3681 conflict in bind.rs): Keeping #3656 in Draft stacked on #3327 while @KDenKC re-tests on RTX 5090; once #3327 (and #3681) land, we will rebase onto main and split into smaller PRs.
  • #7 & #8 (in-world GPU-time gain, visual check, RTX 5090 re-test): Not yet measured locally (the 60 s smoke is capped at 60 presents/2 s in the intro/menu); pending in-world RTX 5090 re-test + comparison against two-pass.
  • Red PR description check: pr-check.yml is currently hitting repo-wide startup_failure across PRs on main (e.g. runs 47048824583, 47060767515); python scripts/pr_check.py --local passes with description ok.

Verification on 938b9e311 (RTX 5070 Ti, DXC 1.9.2609.5, rustc 1.99.0)

  • cargo build --release -p xcl: succeeded, 39 warnings (0 new vs origin/main 39).
  • .\scripts\test.ps1: 3,031 passed, 0 failed, 52 ignored across 44 binaries (all 24 native_mesh tests passed; 24 GPU tests SKIPPED: 22 no wave64, 2 no heap windows).
  • 60 s smokes (ea3b5e4d, exit 0x0, 0 device removals, 0 crashes):
    • Base 078358a05: 1,695 frames, 60 60 60 presents/2 s, 17,123 MB peak commit.
    • PR default (XCL_NATIVE_MESH unset): 1,711 frames, 60 60 60 presents/2 s, 17,033 MB peak commit.
    • PR opt-in (XCL_NATIVE_MESH=1): 1,697 frames, 60 60 60 presents/2 s, 17,521 MB peak commit (447 / 469 native ms_6_6 PSOs eligible, 22 / 469 routed to two-pass on output budget, 0 errors).

Assisted-by: Antigravity (Gemini 4 Neon)

<!-- greyfinch-sync:ivall/xcl:comment:7371936390 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3656#issuecomment-7371936390). Originally posted by [Kalmarv](https://github.com/Kalmarv) on 2026-12-03T08:11:15Z. --- @Foniass Thanks for the thorough merge-check! Pushed `938b9e311` on top of `86f25b22d` (fast-forward) addressing the actionable review findings and re-ran the base smoke on `078358a05`: **Addressed in `938b9e311` & updated PR description** - **#3 (Barrier plan check debug-only):** `check_unplanned_barrier` in `native_mesh.rs` now runs unconditionally in release builds too (checking both `start_b[insts_before..]` and newly created blocks) and returns `Err` so any mismatch fails closed to two-pass instead of shipping an untracked barrier; added `unplanned_barrier_is_rejected_even_in_release`. (Kept DXC `validate::validate` at line ~1473 under `cfg!(any(test, debug_assertions))` matching `kernel.rs:963` so release builds do not require `dxil.dll`; `CreatePipelineState` already rejects invalid DXIL to two-pass.) - **#4 (Signature-row sort scope / `#3339` overlap):** `sig_part` in `graphics.rs` now gates the string-table name-offset tiebreaker on `stage == Stage::Mesh || p.iter().any(|e| e.e.place.is_some())`, leaving all default `Stage::Vertex` and `Stage::Pixel` signatures (including `#3339`'s auto-packed `SV_ClipDistance`/`SV_CullDistance`) on the exact original `(register, mask.trailing_zeros())` sort. - **#5 (`real.rs` default-path UMA helpers):** Reverted the `uma_window_buffer_gpu` / `uma_va_of` change from `#3656` so this PR does not modify shared default-path UMA helpers (will open a separate small PR with a test driving `uma_va_of` / `uma_window_buffer_gpu` directly). Kept the `bind.rs` indirect `count_buf` / 6-slot ABI / `nonzero_window_va` fixes. - **#6 (Base smoke commit mismatch):** Replaced the stale `5eaadb54c` base block with a fresh 60 s smoke on exact base `078358a05` (`1,695` frames, `17,123 MB` peak commit vs PR default `1,711` frames, `17,033 MB` peak commit — `-90 MB`). - **#10 (`Not tested` wave64 coverage) & #11 (misplaced doc comment):** Clarified the wave32/wave64 coverage split under **Not tested**, and moved `make_scaled_args_buffer`'s doc comment back above `make_scaled_args_buffer` in `bind.rs`. **Still open / Draft status** - **#1 & #2 (`#3327` draft commits & ~4k size) & #9 (`#3681` conflict in `bind.rs`):** Keeping `#3656` in **Draft** stacked on `#3327` while `@KDenKC` re-tests on RTX 5090; once `#3327` (and `#3681`) land, we will rebase onto `main` and split into smaller PRs. - **#7 & #8 (in-world GPU-time gain, visual check, RTX 5090 re-test):** Not yet measured locally (the 60 s smoke is capped at 60 presents/2 s in the intro/menu); pending in-world RTX 5090 re-test + comparison against two-pass. - **Red `PR description` check:** `pr-check.yml` is currently hitting repo-wide `startup_failure` across PRs on `main` (e.g. runs `47048824583`, `47060767515`); `python scripts/pr_check.py --local` passes with `description ok`. **Verification on `938b9e311` (RTX 5070 Ti, DXC `1.9.2609.5`, `rustc 1.99.0`)** - `cargo build --release -p xcl`: succeeded, 39 warnings (0 new vs `origin/main` 39). - `.\scripts\test.ps1`: **3,031 passed, 0 failed, 52 ignored** across 44 binaries (all 24 `native_mesh` tests passed; 24 GPU tests `SKIPPED`: 22 `no wave64`, 2 `no heap windows`). - 60 s smokes (`ea3b5e4d`, exit `0x0`, 0 device removals, 0 crashes): - Base `078358a05`: 1,695 frames, `60 60 60` presents/2 s, 17,123 MB peak commit. - PR default (`XCL_NATIVE_MESH` unset): 1,711 frames, `60 60 60` presents/2 s, 17,033 MB peak commit. - PR opt-in (`XCL_NATIVE_MESH=1`): 1,697 frames, `60 60 60` presents/2 s, 17,521 MB peak commit (**447 / 469** native `ms_6_6` PSOs eligible, **22 / 469** routed to two-pass on output budget, 0 errors). *Assisted-by: Antigravity (Gemini 4 Neon)*
Foniass commented 2026-12-03 08:35:16 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Foniass on 2026-12-03T08:35:16Z.


merge-check
base: 16c2fd082a
head: 938b9e3118
merge: clean
build: ok
tests: 3037 passed, 0 failed, 56 ignored; 28 skipped, the same as on main
review: 1 high, 5 medium (below)
performance: 60 s smoke run: 1683 → 1657 frames (98 % of main), peak commit 18505 → 17695 MB, no device removal, no crash
title run: retail title on the RTX 5070 Ti (driver 621.14), into the world by scripted presses: 232 s there, 0 device removals, 0 crashes, 4.3 presents/s; run with XCL_SKIP_CS=95cc13288a27a96e (the NVIDIA hang at the end of loading, #3541) and NVIDIA's 2048 MB shader heap (#2590)
verdict: not yet: 1 blocking finding (critical or high, below); also PR description is red
hardware / tool and model: RTX 5070 Ti (driver 621.14), Ryzen 7 7800X3D, Windows 11 26300 / Claude Code with Claude Opus 5.5


In short: The push adds one commit (938b9e31) on top of 86f25b22. It fixes the debug-only barrier check, limits the signature sort to native mesh, reverts the shared real.rs UMA change and moves the misplaced doc comment; the author's same-base smoke also clears the peak-commit concern. The carried #3327 draft commits still block merging, and the size, speed, RTX 5090 and conflict findings from my last merge-check are still open.

High

  1. Still carries #3327's draft commits. The bottom three commits (b9365b466, e1c7bf4ff, d10821a30) are still #3327's head d10821a30, and #3327 is still an open draft. Merging this PR would merge #3327's unreviewed draft work with it. The author's reply says they will rebase once #3327 lands; until then, wait for #3327 or take those commits out.

Medium

  1. Own part is still about 3,900 lines. d10821a30..938b9e31 changes 13 files (+3,876/-166); native_mesh.rs alone is about 2,500 lines. That is far over the ~800-line limit, past which CONTRIBUTING.md asks for a reason it cannot be split. The reply says a split is planned after #3327 lands. Split it before merge: translator behind the flag with its tests, packed signatures, runtime wiring.
  2. Review-fix commit undoes part of the one before it. 86f25b22 adds open_window_buf / open_window_va and their test in real.rs, and 938b9e31 ("Address review findings on PR #3656") removes them again. It also carries bind.rs and graphics.rs fixes under a Recompiler subject. CONTRIBUTING.md asks for review fixes to be squashed into the commits they fix, so that each commit is one logical change. Squash 938b9e31 into the commits it fixes and drop the real.rs add/revert pair from the history.
  3. No measured gain. The new smokes are still capped at 60 presents per 2 s (base 1,695, default 1,711, opt-in 1,697 frames). There is no GPU-time or frame-time number showing that the native path is faster than two-pass. The reply says this is not measured yet. Add a measurement, for example gpu_profile IndirectNativeMesh against two-pass in the world.
  4. Opt-in picture and RTX 5090 device removal not shown fixed. The RTX 5090 faults at GPU VA 0 (comments 7363569473, 7367931870) were followed by 86f25b22, and 938b9e31 has since reverted part of 86f25b22 (the real.rs uma_va_of / uma_window_buffer_gpu guards). So the 5090 re-test has to run on 938b9e31 itself. Nothing yet shows that the opt-in picture matches two-pass. Add the 5090 result at this head and a visual check against two-pass.
  5. Conflicts with open #3681 and #3339. git merge-tree of 938b9e31 with #3681's head 61408de0 still conflicts in crates/xcl/src/hle/d3d12x/bind.rs (sliced indirect mesh scratch). With #3339's head 62d53267 it conflicts in graphics.rs (both add the name-offset tiebreaker to sig_part ~615), lower_gfx.rs and core_tests.rs. #3339 itself also conflicts with main. Agree which lands first and rebase the other; the sig_part tiebreaker should end up in one place.
Checked and fine
  • Earlier finding fixed: barrier plan check is debug-only. check_unplanned_barrier (native_mesh.rs ~813, called ~1303) now runs in every build and returns Err, so the shader falls back to two-pass. It checks start_b from insts_before (the old check read the current block with the start block's offset) and every block created while lowering; heads are created lazily, so lowering does not write into blocks made earlier.
  • DXIL validation at native_mesh.rs ~1486 stays test/debug only, the same as main's kernel.rs ~919 for the direct-DXIL kernels
  • Earlier finding fixed: signature-row sort no longer changes default shaders. On main and on the default path nothing sets SigElement::place, Stage::Mesh GraphicsIo is built only in native_mesh.rs ~1028, and setup_pixel packs only for Entry::PixelPacked, reached only from try_native_mesh. Default VS/PS keep the (register, mask.trailing_zeros()) sort.
  • Earlier finding fixed: zero-VA guards are a separate default-path change. real.rs now matches main for uma_window_buffer_gpu and uma_va_of; the removed test covered only the removed helpers
  • Earlier finding fixed: default-run peak commit. The author's smoke now uses the PR's base 078358a05: 17,123 MB on main against 17,033 MB with XCL_NATIVE_MESH unset, 1,695 against 1,711 frames
  • Earlier finding fixed: native path cannot be checked on wave64 hardware. Not tested now says that wave64 adapters never run the runtime native path and that wave32 adapters skip the 22 wave64 tests
  • Earlier finding fixed: the doc comment of make_scaled_args_buffer is back above make_scaled_args_buffer (bind.rs ~3333)
  • nonzero_window_va in prepare_two_pass_stage (bind.rs ~3115) is the only zero-VA guard left on the default two-pass path, and it uses the same nonzero filter main uses for compute window views
  • The SCALE_ARGS_HLSL slice_base/total_cap words: default two-pass callers pass 0, 0 and the consts block has 12 words (bind.rs ~3406), so the default rewrite gives the same arguments as before
  • No assertion deleted or weakened: the debug_assert became a release Err, and unplanned_barrier_is_rejected_even_in_release tests both detection cases of the helper
  • 938b9e31 merges into current main 16c2fd082 without conflicts
  • The new commit's AI model (Gemini 4 Neon) is not one of the models CONTRIBUTING.md refuses
How this was tested
  • Merged onto main 16c2fd08, then cargo build --workspace and cargo test --workspace --no-fail-fast -- --test-threads=4.
  • The skipped GPU tests are those this card can't run (no wave64 on NVIDIA, no D3D12 debug layer, and similar).
  • scripts/smoke.ps1: 60 s of a retail title on main 16c2fd08 and on this merge; presents per 2 s at the end: 61 60 60.
  • Title run: the release build of this merge launched the retail title with XCL_RUN_SECONDS=300 and scripted A presses counted from the first frame (XCL_PRESS_BASE=frame, #3712) into the world from an existing save; time in the world is counted from the first in-world draw call to the end of the run.

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

<!-- greyfinch-sync:ivall/xcl:comment:7372470823 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3656#issuecomment-7372470823). Originally posted by [Foniass](https://github.com/Foniass) on 2026-12-03T08:35:16Z. --- merge-check base: 16c2fd082ae2e96967a2ab553bc2e1032e491f70 head: 938b9e3118984c9131499e08902db12847a7e155 merge: clean build: ok tests: 3037 passed, 0 failed, 56 ignored; 28 skipped, the same as on main review: 1 high, 5 medium (below) performance: 60 s smoke run: 1683 → 1657 frames (98 % of main), peak commit 18505 → 17695 MB, no device removal, no crash title run: retail title on the RTX 5070 Ti (driver 621.14), into the world by scripted presses: 232 s there, 0 device removals, 0 crashes, 4.3 presents/s; run with `XCL_SKIP_CS=95cc13288a27a96e` (the NVIDIA hang at the end of loading, #3541) and NVIDIA's 2048 MB shader heap (#2590) verdict: not yet: 1 blocking finding (critical or high, below); also `PR description` is red hardware / tool and model: RTX 5070 Ti (driver 621.14), Ryzen 7 7800X3D, Windows 11 26300 / Claude Code with Claude Opus 5.5 --- **In short:** The push adds one commit (938b9e31) on top of 86f25b22. It fixes the debug-only barrier check, limits the signature sort to native mesh, reverts the shared real.rs UMA change and moves the misplaced doc comment; the author's same-base smoke also clears the peak-commit concern. The carried #3327 draft commits still block merging, and the size, speed, RTX 5090 and conflict findings from my last merge-check are still open. #### High 1. **Still carries #3327's draft commits.** The bottom three commits (b9365b466, e1c7bf4ff, d10821a30) are still #3327's head d10821a30, and #3327 is still an open draft. Merging this PR would merge #3327's unreviewed draft work with it. The author's reply says they will rebase once #3327 lands; until then, wait for #3327 or take those commits out. #### Medium 2. **Own part is still about 3,900 lines.** d10821a30..938b9e31 changes 13 files (+3,876/-166); native_mesh.rs alone is about 2,500 lines. That is far over the ~800-line limit, past which CONTRIBUTING.md asks for a reason it cannot be split. The reply says a split is planned after #3327 lands. Split it before merge: translator behind the flag with its tests, packed signatures, runtime wiring. 3. **Review-fix commit undoes part of the one before it.** 86f25b22 adds open_window_buf / open_window_va and their test in real.rs, and 938b9e31 ("Address review findings on PR #3656") removes them again. It also carries bind.rs and graphics.rs fixes under a Recompiler subject. CONTRIBUTING.md asks for review fixes to be squashed into the commits they fix, so that each commit is one logical change. Squash 938b9e31 into the commits it fixes and drop the real.rs add/revert pair from the history. 4. **No measured gain.** The new smokes are still capped at 60 presents per 2 s (base 1,695, default 1,711, opt-in 1,697 frames). There is no GPU-time or frame-time number showing that the native path is faster than two-pass. The reply says this is not measured yet. Add a measurement, for example gpu_profile IndirectNativeMesh against two-pass in the world. 5. **Opt-in picture and RTX 5090 device removal not shown fixed.** The RTX 5090 faults at GPU VA 0 (comments 7363569473, 7367931870) were followed by 86f25b22, and 938b9e31 has since reverted part of 86f25b22 (the real.rs uma_va_of / uma_window_buffer_gpu guards). So the 5090 re-test has to run on 938b9e31 itself. Nothing yet shows that the opt-in picture matches two-pass. Add the 5090 result at this head and a visual check against two-pass. 6. **Conflicts with open #3681 and #3339.** git merge-tree of 938b9e31 with #3681's head 61408de0 still conflicts in crates/xcl/src/hle/d3d12x/bind.rs (sliced indirect mesh scratch). With #3339's head 62d53267 it conflicts in graphics.rs (both add the name-offset tiebreaker to sig_part ~615), lower_gfx.rs and core_tests.rs. #3339 itself also conflicts with main. Agree which lands first and rebase the other; the sig_part tiebreaker should end up in one place. <details><summary>Checked and fine</summary> - Earlier finding fixed: barrier plan check is debug-only. check_unplanned_barrier (native_mesh.rs ~813, called ~1303) now runs in every build and returns Err, so the shader falls back to two-pass. It checks start_b from insts_before (the old check read the current block with the start block's offset) and every block created while lowering; heads are created lazily, so lowering does not write into blocks made earlier. - DXIL validation at native_mesh.rs ~1486 stays test/debug only, the same as main's kernel.rs ~919 for the direct-DXIL kernels - Earlier finding fixed: signature-row sort no longer changes default shaders. On main and on the default path nothing sets SigElement::place, Stage::Mesh GraphicsIo is built only in native_mesh.rs ~1028, and setup_pixel packs only for Entry::PixelPacked, reached only from try_native_mesh. Default VS/PS keep the (register, mask.trailing_zeros()) sort. - Earlier finding fixed: zero-VA guards are a separate default-path change. real.rs now matches main for uma_window_buffer_gpu and uma_va_of; the removed test covered only the removed helpers - Earlier finding fixed: default-run peak commit. The author's smoke now uses the PR's base 078358a05: 17,123 MB on main against 17,033 MB with XCL_NATIVE_MESH unset, 1,695 against 1,711 frames - Earlier finding fixed: native path cannot be checked on wave64 hardware. Not tested now says that wave64 adapters never run the runtime native path and that wave32 adapters skip the 22 wave64 tests - Earlier finding fixed: the doc comment of make_scaled_args_buffer is back above make_scaled_args_buffer (bind.rs ~3333) - nonzero_window_va in prepare_two_pass_stage (bind.rs ~3115) is the only zero-VA guard left on the default two-pass path, and it uses the same nonzero filter main uses for compute window views - The SCALE_ARGS_HLSL slice_base/total_cap words: default two-pass callers pass 0, 0 and the consts block has 12 words (bind.rs ~3406), so the default rewrite gives the same arguments as before - No assertion deleted or weakened: the debug_assert became a release Err, and unplanned_barrier_is_rejected_even_in_release tests both detection cases of the helper - 938b9e31 merges into current main 16c2fd082 without conflicts - The new commit's AI model (Gemini 4 Neon) is not one of the models CONTRIBUTING.md refuses </details> <details><summary>How this was tested</summary> - Merged onto main `16c2fd08`, then `cargo build --workspace` and `cargo test --workspace --no-fail-fast -- --test-threads=4`. - The skipped GPU tests are those this card can't run (no wave64 on NVIDIA, no D3D12 debug layer, and similar). - `scripts/smoke.ps1`: 60 s of a retail title on main `16c2fd08` and on this merge; presents per 2 s at the end: 61 60 60. - Title run: the release build of this merge launched the retail title with `XCL_RUN_SECONDS=300` and scripted A presses counted from the first frame (`XCL_PRESS_BASE=frame`, #3712) into the world from an existing save; time in the world is counted from the first in-world draw call to the end of the run. </details> <sub>Written by Claude Code (Claude Opus 5.5) and posted by Foniass without a human check of each point.</sub>
Gevroska commented 2026-12-03 08:45:28 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Gevroska on 2026-12-03T08:45:28Z.


I ran six focused checks on 86f25b22 with my RTX 3080, driver 32.0.16.1692, and DXC 1.9.2609.5. All six passed with zero skips.

The native-mesh and two-pass paths produced the expected triangle color and matched across the full texture readback. The separate test for the upper half of the split wave and the packed pixel-shader input signature also passed. The other four checks covered adapter selection, sliced and counted indirect arguments, and the six expected CPU-side binding slots.

This qualifies those paths on Ampere. I haven’t run a parent comparison or a retail game regression for this head.

AI disclosure: OpenAI Codex GPT-6.1 Terra ran the tests. GPT-6.2 Sol independently checked the source, executable, and saved results. GPT-6.2 Astra drafted this comment.

I reviewed and approved this comment before posting.

<!-- greyfinch-sync:ivall/xcl:comment:7372699251 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3656#issuecomment-7372699251). Originally posted by [Gevroska](https://github.com/Gevroska) on 2026-12-03T08:45:28Z. --- I ran six focused checks on `86f25b22` with my RTX 3080, driver `32.0.16.1692`, and DXC `1.9.2609.5`. All six passed with zero skips. The native-mesh and two-pass paths produced the expected triangle color and matched across the full texture readback. The separate test for the upper half of the split wave and the packed pixel-shader input signature also passed. The other four checks covered adapter selection, sliced and counted indirect arguments, and the six expected CPU-side binding slots. This qualifies those paths on Ampere. I haven’t run a parent comparison or a retail game regression for this head. AI disclosure: OpenAI Codex GPT-6.1 Terra ran the tests. GPT-6.2 Sol independently checked the source, executable, and saved results. GPT-6.2 Astra drafted this comment. I reviewed and approved this comment before posting.
Kalmarv commented 2026-12-03 08:53:19 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Kalmarv on 2026-12-03T08:53:19Z.


@Gevroska Thanks for the RTX 3080 (Ampere) verification across all six checks!

@Foniass Squashed our 5 commits above #3327 (d10821a30) into 2 clean logical commits addressing Finding #3 (0-byte tree diff vs 938b9e311, keeping #3327's 3 commits intact below our stack):

  • a1c56128e Recompiler: add direct-DXIL Wave64 native ms_6_6 mesh translator (all gpu/dxil/* changes, verified standalone with cargo check -p xcl --tests).
  • a44f86d3e D3D12.X: wire Wave64 native mesh PSOs and sliced indirect dispatch (pso.rs, bind.rs, real.rs, with the real.rs add/revert pair removed from history).

Verification on a44f86d3e (RTX 5070 Ti, DXC 1.9.2609.5, rustc 1.99.0)

  • cargo build --release -p xcl: succeeded, 39 warnings (0 new vs origin/main 39).
  • .\scripts\test.ps1: 3,031 passed, 0 failed, 52 ignored across 44 binaries (all 24 native_mesh tests passed; 24 GPU tests SKIPPED: 22 no wave64, 2 no heap windows).
  • 60 s smokes (ea3b5e4d, exit 0x0, 0 device removals, 0 crashes):
    • Base 078358a05: 1,695 frames, 60 60 60 presents/2 s, 17,123 MB peak commit.
    • PR default (XCL_NATIVE_MESH unset): 1,716 frames, 60 60 60 presents/2 s, 17,213 MB peak commit.
    • PR opt-in (XCL_NATIVE_MESH=1): 1,699 frames, 60 60 60 presents/2 s, 17,333 MB peak commit (201 / 202 native ms_6_6 PSOs eligible, 1 / 202 routed to two-pass on output budget, 0 errors).

Remaining open items (#1/#2/#6 stacked on #3327, split/rebase after #3327 + #3681/#3339 land; #4/#5 in-world GPU-time gain, visual comparison, and RTX 5090 re-test at a44f86d3e pending @KDenKC) are unchanged.

Assisted-by: Antigravity (Gemini 4 Neon)

<!-- greyfinch-sync:ivall/xcl:comment:7372880683 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3656#issuecomment-7372880683). Originally posted by [Kalmarv](https://github.com/Kalmarv) on 2026-12-03T08:53:19Z. --- @Gevroska Thanks for the RTX 3080 (Ampere) verification across all six checks! @Foniass Squashed our 5 commits above #3327 (`d10821a30`) into 2 clean logical commits addressing Finding #3 (`0`-byte tree diff vs `938b9e311`, keeping #3327's 3 commits intact below our stack): - `a1c56128e` `Recompiler: add direct-DXIL Wave64 native ms_6_6 mesh translator` (all `gpu/dxil/*` changes, verified standalone with `cargo check -p xcl --tests`). - `a44f86d3e` `D3D12.X: wire Wave64 native mesh PSOs and sliced indirect dispatch` (`pso.rs`, `bind.rs`, `real.rs`, with the `real.rs` add/revert pair removed from history). **Verification on `a44f86d3e` (RTX 5070 Ti, DXC `1.9.2609.5`, `rustc 1.99.0`)** - `cargo build --release -p xcl`: succeeded, 39 warnings (0 new vs `origin/main` 39). - `.\scripts\test.ps1`: **3,031 passed, 0 failed, 52 ignored** across 44 binaries (all 24 `native_mesh` tests passed; 24 GPU tests `SKIPPED`: 22 `no wave64`, 2 `no heap windows`). - 60 s smokes (`ea3b5e4d`, exit `0x0`, 0 device removals, 0 crashes): - Base `078358a05`: 1,695 frames, `60 60 60` presents/2 s, 17,123 MB peak commit. - PR default (`XCL_NATIVE_MESH` unset): 1,716 frames, `60 60 60` presents/2 s, 17,213 MB peak commit. - PR opt-in (`XCL_NATIVE_MESH=1`): 1,699 frames, `60 60 60` presents/2 s, 17,333 MB peak commit (**201 / 202** native `ms_6_6` PSOs eligible, **1 / 202** routed to two-pass on output budget, 0 errors). Remaining open items (#1/#2/#6 stacked on #3327, split/rebase after #3327 + #3681/#3339 land; #4/#5 in-world GPU-time gain, visual comparison, and RTX 5090 re-test at `a44f86d3e` pending @KDenKC) are unchanged. *Assisted-by: Antigravity (Gemini 4 Neon)*
KDenKC commented 2026-12-03 09:07:30 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by KDenKC on 2026-12-03T09:07:30Z.


@Kalmarv before this lands: on the RTX 5090 the fault is not gone at 86f25b22 (same code as a44f86d3). Plain PR head, XCL_NATIVE_MESH=1, 16-window layout, the retail title: the device is removed 9 s into the world, at 77 s, now on a native DispatchMesh rather than the indirect path:

[   77.363] D3D12 device removed: 0x887a0006
[   77.364] DRED device state: 7
[   77.364] DRED page fault at GPU VA 0x0 = window 10 + 0x0; allocations there: []; recently freed: []
[   77.365] DRED: list 0xf68f6070 on queue 0x5fdc740: 305 of 355 operations done, around: 0 42 0 >42 0 42; pipeline bound there: a graphics pipeline 0xeb81b5c70 (shaders 1fc0ecf7459418b9)

Op 42 in flight is a DispatchMesh under the native PSO 1fc0ecf7. A lead from reading the code (not yet proven): this run opened 10 UMA windows (3 sparse + 1 coherent + 6 view, so 0..9), and the heap slots for windows 10..15 hold null UAVs; native mesh programs are translated for 16 windows (16 | HEAP_WINDOWS), so a program whose address resolves to window 10+ selects a null slot, which fits a VA-0 fault. If that holds, bounding native-mesh addressability to the windows actually open (and keying the translation on it) would fix it; we're testing that on our side and will post the result. With XCL_NATIVE_MESH=0 the same build runs to the end of the session.

Your loyal testing minion, still on it.

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:7373210038 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3656#issuecomment-7373210038). Originally posted by [KDenKC](https://github.com/KDenKC) on 2026-12-03T09:07:30Z. --- @Kalmarv before this lands: on the RTX 5090 the fault is not gone at `86f25b22` (same code as `a44f86d3`). Plain PR head, `XCL_NATIVE_MESH=1`, 16-window layout, the retail title: the device is removed 9 s into the world, at 77 s, now on a native `DispatchMesh` rather than the indirect path: ``` [ 77.363] D3D12 device removed: 0x887a0006 [ 77.364] DRED device state: 7 [ 77.364] DRED page fault at GPU VA 0x0 = window 10 + 0x0; allocations there: []; recently freed: [] [ 77.365] DRED: list 0xf68f6070 on queue 0x5fdc740: 305 of 355 operations done, around: 0 42 0 >42 0 42; pipeline bound there: a graphics pipeline 0xeb81b5c70 (shaders 1fc0ecf7459418b9) ``` Op 42 in flight is a `DispatchMesh` under the native PSO `1fc0ecf7`. A lead from reading the code (not yet proven): this run opened 10 UMA windows (3 sparse + 1 coherent + 6 view, so 0..9), and the heap slots for windows 10..15 hold null UAVs; native mesh programs are translated for 16 windows (`16 | HEAP_WINDOWS`), so a program whose address resolves to window 10+ selects a null slot, which fits a VA-0 fault. If that holds, bounding native-mesh addressability to the windows actually open (and keying the translation on it) would fix it; we're testing that on our side and will post the result. With `XCL_NATIVE_MESH=0` the same build runs to the end of the session. Your loyal testing minion, still on it. AI use: an agent swarm: Claude Opus 5.5, Claude Sonnet 5.5, GPT-6.2-Sol, Gemini 4 Neon and Gemini 4 Hydrogen.
Kalmarv commented 2026-12-03 09:32:19 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Kalmarv on 2026-12-03T09:32:19Z.


@KDenKC Thanks for testing 86f25b22 / a44f86d3 on the RTX 5090 and narrowing it to a direct DispatchMesh — standing by for your window-bound test result!

Two quick local data points from inspecting that pipeline and testing on our RTX 5070 Ti while you run that check:

  1. Native vs two-pass DXIL on the faulting DispatchMesh pipeline (under 16 | HEAP_WINDOWS): both ms_6_6 and two-pass cs_6_6 emit the exact same 47 window < 16 checks, 72 rawBufferLoads, 56 createHandleFromHeaps, 5 textureLoads, 2 sampleLevels, and IO dword offsets ([3, 16..24, 112, 118]), with ps_packed = false and validate = Ok(()) on DXC 1.9. Both paths also receive the same windows_for_stage(mem_windows(), ...) (pso.rs:1601 / 1687).
  2. Null UAV sanity check on RTX 5070 Ti: a minimal ms_6_6 reading ResourceDescriptorHeap[MEM_HEAP_BASE + 10] populated with console_heap.rs:620's null UAV (None resource, raw_window_uav(MAX_SIZE)) completed cleanly (WAIT_EVENT(0), GetDeviceRemovedReason() = Ok(())) on our RTX 5070 Ti, so a null window-10 descriptor alone did not reproduce a VA-0 fault in isolation here.

Curious to see whether bounding open windows changes the RTX 5090 result — if it does not, another place worth checking on the native DispatchMesh path is whether one of the shader's 2 agreed_branches (CondAgree::Any) or ignored S_BARRIERs diverges from two-pass on live in-world inputs, or whether ensure_view_heap running before flush_two_pass in bind.rs:3506-3509 ever interacts with deferred draws on that list.

Assisted-by: Antigravity (Gemini 4 Neon)

<!-- greyfinch-sync:ivall/xcl:comment:7373819129 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3656#issuecomment-7373819129). Originally posted by [Kalmarv](https://github.com/Kalmarv) on 2026-12-03T09:32:19Z. --- @KDenKC Thanks for testing `86f25b22` / `a44f86d3` on the RTX 5090 and narrowing it to a direct `DispatchMesh` — standing by for your window-bound test result! Two quick local data points from inspecting that pipeline and testing on our RTX 5070 Ti while you run that check: 1. **Native vs two-pass DXIL on the faulting `DispatchMesh` pipeline (under `16 | HEAP_WINDOWS`):** both `ms_6_6` and two-pass `cs_6_6` emit the exact same 47 window `< 16` checks, 72 `rawBufferLoad`s, 56 `createHandleFromHeap`s, 5 `textureLoad`s, 2 `sampleLevel`s, and IO dword offsets (`[3, 16..24, 112, 118]`), with `ps_packed = false` and `validate = Ok(())` on DXC 1.9. Both paths also receive the same `windows_for_stage(mem_windows(), ...)` (`pso.rs:1601` / `1687`). 2. **Null UAV sanity check on RTX 5070 Ti:** a minimal `ms_6_6` reading `ResourceDescriptorHeap[MEM_HEAP_BASE + 10]` populated with `console_heap.rs:620`'s null UAV (`None` resource, `raw_window_uav(MAX_SIZE)`) completed cleanly (`WAIT_EVENT(0)`, `GetDeviceRemovedReason() = Ok(())`) on our RTX 5070 Ti, so a null window-10 descriptor alone did not reproduce a VA-0 fault in isolation here. Curious to see whether bounding open windows changes the RTX 5090 result — if it does not, another place worth checking on the native `DispatchMesh` path is whether one of the shader's 2 `agreed_branches` (`CondAgree::Any`) or ignored `S_BARRIER`s diverges from two-pass on live in-world inputs, or whether `ensure_view_heap` running before `flush_two_pass` in `bind.rs:3506-3509` ever interacts with deferred draws on that list. *Assisted-by: Antigravity (Gemini 4 Neon)*
Foniass commented 2026-12-03 09:58:47 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Foniass on 2026-12-03T09:58:47Z.


merge-check
base: 16c2fd082a
head: a44f86d3e6
merge: clean
build: ok
tests: 3037 passed, 0 failed, 56 ignored; 28 skipped, the same as on main
review: 1 high, 4 medium, 2 nits (below)
performance: 60 s smoke run: 1683 → 1667 frames (99 % of main), peak commit 18505 → 17253 MB, no device removal, no crash
title run: retail title on the RTX 5070 Ti (driver 621.14), into the world by scripted presses: 221 s there, 0 device removals, 0 crashes, 3.2 presents/s; run with XCL_SKIP_CS=95cc13288a27a96e (the NVIDIA hang at the end of loading, #3541) and NVIDIA's 2048 MB shader heap (#2590)
verdict: not yet: 1 blocking finding (critical or high, below); also PR description is red
hardware / tool and model: RTX 5070 Ti (driver 621.14), Ryzen 7 7800X3D, Windows 11 26300 / Claude Code with Claude Opus 5.5


In short: The push re-squashes the author's commits above #3327 into two (a1c56128 translator, a44f86d3 runtime wiring); the tree is the same as 938b9e31, so no code changed since my last merge-check. That fixes the review-fix history finding, but #3327's draft commits are still carried, and the size, speed, RTX 5090 and conflict findings are still open. KDenKC has since reproduced the RTX 5090 device removal on the same code, now on a native DispatchMesh.

High

  1. Still carries #3327's draft commits. The bottom three commits (b9365b466, e1c7bf4ff, d10821a30) are still #3327's head d10821a30, and #3327 is still an open draft. Merging this PR would merge #3327's unreviewed draft work with it. Wait for #3327 to land and rebase, or take those commits out.

Medium

  1. Own part is still about 4,000 lines. d10821a30..a44f86d3 changes 13 files (+3,876/-166): a1c56128e is +3,312/-79 (native_mesh.rs alone is about 2,500 lines) and a44f86d3e is +564/-87. The squash made the commits cleaner but no smaller, and the total is far past the ~800-line point where CONTRIBUTING.md asks for a reason it cannot be split. Split it before merge as planned: translator behind the flag with its tests, packed PS/MS signatures, then the runtime wiring.
  2. RTX 5090 device removal still not fixed. KDenKC (comment 7373210038) ran 86f25b22 with XCL_NATIVE_MESH=1 on the RTX 5090. The device was removed 9 s into the world, with a page fault at GPU VA 0 (window 10 + 0x0) on a native DispatchMesh (PSO 1fc0ecf7). Earlier runs faulted only on the indirect path. 86f25b22 is not quite this head (938b9e31 later reverted its real.rs UMA guards), but nothing since 938b9e31 changes the native path. KDenKC's lead is that native mesh programs are translated for 16 windows while only 10 are open, so an address that resolves to window 10+ reads a null slot; this is not proven yet. Nothing yet shows the opt-in picture matches two-pass either. Add the 5090 result at this head and a visual check against two-pass.
  3. No measured gain. The new smokes are still capped at 60 presents per 2 s: base 1,695, default 1,716 and opt-in 1,699 frames. There is no GPU-time or frame-time number showing that the native path is faster than two-pass. Add a measurement, for example gpu_profile IndirectNativeMesh / NativeMesh against two-pass in the world.
  4. Conflicts with open #3681 and #3339. git merge-tree of a44f86d3 with #3681's head 61408de0 conflicts in crates/xcl/src/hle/d3d12x/bind.rs (sliced indirect mesh scratch). With #3339's head 62d53267 it conflicts in graphics.rs (both add the name-offset tiebreaker to sig_part ~615), lower_gfx.rs and core_tests.rs. Agree which lands first and rebase the other; the sig_part tiebreaker should end up in one place.

Nit

  1. Description says the default path is untouched. The description says "Default path (XCL_NATIVE_MESH=0) is untouched", but a44f86d3e changes code the default two-pass path runs. prepare_two_pass_stage now filters zero window VAs through nonzero_window_va (bind.rs ~3115). SCALE_ARGS_HLSL gains slice_base/total_cap words and binds six root UAVs in emit_scaled_args_rewrite_from (bind.rs ~3287, also reached from prepare_scaled_args ~3330). These look harmless (see the fine lines) but the description should list them.
  2. Commit bodies are unwrapped single lines. The bodies of a1c56128e and a44f86d3e are paragraphs and bullets of 200-500 characters on single lines. git log in this repo wraps bodies at about 72 columns.
Checked and fine
  • Earlier finding fixed: the review-fix commit no longer undoes part of the one before it. The five commits above #3327 are squashed into a1c56128e (only gpu/dxil files, Recompiler subject) and a44f86d3e (pso.rs, bind.rs, real.rs, D3D12.X subject). The real.rs open_window_buf / open_window_va add/revert pair is gone from the history, and the tree is the same as 938b9e31 (tree 5d728532).
  • a1c56128e uses nothing that only a44f86d3e adds: the native-mesh references outside gpu/dxil at that commit (emit.rs, recomp/mod.rs, bind.rs, gpu_profile.rs) all come from #3327's commits, which fits the author's standalone cargo check of that commit
  • The default two-pass changes are the same as at 938b9e31: nonzero_window_va keeps the fallback for None and Some(0) and is tested (bind.rs ~8303), and default SCALE_ARGS_HLSL callers pass 0, 0 for the slice words
  • No assertion deleted or weakened since my last merge-check (same tree); check_unplanned_barrier still returns Err in release builds and has its test
  • a44f86d3 merges into current main 16c2fd082 without conflicts
  • Gevroska's RTX 3080 run of six focused native-mesh tests on 86f25b22 (comment 7372699251) passed with no skips, so the parity, half-1 branch, packed PS signature and sliced-indirect tests have now run on wave32 Ampere. That run had no retail-title regression check.
  • The AI model named in the commits and description (Antigravity, Gemini 4 Neon) is not one of the models CONTRIBUTING.md refuses
How this was tested
  • Merged onto main 16c2fd08, then cargo build --workspace and cargo test --workspace --no-fail-fast -- --test-threads=4.
  • The skipped GPU tests are those this card can't run (no wave64 on NVIDIA, no D3D12 debug layer, and similar).
  • scripts/smoke.ps1: 60 s of a retail title on main 16c2fd08 and on this merge; presents per 2 s at the end: 60 60 61.
  • Title run: the release build of this merge launched the retail title with XCL_RUN_SECONDS=300 and scripted A presses counted from the first frame (XCL_PRESS_BASE=frame, #3712) into the world from an existing save; time in the world is counted from the first in-world draw call to the end of the run.

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

<!-- greyfinch-sync:ivall/xcl:comment:7374557948 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3656#issuecomment-7374557948). Originally posted by [Foniass](https://github.com/Foniass) on 2026-12-03T09:58:47Z. --- merge-check base: 16c2fd082ae2e96967a2ab553bc2e1032e491f70 head: a44f86d3e633e95c797951dcc9acf4962be64bb4 merge: clean build: ok tests: 3037 passed, 0 failed, 56 ignored; 28 skipped, the same as on main review: 1 high, 4 medium, 2 nits (below) performance: 60 s smoke run: 1683 → 1667 frames (99 % of main), peak commit 18505 → 17253 MB, no device removal, no crash title run: retail title on the RTX 5070 Ti (driver 621.14), into the world by scripted presses: 221 s there, 0 device removals, 0 crashes, 3.2 presents/s; run with `XCL_SKIP_CS=95cc13288a27a96e` (the NVIDIA hang at the end of loading, #3541) and NVIDIA's 2048 MB shader heap (#2590) verdict: not yet: 1 blocking finding (critical or high, below); also `PR description` is red hardware / tool and model: RTX 5070 Ti (driver 621.14), Ryzen 7 7800X3D, Windows 11 26300 / Claude Code with Claude Opus 5.5 --- **In short:** The push re-squashes the author's commits above #3327 into two (a1c56128 translator, a44f86d3 runtime wiring); the tree is the same as 938b9e31, so no code changed since my last merge-check. That fixes the review-fix history finding, but #3327's draft commits are still carried, and the size, speed, RTX 5090 and conflict findings are still open. KDenKC has since reproduced the RTX 5090 device removal on the same code, now on a native DispatchMesh. #### High 1. **Still carries #3327's draft commits.** The bottom three commits (b9365b466, e1c7bf4ff, d10821a30) are still #3327's head d10821a30, and #3327 is still an open draft. Merging this PR would merge #3327's unreviewed draft work with it. Wait for #3327 to land and rebase, or take those commits out. #### Medium 2. **Own part is still about 4,000 lines.** d10821a30..a44f86d3 changes 13 files (+3,876/-166): a1c56128e is +3,312/-79 (native_mesh.rs alone is about 2,500 lines) and a44f86d3e is +564/-87. The squash made the commits cleaner but no smaller, and the total is far past the ~800-line point where CONTRIBUTING.md asks for a reason it cannot be split. Split it before merge as planned: translator behind the flag with its tests, packed PS/MS signatures, then the runtime wiring. 3. **RTX 5090 device removal still not fixed.** KDenKC (comment 7373210038) ran 86f25b22 with XCL_NATIVE_MESH=1 on the RTX 5090. The device was removed 9 s into the world, with a page fault at GPU VA 0 (window 10 + 0x0) on a native DispatchMesh (PSO 1fc0ecf7). Earlier runs faulted only on the indirect path. 86f25b22 is not quite this head (938b9e31 later reverted its real.rs UMA guards), but nothing since 938b9e31 changes the native path. KDenKC's lead is that native mesh programs are translated for 16 windows while only 10 are open, so an address that resolves to window 10+ reads a null slot; this is not proven yet. Nothing yet shows the opt-in picture matches two-pass either. Add the 5090 result at this head and a visual check against two-pass. 4. **No measured gain.** The new smokes are still capped at 60 presents per 2 s: base 1,695, default 1,716 and opt-in 1,699 frames. There is no GPU-time or frame-time number showing that the native path is faster than two-pass. Add a measurement, for example gpu_profile IndirectNativeMesh / NativeMesh against two-pass in the world. 5. **Conflicts with open #3681 and #3339.** git merge-tree of a44f86d3 with #3681's head 61408de0 conflicts in crates/xcl/src/hle/d3d12x/bind.rs (sliced indirect mesh scratch). With #3339's head 62d53267 it conflicts in graphics.rs (both add the name-offset tiebreaker to sig_part ~615), lower_gfx.rs and core_tests.rs. Agree which lands first and rebase the other; the sig_part tiebreaker should end up in one place. #### Nit 6. **Description says the default path is untouched.** The description says "Default path (XCL_NATIVE_MESH=0) is untouched", but a44f86d3e changes code the default two-pass path runs. prepare_two_pass_stage now filters zero window VAs through nonzero_window_va (bind.rs ~3115). SCALE_ARGS_HLSL gains slice_base/total_cap words and binds six root UAVs in emit_scaled_args_rewrite_from (bind.rs ~3287, also reached from prepare_scaled_args ~3330). These look harmless (see the fine lines) but the description should list them. 7. **Commit bodies are unwrapped single lines.** The bodies of a1c56128e and a44f86d3e are paragraphs and bullets of 200-500 characters on single lines. git log in this repo wraps bodies at about 72 columns. <details><summary>Checked and fine</summary> - Earlier finding fixed: the review-fix commit no longer undoes part of the one before it. The five commits above #3327 are squashed into a1c56128e (only gpu/dxil files, Recompiler subject) and a44f86d3e (pso.rs, bind.rs, real.rs, D3D12.X subject). The real.rs open_window_buf / open_window_va add/revert pair is gone from the history, and the tree is the same as 938b9e31 (tree 5d728532). - a1c56128e uses nothing that only a44f86d3e adds: the native-mesh references outside gpu/dxil at that commit (emit.rs, recomp/mod.rs, bind.rs, gpu_profile.rs) all come from #3327's commits, which fits the author's standalone cargo check of that commit - The default two-pass changes are the same as at 938b9e31: nonzero_window_va keeps the fallback for None and Some(0) and is tested (bind.rs ~8303), and default SCALE_ARGS_HLSL callers pass 0, 0 for the slice words - No assertion deleted or weakened since my last merge-check (same tree); check_unplanned_barrier still returns Err in release builds and has its test - a44f86d3 merges into current main 16c2fd082 without conflicts - Gevroska's RTX 3080 run of six focused native-mesh tests on 86f25b22 (comment 7372699251) passed with no skips, so the parity, half-1 branch, packed PS signature and sliced-indirect tests have now run on wave32 Ampere. That run had no retail-title regression check. - The AI model named in the commits and description (Antigravity, Gemini 4 Neon) is not one of the models CONTRIBUTING.md refuses </details> <details><summary>How this was tested</summary> - Merged onto main `16c2fd08`, then `cargo build --workspace` and `cargo test --workspace --no-fail-fast -- --test-threads=4`. - The skipped GPU tests are those this card can't run (no wave64 on NVIDIA, no D3D12 debug layer, and similar). - `scripts/smoke.ps1`: 60 s of a retail title on main `16c2fd08` and on this merge; presents per 2 s at the end: 60 60 61. - Title run: the release build of this merge launched the retail title with `XCL_RUN_SECONDS=300` and scripted A presses counted from the first frame (`XCL_PRESS_BASE=frame`, #3712) into the world from an existing save; time in the world is counted from the first in-world draw call to the end of the run. </details> <sub>Written by Claude Code (Claude Opus 5.5) and posted by Foniass without a human check of each point.</sub>
KDenKC commented 2026-12-03 11:22:14 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by KDenKC on 2026-12-03T11:22:14Z.


@Kalmarv follow-up on a44f86d3, RTX 5090, the retail title, XCL_NATIVE_MESH=1. First a correction: my "window 10" lead above was wrong. window 10 + 0x0 is only the log's label for address 0 (that window's base reads as 0); restoring the unopened-window guards from 86f25b22's real.rs changes nothing (run nm-abg below).

1. The DispatchMesh fault at world entry is your own 42bd1090. On a44f86d3 the shared heap's null-window step runs before fill_nulls, so MEM_NULL_LOAD / MEM_NULL_STORE (slots 20 and 21) end up as Texture2D null views while the translated PS reads and writes them as RWByteAddressBuffer (ps 3169caf0d1a3f218: 73 slot-20 + 4 slot-21 raw-buffer ops). Cherry-picking 42bd1090 on top (null window views after fill_nulls, so those slots stay raw-buffer null UAVs) removes it: the run now gets 80-100 s into the world instead of losing the device at entry (the frame dumps up to then still show the loading art; the lit cell isn't reached yet). It isn't in the PR head yet.

2. A second, separate bug (fixed on our side, harmless to the fault): native_mesh.rs alloc_stage / matched (around L943-1010) prune MS output components by the MS's own OSG1 mask. For ms e1fbdad48510b7bc that's 0x3 on TEXCOORD0, while the linked PS declares 0xF and reads .zw, so the PS gets 0.0 there (the two-pass emitter keeps all 4). Our fix keeps every component the linked PS declares unless a sibling MS output owns it on the same register, with a test for both cases. Happy to put it up as a commit for you to pick.

3. What's left: a hang on a native ExecuteIndirect, the same in three runs, ~80-100 s into the world:

run tree removed at world entry
nm-b a44f86d3 + 42bd1090 190.7 s 90.6 s
nm-ab + fix 2 191.9 s 93.8 s
nm-abg + fix 2 + the real.rs guards 177.8 s 95.0 s
[  177.800] DRED device state: 3
[  177.801] DRED page fault at GPU VA 0x0 = window 10 + 0x0; allocations there: []; recently freed: []
[  177.801] DRED: list 0x23a9b90880 on queue 0x7d274150: 34 of 939 operations done, around: 15 0 15 >5 15 15; pipeline bound there: a graphics pipeline 0xc10e744f0 (shaders 0d75c92fa0dc8c6b); bound after it: ms fb0ef97acb468f9a ps 053a41b784a18825

Op 5 = ExecuteIndirect under the native PSO 0d75c92f, 34 operations into the list, with device state 3 this time. It is the same PSO as the ExecuteIndirect fault in our earlier e1c7be06 runs, so the arguments or count fed to that ExecuteIndirect are next on our list. With XCL_NATIVE_MESH=0, the 86f25b22 tree ran to the end of the session.

Direct native DispatchMesh holds. With fixes 1+2 and a local switch that sends only the native-eligible ExecuteIndirect draws down the two-pass path (direct DispatchMesh stays native), the run went to the end: 309 s in the world, no removal, frame GPU span 154 ms, picture the same as the native-off run of the same tree. So what's left is only the native ExecuteIndirect path.

Your loyal testing minion, three removals further along.

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:7376605067 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3656#issuecomment-7376605067). Originally posted by [KDenKC](https://github.com/KDenKC) on 2026-12-03T11:22:14Z. --- @Kalmarv follow-up on `a44f86d3`, RTX 5090, the retail title, `XCL_NATIVE_MESH=1`. First a correction: my "window 10" lead above was wrong. `window 10 + 0x0` is only the log's label for address 0 (that window's base reads as 0); restoring the unopened-window guards from `86f25b22`'s `real.rs` changes nothing (run nm-abg below). **1. The `DispatchMesh` fault at world entry is your own `42bd1090`.** On `a44f86d3` the shared heap's null-window step runs before `fill_nulls`, so `MEM_NULL_LOAD` / `MEM_NULL_STORE` (slots 20 and 21) end up as `Texture2D` null views while the translated PS reads and writes them as `RWByteAddressBuffer` (ps `3169caf0d1a3f218`: 73 slot-20 + 4 slot-21 raw-buffer ops). Cherry-picking `42bd1090` on top (null window views after `fill_nulls`, so those slots stay raw-buffer null UAVs) removes it: the run now gets 80-100 s into the world instead of losing the device at entry (the frame dumps up to then still show the loading art; the lit cell isn't reached yet). It isn't in the PR head yet. **2. A second, separate bug (fixed on our side, harmless to the fault):** `native_mesh.rs` `alloc_stage` / `matched` (around L943-1010) prune MS output components by the MS's own `OSG1` mask. For ms `e1fbdad48510b7bc` that's `0x3` on `TEXCOORD0`, while the linked PS declares `0xF` and reads `.zw`, so the PS gets 0.0 there (the two-pass emitter keeps all 4). Our fix keeps every component the linked PS declares unless a sibling MS output owns it on the same register, with a test for both cases. Happy to put it up as a commit for you to pick. **3. What's left: a hang on a native `ExecuteIndirect`,** the same in three runs, ~80-100 s into the world: | run | tree | removed at | world entry | |---|---|---|---| | nm-b | `a44f86d3` + `42bd1090` | 190.7 s | 90.6 s | | nm-ab | + fix 2 | 191.9 s | 93.8 s | | nm-abg | + fix 2 + the `real.rs` guards | 177.8 s | 95.0 s | ``` [ 177.800] DRED device state: 3 [ 177.801] DRED page fault at GPU VA 0x0 = window 10 + 0x0; allocations there: []; recently freed: [] [ 177.801] DRED: list 0x23a9b90880 on queue 0x7d274150: 34 of 939 operations done, around: 15 0 15 >5 15 15; pipeline bound there: a graphics pipeline 0xc10e744f0 (shaders 0d75c92fa0dc8c6b); bound after it: ms fb0ef97acb468f9a ps 053a41b784a18825 ``` Op 5 = `ExecuteIndirect` under the native PSO `0d75c92f`, 34 operations into the list, with device state 3 this time. It is the same PSO as the `ExecuteIndirect` fault in our earlier `e1c7be06` runs, so the arguments or count fed to that `ExecuteIndirect` are next on our list. With `XCL_NATIVE_MESH=0`, the `86f25b22` tree ran to the end of the session. **Direct native `DispatchMesh` holds.** With fixes 1+2 and a local switch that sends only the native-eligible `ExecuteIndirect` draws down the two-pass path (direct `DispatchMesh` stays native), the run went to the end: 309 s in the world, no removal, frame GPU span 154 ms, picture the same as the native-off run of the same tree. So what's left is only the native `ExecuteIndirect` path. Your loyal testing minion, three removals further along. AI use: an agent swarm: Claude Opus 5.5, Claude Sonnet 5.5, GPT-6.2-Sol, Gemini 4 Neon and Gemini 4 Hydrogen.
Kalmarv commented 2026-12-03 11:47:11 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Kalmarv on 2026-12-03T11:47:11Z.


@KDenKC Huge milestone — thank you for tracking down the world-entry fault to 42bd1090 and verifying that direct native DispatchMesh holds for the full 309 s in-world run with matching output!

On your three points:

  1. World-entry DispatchMesh fault (42bd1090): makes complete sense — a44f86d3 is still stacked on #3327's older base without 42bd1090.
  2. MS OSG1 vs linked PS ISG1 mask pruning (native_mesh.rs:943-1010): great catch — lower_mem.rs already forwards every enabled EXP PARAM channel into staged_comp, so keeping PS-declared components not owned by a sibling MS output on the same register is the right fix. Happy to cherry-pick your commit (with tests) into our next push once the indirect hang is narrowed down.
  3. Native ExecuteIndirect hang (DRED device state: 3 = hung): while you check the live arguments/count on that draw, we audited the faulting indirect pipeline's translated native ms_6_6 DXIL and the bind.rs:3792-3858 indirect path locally:
    • Barrier/loop audit of the faulting pipeline's native ms_6_6 DXIL is clean: DXC 1.9 validate = Ok(()); all 12 RDNA2 loops are single-level (4 exchanged-mask waterfall loops with barriers + 8 barrier-free loops), and every one of the 38 barrier-guarding conditional branches in the emitted DXIL traces either to an agree_cond barrier (16 sites), an exchanged 64-bit mask, a loop counter, or a dispatch-invariant u1 IO load.
    • One concrete lead for the arguments/count check: that pipeline is unusually heavy (~5.7k RDNA2 instructions, ~70 image sample/gather ops, 96 barriers, ~23 KB two-pass record). Because of the ~23 KB record size, two-pass ExecuteIndirect caps a cold command to ~1,455 groups (INDIRECT_RECORDS = 32 MiB, max ~5.8k at 128 MiB), whereas native ExecuteIndirect (bind.rs:3804) allows 65,535 groups per slice (and passes all max commands in a single ExecuteIndirect at bind.rs:3847 vs two-pass's per-command max = 1 loop at bind.rs:3929). If the title's indirect buffer feeds a large or uninitialized group count (or large max), native runs ~45x more groups of that heavy shader than two-pass before capping.

Holding off on pushing any speculative changes while you check the live indirect arguments/count on the RTX 5090 — let us know what shows up there and feel free to drop the commit/branch for fix 2 whenever convenient!

Assisted-by: Antigravity (Gemini 4 Neon)

<!-- greyfinch-sync:ivall/xcl:comment:7377176065 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3656#issuecomment-7377176065). Originally posted by [Kalmarv](https://github.com/Kalmarv) on 2026-12-03T11:47:11Z. --- @KDenKC Huge milestone — thank you for tracking down the world-entry fault to `42bd1090` and verifying that direct native `DispatchMesh` holds for the full 309 s in-world run with matching output! On your three points: 1. **World-entry `DispatchMesh` fault (`42bd1090`):** makes complete sense — `a44f86d3` is still stacked on `#3327`'s older base without `42bd1090`. 2. **MS `OSG1` vs linked PS `ISG1` mask pruning (`native_mesh.rs:943-1010`):** great catch — `lower_mem.rs` already forwards every enabled `EXP PARAM` channel into `staged_comp`, so keeping PS-declared components not owned by a sibling MS output on the same register is the right fix. Happy to cherry-pick your commit (with tests) into our next push once the indirect hang is narrowed down. 3. **Native `ExecuteIndirect` hang (`DRED device state: 3` = hung):** while you check the live arguments/count on that draw, we audited the faulting indirect pipeline's translated native `ms_6_6` DXIL and the `bind.rs:3792-3858` indirect path locally: - **Barrier/loop audit of the faulting pipeline's native `ms_6_6` DXIL is clean:** DXC 1.9 `validate = Ok(())`; all 12 RDNA2 loops are single-level (4 exchanged-mask waterfall loops with barriers + 8 barrier-free loops), and every one of the 38 barrier-guarding conditional branches in the emitted DXIL traces either to an `agree_cond` barrier (16 sites), an exchanged 64-bit mask, a loop counter, or a dispatch-invariant `u1` IO load. - **One concrete lead for the arguments/count check:** that pipeline is unusually heavy (~5.7k RDNA2 instructions, ~70 image sample/gather ops, 96 barriers, ~23 KB two-pass record). Because of the ~23 KB record size, two-pass `ExecuteIndirect` caps a cold command to ~1,455 groups (`INDIRECT_RECORDS = 32 MiB`, max ~5.8k at `128 MiB`), whereas native `ExecuteIndirect` (`bind.rs:3804`) allows `65,535` groups per slice (and passes all `max` commands in a single `ExecuteIndirect` at `bind.rs:3847` vs two-pass's per-command `max = 1` loop at `bind.rs:3929`). If the title's indirect buffer feeds a large or uninitialized group count (or large `max`), native runs ~45x more groups of that heavy shader than two-pass before capping. Holding off on pushing any speculative changes while you check the live indirect arguments/count on the RTX 5090 — let us know what shows up there and feel free to drop the commit/branch for fix 2 whenever convenient! *Assisted-by: Antigravity (Gemini 4 Neon)*
KDenKC commented 2026-12-03 12:10:11 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by KDenKC on 2026-12-03T12:10:11Z.


@Kalmarv checked your group-count lead on the RTX 5090; it isn't the cause. A local switch clamped every native ExecuteIndirect command to at most 1,455 groups (the two-pass cold cap for that record size), with native ExecuteIndirect on and everything else as in the run that held:

  • all 322 native ExecuteIndirect pipelines logged up to 1 commands, so max is 1 everywhere, 0d75c92f included, and nothing passes a large command count;
  • the device is still removed in the same place, ~80 s into the world:
[  167.793] D3D12 device removed: 0x887a0006
[  167.794] DRED device state: 3
[  167.794] DRED page fault at GPU VA 0x0 = window 11 + 0x0; allocations there: []; recently freed: []
[  167.794] DRED: list 0xdf0975360 on queue 0x1851d5710: 34 of 939 operations done, around: 15 0 15 >5 15 15; pipeline bound there: a graphics pipeline 0x173013220 (shaders 0d75c92fa0dc8c6b); bound after it: ms fb0ef97acb468f9a ps 053a41b784a18825

So one command of at most 1,455 groups of that pipeline still hangs, which points at what a single group does (its records/views, or a wait inside it) rather than how many run. We didn't count how often the clamp actually cut a command (no counter in that build), so a count above 1,455 isn't fully ruled out, only made unlikely.

Fix 2 (the OSG1 channel pruning) is on our fork for you to pick: branch fix/native-mesh-ps-channels (commit 918dbd7d, on a44f86d3, with its tests).

Your loyal testing minion, still poking the one draw that won't behave.

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:7377735564 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3656#issuecomment-7377735564). Originally posted by [KDenKC](https://github.com/KDenKC) on 2026-12-03T12:10:11Z. --- @Kalmarv checked your group-count lead on the RTX 5090; it isn't the cause. A local switch clamped every native `ExecuteIndirect` command to at most 1,455 groups (the two-pass cold cap for that record size), with native `ExecuteIndirect` on and everything else as in the run that held: - all 322 native `ExecuteIndirect` pipelines logged `up to 1 commands`, so `max` is 1 everywhere, `0d75c92f` included, and nothing passes a large command count; - the device is still removed in the same place, ~80 s into the world: ``` [ 167.793] D3D12 device removed: 0x887a0006 [ 167.794] DRED device state: 3 [ 167.794] DRED page fault at GPU VA 0x0 = window 11 + 0x0; allocations there: []; recently freed: [] [ 167.794] DRED: list 0xdf0975360 on queue 0x1851d5710: 34 of 939 operations done, around: 15 0 15 >5 15 15; pipeline bound there: a graphics pipeline 0x173013220 (shaders 0d75c92fa0dc8c6b); bound after it: ms fb0ef97acb468f9a ps 053a41b784a18825 ``` So one command of at most 1,455 groups of that pipeline still hangs, which points at what a single group does (its records/views, or a wait inside it) rather than how many run. We didn't count how often the clamp actually cut a command (no counter in that build), so a count above 1,455 isn't fully ruled out, only made unlikely. Fix 2 (the `OSG1` channel pruning) is on our fork for you to pick: branch `fix/native-mesh-ps-channels` (commit `918dbd7d`, on `a44f86d3`, with its tests). Your loyal testing minion, still poking the one draw that won't behave. AI use: an agent swarm: Claude Opus 5.5, Claude Sonnet 5.5, GPT-6.2-Sol, Gemini 4 Neon and Gemini 4 Hydrogen.
Kalmarv commented 2026-12-03 12:29:58 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Kalmarv on 2026-12-03T12:29:58Z.


@KDenKC Thanks for testing the 1,455-group clamp and confirming max == 1 across all 322 native ExecuteIndirect pipelines — that rules out both large command counts and >1,455-group saturation cleanly. Also reviewed 918dbd7d on fix/native-mesh-ps-channels — very clean, we'll cherry-pick it into the next push once we pin down this hang.

A few more local checks on that faulting pipeline on our RTX 5070 Ti (same Blackwell arch):

  • Packed vs unpacked PS: diffed both DXIL outputs — the shader body is identical (0 barriers, 0 atomics, 0 loops, 0 static samplers); the only difference is the packed ISG1 (notably SV_IsFrontFace packed into reg 7 .y alongside TEXCOORD5 .x).
  • D3D12 Debug Layer on the actual linked PSO: CreatePipelineState (ms_6_6 + packed ps_6_6 + 1 MS static sampler) produced 0 Debug Layer messages, and ExecuteIndirect(DispatchMesh, 1) with zeroed buffers completed in 7.6 ms (WAIT_EVENT(0), GetDeviceRemovedReason() = Ok(())).
  • RDNA2 S_BARRIER / loop guards: both S_BARRIERs sit right next to S_SENDMSG at the end of the shader (zero LDS / zero stores), and the icmp eq barrier-free loops are explicitly zero-guarded before entry.

Two quick splits that should separate the remaining hypotheses in one run on the RTX 5090:

  1. Route only that one faulting pipeline to two-pass (leaving the other 321 native ExecuteIndirect pipelines enabled):
    • If the run holds -> bind.rs's native ExecuteIndirect path is clean and the hang is specific to that shader pair (next check there would be disabling want_packed_ps on it in case packed SV_IsFrontFace / reg-7 sharing misbehaves on live primitives, or checking whether its live inputs drive one of its loops to the 4,096 cap).
    • If another native ExecuteIndirect pipeline hangs next -> the bug is in bind.rs's native ExecuteIndirect wiring itself. The only runtime differences left there vs two-pass ExecuteIndirect are:
      • bind.rs:3847 wraps pc(this, sig, ...) in fresh_indirect_arguments (transitioning the global ARGUMENT_ORDER buffer) even though scaled was just transitioned UAV -> INDIRECT_ARGUMENT at bind.rs:3314 (two-pass does not wrap pc in fresh_indirect_arguments);
      • bind.rs:3812 runs native_mesh_stage / ensure_view_heap before flush_two_pass at bind.rs:3818.

Holding off on pushing 918dbd7d until we see which side of that split fires so we don't churn your test base.

Assisted-by: Antigravity (Gemini 4 Neon)

<!-- greyfinch-sync:ivall/xcl:comment:7378351151 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3656#issuecomment-7378351151). Originally posted by [Kalmarv](https://github.com/Kalmarv) on 2026-12-03T12:29:58Z. --- @KDenKC Thanks for testing the 1,455-group clamp and confirming `max == 1` across all 322 native `ExecuteIndirect` pipelines — that rules out both large command counts and >1,455-group saturation cleanly. Also reviewed `918dbd7d` on `fix/native-mesh-ps-channels` — very clean, we'll cherry-pick it into the next push once we pin down this hang. A few more local checks on that faulting pipeline on our RTX 5070 Ti (same Blackwell arch): - **Packed vs unpacked PS:** diffed both DXIL outputs — the shader body is identical (0 barriers, 0 atomics, 0 loops, 0 static samplers); the only difference is the packed `ISG1` (notably `SV_IsFrontFace` packed into reg 7 `.y` alongside `TEXCOORD5` `.x`). - **D3D12 Debug Layer on the actual linked PSO:** `CreatePipelineState` (`ms_6_6` + packed `ps_6_6` + 1 MS static sampler) produced 0 Debug Layer messages, and `ExecuteIndirect(DispatchMesh, 1)` with zeroed buffers completed in 7.6 ms (`WAIT_EVENT(0)`, `GetDeviceRemovedReason() = Ok(())`). - **RDNA2 `S_BARRIER` / loop guards:** both `S_BARRIER`s sit right next to `S_SENDMSG` at the end of the shader (zero LDS / zero stores), and the `icmp eq` barrier-free loops are explicitly zero-guarded before entry. Two quick splits that should separate the remaining hypotheses in one run on the RTX 5090: 1. **Route only that one faulting pipeline to two-pass** (leaving the other 321 native `ExecuteIndirect` pipelines enabled): - If the run holds -> `bind.rs`'s native `ExecuteIndirect` path is clean and the hang is specific to that shader pair (next check there would be disabling `want_packed_ps` on it in case packed `SV_IsFrontFace` / reg-7 sharing misbehaves on live primitives, or checking whether its live inputs drive one of its loops to the 4,096 cap). - If another native `ExecuteIndirect` pipeline hangs next -> the bug is in `bind.rs`'s native `ExecuteIndirect` wiring itself. The only runtime differences left there vs two-pass `ExecuteIndirect` are: - `bind.rs:3847` wraps `pc(this, sig, ...)` in `fresh_indirect_arguments` (transitioning the global `ARGUMENT_ORDER` buffer) even though `scaled` was just transitioned `UAV -> INDIRECT_ARGUMENT` at `bind.rs:3314` (two-pass does not wrap `pc` in `fresh_indirect_arguments`); - `bind.rs:3812` runs `native_mesh_stage` / `ensure_view_heap` before `flush_two_pass` at `bind.rs:3818`. Holding off on pushing `918dbd7d` until we see which side of that split fires so we don't churn your test base. *Assisted-by: Antigravity (Gemini 4 Neon)*
KDenKC commented 2026-12-03 12:31:59 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by KDenKC on 2026-12-03T12:31:59Z.


@Kalmarv your split already has an answer from our side: it's not one pipeline. In the next run on the same tree (a44f86d3 + fixes 1 and 2, native ExecuteIndirect on) the device went at world + 14 s on a different native ExecuteIndirect pipeline, before 0d75c92f had run even once:

[   97.022] DRED device state: 3
[   97.022] DRED page fault at GPU VA 0x0 = window 11 + 0x0; allocations there: []; recently freed: []
[   97.022] DRED: list 0x19504cd90 on queue 0xfe5f24c0: 367 of 786 operations done, around: 15 0 15 >5 15 15; pipeline bound there: a graphics pipeline 0x9c13fc850 (shaders e8d47e794ccce5c7)

e8d47e79 is also the pipeline an earlier run of ours lost the device on, and the e1c7be06 runs above died under e57924ee and 0d75c92f. So the same op-5 hang shows up under at least three native pipelines, which points at the native ExecuteIndirect wiring in bind.rs rather than one shader pair. Your two differences (the fresh_indirect_arguments wrap at L3847, and native_mesh_stage / ensure_view_heap before flush_two_pass) are the right places to look.

Running now: a readback of the rewritten arguments of the last 64 native ExecuteIndirect calls (any pipeline), logged at the removal, so the call in flight shows its dims, stride and address. I'll post what it shows.

Your loyal testing minion.

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:7378417591 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3656#issuecomment-7378417591). Originally posted by [KDenKC](https://github.com/KDenKC) on 2026-12-03T12:31:59Z. --- @Kalmarv your split already has an answer from our side: it's not one pipeline. In the next run on the same tree (`a44f86d3` + fixes 1 and 2, native `ExecuteIndirect` on) the device went at world + 14 s on a different native `ExecuteIndirect` pipeline, before `0d75c92f` had run even once: ``` [ 97.022] DRED device state: 3 [ 97.022] DRED page fault at GPU VA 0x0 = window 11 + 0x0; allocations there: []; recently freed: [] [ 97.022] DRED: list 0x19504cd90 on queue 0xfe5f24c0: 367 of 786 operations done, around: 15 0 15 >5 15 15; pipeline bound there: a graphics pipeline 0x9c13fc850 (shaders e8d47e794ccce5c7) ``` `e8d47e79` is also the pipeline an earlier run of ours lost the device on, and the `e1c7be06` runs above died under `e57924ee` and `0d75c92f`. So the same op-5 hang shows up under at least three native pipelines, which points at the native `ExecuteIndirect` wiring in `bind.rs` rather than one shader pair. Your two differences (the `fresh_indirect_arguments` wrap at L3847, and `native_mesh_stage` / `ensure_view_heap` before `flush_two_pass`) are the right places to look. Running now: a readback of the rewritten arguments of the last 64 native `ExecuteIndirect` calls (any pipeline), logged at the removal, so the call in flight shows its dims, stride and address. I'll post what it shows. Your loyal testing minion. AI use: an agent swarm: Claude Opus 5.5, Claude Sonnet 5.5, GPT-6.2-Sol, Gemini 4 Neon and Gemini 4 Hydrogen.
KDenKC commented 2026-12-03 12:55:52 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by KDenKC on 2026-12-03T12:55:52Z.


@Kalmarv please hold off on cherry-picking 918dbd7d (fix 2): on our side it changes the picture. Same tree, native mesh on (native ExecuteIndirect off), same save and frames, one run each: with 918dbd7d a hard dark diagonal band cuts across a group of paper notes on a wall in all 3 compared frames; with it reverted the band is gone in all 3 (the rest of the frame matches). So keeping the PS-declared components there feeds something wrong into that program, maybe the sibling-output rule or the register it lands on. We'll look at which program draws the notes and report back before you take it.

Your loyal testing minion, catching our own bug this time.

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:7379058080 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3656#issuecomment-7379058080). Originally posted by [KDenKC](https://github.com/KDenKC) on 2026-12-03T12:55:52Z. --- @Kalmarv please hold off on cherry-picking `918dbd7d` (fix 2): on our side it changes the picture. Same tree, native mesh on (native `ExecuteIndirect` off), same save and frames, one run each: with `918dbd7d` a hard dark diagonal band cuts across a group of paper notes on a wall in all 3 compared frames; with it reverted the band is gone in all 3 (the rest of the frame matches). So keeping the PS-declared components there feeds something wrong into that program, maybe the sibling-output rule or the register it lands on. We'll look at which program draws the notes and report back before you take it. Your loyal testing minion, catching our own bug this time. AI use: an agent swarm: Claude Opus 5.5, Claude Sonnet 5.5, GPT-6.2-Sol, Gemini 4 Neon and Gemini 4 Hydrogen.
Kalmarv commented 2026-12-03 13:04:06 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Kalmarv on 2026-12-03T13:04:06Z.


@KDenKC Copy that — holding off on 918dbd7d and waiting for both the indirect argument readback and what you find on that wall-notes shader.

When you inspect that pair, two quick things worth checking:

  1. Whether two-pass (XCL_NATIVE_MESH=0) matches native-without-918dbd7d on those 3 frames (or also shows the band).
  2. Whether the MS OSG1 and PS ISG1 on that register have different lowest set mask bits (ms_first != ps_first), or whether the MS EXP writes nonzero data into channels outside its OSG1 mask that 0.0 was masking.

Assisted-by: Antigravity (Gemini 4 Neon)

<!-- greyfinch-sync:ivall/xcl:comment:7379264729 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3656#issuecomment-7379264729). Originally posted by [Kalmarv](https://github.com/Kalmarv) on 2026-12-03T13:04:06Z. --- @KDenKC Copy that — holding off on `918dbd7d` and waiting for both the indirect argument readback and what you find on that wall-notes shader. When you inspect that pair, two quick things worth checking: 1. Whether two-pass (`XCL_NATIVE_MESH=0`) matches native-without-`918dbd7d` on those 3 frames (or also shows the band). 2. Whether the MS `OSG1` and PS `ISG1` on that register have different lowest set mask bits (`ms_first != ps_first`), or whether the MS `EXP` writes nonzero data into channels outside its `OSG1` mask that `0.0` was masking. *Assisted-by: Antigravity (Gemini 4 Neon)*
KDenKC commented 2026-12-03 13:22:22 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by KDenKC on 2026-12-03T13:22:22Z.


@Kalmarv the native ExecuteIndirect in flight at the removal, named (your a44f86d3 stack with native
EI on, XCL_NATIVE_MESH_EI_CAP=1455; a local readback copies each native EI call's rewritten arguments
just before it runs and marks the slot with WriteBufferImmediate, the 26 in DRED's breadcrumbs):

[186.150] XCL_NATIVE_EI_READBACK: list 0x226316c1a0: newest that ran (in flight if this list faulted) = call 312415 #338 (pipeline 0xb5da3d1a0): commands at 0x10266a3290, stride 12, max 1: rewritten args [0x5, 0x1, 0x1]; title's args as the CPU sees them [0x0, 0x1, 0x1]
[186.162] DRED page fault at GPU VA 0x0 = window 11 + 0x0; allocations there: []; recently freed: []
[186.162] DRED: list 0x226316c1a0 on queue 0x10122a0d0: 46 of 1255 operations done, around: 15 26 15 >5 15 15; pipeline bound there: a graphics pipeline 0xada6182e0 (shaders 0d75c92fa0dc8c6b); bound after it: ms fb0ef97acb468f9a ps 053a41b784a18825, ...
  • The call in flight dispatches 5 groups (x = 5, y = z = 1), from a command record the title's GPU writes
    (in a GPU-memory window). The "title's args" are read on the CPU at the removal, after the title has
    reused that record, so they aren't the values the GPU read and can't be compared. The rewritten
    arguments are the ones that ran: across all 41 cut-off lists they're small, sane counts (0, 1, 2, 5,
    31 groups), nothing like a garbage or huge count.
  • So the hang comes from what those 5 groups of the native program for 0d75c92f do: its record or
    view reads (DRED's VA 0, on NVIDIA possibly "unknown"), not from the argument path.
  • Not in this log: the console ms/ps hashes behind the title pipeline 0xb5da3d1a0 (the crash report's
    list of recent draws doesn't reach back to it).

Your loyal testing minion stands by for the next head.

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:7379715176 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3656#issuecomment-7379715176). Originally posted by [KDenKC](https://github.com/KDenKC) on 2026-12-03T13:22:22Z. --- @Kalmarv the native `ExecuteIndirect` in flight at the removal, named (your `a44f86d3` stack with native EI on, `XCL_NATIVE_MESH_EI_CAP=1455`; a local readback copies each native EI call's rewritten arguments just before it runs and marks the slot with `WriteBufferImmediate`, the `26` in DRED's breadcrumbs): ``` [186.150] XCL_NATIVE_EI_READBACK: list 0x226316c1a0: newest that ran (in flight if this list faulted) = call 312415 #338 (pipeline 0xb5da3d1a0): commands at 0x10266a3290, stride 12, max 1: rewritten args [0x5, 0x1, 0x1]; title's args as the CPU sees them [0x0, 0x1, 0x1] [186.162] DRED page fault at GPU VA 0x0 = window 11 + 0x0; allocations there: []; recently freed: [] [186.162] DRED: list 0x226316c1a0 on queue 0x10122a0d0: 46 of 1255 operations done, around: 15 26 15 >5 15 15; pipeline bound there: a graphics pipeline 0xada6182e0 (shaders 0d75c92fa0dc8c6b); bound after it: ms fb0ef97acb468f9a ps 053a41b784a18825, ... ``` - The call in flight dispatches **5 groups** (x = 5, y = z = 1), from a command record the title's GPU writes (in a GPU-memory window). The "title's args" are read on the CPU at the removal, after the title has reused that record, so they aren't the values the GPU read and can't be compared. The rewritten arguments are the ones that ran: across all 41 cut-off lists they're small, sane counts (0, 1, 2, 5, 31 groups), nothing like a garbage or huge count. - So the hang comes from what those 5 groups of the native program for `0d75c92f` do: its record or view reads (DRED's VA 0, on NVIDIA possibly "unknown"), not from the argument path. - Not in this log: the console ms/ps hashes behind the title pipeline `0xb5da3d1a0` (the crash report's list of recent draws doesn't reach back to it). Your loyal testing minion stands by for the next head. AI use: an agent swarm: Claude Opus 5.5, Claude Sonnet 5.5, GPT-6.2-Sol, Gemini 4 Neon and Gemini 4 Hydrogen.
Kalmarv commented 2026-12-03 14:00:36 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Kalmarv on 2026-12-03T14:00:36Z.


@KDenKC Thank you for the readback — [5, 1, 1] with max = 1, stride = 12 cleanly rules out bad/garbage indirect counts!

We also audited all three hanging indirect pipelines from your DRED logs locally (both the packed-PS one and the two unpacked-PS ones):

  • All three are 128-thread Wave64 ms_6_6 shaders with 51–77 intrinsic barriers (4–8 inside waterfall loops) and 1 MS static sampler; all three pass DXC 1.9 validation cleanly, load the exact same 11 IO buffer offsets as two-pass, have all 36 loop back-edges bounded (4096 cap / epilogue counts), and have all 84 barrier-guarding conditional branches provably group-uniform (0 divergent barrier paths).
  • That leaves two concrete suspects between native ExecuteIndirect and two-pass ExecuteIndirect:
    1. bind.rs native ExecuteIndirect wiring — calling fresh_indirect_arguments around pc(...) hammers the single global ARGUMENT_ORDER buffer (COMMON -> INDIRECT_ARGUMENT -> COMMON) thousands of times per frame on the Direct queue concurrently with Compute queues even though emit_scaled_args_rewrite_from already transitioned scaled from UNORDERED_ACCESS to INDIRECT_ARGUMENT, plus native_mesh_stage / ensure_view_heap ran before flush_two_pass.
    2. NVIDIA Blackwell GroupMemoryBarrierWithGroupSync concurrency hang (#1727 pattern) — two-pass runs those three heavy shaders with Partner::Spin (0 exchange barriers), whereas native ms_6_6 runs them with Partner::Barrier (58–96 dx.op.barrier(9) calls per group) concurrently with async compute queues.

Pushed updated head e2a4128c6 (stacked on #3327 d10821a30; holding off on 918dbd7d as requested, and wrapping commit bodies to 72 cols per @Foniass):

  • Removes the redundant fresh_indirect_arguments wrapper on native ExecuteIndirect (matching two-pass) and moves flush_two_pass before native_mesh_stage on Direct lists (crates/xcl/src/hle/d3d12x/bind.rs).
  • Verified locally on RTX 5070 Ti: .\scripts\test.ps1 3,031 passed, 0 failed, 52 ignored across 44 binaries (24 GPU SKIPPED: 22 no wave64, 2 no heap windows), plus paired 60 s smokes (default 1,695 frames / 17,231 MB, opt-in XCL_NATIVE_MESH=1 1,707 frames / 16,689 MB, 0 removals, 0 crashes).

If e2a4128c6 (+ 42bd1090) holds on the RTX 5090, suspect (1) was the cause; if it still hangs on >5 under DRED device state: 3, we will have isolated it cleanly to suspect (2) (Partner::Barrier concurrency on Blackwell ms_6_6) and can target that directly.

Assisted-by: Antigravity (Gemini 4 Neon)

<!-- greyfinch-sync:ivall/xcl:comment:7380741112 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3656#issuecomment-7380741112). Originally posted by [Kalmarv](https://github.com/Kalmarv) on 2026-12-03T14:00:36Z. --- @KDenKC Thank you for the readback — `[5, 1, 1]` with `max = 1, stride = 12` cleanly rules out bad/garbage indirect counts! We also audited all three hanging indirect pipelines from your DRED logs locally (both the packed-PS one and the two unpacked-PS ones): - All three are 128-thread Wave64 `ms_6_6` shaders with 51–77 intrinsic barriers (4–8 inside waterfall loops) and 1 MS static sampler; all three pass DXC 1.9 validation cleanly, load the exact same 11 IO buffer offsets as two-pass, have all 36 loop back-edges bounded (`4096` cap / epilogue counts), and have all 84 barrier-guarding conditional branches provably group-uniform (0 divergent barrier paths). - That leaves two concrete suspects between native `ExecuteIndirect` and two-pass `ExecuteIndirect`: 1. **`bind.rs` native `ExecuteIndirect` wiring** — calling `fresh_indirect_arguments` around `pc(...)` hammers the single global `ARGUMENT_ORDER` buffer (`COMMON -> INDIRECT_ARGUMENT -> COMMON`) thousands of times per frame on the Direct queue concurrently with Compute queues even though `emit_scaled_args_rewrite_from` already transitioned `scaled` from `UNORDERED_ACCESS` to `INDIRECT_ARGUMENT`, plus `native_mesh_stage` / `ensure_view_heap` ran before `flush_two_pass`. 2. **NVIDIA Blackwell `GroupMemoryBarrierWithGroupSync` concurrency hang (#1727 pattern)** — two-pass runs those three heavy shaders with `Partner::Spin` (0 exchange barriers), whereas native `ms_6_6` runs them with `Partner::Barrier` (58–96 `dx.op.barrier(9)` calls per group) concurrently with async compute queues. Pushed updated head `e2a4128c6` (stacked on #3327 `d10821a30`; holding off on `918dbd7d` as requested, and wrapping commit bodies to 72 cols per @Foniass): - Removes the redundant `fresh_indirect_arguments` wrapper on native `ExecuteIndirect` (matching two-pass) and moves `flush_two_pass` before `native_mesh_stage` on Direct lists (`crates/xcl/src/hle/d3d12x/bind.rs`). - Verified locally on RTX 5070 Ti: `.\scripts\test.ps1` **3,031 passed, 0 failed, 52 ignored** across 44 binaries (24 GPU `SKIPPED`: 22 `no wave64`, 2 `no heap windows`), plus paired 60 s smokes (default `1,695` frames / `17,231 MB`, opt-in `XCL_NATIVE_MESH=1` `1,707` frames / `16,689 MB`, 0 removals, 0 crashes). If `e2a4128c6` (+ `42bd1090`) holds on the RTX 5090, suspect (1) was the cause; if it still hangs on `>5` under `DRED device state: 3`, we will have isolated it cleanly to suspect (2) (`Partner::Barrier` concurrency on Blackwell `ms_6_6`) and can target that directly. *Assisted-by: Antigravity (Gemini 4 Neon)*
KDenKC commented 2026-12-03 14:40:38 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by KDenKC on 2026-12-03T14:40:38Z.


@Kalmarv thanks for both suspects. Results on the RTX 5090, the retail title, native mesh on with native ExecuteIndirect:

Suspect 1 (no fresh_indirect_arguments wrap + flush_two_pass before native_mesh_stage), as two switches in our tree on top of your a44f86d3 stack, both logged on: the device is still lost, at world+101 s, the same way as before:

[192.50] DRED device state: 3
[192.50] DRED page fault at GPU VA 0x0 = window 11 + 0x0; allocations there: []; recently freed: []
[192.50] DRED: list 0xd5aa5ac30 on queue 0xbdc8cf0: 103 of 1097 operations done, around: 7 15 26 >5 15 15; pipeline bound there: a graphics pipeline 0xb61628b70 (shaders 0d75c92fa0dc8c6b)

Your exact tree (e2a4128c6 + 42bd1090, nothing else) hangs the same way, at world+94 s:

[187.76] DRED device state: 3
[187.76] DRED page fault at GPU VA 0x0 = window 10 + 0x0; allocations there: []; recently freed: []
[187.76] DRED: list 0x19d9b3ee0 on queue 0x18c4f1050: 29 of 781 operations done, around: 6 15 0 >5 15 0; pipeline bound there: a graphics pipeline 0xc56056720 (shaders 0d75c92fa0dc8c6b)

Suspect 2 (group barriers hanging while async compute runs) doesn't fit what DRED shows: at every removal, every list on the other two queues is at 0 of N operations done, around: >46 …, and op 46 is Begin. Nothing on another queue was executing when the native draw hung:

0xf9575e70 on queue 0x7c481140: 0 of 64 operations done, around: >46 0 15
0xf74f78a0 on queue 0x7c481140: 0 of 1600 operations done, around: >46 0 0
0xf74f48d0 on queue 0xbdc9170: 0 of 1903 operations done, around: >46 0 0

What all runs share: the same native program (0d75c92f), alone on the GPU, in flight with a small group count. A local readback of the rewritten arguments just before each native ExecuteIndirect shows 5 or 9 groups on the call in flight, with all six root UAVs valid. Sending only that pipeline down two-pass moves the hang to another native ExecuteIndirect pipeline; with native ExecuteIndirect off and direct DispatchMesh native, the world holds. DRED's state is 3 (hung), and the VA 0 label may be NVIDIA's "unknown".

So it looks like the native program itself stops on real data. Could you look at how the native translation places group barriers in 0d75c92f (and the indirect programs generally): a barrier that only some waves reach, or one inside lane-divergent control flow, would hang exactly like this, and only when the data takes that path.

Your loyal testing minion stands by for the next head.

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:7381844429 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3656#issuecomment-7381844429). Originally posted by [KDenKC](https://github.com/KDenKC) on 2026-12-03T14:40:38Z. --- @Kalmarv thanks for both suspects. Results on the RTX 5090, the retail title, native mesh on with native `ExecuteIndirect`: **Suspect 1 (no `fresh_indirect_arguments` wrap + `flush_two_pass` before `native_mesh_stage`)**, as two switches in our tree on top of your `a44f86d3` stack, both logged on: the device is still lost, at world+101 s, the same way as before: ``` [192.50] DRED device state: 3 [192.50] DRED page fault at GPU VA 0x0 = window 11 + 0x0; allocations there: []; recently freed: [] [192.50] DRED: list 0xd5aa5ac30 on queue 0xbdc8cf0: 103 of 1097 operations done, around: 7 15 26 >5 15 15; pipeline bound there: a graphics pipeline 0xb61628b70 (shaders 0d75c92fa0dc8c6b) ``` Your exact tree (`e2a4128c6` + `42bd1090`, nothing else) hangs the same way, at world+94 s: ``` [187.76] DRED device state: 3 [187.76] DRED page fault at GPU VA 0x0 = window 10 + 0x0; allocations there: []; recently freed: [] [187.76] DRED: list 0x19d9b3ee0 on queue 0x18c4f1050: 29 of 781 operations done, around: 6 15 0 >5 15 0; pipeline bound there: a graphics pipeline 0xc56056720 (shaders 0d75c92fa0dc8c6b) ``` **Suspect 2 (group barriers hanging while async compute runs)** doesn't fit what DRED shows: at every removal, every list on the other two queues is at `0 of N operations done, around: >46 …`, and op 46 is `Begin`. Nothing on another queue was executing when the native draw hung: ``` 0xf9575e70 on queue 0x7c481140: 0 of 64 operations done, around: >46 0 15 0xf74f78a0 on queue 0x7c481140: 0 of 1600 operations done, around: >46 0 0 0xf74f48d0 on queue 0xbdc9170: 0 of 1903 operations done, around: >46 0 0 ``` **What all runs share:** the same native program (`0d75c92f`), alone on the GPU, in flight with a small group count. A local readback of the rewritten arguments just before each native `ExecuteIndirect` shows 5 or 9 groups on the call in flight, with all six root UAVs valid. Sending only that pipeline down two-pass moves the hang to another native `ExecuteIndirect` pipeline; with native `ExecuteIndirect` off and direct `DispatchMesh` native, the world holds. DRED's state is 3 (hung), and the VA 0 label may be NVIDIA's "unknown". So it looks like the native program itself stops on real data. Could you look at how the native translation places group barriers in `0d75c92f` (and the indirect programs generally): a barrier that only some waves reach, or one inside lane-divergent control flow, would hang exactly like this, and only when the data takes that path. Your loyal testing minion stands by for the next head. AI use: an agent swarm: Claude Opus 5.5, Claude Sonnet 5.5, GPT-6.2-Sol, Gemini 4 Neon and Gemini 4 Hydrogen.
KDenKC commented 2026-12-03 15:06:49 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by KDenKC on 2026-12-03T15:06:49Z.


@Kalmarv a correction to my hold on 918dbd7d: it was wrong, fix 2 isn't what darkens the notes. Comparing more runs with the gamma raised shows the same defect with fix 2 reverted. In all 4 runs with native mesh on (direct DispatchMesh native, native ExecuteIndirect off, with and without fix 2), dark foreground geometry covers part of the paper notes: a horizontal band across them, one note fully hidden, and stretched grey ribbons outside the window in 3 of the 4. None of the 10 two-pass runs of the same scene has any of it. And a static check of all 560 recorded (ms, ps) mesh pairs from our runs finds 0 where fix 2's rule changes anything (the PS's mask equals the MS's on every matched semantic), so it can't be the cause here.

So for native mesh as it stands on our side there are two separate things: the ExecuteIndirect hang above, and some direct DispatchMesh draws (it looks like skinned foreground geometry) coming out with wrong positions or occlusion. Fix 2 is yours to take or leave on its own merits. We're narrowing down which mesh program draws the dark shapes and will report it.

Your loyal testing minion, owning the misread.

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:7382583982 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3656#issuecomment-7382583982). Originally posted by [KDenKC](https://github.com/KDenKC) on 2026-12-03T15:06:49Z. --- @Kalmarv a correction to my hold on `918dbd7d`: it was wrong, fix 2 isn't what darkens the notes. Comparing more runs with the gamma raised shows the same defect with fix 2 reverted. In all 4 runs with native mesh on (direct `DispatchMesh` native, native `ExecuteIndirect` off, with and without fix 2), dark foreground geometry covers part of the paper notes: a horizontal band across them, one note fully hidden, and stretched grey ribbons outside the window in 3 of the 4. None of the 10 two-pass runs of the same scene has any of it. And a static check of all 560 recorded (ms, ps) mesh pairs from our runs finds 0 where fix 2's rule changes anything (the PS's mask equals the MS's on every matched semantic), so it can't be the cause here. So for native mesh as it stands on our side there are two separate things: the `ExecuteIndirect` hang above, and some direct `DispatchMesh` draws (it looks like skinned foreground geometry) coming out with wrong positions or occlusion. Fix 2 is yours to take or leave on its own merits. We're narrowing down which mesh program draws the dark shapes and will report it. Your loyal testing minion, owning the misread. AI use: an agent swarm: Claude Opus 5.5, Claude Sonnet 5.5, GPT-6.2-Sol, Gemini 4 Neon and Gemini 4 Hydrogen.
Kalmarv commented 2026-12-03 15:07:01 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Kalmarv on 2026-12-03T15:07:01Z.


@KDenKC Huge thanks for testing e2a4128c6 and catching that the other queues are all at >46 (Begin) — ruling out both bind.rs and multi-queue contention narrows this dramatically.

Following your suggestion, we ran three independent formal verifiers directly on the final post-optimize() DXIL IR of all three hanging indirect pipelines (the packed-PS one and both unpacked-PS ones):

  1. Exact forward symbolic taint analysis (tracking group-uniform vs half-divergent vs lane-divergent values and control dependence across all PHIs and branch regions): 0 dx.op.barrier(9) calls sit in half-divergent or lane-divergent control flow across all 58 / 62 / 96 barriers in the three shaders, and 0 @xcl_xs stores hold lane-tainted values. On the smallest of the three (which also uses the unpacked PS, identical PS DXIL to two-pass), there are 0 lane-divergent wave ops anywhere in the entire shader and only 2 agree_cond sites (both or(Any) on S_CBRANCH_EXECNZ).
  2. Independent per-barrier reachability cross-check (without relying on ipdom): every conditional branch that can skip or repeat any barrier is covered by the audited uniform set (affecting - guard == [] on all three).
  3. Full CFG cycle / DAG check + interface diff vs two-pass: removing edges into bounded headers (4096 loop caps, wave_i < 2, record zeroing, nv/np epilogue loops) leaves a 100% DAG on all three (0 nested loops, 0 unbounded or irreducible cycles); all ResourceProperties, shader flags, and 11 IO offsets match two-pass identically; all 55 / 59 / 93 @xcl_xs store–barrier–load exchanges pair cleanly.

Since every barrier in the emitted DXIL is provably uniform, every loop is bounded, and 5–9 groups still hang alone on the GPU with valid root UAVs, this points directly at how the Blackwell ms_6_6 compiler/hardware executes our [numthreads(64, 1, 1)] virtual-warp shader (specifically 55–93 dx.op.barrier(9) calls, including 4–8 barriers inside waterfall loops alongside CreateHandleFromHeap(..., nonUniformIndex=true)).

Two sharp local splits on the RTX 5090 would pin down the exact trigger in 1–2 runs before we change the PR:

  1. Barrier-vs-non-barrier split: on one of the hanging pipelines (or globally for native ExecuteIndirect), temporarily route plan.stats.intrinsic_loop_barriers > 0 (and if needed needs_barrier) to two-pass — and check whether any of the direct DispatchMesh pipelines that held for 309 s even had intrinsic_loop_barriers > 0 or needs_barrier == true.
  2. Proof-of-barrier trigger: if you have a quick local switch on the primary hanging pipeline to emit a tiny bounded spin (e.g. Partner::Spin with a low cap) instead of Partner::Barrier (just checking hang vs no-hang, ignoring picture): if that stops the hang, dx.op.barrier(9) in ms_6_6 is proven as the trigger; if it still hangs, dx.op.barrier(9) is innocent and the culprit is non-barrier ms_6_6 lowering (alloca, nonUniformIndex, atomicrmw lane init, or epilogue).

Holding the PR branch steady at e2a4128c6 while we isolate which side fires — and also checking locally if we can construct a minimal synthetic ms_6_6 repro on our RTX 5070 Ti.

Assisted-by: Antigravity (Gemini 4 Neon)

<!-- greyfinch-sync:ivall/xcl:comment:7382589682 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3656#issuecomment-7382589682). Originally posted by [Kalmarv](https://github.com/Kalmarv) on 2026-12-03T15:07:01Z. --- @KDenKC Huge thanks for testing `e2a4128c6` and catching that the other queues are all at `>46` (`Begin`) — ruling out both `bind.rs` and multi-queue contention narrows this dramatically. Following your suggestion, we ran three independent formal verifiers directly on the final post-`optimize()` DXIL IR of all three hanging indirect pipelines (the packed-PS one and both unpacked-PS ones): 1. **Exact forward symbolic taint analysis** (tracking group-uniform vs half-divergent vs lane-divergent values and control dependence across all PHIs and branch regions): **0** `dx.op.barrier(9)` calls sit in half-divergent or lane-divergent control flow across all 58 / 62 / 96 barriers in the three shaders, and **0** `@xcl_xs` stores hold lane-tainted values. On the smallest of the three (which also uses the unpacked PS, identical PS DXIL to two-pass), there are **0** lane-divergent wave ops anywhere in the entire shader and only 2 `agree_cond` sites (both `or(Any)` on `S_CBRANCH_EXECNZ`). 2. **Independent per-barrier reachability cross-check** (without relying on `ipdom`): every conditional branch that can skip or repeat any barrier is covered by the audited uniform set (`affecting - guard == []` on all three). 3. **Full CFG cycle / DAG check + interface diff vs two-pass**: removing edges into bounded headers (`4096` loop caps, `wave_i < 2`, `record` zeroing, `nv`/`np` epilogue loops) leaves a 100% DAG on all three (0 nested loops, 0 unbounded or irreducible cycles); all `ResourceProperties`, shader flags, and 11 IO offsets match two-pass identically; all 55 / 59 / 93 `@xcl_xs` store–barrier–load exchanges pair cleanly. Since every barrier in the emitted DXIL is provably uniform, every loop is bounded, and 5–9 groups still hang alone on the GPU with valid root UAVs, this points directly at how the Blackwell `ms_6_6` compiler/hardware executes our `[numthreads(64, 1, 1)]` virtual-warp shader (specifically 55–93 `dx.op.barrier(9)` calls, including 4–8 barriers inside waterfall loops alongside `CreateHandleFromHeap(..., nonUniformIndex=true)`). Two sharp local splits on the RTX 5090 would pin down the exact trigger in 1–2 runs before we change the PR: 1. **Barrier-vs-non-barrier split:** on one of the hanging pipelines (or globally for native `ExecuteIndirect`), temporarily route `plan.stats.intrinsic_loop_barriers > 0` (and if needed `needs_barrier`) to two-pass — and check whether any of the direct `DispatchMesh` pipelines that held for 309 s even had `intrinsic_loop_barriers > 0` or `needs_barrier == true`. 2. **Proof-of-barrier trigger:** if you have a quick local switch on the primary hanging pipeline to emit a tiny bounded spin (e.g. `Partner::Spin` with a low cap) instead of `Partner::Barrier` (just checking hang vs no-hang, ignoring picture): if that stops the hang, `dx.op.barrier(9)` in `ms_6_6` is proven as the trigger; if it still hangs, `dx.op.barrier(9)` is innocent and the culprit is non-barrier `ms_6_6` lowering (`alloca`, `nonUniformIndex`, `atomicrmw` lane init, or epilogue). Holding the PR branch steady at `e2a4128c6` while we isolate which side fires — and also checking locally if we can construct a minimal synthetic `ms_6_6` repro on our RTX 5070 Ti. *Assisted-by: Antigravity (Gemini 4 Neon)*
Kalmarv commented 2026-12-03 15:25:07 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Kalmarv on 2026-12-03T15:25:07Z.


@KDenKC Thanks for the quick correction and the careful multi-run comparison (our posts crossed by a few seconds).

Good to know 918dbd7d is cleared and affects 0 of the 560 recorded pairs. Knowing that direct DispatchMesh also shows wrong foreground positions / stretched ribbons (in 4/4 native runs, ribbons in 3/4, vs 0/10 two-pass runs) is a huge clue — especially the intermittent 3/4 behavior, which points either at a race / non-deterministic wave-order interaction (e.g. xcl_xw warp-order assignment, Partner::Barrier exchange / xcl_counts multi-wave GS_ALLOC_REQ, or CondAgree::Half0 / barrier-free Partner::Missing) or at the same Blackwell ms_6_6 virtual-warp lowering issue behind the ExecuteIndirect hang.

Once you narrow down which direct DispatchMesh shader draws the dark foreground geometry, let us know and we will audit its post-optimize() DXIL side-by-side against two-pass (and test a minimal repro on our RTX 5070 Ti). One quick sanity check if you happen to re-run that scene: e2a4128c6 moved flush_two_pass ahead of native_mesh_stage on direct DispatchMesh too, so worth noting whether the direct-draw defect is identical on e2a4128c6. Holding the PR head at e2a4128c6 until both findings land, and we can pick up 918dbd7d on its own merits once we're ready to push the fix.

Assisted-by: Antigravity (Gemini 4 Neon)

<!-- greyfinch-sync:ivall/xcl:comment:7383107269 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3656#issuecomment-7383107269). Originally posted by [Kalmarv](https://github.com/Kalmarv) on 2026-12-03T15:25:07Z. --- @KDenKC Thanks for the quick correction and the careful multi-run comparison (our posts crossed by a few seconds). Good to know `918dbd7d` is cleared and affects 0 of the 560 recorded pairs. Knowing that direct `DispatchMesh` also shows wrong foreground positions / stretched ribbons (in 4/4 native runs, ribbons in 3/4, vs 0/10 two-pass runs) is a huge clue — especially the intermittent 3/4 behavior, which points either at a race / non-deterministic wave-order interaction (e.g. `xcl_xw` warp-order assignment, `Partner::Barrier` exchange / `xcl_counts` multi-wave `GS_ALLOC_REQ`, or `CondAgree::Half0` / barrier-free `Partner::Missing`) or at the same Blackwell `ms_6_6` virtual-warp lowering issue behind the `ExecuteIndirect` hang. Once you narrow down which direct `DispatchMesh` shader draws the dark foreground geometry, let us know and we will audit its post-`optimize()` DXIL side-by-side against two-pass (and test a minimal repro on our RTX 5070 Ti). One quick sanity check if you happen to re-run that scene: `e2a4128c6` moved `flush_two_pass` ahead of `native_mesh_stage` on direct `DispatchMesh` too, so worth noting whether the direct-draw defect is identical on `e2a4128c6`. Holding the PR head at `e2a4128c6` until both findings land, and we can pick up `918dbd7d` on its own merits once we're ready to push the fix. *Assisted-by: Antigravity (Gemini 4 Neon)*
Foniass commented 2026-12-03 17:17:25 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Foniass on 2026-12-03T17:17:25Z.


merge-check
base: 16c2fd082a
head: e2a4128c61
merge: clean
build: ok
tests: 3037 passed, 0 failed, 56 ignored; 28 skipped, the same as on main
review: 1 high, 5 medium (below)
performance: 60 s smoke run: 1683 → 1676 frames (99 % of main), peak commit 18505 → 17902 MB, no device removal, no crash
title run: retail title on the RTX 5070 Ti (driver 621.14), into the world by scripted presses: 233 s there, 0 device removals, 0 crashes, 3.9 presents/s; run with XCL_SKIP_CS=95cc13288a27a96e (the NVIDIA hang at the end of loading, #3541) and NVIDIA's 2048 MB shader heap (#2590)
verdict: not yet: 1 blocking finding (critical or high, below)
hardware / tool and model: RTX 5070 Ti (driver 621.14), Ryzen 7 7800X3D, Windows 11 26300 / Claude Code with Claude Opus 5.5


In short: The PR adds a direct-DXIL Wave64 ms_6_6 mesh translator with packed PS ISG1 / MS OSG1 signatures and wires it into DispatchMesh and sliced ExecuteIndirect behind XCL_NATIVE_MESH=1. Since a44f86d3 only bind.rs changed (+35/-28): the native paths now run only on Direct lists, deferred two-pass draws are flushed before the native stages are prepared, and native ExecuteIndirect no longer goes through fresh_indirect_arguments. These changes read correctly and the two nits from my last merge-check are fixed, but the PR still carries #3327's open draft commits, which blocks merging, and the RTX 5090 native ExecuteIndirect hang is not shown fixed.

High

  1. Still carries #3327's draft commits. The bottom three commits (b9365b466, e1c7bf4ff, d10821a30) are still #3327's head d10821a30, and #3327 is still an open draft. Merging this PR would merge #3327's unreviewed draft work with it. Wait for #3327 to land and rebase, or take those commits out.

Medium

  1. Own part is still about 4,000 lines. d10821a30..e2a4128c changes 13 files (+3,883/-166), and native_mesh.rs alone is about 2,500 lines. That is far past the ~800 lines at which CONTRIBUTING.md asks why a PR cannot be split. Split it as planned once #3327 lands: the translator behind the flag with its tests, then the packed PS/MS signatures, then the runtime wiring.
  2. RTX 5090 native ExecuteIndirect hang not shown fixed. On a44f86d3 KDenKC reproduced a hang (DRED device state 3, op 5 = ExecuteIndirect) under at least three native pipelines (0d75c92f, e8d47e79, e57924ee) 14-100 s into the world. A readback showed sane rewritten arguments ([5,1,1], max 1), and runs with native ExecuteIndirect routed to two-pass held for 309 s. This push changes the native ExecuteIndirect path to chase that hang (bind.rs ~3796-3854), but no test covers the change and there is no 5090 run at e2a4128c yet. The world-entry DispatchMesh fault traced to MEM_NULL_LOAD/STORE null views is fixed by 42bd1090, now open as #3349 (5dc64ea7). That fix is not in this PR or in main a815de93, so XCL_NATIVE_MESH=1 still needs #3349. Add the 5090 result at this head (with #3349) and a visual check against two-pass.
  3. PS components outside the MS OSG1 mask read as 0. native_mesh.rs ~943-1005: alloc_stage stages only the components in the MS output's own OSG1 mask, and matched maps a PS component only if ms_mask has that bit. When the linked PS declares and reads more components (KDenKC: ms e1fbdad48510b7bc has TEXCOORD0 mask 0x3 while the PS reads .zw), the native path gives the PS 0.0, where two-pass keeps all four components. KDenKC's candidate fix 918dbd7d caused a dark band in their run and is not in this head. This affects only the opt-in path. Fix it with a test that links an MS with a narrower mask than the PS reads.
  4. No measured gain. The new smokes are still capped at 60 presents per 2 s: base 1,695, default 1,695 and opt-in 1,707 frames. KDenKC's 154 ms frame GPU span on a native DispatchMesh run has no two-pass number beside it. Add a measurement, for example gpu_profile NativeMesh / IndirectNativeMesh against two-pass in the world.
  5. Conflicts with open #3681 and #3339. git merge-tree of e2a4128c with #3681's head 61408de0 still conflicts in crates/xcl/src/hle/d3d12x/bind.rs (sliced indirect mesh scratch). With #3339's head 62d53267 it conflicts in graphics.rs (both add the name-offset tiebreaker to sig_part), lower_gfx.rs and core_tests.rs. Agree which PR lands first and rebase the other; the sig_part tiebreaker should end up in one place.
Checked and fine
  • pull/3656/head is e2a4128c. The tree differs from a44f86d3 only in crates/xcl/src/hle/d3d12x/bind.rs; 1ed29f44b has the same tree as a1c56128e, with only its message rewrapped
  • Earlier finding fixed: the description now lists the default-path bind.rs changes (nonzero_window_va in prepare_two_pass_stage, the two zeroed SCALE_ARGS_HLSL words, u5 bound to consts)
  • Earlier finding fixed: the bodies of 1ed29f44b and e2a4128c are now wrapped at about 72 columns
  • Dropping fresh_indirect_arguments around the native ExecuteIndirect (bind.rs ~3854) matches two-pass, which calls pc on the scaled buffer directly (~3935). emit_scaled_args_rewrite_from (~3314) still issues a UAV barrier before the rewrite and transitions scaled from UAV to INDIRECT_ARGUMENT before the call, which is the transition fresh_indirect_arguments relies on to make the driver wait
  • The Direct-list gate on both native DispatchMesh branches and native ExecuteIndirect (bind.rs ~3502, ~3796) sends bundles and untracked lists to two-pass. Bundles cannot hold the barriers the native ExecuteIndirect path records, and DispatchMesh cannot be recorded on compute or copy lists
  • flush_two_pass now runs before native_mesh_stage / prepare_scaled_args on all three native paths, the same order as the two-pass path. A failed native stage now falls through to two-pass after the flush, instead of the old non-linear branch returning with no draw when the list could not be borrowed
  • All new bind.rs lines are inside tp.native.get() blocks, so runs with XCL_NATIVE_MESH unset are not affected by this push
  • No assertion deleted or weakened since a44f86d3 (no test lines changed); check_unplanned_barrier still returns Err in release builds
  • e2a4128c merges into current main a815de93 without conflicts
  • The AI model named in the commits and description (Antigravity, Gemini 4 Neon) is not one of the models CONTRIBUTING.md refuses
How this was tested
  • Merged onto main 16c2fd08, then cargo build --workspace and cargo test --workspace --no-fail-fast -- --test-threads=4.
  • The skipped GPU tests are those this card can't run (no wave64 on NVIDIA, no D3D12 debug layer, and similar).
  • scripts/smoke.ps1: 60 s of a retail title on main 16c2fd08 and on this merge; presents per 2 s at the end: 60 60 60.
  • Title run: the release build of this merge launched the retail title with XCL_RUN_SECONDS=300 and scripted A presses counted from the first frame (XCL_PRESS_BASE=frame, #3712) into the world from an existing save; time in the world is counted from the first in-world draw call to the end of the run.

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

<!-- greyfinch-sync:ivall/xcl:comment:7386271172 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3656#issuecomment-7386271172). Originally posted by [Foniass](https://github.com/Foniass) on 2026-12-03T17:17:25Z. --- merge-check base: 16c2fd082ae2e96967a2ab553bc2e1032e491f70 head: e2a4128c6166d61a3f256cc0952bb5af51ecac90 merge: clean build: ok tests: 3037 passed, 0 failed, 56 ignored; 28 skipped, the same as on main review: 1 high, 5 medium (below) performance: 60 s smoke run: 1683 → 1676 frames (99 % of main), peak commit 18505 → 17902 MB, no device removal, no crash title run: retail title on the RTX 5070 Ti (driver 621.14), into the world by scripted presses: 233 s there, 0 device removals, 0 crashes, 3.9 presents/s; run with `XCL_SKIP_CS=95cc13288a27a96e` (the NVIDIA hang at the end of loading, #3541) and NVIDIA's 2048 MB shader heap (#2590) verdict: not yet: 1 blocking finding (critical or high, below) hardware / tool and model: RTX 5070 Ti (driver 621.14), Ryzen 7 7800X3D, Windows 11 26300 / Claude Code with Claude Opus 5.5 --- **In short:** The PR adds a direct-DXIL Wave64 ms_6_6 mesh translator with packed PS ISG1 / MS OSG1 signatures and wires it into DispatchMesh and sliced ExecuteIndirect behind XCL_NATIVE_MESH=1. Since a44f86d3 only bind.rs changed (+35/-28): the native paths now run only on Direct lists, deferred two-pass draws are flushed before the native stages are prepared, and native ExecuteIndirect no longer goes through fresh_indirect_arguments. These changes read correctly and the two nits from my last merge-check are fixed, but the PR still carries #3327's open draft commits, which blocks merging, and the RTX 5090 native ExecuteIndirect hang is not shown fixed. #### High 1. **Still carries #3327's draft commits.** The bottom three commits (b9365b466, e1c7bf4ff, d10821a30) are still #3327's head d10821a30, and #3327 is still an open draft. Merging this PR would merge #3327's unreviewed draft work with it. Wait for #3327 to land and rebase, or take those commits out. #### Medium 2. **Own part is still about 4,000 lines.** d10821a30..e2a4128c changes 13 files (+3,883/-166), and native_mesh.rs alone is about 2,500 lines. That is far past the ~800 lines at which CONTRIBUTING.md asks why a PR cannot be split. Split it as planned once #3327 lands: the translator behind the flag with its tests, then the packed PS/MS signatures, then the runtime wiring. 3. **RTX 5090 native ExecuteIndirect hang not shown fixed.** On a44f86d3 KDenKC reproduced a hang (DRED device state 3, op 5 = ExecuteIndirect) under at least three native pipelines (0d75c92f, e8d47e79, e57924ee) 14-100 s into the world. A readback showed sane rewritten arguments ([5,1,1], max 1), and runs with native ExecuteIndirect routed to two-pass held for 309 s. This push changes the native ExecuteIndirect path to chase that hang (bind.rs ~3796-3854), but no test covers the change and there is no 5090 run at e2a4128c yet. The world-entry DispatchMesh fault traced to MEM_NULL_LOAD/STORE null views is fixed by 42bd1090, now open as #3349 (5dc64ea7). That fix is not in this PR or in main a815de93, so XCL_NATIVE_MESH=1 still needs #3349. Add the 5090 result at this head (with #3349) and a visual check against two-pass. 4. **PS components outside the MS OSG1 mask read as 0.** native_mesh.rs ~943-1005: alloc_stage stages only the components in the MS output's own OSG1 mask, and matched maps a PS component only if ms_mask has that bit. When the linked PS declares and reads more components (KDenKC: ms e1fbdad48510b7bc has TEXCOORD0 mask 0x3 while the PS reads .zw), the native path gives the PS 0.0, where two-pass keeps all four components. KDenKC's candidate fix 918dbd7d caused a dark band in their run and is not in this head. This affects only the opt-in path. Fix it with a test that links an MS with a narrower mask than the PS reads. 5. **No measured gain.** The new smokes are still capped at 60 presents per 2 s: base 1,695, default 1,695 and opt-in 1,707 frames. KDenKC's 154 ms frame GPU span on a native DispatchMesh run has no two-pass number beside it. Add a measurement, for example gpu_profile NativeMesh / IndirectNativeMesh against two-pass in the world. 6. **Conflicts with open #3681 and #3339.** git merge-tree of e2a4128c with #3681's head 61408de0 still conflicts in crates/xcl/src/hle/d3d12x/bind.rs (sliced indirect mesh scratch). With #3339's head 62d53267 it conflicts in graphics.rs (both add the name-offset tiebreaker to sig_part), lower_gfx.rs and core_tests.rs. Agree which PR lands first and rebase the other; the sig_part tiebreaker should end up in one place. <details><summary>Checked and fine</summary> - pull/3656/head is e2a4128c. The tree differs from a44f86d3 only in crates/xcl/src/hle/d3d12x/bind.rs; 1ed29f44b has the same tree as a1c56128e, with only its message rewrapped - Earlier finding fixed: the description now lists the default-path bind.rs changes (nonzero_window_va in prepare_two_pass_stage, the two zeroed SCALE_ARGS_HLSL words, u5 bound to consts) - Earlier finding fixed: the bodies of 1ed29f44b and e2a4128c are now wrapped at about 72 columns - Dropping fresh_indirect_arguments around the native ExecuteIndirect (bind.rs ~3854) matches two-pass, which calls pc on the scaled buffer directly (~3935). emit_scaled_args_rewrite_from (~3314) still issues a UAV barrier before the rewrite and transitions scaled from UAV to INDIRECT_ARGUMENT before the call, which is the transition fresh_indirect_arguments relies on to make the driver wait - The Direct-list gate on both native DispatchMesh branches and native ExecuteIndirect (bind.rs ~3502, ~3796) sends bundles and untracked lists to two-pass. Bundles cannot hold the barriers the native ExecuteIndirect path records, and DispatchMesh cannot be recorded on compute or copy lists - flush_two_pass now runs before native_mesh_stage / prepare_scaled_args on all three native paths, the same order as the two-pass path. A failed native stage now falls through to two-pass after the flush, instead of the old non-linear branch returning with no draw when the list could not be borrowed - All new bind.rs lines are inside tp.native.get() blocks, so runs with XCL_NATIVE_MESH unset are not affected by this push - No assertion deleted or weakened since a44f86d3 (no test lines changed); check_unplanned_barrier still returns Err in release builds - e2a4128c merges into current main a815de93 without conflicts - The AI model named in the commits and description (Antigravity, Gemini 4 Neon) is not one of the models CONTRIBUTING.md refuses </details> <details><summary>How this was tested</summary> - Merged onto main `16c2fd08`, then `cargo build --workspace` and `cargo test --workspace --no-fail-fast -- --test-threads=4`. - The skipped GPU tests are those this card can't run (no wave64 on NVIDIA, no D3D12 debug layer, and similar). - `scripts/smoke.ps1`: 60 s of a retail title on main `16c2fd08` and on this merge; presents per 2 s at the end: 60 60 60. - Title run: the release build of this merge launched the retail title with `XCL_RUN_SECONDS=300` and scripted A presses counted from the first frame (`XCL_PRESS_BASE=frame`, #3712) into the world from an existing save; time in the world is counted from the first in-world draw call to the end of the run. </details> <sub>Written by Claude Code (Claude Opus 5.5) and posted by Foniass without a human check of each point.</sub>
Kalmarv commented 2026-12-03 17:28:05 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Kalmarv on 2026-12-03T17:28:05Z.


@Foniass Thanks for the thorough merge-check on e2a4128c6 (and the 233 s in-world default-path check on RTX 5070 Ti). Every point tracks cleanly with our current state:

  1. #1 (#3327 draft stack), #2 (PR size/split), #6 (#3681 / #3339 conflicts): Agreed — keeping #3327 underneath while #3327 is still an open draft. Once #3327 lands (and as #3349 / #3681 / #3339 land), we will rebase onto main and split into stacked PRs (translator + tests → packed signatures → runtime wiring).
  2. #3 (RTX 5090 native ExecuteIndirect hang + direct DispatchMesh visual check): Confirmed — @KDenKC already tested e2a4128c6 (+ #3349) above (#issuecomment-7381844429, hang still present with other queues idle) and separately reported a direct DispatchMesh foreground geometry/ribbons regression (#issuecomment-7382583982). Holding the branch at e2a4128c6 while those two bisects finish so our next push lands the real fix + tests rather than churn.
  3. #4 (OSG1 mask pruning): @KDenKC cleared 918dbd7d in #issuecomment-7382583982; we will include the PS-mask component preservation fix + regression test on the next push.
  4. #5 (measured gain vs two-pass): Noted — once both the ExecuteIndirect hang and the direct DispatchMesh geometry defect are fixed, we will add an uncapped in-world gpu_profile (NativeMesh / IndirectNativeMesh vs two-pass) comparison alongside the visual check.

Assisted-by: Antigravity (Gemini 4 Neon)

<!-- greyfinch-sync:ivall/xcl:comment:7386557291 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3656#issuecomment-7386557291). Originally posted by [Kalmarv](https://github.com/Kalmarv) on 2026-12-03T17:28:05Z. --- @Foniass Thanks for the thorough `merge-check` on `e2a4128c6` (and the 233 s in-world default-path check on RTX 5070 Ti). Every point tracks cleanly with our current state: 1. **#1 (`#3327` draft stack), #2 (PR size/split), #6 (`#3681` / `#3339` conflicts):** Agreed — keeping `#3327` underneath while `#3327` is still an open draft. Once `#3327` lands (and as `#3349` / `#3681` / `#3339` land), we will rebase onto `main` and split into stacked PRs (translator + tests → packed signatures → runtime wiring). 2. **#3 (RTX 5090 native `ExecuteIndirect` hang + direct `DispatchMesh` visual check):** Confirmed — @KDenKC already tested `e2a4128c6` (+ `#3349`) above (`#issuecomment-7381844429`, hang still present with other queues idle) and separately reported a direct `DispatchMesh` foreground geometry/ribbons regression (`#issuecomment-7382583982`). Holding the branch at `e2a4128c6` while those two bisects finish so our next push lands the real fix + tests rather than churn. 3. **#4 (`OSG1` mask pruning):** @KDenKC cleared `918dbd7d` in `#issuecomment-7382583982`; we will include the PS-mask component preservation fix + regression test on the next push. 4. **#5 (measured gain vs two-pass):** Noted — once both the `ExecuteIndirect` hang and the direct `DispatchMesh` geometry defect are fixed, we will add an uncapped in-world `gpu_profile` (`NativeMesh` / `IndirectNativeMesh` vs two-pass) comparison alongside the visual check. *Assisted-by: Antigravity (Gemini 4 Neon)*
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/3656:upstream-pr/3656'
git switch 'upstream-pr/3656'

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/3656'
git switch 'upstream-pr/3656'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/3656'
git switch 'upstream-pr/3656'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/3656'
git switch 'main'
git merge --squash 'upstream-pr/3656'
git switch 'main'
git merge --ff-only 'upstream-pr/3656'
git switch 'main'
git merge 'upstream-pr/3656'
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!3656
No description provided.