Adaptive Storage Framework: skip main-thread graphic resolve under MP#593
Merged
notfood merged 1 commit intorwmt:masterfrom Apr 25, 2026
Merged
Conversation
Mirrors bbradson/Adaptive-Storage-Framework#30. StorageRenderer.SetPrintDataDirty takes a main-thread fast path that calls itemGraphic.Worker.GetGraphicFor, which chains into Graphic_Random.get_MatSingle and consumes Verse.Rand. SaveAndReload runs on the main thread; a fresh process's load runs off-thread via LongEventHandler.QueueLongEvent doAsynchronously. Host and client therefore consume different amounts of Rand from the seeded Map.FinalizeLoading scope, which desyncs the next downstream consumer (RoomTempTracker.equalizeCells.Shuffle and FreezeManager). Transpile SetPrintDataDirty so the UnityData.IsInMainThread check becomes IsInMainThread && !MP.enabled, forcing the deferred path symmetrically on host and client when an MP session is active. Acts as a stopgap until the upstream PR ships in a release.
Member
|
Looks fine |
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.
Summary
Mirrors bbradson/Adaptive-Storage-Framework#30 as a compat-side stopgap, since AS Framework releases infrequently.
StorageRenderer.SetPrintDataDirtytakes a main-thread fast path that callsitemGraphic.Worker.GetGraphicFor, which chains intoGraphic_Random.get_MatSingleand consumesVerse.Rand.SaveAndReloadruns on the main thread; a fresh process's load runs off-thread viaLongEventHandler.QueueLongEvent doAsynchronously. Host and client therefore consume different amounts ofRandfrom the seededMap.FinalizeLoadingscope, which desyncs the next downstream consumer (RoomTempTracker.equalizeCells.Shuffle, thenFreezeManager.DoIceMelting).Transpile
SetPrintDataDirtyso theUnityData.IsInMainThreadcheck becomesIsInMainThread && !MP.enabled, forcing the deferred path symmetrically on host and client when an MP session is active. Solo behavior unchanged.Test plan
FreezeManager.DoIceMelting)IsInMainThread && !MP.enabledstays true, original fast path runs, no rendering regression