Repository navigation
Conversation
The gamma-space UI composite draws one unblended full-target triangle, so clearing the camera output (or the next post-process texture) before it only costs a full-screen memory pass. Begin unscissored composites with `LoadOp::DontCare`; a composite clipped to a camera viewport keeps the output's own load for the pixels outside it. Co-Authored-By: Dylan T. <14214667+dktapps@users.noreply.github.com>
Each of the three ordered-input drains per frame removed and reinserted the interaction runtime resource and ran the block-stop fence system, whose block-use context is large, even with no input edges and no stop pending. The runtime now stays in place while a drain owns it; edge dispatch, the only reader, still removes it first so its systems see no runtime. The fence runs its system only when a stop is pending, the only case where it does anything. Co-Authored-By: Dylan T. <14214667+dktapps@users.noreply.github.com>
A retained JSON-UI screen that replays its last paint still rebuilt the set of texture paths its layout and renderers draw and filtered each through the atlas sources every frame, about half of the gameplay HUD and crosshair cost on a static view. RetainedPaint now keeps the keys it last resolved, keyed on the layout, the renderers' reported paths and the texture-set revision. The keys are still required every frame, so residency, LRU marking and decode polling are unchanged. Co-Authored-By: Dylan T. <14214667+dktapps@users.noreply.github.com>
wgpu rejects LoadOp::DontCare color attachments when WGPU_STRICT_WEBGPU_COMPLIANCE is set, so unscissored composites keep their original load in that mode. Co-Authored-By: Dylan T. <14214667+dktapps@users.noreply.github.com>
The UI render test target includes the composite through path modules and cannot include device_settings, so the check moves to a module both the library and that target include. Co-Authored-By: Dylan T. <14214667+dktapps@users.noreply.github.com>
In a mixed biome record every tinted cube face is meshed one block wide, and its vertex stage evaluated the 27-sample lattice blend in all four vertices of every such face in every frame. That blend was about 70% of gpu_terrain_solid on the reference flat world, whose surface sections sit at the world bottom and so always count as mixed. On devices with vertex-writable storage, the opaque terrain layout now binds a per-quad cache: the provoking vertex reuses the gamma tint stored under the current epoch and otherwise computes and stores it with the unchanged shader code. The epoch advances whenever quad, origin or biome-record contents are written, the recovery path resets the arena, or the buffers feeding the blend change, so a cached value is always the value recomputing would give. Other devices keep the uncached blend, and CINNABAR_TERRAIN_TINT_CACHE=0 opts out for same-binary comparisons. The blend itself also reuses palette colours it already converted within one evaluation, which helps the uncached path, models and liquids. Co-Authored-By: Dylan T. <14214667+dktapps@users.noreply.github.com>
…tate The first-person hand reads its render-controller visibility twice a frame. Each read replayed the rig's whole pre-animation script, although the player's gates read only tick variables and a query. Visibility-only sampling now applies just the engine's swing and spear writes when the held-item-scale and pre-animation scripts cannot write any variable the gates read, so the result is unchanged. The dropped-item publisher also reads device limits once per render device instead of every frame, and an empty terrain-instance list keeps its allocation. Co-Authored-By: Dylan T. <14214667+dktapps@users.noreply.github.com>
The cache is an optimization: allocate it through the plain checked allocator rather than as required terrain storage, so failure never triggers terrain recovery. Entries are bounded by the device's storage binding size, and an allocation failure falls back to the epoch slot alone; quads without an entry take the uncached blend. Co-Authored-By: Dylan T. <14214667+dktapps@users.noreply.github.com>
Skipping setup was exact only when the skipped script would have completed. The fast path now requires loop-free, forward-only setup and gate expressions, and a remaining budget that covers their worst case; otherwise it replays setup, so an exhausted budget still keeps the full sampler's fallback. The dropped-item device budget is now keyed by device identity, so a device replaced while publication was skipped is still noticed. Co-Authored-By: Dylan T. <14214667+dktapps@users.noreply.github.com>
Review found that the provoking corner appears in both triangles of a quad, so two vertex invocations could store the same cache entry without synchronization, and a reader could pair a new epoch with old colour. Vertex programs now only read the cache. A compute pass, recorded after buffer uploads and before every camera, bakes the entries of each allocation uploaded since the last bake with the same shader function the vertex stage uses, or clears them while the kernel is not ready, so a reused quad slot never shows its previous occupant's tint. Replacing the cache or any table the blend reads rebakes every resident allocation. This removes the epochs and the vertex-writable storage requirement. The cache is admitted only where a vertex storage slot remains beside the terrain units' binding, a failed allocation binds a zeroed one-entry fallback instead of suppressing terrain, and arena telemetry counts the cache. Tests now compare the memoised blend's bits with the per-sample conversion, including swamp grass, instead of asserting source text. Co-Authored-By: Dylan T. <14214667+dktapps@users.noreply.github.com>
Runs block use before physics and attacks and item use after it, so an idle drain at any of the three sites that reinserts the runtime fails. Co-Authored-By: Dylan T. <14214667+dktapps@users.noreply.github.com>
The key memo no longer holds a weak reference that kept a layout's allocation alive outside the dependency cache's budget. It keys on layout and carrier addresses plus the texture revision, and forgetting the retained paint clears it, so it only survives beside a paint that holds the same layout. A miss resolves from the renderer paths already reported, so each callback reports once per frame. A new test stalls a decode until the screen replays and checks that the replay finishes loading it. Co-Authored-By: Dylan T. <14214667+dktapps@users.noreply.github.com>
… optional Review of the compute bake found that admission checked vertex storage slots only, so a device without compute shaders or with smaller compute limits could still create the bake pipeline; that cache entries were capped by the binding size but not the buffer size; that the job buffer and the fallback binding could fail outside an error scope; and that idle frames rebuilt a map of the whole arena. The kernel's constants, layouts, admission, job planning, dispatch and clears now live in one plain-wgpu module shared with the GPU tests. Admission requires compute shaders and every limit the 64-lane kernel needs, entries fit both the buffer and binding limits, and each dispatch axis stays within the per-dimension workgroup limit, clearing any jobs a dispatch cannot reach. Without a cache the opaque group binds the fallback biome record at the head of the biome buffer as one entry that is never valid, so no cache allocation can fail arena construction, and a failed job buffer clears the pending entries instead. Idle frames return before planning, and pending allocations are looked up in the arena's own map. The raster test bakes through the production layouts and dispatch, and covers clearing a reused slot. Co-Authored-By: Dylan T. <14214667+dktapps@users.noreply.github.com>
…ed storage Review found that a batch with no cube quads still allocated a zero-size job buffer; that the cache survived terrain recovery, so a populated cache could keep starving the next required arena buffer; that wasm cannot observe the cache's allocation failures; that work beyond one dispatch restarted from the same prefix every frame while the pending list grew; that admission missed the binding number and workgroup Y/Z limits; and that idle frames still ran the bake system. Pending bakes are now a map from allocation to quads already baked. Each frame drops departed, empty and uncached allocations in place, bakes what one dispatch reaches, records partial progress, and clears the rest, so work always drains; a batch left empty returns before any allocation or encoding. Terrain recovery releases the cache and the bind groups that reference it before retrying, and it is recreated only when quad capacity or the tint tables change. The cache is off on wasm, admission covers the opaque binding number and every workgroup axis, a run condition skips the bake system on idle frames, and bind group preparation reuses the identities it already collected. Co-Authored-By: Dylan T. <14214667+dktapps@users.noreply.github.com>
Review found that every bake created two bind groups after its checked job buffer; on Vulkan a failed descriptor allocation there is device loss, so the optional cache could stop rendering under memory pressure. Each cache now owns a persistent job buffer, created with the cache through the checked allocator and doubled when a bake owes more jobs than it holds, within what one dispatch reaches and one binding holds. The bake's bind groups are built in bind group preparation, next to the terrain bind groups, and only when a table they bind or the job buffer is replaced. A bake writes its jobs into the buffer behind a count header, which the kernel reads instead of the buffer length so stale jobs past it are never baked, and records the dispatch; it creates no buffers or bind groups. A job buffer that cannot grow keeps its size and the bake spreads over more frames. Co-Authored-By: Dylan T. <14214667+dktapps@users.noreply.github.com>
The device poll used an empty `queue.submit([])` every frame only to obtain a submission index for the frames-in-flight bound. On RADV that is a full driver submission. The pinned Bevy fork now keeps the graph submission's index in `PendingCommandBuffers`, and the poll bounds the frame with it instead. Co-Authored-By: Dylan T. <14214667+dktapps@users.noreply.github.com>
Co-Authored-By: Dylan T. <14214667+dktapps@users.noreply.github.com>
Review found that the bake's job write could fail allocating its staging buffer outside an error scope, leaving the previous batch's jobs to be dispatched and the new batch's progress credited, and that job-buffer growth created an output bind group on frames where the terrain bind groups were otherwise reused. The job write now goes through the checked allocator; on failure the batch's entries are cleared and no progress is credited, so the next frame retries. Job-buffer growth and every bake bind group are created only on frames that rebuild the terrain bind groups; on other frames owed growth waits and the backlog drains through the existing progress tracking. Co-Authored-By: Dylan T. <14214667+dktapps@users.noreply.github.com>
Review found that both bake bind groups were created outside an out-of-memory scope, and Vulkan reports a failed descriptor allocation synchronously through the device error sink, which panics when uncaptured. Each bake bind group is now created through the checked allocator. If the device refuses the source group, or the output group of a new cache, the cache is released: the opaque group binds the never-valid alias in the same rebuild and the vertex stage computes every tint, as after a required-storage failure. If it refuses the output group for a grown job buffer, the grown buffer is dropped, the current buffer and group stay paired, and the growth stays owed. Co-Authored-By: Dylan T. <14214667+dktapps@users.noreply.github.com>
Every frame, all thirty pipeline owners re-ran their memoized warm-up and rebuilt the variant list, about 6 µs of render-thread time in an idle world. The registry now keeps the collected variants while the views and the requested sample count stay the same and every registered owner existed when it collected them; the owner set runs only otherwise. Readiness is still checked against the pipeline cache every frame. Co-Authored-By: Dylan T. <14214667+dktapps@users.noreply.github.com>
The tint cache creates its optional bake bind groups inside an out-of-memory scope and falls back to the uncached blend when the device refuses them. On Vulkan the pinned wgpu lost the device on such a failure before the scope could observe it. The new wgpu revision routes bind group and bind group layout out-of-memory through the nonfatal handler buffer and texture creation already use, so the fallback recovers. Bind group creation elsewhere that scopes out-of-memory becomes recoverable too. Co-Authored-By: Dylan T. <14214667+dktapps@users.noreply.github.com>
The previous repin let the lockfile resolver move gpu-allocator to a different windows crate than wgpu-hal, breaking the DX12 build. Restore the earlier lockfile and change only the wgpu source revisions, now at the fork commit that also releases partial bind group work on failure. Co-Authored-By: Dylan T. <14214667+dktapps@users.noreply.github.com>
Co-Authored-By: Dylan T. <14214667+dktapps@users.noreply.github.com>
A frame whose graph submits nothing still submits an empty batch, which sends the writes it staged with the queue and gives the frame an index for the in-flight bound. The Metal queue probe's marker goes through the pending command buffers, so work submitted after the graph is inside that bound. Co-Authored-By: Dylan T. <14214667+dktapps@users.noreply.github.com>
Co-Authored-By: Dylan T. <14214667+dktapps@users.noreply.github.com>
The registry records each owner's resource, and view collection, now an exclusive system, keeps the settled variants only while all of them still exist, so a removed owner's variants leave readiness. A new test fails if settled frames run the owner set again. Co-Authored-By: Dylan T. <14214667+dktapps@users.noreply.github.com>
The probe's pending-frame count shadowed its PendingCommandBuffers parameter, so the macOS build failed to compile the late submission. Co-Authored-By: Dylan T. <14214667+dktapps@users.noreply.github.com>
A memoized gate result is now reused only when the gates' worst-case op count fits the remaining actor and frame budget, so budget exhaustion decides the fallback exactly as without reuse. Tests cover that expression-cache shape and a tick variable changing while gate queries stay fixed. Co-Authored-By: Dylan T. <14214667+dktapps@users.noreply.github.com>
… performance/optimize-gpu-frame
Merging the PRs together grew four files past the architecture limits. Marked chunk instances move to chunk/gpu/upload/marked_instances.rs, the hand pose upload to hand_rig_render/gpu/pose.rs, the overlay's unit tests to ui_render/overlay_tests.rs, and the UI model validation tests to tests/ui_render/model_validation.rs. upload_pose regains the doc comment and #[must_use] that an earlier change left on upload_skin. A launcher-core test's SystemState type gets an alias for clippy's type_complexity lint. Co-Authored-By: Dylan T. <14214667+dktapps@users.noreply.github.com>
|
Important Review skippedToo many files! This PR contains 513 files, which is 363 over the limit of 150. To get a review, reduce the PR to 150 files or fewer by splitting it into smaller PRs or changing its base branch. Upgrade to a paid plan to raise the limit. Usage-priced reviews support at most 500 files.
|
Co-Authored-By: Dylan T. <14214667+dktapps@users.noreply.github.com>
Co-Authored-By: Dylan T. <14214667+dktapps@users.noreply.github.com>
Co-Authored-By: Dylan T. <14214667+dktapps@users.noreply.github.com>
Co-Authored-By: Dylan T. <14214667+dktapps@users.noreply.github.com>
Co-Authored-By: Dylan T. <14214667+dktapps@users.noreply.github.com>
Co-Authored-By: Dylan T. <14214667+dktapps@users.noreply.github.com>
Co-Authored-By: Dylan T. <14214667+dktapps@users.noreply.github.com>
Co-Authored-By: Dylan T. <14214667+dktapps@users.noreply.github.com>
Co-Authored-By: Dylan T. <14214667+dktapps@users.noreply.github.com>
Co-Authored-By: Dylan T. <14214667+dktapps@users.noreply.github.com>
Co-Authored-By: Dylan T. <14214667+dktapps@users.noreply.github.com>
Co-Authored-By: Dylan T. <14214667+dktapps@users.noreply.github.com>
Co-Authored-By: Dylan T. <14214667+dktapps@users.noreply.github.com>
Co-Authored-By: Dylan T. <14214667+dktapps@users.noreply.github.com>
Co-Authored-By: Dylan T. <14214667+dktapps@users.noreply.github.com>
request_readback now takes a FrameWork; the Metal-only tests still passed the queue, so the macOS test build failed. Use the immediate FrameWork the portable tests use, which runs submit work inline as before. Co-Authored-By: Dylan T. <14214667+dktapps@users.noreply.github.com>
RawInputReaders and IdleScreenReaders each add one set condition that skips their readers on frames without input or screen activity, replacing per-frame work in nine systems. Co-Authored-By: Dylan T. <14214667+dktapps@users.noreply.github.com>
Mali drivers reject bools inside structs; store the memo's validity flags as 0u or 1u. Co-Authored-By: Dylan T. <14214667+dktapps@users.noreply.github.com>
The standalone shader check read terrain_tint_bake.wesl raw, without the workgroup size the production constructor substitutes. Co-Authored-By: Dylan T. <14214667+dktapps@users.noreply.github.com>
The debug and test cross-checks for the reused local equipment input and animation view formatted both values into strings every frame, adding 22 allocations to steady actor frames. Compare their Debug output through a hasher instead, formatting only when the check fails. Co-Authored-By: Dylan T. <14214667+dktapps@users.noreply.github.com>
A world tap presses Use a few frames after its finger lifts, once the pick catches up with its ray, so the press can land on a frame without raw input. RawInputReaders then skipped drive_world_inventory_keys on the only frame that carried the press, and the held book never opened. Run the reader every frame again, and note in RawInputReaders that readers of routed or deferred input stay out. Co-Authored-By: Dylan T. <14214667+dktapps@users.noreply.github.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Combines the frame-time work of the OptiFine parity push into one branch: 56 Cinnabar PRs, the Bevy fork changes (cinnabar-mc/bevy#29) and the wgpu fork changes (cinnabar-mc/wgpu#29), plus fixes for the valid CodeRabbit and review findings on those PRs.
Result
Flat world at 960x540, spawn view, release build. Paired runs alternated with dev on one CCD, under a shared bench lock, in rounds with less than one foreign core busy. Medians from 7 to 8 clean rounds:
The paired gain over dev in the same rounds was +2,029 fps, IQR +1,973 to +2,050. Java 1.7.10 with OptiFine measured 5,327 fps on the same world.
Included PRs
Merged in this order with merge commits:
Fork PRs, through the pins: cinnabar-mc/bevy#7, #8, #9, #10, #11, #12, #13, #14, #15, #16, #17, #19, #20, #21, #22, #23, #24, #26 and #27 (cinnabar-mc/bevy#29), and cinnabar-mc/wgpu#26 and #28 (cinnabar-mc/wgpu#29).
Not included: #3175 and #3176, which duplicate #3143 and #3145; the closed #3142 and #3144; and cinnabar-mc/bevy#28, which was not measured on this base.
Conflict resolutions worth a look
SceneTargetfield incrates/render/src/scene_target.rs; both are kept.pub use input::{…}list incrates/client-presentation/src/presentation/equipment.rsis merged with the earlier stack's, keeping both names.prepare_ui_runtimeinapp/src/ui_runtime/presentation/publish.rs. The merge keeps both change-detection guards: the loading-stage snapshot onpresentationand the startup-probe snapshot ondiagnostics_input. In the dropped-item publisher, Mark extracted scenes changed only when what they publish changes #3203'sDroppedItemRepublishguard wraps the scene. Republish a settled empty item frame when its glint raster changes #3170's culling view is still built after the settled-empty check, and the idle-publication calls take&scene.307e3bd74and wgpu ateb610b39d, the heads of Combine the frame-time performance changes for Cinnabar bevy#29 and Combine the framebuffer cache and bind group memory recovery wgpu#29, both now merged intocinnabar-v0.20andcinnabar-v30.Cargo.lockis dev's lock with only those sources changed: Poll the render device in the frame tail after handing the render app back #3184's regenerated lock had movedgpu-allocatortowindows 0.54, which fails the DX12 binding check.Checks
cargo clippy --locked --workspace --all-targets -- -D warnings: clean.8ab4e8332).rendercrate'sui_rendertest target segfaults on RADV when run in parallel. It does the same on dev8ae394f50, and passes all 270 tests single-threaded.Review fixes
Each behavior fix comes with a regression test that fails without the fix.
SubmitInFrameTailrequires. Submitting from the worker keeps its copies ordered with its own staged writes, which handing the command buffers to the render thread would not.HandRigScene::frameis private, with a read accessor, so every change goes through a method that advances the token. This one is enforced by the compiler rather than a test.CodeRabbit sweep
All 53 CodeRabbit findings on the included PRs were checked against this branch: 35 inline comments, plus 18 outside-diff, minor and nitpick items in review bodies.
cinnabar-v30, which it is since Combine the framebuffer cache and bind group memory recovery wgpu#29 merged.Each behavior fix comes with a regression test.
Co-Authored-By: Dylan T. 14214667+dktapps@users.noreply.github.com