startup: translate slot 57 mesh requests without a pixel stage (Part of #2413) #2512

Merged
Leyukaka merged 4 commits from upstream-pr/2520 into main 2026-11-25 20:21:10 +00:00
Leyukaka commented 2026-11-25 19:36:39 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by Leyukaka on 2026-11-25T19:36:39Z.


Part of #2413, item T5, the no-pixel-stage half (claim). The null-export depth-only pixel stage is not touched and stays refused.

A slot 57 request whose req_<key>.ps57 is empty was refused in translate_mesh57 with slot 57 mesh without a pixel stage is not covered. It now translates when the mesh stage has the accepted shape:

  • Pipeline takes ps_code=None, skips the pixel stage and its linkage checks, and keeps the position-export check.
  • MeshPipeline.hlsl_ms removes the parameter write statements when there is no pixel stage, as it already does for unread fparam/hparam fields. The rest of each export line is kept, including its exec guard and mesh_vertex = true. VSOut then holds only SV_Position. Position and primitive exports are unchanged.
  • translate_mesh57 emits and compiles only the mesh stage (<key>.ms57.hlsl, <key>.ms57.cso, published from the staging directory as before). <key>.ms57.txt is still written last.
  • The manifest gets a new ps none line after params. A pair with a pixel stage writes exactly the same manifest as before.
  • pending_keys treats a published result whose manifest has ps none as done with .ms57.cso alone, so it is not retranslated on every pass. A pair still needs both .ms57.cso and .ps57.cso.

Tests (Windows 11, Python 3.14, DXC from the Windows SDK 10.0.26100), at this branch's head

  • python -B tests/startup_mesh57_skeleton_check.py: ok. It checks:
    • the mesh-only files, with no .ps57.* output;
    • the ps none manifest line, and the unchanged pair manifest;
    • a VSOut with only SV_Position;
    • no o.param writes, and the position and index writes still present;
    • as many mesh_vertex = true marks as the paired shader;
    • three pending_keys cases: a mesh-only result is done, a mesh-only result without .ms57.cso is pending, a pair without .ps57.cso is still pending;
    • the depth-only refusal is unchanged.
  • startup_mesh57_skeleton_check.py draw <dxc> offscreen_check warp and ... hardware: ok. DXC compiles the mesh-only stage, and the existing paired draw matches (1024 pixels, 0 mismatches, on WARP and an RTX 5080).
  • tests/startup_gfx2hlsl_watch_check.py: ok. Its synthetic no-pixel mesh now reaches the shape check, and expects the same refusal as the synthetic paired mesh.
  • startup_translator_check, startup_compute_translate_check, startup_gfx2hlsl_refusals_check, startup_gfx2hlsl_capture_check, startup_stream_interface_check, startup_flat_param_check, startup_gfx2hlsl_waitcnt_depctr_check and startup_compute_request_offline_check: ok.

Mutation checks, run by hand. The non-draw check fails on each:

  • pending_keys ignoring ps none;
  • parameter writes kept;
  • the whole export line dropped instead of only its parameter writes (it loses a mesh_vertex mark);
  • the ps none line not written;
  • the old refusal restored.

Measured on a local capture (counts only). Before this change, 108 slot 57 requests without a pixel stage were refused at this gate. With it, none of the 108 translates yet. Their next first refusals are:

  • slot 57 mesh: a branch outside the group-memory exchanges is not covered: 95;
  • s_cselect_b64 on a wave mask: 9;
  • shape-check refusals in the exchanges: 4.

So this removes the gate; the branch support is the next step for these programs. No runtime path loads .ms57 results yet, as before.

AI-assisted.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6612217201 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2520). Originally posted by [Leyukaka](https://github.com/Leyukaka) on 2026-11-25T19:36:39Z. --- Part of #2413, item T5, the no-pixel-stage half ([claim](https://github.com/R0Y00/Xbox2Windows/issues/2413#issuecomment-7172349679)). The null-export depth-only pixel stage is not touched and stays refused. A slot 57 request whose `req_<key>.ps57` is empty was refused in `translate_mesh57` with `slot 57 mesh without a pixel stage is not covered`. It now translates when the mesh stage has the accepted shape: - `Pipeline` takes `ps_code=None`, skips the pixel stage and its linkage checks, and keeps the position-export check. - `MeshPipeline.hlsl_ms` removes the parameter write statements when there is no pixel stage, as it already does for unread `fparam`/`hparam` fields. The rest of each export line is kept, including its exec guard and `mesh_vertex = true`. `VSOut` then holds only `SV_Position`. Position and primitive exports are unchanged. - `translate_mesh57` emits and compiles only the mesh stage (`<key>.ms57.hlsl`, `<key>.ms57.cso`, published from the staging directory as before). `<key>.ms57.txt` is still written last. - The manifest gets a new `ps none` line after `params`. A pair with a pixel stage writes exactly the same manifest as before. - `pending_keys` treats a published result whose manifest has `ps none` as done with `.ms57.cso` alone, so it is not retranslated on every pass. A pair still needs both `.ms57.cso` and `.ps57.cso`. **Tests** (Windows 11, Python 3.14, DXC from the Windows SDK 10.0.26100), at this branch's head - `python -B tests/startup_mesh57_skeleton_check.py`: ok. It checks: - the mesh-only files, with no `.ps57.*` output; - the `ps none` manifest line, and the unchanged pair manifest; - a `VSOut` with only `SV_Position`; - no `o.param` writes, and the position and index writes still present; - as many `mesh_vertex = true` marks as the paired shader; - three `pending_keys` cases: a mesh-only result is done, a mesh-only result without `.ms57.cso` is pending, a pair without `.ps57.cso` is still pending; - the depth-only refusal is unchanged. - `startup_mesh57_skeleton_check.py draw <dxc> offscreen_check warp` and `... hardware`: ok. DXC compiles the mesh-only stage, and the existing paired draw matches (1024 pixels, 0 mismatches, on WARP and an RTX 5080). - `tests/startup_gfx2hlsl_watch_check.py`: ok. Its synthetic no-pixel mesh now reaches the shape check, and expects the same refusal as the synthetic paired mesh. - `startup_translator_check`, `startup_compute_translate_check`, `startup_gfx2hlsl_refusals_check`, `startup_gfx2hlsl_capture_check`, `startup_stream_interface_check`, `startup_flat_param_check`, `startup_gfx2hlsl_waitcnt_depctr_check` and `startup_compute_request_offline_check`: ok. **Mutation checks**, run by hand. The non-draw check fails on each: - `pending_keys` ignoring `ps none`; - parameter writes kept; - the whole export line dropped instead of only its parameter writes (it loses a `mesh_vertex` mark); - the `ps none` line not written; - the old refusal restored. **Measured on a local capture** (counts only). Before this change, 108 slot 57 requests without a pixel stage were refused at this gate. With it, none of the 108 translates yet. Their next first refusals are: - `slot 57 mesh: a branch outside the group-memory exchanges is not covered`: 95; - `s_cselect_b64 on a wave mask`: 9; - shape-check refusals in the exchanges: 4. So this removes the gate; the branch support is the next step for these programs. No runtime path loads `.ms57` results yet, as before. AI-assisted.
tedin7 commented 2026-11-25 20:04:37 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T19:42:34Z.

Review: COMMENTED


Review of head b4e0fec3 (comment only).

Result: sound. No blocking findings.

What I checked

  • tools/startup/gfx2hlsl.py: Pipeline with ps_code=None keeps the position-export check and skips pixel linkage. MeshPipeline.hlsl_ms drops only the o.paramN writes, so the exec guard and mesh_vertex = true stay. translate_mesh57 compiles only the mesh stage. The ps none manifest line is written only for the no-pixel case, so paired manifests are unchanged.
  • pending_keys: a ps none result with .ms57.cso is done. A pair without .ps57.cso is still pending.
  • The depth-only (null export) refusal is untouched.
  • No other open or merged PR covers this slice. #2427 lowers param exports and pixel linkage, a different part.
  • Scope: this removes a gate only. The body says no runtime path loads .ms57 yet and that the 108 captured requests still stop at later refusals. I make no claim about game startup. Executable results were not checked here.

Commands run locally (Linux, worktree at this head)

  • python3 -B tests/startup_mesh57_skeleton_check.py: ok
  • python3 -B tests/startup_gfx2hlsl_watch_check.py: passed
  • python3 -B tests/startup_translator_check.py: 0 failed
  • python3 -B tests/startup_gfx2hlsl_refusals_check.py: ok
  • python3 tests/docs_links_check.py: ok
  • python3 tests/bidi_controls_check.py: ok
  • git diff --check origin/main...HEAD: clean
  • Mutations, each makes startup_mesh57_skeleton_check.py fail: pending_keys ignoring ps none; parameter writes kept; ps none manifest line changed.

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6063902948 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2520#pullrequestreview-6063902948). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-25T19:42:34Z. **Review:** COMMENTED --- Review of head b4e0fec3 (comment only). Result: sound. No blocking findings. What I checked - `tools/startup/gfx2hlsl.py`: `Pipeline` with `ps_code=None` keeps the position-export check and skips pixel linkage. `MeshPipeline.hlsl_ms` drops only the `o.paramN` writes, so the exec guard and `mesh_vertex = true` stay. `translate_mesh57` compiles only the mesh stage. The `ps none` manifest line is written only for the no-pixel case, so paired manifests are unchanged. - `pending_keys`: a `ps none` result with `.ms57.cso` is done. A pair without `.ps57.cso` is still pending. - The depth-only (null export) refusal is untouched. - No other open or merged PR covers this slice. #2427 lowers param exports and pixel linkage, a different part. - Scope: this removes a gate only. The body says no runtime path loads `.ms57` yet and that the 108 captured requests still stop at later refusals. I make no claim about game startup. Executable results were not checked here. Commands run locally (Linux, worktree at this head) - `python3 -B tests/startup_mesh57_skeleton_check.py`: ok - `python3 -B tests/startup_gfx2hlsl_watch_check.py`: passed - `python3 -B tests/startup_translator_check.py`: 0 failed - `python3 -B tests/startup_gfx2hlsl_refusals_check.py`: ok - `python3 tests/docs_links_check.py`: ok - `python3 tests/bidi_controls_check.py`: ok - `git diff --check origin/main...HEAD`: clean - Mutations, each makes `startup_mesh57_skeleton_check.py` fail: `pending_keys` ignoring `ps none`; parameter writes kept; `ps none` manifest line changed. AI-assisted; commands listed were executed locally.
tedin7 commented 2026-11-25 20:04:47 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T19:49:02Z.


Win2025 WARP receipt for head 781f004f after updating with main.

Verified on Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP) at commit 781f004fb41ff19f8dae51048e9a83f2cae6db80:

  • Debug (--preset dev):
    • Build (cmake --build --preset dev --target d3d12_xs_device_obj d3d12_xs_shim -- -j 2): 36.14s (configure 2.39s)
  • Release /O2 (--preset release):
    • Build (cmake --build --preset release --target d3d12_xs_device_obj d3d12_xs_shim -- -j 2): 57.71s (configure 2.49s)
  • Windows Python checks: tests/mesh_heap_sampler_check.py ok (0.8s), tests/startup_buffer_address_check.py ok (0.5s), tests/startup_compute_request_offline_check.py ok (0.5s), tests/startup_compute_translate_check.py ok (0.3s), tests/startup_flat_param_check.py ok (0.1s), tests/startup_gfx2hlsl_add_sub_co_check.py ok (0.1s), tests/startup_gfx2hlsl_add_sub_co_ci_check.py ok (0.2s), tests/startup_gfx2hlsl_bit_alu_check.py ok (0.8s), tests/startup_gfx2hlsl_capture_check.py ok (1.1s), tests/startup_gfx2hlsl_cmp16_check.py ok (0.3s), tests/startup_gfx2hlsl_compare_dst_check.py ok (0.1s), tests/startup_gfx2hlsl_compute_check.py ok (0.4s), tests/startup_gfx2hlsl_cselect_mask_check.py ok (0.1s), tests/startup_gfx2hlsl_cvt_alu_check.py ok (0.1s), tests/startup_gfx2hlsl_f32_lg_check.py ok (1.3s), tests/startup_gfx2hlsl_f32_nan_check.py ok (5.2s), tests/startup_gfx2hlsl_getpc_refusal_check.py ok (0.1s), tests/startup_gfx2hlsl_handler_arity_check.py ok (0.2s), tests/startup_gfx2hlsl_image_arity_check.py ok (0.2s), tests/startup_gfx2hlsl_image_get_lod_check.py ok (0.2s), tests/startup_gfx2hlsl_int_med3_check.py ok (0.2s), tests/startup_gfx2hlsl_join_symbols_check.py ok (0.3s), tests/startup_gfx2hlsl_loop_constants_check.py ok (0.2s), tests/startup_gfx2hlsl_mask_overwrite_check.py ok (0.2s), tests/startup_gfx2hlsl_operand_count_check.py ok (0.7s), tests/startup_gfx2hlsl_pack_absdiff_check.py ok (3.9s), tests/startup_gfx2hlsl_readfirstlane_recompute_check.py ok (0.1s), tests/startup_gfx2hlsl_readfirstlane_uniform_check.py ok (0.1s), tests/startup_gfx2hlsl_refusals_check.py ok (0.6s), tests/startup_gfx2hlsl_root_check.py ok (0.9s), tests/startup_gfx2hlsl_sad_check.py ok (0.4s), tests/startup_gfx2hlsl_saveexec_same_reg_check.py ok (0.1s), tests/startup_gfx2hlsl_scalar_arity_check.py ok (0.3s), tests/startup_gfx2hlsl_scalar_brev_fold_check.py ok (0.1s), tests/startup_gfx2hlsl_scalar_m0_check.py ok (0.1s), tests/startup_gfx2hlsl_sdwa_cvt_check.py ok (0.3s), tests/startup_gfx2hlsl_sgpr_spill_check.py ok (0.1s), tests/startup_gfx2hlsl_shift64_check.py ok (0.2s), tests/startup_gfx2hlsl_smem_offset_check.py ok (0.1s), tests/startup_gfx2hlsl_sop2_complement_check.py ok (6.7s), tests/startup_gfx2hlsl_sopk_accum_check.py ok (0.9s), tests/startup_gfx2hlsl_sopk_signext_check.py ok (0.1s), tests/startup_gfx2hlsl_swap_check.py ok (0.3s), tests/startup_gfx2hlsl_vopc_sdwa_check.py ok (5.0s), tests/startup_gfx2hlsl_waitcnt_depctr_check.py ok (0.1s), tests/startup_gfx2hlsl_watch_check.py ok (2.5s), tests/startup_image_2d_array_check.py ok (0.2s), tests/startup_image_3d_check.py ok (0.1s), tests/startup_image_gather_lz_check.py ok (0.9s), tests/startup_image_load_d16_check.py ok (1.1s), tests/startup_image_sample_a16_check.py ok (0.2s), tests/startup_image_sample_b_check.py ok (0.2s), tests/startup_image_sample_c_check.py ok (0.2s), tests/startup_image_sample_l_check.py ok (0.2s), tests/startup_image_sample_lod_check.py ok (0.6s), tests/startup_inline_sampler_check.py ok (0.2s), tests/startup_mesh57_skeleton_check.py ok (0.2s), tests/startup_run_ps1_check.py ok (11.0s), tests/startup_run_sh_check.py skipped (POSIX launcher, exit 77; 0.1s), tests/startup_sampler_heap_check.py ok (0.1s), tests/startup_smem_address_check.py ok (0.1s), tests/startup_stream_fetch_check.py ok (0.2s), tests/startup_stream_interface_check.py ok (0.2s), tests/startup_translator_check.py ok (0.5s)
  • sccache: -205/-207 hits; wall 163.3s

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7172802569 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2520#issuecomment-7172802569). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-25T19:49:02Z. --- Win2025 WARP receipt for head 781f004f after updating with main. Verified on Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP) at commit `781f004fb41ff19f8dae51048e9a83f2cae6db80`: - **Debug (`--preset dev`)**: - Build (`cmake --build --preset dev --target d3d12_xs_device_obj d3d12_xs_shim -- -j 2`): `36.14s` (configure `2.39s`) - **Release `/O2` (`--preset release`)**: - Build (`cmake --build --preset release --target d3d12_xs_device_obj d3d12_xs_shim -- -j 2`): `57.71s` (configure `2.49s`) - **Windows Python checks**: `tests/mesh_heap_sampler_check.py` ok (`0.8s`), `tests/startup_buffer_address_check.py` ok (`0.5s`), `tests/startup_compute_request_offline_check.py` ok (`0.5s`), `tests/startup_compute_translate_check.py` ok (`0.3s`), `tests/startup_flat_param_check.py` ok (`0.1s`), `tests/startup_gfx2hlsl_add_sub_co_check.py` ok (`0.1s`), `tests/startup_gfx2hlsl_add_sub_co_ci_check.py` ok (`0.2s`), `tests/startup_gfx2hlsl_bit_alu_check.py` ok (`0.8s`), `tests/startup_gfx2hlsl_capture_check.py` ok (`1.1s`), `tests/startup_gfx2hlsl_cmp16_check.py` ok (`0.3s`), `tests/startup_gfx2hlsl_compare_dst_check.py` ok (`0.1s`), `tests/startup_gfx2hlsl_compute_check.py` ok (`0.4s`), `tests/startup_gfx2hlsl_cselect_mask_check.py` ok (`0.1s`), `tests/startup_gfx2hlsl_cvt_alu_check.py` ok (`0.1s`), `tests/startup_gfx2hlsl_f32_lg_check.py` ok (`1.3s`), `tests/startup_gfx2hlsl_f32_nan_check.py` ok (`5.2s`), `tests/startup_gfx2hlsl_getpc_refusal_check.py` ok (`0.1s`), `tests/startup_gfx2hlsl_handler_arity_check.py` ok (`0.2s`), `tests/startup_gfx2hlsl_image_arity_check.py` ok (`0.2s`), `tests/startup_gfx2hlsl_image_get_lod_check.py` ok (`0.2s`), `tests/startup_gfx2hlsl_int_med3_check.py` ok (`0.2s`), `tests/startup_gfx2hlsl_join_symbols_check.py` ok (`0.3s`), `tests/startup_gfx2hlsl_loop_constants_check.py` ok (`0.2s`), `tests/startup_gfx2hlsl_mask_overwrite_check.py` ok (`0.2s`), `tests/startup_gfx2hlsl_operand_count_check.py` ok (`0.7s`), `tests/startup_gfx2hlsl_pack_absdiff_check.py` ok (`3.9s`), `tests/startup_gfx2hlsl_readfirstlane_recompute_check.py` ok (`0.1s`), `tests/startup_gfx2hlsl_readfirstlane_uniform_check.py` ok (`0.1s`), `tests/startup_gfx2hlsl_refusals_check.py` ok (`0.6s`), `tests/startup_gfx2hlsl_root_check.py` ok (`0.9s`), `tests/startup_gfx2hlsl_sad_check.py` ok (`0.4s`), `tests/startup_gfx2hlsl_saveexec_same_reg_check.py` ok (`0.1s`), `tests/startup_gfx2hlsl_scalar_arity_check.py` ok (`0.3s`), `tests/startup_gfx2hlsl_scalar_brev_fold_check.py` ok (`0.1s`), `tests/startup_gfx2hlsl_scalar_m0_check.py` ok (`0.1s`), `tests/startup_gfx2hlsl_sdwa_cvt_check.py` ok (`0.3s`), `tests/startup_gfx2hlsl_sgpr_spill_check.py` ok (`0.1s`), `tests/startup_gfx2hlsl_shift64_check.py` ok (`0.2s`), `tests/startup_gfx2hlsl_smem_offset_check.py` ok (`0.1s`), `tests/startup_gfx2hlsl_sop2_complement_check.py` ok (`6.7s`), `tests/startup_gfx2hlsl_sopk_accum_check.py` ok (`0.9s`), `tests/startup_gfx2hlsl_sopk_signext_check.py` ok (`0.1s`), `tests/startup_gfx2hlsl_swap_check.py` ok (`0.3s`), `tests/startup_gfx2hlsl_vopc_sdwa_check.py` ok (`5.0s`), `tests/startup_gfx2hlsl_waitcnt_depctr_check.py` ok (`0.1s`), `tests/startup_gfx2hlsl_watch_check.py` ok (`2.5s`), `tests/startup_image_2d_array_check.py` ok (`0.2s`), `tests/startup_image_3d_check.py` ok (`0.1s`), `tests/startup_image_gather_lz_check.py` ok (`0.9s`), `tests/startup_image_load_d16_check.py` ok (`1.1s`), `tests/startup_image_sample_a16_check.py` ok (`0.2s`), `tests/startup_image_sample_b_check.py` ok (`0.2s`), `tests/startup_image_sample_c_check.py` ok (`0.2s`), `tests/startup_image_sample_l_check.py` ok (`0.2s`), `tests/startup_image_sample_lod_check.py` ok (`0.6s`), `tests/startup_inline_sampler_check.py` ok (`0.2s`), `tests/startup_mesh57_skeleton_check.py` ok (`0.2s`), `tests/startup_run_ps1_check.py` ok (`11.0s`), `tests/startup_run_sh_check.py` skipped (POSIX launcher, exit 77; `0.1s`), `tests/startup_sampler_heap_check.py` ok (`0.1s`), `tests/startup_smem_address_check.py` ok (`0.1s`), `tests/startup_stream_fetch_check.py` ok (`0.2s`), `tests/startup_stream_interface_check.py` ok (`0.2s`), `tests/startup_translator_check.py` ok (`0.5s`) - `sccache`: -205/-207 hits; wall `163.3s` AI-assisted; commands listed were executed locally.
upstream-sync closed this pull request 2026-11-25 21:01:14 +00:00
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
R0Y00/Xbox2Windows!2512
No description provided.