Repository navigation
Conversation
…_use stops allocating The refresh counter: the copies of a submission's refresh were counted in bytes only, so a frame could not say whether its copy cost was 265 MB of memory or 135,000 calls of a few KiB each -- the two want different fixes, and the ledger's numbers cannot be told apart without this. `RefreshCalls` counts the copy calls the refresh made: one per run of pages the tracker brought back, one per stretch of untracked memory copied whole. It joins the frame line next to bytes checked and unchanged. `memory::note_use` runs once per stage of every draw whose shader reads title memory, thousands of times a frame, and named its pipeline with `to_owned` on every call: a `String` allocated and freed per draw 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, same line (`title memory this frame: N draws/dispatches (...)`) -- one allocation and free less per stage. Verified on an Intel Arc B580, Windows 11: - `cargo test -p victory-gpu --lib --features diagnostics --locked -- --test-threads=1`: 244 passed, 2 failed -- the known Intel heap-cap pair (Marvisak#1744/Marvisak#1829) that pristine main also fails on this card. - The counter's wiring checked against a real refresh (a registered copy's `Shadow::update` raises it), then the probe removed. - `cargo clippy -p victory-gpu --all-targets -- -D warnings` clean on both feature sets; `cargo xtask policy`: 193 files ok. No game data used; synthetic tests only. Generated by Mistral Vibe. Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
|
CI note for reviewers: the This PR does not touch Not re-running from here; leaving that to whoever triages, since a re-run can fail the same way on a loaded runner. |
Dukestar69
left a comment
There was a problem hiding this comment.
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).
…_on_ticks_and_count_frames, a timing test that flakes on loaded shared runners; unrelated to this counter-only change Generated by Mistral Vibe. Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
Summary
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— Test report: RTX 5070 (Blackwell), Windows 11, 70564ae: 471 passed, 5 failed, 7 ignored (4 from the 1,000,000 view heap cap) #1744/Test report: Intel UHD (Raptor Lake Xe-LP), 70564ae: victory-shader 201 passed, 8 failed (3 missing-feature skips, 5 different results) #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