Whole-wave sections: an EXEC set by s_bfm_b32 of constant counts is refused (wave32 prefix sums, 10 compute shaders) #361
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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 LakshanSivakumar/Native-Victory-macOS. Originally posted by tiagonogueiraa-bit on 2026-11-27T14:08:54Z.
A shape from #4's list ("a whole-wave section step the simulation does not follow").
What is refused. The title's wave32 compute prefix sums build an inclusive sum in each row of 16 lanes (DPP
row_shr1, 2, 4, 8). Then they set EXEC to the upper row withs_bfm_b32 exec_lo, 16, 16and add lane 15 throughv_permlanex16_b32 v46, v47, -1, -1. InLower::section_inst,wave::register_onlydoes not take thes_bfm, so the section stops there with "GFX10 code at …: s_bfm_b32 is not supported". The simulator follows onlys_movEXEC writes, even though this is a constant lane set too (0xffff0000).How many. 10 unique compute shaders in a 12,020-shader corpus (Series S, boot to the menus, main
905e7aa) are refused fors_bfm_b32. All 10 are this shape.Plan.
s_bfm_b32ands_bfm_b64EXEC writes of two constant counts as the lane set they give.s_bfmwith a count in an SGPR stays refused.Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by tiagonogueiraa-bit on 2026-11-27T14:08:56Z.
/claim
Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by github-actions[bot] on 2026-11-27T14:09:06Z.
Claimed by @tiagonogueiraa-bit. Open a draft pull request with
Refs #361in its description within 24 hours, or the claim expires.Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by Olima34 on 2026-11-27T14:14:59Z.
Thanks, this looks worth doing, and our data agrees with yours. Our corpus of shaders refused at boot (M5 Pro, Series S, main
60baf130, native host options) has the same count: 10 compute shaders refused with "s_bfm_b32 is not supported", nothing else with that message:1ba04ed0bdb9d8f734046961ba5a083e6c7f547fee86539d6eb2cad0734f084471ffd0d7b57f54138c9f69d0d905ffe3b8c3843f71fb4eaac38c7bd6ba697164cbd298c95c519202d9be592e55ce3180Pointers that may save you time:
wave::register_only(emit/wave.rs) admits onlys_mov/s_andplusOp::salu_offor section steps. The simulator's EXEC tracking is wheres_bfmneeds to become a constant lane set.s_bfmhandling you can reuse instead of writing it again:resource.rs(around l. 2911):s_bfm_b32/s_bfm_b64with two constant operands;structure.rs(around l. 1149):s_bfmwith constant width and offset in the lane algebra;mask_tests.rs: tests fors_bfm_b64 exec, 8, 4and for a count in an SGPR, which must stay refused.When your draft is up, mention @Olima34 and we'll run it over our two boot sets (4,129 refused and 4,921 translated containers) and post the table.
Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by tiagonogueiraa-bit on 2026-11-27T14:20:37Z.
Widened to the wave64 form of the same prefix sums:
s_bitreplicate_b64_b32 exec, 0xff00ff00thens_bfm_b64 exec, 32, 32. That adds 2 shaders refused by name and 6 whose section values were unknown, which were refused later at a mask read. #362 now gains 17 compute shaders with no regressions.Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by LakshanSivakumar on 2026-11-28T00:35:26Z.
Thank you for the careful report and the PR. Both commits (s_bfm for the wave32 sums, s_bitreplicate for the wave64 form) are on main through #362. Your corpus sweep showed 17 more compute shaders translating, with no regressions and no changed outputs. I did not re-run the sweep and I have not seen these shaders work in the game, so this rests on your numbers. Closing as fixed. If one of the 10 shaders is still refused for s_bfm on
a6a58361, please tell me and I will reopen it.