gpu/shadow: opt-in ReBAR GPU_UPLOAD heap with VRAM guard & WC streaming (3/4 of #51) #58
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/58"
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 PastiiJay/klbf-lab. Originally posted by Vladimir-Human on 2026-11-26T00:43:59Z.
Split 3/4 of #51 cleanly on top of
beta(independent of #56, #57, and Part 4 Lazy Copy-Back).Summary of Changes (
crates/victory-gpu/src/shadow.rs)mod rebar(VICTORY_REBAR=1|2, default OFF): allocates host shadow buffers/windows inD3D12_HEAP_TYPE_GPU_UPLOADafter querying live adapter support and checking VRAM budget (1for windows only,2for windows + buffers, keepingVICTORY_CARD_BUFFERSVRAM copies preferred when carded).CARD_BYTES/WINDOW_CARD_BYTESifshared_bufferstaging allocation fails.VMOVNTDQAWC streaming helpers +_mm_sfence()ordering: addscopy_from_wc,slices_equal_wc,merge_gpu_into_title_runs,wc_sfence(), and TLSSCRATCH_WCso reads from write-combined ReBAR mappings avoid slow uncached byte reads while keeping sequential WC writes ordered.copy_jobs_wc/find_pieces_wc) and single-threadeddifferingto avoid thrashing PCIe read queues.rebar_tests::{rebar_wc_write_read_compare_roundtrip, simd_wc_and_gpu_merge_helpers_match_scalar_oracles}and#[ignore] bench_rebar(plusrebar::tests::rebar_decisions_and_concurrent_headroom_hold).Verification (
VICTORY_D3D12_DEBUG=1)cargo test -p victory-gpu-> passedcargo test -p victory-gpu --all-features-> passedcargo run -p xtask -- policy --staged->asset policy: 1 files ok(shadow.rs= 224,768 B)Related: #51, #56, #57
Imported from PastiiJay/klbf-lab. Originally posted by HandshakeHackin on 2026-11-26T02:58:59Z.
On hosted native Windows I forced the diagnostics software adapter and
VICTORY_REBAR=2atd29505a. WARP reported GPU-upload heap support, allocated and mapped the 256 KiB buffer, and completed the write/read/compare round trip, including detecting the altered byte. The verification wrapper required an initialized device and an explicit support or fallback marker, since the original live test can return early. This verifies buffer contents on WARP. The physical RX 9070 XT run is still needed for PCIe behavior and timings. Windows test and resultImported from PastiiJay/klbf-lab. Originally posted by PastiiJay on 2026-11-26T10:42:11Z.
Thanks @HandshakeHackin for the GPU-upload round trip on WARP. The ReBAR path still needs a real-card run on our side, we'll do that next.
Imported from PastiiJay/klbf-lab. Originally posted by Vladimir-Human on 2026-11-28T18:26:44Z.
Superseded by https://github.com/PastiiJay/klbf-lab/pull/185 cleanly ported onto
origin/stable-amd(75022ba).Pull request closed