Test/shader random control flow #3596
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3596"
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 Marvisak/VIctory. Originally posted by Levichu51 on 2026-11-27T20:05:19Z.
Builds on #1335 and #3591 (random vertex and mesh programs). Until those land, this branch also carries their commits; only the last one,
cd0a7da, is new here.Why
structureremoves EXEC: lane masks become per-lane booleans, wave-wide mask tests become per-lane branches, and each vector instruction keeps a guard only where a lane can reach it outside EXEC. It is the most involved part of the translator, and the part most open PRs touch.The random programs branched at random, but almost never in the shapes the console's compiler emits, so that work was barely tested.
What
Now and then a body item is divergent control flow as the compiler emits it. These constructs:
v_cmp;s_and_saveexec;s_cbranch_execz; body;s_or execs_xorof the else lanes; at the else,s_or_saveexec+s_xor execs_orof the exits,s_andn2 exec,s_cbranch_execnz,s_or execafterv_readfirstlane,v_cmp_eq,s_and_saveexec, body using the scalar,s_xor exec,s_cbranch_execnzv_cmpxv_cmpxof the killed lanes,s_andn2from the live mask,s_cbranch_scc0to anexp nullkill block after the endOf 16,384 programs, the number that translate with each construct:
v_cmpxAlso
Results
cargo test -p victory-shader: 174 passedcargo clippy -p victory-shader --all-targets [--all-features] --target x86_64-pc-windows-msvc -- -D warnings: cleancargo xtask policy: okAs with #1335, I ran it on Linux only. The Windows target was checked with clippy, not run; the test uses no GPU and no
dxil.dll.Imported from Marvisak/VIctory. Originally posted by futurepro62 on 2026-11-29T17:36:13Z.
Full-suite run on NVIDIA, since this PR has no test report yet. Tested exact head
cd0a7da(on its base63bcca4).Tested
dxil.dllfrom Windows SDK 10.0.26100 (the loader's default), debug.cargo build --workspace --locked, thencargo test --workspace --locked --no-fail-fast -- --test-threads=4 --skip emit::memory_tests::heap_direct_texture_reads_mark_their_heap_index --skip descriptor::host::tests::dynamic_slots_are_held_until_released --skip memory::tests::lists_share_a_table_and_copies_keep_their_views --skip emit::stride_tests::a_heap_buffer_read_by_element_takes_the_views_stride --skip emit::stride_tests::a_heap_buffer_read_where_no_buffer_view_is_reads_zeros --skip emit::synthetic_tests::gathers_at_a_level_match_the_hardware: 868 passed, 0 failed, 10 ignored.random_programs_translate_or_are_refused_the_same_way_every_time,random_programs_are_reproducible_from_their_seed.--skipleaves out tests that fail on main63bcca4on this card too, not because of this PR:heap_direct_texture_reads_mark_their_heap_indexends thevictory-shadertest process with0xc0000005(#2571), so without the skip the rest of that crate never reports;dynamic_slots_are_held_until_released,lists_share_a_table_and_copies_keep_their_viewsand the twostride_testshit the 1,000,000-view heap cap of NVIDIA drivers (#1835, #2317);gathers_at_a_level_match_the_hardwarefails on lane 0 (#1744).Not tested
AI use
Imported from Marvisak/VIctory. Originally posted by Levichu51 on 2026-11-29T19:18:08Z.
Thanks for the full run. Corrections to my description (and to the message of
cd0a7da):View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.