perf(gpu): coalesce CBV descriptor batches and fuse FillsOnly card_steps #365
No reviewers
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: launcher
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
run report
security: hold
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs gpu test
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Androtim--MiniVI!365
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/365/head"
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?
@Androtim on GitHub · 2026-12-02 18:20 UTC · original
Androtim:perf/card-steps-fills-only-and-bitset→main· +750 −110 · 3 files · 1 commits · merged 2026-12-02 18:33 UTCCuts CPU
preparingandcard_stepssubmission latency by coalescing constant-buffer descriptor updates into 64-slot batches and eliminating per-step scan/HashSet overhead (#276).Changes
crates/victory-gpu/src/descriptor/host.rs,descriptor.rs)staged_cbv_batch, honoringVICTORY_VIEW_COPY=0) andHostHeap::constant_slots_batch()for non-sampler heaps without raw twins: stages up to 64 unique slot writes (cbv_chunk_lensplits on duplicate slot indices), coalesces contiguous runs viacoalesce_cbv_ranges(), and issues a singleCopyDescriptorsSimple/CopyDescriptorsper chunk instead of per-slot calls.descriptor::bucket_constant_ops()bucketing from/ 4to/ 64so worker threads own contiguous descriptor ranges and hit the batch fast path.FillsOnlycard_stepsfast path & data structures (crates/victory-gpu/src/host/card_steps.rs)Host::scan_and_take()to evaluateblocked_by,copied_read, andFillsOnlycandidate collection in a single pass under oneHostList::deferred()lock per list, bypassingdoes_of_for/plan_fast/fill_to()on fill-only submissions and falling back cleanly whenStep::Copy,Step::Placed, orStep::Runappears (withfill_tosalso captured duringdoes_of_forin the full path).HashSet<(usize, usize)>inTakenwith dense per-list bitsets (TakenBits).compact_writers+intern_shadow+holder_compact+first_readonOpto collapse duplicate in-flight ranges, eliminate per-opArc<Shadow>clones andplaces.removelookups, and build refresh spans in a tiny index-addressedVec.HashMapallocations inmapped()with a reusable thread-localMappedPagesset.Verification Gates
cargo +1.98.1-x86_64-pc-windows-gnu xtask policy->asset policy: 328 files okcargo +1.98.1-x86_64-pc-windows-gnu test -p victory-gpu card_steps --locked->16 passed; 0 failed; 1 ignoredcargo +1.98.1-x86_64-pc-windows-gnu test -p victory-gpu descriptor --locked->87 passed; 0 failed; 1 ignoredcargo +1.98.1-x86_64-pc-windows-gnu clippy --workspace --all-targets --locked -- -D warnings-> passcargo +1.98.1-x86_64-pc-windows-gnu clippy --workspace --all-targets --features diagnostics --locked -- -D warnings-> passobjdump -pon plain--releasebuild -> standard Windows system DLLs onlyPaired Plain
--releaseA/B Benchmarks (vsmain@8ff2a82,Series Xparity, DLSS Quality)ab2-main-8ff2a82-1440p-90svsab2-pr-cardsteps-1440p-90s):planning steps done on the card(card_steps):4.90 msmed /4.82 msmean (8.90 msmax) ->3.00 msmed (-38.8%) /2.95 msmean (5.30 msmax) across higher fills (1871.9->1973.8fills med;2.62 -> 1.52 msper 1000 fills)total_sub:34.15 msmed /37.85 msmean ->31.60 msmed (-2.55 ms) /31.98 msmean (-5.87 ms)preparing:25.25 ms->23.70 ms(-1.55 ms);copyback:9.85 ms->9.65 ms14.1 fps(70.9 ms) ->14.2 fps(70.4 ms,max_draws12246->13573); min FPS:0.9->5.2 fpsmapped():1.45 ms/s(538.6 mstotal, longest19.8 ms) ->0.50 ms/s(383.2 ms, longest11.1 ms);crashes=0ab2-main-8ff2a82-4k-90svsab2-pr-cardsteps-4k-90s):planning steps done on the card(card_steps):6.70 msmed /6.45 msmean ->4.75 msmed (-1.95 ms) /5.08 msmeantotal_sub:155.15 msmed /137.68 msmean ->149.40 msmed (-5.75 ms) /133.21 msmeanpreparing:20.9 ms->17.7 ms(-3.2 ms);copyback:14.4 ms->13.95 ms6.3 fps(158.5 ms) ->6.5 fps(154.2 ms,+0.2 fps / -4.3 ms)6345 MB->6243 MB(-102 MB);mapped():4.18 ms/s->1.62 ms/s;crashes=0--features diagnosticsVisual Verification (diag-pr-cardsteps-1440p-90s, 90s 1440p)world_windows=20(max_draws=12486),crashes=0,used_max=5849 MB(over=0 MB,room_false=6.2%),final_waiting=2463,mapped_rate=0.76 ms/s,pngs=24(lit=19/24,luma=95.09,near_black=0.1%,edge_energy=7.72,magenta=0.0%).frame-2414.png,frame-2422.png, andframe-2428.png: sharp textures, natural lighting, water reflections, and crisp HUD overlays.