No reviewers
Labels
No labels
accessibility
bench-bm-v1
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/PastiiJay--klbf-lab!46
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-46"
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?
@Vladimir-Human on GitHub · 2026-11-25 21:08 UTC · original
Vladimir-Human:perf/vram-12gb-warp-fix→beta· +1659 −184 · 10 files · 4 commits · openAI-assisted clean-room contribution (
victory-gpu, D3D12 WARP/hardware unit tests only — refs #30 and fixes #32; no title files used).Summary
Combines two orthogonal improvements in
crates/victory-gpu/src/onbeta(e328c88):DynamicPool(helps #30):resource.rs: eliminates theroom_percent..90%idle-eviction dead zone (evict_trigger_percentdefaultroom_percent - 2, floor45), tightens high-pressure grace to 30 frames / 1000 ms, includestiles::Tiledreserved textures (HostTexture::card_bytes()) +card_room_kept() + targets_room_kept()+tiles::given_total()in pressure accounting, adds safe rate-limitedreclaim_unpinned_idlefallback inroom(), and closes the Pass 1 -> Pass 2 TOCTOU window by re-verifyinghost_wrote,is_idle_at, COM pointer identity,Arc::strong_count == 1, andhost::references == 1underr.host.madebefore retiring outside locks.descriptor/host.rs&descriptor.rs: replaces linear ring-walk +too_longwith a coalescingO(1)bitmask small-bucket (1..=32) +BTreeSetlarge-extentDynamicPool, opens fullcount..nullview-heap headroom, and keepsHostHeap::evict_keptstrictly aligned withHostHeap::mirror'sSHADER_HEAPS -> made -> {kept, placed, textures}lock order while retiring COM refs outside all locks (zero edits toHostHeap::mirror/ stripes in #16).texture.rs: tracksStaging::{copy_queued, unflushed}accurately across multi-list submissions (defer_hostclear immediately afterdefer_texture) and trims clean idle staging buffers under pressure while keeping host textures and dirty/unflushed uploads intact.d3d10warp.dll0xc0000005test crashes & parallelwatch::testsVA-reuse flake (#[cfg(test)]ONLY):host::warp_test_lock()guarding all 5 WARP D3D12 test fixtures (host.rs,indirect.rsWarpHarness,inplace.rs,shadow.rs,tiles.rsRig),Host::test_sweep_lock()for sweep/eviction tests, and movestitle_memory_remapped(...)beforeUnmapViewOfFile/VirtualFreein the 3watch.rs#[cfg(test)]view-teardown tests (matchingDrop for Viewso parallel Windows VA reuse never collides). Zero non-test runtime edits for #32, zero weakened/skipped/retried assertions.Verification (
betae328c88, RTX 4070 SUPER / i5-13400F, Rust 1.98)git diff --check beta..HEAD: clean;git merge-treeclean againstbeta, #41, #42, #43, and our BVH PR.cargo clippy -p victory-gpu --all-targets(default&--features diagnostics): 0 warnings in all added/modified code.cargo test -p victory-gpu --lib --lockedruns (WITHOUT--test-threads=1): 10/10 PASSED (161 passed; 0 failed, 3 ignored per run,1.29s–5.29s, 0 WARP crashes).@PastiiJay on GitHub · 2026-11-25 21:10 UTC · original
Thanks a lot @Vladimir-Human! The 12 GB dead-zone stalls are what @mayauxpaul8-droid hit in #30, and a fix for the #32 parallel WARP test crash is welcome too. Same as your other PRs: it goes into our one-change-at-a-time queue on the RX 9070 XT (same save, same 7-minute run, fps and picture against our reference build), and results will be posted here. A run on a 12 GB card from #30 would be the real proof, so @mayauxpaul8-droid, if you can test this branch, please say so here.
@HandshakeHackin on GitHub · 2026-11-25 21:20 UTC · original
Two details for interpreting the hardware retests. The original #30 tester reports a standard RTX 4060, which NVIDIA lists with 8 GB. The other tester in that issue reports a 16 GB RTX 4080 SUPER. The 4060 run would give us an 8 GB comparison. A 12 GB card would cover the capacity in the PR title. RTX 4060 report · 4080 SUPER report · NVIDIA specifications
I also ran the threshold functions from
b1c90b3in isolation with a synthetic 10 GiB budget. With both environment overrides unset, eviction became preemptive at 88% effective usage and high-pressure at 90%. WithVICTORY_TEXTURE_ROOM_PERCENT=82, those transitions were 80% and 82%, as in the unit fixture. The fixture comment calls 82 the default. Including the room setting and thevram_used_mb/vram_budget_mbvalues from the eviction line would make the A/B results easier to compare. Threshold calculation@PastiiJay on GitHub · 2026-11-25 21:23 UTC · original
Thanks for the correction @HandshakeHackin, you're right: the RTX 4060 in #30 is the standard 8 GB model, so I was wrong to call it a 12 GB case. A run there gives us an 8 GB comparison, and a 12 GB card would still be the direct test of the PR title.
Noted for our A/B runs: we'll log the room setting and the
vram_used_mb/vram_budget_mbvalues from the eviction line. @Vladimir-Human, your thresholds come out at 88/90% with the overrides unset while the fixture comment calls 82 the default; could you say which one you intended?@Vladimir-Human on GitHub · 2026-11-26 00:04 UTC · original
@PastiiJay @HandshakeHackin 88/90% is the intended default: preserving klbf-lab's existing
oom_percent() = 90 default, with preemptive eviction starting 2 percentage points below (88%) to eliminate any dead-zone regardless of VICTORY_TEXTURE_ROOM_PERCENT.
The 82 in the unit test fixture comment was a stale leftover from ictory-perf when porting #30. Pushed
9c68c0bto update crates/victory-gpu/src/resource.rs:oom_percent = 90, rigger = 88: no trigger at 87%, preemptive at 88%, high pressure at 90%).
Re-verified cargo test -p victory-gpu resource (12/12 passed) and cargo run -p xtask -- policy --staged (1 files ok). Ready for your A/B queue!
@PastiiJay on GitHub · 2026-11-26 00:05 UTC · original
Clear, thanks @Vladimir-Human: 88/90% as the default, 82 only as the explicit override, and the test now says so. It's in the queue.
9c68c0bb81to1d01dfa5fd@Vladimir-Human on GitHub · 2026-11-26 11:01 UTC · original
Rebased cleanly onto
klbf-upstream/beta(6cce57e->1d01dfa), preserving#63(VICTORY_TEXTURE_MAX_DIM),#61,#64,#25, and#18, plus a 1-line fix (1d01dfa) passinghad_copy = falsetoStaging::detile(data, false)in#63'scapped_placed_texture_stages_the_retained_title_miptest.Re-verified on
1d01dfa(rustc 1.98.1):git diff --check klbf-upstream/beta: cleancargo run -p xtask -- policy:asset policy: 190 files okcargo clippy --workspace --all-targets --locked -- -D warnings -A deprecated(default &--all-features): 0 warnings across all 10 touched files (only pre-existingobject.rs:77,134AtomicU32::fetch_updatedeprecation warnings remain on untouchedbeta)cargo test -p victory-gpu -- --test-threads=1(default) &VICTORY_D3D12_DEBUG=1:168 passed; 0 failed; 5 ignoredcargo test -p victory-gpu --lib --locked(default parallel):168 passed; 0 failed; 5 ignoredVICTORY_TEXTURE_MAX_DIM=512 cargo test -p victory-gpu --lib --locked -- --ignored capped_placed_texture_stages_the_retained_title_mip:1 passed; 0 failed@PastiiJay on GitHub · 2026-11-26 11:08 UTC · original
Thanks for the clean rebase onto current beta, and for spotting the
had_copyslip in the #63 test. The 12 GB dead-zone fix is next in line for an in-game run on our side.@Kal0s-design on GitHub · 2026-11-26 12:50 UTC · original
Independent check of the #32 part on Windows 11 (unit tests only, WARP runs on the CPU, no game files). Base
beta6cce57e, head1d01dfa, Rust 1.98.1 MSVC.I split the two halves of the fix to see which one does what. Four test binaries, run round robin 100 times each,
victory-gpu --libwith the default thread count:watchtest failedwatch.rsreorderwarp_test_lockSo the lock is what stops the crash, and the reorder in
watch.rsdoes nothing for it. The reorder fixes something else. The test that failed in the two builds without it wasa_view_mapped_beside_a_guarded_one_makes_it_check_again(watch.rs,guardreturnedSome([])where two pages were expected). That fits a VA left in the guard'sprotectedset by a test that unmapped before callingtitle_memory_remapped, then reused by the next view. One failure per build is thin evidence, but it never showed up with the reorder in.I also wondered whether the crash came from the vectored handler in
watch.rsreopening a stale block that WARP had reused, since that handler runs first. A local probe that logged every write fault it opened on memory that was no longer a mapped view never fired in 30 runs, so I don't think that is it. It looks like WARP itself not liking several devices created in parallel, as in fxceless/victory-fork#850.Coverage of the lock. Every WARP device created by a default test goes through it. The one WARP test left out is
pipeline::host::tests::integer_blend_creates_the_mixed_target_pipeline_on_warp, which is#[ignore]today. If it gets un-ignored it should take the lock too.The new
DynamicPool. I ran a differential fuzz against a plain bitmap model, 300 seeds and 6 million alloc/release operations on capacities from 1 to 4096, checking after every step that blocks never overlap, that a refusal only happens when no free run is long enough, that release coalesces and counts newly freed slots right (duplicate and overlapping releases included), and thatby_start, the 32 small buckets with their mask, and the large set stay consistent. No failures. As a control, changing the bucket mask so it skips the exact-length bucket is caught within the first seed.Not covered: the VRAM eviction and staging changes in
resource.rsandtexture.rs, which need the game and a card with the matching memory size.AI-assisted: yes (Claude Code). The numbers are from runs on my machine.
@PastiiJay on GitHub · 2026-11-26 12:59 UTC · original
Thanks @Kal0s-design, splitting the two halves over 100 runs each is the kind of check that settles it: the lock stops the crash, and the reorder fixes the stale guard address. If you have time for one more, a run of the full PR head with
--test-threads=1would tell us whether thatwatchfailure can still show up when tests do not overlap at all.@Kal0s-design on GitHub · 2026-11-26 15:47 UTC · original
Ran it. The full PR head with
--test-threads=1, 50 runs: 50 passed, no crash and nowatchfailure. For reference I ranbetathe same way, also 50 out of 50, with nowatchfailure there either. So in this setup thewatchfailure only appears when tests overlap, which fits the reused-VA explanation.@PastiiJay on GitHub · 2026-11-26 15:56 UTC · original
Thanks @Kal0s-design, 50 clean serial runs on both sides closes that question: the
watchfailure only shows up when tests overlap, as the reused-address explanation predicted. That is enough for us on this PR.View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.