Three opt-in levers for the layer's own frame time: VICTORY_FILL_HOT, VICTORY_SHADOW_CACHE, VICTORY_BURY_ASIDE (all off by default) #1221

Open
Steenax6 wants to merge 3 commits from upstream-pr/1224 into main
Steenax6 commented 2026-11-26 00:34:07 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by Steenax6 on 2026-11-26T00:34:07Z.


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.

  1. 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 (one WAIT flag). In our tree two fills a frame waited 54 ms.
  2. 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.
  3. 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

  • Compiled and linted on 4aa6e8c: both clippy runs of the CI give exactly the warnings main gives, none new. cargo test --workspace --locked: all suites pass except xtask repository_passes_policy, which objects to two files under diagnostics/ that are on main.
  • Not run with the title on this base. The numbers above are per-lever notes from our tree, measured before this tree's last 32 commits; whether the waits they remove still exist here in that size is exactly what a run with each switch would show.
  • With the switches off the three paths are the code as it is on main (bury byte for byte; the shadow table exclusive on every lookup, as now).

🤖 Generated with Claude Code

<!-- greyfinch-sync:fxceless/victory-fork:issue:6616743874 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/1224). Originally posted by [Steenax6](https://github.com/Steenax6) on 2026-11-26T00:34:07Z. --- ## What Three small levers from a larger piece of work in Steenax6/VIctory-NVID ([2e21055](https://github.com/Steenax6/VIctory-NVID/commit/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. 1. **`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 (one `WAIT` flag). In our tree two fills a frame waited 54 ms. 2. **`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. 3. **`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 - Compiled and linted on 4aa6e8c: both clippy runs of the CI give exactly the warnings `main` gives, none new. `cargo test --workspace --locked`: all suites pass except `xtask` `repository_passes_policy`, which objects to two files under `diagnostics/` that are on `main`. - **Not run with the title on this base.** The numbers above are per-lever notes from our tree, measured before this tree's last 32 commits; whether the waits they remove still exist here in that size is exactly what a run with each switch would show. - With the switches off the three paths are the code as it is on `main` (`bury` byte for byte; the shadow table exclusive on every lookup, as now). 🤖 Generated with [Claude Code](https://claude.com/claude-code)
UwUCammie commented 2026-11-26 02:08:43 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by UwUCammie on 2026-11-26T01:39:20Z.


I tried VICTORY_SHADOW_CACHE on the RX 7900 XT with FILL_HOT and BURY_ASIDE both off. Four pairs in the first room gave 515 presents in 77.99 s (6.60 FPS) off and 508 in 76.86 s (6.61 FPS) on. The enabled blocks counted 106.7 million cache hits; the four differences were +0.48, −0.08, −0.43 and +0.06 FPS. A low-priority build overlapped the last eight seconds of the fourth pair. I don't see a consistent change in this scene on my machine. Build and method

<!-- greyfinch-sync:fxceless/victory-fork:comment:7179990805 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/1224#issuecomment-7179990805). Originally posted by [UwUCammie](https://github.com/UwUCammie) on 2026-11-26T01:39:20Z. --- I tried `VICTORY_SHADOW_CACHE` on the RX 7900 XT with `FILL_HOT` and `BURY_ASIDE` both off. Four pairs in the first room gave 515 presents in 77.99 s (6.60 FPS) off and 508 in 76.86 s (6.61 FPS) on. The enabled blocks counted 106.7 million cache hits; the four differences were +0.48, −0.08, −0.43 and +0.06 FPS. A low-priority build overlapped the last eight seconds of the fourth pair. I don't see a consistent change in this scene on my machine. [Build and method](https://github.com/UwUCammie/victory-amd/blob/dc52b4b/benchmarks/README.md#profiling-after-the-comparison)
Garu667 commented 2026-11-26 11:05:32 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by Garu667 on 2026-11-26T10:48:07Z.


Data point for VICTORY_FILL_HOT (same idea, independently written here before we found this PR): RTX 3080, f6a09d3 + #799's programs running, boat mission. The block caught is the 2 KiB at 0xdc07eab00 (as in #1205 / #1256). Only 1 piece of 64 KiB caught in 3 min; submit thread's waits on the card 24.3 → 10.9 ms/frame, world fps 8.6 → 9.6. Note #1205: the first stale fill is visible (the café oval), so this pairs well with making that one block wait from the start.

<!-- greyfinch-sync:fxceless/victory-fork:comment:7189855104 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/1224#issuecomment-7189855104). Originally posted by [Garu667](https://github.com/Garu667) on 2026-11-26T10:48:07Z. --- Data point for `VICTORY_FILL_HOT` (same idea, independently written here before we found this PR): RTX 3080, `f6a09d3` + #799's programs running, boat mission. The block caught is the 2 KiB at `0xdc07eab00` (as in #1205 / #1256). Only 1 piece of 64 KiB caught in 3 min; submit thread's waits on the card 24.3 → 10.9 ms/frame, world fps 8.6 → 9.6. Note #1205: the first stale fill is visible (the café oval), so this pairs well with making that one block wait from the start.
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/1224:upstream-pr/1224'
git switch 'upstream-pr/1224'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/1224'
git switch 'upstream-pr/1224'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/1224'
git switch 'upstream-pr/1224'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/1224'
git switch 'main'
git merge --squash 'upstream-pr/1224'
git switch 'main'
git merge --ff-only 'upstream-pr/1224'
git switch 'main'
git merge 'upstream-pr/1224'
git push origin 'main'
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
fxceless/victory-fork!1221
No description provided.