WIP: fix(vk): seal capture repairs and prove exact CPU visibility #759
No reviewers
Labels
No labels
area/accessibility
area/audio
area/input
area/install
area/menu
area/renderer
area/saves
area/upscaling
beanstalk: approved @ 1697603
beanstalk: approved @ 2c5a62e
beanstalk: approved @ 4fd82b7
beanstalk: approved @ 64d6d09
beanstalk: approved @ 6f91fae
beanstalk: approved @ 70a78f9
beanstalk: approved @ 8d361dc
beanstalk: approved @ 9d8356e
beanstalk: approved @ abf2227
beanstalk: approved @ d82f202
beanstalk: approved @ e5f1e40
beanstalk: approved @ ee8ab5f
ci: approved
good first issue
gpu/amd
gpu/igpu
gpu/intel
gpu/nvidia
help wanted
kind
bug
kind
chore
kind
docs
kind
feature
kind
performance
kind
question
needs measurements
platform/linux
platform/macos
platform/steam-deck
platform/windows
preview
priority
critical
priority
high
priority
low
regression
status
blocked
status
confirmed
status
duplicate
status
invalid
status
needs-info
status
wontfix
testing wanted
ci: approved
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Longshot!759
Loading…
Reference in a new issue
No description provided.
Delete branch "siantm/Longshot:fix/capture-repair-publication"
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?
Type: fix · Risk: high · Tested on: Windows 11 Pro 26300, compiled fake-Vulkan consumers · Needs: full native renderer build, full suite and real Vulkan validation
Why
CPU buffer and texture consumers must see the completed immutable capture, not stale host-cache bytes or newer guest memory. Repair tables must be sealed before GPU submission becomes visible, and a later successful signal must not conceal a failed earlier recording.
This is a follow-on to #526, not a replacement for its same-part fallback/writeback-shadow fixes. It does not claim the reported player-visible flashes are fixed.
How to reproduce
Seen on: authored game-free Windows fixtures; a player-visible artifact has not been reproduced on this isolated branch.
Settings and switches: fake deferred/failed Vulkan submissions, noncoherent mappings and capture-generation changes.
Steps: run the focused drivers listed under Testing; they exercise production helpers with controlled publication races, held/direct failures and CPU reads.
Expected: exact completion and publication proof before repaired bytes become CPU-visible; tables and capture allocations stay valid through waits.
Actual before this proposal: the missing ordering/lifetime contract is established by source analysis and earlier local synthetic work, not a fresh same-fixture baseline run. Baseline consumer proof and real GPU validation are still required before readiness.
What changed
Seal repair metadata before direct/held queue publication, prove completion of the exact recording part, and pin captures while releasing memory locks for waits. Invalidate only the repaired allocation/page range and restart whole multipage reads if their capture view changes.
vk_replay.cpp/ declarations: exact completion, failed-submission poisoning and publication ordering.vk_memory.cpp,vk_vma.cpp: sealed tables, retained storage and checked noncoherent visibility.Measurements
Verdict: eight focused compiled-consumer drivers pass. This is correctness work; no FPS gain or flashes-fixed claim.
Hardware: Windows 11 Pro 26300, Intel Core i7-9700, 31.8 GiB usable RAM; Python 3.14.7, LLVM-MinGW Clang 23.1.5, Vulkan-Headers v1.4.345. No GPU used.
Method: authored bytes, deferred/failed work and fake noncoherent visibility; production helper consumers compiled from this PR @
2de66d862don main9e6f231d.Observed:
PASS: capture prefix repair, immutable exact-part CPU/texture reads, cache visibility, fallback and lifetime semantics; direct/held failed work stays unproven after a higher signal; concurrent waiters cannot pass prequeue sealing/publication. No fresh same-fixture baseline pass/fail comparison, complete renderer build or real GPU run is claimed. Historical integrated-local serial/parallel FPS observations are not measurements of this isolated branch.Flags and settings
No new switch or default. Parallel rendering stays off; threaded-rendering defaults stay unchanged. Existing
RX_VK_LATE_FIX=0retains the wait/copy fallback. Explicitly enabled parallel repair uses the ordered prefix rather than publishing mutable tables.Testing
Tested:
test_late_fix_build,test_readback_part,test_parallel_init_order,test_draw_stream_visibility,test_fsr_image_retirement,test_flush_nothing_held,test_value_rec_last_partandtest_recorded_wait_flush: all eight drivers pass. Catalogue renderer accepts the measured-run fragment.Not tested: full native renderer build, full suite, Linux, real GPU/runtime behavior, or exhaustive transient-artifact detection. Catalogue unit driver has a Windows CRLF-vs-LF fixture failure.
Must be tested: author/Test Farm completes native Windows/Linux builds, full suite and real Vulkan serial/opt-in parallel runs including held batching, resumed submissions, CPU buffer/texture uploads, sparse binding and noncoherent memory. Capture both expected visibility and absence of device loss/deadlocks; coordinate the overlap with PR 526.
Risks
What could break: deadlocks, capture retention, failed-submission handling, noncoherent visibility or retirement ordering. Synthetic success is not exhaustive runtime proof.
Turning it off: disable late fixes for the existing fallback, disable optional parallel replay, or revert the patch.
Compatibility: public renderer ABI, saves/options and disk-cache formats are unchanged; no game-derived artifacts are included.
Checklist
Everyone
fix(vk): seal capture repairs and prove exact CPU visibility.9e6f231d.When it applies
Assisted-by: OpenAI Codex.View command line instructions
Manual merge helper
Use this merge commit message when completing the merge manually.
Checkout
From your project repository, check out a new branch and test the changes.