Skip to content

Frame rate: indirect clamps in runs, landing fetches from card slots, re-check fix (2.5 -> 7.5 fps on a 5070 Ti) - #995

Open
tunczzz wants to merge 2 commits into
fxceless:mainfrom
tunczzz:pr/fps-relay-landing
Open

tunczzz wants to merge 2 commits into
fxceless:mainfrom
tunczzz:pr/fps-relay-landing

Conversation

@tunczzz

@tunczzz tunczzz commented Nov 25, 2026 •

Copy link
Copy Markdown

Frame-rate work on top of 0b0074e, measured on an RTX 5070 Ti (32 GB) in the first prison cutscene and the start of gameplay.

Result: 217-225 ms a frame before the 9376fd6 merge, 133-138 ms (7.2-7.5 fps) with the settings listed in docs/fps-notes.md. The card went from ~117 to ~64 ms a frame; the frame is now bound by the submitting thread, mostly the descriptor heap sync.

Almost everything is behind a switch and off by default, so the default behaviour is unchanged except for the fixes listed below. docs/fps-notes.md has the run table, the exact settings, what was tried and rejected (with the reason), and what is still open.

The big wins

  • Indirect clamp stalls (card 105 -> 64 ms). Each indirect record was clamped by a compute pass between two waits, 7-12 us of card time per call, ~4,700 calls a frame. VICTORY_INDIRECT_BATCH=3 clamps a run of calls in one pass (a run ends only at work that can store to a buffer); VICTORY_MESH_AMPLIFY=1 clamps mesh records inside an amplification stage.
  • Landing fetches. Fetches sat on the main queue behind every later flight (60-105 ms a frame of waiting). VICTORY_CARD_FETCH_INFLIGHT=2 copies each flight's flagged pieces into slots in card memory inside the flight, then copies the slots down on a copy queue at landing. Mode 1 was slow because shader writes into PC memory fall off a cliff on this card (64 MB: ~600 ms, against 0.74 ms into card memory).
  • Windows in GPU upload heaps (VICTORY_GPU_UPLOAD_COPIES=1) and table constants bound to the card copy (VICTORY_TABLE_ON_CARD=1).
  • CPU side: heap-sync skips (VICTORY_HEAP_SYNC_TABLES=2, VICTORY_SYNC_NULL_SKIP=1), wide fills, texture checks and refreshes, and fewer view-memory askings.

Fixes that are on by default

  • Texture re-check: VICTORY_HEAP_RECHECK fingerprinted past a texture's own bytes into the next texture placed in its large levels, and uploaded it again with them; that was the blocky strip at the bottom of the scene. It now stops at the next texture's start. There is also a BTreeMap::range panic fix for textures smaller than the head.
  • Refresh on a full card: VICTORY_REUPLOAD_WHEN_FULL with async texture workers never ran. It is now done in the pass.
  • Stale textures: textures uploaded before a DirectStorage write into their pages are uploaded again.
  • Save containers: they no longer fail when a version folder exists in both layers of a packaged app's virtualised AppData (os error 4395). This is why the settings never saved.
  • Smaller ones: window ghosting is off; the arrow keys also turn the camera (VICTORY_ARROWS_LOOK=0 restores the D-pad); blending is turned off for integer targets, so the wiper-mask pipeline builds.

Not proven / needs a look

  • VICTORY_ASYNC_SUBMIT=1 drew the room without walls here. VICTORY_FLIP_LANDED is the attempted fix and is not measured yet.
  • VICTORY_PICKED_EXACT=1 declares the skinning programs' writes through heap-picked UAVs from their job records. It is not measured yet.
  • Run-to-run differences (window wire mesh, left wall, top colour) track textures held back under the commit floor.
  • Tests: victory-gpu and victory-shader lib tests pass, except indirect::tests::warp_budget_saturates_without_wraparound_and_preserves_draw_fields, which is flaky on the merged upstream code too.

This is one squashed commit of many smaller ones. Happy to split it if you'd rather take parts of it.

🤖 Generated with Claude Code

