shader: accept gfx10 scheduling hints in pixel_aot #356
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/362"
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 denn0x on 2026-11-21T23:21:19Z.
Change
Advances an independent problem:
pixel_aotrejecting compiler-emitted gfx10 code that only carries scheduling hints. It touches the top of the instruction loop intools/pixel_aot.py, next to the existings_nop/s_inst_prefetchcase. No open PR claims these hints, and no prerequisite PR is needed.gfx10 compilers emit
s_clausebefore memory clauses, and may emits_setprioands_sleep. None of these affects results, butpixel_aotrejected all three as unsupported instructions.s_clause,s_setprio,s_sleep: accepted wherevers_nopis, and lowered exactly like it. Each operand must fit its RDNA 2 field, so a larger value is rejected:s_clause: 6 bits, the clause length minus one;s_setprio: 2 bits, the wave priority;s_sleep: 7 bits.s_code_end: still rejected.native_programends the code ats_endpgm, so padding after it never reaches the translator. As before, nothing may follows_endpgmand no hint may sit between the color export ands_endpgm.Tests
check_scheduling_hints(), which runs in both test modes:s_nop 0. Generated names carry the instruction index, sos_nopat the same position is the exact reference.s_nop 0.s_code_endis rejected before and afters_endpgm, any instruction afters_endpgmis rejected, and a hint after the export is rejected.scheduling_hints()is incheck_binary, so LLVM assembles and disassembles the hinted program, and the extracted native bytes must equal the.textbytes.tests/form_coverage_check.pynow expectss_nop,s_clause,s_setprioands_sleepto be recorded from the real controls, and keepss_branch(fed only tomust_reject) ands_code_endas the rejected-form control.Verification
Windows 11 build 26200, MSVC 19.50.35720, Windows SDK 10.0.26100.0, DXC 1.8.2502.11, D3D12 debug layer enabled. Hardware: AMD Radeon RX 9070 XT (vendor 1002, device 7550), driver 32.0.32015.7029. WARP: Microsoft Basic Render Driver 10.0.26100.9818.
bvh_wave64_warpandwave_shuffle_warpreported capability skips.Mutation checks (local, reverted): widening every hint limit to 0xffff makes
check_scheduling_hintsfail withtranslate accepted invalid input. Re-adding thes_code_endskip afters_endpgmfails the same way.After
2b93466, in the same environment:Not run locally:
tests/pixel_aot_check.py binary, because this machine has no LLVM with gfx1013. Ubuntu CI covers the round trip, including the LLVM 15 spelling of these hints.Checklist
AI-assisted (Claude Code).
Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-21T23:26:28Z.
Two independent checks fail at
2fc9ee4.tests/form_coverage_check.py:199still asserts thats_nopis absent frompixel.ACCEPTED. Please update the coverage expectation for the newly accepted hint and retain a rejected-form control. The LLVM 15 round-trip also fails the byte comparisonnative == binary.read_bytes()intests/pixel_aot_check.py:1333. Please identify the first differing instruction and reconcile its encoding with LLVM 15 while keeping the byte comparison. CI logsImported from R0Y00/Xbox2Windows. Originally posted by denn0x on 2026-11-21T23:33:48Z.
Thanks. Both are fixed in
2b93466.native_programends the code ats_endpgm, but the fixture appended twos_code_endwords, so the.textwas 8 bytes longer than the extracted program, starting right afters_endpgm. Padding afters_endpgmtherefore never reaches the translator, so I droppeds_code_endacceptance instead of loosening the comparison. The fixture now ends ats_endpgm, the byte comparison is unchanged, ands_code_endis rejected before and afters_endpgm.s_nop 0as the reference, sos_nopis now legitimately recorded.check_shader_recordsnow asserts thats_nop,s_clause,s_setprioands_sleepare inACCEPTED, and keeps a rejected-form control:s_branchreaches onlymust_reject(it is a gfx1013 SOPP form, asserted to be in the reference) and must stay out, as musts_code_end. The synthetics_nopleak control above it is unchanged.Local reruns on the RX 9070 XT and WARP give
max_absolute_error=0in both modes, andform_coverage_check.pypasses. Re-adding thes_code_endskip makescheck_scheduling_hintsfail. The LLVM mode is still CI-only here.