shader: pin the lockstep rewrites with unit tests #481
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/481"
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 AnastasisKon on 2026-11-27T21:59:18Z.
What this changes
Refs #478.
crates/victory-shader/src/emit/lockstep.rsrewrites a wave's instructions before DXIL is emitted, so the two host waves of a console wave arrive together: a mask branch becomes a 64-bit compare with zero plus an SCC branch of the same distance, and a group barrier goes around each LDS write.lockstep.rshad two end-to-end tests of the refusal path and nothing on the rewrites themselves, so a change there is invisible until a shader is refused or lowered wrongly.emit/lockstep_tests.rs(declared undercfg(test), so the build hash is unchanged) pins the two pure passes on hand-assembled programs built throughir::build, the approachgfx_refusal_tests.rsalready uses:branches:s_cbranch_execzbecomings_cmp_eq_u64over the EXEC pair pluss_cbranch_scc1, the compare writing SCC, the branch reading it, and the original distance and opcode kept;s_cbranch_execnz,s_cbranch_vcczands_cbranch_vccnzpicking the matching compare over EXEC or VCC; a branch already on SCC, and a branch that is not on a mask, left untouched.lds_barriers: a group barrier before and after each LDS write, and none around reads.No behaviour change, no new dependencies, no game data.
How it was tested
cargo test -p victory-shader: 406 passed, 0 failed, 3 ignored (the new module included).cargo clippy --workspace --all-targets --locked --target x86_64-pc-windows-gnullvm -- -D warnings: no warnings on this tree.cargo xtask policy: 398 files ok.Checklist
VICTORY_*variable and documented: none addedImported from LakshanSivakumar/Native-Victory-macOS. Originally posted by Olima34 on 2026-11-28T01:35:43Z.
Review: APPROVED
Check report (helping the maintainer clear the queue):
checkandmacos-scriptsgreen on the current head.226645f9) merged with this PR and the other test/docs/tools PRs we're landing in this batch (#397 #399 #422 #467 #471 #475 #479 #481 #486 #489 #494 #498 #505 #511). On it, thevictory-gpu(arm64),victory-shader,victory-backend,victory-metalandvictorytests pass, as do the macOS script tests (rustup-path.sh,run-summary-compare.sh,run-summary.sh --self-test), Windows clippy (-D warnings) andcargo xtask policy. Onevictory-gpurun in four failed main's ownmulti_mip_array_and_placed_depth_twins_preserve_all_subresources_and_remirror_immediately. That test also flakes on main alone, so it isn't from this batch.Thanks @AnastasisKon!