Repository navigation
Integrate fxceless round 3: frame composition + copy-back through our own view (9.6 fps first rooms) - #65
Conversation
…rites counted; levels on demand (off); warm-up; card memory numbers Memory sync: - The guard over every view of a physical page (code by myokex, victory-amd c6dc4d8, after pull request #115 by Spexivus, its correction by joroyt and a part of VIctory #1122 by tightfall): the title shows one page at several addresses and a copy was guarded at one only. 0.8 to 1.0 million writes through another view in a five-minute run on the test machine. VICTORY_VIEW_GUARD=0 turns it off. - Kernel reads into title memory are read beside and copied in (Joshua Odom, 10ea38e). - Writes of the storage layer into physical pages are counted where the title has the pages mapped and can open the guards there (VICTORY_PAGE_WRITES, off: counted only). Failed page-destination reads are retried. Card memory: - Levels on demand, off unless VICTORY_LEVELS_ON_DEMAND=1: a texture the title fills takes card memory for the levels the title holds; held levels get memory only while the card has room and are asked for again. Its test runs on the software adapter; not run on a card yet. - Refused texture slots are held back so a pass reaches the slots behind them; room can be kept for card copies of title buffers (off). Tools: translate --warm all; the shader cache is keyed on the translator's source; counters for copy-back races, page writes and the copies the texture sweep never lets go; a walls trace. Game runs of these changes on an RTX 4070: five five-minute runs without a device loss or a failed request. This merged tree was built; its test suites were run on the tree the changes come from (gpu 129, hle 97). Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…ored, views off their copy's elements get their own bytes, card room for the first world frame, levels on demand run on the card - Descriptor records the title copies into its heap as bytes are mirrored before each submission (pull request #305 by Flyander, after upstream VIctory 86a5ed6), with a per-slot fingerprint so only records that changed are mirrored, the page read through the kernel, a switch (VICTORY_HEAP_SYNC=0) and a counter: about 40,000 records a frame on the test machine. - A buffer view off its copy's elements gets a copy of its own bytes (after upstream 86a5ed6; VICTORY_VIEW_OWN_COPY=0: refused as before). - Room on the card for the world's first-frame bursts: buffer copies (VICTORY_CARD_ROOM_FOR_BUFFERS, now on) and render targets (VICTORY_CARD_ROOM_FOR_TARGETS_MB, 3,072); a copy turned down gives its room up and is logged; the texture pass asks again every 32 MiB. 98 buffer copies made (945 MB) where earlier runs made 1; 25 MB compared on the processor a frame where it was 550 to 710. - Levels on demand: the fixes of pull request #747 by AscilCH. First run on a card (RTX 4070, VICTORY_LEVELS_ON_DEMAND=1): no device loss, 3.1 GB not allocated for levels the title does not hold. Still off by default. - The guarded blocks under storage writes into physical pages are opened by default (VICTORY_PAGE_WRITES=0: counted only). - Shaders: a program is translated with first-half interpolation pairs only if it was refused for one (with it on for every program 8,551 working pixel programs came out changed); parked lane-mask pairs, f64 conversions and sums, lane permutations: 14 more programs translate. - Counted, not fixed: an indirect compute pass asks for about 77,500 groups in x and is cut to 65,535. One five-minute game run of these changes on the test machine: no device loss, no failed request. This merged tree was built; its test suites were not run. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…c, draw-table slots left to their draws, no failing write-watch calls; card fetches inside their flights (off by default) - Descriptor sync: a multiply-and-fold fingerprint of a record in place of BLAKE3 (35 to 42 ms a frame over 250,000 to 300,000 records), and slots that draws read through tables lately are left to their draws (VICTORY_HEAP_SYNC_TABLES=1 mirrors them too): the pass over the heap went from 70-220 ms a frame to about 3. - Write watch: no kernel asking for memory the guards already hold as view memory (pull request #670 by Jonirulah). - Card copies' flagged pieces can come down inside their own flights (pull request #648 by Jonirulah; VICTORY_CARD_FETCH_INFLIGHT=1, off by default). One game run with it on: no device loss, the copy-back thread's fetch wait 181 -> 0 ms a frame, the card busier; no frame-time gain claimed. - Logging: the heap pass's texture part and buffer slots; indirect compute dispatches over 65,535 groups. - README: what was measured, and that pull request #220 with VICTORY_INDIRECT_WINDOW=1 lost the device twice here and is not in. One five-minute game run of this tree's source on an RTX 4070: no device loss; the frame is still 250 to 380 ms (the card is the limit). This merged tree was built; its test suites were not run. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…queue for fetches, indirect draw windows made safer, a profiler; all behind switches - VICTORY_ASYNC_SUBMIT=1: submissions are prepared and sent by a thread of the layer, in order, instead of by the title's render thread; the queue's line stays open while its head is prepared. - VICTORY_QUEUE2=1: fetches of what shaders wrote to copies in the card's memory go to a copy queue, with the fix for a piece fetched beside a later flight (fetched again when that flight lands). - Pull request #220 (cheaper indirect draws) is in, its windows off by default; a draw record of 2^23 vertices an instance or more runs empty (its window checker found one list drawing 90 such records). - Fills of upload memory and read-only title buffer copies no longer wait for flights; each is checked against what the flights then wrote, and the first mismatch turns the waiting back on (VICTORY_FILL_WAIT=1). - Up to 512 idle host lists and the texture staging buffers are reused. - VICTORY_MERGE_GAP / VICTORY_MERGE_RUNS (off / 512 by default; the gap form is not exact, see its comment). - VICTORY_PROFILE=1 (diagnostics builds): a sampling profiler inside the layer. - README: what was measured, the history of the device losses with windows, and what is still open (frame rate dips; cause not known). Measured on an RTX 4070 in the first room: about 3.5-4 frames a second before, 6-7 with all the switches, defaults about 4.5-5. Five runs with windows on since the fix, no device loss. This merged tree was built; its whole test suite was not run (the tests around flights, queues, indirect draws and the copy queue were, on the development tree). Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…atch, a forbidden self-copy removed; draw windows measured at 6.0 -> 8.9 frames a second - VICTORY_FRAME_LOG (on in diagnostics builds): every frame's length, and what the usual frame and each long frame were made of; VICTORY_CARD_METER adds the card's time by kind of list. - VICTORY_CAPTURE_WORLD_EVERY: a saved frame costs 235 ms inside the present, which was the regular dip of test runs (every 8th frame). - A driver watch (VICTORY_DRIVER_WATCH=0: off): entries of a display driver in the system's event log are logged as they are recorded; the first one turns draw windows off for the rest of the run. Every device loss here was announced that way 2.7 to 55 seconds ahead. - A copy between two title textures that share one host texture is left out (the host does not allow a texture copied onto itself): 402 in a five-minute run. - The list of shader-visible heaps is a reader-writer lock; the heap sync takes a changed page's records under one lock; guarded view memory is left out of the write-watch askings ahead (after triippywhale cc368c7c, d0581a55). - Behind switches, off by default: VICTORY_COPY_PLAIN, VICTORY_REFRESH_ONCE (after upstream 6d021fe), VICTORY_VIEW_KNOWN, VICTORY_BACK_OWN_VIEW, VICTORY_ASYNC_PRESENT, VICTORY_BVH_HOLD (refused: the picture loses its indirect light), VICTORY_CARD_REHASH_RUNS=alt. - The process opts out of the system's efficiency mode. - README: what the instruments measured and what is still open. Measured on an RTX 4070 in the first room: 6.0 frames a second on average with windows off, 8.9 with VICTORY_INDIRECT_WINDOW=1 (one run each, the second with the driver watch; no driver entry, no device loss). This merged tree was built; the unit tests of the changed parts were run on the development tree, the whole suite was not. One test of the indirect budget on the software adapter is flaky (it was before these changes). Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…d a corrected comparison of draw windows - VICTORY_COPY_PLAIN=1 also serves reads of title memory into buffers of the layer; reads under 256 bytes stay with the kernel and a source that faulted is left alone for two seconds (the first form took the layer's one-byte askings too: 1,000 to 1,300 faults a frame). - The submit and copy-back threads ask for the fast cores of a hybrid processor (VICTORY_FAST_CORES=0: not). - VICTORY_DISK_CORES=slow (off): the DirectStorage workers ask for the slow cores. - README: the 6.0 against 8.9 frames a second given for draw windows compared runs in different scenes and is withdrawn; frame time against draws per frame is given instead. A first play session past the first rooms lost the device in the open world with the card out of room for new textures; cause not known. Measured on an RTX 4070 (one run each): at 4,500 draws a frame 145 ms with windows off, 124 ms with windows on and copies in place; 7-8 frames a second in the first rooms, 10-12 in lighter views. No driver entry, no device loss in that run. This merged tree was built; the unit tests of the changed parts were run on the development tree. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
… our own view (9.6 fps in the first rooms) - Meters: how the title paces itself on its fences (fence.rs pace, console_insn.rs mwaitx waits and exceptions by kind), the card's time by list and by pipeline (cardmeter.rs), indirect commands by what became of their clamp, switches that alternate inside one run. - VICTORY_JOIN_PARTS=1: parts that follow one another in the queues' lines go to the host as one submission (29 -> 9 a frame), about 6 %. - VICTORY_BACK_OWN_VIEW=1 measured and proved (VICTORY_BACK_OWN_CHECK=1): about 9 %. - The 15-byte clzero loop is taken whole; a section handle's number coming round again forgets our view of the earlier section. - Measured at nothing, left off: REFRESH_ONCE, ASYNC_PRESENT, VIEW_KNOWN, SPREAD, QUEUE2=3, WINDOW_JUMP. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…and copy-back through our own view (9.6 fps in the first rooms) Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
…eatures build) Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
There was a problem hiding this comment.
Devin Review found 3 findings. All 3 findings are left for you to triage below.
There was a problem hiding this comment.
🔴 Joined waits expose stale buffer data
With joining enabled, release_held_now lets a buffer copy pass a wait on a write that has not run. Host submission preparation runs the copy before publishing that write, so the destination retains the old bytes.
Devin left this for you to triage: Upstream fxceless design adopted wholesale (round 3); joining is opt-in behind VICTORY_JOIN_PARTS (off by default). If it ships as-is, the experimental joining mode can expose stale copy destinations; recommend upstreaming or a dedicated follow-up since a correct fix reaches into their submission-ordering design.
(Refers to this code)
Learn more
Console command lists can publish a value after their GPU work and wait on that value in a later part. write32 and write64 defer the store, while copy_buffer_region records a CPU copy to run during submission preparation. For a joined batch, Host::submit runs those copies before sending any of the lists to the GPU. The deferred store is published only when the flight lands, as in relay landing. Turning off deferred write completion via late_writes forces separate parts to land before the next part is prepared, but execute_late applies that rule only after the entire joined batch has been prepared.
Example: A list writes 1 into a buffer word that initially holds 0, waits for that word to equal 1, then copies the word to a second buffer. With asynchronous submission and VICTORY_LATE_WAIT_WRITES=0, separate parts copy 1; joining them copies 0 and publishes 1 only to the source.
Recommended fix: Keep the wait as a batch boundary when its producer has not published the value and the consumer prepares CPU work that depends on it. Submit the producer and settle its writes before preparing the consumer. Add a regression test that exercises a deferred copy after a recorded memory wait.
Was this helpful? React with 👍 or 👎 to provide feedback.
There was a problem hiding this comment.
🔴 Joined submissions rewind fence values
release_held_now moves a queued signal past later lists in the same batch. If a later list writes the same fence, send_joined publishes the older signal last and overwrites the newer value.
Devin left this for you to triage: Same root area: upstream fxceless joining design (opt-in, off by default). Same-fence ordering within a joined batch can publish the older signal last; recommend follow-up against upstream rather than diverging our tree from theirs.
(Refers to this code)
Learn more
A title can signal a fence from a queue using signal or write its value from a command list using the address exposed by gpu_address and a bottom-of-pipe write. Without joining, the queue inserts the signal between the two flights. With joining, send_joined sends all lists first, then appends the signals. execute_late enqueues the list writes as part of that first operation. Relay landing applies those effects in insertion order, so the signal can overwrite a write from a list recorded after it.
Example: In one asynchronous queue, submit a list, signal fence F to 1, then submit another list that writes 2 to F and leaves it there. If both submissions join, F ends at 1 instead of 2, leaving a later wait for 2 blocked.
Recommended fix: Treat a queued signal as a batch boundary. Submit the accumulated lists, enqueue the signal behind them, then start a new batch for later work. Test the order of a queue signal and a later list write to the fence, not only the resulting list order.
Was this helpful? React with 👍 or 👎 to provide feedback.
| // A record that would be clamped alone, on a buffer whose | ||
| // step is remembered: the window the next record would | ||
| // open, opened here ([`jump_windows`]). | ||
| let (step, records) = match (windowed && records == 1 && jump_windows()) | ||
| .then(|| { | ||
| jump_window( | ||
| self.walk_step, | ||
| (args.id(), kind, stride), | ||
| args.left(arguments), | ||
| ) | ||
| }) | ||
| .flatten() | ||
| { | ||
| Some(jumped) => { | ||
| self.window_jumped = true; |
There was a problem hiding this comment.
🟡 Unused indirect records crowd out draws
With window jumping enabled, jump_window expands a lone draw into speculative records at a step the title may not follow. The clamp charges valid records immediately, so unused records can exhaust the budget and suppress later draws.
Devin left this for you to triage: Upstream fxceless jump-windows feature (opt-in). Speculative records can consume the indirect budget and suppress later draws when the guess is wrong; correct fix belongs to their window sizing/clamp design, not this integration PR.
Learn more
Indirect draws read argument records that the clamp validates before execution. bound_ahead validates a whole window and charges the command list's shared budget for every nonempty valid record in it. A jump can open a window at a remembered step that the title does not follow. Forgetting that step on the next miss does not reverse charges for records that went unused. Once the budget is exhausted, the clamp emits zero work for later draws.
Example: A title walks a set of mesh records, then jumps to an isolated draw whose next 15 slots still contain valid mesh records from earlier work. The jump charges all 16 slots even if the next draw jumps away again. Repeated jumps like this can zero out a later draw that would fit if only the executed records were charged.
Recommended fix: Charge speculative records only when a draw consumes them, or clamp a lone record by itself until the new walk is established. Test a jump over nonzero, in-range records followed by a draw that only fits if unused records are not charged.
Was this helpful? React with 👍 or 👎 to provide feedback.
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
… round 3 Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Summary
Integrates fxceless
3973179— "What a frame is made of, measured; parts joined and copy-back through our own view (9.6 fps in the first rooms)". Upstream's measured frame rate in the first rooms goes 8.9 -> 9.6 fps; round 2 was merged in #55.What the commit brings (~1.8k lines over 16 files):
console_insn.rs/console_insn_decode.rs— more of the console's instruction surface decodes, feeding translation coverage.Merge notes
0b0074eas base. Files untouched by round 3 keep our side wholesale (descriptor/host.rs, list.rs, resource.rs, shader_cache.rs, texture.rs, emit/lower.rs, emit/mod.rs — preserving the wine write-watch allocation cache watch: under Wine, ask about whole allocations, cached (re-port #47) #59, the cache-write fallback + warm-up mesh mode fixes gpu: review follow-ups: cache-write fallback, warm-up mesh mode + deadline #61, and the lower/tests.rs split). Files we never touched since round 2 take theirs wholesale (cardmeter, framelog, inplace).draw.rs: the indirect window logic — theirs restructures step/records computation aroundjump_windows; since this is their active development area and our side there is verbatim round-2, theirs was taken.translate.rsduplicatedwarmafter auto-merge: deduplicated keeping the copy with our deadline-first check (gpu: review follow-ups: cache-write fallback, warm-up mesh mode + deadline #61).is_multiple_ofin queue.rs, doc-comment spacing in translate.rs.Validation
cargo check/clippy -D warnings/fmtclean locally (x86_64-pc-windows-msvc).depth_bounds_pipeline_loads_and_filters_draws, the known environmental failure on a VM without an SM 6.6 GPU — it passes on thecheckrunner, as before.Deferred
90228a7turned out to already be in our main — nothing left of the wave-10 deferrals.Link to Devin session: https://app.devin.ai/sessions/39a24dfe2c184165b42b2108a96286b6
Open in Devin Desktop: https://app.devin.ai/desktop/session/39a24dfe2c184165b42b2108a96286b6?variant=devin
Requested by: @Personed
👀 3 findings for you to triage · Follow Devin's work