Skip to content

fix(shader): mask writes after barrier-safe BDA faults - #7392

Open
MarcZX10 wants to merge 3 commits into
boykopovar:mainfrom
MarcZX10:codex/bda-barrier-write-mask-6689-current
Open

MarcZX10 wants to merge 3 commits into
boykopovar:mainfrom
MarcZX10:codex/bda-barrier-write-mask-6689-current

Conversation

@MarcZX10

Copy link
Copy Markdown
Contributor

What

Keep compute invocations participating in s_barrier after a BDA read fault, while recording the fault per lane and suppressing that lane's later writes, atomics and exports. The checked BDA read result is propagated back to the correct lane half. The regression tests cover all-fault and mixed valid/faulting lanes around a barrier. Hull and mesh barrier handling remains outside this change and is recorded in shader technical debt.

This is stacked on #6416. Its original fault-lane commit and the follow-up author's commit remain attributed to their respective authors.

Tested

  • The prepared branch passed the full Windows build and focused BDA span-read/faulting-wave tests. Five fresh runs passed on each GPU with the shader cache disabled; the results are recorded in issue #6689.
  • GPUs: NVIDIA GeForce RTX 5080, driver 610.62 / 32.0.16.1062, Windows 11 Enterprise build 26200; AMD Radeon(TM) Graphics (1002:13c0), driver 32.0.21036.18, Windows 11 Enterprise build 26200.
  • After rebasing onto current main (3de84fa1), git diff --check and python3 tools/check_conventions.py --base upstream/main pass. The runtime tests were not rerun after the rebase.
  • Compile time for a representative very large barrier compute shader has not been measured; the generated per-lane write mask may affect compile time. No performance claim is made.

Checklist

@github-actions github-actions Bot added shader core/shader docs agc libSceAgc* labels Oct 18, 2026
@github-actions

github-actions Bot commented Oct 18, 2026 •

Copy link
Copy Markdown

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.

Pull request Shared files not compared
PR 5021 core/shader/recompiler/SpirvBackend/include/SpirvBackend/SpirvEmitterState.hpp
core/shader/recompiler/SpirvBackend/src/SpirvEmitter.cpp
core/shader/recompiler/SpirvBackend/src/SpirvFlowEmitter.cpp
docs/dev/debt/shader.md
PR 5371 docs/dev/debt/shader.md
PR 6235 docs/dev/debt/shader.md
PR 6280 docs/dev/debt/shader.md
PR 6412 docs/dev/debt/shader.md
PR 6488 core/shader/recompiler/SpirvBackend/src/SpirvEmitter.cpp
docs/dev/debt/shader.md
PR 6924 docs/dev/debt/shader.md
PR 7085 docs/dev/debt/shader.md
PR 7223 docs/dev/debt/shader.md
PR 7395 docs/dev/debt/shader.md
PR 7410 core/shader/recompiler/SpirvBackend/src/SpirvFlowEmitter.cpp
docs/dev/debt/shader.md
PR 7642 core/shader/recompiler/SpirvBackend/include/SpirvBackend/SpirvEmitterState.hpp
core/shader/recompiler/SpirvBackend/src/SpirvBdaFault.cpp
core/shader/recompiler/SpirvBackend/src/SpirvEmitter.cpp
core/shader/recompiler/SpirvBackend/src/SpirvFlowEmitter.cpp
PR 7684 docs/dev/debt/shader.md
PR 8004 core/shader/recompiler/SpirvBackend/include/SpirvBackend/SpirvEmitterState.hpp
core/shader/recompiler/SpirvBackend/src/SpirvEmitter.cpp
docs/dev/debt/shader.md
PR 8458 docs/dev/debt/shader.md
PR 8939 docs/dev/debt/shader.md
PR 9020 docs/dev/debt/shader.md
PR 9183 docs/dev/debt/shader.md
PR 9335 docs/dev/debt/shader.md
PR 9356 core/shader/recompiler/SpirvBackend/include/SpirvBackend/SpirvEmitterState.hpp
core/shader/recompiler/SpirvBackend/src/SpirvEmitter.cpp
PR 9387 core/shader/recompiler/SpirvBackend/include/SpirvBackend/SpirvEmitterState.hpp
core/shader/recompiler/SpirvBackend/src/SpirvEmitter.cpp
docs/dev/debt/shader.md
PR 9457 docs/dev/debt/shader.md
PR 9508 core/shader/recompiler/SpirvBackend/include/SpirvBackend/SpirvEmitterState.hpp
core/shader/recompiler/SpirvBackend/src/SpirvBdaFault.cpp
core/shader/recompiler/SpirvBackend/src/SpirvEmitter.cpp
core/shader/recompiler/SpirvBackend/src/SpirvFlowEmitter.cpp
PR 9633 docs/dev/debt/shader.md
PR 9671 docs/dev/debt/shader.md
PR 9748 docs/dev/debt/shader.md
PR 9749 docs/dev/debt/shader.md
PR 9790 core/shader/recompiler/SpirvBackend/include/SpirvBackend/SpirvEmitterState.hpp
core/shader/recompiler/SpirvBackend/src/SpirvBdaRead.cpp
docs/dev/debt/shader.md
PR 9889 docs/dev/debt/shader.md
PR 9969 core/shader/recompiler/SpirvBackend/include/SpirvBackend/SpirvEmitterState.hpp
core/shader/recompiler/SpirvBackend/src/SpirvBdaRead.cpp
docs/dev/debt/shader.md
PR 10000 docs/dev/debt/shader.md
PR 10193 core/shader/recompiler/SpirvBackend/include/SpirvBackend/SpirvEmitterState.hpp
core/shader/recompiler/SpirvBackend/src/SpirvBdaFault.cpp
core/shader/recompiler/SpirvBackend/src/SpirvEmitter.cpp
core/shader/recompiler/SpirvBackend/src/SpirvFlowEmitter.cpp
PR 10233 docs/dev/debt/shader.md
PR 10351 core/shader/recompiler/SpirvBackend/include/SpirvBackend/SpirvEmitterState.hpp
PR 10489 docs/dev/debt/shader.md
PR 10556 docs/dev/debt/shader.md
PR 10652 core/shader/recompiler/SpirvBackend/include/SpirvBackend/SpirvEmitterState.hpp
core/shader/recompiler/SpirvBackend/src/SpirvEmitter.cpp
docs/dev/debt/shader.md
PR 10867 core/shader/recompiler/SpirvBackend/src/SpirvEmitter.cpp
docs/dev/debt/shader.md
PR 11265 core/shader/recompiler/SpirvBackend/src/SpirvFlowEmitter.cpp
PR 11351 core/shader/recompiler/SpirvBackend/include/SpirvBackend/SpirvEmitterState.hpp
core/shader/recompiler/SpirvBackend/src/SpirvEmitter.cpp
PR 11483 core/shader/recompiler/SpirvBackend/include/SpirvBackend/SpirvEmitterState.hpp
core/shader/recompiler/SpirvBackend/src/SpirvEmitter.cpp
docs/dev/debt/shader.md
PR 11557 docs/dev/debt/shader.md
PR 12132 docs/dev/debt/shader.md
PR 12316 docs/dev/debt/shader.md
PR 12458 docs/dev/debt/shader.md
PR 12548 core/shader/recompiler/SpirvBackend/src/SpirvFlowEmitter.cpp
docs/dev/debt/shader.md
PR 12662 core/shader/recompiler/SpirvBackend/include/SpirvBackend/SpirvEmitterState.hpp
core/shader/recompiler/SpirvBackend/src/SpirvEmitter.cpp
docs/dev/debt/shader.md
PR 12764 core/shader/recompiler/SpirvBackend/include/SpirvBackend/SpirvEmitterState.hpp
core/shader/recompiler/SpirvBackend/src/SpirvBdaFault.cpp
core/shader/recompiler/SpirvBackend/src/SpirvEmitter.cpp
core/shader/recompiler/SpirvBackend/src/SpirvFlowEmitter.cpp
docs/dev/debt/shader.md
PR 12790 docs/dev/debt/shader.md
PR 12840 core/shader/recompiler/SpirvBackend/include/SpirvBackend/SpirvEmitterState.hpp
PR 12944 core/shader/recompiler/SpirvBackend/src/SpirvEmitter.cpp
docs/dev/debt/shader.md
PR 12980 core/shader/recompiler/SpirvBackend/include/SpirvBackend/SpirvEmitterState.hpp
core/shader/recompiler/SpirvBackend/src/SpirvEmitter.cpp
docs/dev/debt/shader.md
PR 13928 core/shader/recompiler/SpirvBackend/include/SpirvBackend/SpirvEmitterState.hpp
core/shader/recompiler/SpirvBackend/src/SpirvBdaFault.cpp
core/shader/recompiler/SpirvBackend/src/SpirvEmitter.cpp
core/shader/recompiler/SpirvBackend/src/SpirvFlowEmitter.cpp
PR 13929 core/shader/recompiler/SpirvBackend/include/SpirvBackend/SpirvEmitterState.hpp
core/shader/recompiler/SpirvBackend/src/SpirvBdaFault.cpp
core/shader/recompiler/SpirvBackend/src/SpirvEmitter.cpp
core/shader/recompiler/SpirvBackend/src/SpirvFlowEmitter.cpp
PR 14068 docs/dev/debt/shader.md
PR 14072 docs/dev/debt/shader.md
PR 14081 docs/dev/debt/shader.md
PR 14085 docs/dev/debt/shader.md
PR 14212 docs/dev/debt/shader.md
PR 14217 core/shader/recompiler/SpirvBackend/include/SpirvBackend/SpirvEmitterState.hpp
core/shader/recompiler/SpirvBackend/src/SpirvEmitter.cpp
docs/dev/debt/shader.md
PR 14218 core/shader/recompiler/SpirvBackend/include/SpirvBackend/SpirvEmitterState.hpp
core/shader/recompiler/SpirvBackend/src/SpirvEmitter.cpp
core/shader/recompiler/SpirvBackend/src/SpirvFlowEmitter.cpp
docs/dev/debt/shader.md
PR 14247 docs/dev/debt/shader.md
PR 14260 core/shader/recompiler/SpirvBackend/include/SpirvBackend/SpirvEmitterState.hpp
core/shader/recompiler/SpirvBackend/src/SpirvBdaRead.cpp
PR 14265 docs/dev/debt/shader.md
PR 14341 core/shader/recompiler/SpirvBackend/include/SpirvBackend/SpirvEmitterState.hpp
PR 14377 docs/dev/debt/shader.md
PR 14627 docs/dev/debt/shader.md
PR 14628 docs/dev/debt/shader.md
PR 14633 docs/dev/debt/shader.md
PR 14636 docs/dev/debt/shader.md
PR 14692 docs/dev/debt/shader.md
PR 14708 core/shader/recompiler/SpirvBackend/src/SpirvFlowEmitter.cpp
PR 14793 docs/dev/debt/shader.md
PR 14795 docs/dev/debt/shader.md
PR 14821 docs/dev/debt/shader.md
PR 14853 docs/dev/debt/shader.md
PR 14866 core/shader/recompiler/SpirvBackend/src/SpirvBdaRead.cpp
PR 14871 docs/dev/debt/shader.md
PR 14888 docs/dev/debt/shader.md
PR 14900 docs/dev/debt/shader.md
PR 14904 docs/dev/debt/shader.md
PR 14909 core/shader/recompiler/SpirvBackend/include/SpirvBackend/SpirvEmitterState.hpp
docs/dev/debt/shader.md
PR 14913 docs/dev/debt/shader.md

