Repository navigation
Title memory by address: per-frame timings on its log line (log only) - #1468
Open
tupacfan04 wants to merge 1 commit into
Open
tupacfan04 wants to merge 1 commit into
tupacfan04 wants to merge 1 commit into
Conversation
…rena growth, bring-ups and lands on its 10 s line (log only)
The "title memory by address: ..." line (memory.rs, every ten seconds or
so) keeps its text as it was and ends with:
; timings per frame: {:.3} ms in ready over {:.0} calls, of it {:.3} ms
waiting for the lock ({:.1} waits), {:.3} ms making arenas ({:.2} tried),
{:.3} ms in bring-ups ({:.1}), {:.3} ms landing at submissions ({:.0})
All per frame averages over the frames since the last line:
- ready: every call of memory::ready (one per draw/dispatch that reads or
builds by address), lock wait included;
- the lock wait: the clock is read only when MEMORY.try_lock() finds the
lock held, then lock() as before (the same guard, poisoning handled as
before); "waits" counts those calls;
- making arenas: Memory::another past its once-a-frame refusal (the cheap
early return is not timed);
- bring-ups: Memory::bring_up (the refreshes of the directory and of every
copy recorded into a list);
- landing: the deferred closure at submission (its own lock wait and
Memory::land).
Numbers are kept in static atomics and swapped to zero when the line is
written. No control flow changes.
Tests: memory::tests::timings_are_taken_once (a timed call counts once,
taking leaves zeros). cargo test --release -p victory-gpu --lib -- memory
shadow:: watch:: resource:: : 134 passed, 0 failed, 5 ignored.
Measured (RTX 5070 12 GB, i9-14900F, Series X 1440p, VICTORY_BVH_BUILDER=1):
the line reads 15-24 ms per frame in ready over about 280-380 calls, 3-7 ms
of it waiting for the lock; without the builder 0.1 ms over 15 calls. At a
few hundred calls a frame the two clock reads are not a visible cost.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
1 task done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Log only. The existing
title memory by address:line (about every ten seconds) keeps its text and gains a tail with per-frame timings:memory::ready, lock wait includedtry_lockfinds the lock held, thenlock()as beforeMemory::anotherpast its once-a-frame refusal,Memory::bring_up, and the deferred closure at submissionNumbers are kept in static atomics and swapped to zero when the line is written. No control flow changes, no new switch. One file,
crates/victory-gpu/src/memory.rs(+97 −3).Why
With ray tracing on, nothing in the log said how much of the submitting thread's frame goes to title memory by address. This line does, so the ray tracing PRs that touch this path (#971, #1062, #1046) can be judged with a number from any tester's log.
Measured
RTX 5070 12 GB (driver 621.40), i9-14900F, 32 GB, Windows 11. Series X, 2560x1440, DLSS Quality (model K), frame generation 2x. Unattended 6-minute runs on one walking route, built from source.
readyper frameVICTORY_BVH_BUILDER=1VICTORY_BVH_BUILDER=1(next run)So on this PC roughly 15–24 ms of the ray tracing frame is spent in
memory::ready, and 3–7 ms of that is waiting for the memory lock. The two clock reads per call are not a visible cost at a few hundred calls a frame.The runs were made on my test branch (main
63b902fplus local off-by-default switches) carrying this same commit; this PR is that commit alone, rebased on main923e38c.Tests
memory::tests::timings_are_taken_oncecargo test --release -p victory-gpu --libon this branch: 551 passed, 0 failed, 43 ignoredwatch::tests::what_is_put_in_beside_the_guards_is_told_at_every_viewfail once; it then passed three times alone and in the next full run. This PR does not touchwatch.rs. Plain main923e38cpassed twice (550 passed) in my runs, so I could not reproduce it there.Checked for overlap
cargo testpassed for the crate it touches: yes🤖 Generated with Claude Code