spirv-val's structured-control-flow checking cost grows roughly with the cube
of the nesting depth: over the 1.0.2.1 corpus the deepest block sits 118
constructs deep and about 85% of validation time is in modules nested 20 or
deeper. cfg_structure.depth() measures the tree and a module deeper than
MAX_STRUCTURED_DEPTH (16) is emitted in the existing flat dispatch-loop form
instead, which emits the same blocks and only changes the routing. Depth
5-12 shows no gain, hence the bound at 16.
Avoid O(N) OpSelectionMerge nesting and Python RecursionError on long sequential diamond/loop chains (e.g. unrolled ScreenProbes compute shaders): hoist each guarded member's dominated tail continuation out of its enclosing guard (exact by strict dominance) and make cfg_structure.structure, cfg_structure.run, and rdna2spirv.assemble's structured emitter iterative.
test_random_graphs returned the five counters it had already asserted two
lines above, so pytest reported the file's only warning:
PytestReturnNotNoneWarning: Expected None, but ... returned (18228, 1772,
12692, 1755, 17). tests/requirements.txt pins pytest 9.2.0, which still warns
but says the warning becomes an error in a future release, so the file would
turn the translator-tests job red without anyone touching it.
Drop the return. Under both pytest 8.3.5 (local) and the pinned 9.2.0 (clean
venv) the file passes 2/2 with no warnings.
🤖 Generated with Codebuff
Co-Authored-By: Codebuff <noreply@codebuff.com>
Preserve whole-wave mask operations, saved EXEC values and flat
pixel inputs when generating SPIR-V. Keep a dispatch-loop fallback
alongside structured control flow and share the descriptor probe.
Add reproducible GPU fixtures for these cases and exercise the
control-flow and mask analyses in CI.