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
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/fxceless--victory-fork!1414
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1414"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@KyleS98 on GitHub · 2026-11-26 23:58 UTC · original
KyleS98:perf/tabled-table-slots→main· +48 −5 · 2 files · 1 commits · openSummary
One opt-in switch,
VICTORY_TABLED_ALL=1(off by default): every slot of a table a draw binds counts as a table's slot, whatever it holds, not only the slots that hold texture views. Nothing changes without the switch.In the prologue's cell on
mainit took the frame from 84–96 ms to 55–59 ms on an RTX 3090 Ti (table below).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:State::heap_buffers) then makes each of them and looks at its memory.I found it with a counter of what
HostHeap::mirrordoes 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 a table's (the same stamptexture_slot_tabledwrites, without the "read" bit and without touching the texture queue). It does nothing unless the switch is on.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 pass over copied records then skips those slots exactly as it skips a table's texture slots, for
TABLED_FRAMES. 48 lines added, 5 removed, two files.Measurements
main4c60466with #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 build; the switch is the only difference between the two runs.Switches in both:
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_ONCEat 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 inVICTORY_SKIP_PIPELINES.VICTORY_TABLED_ALL=1sync_heaps)A third run of the same build with the switch off (it had another, unrelated switch on that changed nothing) read 84–88 ms, so the baseline is not one slow run.
On another tree (#994's head with #911 and #868; the frame there was limited by the submitting thread, not by recording) the same change took the frame from 60 to 53 ms, the pass from 13.8 to 2.3 ms and the buffer slots looked at from 29,400 to 6,500 a frame.
Picture: in the cell the same with and without, on both trees (four frames of each run side by side). The cutscene before the cell has
main's known faults in both runs 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.Risk, and why it is off by default
It widens a rule that already has a known weakness.
tabled_latelyskips a slot for 240 frames after it was last a table's, and does not see a slot that stops being read through a table and is then picked by index: #827 describes that for texture slots (and proposes a shorter, read-based window). With this switch the same holds for the other slots of a table.For buffer views there is a second net: the pass over buffer views, in its default form, looks at every slot it knows again every 16 passes, so a slot it has seen once is brought up to date within 16 frames. A slot stamped before the pass ever saw it has no such net.
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
Verification
cargo clippy -p victory-gpu --all-targets: no warnings.cargo test -p victory-gpu --lib descriptor: 39 passed.cargo xtask policyreports the two oversized files it reports onmain(host.rs,lower.rs); this PR touches neither.main, and about a dozen 6-minute runs with the switch on on the other tree, none with an exception or a lost device.Numbers and text only: no game data, captures or screenshots.
AI-assisted (Claude Code, Claude Fable 5.2).
@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 wheremirrorfound 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.
@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_ALLchanged. This is the4c604661-based compatibility build.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
b1d777aintegration, 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
b1d777aplus the PR and fixture at4f164079. Atf189f9a3, 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 correctionAssisted by Codex (GPT-6.2-Sol High).
@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.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.