Repository navigation
ariadne: live two-instance conference (clustered host + conference_live.ari) - #705
Merged
Merged
Conversation
…lice
The first room verbs for the conference app, as reusable core free functions (room_join / room_roster / room_leave) wrapped by DSL verbs (room-join / room-roster / room-leave), mirroring stream_intrinsics' document-scoped-handle pattern. Pure replicated state: participants live on the SHARED tree conf.rooms.<room>.participants.<pid>.{profile.name, presence.joined} off app.root(), so every node converges via whatever state_cluster_shard the host installs — no gRPC, no GL, no Runtime.
Trust-all self-insert (roadmap-blessed 'mesh works first; auth hardens later'): a client writes its own participant subtree and the pid is the local cluster node id. Writes use the stream.cpp touch()-before-write idiom so a fresh node's first value is not lost to the lazy distributed-observer attach. Leave is SOFT (presence.joined=0, a replicating value update) because a hard subtree delete is resurrected by any peer that still holds the participant; room_roster returns present-only. Server-mediated writes, admission/pid-allocation, roster authority and presence reaping are Phase 2 (§5d); media wiring (room-publish/-subscribe over the gRPC bridge/relay) is a later slice.
Test room_intrinsics_test (3 cases, no gRPC): local join/roster/leave; two-node join convergence (both see both, names intact); two-node soft-leave convergence (a leave replicates, both drop the leaver). Mirrors state_transport_inproc_test's two-shard + pump_all harness.
ariadne_conference now calls register_room_intrinsics(app) alongside the stream/media registrations, so a conference .ari can call (room-join/roster/leave). No demo uses them yet (a room demo needs two instances + the §5 control plane); this makes the §8 bundle complete.
The conference is a LAYER on top of the general streaming substrate — cvc::ariadne::stream and cvc::gl::ariadne stay task-neutral (streaming serves many uses, not just conferencing), so only the room/authority control plane is conference-specific. Move it into a cvc::ariadne::conference namespace + inc/cvc/ariadne/conference/ + src/cvc/ariadne/conference/, mirroring ariadne/stream/. No behaviour change; streaming is untouched.
General streaming additions (not conference-specific). stream::format()/scope() expose what a stream was opened with — the frame format and the root_path — which a consumer needs to advertise a stream or open a matching proxy for it (the stream already stores both; they just weren't exposed). own_document_stream() hands an already-open stream to a document's owning table (the same one (stream-open) fills), so a module that opens a stream itself — e.g. a pulled proxy — can make it a first-class document stream reachable by document_stream() and the (stream-info/-close/-capture/-play) verbs.
…§4b), audio proven
The conference MEDIA plane, mesh P2P over the merged gRPC stream_bridge. room-publish serve_port()s an open stream on the host's bridge and advertises its descriptor (endpoint + token + id + scope + format) under the publisher's participant subtree; room-subscribe reads a remote participant's descriptor from the REPLICATED room tree, opens a local proxy sized to the format and sharing the token (so the pull routes), and pull_from()s the publisher's endpoint. Reusable free functions (room_publish/room_subscribe) + DSL verbs (room-publish/room-subscribe), in cvc::ariadne::conference; grpc-gated (new src/cvc/ariadne/conference/room_media_intrinsics.{h,cpp}).
Test room_media_test (grpc): an f32 audio stream published on node A crosses to node B's proxy BYTE-IDENTICAL, routed entirely by the replicated descriptor — no manual endpoint wiring. State plane (room tree) on an inproc transport, media plane on a real gRPC transport on loopback, the split a two-process conference uses. Deferred: SFU-via-relay (server-selected serve/pull through stream_relay), per-proxy retirement (room-unpublish/leave teardown — the §7 gap), and the live two-instance host demo (needs host clustering plumbing).
…erive publisher pid DSL ergonomics for the live demo: room-publish/room-subscribe now accept a bare room-id string (not only a room-join handle dict), so a .ari can pass (state-get "conf.room") without persisting the handle across program-lane ticks. And room-publish derives the publisher's pid from the default cluster shard (the publisher is always the local node) instead of reading it from the handle, so it works with a plain room-id.
…onference_live.ari) The payoff: two ariadne_conference processes that see and hear each other. New clustering flags (--node-id/--room/--peer-id/--state-listen/--state-peer/--media-listen) turn on a cross-process room cluster — a gRPC state_transport_grpc + state_cluster_shard replicate the room tree (serve + optionally dial a peer, backfill-on-connect), a gRPC stream_transport_grpc + stream_bridge carry media, and register_room_media_intrinsics is wired. The document is scoped by node-id so each participant's self-stream tokens are unique; pump_all() each frame publishes the room-tree writes. conference_live.ari (pure DSL): each node joins, publishes its synthetic camera + a 440 Hz tone, and subscribes to the peer's, shown in a Me/Peer tile pair. Verified end-to-end: two concurrent offscreen processes converge the roster (both see A+B) and each subscribes 2/2 to the peer's camera+audio over the bridge; the Peer tile renders the remote node's live video (screenshot). Grpc-gated; the single-node demo is unchanged without --node-id. Deferred: N-party roster->tiles, SFU relay, --camera in clustered mode, real speaker output (pending the ALSA recipe fix).
transfix
force-pushed
the
feat/ariadne-conference-live
branch
from
October 19, 2026 01:36
647be59 to
d0c3511
Compare
transfix
added a commit
that referenced
this pull request
Oct 19, 2026
Resolve conflicts: the conference files (ariadne_conference.cpp, conference_live.ari,
room_intrinsics.cpp, room_media_intrinsics.{h,cpp}, room_media_test.cpp) take THIS
branch's versions — master only had the squashed #699/#705 baseline of them, and this
branch is the continuation (N-party, SFU relay + ready-gate, MJPG, --name/--mic,
snapshot bootstrap, UX toggles), verified as a strict superset with no master-unique
change (register_room_media_intrinsics has exactly one caller, ariadne_conference.cpp).
src/cvc/CMakeLists.txt keeps master's addition of ariadne/tvision_backend.cpp.
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.
Live two-instance conference 🎥🔊
The payoff: two separate
ariadne_conferenceprocesses that see and hear each other, wired entirely through the room verbs over the merged gRPCstream_bridge.What's here
--node-id/--room/--peer-id/--state-listen/--state-peer/--media-listen): turn on a cross-process room cluster. A gRPCstate_transport_grpc+state_cluster_shardreplicate the room tree (serve + optionally dial a peer; backfill-on-connect converges a late joiner); a gRPCstream_transport_grpc+stream_bridgecarry media;register_room_media_intrinsicsis wired. The document is scoped by node-id so each participant's self-stream tokens are unique, andpump_all()each frame publishes the room-tree writes. Without--node-idthe host is the single-node demo, unchanged.conference_live.ari(pure DSL): each noderoom-joins, opens +room-publishes its own synthetic camera + a 440 Hz tone, androom-subscribes the peer's camera + audio — shown in a Me / Peer tile pair, playing the peer's audio.room-publish/room-subscribeaccept a bare room-id string (so a.arican pass(state-get "conf.room")without persisting a handle across ticks), androom-publishderives the publisher's pid from the cluster shard.Verified
Two concurrent offscreen processes:
The roster converges across the process boundary, each node pulls both of the other's streams, and the Peer tile renders the remote node's live video (screenshot in the PR).
Run it
Deferred
N-party roster→tiles (
repeatover the roster); SFU-via-relay (server-selected, for scale);--camerain clustered mode (real webcam per participant); real speaker output (pending the relocatable-ALSA recipe fix, tasked separately); per-proxy retirement onroom-leave.