Repository navigation
fix(recompiler): accept optional-body merges implied by the skip predicate in stencil replay - #9393
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.
|
|
Independent Windows run of this PR (data only). Environment: Windows 10 Pro 10.0.19045, Ryzen 7 5800X3D, WinLibs GCC 15.2.0 r7 (MinGW-w64 UCRT), Release, BUILD_TESTING=ON. Merge-tree of the PR head against PR head tested: Results (3 runs each):
GPU: the run output has no Not run: other platforms, the other tests in the same family, the full repository CTest, and any title or console run. AI-assisted (Claude Code). |
MarcZX10
left a comment
There was a problem hiding this comment.
The new inactiveEquals case is narrowly guarded by IrType::Bool, predicate identity, and GuardImplies, and the positive/negative regression cases are useful. I built agc_masked_select_tests on this head and ran agc_masked_select three times; all three passed. As a local paired check, I applied only the new test hunk to current main: the suite failed on the expected “own bit of the predicate's ballot” case. tools/check_conventions.py --base upstream/main and git diff --check also pass.
I cannot approve yet because the change still needs the repository-required follow-up:
- Current
mainis5a79f26450; this head is 442 commits behind. Please rebase and refresh the conventions and overlap checks. - This is a shader-recompiler change. The PR report says the Khronos validation layer was unavailable, so the required paired GPU run with
ANYPS5_REQUIRE_VULKAN=1,ANYPS5_NO_SHADER_CACHE=1, andVK_LAYER_KHRONOS_validationhas no VUID comparison. Please rerun the focused main/change tests with the layer and report GPU/driver details and VUID differences. The local unit test above is host-only; I could not run GPU tests here. - The refreshed overlap scan finds direct
inactiveEqualsoverlap with open #9317. Please coordinate with that author and agree order/composition, then setDepends onaccurately. The overlap tool could not compare #6879’sMaskedSelect.cpp; I manually confirmed it also adds tests in this file, so please refresh that test-area comparison after rebase. - The Tested section says the Onimusha shader still stops at
quadObservedand explicitly relies on the separate #9394 change. Please keep the title result scoped to the combined changes and coordinate the dependency/order with #9394 so the checklist and unblocks claim reflect what is actually required.
Hosted eligibility, conventions, intake, labels, and report checks pass; product build jobs were skipped. The local focused test and author/independent Windows reports are positive evidence, but the Vulkan validation-layer requirement and current-main/overlap updates remain outstanding.
61d4817 to
5844ac9
Compare
|
Paired run with the Khronos validation layer (@MarcZX10's request), 2026-10-23. Layer:
AI-assisted: yes (Claude Code). |
…icate in stencil replay An EXEC- or VCC-skipped optional body is accepted when every merge phi's value from the body equals the skipped value on lanes inactive in the body. A body value that implies the skip predicate is false on every inactive lane, so it equals the skipped value when that value is the predicate itself. inactiveEquals now accepts that case, which covers a lane's own bit of a ballot of the predicate merged with the predicate. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
5844ac9 to
bf0589e
Compare
Dismissing a stale review: the requested changes were addressed after it (new head) and the merge queue blocks on it. Please request changes again if anything is still open.
|
Checked the |
What
On devices without
VK_EXT_shader_stencil_export,MaskReplaySafety::optionalBodyaccepts an EXEC- or VCC-skipped body when every merge phi's value from the body equals the skipped value on lanes that are inactive in the body (inactiveEquals). Lanes are inactive in the body exactly where the skip predicatePis false.A body value that implies
Pis false on every inactive lane. When the phi's skipped value isPitself, that is also false there, so the two are equal on inactive lanes.inactiveEqualsnow accepts a Bool body valuevwhen the skipped value is the predicate andGuardImplies(v, P)holds. The case that needs it is a lane's own bit ofBallot(P)(optionally intersected with a whole-quad active mask) merged withP: Onimusha: Way of the Sword (PPSA27836) has this as the "lane is done" flag of its stencil-exporting pixel shader, merged after ans_cbranch_execzbody.The existing rules (same value, select on the predicate, region phis) are unchanged.
This branch is rebased onto
main570089a80, which now carries #9317 (merged asdef1f5dd9); the diff is this PR's own commit (one line ininactiveEqualsand two test cases).Tested
Rebased 2026-10-26: on this head
bf0589e28(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 on a single-block EXEC-skipped body: merging a lane's own bit ofBallot(P)from the body withPfrom the skip is replay-safe; merging!P(true on inactive lanes) 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 lane's own bit of the predicate's ballot with the skipped predicate) and the second passes; 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: without this rule block 0's merge phi of the "done" flag refuses ininactiveEquals; with it, that phi is accepted. The request still needs the ballot exemption I asked about on fix(recompiler): exempt proven control conditions and own-bit ballots in stencil replay #9317 and a change for an early exit inside the optional body before it passes (details on fix(recompiler): exempt proven control conditions and own-bit ballots in stencil replay #9317), so no title is claimed.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