Skip to content

Networked scene sync#214

Merged
jeffamstutz merged 11 commits intonext_releasefrom
network_parameter_updates
Feb 4, 2026
Merged

Networked scene sync#214
jeffamstutz merged 11 commits intonext_releasefrom
network_parameter_updates

Conversation

@jeffamstutz
Copy link
Collaborator

No description provided.

Copilot AI review requested due to automatic review settings February 4, 2026 15:36
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds infrastructure for synchronizing scene state over the network by introducing new network messages for object/layer/parameter/array updates and extending serialization to support proxy arrays and parameter enable state.

Changes:

  • Added a set of StructuredMessage types to transfer scene deltas (new/remove object, parameter change/remove, layer updates, array data transfer).
  • Extended DataTree serialization utilities (now public APIs) to support proxy-array serialization and parameter enabled state.
  • Updated network demo client/server to use the new message types and unified ping handling.

Reviewed changes

Copilot reviewed 32 out of 32 changed files in this pull request and generated 10 comments.

Show a summary per file
File Description
tsd/src/tsd/ui/imgui/Application.cpp Updates app-state save to call new save_Scene(..., forceProxyArrays) signature.
tsd/src/tsd/network/messages/TransferScene.hpp / .cpp Adds includeArrayData flag; forces proxy arrays by default for scene transfer.
tsd/src/tsd/network/messages/TransferLayer.hpp / .cpp New message to send layer contents and apply them remotely.
tsd/src/tsd/network/messages/TransferArrayData.hpp / .cpp New message to send array payloads and apply them remotely.
tsd/src/tsd/network/messages/NewObject.hpp / .cpp New message to send object creation (and currently array serialization too).
tsd/src/tsd/network/messages/ParameterChange.hpp / .cpp New message to send parameter updates.
tsd/src/tsd/network/messages/ParameterRemove.hpp / .cpp New message to remove parameters.
tsd/src/tsd/network/messages/RemoveObject.hpp / .cpp New message to remove objects.
tsd/src/tsd/network/NetworkChannel.hpp / .cpp Adds send(type) overload for empty-payload messages.
tsd/src/tsd/network/CMakeLists.txt Adds new message sources to the build.
tsd/src/tsd/io/serialization/serialization_datatree.cpp Makes serialization helpers public; adds proxy array support and parameter enabled serialization.
tsd/src/tsd/io/serialization.hpp Exposes the new/expanded serialization API surface and updates save_Scene signature.
tsd/src/tsd/core/scene/objects/Array.hpp / .cpp Adds convenience helpers (isCUDA/isProxy/...) and reorders accessors.
tsd/src/tsd/core/scene/Scene.hpp / .cpp Adds createObject(type, subtype), createArrayProxy(), getLayerName(); updates save_Scene friend signature.
tsd/src/tsd/core/Forest.hpp Adds Forest::clear() used by layer deserialization.
tsd/apps/interactive/demos/network/server/RenderServer.hpp / .cpp Registers handlers for new scene-delta messages; adds guarded set_Mode().
tsd/apps/interactive/demos/network/client/tsdTestClient.cpp Switches to unified PING message type.
tsd/apps/interactive/demos/network/client/tsdRemoteViewer.cpp Uses heap-owned NetworkUpdateDelegate and disables it during full scene transfer.
tsd/apps/interactive/demos/network/client/NetworkUpdateDelegate.hpp / .cpp Implements update signals by emitting the new network messages.
tsd/apps/interactive/demos/network/RenderSession.hpp Extends message enum with new delta message types and unified PING.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +162 to +164
auto msg = tsd::network::messages::TransferLayer(
m_scene, const_cast<tsd::core::Layer *>(l));
m_channel->send(MessageType::SERVER_UPDATE_LAYER, std::move(msg));
Copy link

Copilot AI Feb 4, 2026

Choose a reason for hiding this comment

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

signalLayerUpdated() repeats the const_cast workaround when constructing TransferLayer. It would be cleaner/safer to make the message/serialization API accept const Layer&/const Layer* so this cast isn't needed.

Suggested change
auto msg = tsd::network::messages::TransferLayer(
m_scene, const_cast<tsd::core::Layer *>(l));
m_channel->send(MessageType::SERVER_UPDATE_LAYER, std::move(msg));
// Reuse the layer transfer logic from signalLayerAdded to avoid
// duplicating the const_cast workaround.
signalLayerAdded(l);

Copilot uses AI. Check for mistakes.
Comment on lines +148 to +150
auto msg = tsd::network::messages::TransferLayer(
m_scene, const_cast<tsd::core::Layer *>(l));
m_channel->send(MessageType::SERVER_UPDATE_LAYER, std::move(msg));
Copy link

Copilot AI Feb 4, 2026

Choose a reason for hiding this comment

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

signalLayerAdded() uses const_cast to pass a const Layer* into TransferLayer. This makes it easy to accidentally mutate layer state from a const context and hides API intent. Prefer updating TransferLayer/tsd::io::layerToNode() to accept const Layer& (and/or a const Layer*) so the call site stays const-correct.

Copilot uses AI. Check for mistakes.
@jeffamstutz jeffamstutz merged commit 9e7b334 into next_release Feb 4, 2026
5 checks passed
@jeffamstutz jeffamstutz deleted the network_parameter_updates branch February 4, 2026 16:30
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.

1 participant