Heap pass: looks on eight threads, its own looks leave the written set alone, a part forgotten after the looks, spans by parts #4875

Closed
Kenzim wants to merge 1 commit from upstream-pr/4875 into main
Kenzim commented 2026-12-01 12:28:49 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by Kenzim on 2026-12-01T12:28:49Z.


The pass over the view heap's buffer views runs beside the recording, and the list that began it waits for it at its close. In the street scene that wait was 6.3-6.6 ms a frame (16,500 slots looked at a frame, 114,000 views kept in 4,700 host copies).

What changes (each on by default, each with a switch back):

  • VICTORY_VIEW_THREADS default 8 for the views' pool (was 4).
  • VICTORY_HEAP_LOOK_QUIET on: the pass's own look at a slot no longer puts the slot back in the written set, so it is not looked at again a pass later for what the pass has just noted. Title writes and draws' looks are on other threads and still put it there.
  • VICTORY_HEAP_FORGET_AFTER on: a pass forgets what it did not find of its part once it has looked (HeapRanges::forget_part_but). Before, it forgot the whole part first and put it back slot by slot. The same views are kept, slot for slot.
  • VICTORY_HEAP_SPANS_WIDE on: the spans per host copy are found on four threads, each copy's views all by one thread (spans_of). Upstream's heap_used note (issue 4036) is kept and made as each copy's entry is first made.
  • Diagnostics only: a frame line with the pass's counts and the looks' time by kind of slot.

Measurements (RTX 3090, 32 threads, native 2560x1440, DLSS off, street scene; switches flipped inside one run with VICTORY_AB), per frame:

change effect phases
looks on 8 threads looks 5.77 -> 4.67 ms, wait at list close 5.98 -> 4.51 ms (looks summed over threads 16.5 -> 23.7) 8 each way
LOOK_QUIET slots looked at 16,300 -> 14,200; looks 4.6 -> 4.2; wait 4.5 -> 4.2 6 each way
FORGET_AFTER looks 5.38 -> 5.10, wait 5.46 -> 5.10 8 each way
SPANS_WIDE spans stage 1.42 -> 1.28 8 each way

All together: looks 6.2 -> 4.2 ms, spans 1.35 -> 1.2 ms, wait at the list's close 6.3-6.6 -> 4.2 ms.

In this card-bound scene the frame time does not move. The gains are in the processor stages named above.

Not measured: scenes other than the street; about 1 ms of the spans stage is still unexplained.

To restore the old behaviour: VICTORY_VIEW_THREADS=4, VICTORY_HEAP_LOOK_QUIET=0, VICTORY_HEAP_FORGET_AFTER=0, VICTORY_HEAP_SPANS_WIDE=0.

Shader cache / translator key: not affected (no victory-shader change).

Tests: draw::heap_range_tests (3 pass, one new). Clippy on victory-gpu is clean apart from the five errors main already has (#4152). The rest of draw:: aborts on the test PC (Windows 10, no Shader Model 6.6), as on main.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:issue:5585689362 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/4875). Originally posted by [Kenzim](https://github.com/Kenzim) on 2026-12-01T12:28:49Z. --- The pass over the view heap's buffer views runs beside the recording, and the list that began it waits for it at its close. In the street scene that wait was 6.3-6.6 ms a frame (16,500 slots looked at a frame, 114,000 views kept in 4,700 host copies). What changes (each on by default, each with a switch back): - `VICTORY_VIEW_THREADS` default 8 for the views' pool (was 4). - `VICTORY_HEAP_LOOK_QUIET` on: the pass's own look at a slot no longer puts the slot back in the written set, so it is not looked at again a pass later for what the pass has just noted. Title writes and draws' looks are on other threads and still put it there. - `VICTORY_HEAP_FORGET_AFTER` on: a pass forgets what it did not find of its part once it has looked (`HeapRanges::forget_part_but`). Before, it forgot the whole part first and put it back slot by slot. The same views are kept, slot for slot. - `VICTORY_HEAP_SPANS_WIDE` on: the spans per host copy are found on four threads, each copy's views all by one thread (`spans_of`). Upstream's `heap_used` note (issue 4036) is kept and made as each copy's entry is first made. - Diagnostics only: a frame line with the pass's counts and the looks' time by kind of slot. Measurements (RTX 3090, 32 threads, native 2560x1440, DLSS off, street scene; switches flipped inside one run with `VICTORY_AB`), per frame: | change | effect | phases | |---|---|---| | looks on 8 threads | looks 5.77 -> 4.67 ms, wait at list close 5.98 -> 4.51 ms (looks summed over threads 16.5 -> 23.7) | 8 each way | | LOOK_QUIET | slots looked at 16,300 -> 14,200; looks 4.6 -> 4.2; wait 4.5 -> 4.2 | 6 each way | | FORGET_AFTER | looks 5.38 -> 5.10, wait 5.46 -> 5.10 | 8 each way | | SPANS_WIDE | spans stage 1.42 -> 1.28 | 8 each way | All together: looks 6.2 -> 4.2 ms, spans 1.35 -> 1.2 ms, wait at the list's close 6.3-6.6 -> 4.2 ms. **In this card-bound scene the frame time does not move.** The gains are in the processor stages named above. Not measured: scenes other than the street; about 1 ms of the spans stage is still unexplained. To restore the old behaviour: `VICTORY_VIEW_THREADS=4`, `VICTORY_HEAP_LOOK_QUIET=0`, `VICTORY_HEAP_FORGET_AFTER=0`, `VICTORY_HEAP_SPANS_WIDE=0`. Shader cache / translator key: not affected (no `victory-shader` change). Tests: `draw::heap_range_tests` (3 pass, one new). Clippy on `victory-gpu` is clean apart from the five errors main already has (#4152). The rest of `draw::` aborts on the test PC (Windows 10, no Shader Model 6.6), as on main.
trustno1-coder commented 2026-12-01 18:29:50 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by trustno1-coder on 2026-12-01T18:29:50Z.


Closing this as part of moving main to the texture and video-memory rework (v2026.12.01.01-test). A lot of the code changed, and this pull request no longer applies cleanly to it; it would need to be rewritten against the new main rather than rebased. Thank you for the work. If the change is still needed, please open a new pull request based on the current main.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7321038819 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/4875#issuecomment-7321038819). Originally posted by [trustno1-coder](https://github.com/trustno1-coder) on 2026-12-01T18:29:50Z. --- Closing this as part of moving main to the texture and video-memory rework (v2026.12.01.01-test). A lot of the code changed, and this pull request no longer applies cleanly to it; it would need to be rewritten against the new main rather than rebased. Thank you for the work. If the change is still needed, please open a new pull request based on the current main.

Pull request closed

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
trustno1-coder/VIctory-NVIDIA!4875
No description provided.