Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2517"
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 Leyukaka on 2026-11-25T19:25:50Z.
Continues #2066 by @tedin7 (paused to keep the Windows test queue short; takeover note). Part of #1723.
The first commit is tedin7's
eb931ba9, cherry-picked onto main6d2d3bewith his authorship. It includes his fixes for the three review findings on #2066.An
s_load_dword*whose offset register holds a known constant now uses it as the literal byte offset, plus anyoffset:modifier. Such a constant comes from ans_mov_b32ors_movk_i32before the load. This reaches descriptors in the resource heap. Limits, unchanged from #2066:m0and the run-time sampler heap keep their old handling. A constant whose total with theoffset:modifier is above 0xfffff is refused (SMEM register offset ...).resheapresource.Rebase. One conflict in
CMakeLists.txt: both sides add a test next tostartup_gfx2hlsl_loop_constants, so I kept both.Two commits of mine on top.
The first drops #2066's
s_movk_i32sign extension inStage.scalar. Main has sign-extended the SOPK i32 immediates throughsopk_immsince8e0ef148, sos_movk_i32 s9, 0x8000already records0xffff8000, and the removed branch could no longer run. The checks for that value, and for the refused negative offset, now exercise main's path. The behaviour #2066 asked for is kept.The second:
const_soffsettake only an untagged('const', value)symbol, so the('const', 0, 'unassigned')default-sampler placeholder is not folded to offset 0;s_mov_b32 0x8000(not sign-extended), a total above 0xfffff, the placeholder and a sampler-heap register offset;Tests. Run on Windows 11 with Python 3.14 at this branch's head, all passing:
tests/startup_gfx2hlsl_sload_const_offset_check.py(new, from #2066);startup_gfx2hlsl_smem_offset_check.py;startup_translator_check.py;startup_gfx2hlsl_scalar_m0_check.py;startup_gfx2hlsl_loop_constants_check.py;startup_gfx2hlsl_join_symbols_check.py;startup_gfx2hlsl_sopk_signext_check.py.docs_links_check.pywas not run: it needs a git checkout, and these tests ran on a copy of the tree without.git.Mutation checks, run by hand.
startup_gfx2hlsl_sload_const_offset_check.pyfails on each:offset:modifier ignored;s_movk_i32sign extension turned off (sopk_imm(..., False)), whichstartup_gfx2hlsl_sopk_signext_check.pyalso catches;Why. In a local first-refusal census of captured start-up requests at main
6d2d3be,s_load with a register offset through ('resheap',)is the first refusal for 174 requests (private inputs, counts only). I have not measured how many of those are branch-free shaders with a constant offset, which is the case this slice handles.No GPU run; the checks drive the load handlers on a scalar symbol state.
AI-assisted.
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T19:37:45Z.
Review: COMMENTED
Review of head
75141d9b(comment only, no approval).Code (
tools/startup/gfx2hlsl.py,const_soffsetand theop_s_load_dwordx4hook): looks correct.('const', v)symbol, only for s0..s105, and only when the total withoffset:is within 0..0xfffff.has_branchesis set at line 1961 and the default is the safe one.startup_gfx2hlsl_smem_offset_check.pystill passes.Tests (Linux, at this head):
tests/startup_gfx2hlsl_sload_const_offset_check.py: 0 failed.tests/startup_gfx2hlsl_smem_offset_check.py: 0 failed.tests/docs_links_check.py: passed.tests/bidi_controls_check.py: passed.git diff --check origin/main...HEAD: clean.Scope notes:
.github/workflows/windows.ymlonly adds the new check to the Python list (one line). Its own CI run exercises it.AI-assisted; commands listed were executed locally.