Skip to content

feat: allow specific object updates in LocalView - #65

Merged
jourdain merged 1 commit into
masterfrom
passthrough-ids-to-update
Sep 16, 2026
Merged

jourdain merged 1 commit into
masterfrom
passthrough-ids-to-update

Conversation

@jspanchu

Copy link
Copy Markdown
Member

No description provided.

Comment thread src/trame_vtklocal/widgets/vtklocal.py Resolved
@ahinoamp

Copy link
Copy Markdown
Contributor

I would like to use this API for small server-produced changes while keeping transient hover presentation in the browser. Could the tests cover replacing a dependency of the selected object, preserving the client camera and untouched objects, and alternating subset updates with a subsequent full update? A second view sharing the session would also be a useful regression case. Measuring the reduction in serialization work alongside the visible result would make the performance benefit easier to assess.

@jspanchu
jspanchu force-pushed the passthrough-ids-to-update branch from be348b9 to b0c3a02 Compare September 15, 2026 22:30
@jspanchu
jspanchu requested a review from jourdain September 15, 2026 22:32
@jspanchu

Copy link
Copy Markdown
Member Author

I have resolved a merge conflict and rebased to bring this PR up to date. Will add test to cover this kwarg.

Comment thread src/trame_vtklocal/widgets/vtklocal.py Resolved
@jspanchu
jspanchu force-pushed the passthrough-ids-to-update branch 2 times, most recently from 6577410 to aa62806 Compare September 15, 2026 23:56
@jspanchu

jspanchu commented Sep 16, 2026 •

Copy link
Copy Markdown
Member Author
Serialization work per update (view1):
step                         roots  serialize (ms)  states sent  blob bytes
subset: replace mapper           1           0.296           17          84
full: replace mapper             2           4.462           17          84
subset: recolor                  1           0.204            2           0
view2 full                       1           0.660           11       84536

as you can see the time to serialize goes down. ~20x faster, however the stuff sent over network is the same for both strategies due to mtime diffing on the client.

@jspanchu
jspanchu force-pushed the passthrough-ids-to-update branch from aa62806 to 3722b5f Compare September 16, 2026 00:35
@jspanchu
jspanchu force-pushed the passthrough-ids-to-update branch from 3722b5f to 5e98851 Compare September 16, 2026 00:36
@jourdain

Copy link
Copy Markdown
Collaborator

LGTM, but I mostly looked at the main src/trame_vtklocal/widgets/vtklocal.py‎

@jspanchu

Copy link
Copy Markdown
Member Author

@ahinoamp can you verify the test and it's result is what you expect?

@ahinoamp

Copy link
Copy Markdown
Contributor

Yes, this covers the cases I had in mind. I reviewed the test and confirmed that it:

  • replaces the selected actor mapper and its upstream source through a subset update;
  • preserves the client-controlled camera and browser-only hover color;
  • keeps an unrelated server edit out of the subset update, then delivers it with the following full update;
  • exercises another subset update after the full update; and
  • updates a second view in the same session, with pixel comparisons at each stage.

The reported result also matches the mechanism I expected: limiting the roots reduces server-side serialization traversal, while client-side mtime diffing means the changed states and blob bytes sent for the mapper replacement can remain the same. The exact ~20x ratio is run-dependent, but the direction and explanation are right. Linux, macOS, and Windows test jobs are all green. This looks good to me.

@jourdain
jourdain merged commit 263451e into master Sep 16, 2026
6 checks passed
@jourdain
jourdain deleted the passthrough-ids-to-update branch September 16, 2026 15:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants