shader: refuse whole-word lane reads as wave32 vcc_hi masks #2768
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2776"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from R0Y00/Xbox2Windows. Originally posted by chadhyatt on 2026-11-26T07:56:11Z.
AI-assisted backport patch from x2w-microlift.
A wave32 vcc_hi written by v_readfirstlane or v_readlane holds one scalar word, not a lane bit. Use the same whole-word writer classification in the straight-line and branch-order mask checks; retain ordinary scalar-only lowering. Advance graphics and compute cache revisions together to avoid reusing previously accepted incorrect results.
Verification: Apple Silicon, head
b61e118188on upstream624f5927da. Eight portable checks passed:python -B tools/run_checks_parallel.py -j 3 tests/startup_shader_cache_key_check.py tests/startup_compute_request_offline_check.py tests/startup_gfx2hlsl_fract_check.py tests/startup_shader_cache_rekey_check.py tests/startup_gfx2hlsl_buffer_store_check.py tests/startup_packed_position_provenance_check.py tests/startup_gfx2hlsl_const_copy_join_check.py tests/startup_gfx2hlsl_vcc_hi_check.py.python -B tests/startup_gfx2hlsl_vcc_hi_check.py binary /opt/homebrew/opt/llvm@15/bin/llvm-mcalso passed. Authored negative controls include a backward-edge mask read and scalar-only positive control. Windows/D3D12 execution not run on this host.Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-26T08:01:20Z.
Review: COMMENTED
Review of head
b61e1181(comment only; the merge decision stays with the merge-check rules).What I checked:
vcc_hi_whole_word_writeris now shared by the straight-line check and the branch-order check.v_readfirstlaneis covered; before, onlys_*andv_readlanewere.shader-22string is left in the tree.wave32_vcc_hidirectly.Commands run (Linux):
python3 -B tests/startup_gfx2hlsl_vcc_hi_check.py,startup_shader_cache_key_check.py,startup_compute_request_offline_check.py,startup_gfx2hlsl_fract_check.py,startup_shader_cache_rekey_check.py: all rc=0python3 tests/docs_links_check.py,python3 tests/bidi_controls_check.py,git diff --check origin/main...HEAD: cleans_/v_readlanerule and the key back to 22: the vcc_hi check fails onREADFIRSTLANE_MASK.No issues found.
AI-assisted; commands listed were executed locally.
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-26T08:06:25Z.
Review: COMMENTED
Review of head
ee027c1e(comment only). Delta over the previously reviewedb61e1181is only the merge of main plus the cache revision moving from 23 to 24 (gfx2hlsl.py, d3d12_draw.inl, C++ fixtures, key-pinning checks, docs). Noshader-23literal is left outside docs history. The key checks and the vcc_hi check (with its negative control) pass, see the earlier review and Win2025 receipt.AI-assisted; commands listed were executed locally.
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-26T08:02:05Z.
Verified on Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP) at commit
b61e1181880bbd33831338c3099654baf5100ad4:--preset dev):cmake --build --preset dev --target d3d12_xs_device_obj d3d12_xs_shim startup_buffer_format_word3_check startup_indirect_draw_indexed startup_resource_retire_title -- -j 2):1.65s(configure2.35s)ctest --preset dev -R 'startup_indirect_draw_indexed|startup_resource_retire_title|startup_buffer_format_word3' --parallel 3 --no-tests=error --output-on-failure): 8/11 passed (0.46s:startup_resource_retire_title_warp_debug00.12s,startup_buffer_format_word3_table0.13s,startup_resource_retire_title_hardware_debug00.12s,startup_resource_retire_title_off_warp0.10s,startup_resource_retire_title_off_hardware0.09s,startup_buffer_format_word3_mapping_control0.02s,startup_buffer_format_word30.01s,startup_indirect_draw_indexed_warp0.13s,startup_resource_retire_title_warp_debug10.03s,startup_resource_retire_title_hardware_debug10.03s,startup_indirect_draw_indexed_hardware0.03s); skipped (capability, not a pass):startup_resource_retire_title_warp_debug1,startup_resource_retire_title_hardware_debug1,startup_indirect_draw_indexed_hardware/O2(--preset release):cmake --build --preset release --target d3d12_xs_device_obj d3d12_xs_shim startup_buffer_format_word3_check startup_indirect_draw_indexed startup_resource_retire_title -- -j 2):1.70s(configure2.23s)ctest --preset release -R 'startup_indirect_draw_indexed|startup_resource_retire_title|startup_buffer_format_word3' --parallel 3 --no-tests=error --output-on-failure): 8/11 passed (0.40s:startup_indirect_draw_indexed_warp0.10s,startup_resource_retire_title_warp_debug00.10s,startup_buffer_format_word3_table0.14s,startup_resource_retire_title_hardware_debug00.10s,startup_resource_retire_title_off_hardware0.10s,startup_buffer_format_word3_mapping_control0.02s,startup_resource_retire_title_off_warp0.07s,startup_buffer_format_word30.01s,startup_resource_retire_title_warp_debug10.03s,startup_resource_retire_title_hardware_debug10.02s,startup_indirect_draw_indexed_hardware0.03s); skipped (capability, not a pass):startup_resource_retire_title_warp_debug1,startup_resource_retire_title_hardware_debug1,startup_indirect_draw_indexed_hardwaretests/startup_gfx2hlsl_vcc_hi_check.pyok (0.2s),tests/startup_shader_cache_key_check.pyok (0.5s),tests/startup_compute_request_offline_check.pyok (0.6s),tests/startup_gfx2hlsl_fract_check.pyok (0.2s),tests/startup_shader_cache_rekey_check.pyok (2.8s),tests/startup_gfx2hlsl_buffer_store_check.pyok (0.6s),tests/startup_packed_position_provenance_check.pyok (0.3s),tests/startup_gfx2hlsl_const_copy_join_check.pyok (0.1s)sccache: 8/10 hits; wall19.4sWin2025 WARP receipt for head
b61e1181(dev+release): CTest 11/11 each (startup_indirect_draw_indexed, startup_resource_retire_title, startup_buffer_format_word3 included); Python checks rc=0: vcc_hi, shader_cache_key, compute_request_offline, gfx2hlsl_fract, shader_cache_rekey, buffer_store, packed_position_provenance, const_copy_join.AI-assisted; commands listed were executed locally.
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-26T08:05:44Z.
Pushed a merge of main into this branch (head
ee027c1e). Main had already taken shader cache revision 23, so the conflicts were all the revision bump. Resolution: revision 24 for graphics and compute (gfx2hlsl.py,d3d12_draw.inl, the two C++ fixtures, the key-pinning Python checks, new known-answer constants, docs). The author's logic and fixtures are unchanged.Win2025 WARP, dev and release, on this change applied to
b61e1181: CTest 8/11 passed each, 3 capability skips (hardware/debug1), 0 failed;startup_indirect_draw_indexed_warp,startup_resource_retire_title_*andstartup_buffer_format_word3*included. Python checks rc=0: vcc_hi, shader_cache_key, compute_request_offline, gfx2hlsl_fract, shader_cache_rekey, buffer_store, packed_position_provenance, const_copy_join.AI-assisted; commands listed were executed locally.
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-26T08:06:24Z.
Win2025 WARP receipt for head
ee027c1e(this change applied on top ofb61e1181= merge of main + revision 24).Verified on Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP) at commit
b61e1181880bbd33831338c3099654baf5100ad4:--preset dev):cmake --build --preset dev --target d3d12_xs_device_obj d3d12_xs_shim startup_buffer_format_word3_check startup_indirect_draw_indexed startup_resource_retire_title -- -j 2):26.27s(configure0.00s)ctest --preset dev -R 'startup_indirect_draw_indexed|startup_resource_retire_title|startup_buffer_format_word3' --parallel 6 --no-tests=error --output-on-failure): 8/11 passed (0.28s:startup_resource_retire_title_off_hardware0.06s,startup_resource_retire_title_off_warp0.09s,startup_buffer_format_word3_mapping_control0.01s,startup_resource_retire_title_hardware_debug00.10s,startup_buffer_format_word30.02s,startup_resource_retire_title_warp_debug00.12s,startup_buffer_format_word3_table0.14s,startup_resource_retire_title_warp_debug10.03s,startup_indirect_draw_indexed_warp0.12s,startup_resource_retire_title_hardware_debug10.03s,startup_indirect_draw_indexed_hardware0.03s); skipped (capability, not a pass):startup_resource_retire_title_warp_debug1,startup_resource_retire_title_hardware_debug1,startup_indirect_draw_indexed_hardware/O2(--preset release):cmake --build --preset release --target d3d12_xs_device_obj d3d12_xs_shim startup_buffer_format_word3_check startup_indirect_draw_indexed startup_resource_retire_title -- -j 2):56.04s(configure0.00s)ctest --preset release -R 'startup_indirect_draw_indexed|startup_resource_retire_title|startup_buffer_format_word3' --parallel 6 --no-tests=error --output-on-failure): 8/11 passed (0.27s:startup_resource_retire_title_warp_debug00.08s,startup_indirect_draw_indexed_warp0.10s,startup_resource_retire_title_off_warp0.07s,startup_resource_retire_title_off_hardware0.08s,startup_buffer_format_word3_mapping_control0.02s,startup_resource_retire_title_hardware_debug00.09s,startup_buffer_format_word30.02s,startup_resource_retire_title_warp_debug10.02s,startup_resource_retire_title_hardware_debug10.02s,startup_indirect_draw_indexed_hardware0.02s,startup_buffer_format_word3_table0.13s); skipped (capability, not a pass):startup_resource_retire_title_warp_debug1,startup_resource_retire_title_hardware_debug1,startup_indirect_draw_indexed_hardwaretests/startup_gfx2hlsl_vcc_hi_check.pyok (0.1s),tests/startup_shader_cache_key_check.pyok (0.4s),tests/startup_compute_request_offline_check.pyok (0.5s),tests/startup_gfx2hlsl_fract_check.pyok (0.1s),tests/startup_shader_cache_rekey_check.pyok (2.1s),tests/startup_gfx2hlsl_buffer_store_check.pyok (0.5s),tests/startup_packed_position_provenance_check.pyok (0.3s),tests/startup_gfx2hlsl_const_copy_join_check.pyok (0.1s)sccache: 0/10 hits; wall91.2sAI-assisted; commands listed were executed locally.