Repository navigation
Conference: avatar poses as compact per-viewer snapshots at up to 60 Hz - #951
Merged
Merged
Conversation
Poses used to replicate as room-tree leaves: - about 110 bytes for each changed number, roughly 780 bytes per walking avatar per update, sent as 7 separate messages; - at the relay's 20 Hz step; - to every client alike. Each viewer now gets its own stream: - The relay steps the room at 60 Hz. room_pose_relay sends each viewer that is due one PoseSnapshot frame (a new Frame kind on both transports) with the participants it sees. - Positions go in mm, velocities in mm/s, and quaternions as components times 32767. - Each value is the difference from what that connection was last sent (pose_stream.h): a walking avatar costs about a dozen bytes, and a still one a two-byte heartbeat a second. - A viewer's rate follows its round trip from the link reports: 60 Hz under 80 ms, 30 Hz under 160 ms, 20 Hz beyond, with 10% hysteresis. - Middle and outer AOI pairs keep the push cadence. - Every 2 s a viewer's stream restarts with absolute entries, so a client that lost its place (a snapshot written into a dying connection) is back in step. - Snapshots are link-level like media: never journaled, relayed or bridged. A WebSocket peer backed up past 64 KB skips one, and the next carries the difference. - The tree's copy of the poses drops to 1 Hz, for late joiners and the log. Clients (arigl, and the bench) apply snapshots through apply_pose_snapshot before client_pump. The holon's playout learns the shorter interval; its assumed interval before measuring is now 2 ticks. arisrv_aoi_bench gains --poses tree|stream, --client-hz, a per-receiver snapshot byte count and a peer-lag probe. On loopback with clients at 60 fps: - 2 clients: 168 kb/s into each client and 70/87 ms peer lag (p50/p95) become 47 kb/s and 48/62 ms. - 6 clients, gRPC and WebSocket mixed: 400-431 kb/s and 103/130 ms become 92-122 kb/s and 42/60 ms. - The relay's output drops from 2.5 to 0.66 Mb/s, and its room step from 4.9 ms to 0.6 ms (p50).
transfix
added a commit
that referenced
this pull request
Nov 1, 2026
…des and at both client rates The snapshot session's corrected reruns (#951): tree poses stalled 3 of 3 at 60 Hz client frames and 1 of 3 at 30 Hz; snapshots 0 of 3 and 2 of 3. Neither the snapshots nor the 60 Hz client rate cause it, and the media stall drop never fired in any of the 15 runs.
…hannels) (#949) * conference: an unreliable fast lane for pose snapshots (WebRTC data channels) Each client may open WebRTC data channels to the relay beside its reliable connection, unordered and never waited for: a pose lane (maxRetransmits 0) and, with arisrv --lane-media on, a media lane (lifetime 100 ms). Each is its own peer connection on the relay's one UDP port (ICE UDP mux, host candidates, no STUN/TURN), so poses never queue behind video in one SCTP congestion window. The room tree stays on gRPC/WebSocket. The pose lane carries room_pose_relay's PoseSnapshot stream. On the lane the encoder runs acked (pose_stream_encoder::set_acked): nothing commits on write, every snapshot differs from the last one the viewer acknowledged, so a lost one is superseded by the next. The client decodes with 32 kept bases (pose_stream_decoder::set_bases), acks what it decodes, and applies the samples with apply_pose_samples. A keyframe keeps the bases: until its ack, every snapshot is base 0 and any of their acks may become the base. The rate (60/30/20 Hz, fed the lane's RTT), the area of interest and the 2 s keyframe are unchanged; opening or closing a lane restarts the stream on the new path. - cvc::net: fast_lane (datagram envelope, codecs, hub) and fast_lane_rtc (libdatachannel natively, datachannel-wasm in the browser), behind CVC_ENABLE_RTC (default OFF; inert stubs without it). - Signaling: a ttl-0 state_message at <participant>.lane.<pose|media>, never forwarded; the answer goes through the new state_transport::send_message_to, written through the admission hold. - The media lane server is a media_endpoint (AOI gate, rung shaper); the reliable endpoints send a lane viewer no media; lane link reports first. - arisrv --lane-listen/--lane-advertise/--lane-media; arigl CVC_ARIADNE_LANE=1; cyprty ?lane=1; arisrv_aoi_bench --lane rtc with pose-arrival, pose-age, media and correction probes. Measured on catx-03 (netns + netem, 2 clients, 60 Hz snapshots, camera + mic, 3 runs per lossy row): pose arrival p99 21-25 ms on the lane against 71-139 ms over WebSocket and 74-98 ms over gRPC at random loss; pose age p99 51-62 ms against 84-141 ms. Under bursty loss gRPC can stall for seconds whatever carries the poses (it queues every write). Media stays on the connection by default: usrsctp's congestion control was slower than TCP's under loss. Design and tables: docs/roadmap/CONFERENCE_UNRELIABLE_TRANSPORT.md. * docs(fast lane): the gRPC bursty-loss stall is random in both pose modes and at both client rates The snapshot session's corrected reruns (#951): tree poses stalled 3 of 3 at 60 Hz client frames and 1 of 3 at 30 Hz; snapshots 0 of 3 and 2 of 3. Neither the snapshots nor the 60 Hz client rate cause it, and the media stall drop never fired in any of the 15 runs.
On macOS (package-macos release-grpc jobs) the held-out calibration closes the dissipation to 0.152 against a 0.15 bound and its calibrated step's twist is 1% over the uncalibrated one's, and the gradient check's beta and gamma (a quarter of alpha there) flip sign against Jolt's finite differences while the gradient as a whole agrees (ratio 0.92). The calibration's margins are 0.2 and 5%; the per-bias checks apply to components at least a third of the largest (all three on Windows), and the whole-gradient check is unchanged.
…shots-v2 # Conflicts: # src/arisrv/main.cpp # src/cvc/CMakeLists.txt
Both sides kept: arisrv takes the --lane-* and --avatar-* flags, the CMake list gains avatar_panel.cpp beside the pose stream sources, and server_pump keeps #956's policy sync and reserve writes with #951's write_poses switch. The reserve now goes out every step rather than with the tree poses: the relay writes those only once a second when it streams snapshots, and no snapshot carries a reserve. write_reserve already thins it (half a percent of the reserve, or a 5 s heartbeat).
…shots-v2 # Conflicts: # src/cvc/CMakeLists.txt
…shots-v2 # Conflicts: # src/cvc/CMakeLists.txt
This was referenced Nov 2, 2026
Merged
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.
Avatar poses used to replicate as room-tree leaves:
7 separate messages;
This PR gives each viewer its own compact pose stream instead.
What changes
Relay
room_pose_relaysends each viewer that is due onePoseSnapshotframe with the participants itsees. It is a new
Framekind (field 13) on both gRPC and WebSocket.difference.
Encoding (
pose_stream.h)about a dozen bytes; a still one, a two-byte heartbeat once a second.
snapshot written into a dying connection) is back in step.
Rate per viewer
160 ms, 20 Hz beyond, with 10% hysteresis.
Tree poses drop to 1 Hz. They remain for late joiners and the log.
Clients
apply_pose_snapshotbeforeclient_pump.is now 2 ticks.
Measured
arisrv_aoi_benchgains--poses tree|stream,--client-hz, a per-receiver snapshot byte countand a peer-lag probe. On loopback with clients at 60 fps:
Own-avatar reconcile corrections sum about 2x higher with snapshots: more checks, each smaller.
gRPC under bursty loss. netem
delay 20ms loss gemodel 1% 30% 100% 0%on loopback; 2 clientswith camera (5400 B at 15 Hz) and Opus mic, their clients at 60 Hz then 30 Hz; 3 runs each.
p95/p99 in ms; the camera rows show how late video arrives.
gRPC can stall for seconds under bursty loss whichever pose mode is used, and at either client
rate. An earlier batch of the same snapshot runs stalled 2 times in 3, so the spread is wide.
gRPC accepts every write and queues it, so a loss burst leaves seconds of media and poses
queued; nothing stale is dropped. This predates this PR, and snapshots neither cause it nor cure
it. The unreliable pose lane (#949, stacked on this) takes poses off TCP; media
on gRPC still needs a bound on what it queues.
Also in this PR
PoseSnapshot stream unreliably.
docs/roadmap/CONFERENCE_UNRELIABLE_TRANSPORT.md.JoltRollout.GradientAgreesWithJoltFiniteDifferencesandCalibrationClosesTheBooksOnHeldOutRunsfail on macOS arm64. That failure came in withNav: train on the Jolt Humvee through the four-wheel pH model's gradient (P1-P3) #940/Nav: the material trainer and pycvc train on the Jolt Humvee (P4) #941 and turned this PR's
recipe / macos-latest / Debugred.Tests
pose_stream_test(9).PoseSnapshotReachesOnlyNamedPeer.room_relay_integration 16.
main.cppand the core files compile under emcc.