Skip to content

[Remote rendering 3.5] Server-authoritative color variable lookup tables聽#23

Description

@margalva

馃摑 Description of the feature

Intent: The lookup table backing each color variable, the color mapping itself rather than a part's reference to it, becomes server-owned. This is the last piece of the state to invert.

Context: Story 3.1 makes each part's reference server-authoritative: which color variable it uses, which component, over what range. the lookup table that reference resolves against still lives client-side on the wasm path, so the server cannot reconstruct what a scene actually looks like, and a user-modiifed color mapping is lost on reload. RuntimeAppState reserves a slot for this; this story fills it.

Also move component selection from the mapper to the lookup table (SelectColorArray(name) plus VectorMode / VectorComponent), which is required for magnitude coloring of vector variables. The serialized reference can stay as it is, since component: -1 already means magnitude, but decide whether to keep that sentinel or mirror VTK's two-field shape.


Known risk: the lookup table sync issue: On the round-trip spike branch, the LUT state failed to reach the renderer correctly: the framework's client-side cache applied a stale snapshot instead of the state the server delivered. It was diagnosed as a framework-level issue, with no viable local workaround, and has not been retested since.

What kept this from being an issue on main is that the client rebuilds its own LUT on every color change, which creates a fresh object (and object ID) every time, and the framework's stale cache is keyed on object ID. This story removes that, so this is the story that creates that condition; it is therefore expected here. See the first comment below for more details on diagnosing the issue.

If we do encounter a similar issue in this user story, it can be deferred until 6.2 [to add link to user story once it's created] - where we retest after bumping the vtk-wasm and trame-vtklocal versions to be current (we are currently a major version behind on both dependencies). Defer by leaving the client owning its own LUT on the wasm path, which is what main does today. The spike branch tried making the server own the LUT state and adding a client-side reapply to compensate; this did not reliably work, so is not a recommended stop-gap.

The remote rendering work that follows in Phase 4 and Phase 5 is not dependent on the present user story.

Acceptance Criteria

  • Color LUT is applied on the server side, so on a refresh or reconnect, the LUT is preserved.
  • No in-visualizer differences from main.

馃挼 Business Value

No response

馃敆 Useful links and references

No response

Activity

  1. added theissue type on Aug 25, 2026
  2. added
    technicalA User Story internal to development that identifies non-functional work such as a refactoring
    on Aug 25, 2026
  3. changed the issue type fromtoon Aug 26, 2026
  4. LKasianAnsys commented on Sep 11, 2026

    @LKasianAnsys
    Collaborator

    Note: The known risk (the lookup table sync issue) mentioned in the user story description has been resolved. On the round-trip spike branch (in the internal repo) the issue was fixed by adding two lines of code, to serialize the state of the LUT and its dependent table object, using:

            self._object_manager.UpdateStatesFromObjects(
                [self._object_manager.GetId(lut)]
            )
    

    and

            _tbl = lut.GetTable()
            self._object_manager.UpdateStatesFromObjects(
                [self._object_manager.GetId(_tbl)]
            )
    

    Note: local_view.update() contains both UpdateStatesFromObjects and a js_call to push the serialized state to the client. Here, we only apply the serialize step at this point, so that when the server state is flushed to the client later, it has the LUT and table serialized correctly.

  5. self-assigned this
    on Sep 28, 2026
  6. LKasianAnsys commented on Sep 28, 2026

    @LKasianAnsys
    Collaborator

    Two main pieces of work here:

    1. Move variable ownership itself to the backend. Currently the client aggregates the data arrays across all parts in the scene, defines the application's 'variables' as unique triplets of dataArray name, type (field association POINT or CELL) and number of components, and assigns the IDs. This will move to the server in this user story.
    2. Making the variable ranges and component application server-authoritative.

    As a first step in this user story, will consolidate the naming between frontend and backend. Currently the server uses the name 'variable' and the frontend uses 'spectrum'. Since the product naming has used 'variable', will update the frontend to use that naming as well.

  7. LKasianAnsys commented on Oct 6, 2026

    @LKasianAnsys
    Collaborator

    Update:

    The cleanup pass to align the variable naming across frontend and backend has been approved and merged #150.

    Server-authoritative variables and their associated states have been implemented and tested in these two PRs, which will be ready for review once :

    • #152 3.5a Move variable ownership to server
    • #153 3.5b Client uses server-owned variables

    One substantive PRs is still pending for this user story:

    • [work done, needs PR] Attach a fixed LUT to each dataset part on the server, and remove its creation from the client

    Two smaller PRs will be added to clean up loose ends around this work:

    • [pre-existing small bug] Fix pre-existing issue switching to a scalar component after coloring by a vector component (rather than magnitude)
    • [simple cleanup] Two cleanups: Remove round trip on save_state (now that all state is server-authoritative); and remove client-side re-application of cached state in App.tsx in onServerUpdateAsync
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

technicalA User Story internal to development that identifies non-functional work such as a refactoring

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions