shader: pin the lockstep rewrites with unit tests #485
No reviewers
Labels
No labels
accessibility
bug
claimed
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
tester report
urgent
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/LakshanSivakumar--Native-Victory-macOS!485
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-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?
@AnastasisKon on GitHub · 2026-11-27 21:59 UTC · original
AnastasisKon:vibe/lockstep-rewrite-tests-4f9c68→main· +106 −0 · 2 files · 1 commits · merged 2026-11-28 01:35 UTCWhat this changes
Refs #482.
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 added@Olima34 on GitHub · 2026-11-28 01:35 UTC · original · approved these changes
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 (#401 #403 #426 #471 #475 #479 #483 #485 #490 #493 #498 #502 #509 #515). 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!