Update: merged 3973179 (upstream's frame-rate commit). Where both of us had built the same thing, yours wins: VICTORY_JOIN_PARTS is yours (my own version of it was dropped), and your pace/card-meter diagnostics are kept as they are; the one clash was a field called �sked on Fence, mine is unchanged and yours is now pace_asked. After the merge: cargo check is clean with and without diagnostics, �ictory-gpu lib tests pass (264), and a five-minute run on the 5070 Ti is 131-136 ms (7.4-7.6 fps) with no device loss.

tunczzz and others added 2 commits November 25, 2026 15:25
… table constants on the card, fixes to upstream's texture re-check

Measured on an RTX 5070 Ti in the first prison cutscene and gameplay:
217-225 ms a frame before the 9376fd6 merge, 133-138 ms (7.2-7.5 fps) with
the settings in docs/fps-notes.md; the card went from ~117 to ~64 ms a
frame. Almost everything is behind switches, off by default; see the notes
for the table of runs, what was rejected and why.

- Indirect calls: VICTORY_INDIRECT_BATCH=1|3 clamps a run of indirect calls
  in one pass (3: a run ends only at work that can store to a buffer);
  VICTORY_MESH_AMPLIFY=1 clamps indirect mesh records in an amplification
  stage (blending turned off for targets the card cannot blend, so the
  wiper-mask pipeline builds).
- Landing: VICTORY_CARD_FETCH_INFLIGHT=2 copies each flight's flagged pieces
  into slots in card memory inside the flight and copies the slots down on
  the landing thread's copy queue; one flight per landing.
- Title reads: VICTORY_TABLE_ON_CARD / VICTORY_TABLE_GPU_COPY bind or copy
  table constants on the card; VICTORY_COPY_ON_CARD runs title buffer copies
  on the card; early-read counters for title copies.
- Memory and buses: VICTORY_GPU_UPLOAD_COPIES (windows in GPU upload heaps),
  card-window gate, levels kept under pressure (VICTORY_PRESSED_LEVELS_KB),
  memory map labels, notes that card memory counts as commit.
- CPU: heap sync parts line and skips (VICTORY_HEAP_SYNC_TABLES=2,
  VICTORY_SYNC_NULL_SKIP, a pre-read that only peeks), wide fills/texture
  checks/declared refreshes, fewer view askings, joined submissions
  (VICTORY_JOIN_PARTS), async-submit fixes (VICTORY_FLIP_LANDED), barrier
  counter and lazy UAV waits, frame-path line.
- Fixes on by default: upstream's texture re-check fingerprints only the
  texture's own bytes (and no BTreeMap range past its end); refresh on a full
  card is done in the pass; textures uploaded before a DirectStorage write are
  uploaded again; save containers survive a folder present in both layers of
  a packaged app's AppData; window ghosting off; arrow keys also turn the
  camera (VICTORY_ARROWS_LOOK=0: the D-pad as before).
- Shaders: wave-wide LDS branches outside loops, VICTORY_WAVE_LOCAL_FIRST,
  VICTORY_WAVE_UNIFORM, VICTORY_LEAN_MATH, picked-store recipes
  (VICTORY_PICKED_EXACT).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Where both sides built the same thing, upstream's wins: VICTORY_JOIN_PARTS is
upstream's (our own joining of parts is dropped), VICTORY_VIEW_KNOWN=alt and
the fence pace/card meter diagnostics are taken as they are. The field
upstream added to Fence for its pace meter is renamed pace_asked (ours is
the highest value a queue was told to signal, asked). Kept from our side: the
async-submit/flip fixes, window-jump stays off by default beside our indirect
runs.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@grosterr

Copy link
Copy Markdown

A data point on "VICTORY_ASYNC_SUBMIT=1 drew the room without walls here": not reproduced on an RTX 3060 12 GB (Ryzen 7 5700X, 32 GB, Windows 11, Series X profile).

Tree: not this PR. It is the #770 stack (d034ac1) with main a253706 merged in (grosterr/victory-fork rtx3060), with LEVELS_ON_DEMAND=1 EARLY_TEXTURES_MS=40 TEXTURE_NO_WAIT=1 WIDE_TEXTURES=1 as the base. Same save each time, ~5–10 minutes in the first rooms and corridor:

run switches on top of the base walls / picture
A0a ASYNC_SUBMIT=1 alone walls present, picture clean
A0, A0r ASYNC_SUBMIT=1 QUEUE2=1 INDIRECT_WINDOW=1 COPY_PLAIN=1 walls present in both

No device loss and no errors in any of them. So on this tree the missing walls do not follow from ASYNC_SUBMIT alone. It may depend on something else in this PR (or on 0b0074e's changes), which might help narrow down what VICTORY_FLIP_LANDED has to fix.

For scale, the four switches together took this card from 330 to 243–282 ms a frame (copy-back 216 → 66 ms, most of it from QUEUE2).

AI-assisted (Claude Code); the runs and observations are mine.

PiloteCode added a commit to PiloteCode/victory-fork that referenced this pull request Nov 25, 2026
…opies of them (os error 4395), from fxceless fxceless#995 (tunczzz)

Run from a packaged app, the host merges the real AppData\Local with the
package's private copy of it, and a version folder can exist in both
layers. std::fs::remove_dir_all opens what is inside without following
reparse points, which such a merged folder needs, and fails with
ERROR_REPARSE_POINT_ENCOUNTERED (4395) however often it is retried:
`patiently` gave up on a staged v<n>.new after its second and the commit,
and so the title's settings save, failed. fxceless#995's remove_tree removes it
entry by entry, by path, up to four passes (each pass removes the upper
copy, the lower one shows through); every removal of the module goes
through it, stale versions included, and a deleted container whose lower
copy shows through after the rename is renamed and removed again.

Already ours (kept): a stale version that cannot be removed never blocks
the container (remove_stale, patiently, a_held_old_version_does_not_cost_
the_save), so fxceless#995's discard() and its test of that are not taken.
PiloteCode added a commit to PiloteCode/victory-fork that referenced this pull request Nov 25, 2026
…xture placed inside it; no BTreeMap range panic for a texture smaller than its head, from fxceless fxceless#995 (tunczzz)

The re-check of a slot uploaded whole (VICTORY_HEAP_RECHECK, upstream's,
on by default) fingerprinted the texture's memory at its full size. The
title keeps only a texture's small levels and places the next textures
where its large ones would be, so the fingerprint's middle and end
windows saw the neighbours stream in, and the texture was uploaded again
with their bytes as its large levels: fxceless#995 measured the most re-uploaded
slots 4, 8 and 16 KiB apart, 344-684 KiB each (its runs n7-n14), and
names this as the blocky strip on the near surfaces at the bottom of the
picture. (A different cause from the strip we fixed by splitting
dispatches past 65,535 groups.)

descriptor::host::texture_own_bytes (start, len): up to where the next
texture placed inside it starts (next_start), all of it if none does. The
upload notes the fingerprint of those bytes only, and the re-check reads
the same. Spans::next_start no longer asks BTreeMap::range for a range
whose start is past its end (a texture smaller than HEAD), which panics.

Test: own_bytes_end_at_the_next_texture_placed_inside (fxceless#995's, with the
small-texture case added).
PiloteCode added a commit to PiloteCode/victory-fork that referenced this pull request Nov 25, 2026
…efore such a write are made due again by default (VICTORY_PAGE_WRITES=guards: as before), from fxceless fxceless#995 (tunczzz)

A DirectStorage write into physical pages the title has mapped is seen by
no guard; title_memory_written said so (counted), and by default only the
guarded blocks of host copies under it were opened (bit 1). The placed
textures picked by index that had been uploaded before the write kept the
bytes from before it, what the title's pages held for another texture,
for the rest of the run. fxceless#995 measured 5,500 to 7,300 such textures a run
(a quarter of the slots under such writes; its runs n15-n23), which ones
depending on timing, so one shot looked different from run to run.

- watch::page_writes: unset (or 1) is now bits 1 and 2: the guards are
  opened and those slots are made due, each once a write (about 25 a
  second while the world streams; their host copies exist, no room
  needed). `guards` keeps bit 1 alone, the default before; 0, slots and
  all as they were.
- A finished kernel read to a plain address also tells the texture slots
  under it with bit 2 (writing() made them due when the read began, a
  frame before its bytes may be there; one uploaded meanwhile took what
  was there before); the guards there still only with bit 4.
- The per-second "writes behind the guards" line says how many slots were
  made due for such writes, and how many show bytes older than the
  title's last write now, with the age of the oldest
  (TextureQueue::behind, descriptor::host::PAGE_BEHIND): with
  VICTORY_PAGE_WRITES=guards that count stays high.

Not ported here: fxceless#995's worker read let go at such a write
(prepare::forget), which belongs to its texture workers
(VICTORY_ASYNC_TEXTURES), ported with them behind their switch.
PiloteCode added a commit to PiloteCode/victory-fork that referenced this pull request Nov 25, 2026
…WS_LOOK=1) and window ghosting may be turned off (VICTORY_GHOSTING=0), both off by default, from fxceless fxceless#995 (tunczzz)

- VICTORY_ARROWS_LOOK=1: the arrow keys are the right stick too (as the
  I/J/K/L places) and the D-pad moves to the numpad's 8/2/4/6. fxceless#995 has
  it on unless 0; here it is off: it is a preference, not a fix, and the
  arrows stay the D-pad the menus use. Ported onto our key places (the
  letters by US scan code, AZERTY as US; Esc, Enter and the arrows by
  virtual key), which it does not touch. Test:
  the_arrows_look_only_when_asked (off and on, the numpad, the stick
  clamped, AZERTY letters).
- VICTORY_GHOSTING=0: DisableProcessWindowsGhosting once before the
  title's first window. fxceless#995 turns ghosting off by default against a
  white "not responding" ghost over the frames while the title's window
  thread loads; our stand-in window (owned by a thread of ours that only
  reads its messages, the title's window message-only) already keeps the
  window the player sees answering, so ghosting stays on by default.

Not ported: fxceless#995's title_window_made hook (frames go to the title's
biggest top-level window; ours go to the stand-in), and scripted keys
(VICTORY_KEYS) in release builds (they stay a diagnostics aid).
PiloteCode added a commit to PiloteCode/victory-fork that referenced this pull request Nov 25, 2026
…uffer views by a computed index (fxceless#995 by tunczzz, picked-store recipes)

From fxceless/victory-fork fxceless#995 (tunczzz), its translator part. The
title's skinning programs (CSComputeSkinning*, cable, rope, tree
animation, CSUnpackIB*) write their vertex and index streams through
unordered access views they pick from the view heap by an index they
compute; no table or root view of the dispatch names them, so the layer
cannot tell from the binding what such a dispatch writes.

victory_shader::picked::heap_picks reads the recipe out of the
program's SSA form: per buffer store whose descriptor is loaded from the
heap, the shift, the mask and where the index comes from (a root
constant, or a field of a job record in a structured buffer the
dispatch's root constants bound), as HeapPick / PickSource. Nothing here
is used by the translation itself: the layer evaluates the recipes with
the dispatch's arguments under its own switch (fxceless#995's
VICTORY_PICKED_EXACT, ported with the GPU side). The example
picked_index prints the recipes of containers given to it (offline).
PiloteCode added a commit to PiloteCode/victory-fork that referenced this pull request Nov 25, 2026
…rds, lean math, more wave-uniform values, local waves first, wave-wide branches outside loops and node tests that miss (tunczzz; every one off by default)

From fxceless/victory-fork fxceless#995 (tunczzz), its translator part. The
default translation is unchanged: what fxceless#995 turns on by default is
behind a switch here, said below. Each switch is read by the shader
cache key (build.rs lists every quoted VICTORY_* name).

- VICTORY_MESH_AMPLIFY=1: translated mesh shaders declare a 4-byte
  payload (shader::mesh_payload, read at each translation) so that the
  layer can put its amplification shader in front of them
  (emit::amplification_shader, as_6_6; AMPLIFY_CONSTANTS,
  AMPLIFY_RECORDS, AMPLIFY_COUNTED, MESH_PAYLOAD): an indirect mesh
  record is read and clamped in the graphics pipe instead of by a
  compute pass between two waits. The metadata and the PSV take the
  payload and the amplification kind (14). Off: payload 0, as before.
- VICTORY_RT_MISS=1 (emit::rt_miss): every ray-tracing node test returns
  what a ray with nothing in its way gets (bvh::nothing_in_the_way),
  without reading the node. Ours already answers no hit while the
  structures are not built, at run time (USER_STRUCTURES); this is the
  translation-time form, for comparing the two.
- VICTORY_LEAN_MATH=1|2: legacy multiply, maximum and minimum, the cube
  face instructions and scalar loads from raw views (one load of up to
  four dwords) in cheaper exact forms (bitcode float_bits, zero_root);
  2 also uses DXIL's FMax/FMin. VICTORY_CLASS_RANGES=1 (lean.rs):
  v_cmp_class with a constant mask tests ranges of the bits.
- VICTORY_WAVE_UNIFORM (bits): more values a console wave64 program in
  two host waves finds alike in every lane, so that a first-lane read
  takes its own host wave's lane instead of an exchange through LDS: 1,
  an operand judged by its own registers; 2, buffer loads at an alike
  address through read-only views; 4, LDS reads at an alike address no
  LDS write can race (lds_unraced). Bit 4's rule is always on in fxceless#995:
  here it waits for the bit.
- VICTORY_WAVE_LOCAL_FIRST=1: a wave64 program whose wave operations are
  the allocation idiom takes each host wave as its own wave before the
  forms that exchange through LDS at group barriers.
- VICTORY_WAVE_WIDE=acyclic: the wave-wide form only where no branch
  taken wave-wide lies in a loop (fxceless#995's default; here, as before, the
  wave-wide form stays off unless VICTORY_WAVE_WIDE=1 takes any, and
  `acyclic` is asked for by name). WAVE64-FORM / WAVE64-LDS-REGION lines
  under VICTORY_WAVE_WHY say why a form failed.

On by default, as a fix: a v_fma_mixlo_f16 whose register's old value
has no host form (the first half of an interpolation) no longer stops
the program when no one reads the high half it keeps
(Lower::high_half_unread); it only changes programs that failed before.

Not taken, ours kept: fxceless#995's ir::join_wave_sections (wave7's
ir::whole_sections does the same at translation, tested by
two_reductions_that_share_their_end_translate_as_two_sections);
VICTORY_QUAD_OPS (quad.rs already makes DPP quad permutations host quad
operations: VICTORY_QUAD_READS, on by default); fxceless#995's restore-pair
change in ir::unspill (wave7 already lets work come between the two
restores; only the comment is taken).
PiloteCode added a commit to PiloteCode/victory-fork that referenced this pull request Nov 25, 2026
…'s mesh bench, lean math, wave-uniform LDS reads, wave-wide branches outside loops, local waves first, lane masks joined round loops, title containers