@DavidAmsellem

Copy link
Copy Markdown
Contributor

This PR fails two tests that pass on main, and it is not vendor specific: it also fails on
lavapipe, which is what CI runs.

Built 1c5a918bc merged into main 0bc3003f8, Release, BUILD_TESTING=ON, Linux Mint 22.3
(Ubuntu 24.04 base), GCC 13.3, on an RX 7900 XT (RADV NAVI31, Mesa 25.2.8).

test main main + this PR
agc_shader_memory passes 3 of 3 fails 3 of 3
agc_driver_bda_span_reads passes 3 of 3 fails 3 of 3

Messages:

agc_shader_memory:          BDA read functions: a read site does not call its span read function once
agc_driver_bda_span_reads:  AGC graphics: BDA span reads: no unmapped fault report

agc_driver_bda_span_reads also reports, before that line:

BDA fault span wave32       coherent=0 barrier=0 changed=0 refused=1
BDA fault span wave64       coherent=0 barrier=0 changed=0 refused=1
BDA fault span wave64-split coherent=0 barrier=0 changed=0 refused=1

Both failures reproduce with ANYPS5_GPU=llvmpipe on the same build, so this is independent of the
driver rather than an AMD difference.

For completeness: this machine has no read-write access to /dev/udmabuf, so the run prints the
usual permission line and agc_driver_guest_memory_lifetime_direct fails here on main too. That
is unrelated: both tests above pass on plain main in exactly the same environment.

AI-assisted (Claude Code).

@wachi35676

Copy link
Copy Markdown
Contributor

Tested at 1c5a918bc on Windows 11 (GCC 15.2.0, Release), on an RTX 5070 Ti (617.42) and an AMD Radeon iGPU, RDNA2 (1002:13c0, 32.0.21042.62, ANYPS5_GPU=AMD). Two tests fail with this PR on both GPUs, both merged onto main 9f25d0bf5 and on the PR's own base 3de84fa10:

  • agc_shader_memory: BDA read functions: a read site does not call its span read function once
  • agc_driver_bda_span_reads: AGC graphics: BDA span reads: no unmapped fault report: (empty); it passed 0 of 5 runs on each GPU.

By commit:

Commit Result
3de84fa10 (base) both pass
451a8a201 (#6416's commit) both pass, plus agc_driver_faulting_wave_invocation
ac131aba9 (mask barrier compute writes after BDA read faults) both fail
1c5a918bc (head) both fail

The last case printed before the span failure is wave32 barrier=1 or wave64-mixed barrier=1 on NVIDIA, and wave64-split barrier=0 on AMD.

Minor: the debt entry is under "Unknown function info" rather than "Functional".

AI-assisted: yes (Claude Code); results above were run on this machine.

@github-actions github-actions Bot added the needs rebase Conflicts with main, rebase needed label Oct 19, 2026
@blawesom

Copy link
Copy Markdown
Contributor

Rebase handoff — rebased onto current main (all three commits, authorship unchanged). One docs-debt conflict, unioned.

Verified on Linux (CachyOS, kernel 7.2.9, GCC 16.2.1, Ninja, Release, BUILD_TESTING=ON, AMD RX 9070 XT / RADV): builds; conventions pass; full suite green apart from the four known main regressions (#5444 Mesa, #7584 BDA, #7766, #7784), none from this PR.

To pick it up:

git fetch https://github.com/blawesom/AnyPS5 rebase/7392
git checkout <your branch>
git merge --ff-only FETCH_HEAD

Head is 27d15fb7e.

@blawesom

Copy link
Copy Markdown
Contributor

One note on the handoff: agc_shader_memory (a read site does not call its span read function once) and agc_driver_bda_span_reads (no unmapped fault report) fail on the rebased head — and fail identically on your own unrebased head, so they are the branch's own state, not the merge: the barrier-masking changes the read-fault path makes appear to change the span-call pattern the test counts and the fault-report case the span test expects. Everything else is green apart from the four known main regressions (#5444 Mesa, #7584 BDA, #7766, #7784). The handoff branch is still up for the rebase value with this caveat.

@MarcZX10

Copy link
Copy Markdown
Contributor Author

Thanks for the rebase handoff and the follow-up that pins these failures to the PR’s own change. I confirm the two cases are still unresolved: agc_shader_memory expects one span-read call and agc_driver_bda_span_reads expects the unmapped-fault report, and they fail on the reported PR heads while passing on main. I won’t treat the clean remainder of the suite or the rebase as resolving them; the change needs to preserve the barrier-safe write masking while restoring those read-path expectations.

@oneandonlydean oneandonlydean self-assigned this Oct 20, 2026
@MarcZX10

Copy link
Copy Markdown
Contributor Author

Review status: the reported #7392 head 1c5a918bc5 is still known to fail agc_shader_memory and agc_driver_bda_span_reads on NVIDIA, AMD, and lavapipe, while the reported base passes. The rebase handoff at 27d15fb7e carries the same failures, so rebasing alone does not resolve them. Issue #6689 documents a different follow-up commit 21745fa223 with all-fault and mixed-lane tests reported passing 5/5 on RTX 5080 and AMD, but that evidence is from an older main and the compile-time cost remains unmeasured. I recommend holding merge until a corrected series passes both regressions on current main and reports the barrier-shader compile impact. No commits were added or pushed in this update.

@oneandonlydean

Copy link
Copy Markdown
Collaborator

Thanks for this. The branch conflicts with main only in docs/dev/debt/shader.md, where main added two entries next to your new "BDA read faults" entry. We'll merge current main into the branch ourselves, keeping both sides, so there's nothing to do for that.

One question on 1c5a918: the mixed valid/faulting barrier cases now run only when the device's native subgroup size is exactly 32, so they're also skipped on 64-wide hosts (RADV's default compute subgroup), not only on narrower ones. Is that intended, i.e. does the mixed layout assume 32 lanes? If they hold at 64, >= 32 would keep them running on AMD hardware.

@oneandonlydean

Copy link
Copy Markdown
Collaborator

We reproduced both failures on an RTX 4090 with this branch on current main (main alone passes 16/16), and narrowed them down in case it helps the corrected series:

  • agc_shader_memory fails with "a read site does not call its span read function once". It passes again with ac131ab's barrierCompute masking switched off, so that new rule is the cause.
  • agc_driver_bda_span_reads fails in its wave64 non-coherent barrier case: a wave64 barrier program on a 32-lane host gets no "BDA access failed" report at all. It still fails with the masking switch off, so this one is in the spanned-wave fault path, not the switch.

@github-actions github-actions Bot removed the needs rebase Conflicts with main, rebase needed label Oct 20, 2026
@MarcZX10

Copy link
Copy Markdown
Contributor Author

Thanks for reproducing this on the RTX 4090 and separating the two failures. The barrierCompute mask accounts for the agc_shader_memory call-count regression, while the wave64-on-32-lane agc_driver_bda_span_reads report is independent and still missing with that switch off. Since the base passes and this head fails both cases, I agree this head needs a corrected series before it can be considered validated. Please keep the second failure in scope when updating the PR; the current focused pass on the original GPU set does not cover these newer regressions.

@MarcZX10

Copy link
Copy Markdown
Contributor Author

The mixed control expects valid lanes to write their two output dwords and faulting lanes to leave theirs unchanged; RunFault compares the whole buffer against that per-work-item expectation. The native.subgroupSize == 32 gate was intended to exercise the special wave64-on-32-host spanned case, not because the address pattern itself requires 32 lanes. I agree it unnecessarily skips the native 64-lane-host case; that case should also run (with >= 32). I have not changed the test on this already-failing head, so the expansion still needs to be included and validated with the corrected series.

@MarcZX10

Copy link
Copy Markdown
Contributor Author

Thanks, these current-main repros are useful. The 32-only gate was conservative because the fixture uses a 32-lane guest wave; I do not have evidence that the mixed-lane case requires a native 32-lane subgroup, so I can’t justify claiming wave64 coverage from the current test. Separately, both agc_shader_memory (introduced by barrier-write masking) and the wave64 agc_driver_bda_span_reads failure remain real blockers even though the second reproduces with that switch disabled. I’m keeping the PR unready until the corrected series preserves the main behavior and reports the fault on the spanned-wave path; I won’t treat the existing passing subset as sufficient.

@cookie42073-cmd

Copy link
Copy Markdown
Contributor

Hey @MarcZX10, I’m starting a Windows repro of the two failures on 4b76e2c1d6644985ea78a5134a63cc8dca64eddb, using an RTX 4070 SUPER and a pinned current-main control. I’ll check the span-read call-count regression and the missing wave64 fault report separately, then share the patch and before/after logs here if I can verify a correction.

Have you already started a corrected series? I’ll keep this work with #7392 rather than opening a competing PR, preserve the existing commit authors, and keep #6416 as the declared prerequisite. I also saw @Celegans12’s separate spanned-wave masking follow-up on #6416; I’ll flag any overlap before proposing changes to that path.

No fix or game result is being claimed yet. AI-assisted investigation and independent review.

@MarcZX10

Copy link
Copy Markdown
Contributor Author

I have not started a corrected series. Please continue the focused repro on this PR and keep #6416 as the prerequisite; I will avoid a competing fix while you investigate. The separate span-read call-count and wave64 fault-report paths should stay isolated as you described.

@cookie42073-cmd

Copy link
Copy Markdown
Contributor

Hey @MarcZX10, I reproduced both failures and have a separate test-only correction for each.

  • agc_shader_memory was counting the old non-stopping helper in the barrier fixture. The emitter now calls the fault-returning _stop helper there. The correction keeps the five-call/two-adjacent-span checks, coherence, CAS and size checks, and checks that barrier main has only its final return.
  • On both GPUs here, the missing span-test report comes from repeated-message coalescing: three identical reports print within ten seconds, then later ones are suppressed. The original wave64 barrier and coherent wave32 cases both report correctly in isolation. Giving each control a distinct fault PC with bounded s_nop padding fixes that observation without changing its input/output memory addresses. Each report must identify that case, and the whole 64 KiB output comparison and mixed 32-valid/32-faulting layout remain checked. The mixed controls now admit native subgroups >= 32, as discussed above.

Tested against main 0c50cbf3e4a99e93389368e1e72a0d365cff3992 plus PR head 4b76e2c1d6644985ea78a5134a63cc8dca64eddb:

Windows 11 Pro 26300 Original PR: the two reported tests Corrected focused set
RTX 4070 SUPER, NVIDIA 617.42, subgroup 32 both fail 7/7 pass
Intel UHD 770, driver 101.7088, subgroup 32 both fail 4/4 pass

Each corrected test also passed five fresh-process runs on each GPU: 20/20 test executions, with all 12 fault controls showing zero wrong output dwords every run. Vulkan was required, the AnyPS5 shader cache was disabled, and the requested Khronos validation layer actually loaded; neither side reports a VUID. APS5_SPANNED_WAVE was unset.

As a negative control, disabling barrierCompute makes both corrected tests fail: all 12 fault reports are still observed, but 8 barrier programs wrongly store output (128 dwords for all-fault cases, 64 for mixed). I restored the production source, checked its bytes and rebuilt before the final runs.

Full Windows builds of pinned main, the original PR integration and the corrected integration passed with the same separate alignment workaround for ImageArrayWindowPastLayerLimit.cpp. Untouched main fails that fixture's alignas(65536) on WinLibs; the workaround is included separately for reproducibility and is absent from these two correction commits. Conventions and whitespace checks pass. The full CTest suite was not run.

Patch commits, authored as Blazing Cook:

  • e2227345e75092c40ce07b59eb5ef685b9fcbb59
  • 38f507ceb6031b756ed2876dce035245f5395e1d

The format-patches and combined diff apply cleanly to exact PR head 4b76e2c1. This handoff builds on Celegans12's and Amoenus's implementation and your fixture work; #6416 remains the prerequisite. Independent review covered the source, raw logs and final package.

The representative large-barrier compile-time check is still open. I couldn't locate a public replay attachment in the checked sources. Could someone share a reduced barrier+BDA replay request, or run an A/B on an existing request and report exact commits, GPU/driver, preparation time, SPIR-V words and cold pipeline compilation/cache controls? Native64, AMD, other platforms and title validation also remain open; no title-unblock or performance claim is made. At the final overlap check, f894ba69 adds cache-path housekeeping and unrelated library/tool fixes; neither corrected fixture nor the barrier fault-mask source changed. Results above are for the pinned 0c50cbf3 integration.

Public log copies replace local filesystem prefixes with placeholders; the private originals are retained. The archive records public-entry hashes and raw/public provenance hashes.

AI-assisted: yes.

AnyPS5-7392-tests-and-evidence-20261021.zip
ZIP SHA256: 0856cb1607fbf8ed298121a94e2f856580c6e22fa64cc9ac3bfbc5bc890eafc2

@Alexius0815

Copy link
Copy Markdown
Contributor

@MarcZX10 a compile-time measurement for the open point in your Tested section ("Compile time for a representative very large barrier compute shader has not been measured"). For this shader the PR makes the back-end compile much faster, not slower.

Shader. vkQuake (PPSA99010) compute 0x20bf7f400: 2748 code words, wave64, 14 barriers, 211 device stores. This is the kernel that keeps MoltenVK in the Metal compiler for over a minute (see #1). I saved its request with APS5_DUMP_SHADERS and replayed the same .req with agc_shader_replay --spv twice, on the community macOS stack before and after cherry-picking this PR's three commits (451a8a2, ac131ab, 1c5a918). Both SPIR-V outputs went through SPIRV-Cross (--msl --msl-version 30100). I timed them with the system Metal compiler through MTLDevice, the same MTLCompilerService MoltenVK uses, on an Apple M4 (macOS 27.2):

SPIR-V words MSL lines return; if library specialization pipeline
before 402,163 32,740 904 2,595 9.8 s 4.7 s 69.0 s (78.8 s on a repeat)
with #7392 407,238 31,776 0 1,901 10.0 s 5.1 s 27.5 s
with #7392, same MSL again 0.0 s 0.0 s 0.0 s
  • The early exits after record_bda_fault are what costs the Metal back end. I tested two measurement-only arms on an earlier extraction of the same kernel from the shader cache (413k words, 63–81 s pipeline):
    • removing only the NaN-result selects (1,582 of them, in the spirit of macOS support #1's NaN discussion): the pipeline step stayed at 68 s;
    • removing the fault calls and exits by hand: 18 s.
  • Before the PR, macOS never served this pipeline from its Metal cache: every repeat took 64–81 s again. With the PR, the second compile of the same MSL came entirely from the cache. I don't know why the larger build isn't cached; size or compile time limits would be my guess.
  • In a guarded title run on the stack with these three commits, the second start still showed the AGC thread in MoltenVK's newMTLComputePipelineState at 8 and 12 s. So MoltenVK's own build of this kernel did not hit the cache that my standalone compile hit, possibly because its MSL or pipeline descriptor differs. I'm looking into that separately. It doesn't change the comparison above.

I only measured compile time and didn't check the PR's fault semantics. Replay tool, scripts and timings are on the M4 if you want any other variant measured.

AI-assisted: yes

@cookie42073-cmd

Copy link
Copy Markdown
Contributor

Hey @Alexius0815, thanks for running this. The 69–79 s versus 27.5 s pipeline result is useful evidence for the open compile-time check.

Could you share the retained replay request and timing scripts, or an original/shareable reduced request that exercises the same barrier+BDA path? To make a matched comparison, these details would help:

  • Full before/after Git revisions, the community macOS stack/local patches, and the replay, SPIRV-Cross and MoltenVK versions/options.
  • The request's SHA256 and exact replay/compiler commands, keeping wave-spanning, optimization and pipeline/specialization settings the same between arms.
  • A few sequential, alternating before/after runs, with the fresh-process/cold-cache procedure recorded. Please keep preparation time, SPIR-V word count, library/specialization time and pipeline time separate. If a cache can't be isolated, stating what was controlled is useful too; the 0.0 s warm result can stay separate.

A shareable request would let us try the same input on our NVIDIA/Intel setup and compare with your Metal measurements. We'll keep the existing Windows fault-correctness results separate from compile performance. Your actual MoltenVK cache investigation already has an owner, so any help from us can stay coordinated here.

AI-assisted: yes.

@cookie42073-cmd

Copy link
Copy Markdown
Contributor

Quick refresh on the two test corrections: they still fix both reported failures on main 9d3becbe517b285a4554b40d84aeacfe2398c62a plus this PR's unchanged 4b76e2c1 head.

Windows 11 Pro 26300 Main focused set Original PR: reported tests Corrected focused set
RTX 4070 SUPER, NVIDIA 617.42, subgroup 32 6/6 both fail 7/7
Intel UHD 770, driver 101.7088, subgroup 32 3/3 both fail 4/4

Each corrected test also passed five fresh-process runs on each GPU: 20/20 test executions, with all 12 fault controls visible and no wrong output every run. Both GPUs reject the masking-off negative control: 8 barrier cases write incorrect output while every fault report stays visible. Production source bytes were restored and verified before the final rebuild/runs.

All three source compositions passed the full default Windows build. Upstream now includes the alignment fixture change, so this refresh needs no local build workaround. Vulkan was required, the shader cache disabled and the requested Khronos validation layer actually loaded; no VUID/SYNC-HAZARD lines or skips in the focused runs. The full CTest suite was not run.

Refreshed commits are 3701f884854a9906fae310ec3467e750c152fa16 and 9cef69af1195f06f34b39b4f5b163697754c7656. Their patch IDs match the earlier two corrections, preserving Blazing Cook authorship; they change only the same two test files and still apply to exact 4b76e2c1. Celegans12, Amoenus and MarcZX10 retain implementation credit, and #6416 remains the prerequisite. Independent review covered the refreshed source, raw results and public package.

At the final upstream check, main had advanced to 7e69be6793 with CommonDialog and export-overlap tooling changes only; the tested shader/driver paths are unchanged from the pinned 9d3becbe matrix above.

AMD/native64, other platforms and title validation remain untested here. Alexius's Metal timing/replay follow-up is separate; these runs make no new compile-performance or title-unblock claim. Public log copies normalize local paths; raw originals are retained. AI-assisted: yes.

AnyPS5-7392-refreshed-tests-and-evidence-20261022.zip
ZIP SHA256: d6bfbb4a1a0976d59be6a6a76638303ac61d72ee1083f0bf6324dd8e242683ed

@Alexius0815

Copy link
Copy Markdown
Contributor

@cookie42073-cmd thanks, here is the material. The attached vkquake-bda-7392.zip contains:

  • the saved request (shader_20bf7f400.req, SHA-256 7899099058d03e11411dfabdd929d78bfd2745dd8d79b545c9d242b6c0c6df1c);
  • the SPIR-V and MSL of both arms;
  • the scripts;
  • timings.tsv, every run in execution order with its method;
  • a README with revisions, origin, commands and SHA-256 sums.

Origin. The kernel is PS5_vkQuake 1.0's compute shader 0x20bf7f400, from https://github.com/mihawk-99/PS5_vkQuake (GPL-3.0-or-later; artifact SHA-256 matches the ps5-homebrew-catalog entry). The request holds that shader's code, a 40-byte descriptor and user data, with no game data. It was written by the community macOS stack in its request format 39, which carries meshAsCompute, so main's agc_shader_replay may not read it. That is why the SPIR-V of both arms is included.

Correction to my note above. "Before the PR, macOS never served this pipeline from its Metal cache" was wrong. Both arms come from the cache on a repeat. One repeat of the "before" MSL on the 22nd did miss it (78.8 s), and I don't know why. The PR doesn't change caching; the difference is the cold compile.

Pipeline step, by method. The README explains each and gives library and specialization times, which don't change.

A: unmodified MSL, first compile B: unique comment line, round 1 C: one literal changed (measurement only)
before 68.99 s 58.60 s 71.74 s
with #7392 27.50 s 27.63 s 26.02 s
  • In B the comment only changes the library key, so from round 2 on, specialization and pipeline came from the cache for both arms.
  • C changes the shader's semantics and only serves to get a cold specialization and pipeline.
  • I didn't measure preparation time.
  • The scripts in the ZIP have since been hardened: exit status, stop on write errors, UTC times and the SHA-256 of each compiled copy. They have no overall deadline. The runs above used their earlier versions.
  • MoltenVK is not involved in these numbers.

AI-assisted: yes
vkquake-bda-7392.zip

@Michael-KD

Copy link
Copy Markdown
Contributor

@MarcZX10, about the overlap with #11255: this PR adds the "BDA read faults" entry directly above "VCC-backed MIMG samplers" in docs/dev/debt/shader.md, and #11255 edits that VCC entry. Git reports a conflict, but the two edits are independent and neither PR needs the other.

My proposal is no fixed order: whichever lands second rebases and keeps both. If this one lands first, I'll rebase #11255 myself. Does that work for you?

@cookie42073-cmd

Copy link
Copy Markdown
Contributor

Got the Windows compile-only comparison for @Alexius0815's supplied SPIR-V pair. Both files compile on the RTX 4070 SUPER. Neither controlled Intel UHD 770 replay finished within the same 300-second limit.

Tool source: main e0b13f2990f31a949a6da21d81a7789ebdfeaa26, Windows 11 Pro 26300, WinLibs GCC 15.2.0 r7, Release with bundled SPIRV-Tools enabled. GPUs: NVIDIA RTX 4070 SUPER / 617.42 and Intel UHD 770 / 101.7088. The focused replay/dependency build passed. All six selected capture/replay tests plus the no-op fixture passed on each GPU, including a repeat after excluding implicit layers; no tests skipped. Khronos validation was actually loaded.

RTX 4070 SUPER, vkCreateComputePipelines seconds, median of three fresh-process calls per cell:

Application pipeline cache before.spv after-7392.spv
Fresh, no import 0.303395 0.214909
Imported from the preceding same-module call 0.284146 0.188948

Order alternated before/after, after/before, before/after. The driver had already seen both modules in the pilots. Driver caches remained uncontrolled, and these figures do not establish cold-driver compilation cost or a current-PR speedup. Imported cache files were checked against their own GPU/module export; the tool reports no cache-hit feedback flag. Module, layout, replay-total and process times are separate in the reports.

On Intel, the controlled before and after attempts each reached 300 seconds without emitting a timing report. A separate 20-second API-dump diagnostic on before.spv returned successfully from module/layout creation, then logged entry to vkCreateComputePipelines without a return before its deadline. That localizes the separate traced attempt; it does not turn either 300-second replay timeout into a measured pipeline duration or demonstrate a driver hang. I stopped the Intel matrix there.

The initial pilots had recording/overlay hooks inserted and are retained separately: NVIDIA 37.621/34.647 seconds for pipeline creation, and an Intel-before replay timeout. They are excluded from the table. The controlled trials used per-child VK_LOADER_LAYERS_DISABLE=~implicit~; explicit Khronos validation stayed loaded. There were no VUID/SYNC validation errors. Stale installed capture-manifest lookups still produced loader discovery errors, so the raw logs are not error-free. No global settings changed, and the timing change between campaigns is not attributed to hook removal.

The exact supplied shader bytes and original format-39 request remain unchanged. These are derived supplemental wrappers: set 0 storage buffers 59/60/61, count 1; push constants 0..128 bytes; uint32 specialization IDs 8241/8242/8243 all 0; subgroup 32; pipeline flags 16; stage flags 0. Those settings are explicit assumptions/defaults, not the original macOS capture. This uses the supplied translations, rather than regenerating them from the unpublished integration.

No shader dispatch, output correctness, gameplay, PS5, native Metal/MSL or CPU-preparation claim. No full default build/full CTest, AMD or other-platform run. Alexius supplied the artifacts; Celegans12, Amoenus and MarcZX10 retain implementation credit. I'm adding the Windows comparison. AI-assisted, with independent review of the raw results and final package.

Text-only evidence and portable wrapper maker

ZIP SHA-256: 52419e1010cfdd30a8330ab0b064ef1a9a026b31b9c37e0fca51119a108e6b8e. The archive contains normalized logs, receipts and scripts, with public payload hashes; it excludes shader binaries, captures, driver-cache payloads and executables. The wrapper maker was checked against both tested wrapper hashes using the existing original download.

An Intel run of this same pair on another driver would help narrow the remaining limit; the useful details are the exact driver, exit/timeout and API-phase log.

@MarcZX10

Copy link
Copy Markdown
Contributor Author

@Michael-KD that works for me: no fixed order, and whichever of #7392 and #11255 lands second rebases and keeps both entries in docs/dev/debt/shader.md. Thanks for offering to rebase #11255 if this one goes first; I will do the same for this PR if yours lands first.

@github-actions github-actions Bot added the needs rebase Conflicts with main, rebase needed label Oct 27, 2026
@MarcZX10
MarcZX10 force-pushed the codex/bda-barrier-write-mask-6689-current branch from 4b76e2c to 39a0161 Compare October 27, 2026 08:41
@github-actions github-actions Bot removed the needs rebase Conflicts with main, rebase needed label Oct 27, 2026
@TechLevelZero

Copy link
Copy Markdown
Contributor

❌ NVIDIA GPU test: failed

PR head 39a0161 merged onto main ba5b533 · tested 2026-10-29 17:38 UTC · 37 min

GPU NVIDIA RTX 2000 Ada Generation, driver 595.99.02, Vulkan 1.4.329
Host Ubuntu 26.04.1 LTS, kernel 7.0.0-38-generic, container ubuntu:24.04
Logs build and test logs for this run
Build ✅ passed (Release, -DANYPS5_ENABLE_SPIRV_TOOLS=ON)
Tests ❌ 2,206 passed · 9 failed (3 new: 1 pass on main with the PR's tests, 2 fail on main with the PR's tests too, 5 also fail on main, 1 unstable on main) · 39 skipped (ANYPS5_REQUIRE_VULKAN=1)
Test setup CPU-only tests without a GPU; GPU tests (and any CPU-only test that failed or skipped without one) once on the GPU with VK_LAYER_KHRONOS_validation and ANYPS5_NO_SHADER_CACHE=1; main ran the same way
Test selection 2,254 of 2,891 tests run: the ones this change can reach, chosen by tools/select_tests.py from main's build graph
Vulkan validation ✅ no new validation IDs vs main (856 tests run on the GPU)
Slow tests (>30 s, GPU tests timed with validation layers) none

Failing tests

This PR changes test files, so each failing test was also built and run on main with only the PR's test changes applied. ✅ there means the failure comes from the PR's other changes; ❌ means the test fails on main too, so this run does not show the PR caused it.

Test With this PR Same test on main ba5b533 (main + this PR's test changes only)
agc_driver_bda_span_reads ❌ failed ❌ also fails
agc_driver_bda_span_reads_draw_pipeline ❌ failed ❌ also fails
agc_shader_memory ❌ failed ✅ passed
agc_driver_bda_span_reads: Failed (also failed when re-run alone), assertion and diagnostics
ctest: Failed

[write-watch] host imports resolve write protection: no (0 of 4 scratch pages written after a GPU read, 0 after a GPU write, 4 after the import); imported ranges stay watched
BDA fault span wave32 coherent=0 barrier=0 changed=0 refused=1
BDA fault span wave64 coherent=0 barrier=0 changed=0 refused=1
BDA fault span wave32 coherent=0 barrier=1 changed=0 refused=1
AGC graphics: BDA span reads: no unmapped fault report: 
agc_driver_bda_span_reads_draw_pipeline: Failed (also failed when re-run alone), assertion and diagnostics
ctest: Failed

[write-watch] host imports resolve write protection: no (0 of 4 scratch pages written after a GPU read, 0 after a GPU write, 4 after the import); imported ranges stay watched
BDA fault span wave32 coherent=0 barrier=0 changed=0 refused=1
BDA fault span wave64 coherent=0 barrier=0 changed=0 refused=1
BDA fault span wave32 coherent=0 barrier=1 changed=0 refused=1
AGC graphics: BDA span reads: no unmapped fault report: 
agc_shader_memory: Failed (also failed when re-run alone), assertion and diagnostics
ctest: Failed

BDA read functions: a read site does not call its span read function once
Unstable on main (1, these also failed in recent main runs on this machine; not counted against this PR)
agc_driver_submit_progress: failed in 3 of the last 5 main runs
Failing on main too (5, not counted against this PR)
agc_compute_pipeline_inspection
agc_submit_progress
agc_submit_progress_no_timeline
guest_mmap_executable
guest_socket_options_multicast
Validation IDs already present on main (4 IDs in 404 tests)
VUID-VkDeviceCreateInfo-pNext-pNext (404 tests): agc_compute_pipeline_replay, agc_driver, agc_driver_address_passes, agc_driver_address_passes_draw_transitions, agc_driver_address_passes_targets_split, agc_driver_alpha_to_coverage, agc_driver_array_layer_target_cpu, agc_driver_bc_block_copy, and 396 more
VUID-vkCmdCopyImage-srcImage-01548 (11 tests): agc_driver_depth_clear_hle, agc_driver_depth_plane_buffer_memory, agc_driver_depth_plane_cpu_write_after_memo, agc_driver_depth_plane_cpu_write_after_page_unwatch, agc_driver_depth_plane_cpu_write_after_partial_unwatch, agc_driver_depth_plane_partial_store, agc_driver_depth_plane_partial_store_unimported, agc_driver_depth_storage_dispatch, and 3 more
VUID-vkCmdCopyImage-srcImage-01551 (11 tests): agc_driver_depth_clear_hle, agc_driver_depth_plane_buffer_memory, agc_driver_depth_plane_cpu_write_after_memo, agc_driver_depth_plane_cpu_write_after_page_unwatch, agc_driver_depth_plane_cpu_write_after_partial_unwatch, agc_driver_depth_plane_partial_store, agc_driver_depth_plane_partial_store_unimported, agc_driver_depth_storage_dispatch, and 3 more
VUID-VkPipelineColorBlendStateCreateInfo-pAttachments-00605 (2 tests): agc_driver_prepared_exports, agc_driver_srgb8_color_target
Skipped (39)
agc_driver_bda_reads_shadowed_results: skipped, the device reports watched host memory written when it imports or reads it
agc_driver_bda_reads_shadowed_results_per_build: skipped, the device reports watched host memory written when it imports or reads it
agc_driver_msaa_dcc_compared_import_2: skipped, the device reports host imports that keep write protection, so the write-watch probe compares none of them
agc_driver_msaa_dcc_compared_import_4: skipped, the device reports host imports that keep write protection, so the write-watch probe compares none of them
agc_driver_msaa_dcc_compared_import_8: skipped, the device reports host imports that keep write protection, so the write-watch probe compares none of them
agc_driver_sample_order_grid_reference: skipped, the device does not keep depth drawn at custom sample locations at those locations, even after a transition that names them: the composite of uniform renders holds the guest's depth in 0 of 3005 sloped samples, so no path can be compared with it bit for bit
agc_driver_sparse_dma_buf_import: skipped, host imports are unavailable: /dev/udmabuf is not accessible
agc_driver_stencil_ref_export: skipped, the device lacks VK_EXT_shader_stencil_export
agc_host_import_sparse: skipped, host imports are unavailable: /dev/udmabuf is not accessible
agc_import_settle_initial_dcc: skipped, the device has no deferred settle of host imports: imports under 1 MiB wait for one only on Windows
agc_unit_shadow_completion_store: skipped, the device reports watched host memory written when it imports or reads it
guest_net_ctl: skipped, the host has no IPv4 address
guest_video_out_color_space: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_hdr: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_high_frame_rate: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_output_mode: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_resolution_status: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_wqhd_detection: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
video_out_flip_controls: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_cpuflip: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_cpuflip_in_order: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_eop: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_eop_aftergpu: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_eop_main: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_fresh: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_labels: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SD
Reproduce
git fetch origin 39a016143547fd5d5ae866a78622240f58b0dcfd ba5b5330b37724bca4b99f30faab504653635a04
git checkout ba5b5330b37724bca4b99f30faab504653635a04 && git merge --no-ff 39a016143547fd5d5ae866a78622240f58b0dcfd
git submodule update --init --recursive
cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=ON -DANYPS5_ENABLE_SPIRV_TOOLS=ON
cmake --build build && cmake --build build --target libs
VK_DRIVER_FILES=/nonexistent/icd.json ctest --test-dir build -E '^(agc|shader|recompiler|videoout|video_out|guest_video_out|vulkan)|gpu' --timeout 120 --parallel 32 --output-on-failure
ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation \
  ctest --test-dir build -R '^(agc|shader|recompiler|videoout|video_out|guest_video_out|vulkan)|gpu' --timeout 120 --parallel 4 --output-on-failure
# failures are then re-run alone: --timeout 360 --parallel 2; new validation IDs: the test alone, twice, --parallel 1
# the failing tests, on this merge and on main:
ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation \
  ctest --test-dir build -R '^(agc_driver_bda_span_reads|agc_driver_bda_span_reads_draw_pipeline|agc_shader_memory)$' --parallel 1 -V

Automated build and test on a contributor's NVIDIA machine; it does not replace upstream CI. A new comment is posted for each new push. Full logs.

@cookie42073-cmd

Copy link
Copy Markdown
Contributor

Quick follow-up on today's NVIDIA report: I rechecked the two test corrections on current main bb04a4f1ea0175e9e4f149f0359a764d62ff3296 plus this PR's exact head 39a016143547fd5d5ae866a78622240f58b0dcfd, including the draw-pipeline variant this time.

Windows 11 Pro 26300, WinLibs GCC 15.2.0 r7, Release, bundled SPIRV-Tools enabled:

Same machine, fresh comparison Main focused set Main + submitted PR With the two test corrections
RTX 4070 SUPER, NVIDIA 621.01 / 32.0.16.2101, subgroup 32 7/7 5/8 8/8
Intel UHD 770, 32.0.101.7088, subgroup 32 7/7 5/8 8/8

The extra test in the PR arms is agc_driver_faulting_wave_invocation. Both GPUs reproduce the helper-count assertion in agc_shader_memory and missing fault reports in both agc_driver_bda_span_reads variants. These are the same test issues from the earlier handoff; the two span failures in today's CI also occur on main with the PR's tests, so I am not calling them a new production regression.

The first correction counts the fault-returning _stop helper in the barrier fixture and rejects early returns from its main function. The second gives each fault control a distinct instruction PC so repeated-message coalescing cannot hide it, verifies that exact PC/unmapped address, and keeps the complete output comparison. This refresh preserves your latest subgroupSize == 32 restriction and skip wording. It does not carry the older patch's widening to native64.

Each of the three regression tests also passed three fresh-process runs per GPU: 18/18 additional test executions. Each span fixture checked all 12 fault controls with zero wrong output dwords. With barrier write masking deliberately disabled, all three tests fail on both GPUs: every fault report is still observed, while eight barrier controls per span fixture write wrong output (128 dwords for all-fault cases, 64 for mixed). Exact production source bytes were restored, rebuilt, and the final 8/8 set passed again on both GPUs.

The full default Windows build passed for main, the submitted PR integration, the corrected integration and the restored final tree. FFmpeg reused the pinned prebuilt cache. Vulkan was required, the application shader cache disabled, implicit layers excluded per child, and Khronos validation actually loaded. No VUID/SYNC errors or selected-test skips. The full CTest suite was not run.

Refreshed test commits, authored as Blazing Cook:

  • cdacc28ac — helper expectation
  • a79da50c6442418a228ff61e4a1052dc23f826fc — distinct reports, retaining the current subgroup restriction

@MarcZX10, could you take these two test corrections into this PR when convenient? Celegans12, Amoenus and you retain implementation credit. #6416 remains the prerequisite; its separate performance hold is not addressed by these tests. No native64, AMD, other-platform, title-unblock or performance claim. The supplied-SPIR-V compile measurements remain a separate result.

AI-assisted: yes, with independent source and raw-log review. Public logs normalize local paths; private originals are retained. Final artifact hashes describe the restored arm; earlier-arm binaries were not retained.

AnyPS5-7392-current-tests-20261029.zip

ZIP SHA256: 4fcedf530cdf7acaededb2d09e6750389b8ee624a59df1dd713f72b65db2d48f

@github-actions github-actions Bot added the needs rebase Conflicts with main, rebase needed label Oct 30, 2026
@MarcZX10

Copy link
Copy Markdown
Contributor Author

Self-review — test corrections remain off-head

The new GPU report shows the current tests failing and the two supplied test corrections passing, but those corrections are not part of published head 39a016143547fd5d5ae866a78622240f58b0dcfd.

The report says both GPUs reproduce the current test failures and pass the corrected set, with the negative control failing as intended. This supports bringing the two test-only corrections into the PR while retaining Blazing Cook's authorship. It does not establish that the current public head passes those tests. I did not run the GPU tests or modify this branch. Exact report and patch references.

@cookie42073-cmd

Copy link
Copy Markdown
Contributor

Hey @MarcZX10, I prepared a tested current-main integration for the emitter conflict, keeping the existing implementation and the two supplied test corrections.

Pins: main bff0289787c98570491c8f175179c8a5651c8017 + this PR's 39a016143547fd5d5ae866a78622240f58b0dcfd. The sole conflict was in SpirvEmitter.cpp: I kept main's meshWindowBuffer assignment, followed by the PR's unchanged wave/fault/write-mask setup. Original implementation authors and commit history are preserved. The conflict resolution is included separately from the two test patches.

On Windows 11 Pro 26300, WinLibs GCC 15.2.0 r7, Release with bundled SPIRV-Tools:

GPU Main focused set Integrated PR before test corrections Corrected and restored set
RTX 4070 SUPER, NVIDIA 621.01, subgroup 32 7/7 5/8 8/8
Intel UHD 770, 101.7088, subgroup 32 7/7 5/8 8/8

The same three test failures reproduce before correction: the shader-memory helper assertion and the direct/draw-pipeline span-report checks. All three corrected tests also passed three fresh-process runs per GPU (18 additional test executions). Disabling barrier write masking makes all three reject the result on each GPU: on each GPU, all 24 reports across the two span fixtures stay visible, while 16 controls write wrong output. After restoring exact production bytes and rebuilding, the final sets pass again.

Main's new agc_driver_mesh_vector_window_waves also passes on NVIDIA in main, the integrated PR, the corrected tree and the restored tree. Each arm has recorded source and binary fingerprints. Full default Windows builds pass for main, the integration, corrections and final restoration; FFmpeg uses the pinned prebuilt cache. The full CTest suite was not run.

The test corrections are now 7664761651f9b2ab5d4d2ace82be30199588d92e and f492498cde85c7d12bac4f43567ca3259de26d1c. Their patch IDs match the October 29 corrections. Blazing Cook authorship is retained, as is the current subgroupSize == 32 restriction. Celegans12, Amoenus and you retain implementation credit.

Vulkan was required, the application shader cache disabled, implicit layers excluded, and Khronos validation actually loaded. No VUID/SYNC errors or selected-test skips were added. Stale installed-layer manifest lookups still emit loader errors, so the raw logs are not error-free.

This is a local integration handoff, not a push to your branch or a separate PR. #6416 remains the prerequisite. Its Astro startup evidence request is still open; these checks do not resolve that performance question or establish a title unblock. AMD/native64 and other platforms remain untested here. AI-assisted, with independent review of the resolution, tests and evidence package.

AnyPS5-7392-current-main-handoff-20261030.zip

ZIP SHA256: 192d7dcbd43f169c19846e00b8a57982426e31780fe2e769816f57cbe61e739a

@oneandonlydean

Copy link
Copy Markdown
Collaborator

@MarcZX10 the branch still has the tests that fail: the NVIDIA run on this head (29 Oct) shows agc_shader_memory failing because of the production change (it passes on main with only this PR's test changes), and both agc_driver_bda_span_reads variants failing with this PR's tests even on main. @cookie42073-cmd has a tested merge of current main with the two test corrections (7664761651, f492498cde), which turn the focused set from 5/8 to 8/8 on NVIDIA and Intel. As you said in your self-review, could you bring those corrections (and the main merge) onto this branch? We'll take the next head from there.

@CnRJay CnRJay left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1. Stacked and not rerun. This is stacked on #6416 and the body says the runtime tests were not rerun after the rebase onto main 3de84fa; only git diff --check and the conventions script were. The five-run GPU results live in issue #6689, on the pre-rebase tree. Please rerun the BDA span-read tests on the current head.

2. Compile-time and size cost is unmeasured. The body states the per-lane write mask "may affect compile time" for large barrier compute shaders and that no measurement was made. The mask is added to every write, atomic and export in a shader that has a barrier plus a BDA read, so SPIR-V size and variant compile time grow with the number of stores. Please give SPIR-V word counts and compile time for one large barrier shader before and after, and say whether shaders that have BDA reads but no fault possibility are affected.

3. Validation. The tests are BDA execution tests on two GPUs but no mention of running with VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation and comparing for new VUID- lines against main, which the shader recompiler rules require. A barrier inside divergent control flow is the kind of thing the layer and the SPIR-V validator complain about.

4. Negative control for the mixed case. RunFault builds a mixed valid/faulting input and requires that valid lanes' writes land; does the test fail if the write mask is dropped (faulting lanes writing garbage) or if the barrier is skipped for faulting lanes? The body claims both lanes are covered but does not say the test was shown failing.

@MarcZX10 MarcZX10 left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Replies checked — failing tests and four review points need answers, corrections not on branch

The 29 Oct NVIDIA run at this head reports three new failures, and the branch still conflicts with current main.

What I ran

  • Live head 39a016143547fd5d5ae866a78622240f58b0dcfd (OPEN, unchanged from batch).
  • gh api comments, reviews and review comments on #7392, newer than 2026-10-30T01:44:46Z, excluding MarcZX10 and bots.
  • gh pr view 7392 --json body,statusCheckRollup; the 2026-10-29 TechLevelZero comment.
  • git cat-file, git merge-tree --write-tree upstream/main 39a01614, git grep for the write-mask gate and RunFault.
  • Nothing built or run.

Results

Check Result Note
Live head matches batch OPEN
merge-tree vs upstream/main exit 1 conflict in SpirvEmitter.cpp
NVIDIA run 2026-10-29 (third-party) failed 3 new: agc_shader_memory fails with production change; both agc_driver_bda_span_reads variants
Correction commits 7664761651, f492498c not in this clone not verified
Hosted windows, relinker, relinker-asan, conventions SUCCESS linux, register-context, write-watch SKIPPED

Findings

  • @oneandonlydean (2026-11-01 09:49 UTC) asks to bring the two test corrections and a main merge onto the branch. Answer needed. The corrections are not in this clone.
  • @CnRJay (2026-11-01 19:59 UTC), point 1: runtime tests not rerun after the rebase. Confirmed in the body. Answer needed.
  • Points 2 and 3: compile time not measured, and no validation-layer comparison, both confirmed in the body. Answer needed.
  • Point 4: the mixed-lane negative control. RunFault is at BdaSpanReads.cpp L160. Write masking is gated at SpirvEmitter.cpp L329 and applied to guest-state writes at SpirvFlowEmitter.cpp L827, so "every write, atomic and export" is only partly right. Whether the test fails without the mask is not shown. Answer needed.
  • @cookie42073-cmd (2026-10-31) offers an integration ZIP outside the branch. No question asked. Not downloaded.

Sources

Not verified

  • The correction commits and the ZIP contents.
  • The mixed-lane negative control, compile time, and any build or test result.

@cookie42073-cmd

Copy link
Copy Markdown
Contributor

Quick update after #6416's spanning-wave follow-up: I checked this barrier change on that newer prerequisite, keeping the two existing test corrections.

This is a local integration, a0ef9ee98b0030fb12c2470c3f9d660d81c8d239, based on main f6232fcf and the #6416 19eddec qualification reported here. The published #7392 head is still 39a016. Original implementation authors and the two test commits retain their credit.

There were two production conflicts: the combined emitter must keep #6416's spanning-wave eligibility while adding the barrier mask, and the byte-read path must keep its bdaStopValue guard while propagating barrier faults. The first-fault latch is unchanged. The attached patch records the combined code; this is not an unchanged cherry-pick of e205da0d.

Windows 11 Pro 26300, GCC 15.2.0 Release, SPIRV-Tools enabled; Intel UHD 770 (32.0.101.7088) and RTX 4070 SUPER (621.01):

Same test set Each GPU
Combined code, original public tests 7/10 pass; the same three test issues reproduce
With the two test corrections 10/10 pass
Disable only barrier masking Those three tests fail; all seven companions, including the new spanning-wave fault test, pass
Restore the code, full build, final rerun 10/10 pass, plus the nonspanning fault control

In the barrier-disabled control, all 24 fault reports stay visible per GPU, but 16 controls write wrong output. The corrected and restored runs retain all reports with no wrong output. The final 22 checks pass, with Khronos validation loaded and no VUID/SYNC errors or CTest skips. Expected BDA fault diagnostics remain. Full build and conventions pass.

This adds current-prerequisite integration evidence to the existing handoff. The negative control drops the write mask; it does not deliberately skip a barrier. Large-shader word counts and compile timings still need separate evidence. No title unblock, Linux/macOS or native-64 mixed-barrier claim. AI-assisted integration, testing and independent review.
AnyPS5-7392-on-6416-a0ef9ee9-20261102.zip

Celegans12 and others added 3 commits November 4, 2026 12:05
…ater writes

A recorded BDA fault (StopBdaInvocationIf) returned from the invocation.
In programs whose invocations vote together the others then wait for it
forever: with two lanes per invocation (wave64 on a 32-lane host) an
execz, vccz or scc0 branch is taken only when all 32 invocations vote,
and a waterfall that clears a lane from an SGPR mask only by that lane's
own ballot never ends. The stop also ended the partner lane, which had
not faulted.

In programs with two lanes per invocation, ballots or shuffles (not
pixel or mesh), a fault now sets a per-lane flag instead. The invocation
keeps running and voting, and each later buffer, address, image, LDS or
GDS write or atomic and each export of that lane is skipped. Other
programs still stop.
@MarcZX10
MarcZX10 force-pushed the codex/bda-barrier-write-mask-6689-current branch from 39a0161 to 99a8be7 Compare November 4, 2026 12:05
@github-actions github-actions Bot removed the needs rebase Conflicts with main, rebase needed label Nov 4, 2026
@oneandonlydean

Copy link
Copy Markdown
Collaborator

Hi MarcZX10,

Thanks for rebasing onto current main. A follow-up to our 1 Nov comment: the rebased head 99a8be77d0 has the same production change and the same tests as the head the NVIDIA run failed on (the patches are unchanged apart from context), so the three failures from that run should still reproduce here.

cookie42073-cmd's two test-only corrections are still not on the branch. On 3 Nov they reported 10/10 with those corrections on top of #6416's newer 19eddec, versus 7/10 without them, and their negative control (barrier write masking disabled) fails the three tests as expected. Could you bring those two corrections in with cookie42073-cmd's authorship, as you suggested on 30 Oct?

One more point on the base. The first commit here, 54846952c3, is the earlier version of #6416's fix. #6416 has since changed that commit (the first-fault latch for guarded SRT faults) and added 19eddec (masking faults in spanning waves). Rebasing onto #6416's current head, or waiting until #6416 merges and dropping the carried commit, would keep this branch from landing the older version.

@TechLevelZero

Copy link
Copy Markdown
Contributor

❌ NVIDIA GPU test: failed

PR head 99a8be7 merged onto main b11c7bf · tested 2026-11-04 19:32 UTC · 54 min

GPU NVIDIA RTX 2000 Ada Generation, driver 595.99.02, Vulkan 1.4.329
Host Ubuntu 26.04.1 LTS, kernel 7.0.0-38-generic, container ubuntu:24.04
Logs build and test logs for this run
Build ✅ passed (Release, -DANYPS5_ENABLE_SPIRV_TOOLS=ON)
Tests ❌ 2,771 passed · 5 failed (2 new: 1 pass on main with the PR's tests, 1 fail on main with the PR's tests too, 3 also fail on main) · 49 skipped (ANYPS5_REQUIRE_VULKAN=1)
Test setup CPU-only tests without a GPU; GPU tests (and any CPU-only test that failed or skipped without one) once on the GPU with VK_LAYER_KHRONOS_validation and ANYPS5_NO_SHADER_CACHE=1; main ran the same way
Test selection 2,825 of 3,894 tests run: the ones this change can reach, chosen by tools/select_tests.py from main's build graph
Vulkan validation ✅ no new validation IDs vs main (975 tests run on the GPU)
Slow tests (>30 s, GPU tests timed with validation layers) ⚠️ agc_driver_pipeline_journal 119.2 s

Failing tests

This PR changes test files, so each failing test was also built and run on main with only the PR's test changes applied. ✅ there means the failure comes from the PR's other changes; ❌ means the test fails on main too, so this run does not show the PR caused it.

Test With this PR Same test on main b11c7bf (main + this PR's test changes only)
agc_driver_bda_span_reads ❌ failed ❌ also fails
agc_shader_memory ❌ failed ✅ passed
agc_driver_bda_span_reads: Failed (also failed when re-run alone), assertion and diagnostics
ctest: Failed

[write-watch] host imports resolve write protection: no (0 of 4 scratch pages written after a GPU read, 0 after a GPU write, 4 after the import); imported ranges stay watched
BDA fault span wave32 coherent=0 barrier=0 changed=0 refused=1
BDA fault span wave64 coherent=0 barrier=0 changed=0 refused=1
BDA fault span wave32 coherent=0 barrier=1 changed=0 refused=1
BDA fault span wave64 coherent=0 barrier=1 changed=0 refused=1
BDA fault span wave32-mixed coherent=0 barrier=1 changed=0 refused=1
BDA fault span wave64-mixed coherent=0 barrier=1 changed=0 refused=1
BDA fault span wave32 coherent=1 barrier=0 changed=0 refused=1
BDA fault span wave64 coherent=1 barrier=0 changed=0 refused=1
AGC graphics: BDA span reads: no unmapped fault report: 
agc_shader_memory: Failed (also failed when re-run alone), assertion and diagnostics
ctest: Failed

descriptor Phi: skipped mapped, unmapped and null reads stay null; taken unmapped reads fail
BDA read functions: a read site does not call its span read function once
Failing on main too (3, not counted against this PR)
agc_driver_image_table
guest_mmap_executable
guest_socket_options_multicast
Validated but not compared (1, not in the main baseline's validation pass)
agc_driver_faulting_wave_invocation
Validation IDs already present on main (13 IDs in 544 tests)
VUID-VkDeviceCreateInfo-pNext-pNext (544 tests): agc_driver, agc_driver_address_draw_space_reuse, agc_driver_address_passes, agc_driver_alias_copy_label, agc_driver_alpha_to_coverage, agc_driver_array_layer_target, agc_driver_bc_block_copy, agc_driver_bda_anchor_reads, and 536 more
VUID-VkShaderModuleCreateInfo-pCode-08737 (8 tests): agc_driver_dpp16_operands, agc_driver_dpp8_pk_fmac, agc_driver_dx10_clamp, agc_driver_float16_fma_rounding, agc_driver_float16_unused_nan_payloads, agc_driver_packed_alu, agc_driver_packed_f16_denormal_modes, agc_driver_packed_float16_native
VUID-VkShaderModuleCreateInfo-pCode-08739 (8 tests): agc_driver_dpp16_operands, agc_driver_dpp8_pk_fmac, agc_driver_dx10_clamp, agc_driver_float16_fma_rounding, agc_driver_float16_unused_nan_payloads, agc_driver_packed_alu, agc_driver_packed_f16_denormal_modes, agc_driver_packed_float16_native
VUID-VkShaderModuleCreateInfo-pCode-08741 (8 tests): agc_driver_dpp16_operands, agc_driver_dpp8_pk_fmac, agc_driver_dx10_clamp, agc_driver_float16_fma_rounding, agc_driver_float16_unused_nan_payloads, agc_driver_packed_alu, agc_driver_packed_f16_denormal_modes, agc_driver_packed_float16_native
VUID-vkCmdCopyImage-srcImage-01548 (7 tests): agc_driver_depth_clear_hle, agc_driver_depth_plane_buffer_memory, agc_driver_depth_plane_partial_store, agc_driver_depth_plane_sampling, agc_driver_depth_storage_dispatch, agc_driver_depth_surface_from_storage, agc_driver_dispatch_move_depth
VUID-vkCmdCopyImage-srcImage-01551 (7 tests): agc_driver_depth_clear_hle, agc_driver_depth_plane_buffer_memory, agc_driver_depth_plane_partial_store, agc_driver_depth_plane_sampling, agc_driver_depth_storage_dispatch, agc_driver_depth_surface_from_storage, agc_driver_dispatch_move_depth
VUID-VkPipelineColorBlendStateCreateInfo-pAttachments-00605 (2 tests): agc_driver_prepared_exports, agc_driver_srgb8_color_target
VUID-VkPipelineShaderStageCreateInfo-module-parameter (1 test): agc_driver_float16_unused_nan_payloads
VUID-VkPipelineShaderStageCreateInfo-pSpecializationInfo-06849 (1 test): agc_driver_float16_unused_nan_payloads
VUID-VkSamplerCreateInfo-addressModeU-01079 (1 test): agc_driver_image_gather_volume
VUID-VkSamplerCreateInfo-addressModeU-parameter (1 test): agc_driver_image_gather_volume
VUID-VkSamplerCreateInfo-addressModeV-parameter (1 test): agc_driver_image_gather_volume
VUID-VkSamplerCreateInfo-addressModeW-parameter (1 test): agc_driver_image_gather_volume
Skipped (49)
agc_driver_bda_reads_shadowed_results: skipped, the device reports watched host memory written when it imports or reads it
agc_driver_bda_reads_shadowed_results_per_build: skipped, the device reports watched host memory written when it imports or reads it
agc_driver_gcn_display_present: skipped, no display: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
agc_driver_sample_order_grid_reference: skipped, the device does not keep depth drawn at custom sample locations at those locations, even after a transition that names them: the composite of uniform renders holds the guest's depth in 0 of 3005 sloped samples, so no path can be compared with it bit for bit
agc_driver_scattered_runs: skipped, host imports are unavailable: /dev/udmabuf is not accessible
agc_driver_sparse_dma_buf_import: skipped, host imports are unavailable: /dev/udmabuf is not accessible
agc_driver_stencil_ref_export: skipped, the device lacks VK_EXT_shader_stencil_export
agc_host_import_sparse: skipped, host imports are unavailable: /dev/udmabuf is not accessible
agc_import_settle_initial_dcc: skipped, the device has no deferred settle of host imports: imports under 1 MiB wait for one only on Windows
agc_unit_shadow_completion_store: skipped, the device reports watched host memory written when it imports or reads it
guest_http_uri_locale: 
guest_net_ctl: skipped, the host has no IPv4 address
guest_video_out_color_space: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_hdr: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_high_frame_rate: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_output_mode: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_resolution_status: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_wqhd_detection: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
video_out_flip_aftergpu: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_backtoback: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_controls: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_cpuflip: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_cpuflip_in_order: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_dcc: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_deferred: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_eop: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_eop_aftergpu: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not av
Reproduce
git fetch origin 99a8be77d00aef765296627c1b1e8a6fed39152f b11c7bf84f5d2f636ff60166cc3371bd071e24d5
git checkout b11c7bf84f5d2f636ff60166cc3371bd071e24d5 && git merge --no-ff 99a8be77d00aef765296627c1b1e8a6fed39152f
git submodule update --init --recursive
cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=ON -DANYPS5_ENABLE_SPIRV_TOOLS=ON
cmake --build build && cmake --build build --target libs
VK_DRIVER_FILES=/nonexistent/icd.json ctest --test-dir build -E '^(agc|shader|recompiler|videoout|video_out|guest_video_out|vulkan)|gpu' --timeout 120 --parallel 32 --output-on-failure
ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation \
  ctest --test-dir build -R '^(agc|shader|recompiler|videoout|video_out|guest_video_out|vulkan)|gpu' --timeout 120 --parallel 4 --output-on-failure
# failures are then re-run alone: --timeout 360 --parallel 2; new validation IDs: the test alone, twice, --parallel 1
# the failing tests, on this merge and on main:
ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation \
  ctest --test-dir build -R '^(agc_driver_bda_span_reads|agc_shader_memory)$' --parallel 1 -V

Automated build and test on a contributor's NVIDIA machine; it does not replace upstream CI. A new comment is posted for each new push. Full logs.

@cookie42073-cmd

Copy link
Copy Markdown
Contributor

I refreshed the existing #6416/#7392 integration on main 1da78eb048 and found an additional cached formatted-buffer helper bug. The reviewed support branch is now available:

Support branch, tested head 2e04b84153.

In barrier compute mode, bdaFaultMasksWrites can be true while bdaStopsInvocations is false. formattedGpuCall selected its cached helper ABI using only the latter. A helper generated for the lower half could then mark that half when reused by an upper-half fault, suppressing healthy lower-half writes. The correction returns fault status from the helper, restores the caller's fault-handling mode, and applies that status to the caller's current lane half.

The new regression is bfaac72496; its direct child 2e04b84153 changes only SpirvRuntimeBuffer.cpp (15 additions, 9 deletions). The fixture is unchanged between the failing and passing comparisons.

Windows comparison RTX 4070 SUPER Intel UHD 770
Clean main: four existing focused tests 4/4 pass 4/4 pass
Refreshed integration + new fixture, old helper 6 pass, 2 expected failures 6 pass, 2 expected failures
Corrected helper: common four + new eight + default faulting-wave test 13/13 pass 13/13 pass
Additional forced-nonspanning faulting-wave test 1/1 pass 1/1 pass

The failing controls are agc_driver_gpu_buffer_format_barrier_load_upper_nonspanning and agc_driver_gpu_buffer_format_barrier_store_upper_nonspanning. On both GPUs, the first healthy lower-half output stays 0xdeadbeef. With the fix, all eight load/store ? lower/upper ? default/nonspanning cases pass, including full 64 KiB memory comparisons and the required fault diagnostic. Actual default cases used fullSubgroups=1/one helper call; forced cases used fullSubgroups=0/two calls to the same helper.

Tests ran on Windows 11 Pro 10.0.26300, NVIDIA driver 621.01 and Intel 32.0.101.7088, Release/GCC 15.2, with the required Vulkan/cache flags. Every Vulkan process loaded the Khronos validation layer; no missing-layer, VUID- or SYNC- reports occurred. The slowest new case was 0.98 s on NVIDIA and 1.97 s on Intel, with the AnyPS5 shader cache disabled. This is not a driver-cold-cache performance claim.

Full logs, receipts, commands, attribution and limitations. Independent source, regression, overlap and runtime reviews passed. Conventions passed against both tested main and the later 9f2b939606 base. The latter adds only unrelated libwebrtc work; a clean merge-tree check passed, but that hypothetical merged tree was not GPU-tested.

The support integration retains the newer #6416 spanning/first-fault behavior and both of my prior test corrections. It carries the existing authors' cherry-picked commits with credit preserved; the evidence includes the original-to-carried mapping. #6416 remains a prerequisite. The unchanged public #7392 head is still 99a8be77d0, so these results should not be attributed to that head.

This fixes propagation of faults already reported by the formatted helper, including the tested invalid-format store. Unmapped stores through EmitBdaStoreAt, native-64 AMD, hull/mesh barriers, Linux/macOS, large-pipeline performance and gameplay remain outside this qualification. No competing production PR was opened. AI-assisted; new regression and helper correction by Blazing Cook.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agc libSceAgc* docs fix error Closes an issue (Fixes #N) shader core/shader

Projects

None yet

Development

Successfully merging this pull request may close these issues.

shader: faulting BDA reads in programs with s_barrier still update guest output buffers