GPU: a frame line says how many copy calls the refresh made, and note_use stops allocating #3214
No reviewers
Labels
No labels
accessibility
area: build
area: formats
area: gpu
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
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
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/Marvisak--VIctory!3214
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-3214"
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?
@borosf on GitHub · 2026-11-26 13:15 UTC · original
borosf:vibe/refresh-calls-842ca5→main· +21 −4 · 3 files · 2 commits · openSummary
ReadProcessMemoryis 7.99 µs, a 4 KiB run is 2.39 µs (measured here). The fixes are different too — sub-page dirty extents versus fewer/larger calls — so the split has to be readable before either is written.RefreshCallscounts the copy calls the refresh made: one per run of pages the tracker brought back (Shadow::update_tracked), one per stretch of untracked memory copied whole (Shadow::update_untracked). It prints next to the bytes checked and unchanged, sobytes / callsis the average call size.memory::note_usestops allocating. It runs once per stage of every draw whose shader reads title memory — thousands of times a frame in the world — and named its pipeline withto_owned()on every call: aStringheap allocation and free per stage for a key that is almost always already in the map. It now looks the key up first and only names a pipeline the first time one is seen. Same counts, sametitle memory this frame: …line.Verification
Intel Arc B580, Windows 11,
-p victory-gpu:cargo test -p victory-gpu --lib --features diagnostics --locked -- --test-threads=1→ 244 passed, 2 failed, 1 ignored. The two failures are the known Intel heap-cap pair (descriptor::host::tests::dynamic_slots_are_held_until_released,memory::tests::lists_share_a_table_and_copies_keep_their_views— #1744/#1829) that pristinemain63bcca4also fails on this card.Shadow::updatewas observed to raiseRefreshCalls, and the probe was then removed (the diff touches three files, +21/−4).cargo clippy -p victory-gpu --all-targets -- -D warningsclean on both feature sets.cargo xtask policy→ 193 files ok.No game data used; synthetic tests only.
The
note_usesaving is modelled from call rate × (mutex + allocation) cost, not measured: that needs a world frame, which needs the title. The counter is what makes the larger decision measurable on the first run anyone has.claiming: GPU diagnostics: count the copy calls a submission's refresh makes (RefreshCalls on the frame line) beside the bytes, so a frame's copy cost can be told apart as bytes or as calls; and stop
memory::note_useallocating a String per stage per draw@borosf on GitHub · 2026-11-26 13:21 UTC · original
CI note for reviewers: the
checkjob's only failure isframe::tests::waits_end_on_ticks_and_count_framesatframe.rs:231(left: 0,right: 1— a wait that returnedS_OKwhere the test expectsS_FALSE).This PR does not touch
frame.rs; it changesvictory-gpu/src/{copystat,memory,shadow}.rsonly (3 files, +21/−4), and 230 of the job's tests passed. This is the intermittent runner-timing failure already documented in #2861 and #2877: a runner woken a little late finds the next tick has passed and the followingtimeout_ms = 0poll returnsS_OKinstead ofTIMEOUT. Both Clippy steps — plain and the diagnostics build — passed, which is what this change needed to prove.Not re-running from here; leaving that to whoever triages, since a re-run can fail the same way on a loaded runner.
@Dukestar69 on GitHub · 2026-11-26 13:28 UTC · original · approved these changes
Verified on RTX 5090 against
origin/main(63bcca4):cargo test -p victory-gpu --lib shadow:: -- --test-threads=1: 10/10 passed;draw::: 20/20 passed.cargo clippy -p victory-gpu --all-targets -- -D warnings&--features diagnostics: clean.cargo xtask policy: 191 files ok.Cleanly reports refresh copy call counts and avoids allocating in
note_use.Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).
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.