Skip to content

fix: update_variables no longer rebuilds the frontend and add sim example notebook - #237

Open
LKasianAnsys wants to merge 14 commits into
feat/5.2d-batch-visibility-and-selectionfrom
fix/no-rebuild-on-update-variables-1
Open

LKasianAnsys wants to merge 14 commits into
feat/5.2d-batch-visibility-and-selectionfrom
fix/no-rebuild-on-update-variables-1

Conversation

@LKasianAnsys

@LKasianAnsys LKasianAnsys commented Nov 19, 2026 •

Copy link
Copy Markdown
Collaborator

Issue

Resolves #236

Summary

The update_variables API replaces variable data on an already-loaded VTK dataset in a VISOR scene. However, despite only updating the data, it currently goes down the same update path as start and add_dataset, which create or change the scene topology and rebuilds the whole frontend. As a result, the panels visibly reset to their defaults and back on every update, in both CLIENT and SERVER mode.

This PR treats a variable update as a data-only change. It also adds an example notebook that drives a live simulation through the update_variables path.

Changes

  • Backend: update_variables now signals a data change instead of a scene change. In CLIENT mode the render is pushed as data only, so the wasm frontend updates in place. In SERVER mode a new data_version state key is bumped alongside the existing scene_version, and the client fetches the updated variable records through a new get_variable_records_json trigger instead of rebuilding.
  • Colour map ranges: When data updates, each variable keeps the range currently shown, whether the user edited it or not, so the colour map doesn't jump every frame. The default ranges are still recalculated from the new data, so a user can reset to them. Adding, removing or clearing datasets works as before.
  • Frontend update ordering: FrontendRebuilder is replaced by FrontendUpdateQueue. It runs rebuilds and data refreshes one at a time, and if a rebuild is already waiting, a data refresh is folded into it. Server updates that arrive during a rebuild are now queued instead of dropped.

Example

  • examples/notebooks/warp_fluid_update_variables.ipynb runs a Warp fluid simulation example and streams each step to VISOR through update_variables. It allows for a test of the fix: the panels should stay put while the data animates on the fixed geometry.

Illustration

1. Screen capture before this PR (flickering update_variables data streaming)

click to hide
Screen.Recording.2026-11-23.072641.mp4

2. Screen capture after this PR

click to hide
Recording.2026-11-19.145522.mp4

Note

This PR is added to the top of stack #233. It is not related to the rest of that stack (which builds ParaView mode), but as it touches some common code that is likely to result in merge conflicts, it is branched here rather than off main.

@LKasianAnsys LKasianAnsys self-assigned this Nov 19, 2026
@LKasianAnsys
LKasianAnsys changed the base branch from main to feat/5.2d-batch-visibility-and-selection November 19, 2026 20:05
@LKasianAnsys
LKasianAnsys force-pushed the fix/no-rebuild-on-update-variables-1 branch from 4f91c39 to 4817f87 Compare November 19, 2026 20:15
@github-actions github-actions Bot added test Work associated with testing fixed bug Something isn't working labels Nov 19, 2026
@LKasianAnsys
LKasianAnsys added this pull request to stack #233 November 19, 2026 20:23
@LKasianAnsys
LKasianAnsys marked this pull request as ready for review November 19, 2026 20:23
@LKasianAnsys LKasianAnsys changed the title fix: update_variables no longer rebuilds the frontend fix: update_variables no longer rebuilds the frontend and add sim example notebook Nov 20, 2026
@ansBAkula
ansBAkula force-pushed the fix/no-rebuild-on-update-variables-1 branch from c20ed80 to c916e5d Compare November 23, 2026 04:47
@LKasianAnsys
LKasianAnsys force-pushed the fix/no-rebuild-on-update-variables-1 branch 2 times, most recently from 50962b9 to 58be561 Compare November 23, 2026 14:02
@LKasianAnsys
LKasianAnsys force-pushed the fix/no-rebuild-on-update-variables-1 branch from 58be561 to 5e58f85 Compare November 23, 2026 15:51

@ansBAkula ansBAkula left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested with saf-visor-poc and works.

@LKasianAnsys

Copy link
Copy Markdown
Collaborator Author

Thanks for testing and the approval; I'll hold off on merging until the PR for #227 is in (so they land as separate commits into main).

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working fixed test Work associated with testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

modify update_variables API to avoid rebuilding the VISOR frontend

3 participants