Repository navigation
fix(recompiler): pair structurally equivalent whole-quad evaluations in stencil replay - #9266
akkadbakkad89 wants to merge 1 commit into
Conversation
|
OK, with two coordination notes. Verified against the branch rather than taking the description on faith:
Minor convention nit: the branch commit subject is Freshness: current Cross-PR ordering (both #9017 and #9030 also touch these two files, both open — verified states):
Disclosure: source-only verification plus merge checks; no recompiler test compiled or run locally here (GPU test device absent), so all run claims including the |
|
@fogydes thanks for the read-verification — your three points are accurate.
Your merge-tree findings match what we hit: the |
9b578d5 to
29bb5f0
Compare
29bb5f0 to
80c925d
Compare
|
Heads-up from the #9317 review sweep: this PR's MaskedSelect.cpp diff anchors on Fixed and rebased onto current main: pushed |
|
@akkadbakkad89 Thanks for the scope fix in Could you compare the immediate's kind/type and value before the structural recursion, and add a full-verifier refusal case where the two WQM source predicates differ only in a constant, including |
IrProgram does not intern values, so titles that evaluate the same whole-quad ballot twice emit distinct WqmU64 nodes for the low and high mask words. maskStable and helpers paired those words by object identity and rejected the split form. Compare the two evaluations structurally instead: same-block ballots must agree on their source tree and must not be separated by an execution-mask change, and every newly accepted node is recorded as restricted. Assassins Creed Shadows (PPSA20397) hits this in shader 0x407325e400. Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
80c925d to
46ff428
Compare
|
Verified and fixed at Claim confirmed: Fix: Test: added "stencil replay refuses to pair whole-quad evaluations whose predicates differ only in a constant" — exactly the The fix is carried into #9317's stack — its rebased head |
|
Closing this as superseded: #9317 has merged and carries this change. Thanks! |
What
On devices without
VK_EXT_shader_stencil_export,MaskReplaySafetyonly accepts a whole-quad (WqmU64) mask expansion when the low and high words extract the sameWqmU64node at indices 0 and 1.IrProgram::CreateValuedoes not intern values, so a title whose compiler emitss_wqm_b64twice on equivalent ballot inputs produces two distinctWqmU64nodes; a mask pairingextract(wqmA, 0)withextract(wqmB, 1)was refused even though the two evaluations are semantically identical.This was observed on Assassin's Creed Shadows (PPSA20397, #8514): shader
0x407325e400composes its own-lane mask from two same-blocks_wqm_b64instructions overballot(exec)sources, captured viaagc_shader_replay --materializeon a liveRecompileRequest— the pairing gate reportspaired=0on object identity alone.Both
maskStable()andhelpers()now pair the words throughequivalentWqm(): twoWqmU64s are equivalent when their source trees match opcode-for-opcode, treating same values and equal immediates as equal, and requiring anyBallotpair to sit in the same block with no execution-mask-affecting instruction (SetExec,SetExecLo,SetExecHi,Discard,Sendmsg,SetThreadBitScalarRegister,SetScalarMaskTag) between them. When a distinct high-side evaluation is accepted its node tree is added torestrictedso the untracked-lane-op checks keep their strength.This is one of several verifier gaps this shader hits; on its own it does not unblock the title (the EXEC-copy provenance is #9017's scope, multi-block optional bodies are #9030's, and a further
quadObservedrejection of a merged phi feeding a nestedexeczcondition remains — detail posted on #8514).Tested
Windows 10 Pro 22H2, WinLibs GCC 15.2.0 r7, Debug, on main
cecb540a6.agc_masked_select, two new cases: a mask pairingextract(wqmA, 0)withextract(wqmB, 1)over structurally identical, same-block ballot trees is replay-safe (stencil replay pairs structurally equivalent whole-quad evaluations for split low and high words); the same pair separated bySetExecLois refused (stencil replay refuses to pair whole-quad evaluations separated by an execution-mask change). Reverting the pairing relaxation makes the first fail while the second still passes; all pre-existing cases pass unchanged.agc_shader_replay --materializeon the captured0x407325e400request (ANYPS5_NO_SHADER_CACHE=1): the two same-blockWqmU64s now pair (paired=1, verified by instrumented build); the check then proceeds to the unrelatedcontrol()/optionalBodygate covered by fix(recompiler): accept optional wave bodies of several blocks in stencil replay #9030.python3 tools/check_conventions.py --base origin/main: pass.python3 tools/pr_overlap.py --branch fix/stencil-replay-wqm-duplicates: no same-scope overlap (fix(recompiler): accept EXEC copies in stencil replay masks #9017 toucheshelpers()' ballot provenance, fix(recompiler): accept optional wave bodies of several blocks in stencil replay #9030 touchesoptionalBody— disjoint hunks).Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)agc_masked_select+agc_shader_replayon NVIDIA RTX 3070, driver 581.80, Windows 10 22H2