feat(gpu): bound send spare pool and trim idle shader DXIL #305
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!305
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-305"
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 04:46 UTC · original
Androtim:feat/send-spare-and-dxil-trim→main· +301 −25 · 4 files · 1 commits · merged 2026-12-02 04:52 UTCSummary
Addresses
[USER PRIORITY — MEMORY REALITY CHECK]in #276 by trimming retained host/upload allocations without introducing submission allocation churn:Right-sized upload send slabs & stale-first pressure trimming (
crates/victory-gpu/src/host/send.rs,crates/victory-gpu/src/host.rs):8 MiBto1 MiB(powers of two up to16 MiB, then8 MiBsteps above16 MiB) to eliminate 8x over-commit on small submissions and 2x overshoot on large bursts.768 MiBuntrimmedSPAREcap with pressure-aware working-set limits (96 / 128 / 192 / 256 MiBoff-card;64 / 96 / 128 MiBon-card) and addssend::trim_under_pressureintohost::sweep()(evicting stale idle slabs >= 5–10s first down to32 MiB, droppingID3D12Resources asynchronously viadrop_aside).VICTORY_SEND_SPARE_TRIM=0kill-switch.Idle compiled shader DXIL trimming with transparent reload (
crates/victory-gpu/src/pipeline.rs,crates/victory-gpu/src/pipeline/host.rs,crates/victory-gpu/src/host.rs):Translated.host.dxilinto an independently releasable slot while keeping translation metadata resident.pipeline::trim_shader_bytecodetohost::sweep(), dropping idle DXIL buffers after 30 s normal / 10 s pressured / 5 s critical commit (~76–84 MBreleased down to0 MBin steady state) and reloading transparently fromshader_cacheviaShader::dxil()if another pipeline later shares that shader.VICTORY_SHADER_TRIM=0kill-switch.Verification
cargo +1.98.1-x86_64-pc-windows-gnu xtask policy—asset policy: 320 files okcargo +1.98.1-x86_64-pc-windows-gnu test -p victory-gpu --lib --locked -- send_spare_limit send_alloc_size trim_spare_items shader_trim_enabled shader_dxil_idle_ms— 5/5 passedcargo +1.98.1-x86_64-pc-windows-gnu clippy --workspace --all-targets --locked -- -D warnings(default and--features diagnostics) — passed (0 warnings)--release --bin MiniVI --locked+objdump -p— passed, standard Windows DLLs onlyPaired Plain
--release90s A/B vsmain(001702f)(RTX 4060 Ti 8 GB / i7-13700F / 32 GB RAM,
-PlayParity -WorldSeconds 90)mainmain14.0 fps(71.7 ms)14.95 fps(66.85 ms)6.6 fps(151.7 ms)6.6 fps(151.4 ms)verify-world/ core avg)26.4 ms/28.19 ms26.7 ms/26.14 ms23.4 ms/31.91 ms20.4 ms/28.42 mssend::takemedian0.95 ms0.88 ms0.59 ms0.57 ms18993 / 21251 / 21742 MB15146 / 18790 / 19609 MB18794 / 21669 / 21930 MB15726 / 19443 / 20356 MB19607 / 21257 / 21873 MB17518 / 20663 / 20979 MB19841 / 21973 / 22446 MB18302 / 21324 / 21889 MB5350 / 5713 MB5091 / 5258 MB6066 / 6208 MB5632 / 5775 MBroom=false6317 MB(5.9%)6144 MB(0.0%)6532 MB(94.7%FAIL)6515 MB(78.9%PASS)395 MB2594 MB471 MB2101 MB0000Diagnostics 1440p 90s Visual & Memory Gate (
--features diagnostics)world_windows=19,crashes=0,used_max=6209 MB / budget_min=6699 MB,room=false 0.0%,pngs=24,lit=20/24,luma=101.1,near_black=0.06%,edge_energy=7.73,magenta=0.0%).copystatconfirmed retained translation DXIL dropped from84 MBduring initial shader compilation to0 MBin steady state; inspected output frames showed clean textures, water reflections, foliage, and indirect lighting.@Androtim on GitHub · 2026-12-02 04:50 UTC · original
Autonomous architectural audit PASSED on
88347e90:VICTORY_SEND_SPARE_TRIM=0andVICTORY_SHADER_TRIM=0kill-switches only), right-sizedsend_alloc_size(1..16 MiBpowers of two,8 MiBsteps above), lock-safetrim_spare_items+drop_aside, and safeShader::dxil()reload withArc<[u8]>lifetime pinned acrossCreate*PipelineState+rect_list_gs(zero stalehost.dxilreaders remaining incrates/victory-gpu).--releaseA/B (memtrim2vs001702fc, 0 crashes / 0 DRED):14.0 -> 14.95 fps(+0.95 fps), core avg preparing28.19 -> 26.14 ms,working_set_mb-3,847 MBavg /-2,461 MBmed /-2,133 MBmax,private_commit_mb-2,089 MBavg /-894 MBmax,shared_mb-455 MBmax,dedicated_mb6,317 -> 6,144 MB(room_false 5.9% -> 0.0%),final_waiting4,121 -> 2,738(-33.6%), end free RAM395 -> 2,594 MB(+2,199 MB).6.6 -> 6.6 fps(151.7 -> 151.4 ms),preparing23.4 -> 20.4 ms(-3.0 ms),working_set_mb-3,068 MBavg /-2,226 MBmed /-1,574 MBmax,private_commit_mb-1,539 MBavg /-557 MBmax,shared_mb-433 MBmax, VRAM gateFAIL (94.7%) -> PASS (78.9%),final_waiting12,271 -> 11,469, end free RAM471 -> 2,101 MB(+1,630 MB).luma=101.1,near_black=0.06%,edge_energy=7.73,magenta=0.0%, retained DXIL84 MB -> 0 MB); captured PNGs inspected directly — crisp lighting, textures, and reflections with zero visual regressions.Status: Waiting on CI run
46812254254(Testscurrently in progress;Clippy+Clippy, diagnostics buildalready green). Will squash-merge automatically once green.