From fxceless/victory-fork fxceless#995 (tunczzz), its translator tests, run
against wave7's translator. Tests of what fxceless#995 has on by default set the
switch through its test hook (lower::TEST_WAVE_UNIFORM, emit's
TEST_WAVE_WIDE) and check that the default translation does not take it.

- mesh_bench_tests (ignored unless asked for: a card and dxc.exe): card
  time of mesh draws, direct, clamped by a compute pass, and launched by
  the amplification shader; the title's containers come from paths in
  VICTORY_TEST_MESH_CONTAINER(S) at run time, none in the repository.
  Host::root_signature_with takes fxceless#995's extra root parameters (ours'
  bounded root UAVs kept, as root_signature_bounded).
- title_tests (ignored unless VICTORY_TEST_CONTAINERS and friends name
  containers): translate, validate, pair and dump the title's programs.
- valu_tests: lean math against the general forms, class ranges, the
  host's FMax/FMin order of signed zeros (build_cs_with, per-thread
  stores).
- wave64_tests: the structure builder's scan (an LDS read alike in every
  lane, VICTORY_WAVE_UNIFORM bit 4), LDS shared inside a lane branch
  taken wave-wide (VICTORY_WAVE_WIDE=acyclic picks it, the default does
  not), a wave-wide branch in a loop only when asked for, an append with
  an early-out taking local waves first (VICTORY_WAVE_LOCAL_FIRST).
  fxceless#995's test of its join_wave_sections is not taken (wave7's
  whole_sections has its own).
