Repository navigation
Three opt-in levers for the layer's own frame time: VICTORY_FILL_HOT, VICTORY_SHADOW_CACHE, VICTORY_BURY_ASIDE (all off by default) - #1224
Conversation
…ts (VICTORY_FILL_HOT=1, off by default) Fills of upload memory that read title memory flights may write go ahead of the flights and are checked when those land (fill_ahead). The first fill that had read bytes a flight then changed turned the waiting back on for every fill, for the rest of the run. With VICTORY_FILL_HOT=1 the 64 KiB pieces of title memory that fill read are remembered instead, and only fills and buffer copies that read one of those pieces wait; the others keep reading ahead and stay checked as before. Without the switch nothing changes. The frame line that counts fills read ahead names the number of such pieces. Numbers, measured in another tree (Steenax6/VIctory-NVID, commit 2e21055, RTX 4070 Ti 12 GB, Ryzen 7 9800X3D), in the title's opening scene: one fill of 2,048 bytes of a small buffer shaders write every frame turned the waiting on, and from then on two fills a frame waited 54 ms for flights; 1,229 of those waits were looked at, each for 480 bytes of per-draw constants elsewhere, and the bytes were the same after the wait 1,229 times. That commit as a whole (this and other changes together) took the submit thread from about 195 to about 47 ms a frame there; no figure for this change alone was taken beyond the 54 ms above. On this base the change was compiled and linted only, not run. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…(VICTORY_SHADOW_CACHE=1, off by default) Every view of every draw asks shadow::lookup for the host copy of a range of title memory, on every recording thread, and each ask took the mutex of the table of title buffers. The table is now behind a read/write lock. Without the switch every ask takes it exclusive and looks in the table, as before. With VICTORY_SHADOW_CACHE=1: - an ask whose buffer has its copy already reads the table shared; - each thread remembers, by ask, the copy it was answered with (512 answers, held weakly), and answers from there while a counter of the table's changes stands where it stood. The counter is bumped, under the exclusive lock, by everything that can change such an answer: a buffer registered or unregistered, a copy in place taken out (in_place_let_go). Those are all the places that change the table. Only answers from a buffer's copy are remembered; windows outside buffers (loose) are looked up as before. A test walks the cache through a buffer added inside another and taken out again. Numbers, measured in another tree (Steenax6/VIctory-NVID, commit 2e21055, RTX 4070 Ti 12 GB, Ryzen 7 9800X3D): as a mutex the table was 32 ms a frame of the recording threads, 15 of them waiting. That is time of the title's recording threads, not of the submit thread. No frame time was taken for this change alone. On this base the change was compiled and linted only, not run; the new unit test passes. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…read (VICTORY_BURY_ASIDE=1, off by default) Objects retired while submissions run (host::retire) are dropped by the thread that finishes the submission they waited for. With the relay that is the thread that lands flights, and every landing took the whole list apart and put the part that still waits back (a partition that moves every entry), then released the others there. With VICTORY_BURY_ASIDE=1 the relay's landing takes only the entries that are done with out of the list, where they lie, and hands them to a thread of its own (victory-bury) that drops them. Dropping later is always allowed: these objects only wait for the card, and Retired is already dropped on whatever thread finishes the submission. If the thread cannot be started they are dropped in the landing. Without the switch, and on the two other paths that finish submissions, nothing changes. Numbers, measured in another tree (Steenax6/VIctory-NVID, commit 2e21055, RTX 4070 Ti 12 GB, Ryzen 7 9800X3D), from a sampling profile: the partition 0.9 ms a frame and the releases 2 ms a frame of the landing thread. That is the relay thread's time, not the submit thread's. On this base the change was compiled and linted only, not run. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
|
I tried |
|
Data point for |
What
Three small levers from a larger piece of work in Steenax6/VIctory-NVID (2e21055, which took the layer's submit thread from about 195 to about 47 ms a frame on an RTX 4070 Ti). Each is one commit, each is off by default and does nothing without its switch.
VICTORY_FILL_HOT=1: only reads of the 64 KiB a flight changed under a fill wait for flights. Today the first such fill makes every later read wait (oneWAITflag). In our tree two fills a frame waited 54 ms.VICTORY_SHADOW_CACHE=1: recording threads remember which host copy a title address range has; the buffer table becomes a read/write lock, read shared only with the switch on. In our tree the table's mutex cost 32 ms a frame of the recording threads.VICTORY_BURY_ASIDE=1: host objects that waited for a flight are released off the landing thread. In our tree 0.9 + 2 ms a frame of the relay thread.What this is not
It is not the 195 -> 47 ms. Most of that came from things this tree has since built its own way (
VICTORY_INDIRECT_GATHER,VICTORY_COPY_PLAIN,VICTORY_CARD_HASH_WIDE,VICTORY_LIGHT_REFRESH,cardmeter.rs) or from changes that sit on our rewritten watch journal and descriptor locking and cannot be brought over in isolation (4 KiB tracking and refresh in parts, striped slot locks, the fine card compare). I left those out rather than port them on guesses about lifetimes. If one of them is of interest, say which and I will look at it against this tree.What I can and cannot say for this tree
maingives, none new.cargo test --workspace --locked: all suites pass exceptxtaskrepository_passes_policy, which objects to two files underdiagnostics/that are onmain.main(burybyte for byte; the shadow table exclusive on every lookup, as now).🤖 Generated with Claude Code