Repository navigation
Runtime: predicate byte-granular buffer copies (BUILD-180) - #1277
Merged
ItsNotRexed merged 3 commits intoNov 22, 2026
Merged
Conversation
Build on the full 64-bit predicate snapshots from ItsNotRexed#856. Replay predicated buffer copies through a storage8 compute helper, retain descriptor batches through timeline completion, and reject missing capabilities or active statistics queries before submitting work. Validate byte offsets, high predicate words, bounds, skipped destinations and pending descriptor lifetimes with CPU checks, 180 native WARP comparisons and 64 gated/reused GPU submissions. The existing OPTIONS19 host-capability mismatch also reproduces on base 4a36bb1; no tests are disabled.
Verify compute and transfer readback-stage collection, descriptor cleanup after failed submits and gated/reused batches. Extend binary and overlapping occlusion fixtures with independent destinations to check skipped-copy preservation and copying after predicate reset. Document the command-slot lifetime and queue integration. Local RX 5700 XT validation: 180 exact WARP comparisons, 64 gated/reused copy submissions, both occlusion controls, 192 predicate captures, replay A-G and 1663 existing WARP readbacks passed. CTest: 59/60 active tests passed; the six stencil CopyResource mismatch reports exactly match the tested ItsNotRexed#856 baseline. Shader source and embedded SPIR-V match after Vulkan 1.2 validation.
Resolve real empty ordinary/binary occlusion queries into default-heap predicates at two offsets and check both operators. Add GPU high-word-only overwrites, captured-value preservation, same-address recapture and reset controls. Compare all destination bytes and predicate guards with literal expectations and native WARP; four paired recapture controls change exactly one 13-byte region. RX 5700 XT with Vulkan validation and synchronization validation: all 16 query-to-copy cases plus 180 existing cases passed, zero validation errors. Native WARP-only controls also passed. Coverage intentionally excludes nonzero visible-draw occlusion counts.
Contributor
|
Tested on Windows 11 with two GPUs on one machine (runtime built from this PR's head, MSVC 14.51): pass. |
ItsNotRexed
pushed a commit
that referenced
this pull request
Nov 22, 2026
On top of the merge candidate 70178d3 (Ryx69#6, which merged main at 426023a): the 219 commits main gained since. Three hunks conflicted, in two files; both follow the notes on #291 (ItsNotRexed 08:27 UTC, Vonsek 09:58 UTC on 2026-11-22). runtime/shims/d3d12_vulkan_device.cpp, device setup after the VulkanContext: - the branch's GPU address arena is created first, as before; - main's block that configures predication and the predicated byte copy (#1277) follows it; - one load_host_image_copy call and main's lazy D24 converter (enabled only where D24_UNORM_S8_UINT is not usable) replace the branch's unconditional enable_depth24, which was the same code before main changed it. runtime/src/vulkan_replay.h: - CopyBuffer: main's version. It already adds ResourceBinding::buffer_offset to both offsets, as the branch did, and adds the overflow and overlap checks and the predicated copy. With the arena, source and destination are often the same VkBuffer; the overlap check compares the adjusted ranges. - Predication: main's version. prepare() passes buffer_offset + the command's offset to prepare_predicate, so a default-heap buffer inside the arena is read at its own range; emit() captures the word and tests the capture's scratch slot, not the application's buffer. Everything else merged without conflicts. Nothing in main's 219 commits adds a caller that takes a buffer's Vulkan device address for its GPU VA. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This was referenced Nov 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Claimed in the coordination issue as: BUILD-180 — renewed reservation, original claim.
Depends on: #856 (merged). Rebased onto main
e7584c52.What and why
vkCmdCopyBufferignores conditional rendering, so aCopyBufferRegionunder a false predicate currently overwrites its destination. Replay predicated buffer copies as byte-granular compute dispatches using #856's captured 64-bit condition instead.storageBuffer8BitAccess; reject unsupported predicated copies instead of executing them unconditionally. Ordinary copies retain the transfer path.QueueKindand accumulate compute/copy readback producer stages before the queue's host-stage filtering.Tested
Windows, RX 5700 XT, driver 32.0.21045.5002, RelWithDebInfo, Khronos validation and synchronization validation enabled. Synthetic inputs only.
d3d12_predicated_copy_test: 180 exact Vulkan/WARP/literal-oracle comparisons plus 16 query-to-copy cases. Four paired same-address recapture controls change exactly one 13-byte region. Predicate-buffer guards and untouched destination bytes match.vk_predicated_copy_test: 32 gated + 32 reused submissions, forced small descriptor/dispatch windows, dependent copies, failed-submit cleanup and direct/compute/copy host-stage controls: passed.vk_predicate_capture_test: 192 snapshots and tracker/queue integration controls passed. Replay A-G and all 1,663 existing typeless WARP readbacks passed.CopyResourcecomparison ind3d12_vulkan_device: a separate build of unmodified maine7584c52reproduces the same six mismatch reports exactly.git diff --checkpassed. Zero validation errors in the new GPU tests.Scope and limitations
Texture copies,
CopyResource, resolves and other predicated transfer operations remain outside this change. Predicated buffer copies require the enabled storage8 feature and a supported direct/compute queue; logical copy queues remain unsupported for predicate capture. Active pipeline-statistics queries are rejected to avoid counting internal compute work. Application compute bindings must be restored by future dispatch integration, as documented for #856.The query-to-copy fixtures use real empty ordinary/binary occlusion queries; they do not claim nonzero visible-draw coverage. Executing GPU overwrite copies supply the high-word-only replacement used by snapshot/recapture controls.
Checklist