gpu(draw,host): scan root views for bake sources and pin copies on bake list #156
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/156"
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 Androtim/MiniVI. Originally posted by Androtim on 2026-11-29T19:14:09Z.
Addresses #150
Prevents bindless decoration bake sources from being missed or evicted between bake recording and GPU execution:
Changes
crates/victory-gpu/src/draw.rs(State::bake_sources,bake_srv_slice):RootType::Descriptor, reading up to 4096 bytes) and root descriptor pixel-stage SRVs (RootType::Descriptor, narrowed bybake_srv_slicewhen record range + stride apply) alongside descriptor-table CBVs/SRVs.crates/victory-gpu/src/host.rs&crates/victory-gpu/src/draw.rs(HostList::keep_copies,bring_bake_sources,early_textures):Deferred::kept_copiesandHostList::keep_copies(cleared onHostList::resetand included inuntouched()).Arc<HostTexture>copies inbring_bake_sourcesacross all valid source branches (is_aliased, host-written, unchanged,upload_listed, and uploaded) and pinned them onto the bake draw'sHostListinearly_texturesinstead of droppingsync.keepright afterBAKE_UPLOAD, keepingArc::strong_count > 1until GPU execution finishes solet_go_idle/slot_evictcannot evict active bake sources mid-flight.bake_srv_slice_respects_range_for_bounded_and_root_buffersunit test.Verification
cargo +1.98.1-x86_64-pc-windows-gnu run --locked -p xtask -- policycargo +1.98.1-x86_64-pc-windows-gnu test -p victory-gpu --locked -- draw::cargo +1.98.1-x86_64-pc-windows-gnu test -p victory-gpu --locked -- host::cargo +1.98.1-x86_64-pc-windows-gnu clippy --workspace --locked --all-targets -- -D warnings(default features and--all-features)Imported from Androtim/MiniVI. Originally posted by Androtim on 2026-11-29T19:23:55Z.
Live RTX 4060 Ti 8 GB verification (
scripts/verify-world.ps1with--features diagnosticsforVICTORY_CAPTURE,VICTORY_SLOT_EVICT=1,86/80%eviction thresholds,VICTORY_TEXTURE_ROOM_PERCENT=88, Series S 60s warm runb701929a):stderr.log):decoration bakes' sources, since the start bakes=16 sources=185 current=144 showed_another_view=3 no_host_copy=0 other_bytes=31 host_written_published=7 not_mapped=0 failed=0flushed deferred texture stand-ins before decoration bake:settled=truePASS):pngs=24,lit=15/24, median luma103.41, near-black1.49%, edge energy7.4, max magenta0.0%frame-4449.png,frame-4481.png) confirms clean skin, clothing, foliage, water, lighting, and UI with zero colored-square artifacts.Reached real 3D world(world_windows=15,max_draws=11157),Zero crashes / DRED / panics(crashes=0,no_host_texture_errors=0),Residency stalls bounded(mapped_rate=4.35 ms/world_sec),Visual lighting & texture detail. (median 10.6 fps)origin/mainwithout PR #153's pool-hole reuse (reuse_pool_when_full), runningVICTORY_SLOT_EVICT=1at86/80%whileused=5467 MB+ buffers (127 MB) + pending render targets (559 MB) exceeded the5963 MB(88%) room line leftroom_false=83.3%andfinal_waiting=8206(which is already solved on PR #153).Imported from Androtim/MiniVI. Originally posted by Androtim on 2026-11-29T20:03:14Z.
Automated triage for the maintainers (not an approval).
Verdict:
needs-gpu-test· CI (check):passingReview Summary
CI is passing, the diff is focused and clean, and the logic addresses both parts of the bindless decoration-bake source race:
crates/victory-gpu/src/draw.rs):State::bake_sourcesnow scansRootType::Descriptor(Root::View(address)) for CBVs (up toROOT_CBV_BYTES = 4096) and pixel-stage SRVs (passed through the newbake_srv_slicehelper withlen = u64::MAX, clamped toMOST_BYTES = 64 KiBinread), alongside existingRootType::Tableentries.bake_srv_sliceis covered by the new unit testbake_srv_slice_respects_range_for_bounded_and_root_buffers.crates/victory-gpu/src/draw.rs,crates/victory-gpu/src/host.rs):State::bring_bake_sourcesnow pushescrate::resource::host_copy(resource)intosync.keepacross all valid source branches (is_aliased, host-written,shown && unchanged,upload_listed, and freshly uploaded).State::early_texturestransferssync.keepto the bake draw's command list vialist.keep_copies(sync.keep)instead of dropping it immediately afterBAKE_UPLOAD.HostList::keep_copies,Deferred::kept_copies,Deferred::clear, andHostList::untouchedare wired consistently so pinnedArc<HostTexture>copies stay alive until the bake list resets.Minor Non-Blocking Notes
bake_srv_slice, checkingend > first(in addition tostride > 0 && u64::from(end) * stride <= len) and usingaddress.checked_add(...)would harden the helper against reversed ranges or address wrap if ever called outsidebake_record_range.kept_copiesand that root CBV/SRVread_intoscans behave cleanly near allocation boundaries).Verdict
needs-gpu-test— Logic and tests look solid with CI passing; ready for a local real-GPU smoke test.Generated with Antigravity CLI (
agy).Imported from Androtim/MiniVI. Originally posted by Androtim on 2026-11-29T21:27:18Z.
Automated RTX 4060 Ti 8 GB Open-World A/B hardware verification PASSED (
playtest/wave5vsorigin/mainb1b6dc1,VICTORY_LEVELS_ON_DEMAND=0play-parity):cargo test(RTX 4060 Ti): 645 passed, 0 failed (victory39/39,victory-shaderemit::wave64_tests19/19 &lower19/19,victory-gpu568/568).scripts/verify-world.ps1, DLSS Quality + open-world save):9.4 fpsvs7.5 fps(+1.90 fps / +25%), min8.3 fpsvs0.8 fps, preparing53.6 msvs60.0 ms5760 MBvs6005 MB(-245 MB,0 MBover budget);no room for new oneshalved (9,000vs18,000);max_waitingdropped (36,432vs41,431)0mismatches (other_bytes=0, showed_another_view=0, failed=0vs5and2on baseline)mapped_rate1.63 ms/svs6.9 ms/s(-76%, max12.9vs51.9 ms)frame-5975.png,frame-5983.png),edge_energy=4.69vs3.88,near_black=0.02%,magenta=0.0%(and#1412bf6800showed zero visual artifacts).