renderer: preserve concurrent BDA page-fault reports #1137

Closed
github-bot wants to merge 5 commits from gh-pr/1137/head into gh-pr/1137/base
Owner

@⁠Fayberr on GitHub · 2026-10-07 13:36 UTC · original
Fayberr:fix/bda-fault-bitmap-atomic → main · +318 −9 · 5 files · 5 commits · closed without merging

Concurrent shader invocations can lose BDA page-fault reports when they update different bits in the same bitmap word. RecordBdaFault currently performs a separate load, OR and store, so one invocation can overwrite another's report.

This replaces that sequence with a device-scoped relaxed atomic OR. Existing dispatch and readback synchronization handles visibility.

The host reader also needs to respect the report area's capacity. The parser's raw count can exceed the 1,023 stored addresses, causing the callback to read entries from the next area. This clamps consumption to the stored capacity. Excess reports are still dropped by the existing parser; this does not add overflow recovery.

The capacity guard overlaps #869 and is kept in a separate commit. If an equivalent guard lands first, that commit can be dropped.

Two regressions use the existing native compute-test harness. The producer test checks contended updates across workgroups, mapped-page controls, pre-existing bits and neighboring words. The readback test exercises the production parser, deferred callback and real cache acquisition, including overflow, adjacent-area isolation and ring reuse.

Automated testing performed:

  • Built against upstream 96eb681b and passed 192 producer dispatches and 40 production parser/callback cycles on an RTX 3080 Ti.
  • Removing the production fixes reproduced missing bitmap reports and consumption of a neighboring area's sentinel. Restoring them passed both focused CTests again.
  • The broader candidate matrix passed 27 of 29 checks. The matched baseline passed 25 of 27 original checks; both failed only shader_recompiler_compute and compute_meta_clear_classification at the same ResourceMaterialization.cpp:1397 assertion.
  • Earlier A10 producer tests reproduced lost reports in all 48 contention trials, while 32 controls passed. The atomic version passed 160 cases with Vulkan validation enabled.

Native Windows testing used separate MinGW compatibility adjustments excluded from this PR. Generated producer SPIR-V passed validation; native Vulkan validation layers were not explicitly enabled. PR #925 was excluded from the final comparison. No game compatibility or performance improvement is claimed.

AI assistance: Codex assisted with investigation, implementation, test development and automated testing.

**@⁠Fayberr** on GitHub · 2026-10-07 13:36 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/1137) `Fayberr:fix/bda-fault-bitmap-atomic` → `main` · +318 −9 · 5 files · 5 commits · closed without merging Concurrent shader invocations can lose BDA page-fault reports when they update different bits in the same bitmap word. `RecordBdaFault` currently performs a separate load, OR and store, so one invocation can overwrite another's report. This replaces that sequence with a device-scoped relaxed atomic OR. Existing dispatch and readback synchronization handles visibility. The host reader also needs to respect the report area's capacity. The parser's raw count can exceed the 1,023 stored addresses, causing the callback to read entries from the next area. This clamps consumption to the stored capacity. Excess reports are still dropped by the existing parser; this does not add overflow recovery. The capacity guard overlaps #869 and is kept in a separate commit. If an equivalent guard lands first, that commit can be dropped. Two regressions use the existing native compute-test harness. The producer test checks contended updates across workgroups, mapped-page controls, pre-existing bits and neighboring words. The readback test exercises the production parser, deferred callback and real cache acquisition, including overflow, adjacent-area isolation and ring reuse. Automated testing performed: - Built against upstream `96eb681b` and passed 192 producer dispatches and 40 production parser/callback cycles on an RTX 3080 Ti. - Removing the production fixes reproduced missing bitmap reports and consumption of a neighboring area's sentinel. Restoring them passed both focused CTests again. - The broader candidate matrix passed 27 of 29 checks. The matched baseline passed 25 of 27 original checks; both failed only `shader_recompiler_compute` and `compute_meta_clear_classification` at the same `ResourceMaterialization.cpp:1397` assertion. - Earlier A10 producer tests reproduced lost reports in all 48 contention trials, while 32 controls passed. The atomic version passed 160 cases with Vulkan validation enabled. Native Windows testing used separate MinGW compatibility adjustments excluded from this PR. Generated producer SPIR-V passed validation; native Vulkan validation layers were not explicitly enabled. PR #925 was excluded from the final comparison. No game compatibility or performance improvement is claimed. AI assistance: Codex assisted with investigation, implementation, test development and automated testing.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 09:44:31 +00:00
github-bot closed this pull request 2026-11-26 09:44:31 +00:00

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No description provided.