startup: keep a descriptor loaded in an execz arm for reads before the exec restore in gfx2hlsl #2705

Merged
tedin7 merged 5 commits from upstream-pr/2713 into main 2026-11-26 06:51:33 +00:00
tedin7 commented 2026-11-26 03:13:18 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-26T03:13:18Z.


Part of #1723

What this unblocks: a pixel shader whose s_cbranch_execz skips an s_load of a descriptor and reads that descriptor at the join, before the exec restore, now translates instead of being refused as "joined at a branch target".

What changed

tools/startup/gfx2hlsl.py: at a join that only s_cbranch_execz edges skip to (plus the fall-through arm), a descriptor word written by the fall-through arm is kept (exec_keep, rule R1) until exec is written again, a branch or another join is reached, or a scalar instruction reads it. exec_zero_keepable decides it: the register holds a descriptor symbol on the fall-through path, no other edge into the target writes it, and no instruction between the first skipping branch and the target writes exec.

Why it is correct

On every taken s_cbranch_execz edge exec is 0 (RDNA 2 ISA, EXECZ condition). The lanes that skipped the arm therefore do nothing until exec is written again, and the lanes that ran the arm hold the arm's descriptor. A vector memory read at the join that runs before the exec restore only has the arm's lanes active, so reading the arm's descriptor is exact for them.

What stays refused

A read after the exec restore (a lane that skipped the arm is active again and would read a descriptor it never loaded): EXEC_DESC_AFTER is still refused with holds ('joined at a branch target',). Any join with another writer of the register, a path where exec is written between the branch and the join, and every non-descriptor value keep the existing behaviour.

Tests

