Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
b2a1957
startup: keep sample_b and get_lod past a divergent EXEC with a per-q…
tedin7 Nov 26, 2026
b006a05
Merge remote-tracking branch 'origin/main' into x2w-texflow-votes
tedin7 Nov 26, 2026
087c789
startup: vote EXEC branches with an arithmetic helper and only over v…
tedin7 Nov 26, 2026
5c907dd
tests: draw the saved-and-restored EXEC shape in the derivative flow …
tedin7 Nov 26, 2026
9402a52
startup: refuse a per-lane sample_b bias past a divergent EXEC
tedin7 Nov 26, 2026
c45dc9e
Merge remote-tracking branch 'origin/main' into x2w-texflow-votes
tedin7 Nov 26, 2026
213847b
startup: lower s_wqm exec, exec on a narrowed EXEC as a quad vote
tedin7 Nov 26, 2026
846b2aa
docs: the s_wqm vote of a narrowed EXEC
tedin7 Nov 26, 2026
f6ad609
Merge remote-tracking branch 'origin/main' into x2w-texflow-wqm
tedin7 Nov 26, 2026
3e604f1
Merge remote-tracking branch 'origin/main' into x2w-texflow-wqm
tedin7 Nov 26, 2026
48529ed
Merge remote-tracking branch 'origin/main' into x2w-texflow-votes
tedin7 Nov 26, 2026
9d8ca26
tests: restore the scalar_in_block and bias_per_lane refused fixtures…
Nov 26, 2026
5debc65
Merge branch 'main' into x2w-texflow-votes
Nov 26, 2026
1b7ae02
fix: quad vote and lane-exact EXEC for derivative ops (review threads)
Nov 26, 2026
083b949
Merge remote-tracking branch 'origin/main' into HEAD
Nov 26, 2026
af91d6b
Merge remote-tracking branch 'origin/main' into x2w-texflow-votes
Nov 26, 2026
26bcd3d
Merge remote-tracking branch 'origin/main' into x2w-texflow-wqm
Nov 26, 2026
1d648da
Merge remote-tracking branch 'fork/x2w-texflow-votes' into x2w-texflo…
Nov 26, 2026
33ef263
Merge x2w-texflow-votes into x2w-texflow-wqm
Nov 26, 2026
aa473ac
Merge remote-tracking branch 'origin/main' into x2w-texflow-wqm
Nov 26, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3858,6 +3858,24 @@ if(EXISTS "${INTAKE_PYTHON}")
"$<TARGET_FILE:offscreen_check>" ${adapter} $<$<BOOL:${STARTUP_FXC}>:${STARTUP_FXC}>)
set_tests_properties(startup_image_sample_b_${adapter} PROPERTIES TIMEOUT 120 SKIP_RETURN_CODE 77)
endforeach()
# gfx2hlsl image_sample_b past a divergent EXEC: EXEC branches decided per quad, drawn against a CPU reference.
add_test(NAME startup_image_sample_b_flow_controls COMMAND "${INTAKE_PYTHON}" -B
"${CMAKE_SOURCE_DIR}/tests/startup_image_sample_b_flow_check.py")
foreach(adapter IN ITEMS warp hardware)
add_test(NAME startup_image_sample_b_flow_${adapter} COMMAND "${INTAKE_PYTHON}" -B
"${CMAKE_SOURCE_DIR}/tests/startup_image_sample_b_flow_check.py" draw "${DXC_EXECUTABLE}"
"$<TARGET_FILE:offscreen_check>" ${adapter} $<$<BOOL:${STARTUP_FXC}>:${STARTUP_FXC}>)
set_tests_properties(startup_image_sample_b_flow_${adapter} PROPERTIES TIMEOUT 120 SKIP_RETURN_CODE 77)
endforeach()
# gfx2hlsl image_get_lod past a divergent EXEC: EXEC branches decided per quad, drawn against a CPU reference.
add_test(NAME startup_image_get_lod_flow_controls COMMAND "${INTAKE_PYTHON}" -B
"${CMAKE_SOURCE_DIR}/tests/startup_image_get_lod_flow_check.py")
foreach(adapter IN ITEMS warp hardware)
add_test(NAME startup_image_get_lod_flow_${adapter} COMMAND "${INTAKE_PYTHON}" -B
"${CMAKE_SOURCE_DIR}/tests/startup_image_get_lod_flow_check.py" draw "${DXC_EXECUTABLE}"
"$<TARGET_FILE:offscreen_check>" ${adapter} $<$<BOOL:${STARTUP_FXC}>:${STARTUP_FXC}>)
set_tests_properties(startup_image_get_lod_flow_${adapter} PROPERTIES TIMEOUT 120 SKIP_RETURN_CODE 77)
endforeach()
# Constant-sampler LOD limits of image_sample, _l and _lz (#2177): each form drawn alone against a plain-smp control.
foreach(adapter IN ITEMS warp hardware)
add_test(NAME startup_image_sample_lod_${adapter} COMMAND "${INTAKE_PYTHON}" -B
Expand Down
17 changes: 17 additions & 0 deletions docs/experiments.md
Original file line number Diff line number Diff line change
Expand Up @@ -17195,6 +17195,23 @@ or `scalar_wide_op()`). Reads where incoming SCC is unverified are refused: at s
control-flow joins/branch targets, after descriptor-elided SCC writes, and after unmodeled SCC writers in
`SCC_UNMODELLED` such as `s_add_u32` (after `s_add_u32` finishes reading its own sources). Run
`ctest --preset dev --no-tests=error -R '^startup_gfx2hlsl_src_scc$' -V`.


