Repository navigation
Conversation
Use fixed-size comparisons to skip equal bytes and retain byte-level bounds for the merge. Cover unaligned ranges, partial chunks and both directions against the byte-wise search.
|
I tested 413bab7 on Windows with an RTX 5070 (driver 610.88) and Ryzen 7 7800X3D. I ran the same 3D checkpoint once per build, with the same release settings, starting cache files and scripted inputs, and capture disabled. The only source change between the two builds was this PR. All 20 native shadow unit tests passed, including both byte-search tests. In the shared 145–158 seconds after launch, both runs had 12 window-title samples at 4,800–5,100 draws/frame. Median reported frame time was 231.8 ms before and 223.4 ms after. The two host copy-back reports per arm averaged 35.2 ms for 70.05 MB before and 33.5 ms for 66.9 MB after, about 0.50 ms/MB in both. Streaming varied between the runs and the host frame-time reports moved in the opposite direction. This pair does not establish an end-to-end speedup or a regression. The changed byte-search functions represent only part of the copy-back timer. AI-assisted hardware test. No game data attached. |
`State::execute_indirect` refreshes the argument buffer from title memory and dispatches the argument clamp (`indirect::bound`) before it asks whether the call can run. When the pipeline has not been built yet - `prepare` returning false, which fxceless#400 measures at 1 400-1 750 indirect calls a frame, fxceless#255 at 1 294, fxceless#748 at 64 plus 282 refused compute pipelines - the call is dropped after paying a copy and a GPU dispatch with its barrier, for records nothing reads. Ask `host_pipeline` first. It is the same lookup `prepare` does a few lines later, and `None` means the call cannot run, so it is dropped before the refresh and the clamp. A call that can run is unchanged: same refresh, same clamp, same execution. That is the order the file already uses for skipped pipelines ("Skip before the argument clamp can mutate the indirect buffer"), extended to the much more common not-built-yet case. Dropping earlier is safe: the clamp is per call, and a later call that runs clamps its own range first. Not measured in the title - I cannot run it - but the work removed is one refresh and one dispatch per dropped call, and the diagnostics already separate "no host pipeline" from "prepare failed", so the next frame line shows the clamp dispatches behind those drops stop. cargo test --workspace --locked; both clippy configurations with -D warnings; cargo xtask policy.
…; stores never wait for a library save; VICTORY_BVH_BUILDER=2 Hand port of PalmVIDev fxceless#255 and fxceless#249. Groundwork for turning the ray-tracing structure builder on by default; with no switch set nothing changes (the builder stays off). fxceless#255, two stalls seen in a world run with the builder on (RTX 4090: one frame frozen for 5 minutes): - The builder made its 53 pipelines on the title's recording thread, at its first dispatch, under the builder lock (seconds of driver compile each). Now make::poll asks the workers for each one (requested line, ahead of early and background work) and does not wait; the builder does not run, none of its stages, until none is still being made, so all-or-none still holds. - Pipeline workers waited in their library store behind a save, which holds the library alone while it serialises it (over 3 minutes for a 7 GB library). A store that finds a save in progress is now deferred (at most 4096) and done after the save or at the next store; the save log counts them (deferred_stores). fxceless#249: VICTORY_BVH_BUILDER=2 runs the builder while some of its programs have no host pipeline and turns it off at the first dispatched stage without one. The title creates every program of the builder library, also ones its scenes never dispatch, and a few of those do not translate, which keeps =1 off for good. Tests: the_builder_waits_for_pipelines_being_made, a_store_during_a_save_does_not_wait. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017V7WBCi8h4eymnRhdth77t
Summary
Copy-back locates the first and last changed byte of each differing piece before replaying GPU writes into title memory. The RTX 5080 report in #107 measured 44–47 ms per frame for the broader copy-back stage in one cutscene.
Use fixed 32-byte equality in both searches and inspect individual bytes only in the unequal chunk or the partial tail. On Windows x64, Rust 1.98.1 emits two SSE comparisons per complete chunk. The synchronous, relay and card-local paths all use these helpers. The byte offsets passed to the merge stay the same.
Related work: #71 changes the GPU compare and readback queue. #240 reduces scratch allocation and still uses both searches. I verified that this patch merges cleanly with #240.
Measurement
Windows x64, GitHub-hosted AMD EPYC 7763, Rust 1.98.1, optimized standalone A/B of the original and patched helpers. Median of three runs, each reporting the median of nine samples over 128 synthetic pieces per iteration.
A 64 KiB piece differing at both ends took 0.6 ns longer. The 64-byte input with a middle change took 3.3 ns longer. The benchmark times the CPU search only. An independent RTX 5070 checkpoint A/B passed the shadow tests and reported similar copy-back time per MB with variation in streaming. The gameplay benefit remains unverified. Independent test report Windows run · Benchmark source
The bytewise regression checks cover unaligned input, equal spans, partial chunks, unequal lengths and changes on either side of chunk boundaries. Both Clippy configurations and
cargo test --workspace --lockedpassed on the Windows x64 runner with 497 passed, 7 ignored and 0 failed. The asset policy also passed. Windows test jobAI-assisted with Codex. All benchmark and test inputs are synthetic.