fix,perf(shader,gpu,hle): pin polling loop headers, CUDA preload fence, ambient chroma scrub, and RT-off BVH/dead-pass skips #401
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/401"
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-12-03T17:20:49Z.
Ports four high-impact GPL-3.0 stability, visual quality, and GPU performance fixes onto
mainwhile staying 100% title-neutral and preservingVICTORY_HW_RT=1,VICTORY_BVH_BUILDER=1,VICTORY_RAYS=1, and non-NVIDIA GPU behavior.Summary of Changes
1. Pin loop headers in
srv_memory_regionsacross polling loops (Critical Hang Fix)crates/victory-shader/src/emit/bitcode/opt.rs,crates/victory-shader/src/emit/mod.rswashingtonrbo/ochin-nvidia(d0fe794, GPL-3.0)idom) and RPOnumber+dominates()onTree, and pinned both natural loop headers and irreducible RPO back-edge targets (number[b] <= number[p]) as distinct memory-region origins insrv_memory_regions()before the fast-path!has_writes && !has_loopscheck.DOM_LOADS(kept enabled by default) from hoisting/merging SRV loads across spin-wait polling loops — even in shaders without global buffer writes — fixing multi-minuteDXGI_ERROR_DEVICE_HUNGtimeouts introduced by #396.raw_srv_reuse_across_non_aliasing_writes_and_group_barriersand addedpolling_loop_backedge_never_merges_srv_load_with_pre_loop_or_across_iterationscovering tight self-loops, multi-block loops, and irreducible 2-entry loops.2. Pre-title
VICTORY_CUDA_PRELOADaddress-window reservation (Startup Crash Fix + FPS)crates/victory-gpu/src/window.rs,crates/victory-gpu/src/lib.rs,crates/victory-gpu/src/streamline.rs,crates/victory-gpu/src/upload.rs,crates/victory-hle/src/modules/xmem.rsSandBar-developer/VIctory-SandBar(0fd6d57, GPL-3.0)window.rshelpers (TITLE[4 GiB, 2^37),allocating(),regions(),free_runs(),title_free(),Fence,fence_title()) and serialized concurrent title-window allocations inupload::allocate_in_windowandxmem::XMemVirtualAlloc.preload_cuda()holds free holes in the title window withFencewhile callingcuInit(0)(VICTORY_CUDA_PRELOAD, default on unless=0), forcing CUDA reservations above2^37before title allocations begin and logging reclaimed/remaining space.nvcuda.dllorcuInitis absent or DLSS/FG is inactive, leaving AMD and Intel GPUs 100% unaffected.3. Specular
CLEANluminance cap,chroma_scrub, andRole::Missgather reusecrates/victory-gpu/src/ambient.rsHUAXIANs/VIctory-RTX(e49340b, GPL-3.0)#define CLEAN(VICTORY_AMBIENT_CLEAN, default on unless=0) capping stand-in reflectionfound = min(found, 1.5)inreflect_lightandbound_light.chroma_scrub(VICTORY_AMBIENT_CHROMA_SCRUB, default on unless=0, bumpingWORDSto18) to suppress acid-green and electric-cyan probe spikes alongside magenta/blue-violet garbage, and fixedwithout_depth()(bound_light) to upload allWORDSroot constants includingfilterandchroma_scrub.miss_needs_gather()soRole::Missreuses already-gathered screen points inSet::Estimatemode instead of re-running a redundant full-screen gather pass.VICTORY_HW_RT=1completely untouched. Verified with unit tests plus a WARP D3D12 compute test (reflect_and_bound_clean_cap_and_chroma_scrub_on_gpu).4. RT-off
XboxBvhBuilder.dllbuild/rehydrate stub & dead RT compute skipscrates/victory-hle/src/modules/xboxbvh.rs,apps/victory/src/run.rs,crates/victory-gpu/src/pipeline.rs,crates/victory-gpu/src/draw.rsReZOnGithub/VIctory-lap(4b88ef0, GPL-3.0),HUAXIANs/VIctory-RTX(e49340b/readmet3xt-lab/foxhound#418, GPL-3.0),upsidedownstack/VIctory-Performance(487fc68, GPL-3.0)xboxbvh::Interpose(VICTORY_BVH_STUB, default on unless=0) inrun.rsimport binding (startup DLLs, main image, and late-loaded DLLs) to stub the 8 GPU BVH build/copy/rehydrate/validate exports ofXboxBvhBuilder.dllas no-ops when RT is off, while leavingctor,dtor,Set64BitMortonCodes, andGetRaytracingAccelerationStructurePrebuildInfoon the title DLL.DeadRtclassification and skip gates (DeadRt::ResolveforCS_RaytracingResolveviaVICTORY_RT_SKIP_RESOLVE;DeadRt::FeedsforCSComputeSkinning,CSGenerateHairVB,CS_ScreenProbes_TraceRays*, andCS_RaytraceVBuffer*withoutVoxels/FallbackviaVICTORY_RT_SKIP_DEAD, default on unless=0) inpipeline.rs(dead_rt_left_out) anddraw.rs(State::dispatch,State::execute_indirect).VICTORY_HW_RT=1,VICTORY_RAYS=1, orVICTORY_BVH_BUILDER=1is active.Verification
cargo +1.98.1-x86_64-pc-windows-gnu test -p victory-hle --lib xboxbvh::->4 passed; 0 failedcargo +1.98.1-x86_64-pc-windows-gnu test -p victory-shader --lib bitcode::opt->19 passed; 0 failedcargo +1.98.1-x86_64-pc-windows-gnu test -p victory-gpu --lib -- window:: streamline:: ambient:: pipeline::tests::->50 passed; 0 failed; 1 ignored(measurement-onlyname_scans_time)cargo +1.98.1-x86_64-pc-windows-gnu test -p victory-gpu --lib -- window:: streamline:: ambient:: pipeline:: draw::->97 passed; 0 failed; 2 ignored(prior to fixingProvenance::Titletest compilation invictory-hle)cargo +1.98.1-x86_64-pc-windows-gnu clippy --workspace --all-targets -- -D warnings-> passed (0 warnings)cargo +1.98.1-x86_64-pc-windows-gnu clippy --workspace --all-targets --all-features -- -D warnings-> passed (0 warnings)cargo +1.98.1-x86_64-pc-windows-gnu run -p xtask -- policy->asset policy: 354 files okImported from Androtim/MiniVI. Originally posted by Androtim on 2026-12-03T17:35:48Z.
Triage (
101dc008, CIcheckPASS — run47161327469):+1,416/-66across 12 files) with zero opt-in toggles (all newVICTORY_*guards are default-on=0kill-switches):#396hang fix (opt.rs,mod.rs): pins natural loop headers and irreducible RPO back-edge targets insrv_memory_regions()before!has_writes && !has_loopssoDOM_LOADScannot hoist/merge SRV loads across spin-wait polling loops.VICTORY_CUDA_PRELOAD(window.rs,streamline.rs,upload.rs,xmem.rs): fences title address window[4 GiB, 2^37)duringcuInit(0)when DLSS/FG is active; no-op on non-NVIDIA GPUs.ambient.rs): specularCLEANluminance cap (1.5),chroma_scrub(WORDS = 18, fixedwithout_depth()), andRole::Missgather reuse inSet::Estimate.xboxbvh.rs,run.rs,pipeline.rs,draw.rs): stubs 8 GPUXboxBvhBuilder.dllbuild/copy/rehydrate/validate exports and skipsDeadRt::Resolve/DeadRt::Feedswhen RT is completely off.#282) + Gate 3 live GPU verification:srv_memory_regionsback-edge pinning soundness, (b)window::FenceVirtualFreecleanup on all exit paths & lock ordering withupload/xmem, (c)ambient.rsWORDS = 18root-constant binding across all callers +miss_needs_gatherlifetime, and (d) confirmingDeadRt::Feeds(CSComputeSkinning,CSGenerateHairVB) are strictly RT-only feeds that cannot regress RT-off character skinning or hair rendering.--releaseA/B vsmain(21fcafdc) +--features diagnosticsvisual PNGs (characters, hair, reflections, ambient lighting, 0 hangs/DRED) + quickVICTORY_HW_RT=1non-regression smoke.Imported from Androtim/MiniVI. Originally posted by Androtim on 2026-12-03T19:32:41Z.
Marking
triage: needs rebaseafter#402(158fba11) merged ontomain(overlappingambient.rs). Once rebased cleanly with green CI, ready for Gate 2 + Gate 3 GPU verification.