tests/startup_gfx2hlsl_join_symbols_check.py: two source-built wave64 fixtures, EXEC_DESC_MASKED (the image load at the join runs before the restore: translates, the load reads the arm's descriptor) and EXEC_DESC_AFTER (the load runs after the restore: refused). binary mode assembles both with llvm-mc (-mattr=+wavefrontsize64) to the recorded words. On origin/main the check fails on EXEC_DESC_MASKED (descriptor operand s[16:23] holds ('joined at a branch target',)); with the change it passes.

Verification

  • python3 tests/startup_gfx2hlsl_join_symbols_check.py: PASS (fails on origin/main)
  • python3 tests/startup_gfx2hlsl_join_symbols_check.py binary llvm-mc-19: PASS
  • All 240 tests/startup_*check.py run with no arguments on this branch and on origin/main (aa16aae1a): the same result for every script (all exit 0).
  • Win2025 (Windows Server 2025, MSVC 14.44.35207, D3D12 WARP) on head 9533a351fb2b40451cb4ec5492774d0fac3e710f, copy-paste commands:
    cmake --build --preset dev --target d3d12_xs_device_obj d3d12_xs_shim startup_buffer_format_word3_check
    ctest --preset dev --no-tests=error -R 'startup_gfx2hlsl_join_symbols' --output-on-failure
    cmake --build --preset release --target d3d12_xs_device_obj d3d12_xs_shim startup_buffer_format_word3_check
    ctest --preset release --no-tests=error -R 'startup_gfx2hlsl_join_symbols' --output-on-failure
    
    Result: dev 5/5 passed, release 5/5 passed.
  • Independent Stage-2 review, Linux: the merge of this branch with current main gives the same exit code as main for all 241 tests/startup_*check.py run with no arguments (64 of them exit nonzero on both because they need arguments or a renderer). startup_gfx2hlsl_join_symbols_check.py binary llvm-mc-19 passes. Twelve variants of the two fixtures (assembled with llvm-mc, wave64) were translated: masked reads before the restore translate; a read after the restore, before and after the restore, two joins before the read, a scalar overwrite of a descriptor word, a scalar read of the descriptor at the join are refused. Three mutations (rule off, window never closed, exec write not closing it) each fail EXEC_DESC_MASKED or EXEC_DESC_AFTER.

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6618688298 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2713). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-26T03:13:18Z. --- Part of #1723 What this unblocks: a pixel shader whose `s_cbranch_execz` skips an `s_load` of a descriptor and reads that descriptor at the join, before the exec restore, now translates instead of being refused as "joined at a branch target". ## What changed `tools/startup/gfx2hlsl.py`: at a join that only `s_cbranch_execz` edges skip to (plus the fall-through arm), a descriptor word written by the fall-through arm is kept (`exec_keep`, rule R1) until exec is written again, a branch or another join is reached, or a scalar instruction reads it. `exec_zero_keepable` decides it: the register holds a descriptor symbol on the fall-through path, no other edge into the target writes it, and no instruction between the first skipping branch and the target writes exec. ## Why it is correct On every taken `s_cbranch_execz` edge exec is 0 (RDNA 2 ISA, EXECZ condition). The lanes that skipped the arm therefore do nothing until exec is written again, and the lanes that ran the arm hold the arm's descriptor. A vector memory read at the join that runs before the exec restore only has the arm's lanes active, so reading the arm's descriptor is exact for them. ## What stays refused A read after the exec restore (a lane that skipped the arm is active again and would read a descriptor it never loaded): `EXEC_DESC_AFTER` is still refused with `holds ('joined at a branch target',)`. Any join with another writer of the register, a path where exec is written between the branch and the join, and every non-descriptor value keep the existing behaviour. ## Tests `tests/startup_gfx2hlsl_join_symbols_check.py`: two source-built wave64 fixtures, `EXEC_DESC_MASKED` (the image load at the join runs before the restore: translates, the load reads the arm's descriptor) and `EXEC_DESC_AFTER` (the load runs after the restore: refused). `binary` mode assembles both with `llvm-mc` (`-mattr=+wavefrontsize64`) to the recorded words. On `origin/main` the check fails on `EXEC_DESC_MASKED` (`descriptor operand s[16:23] holds ('joined at a branch target',)`); with the change it passes. ## Verification - `python3 tests/startup_gfx2hlsl_join_symbols_check.py`: PASS (fails on `origin/main`) - `python3 tests/startup_gfx2hlsl_join_symbols_check.py binary llvm-mc-19`: PASS - All 240 `tests/startup_*check.py` run with no arguments on this branch and on `origin/main` (aa16aae1a): the same result for every script (all exit 0). - Win2025 (Windows Server 2025, MSVC 14.44.35207, D3D12 WARP) on head `9533a351fb2b40451cb4ec5492774d0fac3e710f`, copy-paste commands: ``` cmake --build --preset dev --target d3d12_xs_device_obj d3d12_xs_shim startup_buffer_format_word3_check ctest --preset dev --no-tests=error -R 'startup_gfx2hlsl_join_symbols' --output-on-failure cmake --build --preset release --target d3d12_xs_device_obj d3d12_xs_shim startup_buffer_format_word3_check ctest --preset release --no-tests=error -R 'startup_gfx2hlsl_join_symbols' --output-on-failure ``` Result: dev 5/5 passed, release 5/5 passed. - Independent Stage-2 review, Linux: the merge of this branch with current `main` gives the same exit code as `main` for all 241 `tests/startup_*check.py` run with no arguments (64 of them exit nonzero on both because they need arguments or a renderer). `startup_gfx2hlsl_join_symbols_check.py binary llvm-mc-19` passes. Twelve variants of the two fixtures (assembled with `llvm-mc`, wave64) were translated: masked reads before the restore translate; a read after the restore, before and after the restore, two joins before the read, a scalar overwrite of a descriptor word, a scalar read of the descriptor at the join are refused. Three mutations (rule off, window never closed, exec write not closing it) each fail `EXEC_DESC_MASKED` or `EXEC_DESC_AFTER`. AI-assisted; commands listed were executed locally.
chatgpt-codex-connector[bot commented 2026-11-26 04:04:30 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-26T03:41:25Z.

Review: COMMENTED


💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9533a351fb

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6068244095 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2713#pullrequestreview-6068244095). Originally posted by [chatgpt-codex-connector[bot]](https://github.com/chatgpt-codex-connector%5Bbot%5D) on 2026-11-26T03:41:25Z. **Review:** COMMENTED --- <!-- codex-review-receipt:v1 --> ### 💡 Codex Review Here are some automated review suggestions for this pull request. **Reviewed commit:** `9533a351fb` <details> <summary>ℹ️ About Codex in GitHub</summary> <br/> [Your team has set up Codex to review pull requests in this repo](https://chatgpt.com/codex/cloud/settings/general). Reviews are triggered when you - Open a pull request for review - Mark a draft as ready - Comment "@codex review". If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". </details>
tedin7 commented 2026-11-26 04:04:30 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-26T04:00:35Z.

Review: COMMENTED


No description provided.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6068369120 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2713#pullrequestreview-6068369120). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-26T04:00:35Z. **Review:** COMMENTED --- _No description provided._
tedin7 commented 2026-11-26 04:04:30 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-26T04:00:39Z.

Review: COMMENTED


No description provided.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6068369569 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2713#pullrequestreview-6068369569). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-26T04:00:39Z. **Review:** COMMENTED --- _No description provided._
tedin7 commented 2026-11-26 04:04:38 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-26T03:28:06Z.


@MasterDomino this is ready for review at head 9533a351.

Independent gate review plus Windows run, one round, no change requested. What was checked:

  • startup_gfx2hlsl_join_symbols_check.py and its binary mode pass; the merge with current main gives the same exit code as main for all 241 startup_*check.py scripts;
  • twelve variants of the two fixtures: masked reads before the exec restore translate; a read after the restore, a read before and after the restore, two joins before the read, a scalar overwrite of a descriptor word and a scalar read of the descriptor at the join are refused;
  • three mutations of the new code each fail EXEC_DESC_MASKED or EXEC_DESC_AFTER;
  • Windows: ctest -R startup_gfx2hlsl_join_symbols 5/5 on dev and 5/5 on release, commands and results are in the PR body.

One gap worth knowing: this PR's own test is translation-only, so no check in the repo draws the masked-read program on a GPU. A readback outside the repo (16 x 16 pixels on WARP, the descriptor read before the restore and the skipped-arm case) matched the CPU reference, and its two wrong-value controls failed as they should, so the rule itself holds; a follow-up could move that draw into startup_gfx2hlsl_join_symbols_check.py dispatch.

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7181744982 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2713#issuecomment-7181744982). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-26T03:28:06Z. --- @MasterDomino this is ready for review at head `9533a351`. Independent gate review plus Windows run, one round, no change requested. What was checked: - `startup_gfx2hlsl_join_symbols_check.py` and its `binary` mode pass; the merge with current `main` gives the same exit code as `main` for all 241 `startup_*check.py` scripts; - twelve variants of the two fixtures: masked reads before the exec restore translate; a read after the restore, a read before and after the restore, two joins before the read, a scalar overwrite of a descriptor word and a scalar read of the descriptor at the join are refused; - three mutations of the new code each fail `EXEC_DESC_MASKED` or `EXEC_DESC_AFTER`; - Windows: `ctest -R startup_gfx2hlsl_join_symbols` 5/5 on `dev` and 5/5 on `release`, commands and results are in the PR body. One gap worth knowing: this PR's own test is translation-only, so no check in the repo draws the masked-read program on a GPU. A readback outside the repo (16 x 16 pixels on WARP, the descriptor read before the restore and the skipped-arm case) matched the CPU reference, and its two wrong-value controls failed as they should, so the rule itself holds; a follow-up could move that draw into `startup_gfx2hlsl_join_symbols_check.py dispatch`. AI-assisted; commands listed were executed locally.
chatgpt-codex-connector[bot commented 2026-11-26 04:04:40 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-26T03:28:05Z.


Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-26T03:41:28.427313Z 9533a35 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7181744814 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2713#issuecomment-7181744814). Originally posted by [chatgpt-codex-connector[bot]](https://github.com/chatgpt-codex-connector%5Bbot%5D) on 2026-11-26T03:28:05Z. --- <!-- codex-pull-request-review-summary --> <!-- codex-review-state:v1 {"code_review":{"commit_sha":"9533a351fb2b40451cb4ec5492774d0fac3e710f","has_any_findings":true,"has_unresolved_findings":true,"status":"completed"},"security_review":{"commit_sha":null,"has_any_findings":null,"has_unresolved_findings":null,"status":null}} --> <details> <summary><strong>Codex Review Summary</strong>: ✅ Completed</summary> This comment shows the latest Codex review activity on this pull request. | Review | Status | Commit | Review trigger | | --- | --- | --- | --- | | 📝 **Code Review** | ✅ **Completed** <relative-time datetime="2026-11-26T03:41:28.427313Z">2026-11-26T03:41:28.427313Z</relative-time> | `9533a35` | Draft marked ready | <details> <summary>ℹ️ About Codex in GitHub</summary> <br/> [Your team has set up Codex to review pull requests in this repo](https://chatgpt.com/codex/cloud/settings/general). Reviews are triggered when you - Open a pull request for review - Mark a draft as ready - Comment "@codex review" or "@codex security review". Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. </details> </details>
tedin7 commented 2026-11-26 04:04:43 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-26T04:04:27Z.


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

  • Debug (--preset dev):
    • Build (cmake --build --preset dev --target d3d12_xs_device_obj d3d12_xs_shim startup_buffer_format_word3_check -- -j 2): 2.28s (configure 2.98s)
  • Release /O2 (--preset release):
    • Build (cmake --build --preset release --target d3d12_xs_device_obj d3d12_xs_shim startup_buffer_format_word3_check -- -j 2): 2.40s (configure 3.38s)
  • Windows Python checks: tests/mesh_heap_sampler_check.py ok (1.1s), tests/startup_buffer_address_check.py ok (0.8s), tests/startup_buffer_format_word3_table_check.py ok (0.1s), tests/startup_compute_request_offline_check.py ok (0.8s), tests/startup_compute_store_format_xyzw_check.py ok (0.3s), tests/startup_compute_translate_check.py ok (0.3s), tests/startup_flat_param_check.py ok (0.2s), 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 (1.2s), tests/startup_gfx2hlsl_capture_check.py ok (1.4s), tests/startup_gfx2hlsl_cmp16_check.py ok (0.6s), tests/startup_gfx2hlsl_cmp_class_f16_sdwa_check.py ok (49.5s), tests/startup_gfx2hlsl_compare_dst_check.py ok (0.2s), tests/startup_gfx2hlsl_compute_check.py ok (0.6s), tests/startup_gfx2hlsl_cselect_mask_check.py ok (0.2s), tests/startup_gfx2hlsl_cvt_alu_check.py ok (0.3s), tests/startup_gfx2hlsl_cvt_off_f32_i4_check.py ok (0.4s), tests/startup_gfx2hlsl_cvt_pk_int16_check.py ok (0.6s), tests/startup_gfx2hlsl_f32_lg_check.py ok (2.2s), tests/startup_gfx2hlsl_f32_nan_check.py ok (9.4s), tests/startup_gfx2hlsl_fma_mix_check.py ok (0.2s), tests/startup_gfx2hlsl_getpc_refusal_check.py ok (0.2s), tests/startup_gfx2hlsl_handler_arity_check.py ok (0.2s), tests/startup_gfx2hlsl_heap_record_check.py ok (0.4s), tests/startup_gfx2hlsl_image_arity_check.py ok (0.2s), tests/startup_gfx2hlsl_image_get_lod_check.py ok (0.3s), tests/startup_gfx2hlsl_int_med3_check.py ok (0.2s), tests/startup_gfx2hlsl_interp_p2_hi_check.py ok (0.4s), tests/startup_gfx2hlsl_join_symbols_check.py ok (0.4s), tests/startup_gfx2hlsl_loop_constants_check.py ok (0.2s), tests/startup_gfx2hlsl_mask_data_check.py ok (0.1s), tests/startup_gfx2hlsl_mask_overwrite_check.py ok (0.2s), tests/startup_gfx2hlsl_operand_count_check.py ok (0.6s), tests/startup_gfx2hlsl_pack_absdiff_check.py ok (5.0s), tests/startup_gfx2hlsl_pack_b32_f16_check.py ok (0.3s), tests/startup_gfx2hlsl_readfirstlane_recompute_check.py ok (0.2s), tests/startup_gfx2hlsl_readfirstlane_uniform_check.py ok (0.2s), tests/startup_gfx2hlsl_refusals_check.py ok (1.0s), tests/startup_gfx2hlsl_root_check.py ok (1.1s), tests/startup_gfx2hlsl_s_abs_check.py ok (0.2s), tests/startup_gfx2hlsl_s_bitset_check.py ok (0.2s), tests/startup_gfx2hlsl_s_ff0_check.py ok (0.2s), tests/startup_gfx2hlsl_s_ff1_check.py ok (0.2s), tests/startup_gfx2hlsl_s_flbit_check.py ok (0.2s), tests/startup_gfx2hlsl_s_quadmask_check.py ok (0.2s), tests/startup_gfx2hlsl_sad_check.py ok (0.5s), 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.3s), tests/startup_gfx2hlsl_scalar_m0_check.py ok (0.3s), tests/startup_gfx2hlsl_scalar_null_check.py ok (0.3s), tests/startup_gfx2hlsl_scalar_table_arity_check.py ok (0.5s), tests/startup_gfx2hlsl_sdwa_cndmask_check.py ok (0.3s), tests/startup_gfx2hlsl_sdwa_cvt_check.py ok (0.5s), tests/startup_gfx2hlsl_sgpr_spill_check.py ok (0.3s), tests/startup_gfx2hlsl_shift64_check.py ok (0.3s), tests/startup_gfx2hlsl_sload_const_offset_check.py ok (0.1s), tests/startup_gfx2hlsl_smem_offset_check.py ok (0.1s), tests/startup_gfx2hlsl_sop2_complement_check.py ok (9.5s), tests/startup_gfx2hlsl_sopk_accum_check.py ok (1.8s), tests/startup_gfx2hlsl_sopk_signext_check.py ok (0.2s), tests/startup_gfx2hlsl_spill_branches_check.py ok (1.4s), tests/startup_gfx2hlsl_swap_check.py ok (0.5s), tests/startup_gfx2hlsl_vopc_sdwa_check.py ok (7.4s), tests/startup_gfx2hlsl_waitcnt_depctr_check.py ok (0.1s), tests/startup_gfx2hlsl_watch_check.py ok (2.9s), tests/startup_image_2d_array_check.py ok (0.2s), tests/startup_image_3d_check.py ok (0.2s), tests/startup_image_gather_lz_check.py ok (0.8s), tests/startup_image_load_d16_check.py ok (1.3s), tests/startup_image_sample_a16_check.py ok (0.2s), tests/startup_image_sample_b_check.py ok (0.3s), tests/startup_image_sample_c_check.py ok (0.3s), tests/startup_image_sample_l_check.py ok (0.2s), tests/startup_image_sample_lod_check.py ok (1.0s), tests/startup_inline_sampler_check.py ok (0.3s), tests/startup_mesh57_depth_only_check.py ok (0.4s), tests/startup_mesh57_lane_spill_check.py ok (0.4s), tests/startup_mesh57_loop_check.py ok (0.3s), tests/startup_mesh57_loop_refusal_check.py ok (0.3s), tests/startup_mesh57_skeleton_check.py ok (1.8s), tests/startup_run_ps1_check.py ok (20.4s), tests/startup_run_sh_check.py skipped (0.1s), tests/startup_sampler_heap_check.py ok (0.3s), tests/startup_shader_cache_rekey_check.py ok (3.4s), tests/startup_smem_address_check.py ok (0.2s), tests/startup_stream_fetch_check.py ok (0.4s), tests/startup_stream_interface_check.py ok (0.4s), tests/startup_translator_check.py ok (0.7s)
  • sccache: 93/311 hits; wall 171.8s

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7182270375 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2713#issuecomment-7182270375). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-26T04:04:27Z. --- Verified on Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP) at commit `6b8961fb74755aa1edd5486536c75a10d8625c65`: - **Debug (`--preset dev`)**: - Build (`cmake --build --preset dev --target d3d12_xs_device_obj d3d12_xs_shim startup_buffer_format_word3_check -- -j 2`): `2.28s` (configure `2.98s`) - **Release `/O2` (`--preset release`)**: - Build (`cmake --build --preset release --target d3d12_xs_device_obj d3d12_xs_shim startup_buffer_format_word3_check -- -j 2`): `2.40s` (configure `3.38s`) - **Windows Python checks**: `tests/mesh_heap_sampler_check.py` ok (`1.1s`), `tests/startup_buffer_address_check.py` ok (`0.8s`), `tests/startup_buffer_format_word3_table_check.py` ok (`0.1s`), `tests/startup_compute_request_offline_check.py` ok (`0.8s`), `tests/startup_compute_store_format_xyzw_check.py` ok (`0.3s`), `tests/startup_compute_translate_check.py` ok (`0.3s`), `tests/startup_flat_param_check.py` ok (`0.2s`), `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 (`1.2s`), `tests/startup_gfx2hlsl_capture_check.py` ok (`1.4s`), `tests/startup_gfx2hlsl_cmp16_check.py` ok (`0.6s`), `tests/startup_gfx2hlsl_cmp_class_f16_sdwa_check.py` ok (`49.5s`), `tests/startup_gfx2hlsl_compare_dst_check.py` ok (`0.2s`), `tests/startup_gfx2hlsl_compute_check.py` ok (`0.6s`), `tests/startup_gfx2hlsl_cselect_mask_check.py` ok (`0.2s`), `tests/startup_gfx2hlsl_cvt_alu_check.py` ok (`0.3s`), `tests/startup_gfx2hlsl_cvt_off_f32_i4_check.py` ok (`0.4s`), `tests/startup_gfx2hlsl_cvt_pk_int16_check.py` ok (`0.6s`), `tests/startup_gfx2hlsl_f32_lg_check.py` ok (`2.2s`), `tests/startup_gfx2hlsl_f32_nan_check.py` ok (`9.4s`), `tests/startup_gfx2hlsl_fma_mix_check.py` ok (`0.2s`), `tests/startup_gfx2hlsl_getpc_refusal_check.py` ok (`0.2s`), `tests/startup_gfx2hlsl_handler_arity_check.py` ok (`0.2s`), `tests/startup_gfx2hlsl_heap_record_check.py` ok (`0.4s`), `tests/startup_gfx2hlsl_image_arity_check.py` ok (`0.2s`), `tests/startup_gfx2hlsl_image_get_lod_check.py` ok (`0.3s`), `tests/startup_gfx2hlsl_int_med3_check.py` ok (`0.2s`), `tests/startup_gfx2hlsl_interp_p2_hi_check.py` ok (`0.4s`), `tests/startup_gfx2hlsl_join_symbols_check.py` ok (`0.4s`), `tests/startup_gfx2hlsl_loop_constants_check.py` ok (`0.2s`), `tests/startup_gfx2hlsl_mask_data_check.py` ok (`0.1s`), `tests/startup_gfx2hlsl_mask_overwrite_check.py` ok (`0.2s`), `tests/startup_gfx2hlsl_operand_count_check.py` ok (`0.6s`), `tests/startup_gfx2hlsl_pack_absdiff_check.py` ok (`5.0s`), `tests/startup_gfx2hlsl_pack_b32_f16_check.py` ok (`0.3s`), `tests/startup_gfx2hlsl_readfirstlane_recompute_check.py` ok (`0.2s`), `tests/startup_gfx2hlsl_readfirstlane_uniform_check.py` ok (`0.2s`), `tests/startup_gfx2hlsl_refusals_check.py` ok (`1.0s`), `tests/startup_gfx2hlsl_root_check.py` ok (`1.1s`), `tests/startup_gfx2hlsl_s_abs_check.py` ok (`0.2s`), `tests/startup_gfx2hlsl_s_bitset_check.py` ok (`0.2s`), `tests/startup_gfx2hlsl_s_ff0_check.py` ok (`0.2s`), `tests/startup_gfx2hlsl_s_ff1_check.py` ok (`0.2s`), `tests/startup_gfx2hlsl_s_flbit_check.py` ok (`0.2s`), `tests/startup_gfx2hlsl_s_quadmask_check.py` ok (`0.2s`), `tests/startup_gfx2hlsl_sad_check.py` ok (`0.5s`), `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.3s`), `tests/startup_gfx2hlsl_scalar_m0_check.py` ok (`0.3s`), `tests/startup_gfx2hlsl_scalar_null_check.py` ok (`0.3s`), `tests/startup_gfx2hlsl_scalar_table_arity_check.py` ok (`0.5s`), `tests/startup_gfx2hlsl_sdwa_cndmask_check.py` ok (`0.3s`), `tests/startup_gfx2hlsl_sdwa_cvt_check.py` ok (`0.5s`), `tests/startup_gfx2hlsl_sgpr_spill_check.py` ok (`0.3s`), `tests/startup_gfx2hlsl_shift64_check.py` ok (`0.3s`), `tests/startup_gfx2hlsl_sload_const_offset_check.py` ok (`0.1s`), `tests/startup_gfx2hlsl_smem_offset_check.py` ok (`0.1s`), `tests/startup_gfx2hlsl_sop2_complement_check.py` ok (`9.5s`), `tests/startup_gfx2hlsl_sopk_accum_check.py` ok (`1.8s`), `tests/startup_gfx2hlsl_sopk_signext_check.py` ok (`0.2s`), `tests/startup_gfx2hlsl_spill_branches_check.py` ok (`1.4s`), `tests/startup_gfx2hlsl_swap_check.py` ok (`0.5s`), `tests/startup_gfx2hlsl_vopc_sdwa_check.py` ok (`7.4s`), `tests/startup_gfx2hlsl_waitcnt_depctr_check.py` ok (`0.1s`), `tests/startup_gfx2hlsl_watch_check.py` ok (`2.9s`), `tests/startup_image_2d_array_check.py` ok (`0.2s`), `tests/startup_image_3d_check.py` ok (`0.2s`), `tests/startup_image_gather_lz_check.py` ok (`0.8s`), `tests/startup_image_load_d16_check.py` ok (`1.3s`), `tests/startup_image_sample_a16_check.py` ok (`0.2s`), `tests/startup_image_sample_b_check.py` ok (`0.3s`), `tests/startup_image_sample_c_check.py` ok (`0.3s`), `tests/startup_image_sample_l_check.py` ok (`0.2s`), `tests/startup_image_sample_lod_check.py` ok (`1.0s`), `tests/startup_inline_sampler_check.py` ok (`0.3s`), `tests/startup_mesh57_depth_only_check.py` ok (`0.4s`), `tests/startup_mesh57_lane_spill_check.py` ok (`0.4s`), `tests/startup_mesh57_loop_check.py` ok (`0.3s`), `tests/startup_mesh57_loop_refusal_check.py` ok (`0.3s`), `tests/startup_mesh57_skeleton_check.py` ok (`1.8s`), `tests/startup_run_ps1_check.py` ok (`20.4s`), `tests/startup_run_sh_check.py` skipped (`0.1s`), `tests/startup_sampler_heap_check.py` ok (`0.3s`), `tests/startup_shader_cache_rekey_check.py` ok (`3.4s`), `tests/startup_smem_address_check.py` ok (`0.2s`), `tests/startup_stream_fetch_check.py` ok (`0.4s`), `tests/startup_stream_interface_check.py` ok (`0.4s`), `tests/startup_translator_check.py` ok (`0.7s`) - `sccache`: 93/311 hits; wall `171.8s` AI-assisted; commands listed were executed locally.
chatgpt-codex-connector[bot commented 2026-11-26 04:04:44 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-26T03:41:25Z.

Code review location: tools/startup/gfx2hlsl.py; line 3020

@@ -3013,8 +3013,11 @@ def translate(self):
             falls = True
             start = 0
             raised_unsupported = None
+            self.exec_keep = {}  # registers whose body-arm descriptor symbol is kept after an execz join (rule R1)
 
             for instruction_index, (off, n, name, asm) in enumerate(self.ins):
+                if self.exec_keep:
+                    self.end_exec_keep(instruction_index, off, name, asm, targets)

P1 Badge Guard scalar descriptor reads in the join instruction

When the execz target itself is s_buffer_load_dword s30, s[16:19], 0x0, this check runs before the join populates exec_keep, so the target instruction bypasses the scalar-read guard. A pure-Python variant of EXEC_DESC_MASKED with that load at the join, followed by the EXEC restore and a read of s30, is accepted and emits an unconditional r0.Load. Scalar instructions execute even with EXEC zero, so the translation binds the arm's resource on an edge that never loaded its descriptor instead of refusing the unsupported read. The parent refuses this variant, and inserting one s_nop before the scalar load also makes this commit refuse it. Validate scalar reads in the join instruction after installing the kept symbols.

Useful? React with 👍 / 👎.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review-comment:4703632946 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2713#discussion_r4703632946). Originally posted by [chatgpt-codex-connector[bot]](https://github.com/chatgpt-codex-connector%5Bbot%5D) on 2026-11-26T03:41:25Z. **Code review location:** `tools/startup/gfx2hlsl.py`; line 3020 ~~~~diff @@ -3013,8 +3013,11 @@ def translate(self): falls = True start = 0 raised_unsupported = None + self.exec_keep = {} # registers whose body-arm descriptor symbol is kept after an execz join (rule R1) for instruction_index, (off, n, name, asm) in enumerate(self.ins): + if self.exec_keep: + self.end_exec_keep(instruction_index, off, name, asm, targets) ~~~~ --- **<sub><sub>![P1 Badge](https://img.shields.io/badge/P1-orange?style=flat)</sub></sub> Guard scalar descriptor reads in the join instruction** When the execz target itself is `s_buffer_load_dword s30, s[16:19], 0x0`, this check runs before the join populates `exec_keep`, so the target instruction bypasses the scalar-read guard. A pure-Python variant of `EXEC_DESC_MASKED` with that load at the join, followed by the EXEC restore and a read of s30, is accepted and emits an unconditional `r0.Load`. Scalar instructions execute even with EXEC zero, so the translation binds the arm's resource on an edge that never loaded its descriptor instead of refusing the unsupported read. The parent refuses this variant, and inserting one `s_nop` before the scalar load also makes this commit refuse it. Validate scalar reads in the join instruction after installing the kept symbols. Useful? React with 👍 / 👎. <!-- codex-code-review-finding:v1 -->
chatgpt-codex-connector[bot commented 2026-11-26 04:04:44 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-26T03:41:25Z.

Code review location: tools/startup/gfx2hlsl.py; line 4096

@@ -4052,6 +4061,41 @@ def pointer_add(self, base, dname, srcs, syms):
         self.__dict__.setdefault('ptr_addc_pcs', set()).add(self.pc)
         return True
 
+    def exec_zero_keepable(self, target, reg, arriving, paths, branches):
+        """Rule R1: the fall-through arm of an s_cbranch_execz skip wrote a descriptor word and no other edge into the
+        target wrote the register, and exec is not written between the first skipping branch and the target (so on
+        the fall-through exec is still the arm's mask, and on every taken edge it is 0)."""
+        if len(paths) != 1 or not paths[0] or paths[0][0] != 'desc' or reg not in arriving[0][1]:
+            return False
+        if any(reg in w for _, w in arriving[1:]):
+            return False
+        first = min(pc for pc, to in branches if to == target)
+        for off, _n, name, asm in self.ins:
+            if first < off < target and writes_exec(name, parse(asm)[1]):
+                return False
+        return True
+
+    def end_exec_keep(self, index, off, name, asm, targets):
+        """Ends the R1 window: from the next join, branch or exec write on, a register kept after an execz join is
+        joined again (a lane that skipped the arm is active again and would read the arm's stale word). A scalar
+        instruction reading a kept register ends it for that register at once: scalar work runs with exec == 0 too."""
+        prev_name, prev_asm = self.ins[index - 1][2], self.ins[index - 1][3]
+        if (off in targets or name.startswith('s_cbranch') or name in ('s_branch', 's_setpc_b64')
+                or writes_exec(prev_name, parse(prev_asm)[1])):
+            doomed = set(self.exec_keep)
+        elif name.startswith('s_'):
+            doomed = set()
+            for tok in parse(asm)[1][1:]:
+                r = reg_range(tok)
+                if r and r[0] == 's':
+                    doomed |= {reg for reg in self.exec_keep if r[1] <= reg <= r[2]}
+        else:
+            return
+        for reg in doomed:
+            if self.sym.get(reg) == self.exec_keep[reg]:
+                self.sym[reg] = ('joined at a branch target',)

P2 Badge Retire keep markers when a descriptor is redefined

If code unconditionally reloads the same descriptor between the join and the EXEC restore, the load recreates exactly the tuples stored in exec_keep, but its writes never retire those markers. This equality check therefore poisons the fresh, all-path definitions after EXEC changes, causing a subsequent image_load to be refused as joined at a branch target. Duplicating EXEC_DESC_MASKED's descriptor load and wait at the join and moving the image read after the restore reproduces the regression: the parent translates it, while this commit refuses it. Retire a register's keep marker on an unconditional redefinition, even when the replacement symbol compares equal.

Useful? React with 👍 / 👎.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review-comment:4703632950 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2713#discussion_r4703632950). Originally posted by [chatgpt-codex-connector[bot]](https://github.com/chatgpt-codex-connector%5Bbot%5D) on 2026-11-26T03:41:25Z. **Code review location:** `tools/startup/gfx2hlsl.py`; line 4096 ~~~~diff @@ -4052,6 +4061,41 @@ def pointer_add(self, base, dname, srcs, syms): self.__dict__.setdefault('ptr_addc_pcs', set()).add(self.pc) return True + def exec_zero_keepable(self, target, reg, arriving, paths, branches): + """Rule R1: the fall-through arm of an s_cbranch_execz skip wrote a descriptor word and no other edge into the + target wrote the register, and exec is not written between the first skipping branch and the target (so on + the fall-through exec is still the arm's mask, and on every taken edge it is 0).""" + if len(paths) != 1 or not paths[0] or paths[0][0] != 'desc' or reg not in arriving[0][1]: + return False + if any(reg in w for _, w in arriving[1:]): + return False + first = min(pc for pc, to in branches if to == target) + for off, _n, name, asm in self.ins: + if first < off < target and writes_exec(name, parse(asm)[1]): + return False + return True + + def end_exec_keep(self, index, off, name, asm, targets): + """Ends the R1 window: from the next join, branch or exec write on, a register kept after an execz join is + joined again (a lane that skipped the arm is active again and would read the arm's stale word). A scalar + instruction reading a kept register ends it for that register at once: scalar work runs with exec == 0 too.""" + prev_name, prev_asm = self.ins[index - 1][2], self.ins[index - 1][3] + if (off in targets or name.startswith('s_cbranch') or name in ('s_branch', 's_setpc_b64') + or writes_exec(prev_name, parse(prev_asm)[1])): + doomed = set(self.exec_keep) + elif name.startswith('s_'): + doomed = set() + for tok in parse(asm)[1][1:]: + r = reg_range(tok) + if r and r[0] == 's': + doomed |= {reg for reg in self.exec_keep if r[1] <= reg <= r[2]} + else: + return + for reg in doomed: + if self.sym.get(reg) == self.exec_keep[reg]: + self.sym[reg] = ('joined at a branch target',) ~~~~ --- **<sub><sub>![P2 Badge](https://img.shields.io/badge/P2-yellow?style=flat)</sub></sub> Retire keep markers when a descriptor is redefined** If code unconditionally reloads the same descriptor between the join and the EXEC restore, the load recreates exactly the tuples stored in `exec_keep`, but its writes never retire those markers. This equality check therefore poisons the fresh, all-path definitions after EXEC changes, causing a subsequent `image_load` to be refused as `joined at a branch target`. Duplicating `EXEC_DESC_MASKED`'s descriptor load and wait at the join and moving the image read after the restore reproduces the regression: the parent translates it, while this commit refuses it. Retire a register's keep marker on an unconditional redefinition, even when the replacement symbol compares equal. Useful? React with 👍 / 👎. <!-- codex-code-review-finding:v1 -->
tedin7 commented 2026-11-26 04:04:45 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-26T04:00:35Z.

Code review location: tools/startup/gfx2hlsl.py; line 3020

@@ -3013,8 +3013,11 @@ def translate(self):
             falls = True
             start = 0
             raised_unsupported = None
+            self.exec_keep = {}  # registers whose body-arm descriptor symbol is kept after an execz join (rule R1)
 
             for instruction_index, (off, n, name, asm) in enumerate(self.ins):
+                if self.exec_keep:
+                    self.end_exec_keep(instruction_index, off, name, asm, targets)

Fixed in 62484f4b0 (now on head 6b8961fb7, merged with current main). The join instruction itself now runs the scalar-read check after the keep markers are installed (end_exec_keep_scalar_read), so s_mov_b32 s30, s17 at the join refuses with numeric use of s17 holding joined at a branch target. New fixture EXEC_DESC_SCALAR_JOIN in tests/startup_gfx2hlsl_join_symbols_check.py: the parent commit accepts it, this commit refuses it.

Commands run:

  • python3 tests/startup_gfx2hlsl_join_symbols_check.py -> pass
  • python3 tests/startup_gfx2hlsl_join_symbols_check.py binary llvm-mc-19 -> fixture words match

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review-comment:4703739794 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2713#discussion_r4703739794). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-26T04:00:35Z. **Code review location:** `tools/startup/gfx2hlsl.py`; line 3020 ~~~~diff @@ -3013,8 +3013,11 @@ def translate(self): falls = True start = 0 raised_unsupported = None + self.exec_keep = {} # registers whose body-arm descriptor symbol is kept after an execz join (rule R1) for instruction_index, (off, n, name, asm) in enumerate(self.ins): + if self.exec_keep: + self.end_exec_keep(instruction_index, off, name, asm, targets) ~~~~ --- Fixed in 62484f4b0 (now on head 6b8961fb7, merged with current main). The join instruction itself now runs the scalar-read check after the keep markers are installed (`end_exec_keep_scalar_read`), so `s_mov_b32 s30, s17` at the join refuses with `numeric use of s17 holding joined at a branch target`. New fixture `EXEC_DESC_SCALAR_JOIN` in `tests/startup_gfx2hlsl_join_symbols_check.py`: the parent commit accepts it, this commit refuses it. Commands run: - `python3 tests/startup_gfx2hlsl_join_symbols_check.py` -> pass - `python3 tests/startup_gfx2hlsl_join_symbols_check.py binary llvm-mc-19` -> fixture words match AI-assisted; commands listed were executed locally.
tedin7 commented 2026-11-26 04:04:45 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-26T04:00:39Z.

Code review location: tools/startup/gfx2hlsl.py; line 4096

@@ -4052,6 +4061,41 @@ def pointer_add(self, base, dname, srcs, syms):
         self.__dict__.setdefault('ptr_addc_pcs', set()).add(self.pc)
         return True
 
+    def exec_zero_keepable(self, target, reg, arriving, paths, branches):
+        """Rule R1: the fall-through arm of an s_cbranch_execz skip wrote a descriptor word and no other edge into the
+        target wrote the register, and exec is not written between the first skipping branch and the target (so on
+        the fall-through exec is still the arm's mask, and on every taken edge it is 0)."""
+        if len(paths) != 1 or not paths[0] or paths[0][0] != 'desc' or reg not in arriving[0][1]:
+            return False
+        if any(reg in w for _, w in arriving[1:]):
+            return False
+        first = min(pc for pc, to in branches if to == target)
+        for off, _n, name, asm in self.ins:
+            if first < off < target and writes_exec(name, parse(asm)[1]):
+                return False
+        return True
+
+    def end_exec_keep(self, index, off, name, asm, targets):
+        """Ends the R1 window: from the next join, branch or exec write on, a register kept after an execz join is
+        joined again (a lane that skipped the arm is active again and would read the arm's stale word). A scalar
+        instruction reading a kept register ends it for that register at once: scalar work runs with exec == 0 too."""
+        prev_name, prev_asm = self.ins[index - 1][2], self.ins[index - 1][3]
+        if (off in targets or name.startswith('s_cbranch') or name in ('s_branch', 's_setpc_b64')
+                or writes_exec(prev_name, parse(prev_asm)[1])):
+            doomed = set(self.exec_keep)
+        elif name.startswith('s_'):
+            doomed = set()
+            for tok in parse(asm)[1][1:]:
+                r = reg_range(tok)
+                if r and r[0] == 's':
+                    doomed |= {reg for reg in self.exec_keep if r[1] <= reg <= r[2]}
+        else:
+            return
+        for reg in doomed:
+            if self.sym.get(reg) == self.exec_keep[reg]:
+                self.sym[reg] = ('joined at a branch target',)

Fixed in 62484f4b0 (now on head 6b8961fb7, merged with current main). A descriptor load (s_load* / s_buffer_load*) that redefines a kept register now retires its keep marker without poisoning it, so the fresh definition stays readable after the EXEC restore. New fixture EXEC_DESC_RELOAD (reload at the join, restore, then image_load): the parent commit refuses it with holds ('joined at a branch target',), this commit translates it to r0.Load.

Commands run:

  • python3 tests/startup_gfx2hlsl_join_symbols_check.py -> pass
  • python3 tests/startup_gfx2hlsl_join_symbols_check.py binary llvm-mc-19 -> fixture words match
  • all 112 tests/startup_gfx2hlsl_*check.py scripts: 110 exit 0; the 2 that exit 1 need arguments or a renderer (same as on main)

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review-comment:4703740128 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2713#discussion_r4703740128). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-26T04:00:39Z. **Code review location:** `tools/startup/gfx2hlsl.py`; line 4096 ~~~~diff @@ -4052,6 +4061,41 @@ def pointer_add(self, base, dname, srcs, syms): self.__dict__.setdefault('ptr_addc_pcs', set()).add(self.pc) return True + def exec_zero_keepable(self, target, reg, arriving, paths, branches): + """Rule R1: the fall-through arm of an s_cbranch_execz skip wrote a descriptor word and no other edge into the + target wrote the register, and exec is not written between the first skipping branch and the target (so on + the fall-through exec is still the arm's mask, and on every taken edge it is 0).""" + if len(paths) != 1 or not paths[0] or paths[0][0] != 'desc' or reg not in arriving[0][1]: + return False + if any(reg in w for _, w in arriving[1:]): + return False + first = min(pc for pc, to in branches if to == target) + for off, _n, name, asm in self.ins: + if first < off < target and writes_exec(name, parse(asm)[1]): + return False + return True + + def end_exec_keep(self, index, off, name, asm, targets): + """Ends the R1 window: from the next join, branch or exec write on, a register kept after an execz join is + joined again (a lane that skipped the arm is active again and would read the arm's stale word). A scalar + instruction reading a kept register ends it for that register at once: scalar work runs with exec == 0 too.""" + prev_name, prev_asm = self.ins[index - 1][2], self.ins[index - 1][3] + if (off in targets or name.startswith('s_cbranch') or name in ('s_branch', 's_setpc_b64') + or writes_exec(prev_name, parse(prev_asm)[1])): + doomed = set(self.exec_keep) + elif name.startswith('s_'): + doomed = set() + for tok in parse(asm)[1][1:]: + r = reg_range(tok) + if r and r[0] == 's': + doomed |= {reg for reg in self.exec_keep if r[1] <= reg <= r[2]} + else: + return + for reg in doomed: + if self.sym.get(reg) == self.exec_keep[reg]: + self.sym[reg] = ('joined at a branch target',) ~~~~ --- Fixed in 62484f4b0 (now on head 6b8961fb7, merged with current main). A descriptor load (`s_load*` / `s_buffer_load*`) that redefines a kept register now retires its keep marker without poisoning it, so the fresh definition stays readable after the EXEC restore. New fixture `EXEC_DESC_RELOAD` (reload at the join, restore, then `image_load`): the parent commit refuses it with `holds ('joined at a branch target',)`, this commit translates it to `r0.Load`. Commands run: - `python3 tests/startup_gfx2hlsl_join_symbols_check.py` -> pass - `python3 tests/startup_gfx2hlsl_join_symbols_check.py binary llvm-mc-19` -> fixture words match - all 112 `tests/startup_gfx2hlsl_*check.py` scripts: 110 exit 0; the 2 that exit 1 need arguments or a renderer (same as on main) AI-assisted; commands listed were executed locally.
upstream-sync closed this pull request 2026-11-26 07:00:16 +00:00
MasterDomino commented 2026-11-26 07:00:16 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by MasterDomino on 2026-11-26T06:25:09Z.

Review: CHANGES_REQUESTED


Reviewed 6b8961fb. The R1 rule and both Codex fixes read correctly, and the masked, after, scalar-join and reload fixtures hold.

One hole remains: when the join instruction is itself a branch, the kept arm symbol goes into the incoming snapshot (gfx2hlsl.py:3114-3122) before end_exec_keep can close the window, because that only runs at the top of the next instruction. The next target then receives the arm's descriptor, and a read after the exec restore translates.

Each of these is refused on main and emits t = r0.Load(...) here. The common prefix is wave64, assembled with llvm-mc 15: s_and_saveexec_b64 s[6:7], vcc; s_cbranch_execz T; s_load_dwordx8 s[16:23], s[8:9], 0x0; s_waitcnt lgkmcnt(0); T:.

  • s_branch T2; T2: s_or_b64 exec, exec, s[6:7]; image_load v[4:7], v[0:1], s[16:23] ...
  • s_branch T2; s_endpgm; T2: <restore>; <image_load>
  • s_cbranch_scc1 T2; s_endpgm; T2: <restore>; <image_load>

That's the case the PR says stays refused: a lane that skipped the arm reads a descriptor it never loaded.

Requested:

  • Fix: at the join instruction, retire every kept register before the branch records its incoming edge (a branch or a proven s_setpc_b64).
  • Refusal fixture: add one of the three programs above.
  • Window fixture: add a case with a branch inside the window (s_nop; s_branch T2; s_endpgm; T2: restore; image_load). Removing the branch condition from end_exec_keep currently still passes the check.

Cache revision: no bump needed. All 673 translations made by the gfx2hlsl, image and compute checks on main are identical on this branch merged with main; only EXEC_DESC_MASKED is new.

Runs: Windows 11 build 26300; AMD Radeon RX 9070 XT (driver 32.0.32029.2010); WARP 10.0.26100.9818.

  • ctest --preset dev -R startup_gfx2hlsl_join_symbols: 5/5.
  • startup_gfx2hlsl_join_symbols_check.py binary with llvm-mc 15: words match.
  • ctest --preset dev -R startup_gfx2hlsl -j 6: 250/251. The failure, fma_mix_dispatch_hardware, also fails on main on this GPU (#2746).

Mutants:

  • Caught: no scalar-read guard at the join, an exec write not closing the window, and a reload not retiring.
  • Survives the PR's checks, caught by the probe above: a branch not closing the window.
  • Equivalent: dropping the exec-write-between check (a taken execz edge has exec 0 regardless).

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6069476083 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2713#pullrequestreview-6069476083). Originally posted by [MasterDomino](https://github.com/MasterDomino) on 2026-11-26T06:25:09Z. **Review:** CHANGES_REQUESTED --- Reviewed `6b8961fb`. The R1 rule and both Codex fixes read correctly, and the masked, after, scalar-join and reload fixtures hold. **One hole remains: when the join instruction is itself a branch, the kept arm symbol goes into the `incoming` snapshot** (`gfx2hlsl.py:3114-3122`) before `end_exec_keep` can close the window, because that only runs at the top of the next instruction. The next target then receives the arm's descriptor, and a read after the exec restore translates. Each of these is refused on `main` and emits `t = r0.Load(...)` here. The common prefix is wave64, assembled with llvm-mc 15: `s_and_saveexec_b64 s[6:7], vcc; s_cbranch_execz T; s_load_dwordx8 s[16:23], s[8:9], 0x0; s_waitcnt lgkmcnt(0); T:`. - `s_branch T2; T2: s_or_b64 exec, exec, s[6:7]; image_load v[4:7], v[0:1], s[16:23] ...` - `s_branch T2; s_endpgm; T2: <restore>; <image_load>` - `s_cbranch_scc1 T2; s_endpgm; T2: <restore>; <image_load>` That's the case the PR says stays refused: a lane that skipped the arm reads a descriptor it never loaded. **Requested:** - **Fix:** at the join instruction, retire every kept register before the branch records its incoming edge (a branch or a proven `s_setpc_b64`). - **Refusal fixture:** add one of the three programs above. - **Window fixture:** add a case with a branch inside the window (`s_nop; s_branch T2; s_endpgm; T2: restore; image_load`). Removing the branch condition from `end_exec_keep` currently still passes the check. **Cache revision:** no bump needed. All 673 translations made by the gfx2hlsl, image and compute checks on `main` are identical on this branch merged with `main`; only `EXEC_DESC_MASKED` is new. Runs: Windows 11 build 26300; AMD Radeon RX 9070 XT (driver 32.0.32029.2010); WARP 10.0.26100.9818. - `ctest --preset dev -R startup_gfx2hlsl_join_symbols`: 5/5. - `startup_gfx2hlsl_join_symbols_check.py binary` with llvm-mc 15: words match. - `ctest --preset dev -R startup_gfx2hlsl -j 6`: 250/251. The failure, `fma_mix_dispatch_hardware`, also fails on `main` on this GPU (#2746). **Mutants:** - **Caught:** no scalar-read guard at the join, an exec write not closing the window, and a reload not retiring. - **Survives the PR's checks, caught by the probe above:** a branch not closing the window. - **Equivalent:** dropping the exec-write-between check (a taken execz edge has exec 0 regardless). AI-assisted; commands listed were executed locally.
MasterDomino commented 2026-11-26 07:00:16 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by MasterDomino on 2026-11-26T06:51:27Z.

Review: APPROVED


Approving 68dd9612. My change request is resolved.

  • The fix: dd182fdd retires every kept execz descriptor at the join instruction when that instruction is a branch (s_cbranch*, s_branch or s_setpc_b64), before the branch records its incoming edge.
  • The fixtures: it adds the three refusals I asked for. EXEC_DESC_JOIN_BRANCH and EXEC_DESC_JOIN_SCC cover a branch at the join, and EXEC_DESC_BRANCH_IN covers a branch inside the window.

Checked at this head (Windows 11 build 26300):

  • The check passes: python -B tests/startup_gfx2hlsl_join_symbols_check.py ends with "18 refusal controls and the old behaviour hold".
  • Negative control: with the new retire_exec_keep call replaced by pass, the same check fails: EXEC_DESC_JOIN_BRANCH accepted, expected a refusal naming "holds ('joined at a branch target',)". Restored, it passes.
  • GPU draws: the WARP and RX 9070 XT draws from my earlier review were at 6b8961fb. This change only adds refusals.
  • Cache revision: no bump is needed, since only newly translated programs change.
  • CI is green at this head.

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6069700219 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2713#pullrequestreview-6069700219). Originally posted by [MasterDomino](https://github.com/MasterDomino) on 2026-11-26T06:51:27Z. **Review:** APPROVED --- Approving `68dd9612`. My change request is resolved. - **The fix:** `dd182fdd` retires every kept execz descriptor at the join instruction when that instruction is a branch (`s_cbranch*`, `s_branch` or `s_setpc_b64`), before the branch records its incoming edge. - **The fixtures:** it adds the three refusals I asked for. `EXEC_DESC_JOIN_BRANCH` and `EXEC_DESC_JOIN_SCC` cover a branch at the join, and `EXEC_DESC_BRANCH_IN` covers a branch inside the window. Checked at this head (Windows 11 build 26300): - **The check passes:** `python -B tests/startup_gfx2hlsl_join_symbols_check.py` ends with "18 refusal controls and the old behaviour hold". - **Negative control:** with the new `retire_exec_keep` call replaced by `pass`, the same check fails: `EXEC_DESC_JOIN_BRANCH accepted, expected a refusal naming "holds ('joined at a branch target',)"`. Restored, it passes. - **GPU draws:** the WARP and RX 9070 XT draws from my earlier review were at `6b8961fb`. This change only adds refusals. - **Cache revision:** no bump is needed, since only newly translated programs change. - **CI** is green at this head. AI-assisted; commands listed were executed locally.
tedin7 commented 2026-11-26 08:01:54 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-26T07:12:26Z.


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

  • Debug (--preset dev):
    • Build (cmake --build --preset dev --target d3d12_xs_device_obj d3d12_xs_shim startup_buffer_format_word3_check -- -j 2): 1.12s (configure 1.82s)
    • Test (ctest --preset dev -R 'startup_gfx2hlsl_join_symbols' --parallel 6 --no-tests=error --output-on-failure): 5/5 passed (0.51s: startup_gfx2hlsl_join_symbols_folded_hardware 0.29s, startup_gfx2hlsl_join_symbols_folded_warp 0.30s, startup_gfx2hlsl_join_symbols_controls 0.31s, startup_gfx2hlsl_join_symbols_hardware 0.38s, startup_gfx2hlsl_join_symbols_warp 0.39s)
  • Release /O2 (--preset release):
    • Build (cmake --build --preset release --target d3d12_xs_device_obj d3d12_xs_shim startup_buffer_format_word3_check -- -j 2): 1.49s (configure 1.85s)
    • Test (ctest --preset release -R 'startup_gfx2hlsl_join_symbols' --parallel 6 --no-tests=error --output-on-failure): 5/5 passed (0.42s: startup_gfx2hlsl_join_symbols_folded_warp 0.24s, startup_gfx2hlsl_join_symbols_controls 0.26s, startup_gfx2hlsl_join_symbols_folded_hardware 0.26s, startup_gfx2hlsl_join_symbols_hardware 0.30s, startup_gfx2hlsl_join_symbols_warp 0.31s)
  • Windows Python checks: tests/mesh_heap_sampler_check.py ok (0.5s), tests/startup_buffer_address_check.py ok (0.4s), tests/startup_buffer_format_word3_table_check.py ok (0.1s), tests/startup_compute_global_load_check.py ok (0.2s), tests/startup_compute_request_offline_check.py ok (0.5s), tests/startup_compute_store_format_xyzw_check.py ok (0.2s), tests/startup_compute_translate_check.py ok (0.2s), 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.1s), tests/startup_gfx2hlsl_bfm_b64_check.py ok (1.0s), tests/startup_gfx2hlsl_bit_alu_check.py ok (0.6s), tests/startup_gfx2hlsl_capture_check.py ok (1.0s), tests/startup_gfx2hlsl_cmp16_check.py ok (0.2s), tests/startup_gfx2hlsl_cmp_class_f16_sdwa_check.py ok (26.6s), tests/startup_gfx2hlsl_compare_dst_check.py ok (0.1s), tests/startup_gfx2hlsl_compute_check.py ok (0.4s), tests/startup_gfx2hlsl_const_copy_join_check.py ok (0.1s), tests/startup_gfx2hlsl_cselect_mask_check.py ok (0.1s), tests/startup_gfx2hlsl_cvt_alu_check.py ok (0.2s), tests/startup_gfx2hlsl_cvt_off_f32_i4_check.py ok (0.2s), tests/startup_gfx2hlsl_cvt_pk_int16_check.py ok (0.2s), tests/startup_gfx2hlsl_f32_lg_check.py ok (1.0s), tests/startup_gfx2hlsl_f32_nan_check.py ok (4.0s), tests/startup_gfx2hlsl_fma_mix_check.py ok (0.1s), tests/startup_gfx2hlsl_getpc_refusal_check.py ok (0.1s), tests/startup_gfx2hlsl_handler_arity_check.py ok (0.1s), tests/startup_gfx2hlsl_heap_record_check.py ok (0.2s), tests/startup_gfx2hlsl_heap_word_check.py ok (0.2s), tests/startup_gfx2hlsl_image_arity_check.py ok (0.1s), tests/startup_gfx2hlsl_image_get_lod_check.py ok (0.1s), tests/startup_gfx2hlsl_int_med3_check.py ok (0.1s), tests/startup_gfx2hlsl_interp_p2_hi_check.py ok (0.2s), tests/startup_gfx2hlsl_join_symbols_check.py ok (0.2s), tests/startup_gfx2hlsl_loop_constants_check.py ok (0.1s), tests/startup_gfx2hlsl_mask_data_check.py ok (0.1s), tests/startup_gfx2hlsl_mask_overwrite_check.py ok (0.1s), tests/startup_gfx2hlsl_operand_count_check.py ok (0.3s), tests/startup_gfx2hlsl_pack_absdiff_check.py ok (2.0s), tests/startup_gfx2hlsl_pack_b32_f16_check.py ok (0.1s), tests/startup_gfx2hlsl_readfirstlane_load_recompute_check.py ok (0.1s), 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.5s), tests/startup_gfx2hlsl_root_check.py ok (0.7s), tests/startup_gfx2hlsl_s_abs_check.py ok (0.1s), tests/startup_gfx2hlsl_s_bitset_check.py ok (0.1s), tests/startup_gfx2hlsl_s_ff0_check.py ok (0.1s), tests/startup_gfx2hlsl_s_ff1_check.py ok (0.1s), tests/startup_gfx2hlsl_s_flbit_check.py ok (0.1s), tests/startup_gfx2hlsl_s_quadmask_b64_check.py ok (0.1s), tests/startup_gfx2hlsl_s_quadmask_check.py ok (0.1s), tests/startup_gfx2hlsl_sad_check.py ok (0.3s), tests/startup_gfx2hlsl_sad_hi_msad_check.py ok (0.3s), tests/startup_gfx2hlsl_saveexec_same_reg_check.py ok (0.1s), tests/startup_gfx2hlsl_scalar_arity_check.py ok (0.2s), tests/startup_gfx2hlsl_scalar_brev_fold_check.py ok (0.1s), tests/startup_gfx2hlsl_scalar_m0_check.py ok (0.1s), tests/startup_gfx2hlsl_scalar_null_check.py ok (0.2s), tests/startup_gfx2hlsl_scalar_table_arity_check.py ok (0.3s), tests/startup_gfx2hlsl_sdwa_cndmask_check.py ok (0.2s), tests/startup_gfx2hlsl_sdwa_cvt_check.py ok (0.2s), tests/startup_gfx2hlsl_sgpr_spill_check.py ok (0.1s), tests/startup_gfx2hlsl_shift64_check.py ok (0.2s), tests/startup_gfx2hlsl_sload_const_offset_check.py ok (0.1s), tests/startup_gfx2hlsl_smem_offset_check.py ok (0.1s), tests/startup_gfx2hlsl_sop2_complement_check.py ok (4.6s), tests/startup_gfx2hlsl_sopk_accum_check.py ok (0.9s), tests/startup_gfx2hlsl_sopk_signext_check.py ok (0.1s), tests/startup_gfx2hlsl_spill_branches_check.py ok (0.8s), tests/startup_gfx2hlsl_swap_check.py ok (0.3s), tests/startup_gfx2hlsl_vopc_sdwa_check.py ok (3.6s), tests/startup_gfx2hlsl_waitcnt_depctr_check.py ok (0.1s), tests/startup_gfx2hlsl_watch_check.py ok (2.4s), tests/startup_image_2d_array_check.py ok (0.1s), tests/startup_image_3d_check.py ok (0.1s), tests/startup_image_gather_lz_check.py ok (0.5s), tests/startup_image_load_d16_check.py ok (0.8s), 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.5s), tests/startup_inline_sampler_check.py ok (0.1s), tests/startup_mesh57_depth_only_check.py ok (0.2s), tests/startup_mesh57_lane_spill_check.py ok (0.2s), tests/startup_mesh57_loop_check.py ok (0.2s), tests/startup_mesh57_loop_refusal_check.py ok (0.1s), tests/startup_mesh57_skeleton_check.py ok (0.9s), tests/startup_run_ps1_check.py ok (8.6s), tests/startup_run_sh_check.py skipped (0.1s), tests/startup_sampler_heap_check.py ok (0.1s), tests/startup_shader_cache_rekey_check.py ok (2.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.4s)
  • sccache: 6/8 hits; wall 88.4s
<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7185207539 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2713#issuecomment-7185207539). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-26T07:12:26Z. --- Verified on Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP) at commit `68dd9612cdcb3b9d937c27469b41dde2f7edb8e5`: - **Debug (`--preset dev`)**: - Build (`cmake --build --preset dev --target d3d12_xs_device_obj d3d12_xs_shim startup_buffer_format_word3_check -- -j 2`): `1.12s` (configure `1.82s`) - Test (`ctest --preset dev -R 'startup_gfx2hlsl_join_symbols' --parallel 6 --no-tests=error --output-on-failure`): **5/5 passed** (`0.51s`: `startup_gfx2hlsl_join_symbols_folded_hardware` `0.29s`, `startup_gfx2hlsl_join_symbols_folded_warp` `0.30s`, `startup_gfx2hlsl_join_symbols_controls` `0.31s`, `startup_gfx2hlsl_join_symbols_hardware` `0.38s`, `startup_gfx2hlsl_join_symbols_warp` `0.39s`) - **Release `/O2` (`--preset release`)**: - Build (`cmake --build --preset release --target d3d12_xs_device_obj d3d12_xs_shim startup_buffer_format_word3_check -- -j 2`): `1.49s` (configure `1.85s`) - Test (`ctest --preset release -R 'startup_gfx2hlsl_join_symbols' --parallel 6 --no-tests=error --output-on-failure`): **5/5 passed** (`0.42s`: `startup_gfx2hlsl_join_symbols_folded_warp` `0.24s`, `startup_gfx2hlsl_join_symbols_controls` `0.26s`, `startup_gfx2hlsl_join_symbols_folded_hardware` `0.26s`, `startup_gfx2hlsl_join_symbols_hardware` `0.30s`, `startup_gfx2hlsl_join_symbols_warp` `0.31s`) - **Windows Python checks**: `tests/mesh_heap_sampler_check.py` ok (`0.5s`), `tests/startup_buffer_address_check.py` ok (`0.4s`), `tests/startup_buffer_format_word3_table_check.py` ok (`0.1s`), `tests/startup_compute_global_load_check.py` ok (`0.2s`), `tests/startup_compute_request_offline_check.py` ok (`0.5s`), `tests/startup_compute_store_format_xyzw_check.py` ok (`0.2s`), `tests/startup_compute_translate_check.py` ok (`0.2s`), `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.1s`), `tests/startup_gfx2hlsl_bfm_b64_check.py` ok (`1.0s`), `tests/startup_gfx2hlsl_bit_alu_check.py` ok (`0.6s`), `tests/startup_gfx2hlsl_capture_check.py` ok (`1.0s`), `tests/startup_gfx2hlsl_cmp16_check.py` ok (`0.2s`), `tests/startup_gfx2hlsl_cmp_class_f16_sdwa_check.py` ok (`26.6s`), `tests/startup_gfx2hlsl_compare_dst_check.py` ok (`0.1s`), `tests/startup_gfx2hlsl_compute_check.py` ok (`0.4s`), `tests/startup_gfx2hlsl_const_copy_join_check.py` ok (`0.1s`), `tests/startup_gfx2hlsl_cselect_mask_check.py` ok (`0.1s`), `tests/startup_gfx2hlsl_cvt_alu_check.py` ok (`0.2s`), `tests/startup_gfx2hlsl_cvt_off_f32_i4_check.py` ok (`0.2s`), `tests/startup_gfx2hlsl_cvt_pk_int16_check.py` ok (`0.2s`), `tests/startup_gfx2hlsl_f32_lg_check.py` ok (`1.0s`), `tests/startup_gfx2hlsl_f32_nan_check.py` ok (`4.0s`), `tests/startup_gfx2hlsl_fma_mix_check.py` ok (`0.1s`), `tests/startup_gfx2hlsl_getpc_refusal_check.py` ok (`0.1s`), `tests/startup_gfx2hlsl_handler_arity_check.py` ok (`0.1s`), `tests/startup_gfx2hlsl_heap_record_check.py` ok (`0.2s`), `tests/startup_gfx2hlsl_heap_word_check.py` ok (`0.2s`), `tests/startup_gfx2hlsl_image_arity_check.py` ok (`0.1s`), `tests/startup_gfx2hlsl_image_get_lod_check.py` ok (`0.1s`), `tests/startup_gfx2hlsl_int_med3_check.py` ok (`0.1s`), `tests/startup_gfx2hlsl_interp_p2_hi_check.py` ok (`0.2s`), `tests/startup_gfx2hlsl_join_symbols_check.py` ok (`0.2s`), `tests/startup_gfx2hlsl_loop_constants_check.py` ok (`0.1s`), `tests/startup_gfx2hlsl_mask_data_check.py` ok (`0.1s`), `tests/startup_gfx2hlsl_mask_overwrite_check.py` ok (`0.1s`), `tests/startup_gfx2hlsl_operand_count_check.py` ok (`0.3s`), `tests/startup_gfx2hlsl_pack_absdiff_check.py` ok (`2.0s`), `tests/startup_gfx2hlsl_pack_b32_f16_check.py` ok (`0.1s`), `tests/startup_gfx2hlsl_readfirstlane_load_recompute_check.py` ok (`0.1s`), `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.5s`), `tests/startup_gfx2hlsl_root_check.py` ok (`0.7s`), `tests/startup_gfx2hlsl_s_abs_check.py` ok (`0.1s`), `tests/startup_gfx2hlsl_s_bitset_check.py` ok (`0.1s`), `tests/startup_gfx2hlsl_s_ff0_check.py` ok (`0.1s`), `tests/startup_gfx2hlsl_s_ff1_check.py` ok (`0.1s`), `tests/startup_gfx2hlsl_s_flbit_check.py` ok (`0.1s`), `tests/startup_gfx2hlsl_s_quadmask_b64_check.py` ok (`0.1s`), `tests/startup_gfx2hlsl_s_quadmask_check.py` ok (`0.1s`), `tests/startup_gfx2hlsl_sad_check.py` ok (`0.3s`), `tests/startup_gfx2hlsl_sad_hi_msad_check.py` ok (`0.3s`), `tests/startup_gfx2hlsl_saveexec_same_reg_check.py` ok (`0.1s`), `tests/startup_gfx2hlsl_scalar_arity_check.py` ok (`0.2s`), `tests/startup_gfx2hlsl_scalar_brev_fold_check.py` ok (`0.1s`), `tests/startup_gfx2hlsl_scalar_m0_check.py` ok (`0.1s`), `tests/startup_gfx2hlsl_scalar_null_check.py` ok (`0.2s`), `tests/startup_gfx2hlsl_scalar_table_arity_check.py` ok (`0.3s`), `tests/startup_gfx2hlsl_sdwa_cndmask_check.py` ok (`0.2s`), `tests/startup_gfx2hlsl_sdwa_cvt_check.py` ok (`0.2s`), `tests/startup_gfx2hlsl_sgpr_spill_check.py` ok (`0.1s`), `tests/startup_gfx2hlsl_shift64_check.py` ok (`0.2s`), `tests/startup_gfx2hlsl_sload_const_offset_check.py` ok (`0.1s`), `tests/startup_gfx2hlsl_smem_offset_check.py` ok (`0.1s`), `tests/startup_gfx2hlsl_sop2_complement_check.py` ok (`4.6s`), `tests/startup_gfx2hlsl_sopk_accum_check.py` ok (`0.9s`), `tests/startup_gfx2hlsl_sopk_signext_check.py` ok (`0.1s`), `tests/startup_gfx2hlsl_spill_branches_check.py` ok (`0.8s`), `tests/startup_gfx2hlsl_swap_check.py` ok (`0.3s`), `tests/startup_gfx2hlsl_vopc_sdwa_check.py` ok (`3.6s`), `tests/startup_gfx2hlsl_waitcnt_depctr_check.py` ok (`0.1s`), `tests/startup_gfx2hlsl_watch_check.py` ok (`2.4s`), `tests/startup_image_2d_array_check.py` ok (`0.1s`), `tests/startup_image_3d_check.py` ok (`0.1s`), `tests/startup_image_gather_lz_check.py` ok (`0.5s`), `tests/startup_image_load_d16_check.py` ok (`0.8s`), `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.5s`), `tests/startup_inline_sampler_check.py` ok (`0.1s`), `tests/startup_mesh57_depth_only_check.py` ok (`0.2s`), `tests/startup_mesh57_lane_spill_check.py` ok (`0.2s`), `tests/startup_mesh57_loop_check.py` ok (`0.2s`), `tests/startup_mesh57_loop_refusal_check.py` ok (`0.1s`), `tests/startup_mesh57_skeleton_check.py` ok (`0.9s`), `tests/startup_run_ps1_check.py` ok (`8.6s`), `tests/startup_run_sh_check.py` skipped (`0.1s`), `tests/startup_sampler_heap_check.py` ok (`0.1s`), `tests/startup_shader_cache_rekey_check.py` ok (`2.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.4s`) - `sccache`: 6/8 hits; wall `88.4s`
tedin7 commented 2026-11-26 08:01:54 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-26T07:12:28Z.


@MasterDomino all three requests are done at head 68dd9612c (merged with current main).

  1. Fix. When the join instruction is itself a branch (s_branch, s_cbranch*, or a proven s_setpc_b64), every kept register is retired before the branch records its incoming edge (gfx2hlsl.py, next to the join-time scalar-read check). The next target no longer receives the arm's descriptor, so a read after the restore is refused.
  2. Refusal fixtures in tests/startup_gfx2hlsl_join_symbols_check.py, wave64, words checked with binary llvm-mc-19:
    • EXEC_DESC_JOIN_BRANCH: join s_branch T2, restore, image_load (your first program);
    • EXEC_DESC_JOIN_SCC: join s_cbranch_scc1 T2; s_endpgm; T2: restore; image_load (your third).
      Both were accepted before the fix and are refused now with holds ('joined at a branch target',).
  3. Window fixture EXEC_DESC_BRANCH_IN: s_nop; s_branch T2; s_endpgm; T2: restore; image_load, refused. I removed the branch condition from end_exec_keep locally: the check now fails on this fixture, so that mutant is caught.

Commands run:

  • python3 tests/startup_gfx2hlsl_join_symbols_check.py -> pass (fails on the three new fixtures without the fix)
  • python3 tests/startup_gfx2hlsl_join_symbols_check.py binary llvm-mc-19 -> fixture words match
  • all tests/startup_gfx2hlsl_*check.py on Linux: only the two draw checks that need draw <dxc> ... arguments exit non-zero
  • Windows Server 2025 dev + release on 68dd9612c: receipt in the comment below (startup_gfx2hlsl_join_symbols ctest 5/5, py checks ok)

Cache revision: no bump, as you measured.

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7185208250 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2713#issuecomment-7185208250). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-26T07:12:28Z. --- @MasterDomino all three requests are done at head `68dd9612c` (merged with current `main`). 1. **Fix.** When the join instruction is itself a branch (`s_branch`, `s_cbranch*`, or a proven `s_setpc_b64`), every kept register is retired before the branch records its incoming edge (`gfx2hlsl.py`, next to the join-time scalar-read check). The next target no longer receives the arm's descriptor, so a read after the restore is refused. 2. **Refusal fixtures** in `tests/startup_gfx2hlsl_join_symbols_check.py`, wave64, words checked with `binary llvm-mc-19`: - `EXEC_DESC_JOIN_BRANCH`: join `s_branch T2`, restore, `image_load` (your first program); - `EXEC_DESC_JOIN_SCC`: join `s_cbranch_scc1 T2; s_endpgm; T2: restore; image_load` (your third). Both were accepted before the fix and are refused now with `holds ('joined at a branch target',)`. 3. **Window fixture** `EXEC_DESC_BRANCH_IN`: `s_nop; s_branch T2; s_endpgm; T2: restore; image_load`, refused. I removed the branch condition from `end_exec_keep` locally: the check now fails on this fixture, so that mutant is caught. Commands run: - `python3 tests/startup_gfx2hlsl_join_symbols_check.py` -> pass (fails on the three new fixtures without the fix) - `python3 tests/startup_gfx2hlsl_join_symbols_check.py binary llvm-mc-19` -> fixture words match - all `tests/startup_gfx2hlsl_*check.py` on Linux: only the two draw checks that need `draw <dxc> ...` arguments exit non-zero - Windows Server 2025 dev + release on `68dd9612c`: receipt in the comment below (`startup_gfx2hlsl_join_symbols` ctest 5/5, py checks ok) Cache revision: no bump, as you measured. AI-assisted; commands listed were executed locally.
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!2705
No description provided.