Repository navigation
chore: [Remote rendering 3.6c] Reserialize actor state inside the renderer apply methods - #167
Open
LKasianAnsys wants to merge 4 commits into
Open
LKasianAnsys wants to merge 4 commits into
LKasianAnsys wants to merge 4 commits into
Conversation
LKasianAnsys
changed the base branch from
main
to
chore/3.6b-resolve-state-on-server
October 13, 2026 18:25
LKasianAnsys
changed the base branch from
chore/3.6b-resolve-state-on-server
to
chore/3.6a-clean-up-state
October 14, 2026 03:25
LKasianAnsys
force-pushed
the
chore/3.6c-reserialize-in-renderer
branch
from
October 14, 2026 03:37
23a34c6 to
be6f79c
Compare
LKasianAnsys
marked this pull request as ready for review
October 14, 2026 04:50
LKasianAnsys
requested review from
ansBAkula and
margalva
and
a balanced review from Copilot
October 14, 2026 13:14
LKasianAnsys
force-pushed
the
chore/3.6a-clean-up-state
branch
from
October 14, 2026 20:42
677b6c0 to
236ff55
Compare
LKasianAnsys
force-pushed
the
chore/3.6c-reserialize-in-renderer
branch
2 times, most recently
from
October 15, 2026 15:00
4a618a5 to
3e43f27
Compare
LKasianAnsys
force-pushed
the
chore/3.6a-clean-up-state
branch
from
October 16, 2026 16:59
68760e5 to
e739f38
Compare
LKasianAnsys
force-pushed
the
chore/3.6c-reserialize-in-renderer
branch
from
October 16, 2026 17:04
3e43f27 to
bf0e6dd
Compare
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.
Issue
Addresses #24
Context
Until now, the server reported an object's version from the live VTK object, but served its content from a cache that only a full update refreshed. Five per-part writes (visibility, opacity, diffuse color, selection, global edges) changed the object without refreshing the cache, so the next client fetch (a refresh, or the next update) got a new version with the old content and applied the pre-write value. The color-variable path did not have this problem because it already refreshed the cache inside the renderer; this PR makes every write do the same.
This went unnoticed because on refresh, the client re-applied the server's record over whatever it fetched. PR #166 removes that reapply, which is why this PR needs to land first.
Changes
VisorLocalRendererapply method re-serializes the object it wrote as its last statement, through one helper.serialize_camera_stateandserialize_cross_section_stateare removed fromIRenderer. The interface states the precondition: on return, the state this renderer serves reflects the write, and the client is not notified.Manual check
add_datasetfrom Python; the rebuild should show the part at 30 opacity.Before: panel is at 100, but the part is translucent. The cache still holds 0.3 from the
add_datasetserialiation, and the client only re-applies a value that differs from its default, so 100 is never written over it.After: the panel is 100, and the part is opaque (ie it reflects the 100 opacity as expected)
Copilot summary
This pull request improves the remote rendering system by ensuring that the renderer's internal state is always kept in sync with client-facing state after any mutating operation. It does this by reserializing the relevant VTK object(s) inside each renderer "apply" method, so the state served to the client always reflects the latest changes. The PR also removes now-unnecessary explicit serialization methods and updates documentation to clarify these behaviors.
Renderer State Synchronization Improvements
All mutating methods in
IRenderer(apply_visibility,apply_opacity,apply_diffuse_color,apply_selected,reset_camera,sync_camera,set_projection,set_edges_visible,sync_cross_section_plane) now guarantee that, on return, the state served to the client reflects the write, and the client is not notified. Docstrings have been updated to document this contract. [1] [2] [3] [4] [5] [6] [7]In
VisorLocalRenderer, each mutating method now calls a new_serialize_vtk_object,_serialize_camera_state, or_serialize_cross_section_statehelper as appropriate, immediately after making changes, to update the serialization cache. This ensures the client-facing state is always current. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13]Codebase Simplification
serialize_camera_stateandserialize_cross_section_statemethods from the interface and implementation, as serialization is now handled automatically after every write. [1] [2] [3] [4]Documentation and Maintenance
Internal Refactoring
_serialize_vtk_objecthelper inVisorLocalRendererto centralize and standardize VTK object reserialization logic.