tests: cover BDA fault resolution and retry #1074
No reviewers
Labels
No labels
bug
documentation
duplicate
enhancement
GPU
GUI
help wanted
question
Shaders
Video
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/KytyPS5--KytyPS5!1074
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/1074/head"
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?
@MehmetCambaz on GitHub · 2026-10-05 17:06 UTC · original
MehmetCambaz:test/bda-fault-resolve-retry→main· +306 −0 · 2 files · 1 commits · closed without mergingSummary
Adds end-to-end GPU coverage for unresolved scalar BDA accesses.
The test verifies the complete production lifecycle for both low and extended guest addresses:
FaultManagerprocesses the real GPU fault;BufferCacheresolves the guest page and publishes the BDA translation;No production behavior is changed.
What is covered
The scalar offset is supplied through runtime SGPR state so current resource planning cannot flatten the access into SRT before the shader reaches the BDA path.
The fixture also keeps its observable output in a separate noncontiguous guest mapping so descriptor preparation cannot resolve the intended target before the first dispatch.
Before the initial access, the test verifies that the target has no cached owner, no registered target region, and a zero BDA page-table entry.
Why this test matters
The individual shader, fault-manager, BufferCache, and page-table components can behave correctly in isolation while the full fault-resolution lifecycle is broken.
This regression exercises the production integration path from a real unresolved shader access through fault handling and BDA publication to a successful later dispatch.
Regression proof
Two temporary mutations were used:
RecordBdaFaultremoves the expected fault bit (0x00000000instead of0x00010000) and fails the real-fault assertion.FaultManager→FindBufferresolution transition preserves the expected fault bit but fails during fault resolution.Both mutations were reverted before the final commit.
Validation
bda_fault_resolution_retry— 10/10 passescommand_scheduler_timeline— passstream_buffer_ring— passbuffer_cache_ranges— passVK_LAYER_KHRONOS_validationrun — passgit diff --check— passresource_tracking_testscould not be built in the current clang-cl test configuration because its exception-enabled source is compiled without-fexceptions; this is unrelated to KT-02.Notes
AI assistance was used for codebase investigation, implementation support, and test execution. I reviewed the production lifecycle, final diff, mutation results, and validation results before submission.
@coderabbitai[bot] on GitHub · 2026-10-05 17:09 UTC · original
Navigate logical layers of code changes, visualize relationships, and explore their blast radius.
No actionable comments were generated in the recent review. 🎉
ℹ️ Recent review info
⚙️ Run configuration
39ce2cc6-c13f-43f9-a476-5982ed7a0433📥 Commits
Reviewing files that changed from the base of the PR and between
77d7722173anda325663c0c.📒 Files selected for processing (2)
CMakeLists.txttests/ShaderRecompilerComputeTests.cppIncluded review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.
📝 Walkthrough
Walkthrough
Adds a compute test for address-only scalar loads from low and extended guest-memory regions. The test checks initial page-table state, verifies that the first dispatch faults on the target page, and confirms that a retry loads the expected value without another fault. The test runs in the normal compute-test sequence and through a dedicated command-line option registered as a CTest case.
Suggested reviewers:
nmzik,defektuPriority: ⬇️ Low
Change: Other
Merge Risk: ⚪ Minimal · up to
a3256This change adds regression coverage for BDA fault resolution and retry, plus a dedicated CTest case. Runtime behavior is unchanged, and no merge-blocking risk was found.
Architecture Summary
Architecture risk: 🔵 Low · up to
a3256The change affects 2 systems.
Changed systems:
CMakeLists.txt,testsArchitecture concerns
No architecture-level concerns identified.
Review details
Systems and components
Before / after behavior
bda_fault_resolution_retrytest, invoking the compute test executable with the--bda-fault-retry-onlyoption.CheckBdaFaultResolutionRetry. For low and extended memory targets, it establishes an uncached page with a zero table entry, dispatches an address-only load, and checks that the first access faults on exactly that page and returns zero. It then verifies the faulted page is cached and its BDA table entry points to the resolved buffer; a second dispatch must record no fault and return the region’s expected value. The test maps and initializes backing and output memory, and releases GPU mappings and direct allocations afterward.--bda-fault-retry-onlyoption, which creates a Vulkan harness, runsCheckBdaFaultResolutionRetry, and exits successfully afterward.CheckBdaFaultResolutionRetryto the normal compute-test sequence.🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
❤️ Share
Comment
@coderabbitai helpto get the list of available commands.@overlordxrz-source on GitHub · 2026-10-06 00:13 UTC · original
Validated locally (read the diff, built on x86_64 macOS no-Qt Release):
shader_recompiler_compute_testsbuilds clean with the newCheckBdaFaultResolutionRetryfixture. Couldn't execute it here (needs a real Vulkan device; no loader in this environment — same pre-existing limitation as clean main), so this is compile + code review only.FaultManagerprocessing, page resolution + BDA publication, clean second dispatch, exact-value retry. The--bda-fault-retry-onlyfilter is a nice touch for iterating on fault-path work without running the whole compute suite.Pull request closed