Descriptors: every slot of a table a draw binds counts as a table's slot (VICTORY_TABLED_ALL=1, off by default): 84-96 -> 55-59 ms a frame in the prologue's cell #1414

Open
github-bot wants to merge 6 commits from github-bot/gh-1414 into main AGit
Owner

@⁠KyleS98 on GitHub · 2026-11-26 23:58 UTC · original
KyleS98:perf/tabled-table-slots → main · +557 −15 · 3 files · 6 commits · open

Summary

One opt-in switch, VICTORY_TABLED_ALL=1 (off by default): the pass over records the title copied into its heap as bytes leaves every slot of a table a draw binds to its draws, whatever the slot holds, and not only the slots that hold texture views. VICTORY_TABLED_ALL_FRAMES (1 to 240, default 60) says for how many frames after a draw last bound the table. Nothing changes without the switch.

In the prologue's cell on main it took the frame from 80–91 ms to 56–62 ms on an RTX 3090 Ti (54–59 ms in the first version, which had a longer window and no retry). It is not a gain everywhere: on an RTX 5060 Laptop 8 GB under Proton, Filip722 measured one pair that was slower with it (5.84 → 5.14 fps, below).

Revised after review (akimfomin, Filip722): the switch has stamps of its own, the window can be set and is 60 frames, a record left to its draws is looked at again when its window ends even if nothing writes its page again (Filip722's test and fix, picked with them as author), and there are tests of where the window ends.

Why

The title writes its per-draw tables into its heap as bytes, every frame. A table that holds a constant buffer is made afresh for its draw in slots of our own, so the title's own slots of it are read by nothing unless a shader picks them by index.

The pass over records copied in as bytes (sync_heaps) cannot know that. It already leaves a table's texture slots to the draws that read them (tabled_lately), but takes every other changed record there for one a shader may pick by index:

  • on the submitting thread, each such buffer view is "left for later" (its host slot made null, the buffer sets and the stride table updated);
  • on a recording thread, the once-a-frame pass over buffer views picked by index (State::heap_buffers) then makes each of them and asks for its memory to be brought up to date.

I found it with a counter of what HostHeap::mirror does by kind (on another tree, not in this PR): of about 19,500 records the pass took a frame, 11,400 were buffer views left for later, 3,700 were slots made null, 3,100 were no view over a slot that showed nothing, and 1,300 were texture views it made.

What changes

  • HostHeap::table_slot(index) stamps a title slot as one of a table a draw bound, in stamps of the switch's own (table_any, allocated only with the switch). The texture queue's stamps are not touched. (The first version of this PR wrote the texture queue's stamp; that also changed how the queue treats a slot that had held a table's buffer view.)
  • State::table_entry (tables read in place) calls it for an entry that is no texture view, and for an entry that is no view at all. The loop that makes a table afresh calls it for each of the title's own slots of the table.
  • The pass (mirror_copied, mirror_copied_page) asks left_to_draws: a table's texture slot lately, as before, or with the switch any stamped slot within VICTORY_TABLED_ALL_FRAMES.
  • The retry (Filip722, d4e76ed the test and 82d837b the fix): a changed record the pass leaves is not noted as seen, so before this it was taken only the next time something wrote its 64 KiB page. A slot that left its table and was then picked by index, on a page nothing wrote again, stayed unseen for good. Now each heap keeps one deadline per page that has such a record (TableRetries), and the pass reads the page again in the first frame the record is no longer left. Only with the switch, and only for records the switch's own stamp left (c59bc53): what the texture queue's rule leaves is taken when its page is next written, as on main. Here it costs the pass about 0.7 ms a frame (4.3 → 4.9–5.1 ms; 174 → 180–192 pages read).

Measurements

main 4c60466 with #798 on top (the Series S profile needs it to show the world) and two commits that do not touch this code (which card to render on in a two-card PC; the skip list looked up in a set). RTX 3090 Ti 24 GB, Ryzen 9 9950X3D, 64 GB, Windows 11 26200. Series S profile, diagnostics build, warm shader cache, the prologue's cell, hands-off, 5.5 minutes each, one run per row. Frame: the last four readings of the frame line.

Switches in every run: INDIRECT_WINDOW JOIN_PARTS BACK_OWN_VIEW INDIRECT_GATHER CARD_REHASH_RUNS LEVELS_ON_DEMAND ASYNC_SUBMIT QUEUE2 TEXTURE_NO_WAIT COPY_PLAIN FILLS_PLAIN ABSENT_ONCE at 1, ABSENT_MS=told MERGE_GAP=64 MERGE_RUNS=4096 STAGING_POOL=0 CARD_BUFFERS_MIN_KB=64 CARD_BUFFERS_MB=1280, and the ray-tracing resolve and traced-shadow shaders of #1268's list in VICTORY_SKIP_PIPELINES.

per frame frame records the pass mirrors the pass (sync_heaps) "heap buffers"
off 80–91 ms 16,994 15.8 ms 25–34 ms
on, 2 frames 73–77 ms 13,016 10.8 ms 19–25 ms
on, 8 frames 64–73 ms 9,697 10.2 ms 12–21 ms
on, 60 frames, no retry yet 55–59 ms 1,658 4.3 ms 9–11 ms
on, 60 frames, with the retry (this head, the default; two runs) 56–62, 57–59 ms 2,011, 2,114 5.1, 4.9 ms 10–12 ms
on, 240 frames (the first version's window), no retry yet 54–59 ms 218 3.0 ms 9–11 ms

Why the window matters at all: the title makes its per-draw tables in a ring of its heap's slots, so a slot is written again some frames after a draw last bound its table, and the stamp has to outlast that. 60 frames has nearly all of the gain for a quarter of the time a slot can go unseen. Two more runs with the switch off on this base read 84–96 and 84–90 ms, and a second run at 60 frames 56–59 ms.

Picture: in the cell the same in all of these (four frames of each run side by side). The cutscene before the cell has main's known faults in every run here (black first screens, a broken face); its frames fall at different moments in each run, so I did not compare them one to one.

One run outside the table was different, and it shaped the last commit. The retry as first picked also read a page again when the texture queue's 240 frames ended for a record on it. In one of two runs of that form the cell's window frame drew flat yellow in all nine screenshots of the cell (three minutes). None of the nine runs without a retry did, and neither of the two with the retry narrowed to the switch's own stamps (c59bc53, the row in bold). One run in two does not prove the wider retry did it, but the narrower rule does not need the proof: the texture rule is main's, and with the switch on it now behaves exactly as without it.

What it costs, and where it was slower

With the switch on, the submitting thread has more to do, and I have not found why yet. On the frame line here:

per frame off on (60 frames)
"copies" (submitting thread) 60–65 MB, 9–10 ms 74–83 MB, 19–24 ms
"preparing" (submitting thread) 25 ms 37–43 ms
copying back 12 ms for 32–33 MB 16–18 ms for 31–33 MB
"on the GPU" 8–9 ms 1–2 ms

It is not simply work moved from one thread to another: the buffer pass defers its refreshes to the submission too. On this PC the frame is shorter all the same, because without the switch recording was the limit; with it the submitting thread is (at work 46 of a 56 ms frame).

On a machine where the submitting side or the card behind it is already the limit, the same extra can make the frame longer. Filip722's pair on an RTX 5060 Laptop 8 GB (Bazzite, GE-Proton, Series S at 50 % scale, the first version of this PR, 240 frames): the descriptor work fell as here (records mirrored 11,292 → 191, the pass 30.5 → 5.3 ms, the buffer pass 77.8 → 22.4 ms, 560 MiB more video memory free) and the frame rate fell too, 5.84 → 5.14 fps, with their GPU phase at 22.5 → 60.8 ms and copy-back at 64.7 → 81.4 ms. One pair, but it points the same way as the table above, so read this switch as "measure on your machine", not as a default.

Risk, and why it is off by default

  • A slot that was a table's and is then picked by index only is not seen by the pass for up to VICTORY_TABLED_ALL_FRAMES frames after the last draw bound its table (60 by default). With the retry it is seen then, whether or not its page is written again. Before the retry it could stay unseen for good; that hole is what Filip722's test shows.
  • The texture slots' own 240-frame rule (tabled_lately, main's) is unchanged, with the switch or without.
  • The cost above.
  • I have run it in one scene only (the opening cutscene and the cell). It should be looked at in the open world and with skinned characters in view before it is anyone's default.

How this relates to open PRs

  • #467 / #523 and #1043 make the two passes cheaper per slot. This takes the slots out of them. They should compose; I have not tried them together. akimfomin checked that #1413 merges cleanly with the first version.
  • #827's read-based window would bound the texture rule's own risk.

Verification

  • cargo clippy -p victory-gpu --all-targets: no warnings.
  • cargo test -p victory-gpu --lib descriptor: 43 passed. New here: the stamp's ends at 1, 8 and 240 frames; the pass over a page (a changed record of a table's slot is left up to the last frame, taken in the frame after, its deadline is that frame, VICTORY_HEAP_SYNC_TABLES=1 holds nothing back, and a table's texture slot is left with no deadline); Filip722's merge test of TableRetries; and Filip722's device test through sync_heaps on a write-watched heap, in child processes with the switch off and on.
  • That device test on Windows 11, RTX 3090 Ti: at the commit that adds it, the child with the switch on fails where it should ("stamp expiry must discover the copied slot without re-dirtying its page") and the child with it off passes; with the retry both pass. It needed one change to get as far as its subject on Windows (9c3deb8): the write watch there also reports a page's first touch when that is a read, so the test now touches its heap's pages and resets the watch before it counts anything.
  • The whole victory-gpu suite is intermittent on this PC with or without this PR: 5 of 48 runs failed on unmodified 4c60466 (watch::tests::a_write_is_reported_at_every_checked_view among them), 4 of 25 on this branch (each time inplace::tests::warp_a_title_buffer_in_place_shows_its_bytes_at_its_offset). Neither test is touched here.
  • cargo xtask policy reports the two oversized files it reports on main (host.rs, lower.rs); this PR touches neither.
  • In the game: thirteen 5.5-minute runs on this base (those in the table, the first version's pair and a third run with the switch off, and the two of the wider retry), none with an exception or a lost device, and about a dozen 6-minute runs of the first version on another tree.

Numbers and text only: no game data, captures or screenshots.

AI-assisted (Claude Code, Claude Fable 5.2). The retry and its two tests are Filip722's (assisted by Codex, per their comment).

**@⁠KyleS98** on GitHub · 2026-11-26 23:58 UTC · [original](https://github.com/fxceless/victory-fork/pull/1414) `KyleS98:perf/tabled-table-slots` → `main` · +557 −15 · 3 files · 6 commits · open ## Summary One opt-in switch, `VICTORY_TABLED_ALL=1` (off by default): the pass over records the title copied into its heap as bytes leaves every slot of a table a draw binds to its draws, whatever the slot holds, and not only the slots that hold texture views. `VICTORY_TABLED_ALL_FRAMES` (1 to 240, default 60) says for how many frames after a draw last bound the table. Nothing changes without the switch. In the prologue's cell on `main` it took the frame from 80–91 ms to 56–62 ms on an RTX 3090 Ti (54–59 ms in the first version, which had a longer window and no retry). **It is not a gain everywhere:** on an RTX 5060 Laptop 8 GB under Proton, Filip722 measured one pair that was slower with it (5.84 → 5.14 fps, [below](#what-it-costs-and-where-it-was-slower)). **Revised after review** (akimfomin, Filip722): the switch has stamps of its own, the window can be set and is 60 frames, a record left to its draws is looked at again when its window ends even if nothing writes its page again (Filip722's test and fix, picked with them as author), and there are tests of where the window ends. ## Why The title writes its per-draw tables into its heap as bytes, every frame. A table that holds a constant buffer is made afresh for its draw in slots of our own, so the title's own slots of it are read by nothing unless a shader picks them by index. The pass over records copied in as bytes (`sync_heaps`) cannot know that. It already leaves a table's **texture** slots to the draws that read them (`tabled_lately`), but takes every other changed record there for one a shader may pick by index: - on the submitting thread, each such buffer view is "left for later" (its host slot made null, the buffer sets and the stride table updated); - on a recording thread, the once-a-frame pass over buffer views picked by index (`State::heap_buffers`) then makes each of them and asks for its memory to be brought up to date. I found it with a counter of what `HostHeap::mirror` does by kind (on another tree, not in this PR): of about 19,500 records the pass took a frame, 11,400 were buffer views left for later, 3,700 were slots made null, 3,100 were no view over a slot that showed nothing, and 1,300 were texture views it made. ## What changes - `HostHeap::table_slot(index)` stamps a title slot as one of a table a draw bound, in stamps of the switch's own (`table_any`, allocated only with the switch). The texture queue's stamps are not touched. (The first version of this PR wrote the texture queue's stamp; that also changed how the queue treats a slot that had held a table's buffer view.) - `State::table_entry` (tables read in place) calls it for an entry that is no texture view, and for an entry that is no view at all. The loop that makes a table afresh calls it for each of the title's own slots of the table. - The pass (`mirror_copied`, `mirror_copied_page`) asks `left_to_draws`: a table's texture slot lately, as before, or with the switch any stamped slot within `VICTORY_TABLED_ALL_FRAMES`. - **The retry (Filip722, `d4e76ed` the test and `82d837b` the fix):** a changed record the pass leaves is not noted as seen, so before this it was taken only the next time something wrote its 64 KiB page. A slot that left its table and was then picked by index, on a page nothing wrote again, stayed unseen for good. Now each heap keeps one deadline per page that has such a record (`TableRetries`), and the pass reads the page again in the first frame the record is no longer left. Only with the switch, and only for records the switch's own stamp left (`c59bc53`): what the texture queue's rule leaves is taken when its page is next written, as on `main`. Here it costs the pass about 0.7 ms a frame (4.3 → 4.9–5.1 ms; 174 → 180–192 pages read). ## Measurements `main` `4c60466` with #798 on top (the Series S profile needs it to show the world) and two commits that do not touch this code (which card to render on in a two-card PC; the skip list looked up in a set). RTX 3090 Ti 24 GB, Ryzen 9 9950X3D, 64 GB, Windows 11 26200. Series S profile, diagnostics build, warm shader cache, the prologue's cell, hands-off, 5.5 minutes each, one run per row. Frame: the last four readings of the frame line. Switches in every run: `INDIRECT_WINDOW JOIN_PARTS BACK_OWN_VIEW INDIRECT_GATHER CARD_REHASH_RUNS LEVELS_ON_DEMAND ASYNC_SUBMIT QUEUE2 TEXTURE_NO_WAIT COPY_PLAIN FILLS_PLAIN ABSENT_ONCE` at 1, `ABSENT_MS=told MERGE_GAP=64 MERGE_RUNS=4096 STAGING_POOL=0 CARD_BUFFERS_MIN_KB=64 CARD_BUFFERS_MB=1280`, and the ray-tracing resolve and traced-shadow shaders of #1268's list in `VICTORY_SKIP_PIPELINES`. | per frame | frame | records the pass mirrors | the pass (`sync_heaps`) | "heap buffers" | |---|---:|---:|---:|---:| | off | 80–91 ms | 16,994 | 15.8 ms | 25–34 ms | | on, 2 frames | 73–77 ms | 13,016 | 10.8 ms | 19–25 ms | | on, 8 frames | 64–73 ms | 9,697 | 10.2 ms | 12–21 ms | | on, 60 frames, no retry yet | 55–59 ms | 1,658 | 4.3 ms | 9–11 ms | | **on, 60 frames, with the retry (this head, the default; two runs)** | **56–62, 57–59 ms** | 2,011, 2,114 | 5.1, 4.9 ms | 10–12 ms | | on, 240 frames (the first version's window), no retry yet | 54–59 ms | 218 | 3.0 ms | 9–11 ms | Why the window matters at all: the title makes its per-draw tables in a ring of its heap's slots, so a slot is written again some frames after a draw last bound its table, and the stamp has to outlast that. 60 frames has nearly all of the gain for a quarter of the time a slot can go unseen. Two more runs with the switch off on this base read 84–96 and 84–90 ms, and a second run at 60 frames 56–59 ms. **Picture:** in the cell the same in all of these (four frames of each run side by side). The cutscene before the cell has `main`'s known faults in every run here (black first screens, a broken face); its frames fall at different moments in each run, so I did not compare them one to one. One run outside the table was different, and it shaped the last commit. The retry as first picked also read a page again when the **texture queue's** 240 frames ended for a record on it. In one of two runs of that form the cell's window frame drew flat yellow in all nine screenshots of the cell (three minutes). None of the nine runs without a retry did, and neither of the two with the retry narrowed to the switch's own stamps (`c59bc53`, the row in bold). One run in two does not prove the wider retry did it, but the narrower rule does not need the proof: the texture rule is `main`'s, and with the switch on it now behaves exactly as without it. ## What it costs, and where it was slower With the switch on, the submitting thread has more to do, and I have not found why yet. On the frame line here: | per frame | off | on (60 frames) | |---|---:|---:| | "copies" (submitting thread) | 60–65 MB, 9–10 ms | 74–83 MB, 19–24 ms | | "preparing" (submitting thread) | 25 ms | 37–43 ms | | copying back | 12 ms for 32–33 MB | 16–18 ms for 31–33 MB | | "on the GPU" | 8–9 ms | 1–2 ms | It is not simply work moved from one thread to another: the buffer pass defers its refreshes to the submission too. On this PC the frame is shorter all the same, because without the switch recording was the limit; with it the submitting thread is (at work 46 of a 56 ms frame). On a machine where the submitting side or the card behind it is already the limit, the same extra can make the frame longer. Filip722's pair on an RTX 5060 Laptop 8 GB (Bazzite, GE-Proton, Series S at 50 % scale, the first version of this PR, 240 frames): the descriptor work fell as here (records mirrored 11,292 → 191, the pass 30.5 → 5.3 ms, the buffer pass 77.8 → 22.4 ms, 560 MiB more video memory free) and the frame rate fell too, 5.84 → 5.14 fps, with their GPU phase at 22.5 → 60.8 ms and copy-back at 64.7 → 81.4 ms. One pair, but it points the same way as the table above, so read this switch as "measure on your machine", not as a default. ## Risk, and why it is off by default - A slot that was a table's and is then picked by index only is not seen by the pass for up to `VICTORY_TABLED_ALL_FRAMES` frames after the last draw bound its table (60 by default). With the retry it is seen then, whether or not its page is written again. Before the retry it could stay unseen for good; that hole is what Filip722's test shows. - The texture slots' own 240-frame rule (`tabled_lately`, `main`'s) is unchanged, with the switch or without. - The cost above. - I have run it in one scene only (the opening cutscene and the cell). It should be looked at in the open world and with skinned characters in view before it is anyone's default. ## How this relates to open PRs - #467 / #523 and #1043 make the two passes cheaper per slot. This takes the slots out of them. They should compose; I have not tried them together. akimfomin checked that #1413 merges cleanly with the first version. - #827's read-based window would bound the texture rule's own risk. ## Verification - `cargo clippy -p victory-gpu --all-targets`: no warnings. - `cargo test -p victory-gpu --lib descriptor`: 43 passed. New here: the stamp's ends at 1, 8 and 240 frames; the pass over a page (a changed record of a table's slot is left up to the last frame, taken in the frame after, its deadline is that frame, `VICTORY_HEAP_SYNC_TABLES=1` holds nothing back, and a table's texture slot is left with no deadline); Filip722's merge test of `TableRetries`; and Filip722's device test through `sync_heaps` on a write-watched heap, in child processes with the switch off and on. - That device test on Windows 11, RTX 3090 Ti: at the commit that adds it, the child with the switch on fails where it should ("stamp expiry must discover the copied slot without re-dirtying its page") and the child with it off passes; with the retry both pass. It needed one change to get as far as its subject on Windows (`9c3deb8`): the write watch there also reports a page's first touch when that is a read, so the test now touches its heap's pages and resets the watch before it counts anything. - The whole `victory-gpu` suite is intermittent on this PC with or without this PR: 5 of 48 runs failed on unmodified `4c60466` (`watch::tests::a_write_is_reported_at_every_checked_view` among them), 4 of 25 on this branch (each time `inplace::tests::warp_a_title_buffer_in_place_shows_its_bytes_at_its_offset`). Neither test is touched here. - `cargo xtask policy` reports the two oversized files it reports on `main` (`host.rs`, `lower.rs`); this PR touches neither. - In the game: thirteen 5.5-minute runs on this base (those in the table, the first version's pair and a third run with the switch off, and the two of the wider retry), none with an exception or a lost device, and about a dozen 6-minute runs of the first version on another tree. Numbers and text only: no game data, captures or screenshots. AI-assisted (Claude Code, Claude Fable 5.2). The retry and its two tests are Filip722's (assisted by Codex, per their comment).
The title writes its per-draw tables into its heap as bytes, every frame.
A table that holds a constant buffer is made afresh for its draw in slots
of our own, so the title's slots of it are read by nothing unless a shader
picks them by index. The pass over records copied in as bytes
(sync_heaps) cannot know that. It leaves a table's TEXTURE slots to the
draws that read them (tabled_lately), and takes every other changed record
there for one a shader may pick by index: a buffer view is "left for
later" (its host slot made null) on the submitting thread, and the
once-a-frame pass over buffer views picked by index (State::heap_buffers)
then makes each of them and looks at its memory, on a recording thread.

With the switch, table_entry and the tables made afresh stamp the title's
own slots as a table's whatever they hold (HostHeap::table_slot), and the
pass leaves them alone for as long as it leaves a table's texture slots
(TABLED_FRAMES).

Measured on main 4c60466 with #798 on top (the Series S profile needs it),
RTX 3090 Ti, Ryzen 9 9950X3D, Series S profile, the prologue's cell,
hands-off, one 5.5-minute run each way, the switch the only difference:

                                          off              VICTORY_TABLED_ALL=1
  frame (frame line)                      84 - 96 ms       55 - 59 ms
  records the pass mirrors, a frame       18,645           213
  the pass (sync_heaps), a frame          17.0 ms          3.0 ms
  "heap buffers" on the frame line        29 - 33 ms       8 - 12 ms
  exceptions, device loss                 none             none

The picture is the same in both (four frames of each side by side).

What it risks is what the rule risks for textures already (and what pull
request #827 describes for the 240-frame window): a slot that was a
table's and is then picked by index only is not seen by the pass until the
frames are over. For buffer views the pass over buffer views, in its
default form, looks at every slot it knows again every 16 passes, which
bounds that to 16 frames for a slot it has seen once. One scene only,
hence off by default.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-27 01:03:52 +00:00
Author
Owner

@⁠akimfomin on GitHub · 2026-11-27 00:16 UTC · original

At pinned head 9a18dd08, the table-slot stamp stays eligible for 240 guest frames, inclusive, even in the branch where mirror found no view. The stamp is local to that descriptor heap. Stamp test and lifetime. That gives a small boundary case for the risk you called out: seed a table slot, change the same slot to an indexed-only resource, and check the fetched value at the 240/241 boundary in fresh OFF and ON processes. This distinguishes delayed host-view publication from a frame-time win.

I separately checked that #1414 and #1413 merge cleanly; the span-cache author has that exact tree and four-case suggestion. For an independently repeatable correctness result, you can link just the SHA, both expected/actual values and the switch in PortBridge #98 so a fork can reuse it. This is source evidence, without GPU validation. AI-assisted review.

**@⁠akimfomin** on GitHub · 2026-11-27 00:16 UTC · [original](https://github.com/fxceless/victory-fork/pull/1414#issuecomment-7206317317) At pinned head `9a18dd08`, the table-slot stamp stays eligible for **240 guest frames**, inclusive, even in the branch where `mirror` found no view. The stamp is local to that descriptor heap. [Stamp test and lifetime](https://github.com/fxceless/victory-fork/blob/9a18dd08f88564894766b3a055dca08d29cb0b21/crates/victory-gpu/src/descriptor/host.rs#L1882-L1937). That gives a small boundary case for the risk you called out: seed a table slot, change the same slot to an indexed-only resource, and check the fetched value at the 240/241 boundary in fresh OFF and ON processes. This distinguishes delayed host-view publication from a frame-time win. I separately checked that #1414 and #1413 merge cleanly; the [span-cache author has that exact tree and four-case suggestion](https://git.gtahub.st/github/fxceless--victory-fork/pulls/1413). For an independently repeatable correctness result, you can link just the SHA, both expected/actual values and the switch in [PortBridge #98](https://github.com/akimfomin/PortBridge/issues/98) so a fork can reuse it. This is source evidence, without GPU validation. AI-assisted review.
Author
Owner

@⁠Filip722 on GitHub · 2026-11-27 00:35 UTC · original · edited 2026-11-27 00:52 UTC

I tested this commit on a Bazzite laptop with an RTX 5060 Laptop 8 GB, GE-Proton11-14, vkd3d-proton 3.2.0 and the indexed Wine server. Both Series S runs used the same executable, restored prefix and cache seed, 50% render scale and the same prison camera. Only VICTORY_TABLED_ALL changed. This is the 4c604661-based compatibility build.

54 s at the matched prison view Off On
Unique DXGI Presents 315 277
FPS 5.84 5.14
Median / p95 frame interval 166 / 216 ms 195 / 237 ms
Minimum free VRAM 902 MiB 1,462 MiB
Median mirrored records per frame 11,292 191
Median descriptor sync per frame 30.48 ms 5.25 ms
Median heap buffer pass per frame 77.75 ms 22.40 ms

The descriptor work fell sharply. In this single pair, median reported GPU phase was 22.5 / 60.8 ms and copy-back was 64.7 / 81.4 ms. Overall throughput fell in the same interval. Both rendered the same camera and had a median of zero queued host pipelines in the scoring windows. The usual GPU timing buckets are aggregate, so command attribution requires a separate trace.

The scoped descriptor filter passed 26 tests with each switch setting on the physical RTX. With a separate b1d777a integration, both default-wait arms hit the same title watchdog during loading and yielded no in-cell performance measurement.

A separate synthetic D3D12 test on the b1 integration put a newly copied buffer view in a write-watched heap. With the switch off, the next sync registered it. With the switch on, the page was consumed during the 240-frame stamp window and the view was still absent after 241 frame tokens. A padding write elsewhere on the same page let sync discover the original descriptor, whose bytes and key were unchanged. Both child processes selected the RTX. This isolates a lost retry after expiry.

A source-only follow-up reproduces that failure on public base b1d777a plus the PR and fixture at 4f164079. At f189f9a3, both physical test children pass. One deadline per changed page schedules a live reread when its table stamp can expire. The helper also checks that due pages merge in address order with ordinary dirty pages and that a failed read waits until a later frame. Windows-target GPU Clippy passed with warnings denied. The gameplay numbers above predate the expiry correction. Fixture and correction

Assisted by Codex (GPT-6.2-Sol High).

**@⁠Filip722** on GitHub · 2026-11-27 00:35 UTC · [original](https://github.com/fxceless/victory-fork/pull/1414#issuecomment-7206583060) · edited 2026-11-27 00:52 UTC I tested this commit on a Bazzite laptop with an RTX 5060 Laptop 8 GB, GE-Proton11-14, vkd3d-proton 3.2.0 and the indexed Wine server. Both Series S runs used the same executable, restored prefix and cache seed, 50% render scale and the same prison camera. Only `VICTORY_TABLED_ALL` changed. This is the `4c604661`-based compatibility build. | 54 s at the matched prison view | Off | On | | --- | ---: | ---: | | Unique DXGI Presents | 315 | 277 | | FPS | 5.84 | 5.14 | | Median / p95 frame interval | 166 / 216 ms | 195 / 237 ms | | Minimum free VRAM | 902 MiB | 1,462 MiB | | Median mirrored records per frame | 11,292 | 191 | | Median descriptor sync per frame | 30.48 ms | 5.25 ms | | Median heap buffer pass per frame | 77.75 ms | 22.40 ms | The descriptor work fell sharply. In this single pair, median reported GPU phase was 22.5 / 60.8 ms and copy-back was 64.7 / 81.4 ms. Overall throughput fell in the same interval. Both rendered the same camera and had a median of zero queued host pipelines in the scoring windows. The usual GPU timing buckets are aggregate, so command attribution requires a separate trace. The scoped descriptor filter passed 26 tests with each switch setting on the physical RTX. With a separate `b1d777a` integration, both default-wait arms hit the same title watchdog during loading and yielded no in-cell performance measurement. A separate synthetic D3D12 test on the b1 integration put a newly copied buffer view in a write-watched heap. With the switch off, the next sync registered it. With the switch on, the page was consumed during the 240-frame stamp window and the view was still absent after 241 frame tokens. A padding write elsewhere on the same page let sync discover the original descriptor, whose bytes and key were unchanged. Both child processes selected the RTX. This isolates a lost retry after expiry. A source-only follow-up reproduces that failure on public base `b1d777a` plus the PR and fixture at `4f164079`. At `f189f9a3`, both physical test children pass. One deadline per changed page schedules a live reread when its table stamp can expire. The helper also checks that due pages merge in address order with ordinary dirty pages and that a failed read waits until a later frame. Windows-target GPU Clippy passed with warnings denied. The gameplay numbers above predate the expiry correction. [Fixture and correction](https://github.com/Filip722/victory-fork/tree/review/tabled-descriptor-expiry) Assisted by Codex (GPT-6.2-Sol High).
Author
Owner

@⁠akimfomin on GitHub · 2026-11-27 01:01 UTC · original

Your source-only fixture closes the 240/241 ambiguity: the view stays missing after expiry until another write hits the page, and the corrected branch passes without that write. I checked the full SHA of the fixture and correction and preserved their distinct baselines in Test Lab #106.

Anyone with a suitable host can give that card to an agent and run both exact revisions without a title. It records the selected adapter and treats an early return as skipped. We can credit any second-device report here. The Bazzite frame-time pair still belongs to the earlier revision, so it won't be used as a performance claim for your expiry correction.

**@⁠akimfomin** on GitHub · 2026-11-27 01:01 UTC · [original](https://github.com/fxceless/victory-fork/pull/1414#issuecomment-7206945207) Your source-only fixture closes the 240/241 ambiguity: the view stays missing after expiry until another write hits the page, and the corrected branch passes without that write. I checked the full SHA of the fixture and correction and preserved their distinct baselines in [Test Lab #106](https://github.com/akimfomin/PortBridge/issues/106). Anyone with a suitable host can give that card to an agent and run both exact revisions without a title. It records the selected adapter and treats an early return as skipped. We can credit any second-device report here. The Bazzite frame-time pair still belongs to the earlier revision, so it won't be used as a performance claim for your expiry correction.
After review of fxceless/victory-fork#1414 (akimfomin: a stamped slot stayed
with its draws for 240 frames whatever it held, and nothing tested where
that ends).

- The switch's stamps are now its own (HostHeap::table_any, allocated only
  with the switch), read by the pass over records copied in as bytes and by
  nothing else. The first form wrote the texture queue's stamp, so the
  switch also changed how that queue treats a slot that had held a table's
  buffer view.
- VICTORY_TABLED_ALL_FRAMES (1 to 240) says for how many frames after a
  draw bound its table a slot is left. The default is 60, not 240.
- Tests: where the stamp ends (the last frame and the one after, for 1, 8
  and 240 frames), and the pass itself over a page: a changed record of a
  table's slot is left up to the last frame, taken in the frame after, and
  taken at once when no draw bound it or with VICTORY_HEAP_SYNC_TABLES=1.

Why 60. The title makes its per-draw tables in a ring of its heap's slots,
so a slot is written again some frames after a draw last bound its table,
and the stamp has to outlast that. main 4c60466 with #798 on top, RTX 3090
Ti, Series S profile, the prologue's cell, one 5.5-minute run a row:

  window        frame         records mirrored   the pass   "heap buffers"
  off           80 - 91 ms    16,994 a frame     15.8 ms    25 - 34 ms
  2 frames      73 - 77 ms    13,016             10.8 ms    19 - 25 ms
  8 frames      64 - 73 ms     9,697             10.2 ms    12 - 21 ms
  60 frames     55 - 59 ms     1,658              4.3 ms     9 - 11 ms
  240 frames    54 - 59 ms       218              3.0 ms     9 - 11 ms

(A second run each of "off" and of 60 frames read 84 - 96 ms with 18,645
records and 56 - 59 ms with 1,765: the figures in the code's comment.)

No exception and no lost device in any of them, and the cell's picture the
same in all (four frames of each side by side).

Co-Authored-By: Claude Fable 5.2 <[email protected]>
(cherry picked from commit 4f1640797187b37666cab4a78175830bd20c2ed8)
(cherry picked from commit f189f9a3a670f67feb18a8c6b5efafe3f32ac509)

Adapted to this branch when picked: a record's deadline comes from
HostHeap::left_until, which answers for the switch's own stamps and their
window (VICTORY_TABLED_ALL_FRAMES) as well as for the texture queue's
stamps. The original took the texture stamp's age and TABLED_FRAMES, which
was the only stamp before the commit under this one.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
On Windows the write watch also reports a page's first touch when that
touch is a read. The pass reads the whole 64 KiB page that holds a changed
slot, so the fifteen kernel pages of the test's heap that nothing had
written counted as written after the first sync, and the test's own check
that nothing wrote the heap again failed before it reached what it tests
(with the switch off, on Windows 11 26200: 'no descriptor writes after the
first sync', 15 against 0).

With every page touched and the watch reset first, on an RTX 3090 Ti: at
the commit that adds the test the child with the switch on fails where it
should ('stamp expiry must discover the copied slot without re-dirtying
its page') and the child with it off passes; with the retry both pass.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
As picked, the retry took a left record's deadline from whichever rule had
left it: the switch's own stamp, or the texture queue's (a table's texture
slot, 240 frames), which main applies without the switch. So with the
switch on, a record the texture rule had left was read again when that
rule's frames ended, where main takes it when its page is next written.

That changes main's texture rule, which is not this switch's to change. A
slot the rule left goes on showing the texture its draws made; made anew
from a record nothing has read since, it waits in the queue of textures
picked by index. In one of two 5.5-minute runs of the wider retry (RTX
3090 Ti, Series S profile, the prologue's cell) the cell's window frame
drew flat yellow from the first minute to the last. None of nine runs
without a retry did, and neither of two with this commit. One run in two
does not prove the retry did it; the narrower rule does not need the
proof.

Now HostHeap::retry_left gives a page a deadline only for a record the
switch's own stamp left (table_slot_until). A record with both stamps is
asked for again when the switch's ends, is found still left by the texture
rule, and then waits for its page's next write, as on main. The test of
the pass over a page covers both cases.

With it, two runs: frame 56 - 62 and 57 - 59 ms (55 - 59 with no retry),
records mirrored 2,011 and 2,114 a frame (1,658), the pass 5.1 and 4.9 ms
(4.3), 192 and 180 pages read a frame (174). No exception, no lost device.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
Author
Owner

@⁠KyleS98 on GitHub · 2026-11-27 02:05 UTC · original

@⁠akimfomin @⁠Filip722 thank you both. The branch has changed a good deal because of what you wrote (head c59bc53, five commits on top of the one you read), and the description is rewritten to match. In short:

1. The lost retry is real, and Filip722's test and fix are in. Writing a boundary test for akimfomin's question I had come to the same hole from the other side (the pass does not note a record it leaves as seen, so it is taken the next time its page is read, and nothing reads the page again unless something writes on it), and was about to write it up as a known limit. TableRetries closes it instead. Both commits are picked with Filip722 as their author: d4e76ed (the test) and 82d837b (the fix).

Two things I changed around them, each in a commit of its own so it can be judged apart:

  • 9c3deb8: the device test did not get as far as its subject on Windows. The write watch there also reports a page's first touch when that touch is a read, and the pass reads the slot's whole 64 KiB page, so the "no descriptor writes after the first sync" check found 15 kernel pages written with the switch off. The test now touches its heap's pages and resets the watch before it counts anything. With that, on Windows 11 and an RTX 3090 Ti: at the commit that adds the test the child with the switch on fails where it should ("stamp expiry must discover the copied slot without re-dirtying its page") and the child with it off passes; with the fix both pass.
  • c59bc53: the retry asks again only for what the switch's own stamp left. As picked, it also read a page again when the texture queue's 240 frames ended for a record on it, which changes main's texture rule whenever the switch is on. In one of two runs of that wider form the cell's window frame drew flat yellow in all nine screenshots of the cell (three minutes); none of nine runs without a retry did, and neither of two with the narrower one. One run in two does not prove the wider retry did it, but the narrower rule does not need the proof: the texture rule is main's, and with the switch on it now behaves exactly as without it. @⁠Filip722, this is the one place where I changed what your fix does, so please say if you see a case it loses.

2. Stamps of the switch's own, and a window that can be set (e072a19). The first version wrote the texture queue's stamp for every table slot, so the switch also changed how that queue treats a slot that had held a table's buffer view. Now the stamps are separate and read only by the pass over copied records. VICTORY_TABLED_ALL_FRAMES (1 to 240) sets the window, and the default is 60:

per frame (RTX 3090 Ti, Series S, the cell) frame records the pass mirrors the pass
off 80–91 ms 16,994 15.8 ms
2 frames 73–77 ms 13,016 10.8 ms
8 frames 64–73 ms 9,697 10.2 ms
60 frames 55–59 ms 1,658 4.3 ms
60 frames, with the retry (this head; two runs) 56–62, 57–59 ms 2,011, 2,114 5.1, 4.9 ms
240 frames (what you both read) 54–59 ms 218 3.0 ms

The title makes its per-draw tables in a ring of its heap's slots, so the stamp has to outlast the ring's turn; 60 frames keeps nearly all of it for a quarter of the exposure.

3. Tests (cargo test -p victory-gpu --lib descriptor: 43 passed): where the stamp ends at 1, 8 and 240 frames; the pass over a page (left up to the last frame, taken in the frame after, the deadline it reports, nothing held back with VICTORY_HEAP_SYNC_TABLES=1, a table's texture slot left with no deadline); and Filip722's two.

The slower pair stands. @⁠Filip722, I am not claiming this switch is a gain on your machine, and the description now says so near the top. Your descriptor figures match mine (at the same 240 frames, records mirrored 11,292 → 191 against 16,994 → 218 here, and the pass 30.5 → 5.3 ms against 15.8 → 3.0). What I can add is that my own frame lines point the same way as your copy-back: with the switch on, the submitting thread's "copies" go from 60–65 MB and 9–10 ms a frame to 74–83 MB and 19–24 ms, its "preparing" from 25 to 37–43 ms, and copying back takes 16–18 ms where it took 12 for the same 31–33 MB. I have not found why yet (the buffer pass defers its refreshes to the submission too, so it is not simply work moved between threads). Here the frame is shorter all the same, because without the switch recording was the limit; with it the submitting thread is. Where that side is the limit already, the extra could be the whole difference, which is what your pair looks like. If you run it again, an off-on-off order would tell a warm laptop apart from the switch, and VICTORY_TABLED_ALL_FRAMES=240 is the window your pair had.

One note on the suite, since both of you ran it: cargo test -p victory-gpu --lib is intermittent on this PC with or without this PR (5 of 48 runs failed on unmodified 4c60466, watch::tests::a_write_is_reported_at_every_checked_view among them; 4 of 25 on this branch, each time inplace::tests::warp_a_title_buffer_in_place_shows_its_bytes_at_its_offset). Neither is touched here.

AI-assisted (Claude Code, Claude Fable 5.2).

**@⁠KyleS98** on GitHub · 2026-11-27 02:05 UTC · [original](https://github.com/fxceless/victory-fork/pull/1414#issuecomment-7207817504) @⁠akimfomin @⁠Filip722 thank you both. The branch has changed a good deal because of what you wrote (head `c59bc53`, five commits on top of the one you read), and the description is rewritten to match. In short: **1. The lost retry is real, and Filip722's test and fix are in.** Writing a boundary test for akimfomin's question I had come to the same hole from the other side (the pass does not note a record it leaves as seen, so it is taken the next time its page is read, and nothing reads the page again unless something writes on it), and was about to write it up as a known limit. `TableRetries` closes it instead. Both commits are picked with Filip722 as their author: `d4e76ed` (the test) and `82d837b` (the fix). Two things I changed around them, each in a commit of its own so it can be judged apart: - `9c3deb8`: the device test did not get as far as its subject on Windows. The write watch there also reports a page's first touch when that touch is a read, and the pass reads the slot's whole 64 KiB page, so the "no descriptor writes after the first sync" check found 15 kernel pages written with the switch **off**. The test now touches its heap's pages and resets the watch before it counts anything. With that, on Windows 11 and an RTX 3090 Ti: at the commit that adds the test the child with the switch on fails where it should ("stamp expiry must discover the copied slot without re-dirtying its page") and the child with it off passes; with the fix both pass. - `c59bc53`: the retry asks again only for what the switch's own stamp left. As picked, it also read a page again when the texture queue's 240 frames ended for a record on it, which changes `main`'s texture rule whenever the switch is on. In one of two runs of that wider form the cell's window frame drew flat yellow in all nine screenshots of the cell (three minutes); none of nine runs without a retry did, and neither of two with the narrower one. One run in two does not prove the wider retry did it, but the narrower rule does not need the proof: the texture rule is `main`'s, and with the switch on it now behaves exactly as without it. @⁠Filip722, this is the one place where I changed what your fix does, so please say if you see a case it loses. **2. Stamps of the switch's own, and a window that can be set** (`e072a19`). The first version wrote the texture queue's stamp for every table slot, so the switch also changed how that queue treats a slot that had held a table's buffer view. Now the stamps are separate and read only by the pass over copied records. `VICTORY_TABLED_ALL_FRAMES` (1 to 240) sets the window, and the default is 60: | per frame (RTX 3090 Ti, Series S, the cell) | frame | records the pass mirrors | the pass | |---|---:|---:|---:| | off | 80–91 ms | 16,994 | 15.8 ms | | 2 frames | 73–77 ms | 13,016 | 10.8 ms | | 8 frames | 64–73 ms | 9,697 | 10.2 ms | | 60 frames | 55–59 ms | 1,658 | 4.3 ms | | 60 frames, with the retry (this head; two runs) | 56–62, 57–59 ms | 2,011, 2,114 | 5.1, 4.9 ms | | 240 frames (what you both read) | 54–59 ms | 218 | 3.0 ms | The title makes its per-draw tables in a ring of its heap's slots, so the stamp has to outlast the ring's turn; 60 frames keeps nearly all of it for a quarter of the exposure. **3. Tests** (`cargo test -p victory-gpu --lib descriptor`: 43 passed): where the stamp ends at 1, 8 and 240 frames; the pass over a page (left up to the last frame, taken in the frame after, the deadline it reports, nothing held back with `VICTORY_HEAP_SYNC_TABLES=1`, a table's texture slot left with no deadline); and Filip722's two. **The slower pair stands.** @⁠Filip722, I am not claiming this switch is a gain on your machine, and the description now says so near the top. Your descriptor figures match mine (at the same 240 frames, records mirrored 11,292 → 191 against 16,994 → 218 here, and the pass 30.5 → 5.3 ms against 15.8 → 3.0). What I can add is that my own frame lines point the same way as your copy-back: with the switch on, the submitting thread's "copies" go from 60–65 MB and 9–10 ms a frame to 74–83 MB and 19–24 ms, its "preparing" from 25 to 37–43 ms, and copying back takes 16–18 ms where it took 12 for the same 31–33 MB. I have not found why yet (the buffer pass defers its refreshes to the submission too, so it is not simply work moved between threads). Here the frame is shorter all the same, because without the switch recording was the limit; with it the submitting thread is. Where that side is the limit already, the extra could be the whole difference, which is what your pair looks like. If you run it again, an off-on-off order would tell a warm laptop apart from the switch, and `VICTORY_TABLED_ALL_FRAMES=240` is the window your pair had. One note on the suite, since both of you ran it: `cargo test -p victory-gpu --lib` is intermittent on this PC with or without this PR (5 of 48 runs failed on unmodified `4c60466`, `watch::tests::a_write_is_reported_at_every_checked_view` among them; 4 of 25 on this branch, each time `inplace::tests::warp_a_title_buffer_in_place_shows_its_bytes_at_its_offset`). Neither is touched here. AI-assisted (Claude Code, Claude Fable 5.2).
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/1414/head:github-bot/gh-1414'
git switch 'github-bot/gh-1414'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-1414'
git switch 'github-bot/gh-1414'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-1414'
git switch 'github-bot/gh-1414'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-1414'
git switch 'main'
git merge --squash 'github-bot/gh-1414'
git switch 'main'
git merge --ff-only 'github-bot/gh-1414'
git switch 'main'
git merge 'github-bot/gh-1414'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.