## Startup translator: derivative image ops under a divergent EXEC

`image_sample_b` and `image_get_lod` take implicit derivatives of the four lanes of a pixel quad. A pixel program
with such an op and no backward branch now decides its `s_cbranch_execz` / `s_cbranch_execnz` per quad
(`x2w_quad_any(exec)`: some lane of the 2x2 quad has its EXEC bit, from fine derivatives of the 0/1 bit), as the guest's
wave skips a block only when no lane is active and runs it with the other lanes masked. A voted branch parts no quad,
so it keeps `uniform_cf` (#2659); the vote reads the quad, so it is taken only while the control flow is quad-uniform
and no lane-exec break (a discard under an unknown EXEC, an `s_wqm` with other operands) came first. With that, a derivative
op may sit under `v_cmpx`, inside an `execz` block, past an `execnz` kill branch, or after an EXEC restore. Still
refused: any branch that can differ between lanes and is not an EXEC branch (VCC, SCC not proven uniform), loops with
such a branch. `s_wqm_b64 exec, exec` on a narrowed EXEC turns every lane of a quad with an active lane on; it is
lowered as `exec = x2w_quad_any(exec) ? 1u : 0u;`, the same vote written back to EXEC.
`tests/startup_image_sample_b_flow_check.py` and `tests/startup_image_get_lod_flow_check.py` draw each shape against a
CPU reference (DXC ps_6_0 and FXC ps_5_1) with wrong-value controls.

The `_dispatch_warp` and `_dispatch_hardware` tests run `s_cmp_eq_u32` then `s_mov_b32 sX, src_scc` on a D3D12
UAV dispatch and compare each lane with the CPU reference (SCC 0 and SCC 1, distinct per-case data). A copy of the
lowering mutated to `(scc ? 0u : 1u)` must read back wrong. Run
Expand Down
7 changes: 4 additions & 3 deletions tests/startup_gfx2hlsl_image_get_lod_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
(image_get_lod; the decoder reads it back with a 2-register address), sampler word 2 loaded from a literal (mip
filter point), and for the second form dmask 0x3.
Checks: dmask 0x1, 0x2 and 0x3 lower to the two calls on the sampler, which carries its LOD limits. A uniform join
before the read is accepted. Controls (refused): dmask 0x4, a 2D array, divergent EXEC, s_cbranch_vccz/execz before
before the read is accepted. Controls (refused): dmask 0x4, a 2D array, s_cbranch_vccz/execz before
the read, a sampler LOD bias, a sampler with mipmapping disabled, and the stage without op_image_get_lod
(negative control: refused as on main).
draw <dxc> [fxc]: also compile the dmask 0x3 stage with dxc ps_6_0 (and fxc ps_5_1).
Expand Down Expand Up @@ -98,7 +98,8 @@ def controls():
assert call in text and 'v4 = U(t.x);' in text, text
refused(stage(dmask=4), 'image_get_lod form')
refused(stage(dim=5), 'image_get_lod form') # SQ_RSRC_IMG_2D_ARRAY
refused(stage(divergent=True), 'image_get_lod needs implicit derivatives')
_, text = ps(stage(divergent=True)) # a cleared EXEC is an exact per-lane write: the quad program keeps the proof
assert call in text, text
for op in (7, 9): # vccnz, execnz back edge after the read
refused(stage(back_op=op), 'image_get_lod needs implicit derivatives')
for op in (6, 7, 8, 9): # vccz, vccnz, execz, execnz
Expand All @@ -112,7 +113,7 @@ def controls():
finally:
G.Stage.op_image_get_lod = saved
print('image_get_lod: CalculateLevelOfDetail / Unclamped for dmask 0x1, 0x2 and 0x3; uniform join/branch before '
'the read accepted; dmask 0x4, a 2D array, divergent EXEC, vcc/exec branches, a sampler bias and a '
'the read accepted, also after a cleared EXEC; dmask 0x4, a 2D array, vcc/exec branches, a sampler bias and a '
'sampler without mipmapping refused; refused without the handler')
return pipe

Expand Down
Loading
Loading