Repository navigation
Conversation
Seventeen extracted resources were marked changed on every idle frame without their published content changing, so extraction cloned each into the render world again every frame. Each writer now compares before marking: plain values use set_if_neq, and the structured scenes (viewmodel, panorama, dropped items, screen overlays, primitive shapes, entity shadows, mod render scene, drawing frame) compare what the renderer reads from them. Co-Authored-By: Dylan T. <14214667+dktapps@users.noreply.github.com>
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the
|
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.
Saving: 0.9 µs per frame for this PR and #3201 together (paired frame time, median of 32 pairs, IQR 0.7–1.7 µs), measured on the
integration/optifine-parityhead baa9e60 on the idle flat world at 960x540. Main thread CPU 181.4 → 180.4 µs per frame, render thread 180.2 → 179.2 µs, about +27 fps at 5,480 fps.Stacked on #3201, which does the same for
ChunkTextureAssets.Every resource below is extracted to the render world with
ExtractResourcePlugin, which clones it into the render world whenever it counts as changed. An extract-dirtiness measurement on the idle flat world found each one marked changed on 99–100% of frames, while nothing it publishes changed. That happens because its writer took the resource mutably every frame, throughDerefMutor an unconditional assignment. Each writer now marks the resource only when what the renderer reads from it differs.Plain values use
set_if_neq:CloudVisibility,CloudDistanceChunks,SkyboxSettings,AtmosphereViewInputs,WorldLighting(atmosphere publisher)UiGlintSettings,ChunkUploadBudget,ChunkArenaCapacityHintStructured scenes compare what they publish:
VisibilityDiagnosticsInput: loading writes only the startup-probe flag, so the caller marks the input when that flag flips.ModRenderScene: the no-runtime packet path reports whether its overlay buffers or personal output changed.DrawingFrame: rebuilt into a reused scratch frame and swapped in only when it differs.EntityShadowScene: marked when the caster list's revision moves.ViewmodelScene: marked when the published token or bound fallback changes.PanoramaScene: compares faces allocation and revision, view and visibility. The shared upload marker is the renderer's acknowledgement, so it is excluded.DroppedItemScene: lists compare by allocation. The glint scroll is compared only while something is drawn.publish_terrain_instancesno longer allocates a new empty list every frame.ScreenOverlayScene: the renderer returns before reading the clock, fire projection and portal transform when no layer is drawn, so those are compared only while one is.PrimitiveShapesScene: the renderer uploads only the clock rounded down to the hour. That rounding is now one scene method used by both sides, and the scene is marked when the hour, dimension, render distance or store handle changes.Render-side readers of these resources read their values every frame rather than reacting to the change flag. None of them mutates its extracted copy.
Not changed, because they do change every frame:
AtmosphereFrame,ActorRenderFrame,Time,FrameCountand the animation clocks.Tests. System-level tests run a writer for several frames and assert that its resource counts as changed only on insertion or a real change; they fail without this change. The scene-level tests check that each comparison keeps an unchanged publication equal and still catches a real change.
environment::time_override::tests::unchanged_inputs_leave_extracted_outputs_unchangedmodding::anchors::tests::unchanged_availability_leaves_the_drawing_frame_unchangedui_runtime::presentation::forms::panorama::tests::steady_in_world_frames_leave_the_scene_unchangedcamera::overlay_publish::tests::steady_frames_without_layers_leave_the_scene_unchangedpublication::pressure_tests::the_budget_counts_as_changed_only_when_its_value_changesScene-level:
How to see it: nothing visible changes.
Co-Authored-By: Dylan T. 14214667+dktapps@users.noreply.github.com