shader: faulting BDA reads in programs with s_barrier still update guest output buffers #6689
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by Amoenus on 2026-10-16T05:01:03Z.
Current follow-up - 7 November 2026
Keep open; #7392 remains the proposed fix, dependent on open #6416. Its current published head is
99a8be77d00aef765296627c1b1e8a6fed39152f; the maintainer's 4 November follow-up says the two test corrections and current #6416 prerequisite are still missing (parent #6416 remains open at19eddecba1143143bb4c5b750f51632a4cf2eef8and also conflicts with inspected main6185bdcfc4e05bbc5a7b61a74ba6345f941a2b6e). Its description explicitly says the runtime tests were not rerun after rebasing. Older failure and passing reports below retain their original pins.Parent #6416 now has independent Intel UHD 770 / NVIDIA RTX 4070 SUPER Windows evidence on main
f6232fcfda70644495273f6b8dd88cf0603463d6, corrected composition2f101cbb2a90e98b26dfcc2ac60e8950d20e4f4f. The hardware-spanning-wave case fails on main and the pre-follow-up composition, passes after the four-line follow-up, fails when that follow-up is removed, and passes after restoration, on both GPUs. The report also checks the nonspanning case, nine companions, selected devices, loaded validation layer, and no VUID/SYNC diagnostics or skips. These are cookie42073-cmd’s executions at the stated pins, not ours.That strengthens the parent’s subgroup/wave fix; the parent alone does not address this barrier-write issue. Earlier author follow-up is retained as history.
Latest barrier integration correction: cookie42073-cmd’s 6 November report identifies a cached formatted-helper ABI gap in the earlier integration. Barrier mode masks writes without stopping invocations; keying/returning fault status only for the stopping mode can mask the wrong wave half when a helper is reused. Focused child
2e04b8415343f2509b9ae5b23e89def7db81721eis directly parented bybfaac7249655743dfce5404b829c8b7b9ee55c9cand changes onlySpirvRuntimeBuffer.cpp: the helper reports faults for either mode, restores caller mode and applies the fault to the current half. This sweep verified that source/parent relationship.The contributor reports main4/4, old helper6 passes/2 expected failures, corrected integration13/13 plus a forced-nonspanning check on each of RTX4070SUPER and IntelUHD770, including full64KiB output comparisons and loaded validation without VUID/SYNC diagnostics. Raw evidence. These are attributed executions on main
1da78eb048and the stated support branch, not ours and not tests of submitted #739299a8be77. They refine the earlier support results rather than qualifying the unchanged public head. AMD/native64, unmapped stores through EmitBdaStoreAt, hull/mesh, other host platforms and representative large-shader compile cost remain outside that report.Keep open: #7392 was textually rebased to
99a8be77d0, but its submitted branch still needs the tested current-parent integration and corrected tests. Its independent NVIDIA run at that head remains red; do not transfer the corrected local-composition results to this submitted head. Preserve #6416’s spanning-wave eligibility, the byte-readbdaStopValueguard and the first-fault latch while propagating barrier faults. Large-shader size/compile timing, AMD/native64 mixed-barrier coverage and the existing scope limits remain separate. No title-unblock or closure claim.The test-only corrections and masked-write negative control remain contributor-reported evidence, not our independent reproduction of the submitted head. The corrected fault/helper checks and per-case PCs must remain in the resulting validation series; a textual rebase does not establish that both reported regressions pass.
A later Windows compile-only comparison adds data for the supplied before/after shader pair: both compile on RTX 4070 SUPER; both controlled Intel UHD 770 attempts reach the 300-second limit without timing reports. Driver caches were uncontrolled, and the report performs no shader dispatch. This addresses part of the compile-time investigation, not current-head output correctness, an Intel driver-hang diagnosis or a measured PR speedup.
Remaining qualification includes the corrected fault/write regressions on a current-base submitted series, AMD/native64 coverage, and representative compile-time/size evidence with its limits. No new local execution, title result or closure claim in this maintenance update. AI-assisted: yes (Codex).
Original reproduction on main (recorded source pin below)
Main
5d9dcc42d2ec5401aebd089028b8d4d7410a77b4, with only this regression added to BdaSpanReads.cpp. No production changes, native-image patch, title binary or other PR is needed.The existing 64-thread fixture loads two DWORDs per thread and stores them to a separate output window in its registered 64 KiB block. The control moves only the load's base past that registered block and verifies the entire input span is unregistered. It captures the unmapped BDA report (
reason=1) and compares every DWORD of the registered block against its pre-dispatch contents.Five fresh processes on each physical GPU, shader cache disabled and Vulkan required:
s_barrier, plain and GLC, wave32 and wave64s_barrier, plain and GLC, wave32 and wave640xcdcdcdcdto zeroRepresentative output:
The original valid-input controls still run and verify their complete load/store results. Each process finishes below 30 s; no timeout or device loss occurred.
Expected behavior and existing implementation
Keep invocations participating in the workgroup barrier, but suppress later guest writes by faulted lanes. Returning early would strand the barrier. Current
StopBdaInvocationIfreturns immediately whenbdaStopsInvocationsis false, so a failed read supplies zero and subsequent stores still execute. #4222 describes the intentional non-stopping barrier protocol; this report concerns its later writes.Related #6416 adds per-lane fault flags for voting/shuffle programs. Its current source at
b5a0c1ff79eb52bd52fea0ba6d0434e072190b99enables write masking only whenbdaStopsInvocationsis true, leaving barrier programs outside that condition. I am checking that composition separately; this report's measured results are on main plus the test only.Discovered while extending #6625/#6628 validation with barrier variants. The isolated reproduction needs neither native MSAA nor the retained integration, so it is a separate shader fault-handling gap. No new title-startup or FPS claim.
Environment
Windows 11 Enterprise 10.0.26200, MinGW-w64 GCC 15.2.0. NVIDIA GeForce RTX 5080 (
10de:2c02), driver 610.62 / 32.0.16.1062; AMD Radeon(TM) Graphics (1002:13c0), driver 32.0.21036.18. Selected physical device checked in every run.Build
agc_driver_bda_span_reads_tests, then runctest -R '^agc_driver_bda_span_reads$' --output-on-failure, settingANYPS5_REQUIRE_VULKAN=1,ANYPS5_NO_SHADER_CACHE=1andANYPS5_GPUto the intended adapter. Focused Windows build and repeated execution only; no full-build, Linux, console or game run claimed here.AI-assisted: yes.
Focused follow-up and dependency validation
b5a0c1ff79eb52bd52fea0ba6d0434e072190b99, with the same test, still fails 5/5 processes per physical GPU: tested composition891a5871b966f6b78d242acc3e1e88a443acb66e.d09ae3c3ded37cbcf623ce5b1bc04f3f02aeb027passes 5/5 processes per GPU, including the mixed-lane controls. Existing valid accesses are checked too. SPIRV-Tools validation is enabled in this build.Checkpoint, 16 October 2026: the experimental proposal remains on the fork; no upstream PR is open. The full Windows build, contribution checks and focused repeated tests passed. The first broader NVIDIA matrix passed 28/29 groups and stopped at
agc_shader_memory's legacy helper-shape expectation. That expectation was updated locally while retaining its call-count and code-size assertions, and the full build/focused tests passed again. The broader matrix has not been rerun after that update; broader AMD validation and static analysis remain outstanding. This investigation is deferred while work pivots to PR maintenance. Hull/mesh barrier handling remains outside the compute proposal and recorded as debt.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-16T05:16:12Z.
One validation point for the proposed follow-up: #6416 has a reported NVIDIA measurement where its wave write mask increased compile time for PPSA26344 compute shader
0x801cdd2700(about 1.75M SPIR-V words) from 700 s to 1,411 s, with only about 0.5% more SPIR-V. This change enables the mask for barrier programs. Could the broader validation include compile time for a representative barrier shader, or note whether the affected class avoids that large-shader cost? This is separate from the functional all-fault and mixed-lane controls reported here.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-16T08:12:57Z.
I checked the current proposal branch (
0ec6f86plus its test-only follow-up084ee6e). It includes all-fault and mixed-lane functional controls, but I do not see a compile-time measurement for a barrier compute shader. The concern is material because #6416 reports the large PPSA26344 compute shader0x801cdd2700going from about 700 s to 1,411 s with the existing lane write mask. Since this change enables that mask on barrier compute programs, could you report a representative barrier shader compile time/size comparison, or explain from the generated path why this shader class avoids the overhead? That result would help distinguish a correctness-only change from an unacceptable compiler-time regression.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-16T08:45:20Z.
I rebased the prepared proposal onto current
main(5d9dcc42d) and reran conventions successfully. Both focused GPU test targets compile on Linux after applying the independent GCC 12 parser fix from #6738 locally. CTest cannot reach the assertions on this runner: loadinglibkernelaborts because its Intel Xeon E5-1620 v2 lacks LZCNT, BMI1/2, MOVBE, AVX2 and FMA. The current Linux host also cannot supply the GPU compile-time measurement requested above for the large barrier shader, so I am leaving this proposal unposted pending that performance evidence and platform test.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-20T08:28:09Z.
Status check (2026-10-20): I rechecked the open #7392 head (
1c5a918bc5) and it is unchanged; reports still showagc_shader_memoryandagc_driver_bda_span_readsfailing on NVIDIA, AMD, and lavapipe while the base passes. The alternative proposed fix21745fa223has older reported 5/5 RTX 5080/AMD results but has not been validated against currentmain, and compile-time impact for a representative barrier shader is still missing. This host cannot run the GPU cases or produce that timing. To resume, the remaining evidence is a current-main validation of the corrected series (including both previously failing tests and all-fault/mixed-lane cases) plus barrier shader compile-time/size comparison.