- mask_join_tests, waterfall_tests, intersect_tests (node tests that
  miss), ir.rs (a parked pair restored with work between).
PiloteCode added a commit to PiloteCode/victory-fork that referenced this pull request Nov 25, 2026
…of the append program without VICTORY_WAVE_LOCAL_FIRST too (split::local_if_exact), and the test says so

fxceless#995 (tunczzz) checks that without the switch another form is picked;
on wave7 the default picks the same local form, as split::local_if_exact
takes each form's local form where it is exact. The switch stays (off):
it only moves the idiom's local forms ahead of the exchange forms.
PiloteCode added a commit to PiloteCode/victory-fork that referenced this pull request Nov 25, 2026
…longer stopped by error 4395, the texture re-check reads only the texture's own bytes and no longer panics, textures uploaded before a DirectStorage write made due again (VICTORY_PAGE_WRITES=guards for the old way), arrow-key look and window ghosting behind switches (off), the translator's speed parts behind switches (off) and its high-half fix

# Conflicts:
#	crates/victory-gpu/src/draw.rs
PiloteCode added a commit to PiloteCode/victory-fork that referenced this pull request Nov 25, 2026
…device copy jobs, fxceless#990, fxceless#959), fxceless fxceless#995's fixes (saves no longer stopped by error 4395, texture re-check on the texture's own bytes, textures uploaded before a DirectStorage write made due again), legacy squares without their select, and switches for the coherence stages, barriers and copy-back measurements (off); 132 ms a frame in the world at PCIe gen 5
PiloteCode added a commit to PiloteCode/victory-fork that referenced this pull request Nov 25, 2026
…(the sync run there, the wait for the sync beside the preparing, the slots that waited for a texture), on a line of its own beside the sync's; for the port of fxceless fxceless#995's heap-sync switches (tunczzz)
PiloteCode added a commit to PiloteCode/victory-fork that referenced this pull request Nov 25, 2026
…ds of tables' slots left to their draws and mirrored a frame later only if no draw made them (VICTORY_HEAP_SYNC_TABLES=2: constant and placed views, 3: all; VICTORY_SYNC_DRAWN_BEFORE, VICTORY_HEAP_SYNC_TABLES_FRAMES), constant views whose mirror would only write the null already there passed over (VICTORY_SYNC_NULL_SKIP=1), records whose slot is made from them already or bytes not ours passed over (VICTORY_SYNC_MADE_SKIP=1, VICTORY_SYNC_NONE_SKIP=1), pages looked at by several threads (VICTORY_SYNC_WIDE=N); a parts line while one is on. Slots are made from the bytes fingerprinted, as ours were; with every switch off the sync is the one before
PiloteCode added a commit to PiloteCode/victory-fork that referenced this pull request Nov 25, 2026
… tables of the title's own slots (VICTORY_TABLE_INDEXED=1, off), from fxceless fxceless#995 (tunczzz): with the heap sync leaving tables' slots to their draws, such entries were made only by the title's view calls; counted on the sync's lines
PiloteCode added a commit to PiloteCode/victory-fork that referenced this pull request Nov 25, 2026
…xt step that writes title memory, host work or the end of the steps (VICTORY_WIDE_FILLS=1, off), from fxceless fxceless#995 (tunczzz); overlapping or fewer than 64 done in order; a line of their own, and their time counted to the fills on the submitting thread's diagnostics line
PiloteCode added a commit to PiloteCode/victory-fork that referenced this pull request Nov 25, 2026
…p sync timed on the submitting thread, fxceless#995's heap-sync modes and skips (VICTORY_HEAP_SYNC_TABLES=2|3, VICTORY_SYNC_NULL_SKIP/MADE_SKIP/NONE_SKIP, VICTORY_SYNC_WIDE), entries picked by root constant from the title's tables (VICTORY_TABLE_INDEXED), upload-memory fills gathered (VICTORY_WIDE_FILLS); all off
PiloteCode added a commit to PiloteCode/victory-fork that referenced this pull request Nov 25, 2026
…itle reads copied back by default (boats no longer sink), lazy copy-back and fxceless fxceless#995's heap-sync parts behind switches (off)
PiloteCode added a commit to PiloteCode/victory-fork that referenced this pull request Nov 25, 2026
…le wrote after its own: a view from before (one the title never cleared) no longer hides its large levels from the look after the upload, nor from a write that begins past that view (VICTORY_OWN_BYTES=next: any next texture, as from fxceless fxceless#995; =0: the whole span, as before it)

Since the fingerprint of a placed texture stopped at the next texture placed inside its span (fxceless fxceless#995), any view in a slot shaders pick by index that started inside the span cut the look after the upload down to the texture's small levels, whether the title still used that view or had only never cleared it. A texture uploaded before the title filled its large levels then kept, for the rest of the run, what that memory held at the upload: texel noise on a surface whose other textures were right. A DirectStorage write of those levels did not name the texture either: a write that begins at no texture's start named the nearest texture before it alone, here the old view.

Spans now keep, per span, when the title last wrote a view of it. texture_own_bytes ends a texture at the next span written after its own; Spans::slots_holding names, for a write that begins at no span's start, the nearest span before it that reaches it and each earlier one written after every span between (up to 256 spans back, no further than the longest span noted).

Test: a_view_from_before_does_not_end_a_texture_written_after_it.
@slauko

slauko commented Nov 26, 2026

Copy link
Copy Markdown

A request for the split you offered, from a Wine line that cannot take the branch as one piece (vkd3d-proton, RTX 3080 Ti, uiliannn's base; the cell at ~4,950 draws a frame, 636 of them indirect, card 144–190 ms of a 262–288 ms frame):

the indirect clamp batching (VICTORY_INDIRECT_BATCH=3) as its own PR, with whatever host.rs/descriptor.rs plumbing it needs.

Why that one first: my line already records the clamps per gather set — a compute pass per set between a UAV barrier on each side (indirect.rs, record_gather_as: uav_barrier, dispatch, uav_barrier + transition) — which is the shape your 105 → 64 ms is about; what it lacks is the run that takes several of them through one pair of waits. The rest of #995 is either not applicable here (VICTORY_GPU_UPLOAD_COPIES: GPU upload heaps ... supported=false under this stack) or too entangled with this line's own state to port from a 31k-line squashed branch.

I can test a split quickly on my side: the cell's frame and the card's time are in every run's log, and m29/m27 give a baseline (270–318 ms and 275–277 ms with and without a translator port today).

If the split is cheap for you, the other piece I would take next is VICTORY_CARD_FETCH_INFLIGHT=2 (the slots-in-card-memory variant) — =1 is measured here: it removes 141 ms of the relay thread's wait and adds ~60 ms on the card, a net loss on this stack, so the =2 geometry is the interesting one.

@slauko

slauko commented Nov 26, 2026

Copy link
Copy Markdown

A follow-up to my split request: the piece I asked for landed through Marvisak#3197's window instead, and it works on this stack — the indirect clamps in the cell fall from 1,757 to 1,796 a frame to 295 to 355 (the mesh draws join a table window; only the compute dispatches are left), with the table filled while recording and one pass per run.

So no split needed on my side for the clamp batch. The other items in this PR that still look interesting here are the CPU ones (VICTORY_HEAP_SYNC_TABLES, the wide fills, the texture checks) — this line's copies are 63–74 ms for ~190 MB a frame, write-bandwidth-bound at ~4 GB/s (VICTORY_COPY_PLAIN=1 changes nothing), and its heap pass is 25–45 ms in the descriptor scan.

@Filip722

Copy link
Copy Markdown
Contributor

I backported the device-local flight-slot readback from 7406afb for a matched Series S replay on Bazzite 44 with GE-Proton11-14, vkd3d-proton 3.2.0 and an RTX 5060 Laptop GPU (8 GB, NVIDIA 615.78.08). Both arms used the same executable, stationary prison view and warmed seed, with relay stage 1 and the clamped gathering path from #1171. To exercise actual device-local copies on this GPU, both used a 1 MiB minimum copy size and a 96 MiB buffer budget.

54-second window Flight slots off Device-local flight slots
Unique completed Presents 271 277
FPS 5.017 5.206
Median / p95 Present interval 190 / 246 ms 186 / 221 ms
Median time fetching card pieces 32.3 ms 4.8 ms
Median copy-back phase 117.2 ms 66.6 ms
Minimum free VRAM 1,563 MiB 1,456 MiB

Mode 2 typically read back 295 pieces (~18.4 MiB) per frame, with no old-path landings or slot overflows reported in the measured window. The patched replay responded to camera input. The asset-free fixture read the expected bytes from two ranges on the copy queue after a direct-queue fence, and the fetch pipeline test passed on the hardware adapter. This comparison isolates the readback path on that older compatibility build.

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants