gpu(host): pool HostList scratch UAVs and wire ahead::card_if_ready #145
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/145"
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-29T15:32:19Z.
Pools
HostListdevice-local scratch UAV buffers and reuses pre-made 64 KiB card buffers:crates/victory-gpu/src/host/uav_pool.rs(UAV_SPARE,VICTORY_UAV_POOL=0disables):COMMON-state device-local scratch UAVs in power-of-two multiples of 64 KiB (up to 16 MiB) forcard_budget,indirect_scratch,batch_place, andplace::between.betweenbuffers back toCOMMONonHostList::close, retires buffers atDeferred::clear/Deferred::dropandHostList::drop, and releases them intoUAV_SPAREonce submissions complete inbury().VICTORY_ALLOCATOR_TRIMidle windows and VRAM/host commit pressure (sweep_uav_spare/trim_uav_spare_pressure) with a 16 MiB warm floor under mild pressure.crates/victory-gpu/src/ahead.rs&crates/victory-gpu/src/host.rs:ahead::card_if_ready()soHost::uav_buffer(64 KiB)reuses pre-made card buffers without spawningvictory-aheadduring offline tools, while preservingHost::uav_buffer_now(unwaited internal pass semantics) and addingHost::uav_buffer_resident_now.Verification
cargo +1.98.1-x86_64-pc-windows-gnu xtask policy(305 files ok)cargo +1.98.1-x86_64-pc-windows-gnu test -p victory-gpu uav_pool:: --locked(3 passed; 0 failed; 1 ignoredincluding live D3D12 lifecycle test)cargo +1.98.1-x86_64-pc-windows-gnu test -p victory-gpu ahead:: --locked(3 passed; 0 failed)cargo +1.98.1-x86_64-pc-windows-gnu clippy --workspace --all-targets(--lockedand--features diagnostics --locked,-D warnings)Imported from Androtim/MiniVI. Originally posted by Androtim on 2026-11-29T15:41:54Z.
Ran a 75s Series S live GPU smoke test (
--release --features diagnostics,-AutoNudgeMenu) viascripts/verify-world.ps1intoD:\victory-data\verify-runs\wave2-uav-pool.Unit & Policy Update
cargo +1.98.1-x86_64-pc-windows-gnu test -p victory-gpu ahead:: --lockedactually ran and passed 5 tests (5 passed; 0 failed—3inahead::tests+2intexture::ahead::tests).Live 75s Series S GPU Verification
42s(world_windows=17,max_draws=10071).crashes=0,no_host_texture_errors=0,untranslated=1,used_max=5657 MB/budget_min=6713 MB(over=0 MB,room_false=7.1%),mapped_rate=4.51 ms/world_sec(14200calls,1027.9 mstotal, longest10.4 ms).lit=14/24,luma=105.22,near_black=0.01%,edge_energy=7.31,magenta=0.0%; visually inspectedframe-3209.pngandframe-3217.png(clean outdoor daylight rendering, water, foliage, HUD, and text).baseline-main:9.5 fpsvs8.9 fps(+0.60, PASS)5657 MBvs5864 MB(-207 MB, PASS)1951vs7121(-5170, PASS)105.22 / 7.31vs103.2 / 7.11(PASS)world_drops_no_pipe_max):294vs261.0(+33over older pre-PR #117 baseline threshold — noteuav_pooldoes not touch pipeline creation).Imported from Androtim/MiniVI. Originally posted by Androtim on 2026-11-29T16:06:06Z.
Automated triage for the maintainers (not an approval).
Verdict:
needs-gpu-test· CI (check):passingReview Summary
Logic, D3D12 state transitions, and memory-pressure handling look solid, and CI is passing. Because this PR modifies D3D12 host buffer allocation/recycling, resource barrier lifetimes, and VRAM-pressure trimming, a local real-GPU smoke test is warranted before merging.
Verified Details
HostList::between(crates/victory-gpu/src/host/place.rs) is only called byplace_copyandplace_source, both of which overwrite[0, len)and leave the buffer inD3D12_RESOURCE_STATE_COPY_SOURCE.HostList::between_commontransitionsbetween_uavsback toCOMMONonHostList::closebefore moving them toretired_uavs. If a list is reset or dropped without closing, the unsubmitted buffers remainCOMMONand are safely retired viaDeferred::clear/Deferred::drop.HostList::make_card_budget,indirect_scratch, andbatch_place(crates/victory-gpu/src/host.rs) all overwrite their active ranges before reading and transition back toCOMMONonclose(card_budget_out,indirect_common,batches_common) or mid-list replacement, matchingUAV_SPAREreuse assumptions.aheadintegration (crates/victory-gpu/src/ahead.rs,crates/victory-gpu/src/host.rs):ahead::card_if_ready()checksCARD_WANTEDwithout spawningvictory-ahead, andahead::fill()switches tohost.uav_buffer_resident_now(SIZE)so the background filler cannot pop its own pre-allocated buffers in a loop.crates/victory-gpu/src/host/uav_pool.rs):retire_uavs/drain_retired_uavs(hooked frombury) defer returning buffers toUAV_SPAREuntilFINISHED >= STARTED + queued, andsweep_uav_spare/trim_uav_spare_pressuretrim to the 16 MiB warm floor or 0 under VRAM (88%/95%) or host commit pressure.drain_retired_uavsuses rawfinishedrather thanfinished.saturating_sub(bury_lag()), which is reasonable here since these scratch UAVs are private to their owningHostListand not shared across unrelated command lists.Recommendation
Run the local D3D12 GPU tests (including debug layer validation) and a short gameplay smoke test to verify zero D3D12 barrier/residency warnings and VRAM behavior under load.
Generated with Antigravity CLI (
agy).Imported from Androtim/MiniVI. Originally posted by Androtim on 2026-11-29T16:41:22Z.
Automated RTX 4060 Ti 8 GB hardware verification PASSED (
playtest/wave4-no141vsorigin/main17a2f09— 5/5 A/B gates PASS):cargo test(RTX 4060 Ti):victory39 passed, 0 failed;victory-gpu552 passed, 0 failed (37 ignored).scripts/verify-world.ps1, DLSS Quality + golden autosave):11.9 fps(84.15 ms) vs11.2 fps(88.9 ms) baseline (+0.70 fps, min improved7.0vs4.6, preparing43.2 msvs45.1 ms)5641 MBvs5760 MB(-119 MB,0 MBover budget)final_waiting=5924vs5753(PASS)mapped_rate=8.69 ms/svs14.96 ms/s(-42%)frame-3923.png,frame-3955.png), luma66.54, edge energy2.1, magenta0.0%.