perf(gpu): fast-path card_steps planning and groupshared tiled ambient compute #304
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!304
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-304"
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 03:40 UTC · original
Androtim:perf/card-steps-and-ambient-fast→main· +458 −78 · 2 files · 1 commits · merged 2026-12-02 03:48 UTCSummary
Speeds up CPU submission planning in
card_stepsand GPU compute efficiency inambient:card_stepsfast planning path (VICTORY_CARD_STEPS_FAST=0disables): omits per-frameStep::Refreshexpansions fromdoes_of_for(scanningrunson-demand only when a rareDoes::Copyoccurs) and short-circuitsplan_fastfor the common fill-only submission path without copies.ambientcompute & targeted UAV barriers: upgradesmeanto a 64-thread parallel reduction ([numthreads(64, 1, 1)]),gatherto[numthreads(8, 8, 1)]withgroupsharedcell/position tiling (20x12dispatch), precomputes pixel depth/spiral rotation inraise&reflect_light, and replaces internal globalNULLUAV barriers with resource-targeted barriers (uav_barrier_foroncells/points).Refs #276
Verification
cargo +1.98.1-x86_64-pc-windows-gnu xtask policy:320 files ok--locked):victory-gpuhost::card_steps::tests:13 passed, 0 failed(1 ignoredintegration benchmark), including 600-round randomized equivalence test (plan_fast_matches_baseline_plan_on_randomized_steps)victory-gpuambient::tests:15 passed, 0 failed(1 ignoredtiming test), including all 9 compute shaders (KEEP/keep,KEEP/mean,PLACE,GATHER,RAISE,RAISE_OUTLIERS,AIR,REFLECT,BOUND) and live D3D12 PSO creation (the_passes_build)clippy --workspace --all-targets --locked -- -D warnings(default +--features diagnostics): passed--releasebuild (--bin MiniVI --locked) +objdump -p: standard Windows DLLs onlyPaired Plain
--release90s A/B Benchmarks (RTX 4060 Ti 8 GB / 32 GB RAM, vsorigin/mainbee160d)1440p (
-PlayParity -Res 1440, 90s in-world):origin/main(bee160d)10.7 / 11.70 fps11.0 / 11.70 fps+0.30 fps(93.5 -> 91.25 ms,+284steady draws)37.2 / 36.95 ms34.15 / 34.20 ms-3.05 / -2.75 ms(-8.2%)12.3 / 13.10 ms11.35 / 12.00 ms-0.95 / -1.10 msasync_submitworked med56.30 ms54.75 ms-1.55 msmapped()stall rate5.59 ms/s4.07 ms/s-27.2%004K (
-PlayParity -Res 4k, 90s in-world):origin/main(bee160d)5.9 / 5.85 fps5.9 / 5.90 fps+0.05 fpssteady (170.4 -> 170.2 ms)30.1 ms28.0 ms-2.1 ms(-7.0%)async_submitworked med163.70 ms157.95 ms-5.75 ms00Diagnostics Visual Check (
--features diagnostics, 1440p, 90s):diag exit 0):pngs=24, lit=12/24, luma=99.98, near_black=0.06%, edge_energy=7.95, magenta=0.0%, crashes=0, bakes=16, failed=0, showed_another_view=0.frame-2316.png,frame-2332.png,frame-2340.png): clean indirect lighting, sky, water, geometry, and textures with zero shader artifacts.@Androtim on GitHub · 2026-12-02 03:48 UTC · original
Audited full diff (
8ad0a218,+458 -78acrosscrates/victory-gpu/src/ambient.rsandcrates/victory-gpu/src/host/card_steps.rs), both 90s plain---releaseA/B pairs (1440p & 4K), and--features diagnosticsvisual PNGs:ambient.rs): Verified all 64 threads uniformly hit bothGroupMemoryBarrierWithGroupSync()barriers ingather(20x12groups covering160x90,activeguards only thepointswrite),CELLS = 2304is an exact multiple of 64 formean,uav_barrier_forproperly dropsManuallyDropCOM refs afterResourceBarrier, and all 9 compute shaders + live D3D12 PSO creation pass.card_steps.rs& policy: Default-onVICTORY_CARD_STEPS_FAST=0kill-switch only (zero opt-in toggles), on-demandelsewhere_inscan for rare copies, fill-only fast path, and 600-round x 4-mode randomized equivalence tests passing.--release90s A/B vsmain(bee160d2):10.7 -> 11.0 fps(93.5 -> 91.25 ms),preparing 37.2 -> 34.15 ms(-3.05 ms/-8.2%),copyback 12.3 -> 11.35 ms(-0.95 ms),async_submit -1.55 ms,mapped() -27.2%,over=0 MB,final_waitingPASS (2,324),untranslated 4 -> 4,0crashes.5.9 -> 5.9 fps(steady5.85 -> 5.90),preparing 30.1 -> 28.0 ms(-2.1 ms),async_submit -5.75 ms,final_waiting 14,973 -> 13,257(-1,716),over=0 MB,untranslated 6 -> 6,0crashes.--features diagnosticsPNG inspection: All 6 gates PASS (diag exit 0); inspectedframe-2332.pngandframe-2340.pngdirectly — spotless outdoor/water indirect lighting,luma=99.98,near_black=0.06%,edge_energy=7.95,magenta=0.0%,showed_another_view=0.#300/#302, CI green (46804272497). Merging now.