victory-gpu: open write-faulted guarded blocks without the guards' lock by default, and build soft runs once per guard pass #516
No reviewers
Labels
No labels
accessibility
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/trustno1-coder--VIctory-NVIDIA!516
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-516"
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?
@henriazz10 on GitHub · 2026-11-27 23:54 UTC · original
henriazz10:perf/cpu-copies-rtx50→main· +28 −13 · 1 files · 1 commits · openSummary
copystatdiagnostics build on RTX 5080):victory-nvidia-play-20261127-220810-11640.log), the last 60s ran at 4.0–5.7 fps (175.4–246.9 ms/frame) with CPUcopiesat 56.3–61.9 ms (116.4–157.8 MB) andrefreshesat 51.7 ms, while GPU busy time was 12–21% and live shader/pipeline compilation had mostly subsided (72shader translated, 3host pipeline shaders=).copystatrun (victory-nvidia-play-20261127-224637-55336.log) showedguardsholdingGUARDS.lock()for49.5 ms/frame(450 watches 53.65 ms,474blocks made read-only) while write-fault handling (VICTORY_FAULT_UNLOCKEDoff by default) spent43.63 msper frame waiting onGUARDS.lock()across threads (429faults/frame).crates/victory-gpu/src/watch.rs, commitf5bde6b (rebased on main 64d4931)):VICTORY_FAULT_UNLOCKEDby default (unlocked_from_envreturnstrueunlessVICTORY_FAULT_UNLOCKED=0).soft_runs(first * BLOCK, (last - first) * BLOCK)out ofGUARDS.lock()inguard(), passing&softintoprotect()/protect_here().watch::many_askers_tests::unlocked_defaults_on_unless_zero.unlocked_from_envback toval.is_some_and(|v| v == "1")causedcargo test -p victory-gpu --lib --locked unlocked_defaults_on_unless_zeroto fail (exit code1):thread 'watch::many_askers_tests::unlocked_defaults_on_unless_zero' (31036) panicked at crates\victory-gpu\src\watch.rs:5294:9: assertion failed: super::unlocked_from_env(None)Before / After Measurements (Plain Release Build, 130s
VICTORY_WARMUP_RESTART=0)victory-nvidia-play-20261127-225157-24736.log):12.6 fps, 79.5 ms/frame (66.0 preparing: copies 34.3 ms 42.3 MB, textures 3.1 ms 24.0 MB; 0.0 on the GPU; 9.5 copying back 0.5 MB), 3576 draws/frame;refreshes27.1–36.1 ms.victory-nvidia-play-20261127-225454-59896.log):8.3 fps, 120.0 ms/frame (80.3 preparing: copies 44.4 ms 82.1 MB, textures 4.1 ms 57.4 MB; 2.8 on the GPU; 9.3 copying back 0.7 MB), 3862 draws/frame;refreshes20.0–50.7 ms.victory-nvidia-play-20261127-231559-54768.log):11.9 fps, 84.2 ms/frame (66.9 preparing: copies 32.2 ms 61.0 MB, textures 18.1 ms 40.1 MB; 2.7 on the GPU; 6.3 copying back 0.5 MB), 3743 draws/frame;refreshes16.1–26.0 ms.victory-nvidia-play-20261127-231853-57360.log):11.1 fps, 90.2 ms/frame (73.8 preparing: copies 46.4 ms 69.7 MB, textures 3.9 ms 29.0 MB; 0.8 on the GPU; 8.4 copying back 0.5 MB), 3161 draws/frame;refreshes25.1–37.3 ms.refreshesnarrowed from20.0–50.7 msto16.1–37.3 ms, while CPUcopiesremained32.2–46.4 msbecause remaining contention/copy cost is dominated byGUARDS.lock()across 8 GPU worker threads inguard()(620 waits, 175.03 msincopystat) andsoft_read(43.47–46.58 ms).Reviewer notes (Claude Code)
64d4931. On that same main, without this change, the CI commands fail the same way on this Windows checkout:cargo fmt --check(CRLF fromcore.autocrlf=true),clippy(clippy::precedenceinvictory-formats/src/texture.rs,missing_transmute_annotationsinvictory-loader/src/write_sites.rs) and the same 2 tests invictory-gpu::indirect::tests. This PR adds no new failure.df2daaf. That first try had no warm shader cache, so part of that difference is the cache, not this change.VICTORY_FAULT_UNLOCKEDis now on by default (VICTORY_FAULT_UNLOCKED=0restores the old path).Checks
cargo test -p victory-gpu --lib --locked watch::: exit code0(48 passed; 0 failed)cargo fmt --all -- --check: exit code1(pre-existing formatting diffs across untouched files; zero diffs in our added/modified lines incrates/victory-gpu/src/watch.rs)cargo clippy --workspace --all-targets --locked -- -D warnings: exit code101(pre-existingclippy::precedenceerror incrates/victory-formats/src/texture.rs:1346)cargo clippy --workspace --all-targets --all-features --locked -- -D warnings: exit code101(same pre-existingclippy::precedenceerror incrates/victory-formats/src/texture.rs:1346)cargo test --workspace --locked: exit code101(victory:23 passed,census:2 passed,victory-core:13 passed,victory-formats:42 passed; 5 ignored,victory-game:3 passed,victory-gpu:423 passed; 2 failed; 35 ignored—indirect::tests::host_list_budget_starts_empty_at_each_submissionandindirect::tests::warp_batch_charges_every_executionalso fail identically withVICTORY_FAULT_UNLOCKED=0)git diff --check: exit code0Environment & Untested Scope
AI-assisted. Gemini 4 Hydrogen (Antigravity CLI) wrote the change and ran the checks; Claude Code reviewed it.
🤖 Generated with Claude Code
@Machad3x on GitHub · 2026-11-28 01:19 UTC · original
Tested merged on top of main (RTX 3080 Ti, Ryzen 7 5700X, 1440p DLSS Quality, title ray tracing on): 300 s alive. Together with #498, it cut the frame from 90-97 ms to 63-67 ms in the cell scene. The submitting thread went from 89.6 to 59.7 ms.
One race found in review: the guard pass now reads the soft-view runs from the runtime's books before taking the
GUARDSlock. If a view is made real (title_memory_made_real) in between, it was opened before it was noted. The pass then still treats the block as guarded and clean, with no protection on it, so writes through it go unseen.Our fix: a counter bumped under the lock in
title_memory_made_real. The guard pass compares it after taking the lock and re-reads the runs if it changed. We also kept the write-fault switch going throughtoggled!, so it stays on by default and can still be flipped byVICTORY_AB.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.