Repository navigation
Conversation
… 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>
|
A data point on " Tree: not this PR. It is the #770 stack (
No device loss and no errors in any of them. So on this tree the missing walls do not follow from 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 AI-assisted (Claude Code); the runs and observations are mine. |
…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.
…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).
…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.
…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).
…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).
…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).
…'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).
…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.
…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
…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
…(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)
…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
… 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
…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
…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
…itle reads copied back by default (boats no longer sink), lazy copy-back and fxceless fxceless#995's heap-sync parts behind switches (off)
…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.
|
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 ( 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 ( 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 If the split is cheap for you, the other piece I would take next is |
|
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 ( |
|
I backported the device-local flight-slot readback from
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). |
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.mdhas the run table, the exact settings, what was tried and rejected (with the reason), and what is still open.The big wins
VICTORY_INDIRECT_BATCH=3clamps a run of calls in one pass (a run ends only at work that can store to a buffer);VICTORY_MESH_AMPLIFY=1clamps mesh records inside an amplification stage.VICTORY_CARD_FETCH_INFLIGHT=2copies 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).VICTORY_GPU_UPLOAD_COPIES=1) and table constants bound to the card copy (VICTORY_TABLE_ON_CARD=1).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
VICTORY_HEAP_RECHECKfingerprinted 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 aBTreeMap::rangepanic fix for textures smaller than the head.VICTORY_REUPLOAD_WHEN_FULLwith async texture workers never ran. It is now done in the pass.AppData(os error 4395). This is why the settings never saved.VICTORY_ARROWS_LOOK=0restores the D-pad); blending is turned off for integer targets, so the wiper-mask pipeline builds.Not proven / needs a look
VICTORY_ASYNC_SUBMIT=1drew the room without walls here.VICTORY_FLIP_LANDEDis the attempted fix and is not measured yet.VICTORY_PICKED_EXACT=1declares the skinning programs' writes through heap-picked UAVs from their job records. It is not measured yet.victory-gpuandvictory-shaderlib tests pass, exceptindirect::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.