Repository navigation
Integrate fxceless round 2: first-room rendering + frame-rate chain (6→8.9fps upstream) - #55
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>
fxceless/main (0b0074e) as the new base: first-room rendering, frame rate chain measured at 6.0 -> 8.9 fps, submit thread, copy queue, levels on demand, warm-up. This commit adds the fork's infrastructure (Linux/Proton chain, extended CI, docs) and the purely additive files (mesh emulation modules, bcpack streaming, tests). Overlap files are merged in follow-ups. Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Overlap files merged as fxceless structure plus this fork's extras: the input chain (gameinput.rs auto-merged whole), the shader cache keyed on mesh mode (their fingerprint build key, strict improvement), translate_with(mesh) carrying their first-half-pairs retry, the host mesh-support detection enum and default_buffer. Dropped as superseded by their rework: the lightweight texture recheck (theirs is full), the depth-bounds stream port (theirs is complete), barrier coalescing (their copy engine rework obsoletes the audit it needs), the Wine write-watch cache and frame percentiles (to be re-applied as their own PRs). Mesh emulation pipeline creation and dispatch are the follow-up commit; mesh_emu.rs compiles against the new host but is not wired yet. Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
…d_clamp_as 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)".
|
…rchitecture emulated_mesh_pipeline + push_stage_params ported onto the fxceless round-2 pipeline/host.rs (their stream/depth-bounds/library machinery unchanged); HostPipeline gains mesh_emu; the creation hook emulates when the host has no native mesh tier. shader_cache: mesh byte in the converter input is stripped with the build fingerprint (input[33..]). Dispatch wiring in draw.rs is the remaining piece. Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Re-applies the mesh-emulation dispatch path onto the round-2 base: bind_parts split (title vs host compute state) with a thin bind wrapper, the emulated compute/graphics bind and restore helpers, the chunked direct dispatch, and the ExecuteIndirect mesh path with its slot-map preparation. Target state handling shared through ensure_targets. Also fixes newer-clippy lints: PLACED_TWINS getter gated to diagnostics, BUILD_LEN used in the cache key strip, is_multiple_of, sort key. Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Conflicts resolved to the round-2 tree: it supersedes main's point fixes (indirect mesh budget #53 content identical, adapter preference #54 and constant tables #52 unioned in). Wine write-watch cache (#47), frame percentiles (#45) and barrier coalescing (#43) are dropped by the base swap as before and return as their own small re-port PRs. Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
… the 512 KiB cap) 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>
|
Coordenação da outra frente: a PR #56 (mip-drop/VRAM da RX 580) está em revisão/CI e mexe em As falhas atuais de CI parecem pontuais: lint de linhas vazias após atributo/doc em |
There was a problem hiding this comment.
Devin Review found 8 findings. All 8 findings are left for you to triage below.
| } | ||
| ensure_state(list, dst, COPY_DEST); | ||
| ensure_state(list, src, COPY_SOURCE); | ||
| list.flush_barriers(); |
There was a problem hiding this comment.
🔴 Texture commands run before transitions
When a list reuses a texture in another state, copy_resource and mesh emulation record work before flushing its transition. ensure_state only queues barriers. The GPU receives copies or draws with textures still in the wrong state.
Devin left this for you to triage: Barrier ordering inside fxceless's copy engine is upstream design; if real it affects upstream too and needs hardware validation before any blind reorder.
Learn more
A texture's first use in a list gets its initial transition in the submission prelude. For later uses, ensure_state queues a transition until flush_barriers records it. The PR removes that flush before the full texture copy and before the compute and graphics steps of dispatch_mesh_emulated. The new tiled zero-fill path has the same ordering gap. A flush at close is too late for commands already recorded.
Example: A title samples a texture and later copies into it on the same list. The copy runs while the destination is still in shader-resource state.
Recommended fix: Flush before each affected copy, dispatch, or draw consumes the queued states. Add D3D12 debug-layer coverage that uses a texture in two different states on the same list.
Was this helpful? React with 👍 or 👎 to provide feedback.
| let path = cache | ||
| .get_or_convert(&converter, &input) | ||
| .map_err(|e| format!("{e:#}"))?; |
There was a problem hiding this comment.
🔴 Failed cache writes drop shaders
When the shader cache cannot save a successful translation, cached returns the disk error instead of the shader. Shader::translated remembers the failure and drops affected draws for the rest of the run.
Devin left this for you to triage: Real logic issue in upstream cache code (disk-write failure should not drop a translated shader); small but belongs in a focused follow-up rather than this 30k-line integration.
Learn more
Cache::get_or_convert calls the translator before it creates, writes, and renames the output file. If any of those filesystem operations fail, the translated shader still exists at that point, but the cache API returns only the filesystem error. The PR no longer preserves the translated value, so Shader::translated records a permanent failure for that shader in the current run.
Example: The cache opens at launch, but its drive fills during a new shader's first use. That shader translates correctly, then all draws using it are dropped because the cache write fails.
Recommended fix: Preserve the converter's successful in-memory result and return it if publication fails. Restore the removed regression test for a cache entry that cannot be written.
Was this helpful? React with 👍 or 👎 to provide feedback.
| for &(index, handle) in &due { | ||
| self.mirror(index, handle, false); | ||
| } |
There was a problem hiding this comment.
🔴 Descriptor sync can crash during unmapping
If streaming unmaps a descriptor page after the snapshot, mirror_copied_page still passes its live address to mirror. That second read can fault and crash the title. The single-slot path also rereads live memory.
Devin left this for you to triage: Descriptor-sync unmap race is upstream fxceless design adopted wholesale in this integration; fix belongs upstream or in a focused follow-up PR, out of scope here.
Learn more
sync_heaps takes a private copy of changed descriptor bytes so the title can unmap a page without faulting the reader. The page helper compares fingerprints against that copy but keeps only the slot and title address for the final update. mirror then dereferences the address directly.
Example: Submission snapshots slot 23. The streaming thread unmaps the page while other slots from the snapshot are being processed. Mirroring slot 23 reads the unmapped address and faults instead of using the snapshot.
Recommended fix: Decode the record words from the snapshot and pass them into the shared mirroring logic. Keep the title handle only for bookkeeping, not for a second dereference in either raw-sync path.
Was this helpful? React with 👍 or 👎 to provide feedback.
| // Never 0, which is "never looked at". | ||
| let print = record_print(record) | 1; | ||
| // The record last seen, or a slot never looked at that | ||
| // holds nothing: as it was. | ||
| if *last == print || (*last == 0 && record.iter().all(|&b| b == 0)) { | ||
| continue; |
There was a problem hiding this comment.
🔍 Raw descriptor copies retain stale views
When a raw copy restores an earlier descriptor, mirror_copied_page skips it after an intervening API write. API mirroring leaves the earlier fingerprint intact, so shaders keep using the intervening view.
Devin left this for you to triage: Stale-view retention is upstream fxceless design adopted wholesale in this integration; fix belongs upstream or in a focused follow-up PR, out of scope here.
Was this helpful? React with 👍 or 👎 to provide feedback.
| if behind() && !all { | ||
| // The line is open while this part is | ||
| // prepared and sent: only this thread takes | ||
| // from its head (one releaser at a time). | ||
| held.insert(0, Held::Running); | ||
| drop(held); | ||
| host.execute_late(lists, order); | ||
| held = lock(line); |
There was a problem hiding this comment.
🔍 Released queues lose pending submissions
With async submit enabled, Release can free a queue before release_held_now sends its pending work. A worker already sending that work can try to relock the freed queue.
Devin left this for you to triage: Async queue release race is upstream fxceless design adopted wholesale in this integration; fix belongs upstream or in a focused follow-up PR, out of scope here.
Was this helpful? React with 👍 or 👎 to provide feedback.
| // The state the lists recorded so far leave the texture in: what our | ||
| // copy finds it in when it runs behind them (looked at, not changed). | ||
| const COPY_SOURCE: u32 = 0x800; | ||
| let state = crate::resource::host_transition(resource, COPY_SOURCE).map_or(COPY_SOURCE, |(_, before)| before); | ||
| crate::resource::host_transition(resource, state); | ||
| let texture = texture.clone(); | ||
| let sent = hold(this, || { | ||
| PRESENTS_HELD.fetch_add(1, Ordering::Relaxed); | ||
| Held::Present(texture, state, frame) |
There was a problem hiding this comment.
🔍 Deferred presents use stale texture states
With async present enabled, send_behind saves the texture state before queued render lists update it in prelude. The present copy then uses the old state in its GPU barrier.
Devin left this for you to triage: Deferred-present texture-state timing is upstream fxceless design adopted wholesale in this integration; fix belongs upstream or in a focused follow-up PR, out of scope here.
Was this helpful? React with 👍 or 👎 to provide feedback.
| let translate = |c: &[u8]| { | ||
| ran.store(true, Ordering::Relaxed); | ||
| victory_shader::emit::translate(c).map_err(|e| e.to_string()) | ||
| }; | ||
| cached(cache, &build(), MeshMode::Native, container, translate).map(|_| ran.load(Ordering::Relaxed)) |
There was a problem hiding this comment.
🔍 Warm-up misses emulated mesh shaders
When a run uses mesh emulation, warm still writes native entries. Runtime translation uses a separate emulation key, so mesh shaders still translate on first use.
Devin left this for you to triage: True: warm-up writes only native-mesh cache entries while emulation keys differ, so emulated mesh shaders translate on first use. Not a correctness bug; recommend small follow-up warming with the host's active mesh mode.
Was this helpful? React with 👍 or 👎 to provide feedback.
| for root in &paths { | ||
| for entry in walkdir::WalkDir::new(root).into_iter().filter_map(Result::ok) { | ||
| if !entry.file_type().is_file() || entry.metadata().map_or(0, |m| m.len()) > MAX_FILE { | ||
| continue; | ||
| } | ||
| let Ok(data) = std::fs::read(entry.path()) else { | ||
| continue; | ||
| }; | ||
| let jobs = sources(&data); |
There was a problem hiding this comment.
🔍 Warm-up scans past its deadline
Once VICTORY_WARM_SECONDS expires, warm stops translating but still opens and scans every remaining eligible asset.
Devin left this for you to triage: Scanning remaining assets past the warm deadline wastes startup time but is harmless; small follow-up, out of scope here.
Was this helpful? React with 👍 or 👎 to provide feedback.
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>
|
Empurrei |
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Summary
fxceless advanced 8 commits past our integration point. This adopts their new tree as base (same method as the first integration):
c96b4f2depth bounds + faster defaults,310c6ebpacked texture upload queue,8dd30abcross-view page writes + warm-up,a26859fthe first room renders right,9376fd6descriptor-sync fingerprint,f85101bsubmit thread + copy queue,a253706measured 6.0 -> 8.9 fps,0b0074ein-place copies + fast cores.Merged on top: the input chain, their fingerprint shader-cache keying with the mesh mode in the key,
translate_with(mesh)carrying their first-half-pairs retry, host mesh-support enum +default_buffer, and the full mesh-emulation dispatch re-wiring:bindsplit intobind_parts(title vs host compute state) with the emulated compute/graphics binds, chunked direct dispatch, and the ExecuteIndirect mesh path with slot-map preparation (the #53 budget work carried over, identical content).The merge with main unions #52 (constant tables after instructions) and #54 (largest-memory adapter); #53's indirect mesh budget content was already identical on both sides.
Dropped as superseded: lightweight texture recheck (#14), depth-bounds port (#15), barrier coalescing (#43, needs re-audit against the new copy engine). Wine write-watch cache (#47) and frame percentiles (#45) return as their own small re-port PRs after this lands.
Regression note
None expected for mesh emulation: the dispatch path is wired in this PR. Wine/Proton write-watch caching and the frame-percentile log lines regress until their re-port PRs land.
Test plan
cc mesh-emulation stream: #41/#44/#48/#53 re-wired onto the new pipeline/host.rs + draw.rs here.
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
👀 8 findings for you to triage · Follow Devin's work