Repository navigation
fix(recompiler): let optional-body merges reach ballots that helper lanes cannot contribute to - #9906
Conversation
|
Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.
|
|
Paired run with the Khronos validation layer (@MarcZX10's request), 2026-10-23. Layer:
AI-assisted: yes (Claude Code). |
|
I reviewed the exact head |
MarcZX10
left a comment
There was a problem hiding this comment.
Reviewed exact head 3740a402f2fac97794664f20bf87371a8404734d on the #9317 stack. This separately recognizes ballots proven false on helper lanes; the tests cover accepted proof and negative controls. The author reports paired validation-layer runs on NVIDIA and AMD with no new VUIDs, and combined title-request evidence with #9904/#9905. Current-main diff-check passes; conventions report no errors and only the inherited #9317 debt-length warning. Sync is clean apart from the shared debt file. Preserve this helper-lane proof alongside the complementary return-block and own-bit-phi changes; I found no duplicate implementation. I did not rerun the C++/GPU tests locally.
|
Validation datapoint for the full follow-up chain (data + source read, no title run). Setup: Windows 11 Pro 26200, WinLibs GCC 15.2.0 MinGW Release. Union tree Result on the union tree:
On this PR's diff: the exemption lands exactly as the reviewed one-liner — Scope note: we do not have the PPSA27836/PPSA24191 dumps locally, so the title-level confirmation for those shaders stays with your runs. |
|
@TheSovietWaffle Thanks, the helper-false ballot exemption looks right, and both new cases exercise it. Once #9317's current head builds, please rebase this branch onto it: this head carries #9317 at |
|
Heads-up for the rebase oneandonlydean asked for: #9317's head moved once more since his note — it is now |
|
@TheSovietWaffle Small correction to my note above: #9317 is now at |
…anes cannot contribute to quadObserved refuses an optional body whose merged value reaches a ballot, unless the ballot is only read as each lane's own bit. A ballot whose argument onHelper proves false on every helper lane is safe for any reader: helper lanes contribute zero to every word whatever the merged value holds there, so its words are a function of real lanes only. quadObserved now skips such a ballot when the mask analysis has restricted it. This bounds contribution where the own-bit funnel bounds consumption. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
3740a40 to
83d2093
Compare
What
On devices without
VK_EXT_shader_stencil_export,MaskReplaySafety::optionalBodyrefuses an EXEC- or VCC-skipped body when a merge phi isquadObserved. Since #9317 a merged value may reach aBallotonly when every use of that ballot funnels into a lane's own bit (ownBitBallot), which bounds what is read.This adds the dual case, which bounds what is written: a ballot whose argument
onHelperproves false on every helper lane. Helper lanes then contribute zero to every word of that ballot whatever the merged value holds on them, so its words are a function of real lanes only, and any consumer (an any-active early-exit gate, the export mask's merge phis) observes nothing about helper lanes. The exemption only applies to ballots the mask analysis has alreadyrestricted(they sit in a stable mask chain whosemaskStable/helperschecks passed); any other ballot still goes through the funnel or is refused.Onimusha: Way of the Sword (PPSA27836) needs this: after its discard,
Ballot(ownLane(liveWords) && !killed)(withliveWordsa ballot of non-helper lanes masked by the whole-quad active lanes) feeds both an any-active exit gate and the export mask's merge phis. @akkadbakkad89 agreed on #9317 that it should land as its own change on top of #9317.This branch is rebased onto
main570089a80, which now carries #9317 (merged asdef1f5dd9); the diff is this PR's own commit (one line inquadObservedand two test cases).Tested
Rebased 2026-10-26: on this head
83d2093a9(main570089a80), withANYPS5_REQUIRE_VULKAN=1andANYPS5_NO_SHADER_CACHE=1on the RTX 3080,agc_masked_select,agc_driver_sample_mask_depth_stencil,agc_driver_stencil_known_replace,agc_driver_stencil_null_feedback,agc_driver_stencil_ref_export_unused,agc_driver_stencil_replayandagc_driver_stencil_replay_no_gplpass andagc_driver_stencil_ref_exportskips (noVK_EXT_shader_stencil_export);tools/check_conventions.py --base origin/mainpasses. The results below were taken on the earlier fix(recompiler): exempt proven control conditions and own-bit ballots in stencil replay #9317 base.Windows 10 Pro 22H2 (19045), WinLibs GCC 15.2.0 r7, Release, on fix(recompiler): exempt proven control conditions and own-bit ballots in stencil replay #9317's head
92ebac241.agc_masked_select, two new cases: an optional body's merged value reachesBallot(own(live) && merged != 0), whose low word is also kept outside the own-bit funnel. Withlivea ballot of the non-helper lanes it is replay-safe; withlivea ballot that helper lanes are in, it is refused. With fix(recompiler): exempt proven control conditions and own-bit ballots in stencil replay #9317'sStencilReplay.cppthe first fails (an optional wave body may merge a value into a ballot whose argument is false on every helper lane); with this change both pass.The Onimusha request (
shader_2111c51800, dumped withAPS5_DUMP_SHADERS) checked offline withPrepareResourceProgram+StencilReplaySafeon fix(recompiler): exempt proven control conditions and own-bit ballots in stencil replay #9317 + fix(recompiler): replay stencil exports of pixel shaders that only read through BDA #8145 + fix(recompiler): accept optional-body merges implied by the skip predicate in stencil replay #9393 + fix(recompiler): accept optional bodies that end the wave through an exit that keeps no lane #9904 + fix(recompiler): accept optional-body merges of ballot words of the skipped lanes' mask bits #9905 + this change: the request passes.With
ANYPS5_REQUIRE_VULKAN=1andANYPS5_NO_SHADER_CACHE=1, on fix(recompiler): exempt proven control conditions and own-bit ballots in stencil replay #9317 and on this change:agc_masked_select,agc_driver_sample_mask_depth_stencil,agc_driver_stencil_known_replace,agc_driver_stencil_null_feedback,agc_driver_stencil_ref_export,agc_driver_stencil_ref_export_unused,agc_driver_stencil_replayandagc_driver_stencil_replay_no_gplpass on both GPUs below, exceptagc_driver_stencil_ref_exportskipped on the RTX 3080 (noVK_EXT_shader_stencil_export). Results are identical on fix(recompiler): exempt proven control conditions and own-bit ballots in stencil replay #9317 and on this change.Not run: the Khronos validation layer (not installed on this host, so
VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validationhas nothing to load; neither log contains aVUID-line), a title.tools/check_conventions.py --base origin/mainpasses with no errors (its one warning,debt-lengthondocs/dev/debt/libSceAgcDriver.md, is in fix(recompiler): exempt proven control conditions and own-bit ballots in stencil replay #9317's entry, which this PR does not touch) andgit diff --checkpasses.tools/pr_overlap.pywas not run (noghon this host).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)1002:164e), 32.0.21045.5002, Windows 10 22H2🤖 Generated with Claude Code