feat: Remote rendering 3.1e - source per-part state from registry on save and restore it on load - #54
Merged
Conversation
LKasianAnsys
changed the base branch from
main
to
feat/3.1d-client-routes-mutations-to-triggers
August 28, 2026 20:52
LKasianAnsys
force-pushed
the
feat/3.1d-client-routes-mutations-to-triggers
branch
from
August 31, 2026 15:02
746d7fa to
cacfd07
Compare
LKasianAnsys
force-pushed
the
feat/3.1e-registry-sourced-save-and-restore
branch
from
August 31, 2026 15:20
d85694a to
e07a020
Compare
LKasianAnsys
force-pushed
the
feat/3.1d-client-routes-mutations-to-triggers
branch
from
August 31, 2026 15:30
056a5bc to
5d5530c
Compare
This reverts commit 5d5530c.
…per-part-apply-logic
…-lock-and-payload-validation
…at/3.1d-client-routes-mutations-to-triggers
LKasianAnsys
force-pushed
the
feat/3.1e-registry-sourced-save-and-restore
branch
from
August 31, 2026 18:03
21136ba to
a4b5ade
Compare
…t/3.1e-registry-sourced-save-and-restore
LKasianAnsys
marked this pull request as ready for review
August 31, 2026 18:32
margalva
previously approved these changes
Sep 2, 2026
Base automatically changed from
feat/3.1d-client-routes-mutations-to-triggers
to
main
September 3, 2026 14:13
margalva
approved these changes
Sep 3, 2026
LKasianAnsys
force-pushed
the
feat/3.1e-registry-sourced-save-and-restore
branch
from
September 3, 2026 15:09
f45092f to
34d04bc
Compare
margalva
approved these changes
Sep 3, 2026
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.
Issue
Resolves #18
Context
This is the last of 5 PRs for user story 3.1 (#18) of the phased implementation plan (here) for adding remote rendering in VISOR.
Per-part visual state (visibility, opacity, diffuse color, color variable), is currently held client-side on
VisorPartStateand reaches the server only viagetAppStateAsyncwhen thesave_stateAPI is called. This story inverts that, makingVisorDatasetRegistrythe source of truth for per-part state by the end of 3.1.This PR is the last step: sourcing the per-part state from the server-side registry during the
save_stateAPI, and restoring it onload_state.save_state: Currently, theget_statemethod onVisorSceneBasesources the per-part state from the client'sgetAppStateAsyncresponse. This PR instead sources it fromruntime_state_dict, as it now is considered the source of truth on the per-part viewer state.load_state: When a state is loaded, this PR now loads the per-part state into the dataset registry on the server, and applies every part to the server's pipeline, before the scene description is built.load_state, adding three fields it needs:array_name,type,num_components.PersistedViewerStateversion kept at 1.0, Backwards-compatibility with existing persisted state is maintained by parsing the variable ID, which is presently a hash of those values, separated by::.VisorSceneDetailsschema version does not need a bump because the new fields don't affect it.Copilot summary
This pull request implements robust support for per-part state persistence and restoration in VISOR (3.1e), ensuring that all necessary variable identity fields are sourced from the registry during save and correctly restored on load. It introduces logic to derive missing variable identity fields for backward compatibility, updates both backend and frontend models to explicitly carry these fields, and enhances the server's logic for restoring per-part visualization state.
Persistence and restoration of per-part state:
VisorSceneBase) now sources per-part state from the registry during save, ensuring that the most up-to-date runtime state is persisted. On load, it restores all per-part properties (visibility, color, variable mapping, etc.) to the VTK pipeline, with robust error handling and logging for mismatches or missing data. [1] [2]Variable identity field handling and backward compatibility:
PersistedSceneStatemodel now includes logic to derive missing variable identity fields (array_name,type,num_components) from the variable identifier, enabling backward compatibility with older save files. This is done via a validator and a helper function that parses the identifier format. [1] [2]Explicit variable identity fields in models:
VisorVariableStatebackend model and the corresponding frontendVisorSpectrumStatenow explicitly carryarray_name,type, andnum_componentsfields, and ensure they are serialized and deserialized correctly. This eliminates the need for consumers to parse the identifier string to access these properties. [1] [2] [3] [4] [5]Clarifications and comments:
These changes collectively ensure robust, future-proof persistence and restoration of per-part visualization state, with explicit variable identity tracking and strong backward compatibility.