Skip to content

release(45.3.0): calls through a capped uplink stay live and come back - #1035

Merged
emooreatx merged 12 commits into
mainfrom
release/45.3.0
Nov 28, 2026
Merged

emooreatx merged 12 commits into
mainfrom
release/45.3.0

Conversation

@emooreatx

Copy link
Copy Markdown
Contributor

45.3.0 (MINOR): calls through a capped uplink send what will arrive in time, keep relays only on the publisher's signed word, and come back after the cap lifts. Plus the second NAT observer, peer_reach, and one address rule on both sides of a direct link. leviculum v0.34.0+ciris.5 by tag; persist and Verify unchanged.

Calls (models R24–R33, branch model/45.3-rules)

  • The uplink backlog reading, the egress budget (control > audio > video > bulk, with a bulk floor), and rows STALE and AGE.

  • Offer-as-life on the publisher's word only. Two signed sources excuse a silent parent:

    • a backlog STAMP: a new capability-gated C3 frame, signed by the stream's chunk key;
    • a verified stale chunk: once by seq, under 6 s late, never delivered.

    Stale chunks alone excuse at most 5 s. A relay's own claim excuses nothing.

  • leviculum ciris.5's scheduler follows the budget at 2× R. FIRST envelopes ride the Channel.

  • CallEvent::KeyframeWanted, at most once a second per stream.

  • Debug logs ciris_edge::alm_decision and ciris_edge::stamp, carrying key ids only.

NAT / reach

  • The second NAT observer, on the bundle facilitator's dial port + 1.
  • Edge::peer_reach, via PyO3 and UniFFI; bindings regenerated.
  • One address predicate on both sides of a direct link, re-read on every standing change. Behaviour change: identified_only now behaves as room_peers.

Ops: the bridge publishes the canonical's dial port + 1/udp, plus canonical-1's firewall allow.

Gates, run locally on this tree

Gate Result
Wide clippy, -D warnings clean
Lib 3068 passed
alm_mesh_stage2 (8 batches) 44 passed, 3 ignored
av_call_805 11 passed
av_call_nat_805 12 passed
direct_links_805 42 passed
link_stall_926 3 passed
log_citations passed
observability_metrics 7 passed
UniFFI drift clean

Known limits are in CHANGELOG.md:

  • a publisher clock that steps back reads late until the room's epoch rolls;
  • the stale-only excuse covers overload up to about 5×;
  • small bulk rows wait behind large transfers;
  • audio has not yet been re-measured with the scheduler.

🤖 Generated with Claude Code

emooreatx and others added 10 commits November 27, 2026 17:48
A netem-like shaper for the harness (NetemUplink): one FIFO for
everything a node sends, cut at HDLC frames, tail drop at 1000 packets,
28 B of IP/UDP per packet, at the server's 300 kbit/s, unscaled. topo_shaped
builds a full mesh with one node's whole uplink behind it.

whole_uplink_cap runs the server matrix's capped-uplink cell in process:
every member publishes framed single-layer video (~190 kbit/s a copy) and
m0 audio as a host packetizes it; m0's identity links carry bulk at the
server's share; per-second tables break m0's egress down by class and
link. Bars (uplink_cap_bars): audio within 800 ms >= 0.95 after a 2 s
settle, audio gap <= 1 s, delivered video within 800 ms >= 0.95, no
teardowns, recovery after the lift.

W6/W4 are #[ignore] (2-minute capped runs; red until the scheduler).
Witness of the pipe itself:
the_netem_pipe_cuts_the_stream_at_hdlc_frames_and_keeps_every_byte.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012q7dLdkP5wzJXrqz2tEsf8
…ver the legs

The stall verdict ages the oldest unproved Channel message from the first
tick it was the oldest, which restarts at every proof: under a standing
queue it reads near zero however deep the queue is. SendClock ages it from
its SEND, from the watch tick's reading of each leg's newest sent sequence
(wrapping 16-bit).

The reading is the least of those ages past each leg's RTT floor, over
every leg with something outstanding, and only with at least two such
legs (the verdict's rule): a leg's age is a round trip, so one slow leg is
that peer's queue, and only a backlog every leg sees is this node's. Once
backlogged the kept leg alone counts. Read alone, the kept leg made every
member of a room whose publisher was capped read the publisher's queue as
its own.

UplinkDrain (row DR) folds the readings into backlog episodes (in at
400 ms, out after a second under 200 ms) and keeps the last reading; while
backlogged the own stream's offer goes to each kept leg every tick so the
backlog stays visible. Gauge alm_uplink_backlog_ms; label
alm_drain_entered; Call::uplink_drain(); a test seam turning the 45.3 queue
rules off (the bench's W_NO_DRAIN baseline).

Witnesses: the_drain_enters_at_400_ms_and_leaves_after_a_second_under_200,
a_send_clock_ages_the_oldest_unproved_message_from_its_send.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012q7dLdkP5wzJXrqz2tEsf8
One sending rate R for everything edge hands the uplink, set from the
backlog reading by delay-based AIMD (over 400 ms x0.7, at most once per
the backlog's depth clamped to 0.5-1 s; under 100 ms +R/32 (floor
8 kbit/s), +R/8 after 5 s clear; lifted after 3 s clear while under 60 %
used). A token bucket at R serves control (never held, counted), then
audio, then video, then bulk.

Own media is admitted per frame, whole (every fragment to every leg) or
not at all; a relay admits per CHUNK: the fragment marker that says where
a frame ends is inside the end-to-end AEAD, so a relay cannot see a
frame's extent. Video resuming after held frames is counted
(av_video_keyframe_wanted: the point a host would be asked for a
keyframe). Gauge alm_media_budget_bps, the rate a host's encoder sizes
itself to; Call::media_budget_bps().

From the CC review:
- FIRST class. An identity-plane send is charged like control and never
  held unless the code that built it knows it is bulk (a task-local send
  class read at Transport::send). Replication messages are classed from
  their row family (replication::egress_class): key, revocation, accord
  (halts and carriage), membership/roster, epoch (key_grant), session,
  consent and moderation rows are FIRST; chat, file, scores and the
  directory planes are BULK; a dimension, kind or envelope edge cannot
  place is FIRST. Content and blob-chunk replies and swarm holding claims
  are BULK.
- The floor. Bulk has a guaranteed share of R (10 %, at least 8 kbit/s)
  paced by its own bucket; its bits come out of R so media yields it;
  waiters are FIFO; nothing is held to be released as a burst. On the
  faithful W6 bench the floor costs audio nothing measurable (0.322-0.354
  within 800 ms with it, 0.313-0.316 without; bulk 27 vs 10 kbit/s).

Witnesses: no_budget_until_the_backlog_reads_over_400_ms,
the_rate_falls_while_backlogged_climbs_when_clear_and_lifts_when_unused,
control_always_then_audio_then_video_then_bulk,
bulk_gets_its_floor_under_full_media_and_never_bursts,
a_removal_rides_first_and_a_chat_row_bulk,
what_edge_cannot_place_rides_first, and on the bench
a_room_removal_leaves_at_once_while_video_is_held (mid-cap, video held: a
removal in 110-450 ms, a chat row 6.7-8.2 s behind queued bulk; 3/3). The
bench host packetizes 60 ms audio while the media budget is under what
20 ms audio costs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012q7dLdkP5wzJXrqz2tEsf8
While the uplink backlog reads over the live-media staleness budget
(MEDIA_STALE_BUDGET, 800 ms) a media chunk handed to the uplink would be
dropped at every receiver, so the sender drops it instead, audio included,
own and relayed alike, and counts it (av_chunk_dropped_stale_at_sender).
Control is never touched. The queue drains even when audio alone does not
fit. Scope: the live push path, profile-0 streams (all edge publishes).

Witness: media_is_dropped_at_the_sender_once_the_backlog_is_past_800_ms.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012q7dLdkP5wzJXrqz2tEsf8
A receiver (and a relay) drops media more than MEDIA_STALE_BUDGET above
its AGE floor: the least wall-minus-source_ts seen for the stream in this
epoch, so clock skew between hosts cancels. Dropped and counted, never
delivered, never relayed on. Judged at the pump per chunk and again per
whole frame at hand-out to the host (a frame waiting on its other
fragments or the reorder window reached the host 837-918 ms above its
floor on the capped bench).

From the CC review: the floor lives one (stream, epoch) and restarts at
each roll, keeping RM1's drift re-anchor; RM2 keeps the stream's own
floor. Scope: the live push path, for presentation, profile-0 streams (a
profile-1 accountable stream is exempt when edge publishes one).

The capped-shed witness is re-barred to what AGE makes true (its 70 %
heard bar held only while relays passed on whatever reached them, however
late): no listener parentless after the settle; no frame handed out more
than 800 ms above its floor; relayed listeners get >= 0.9 of the direct
child's fresh frames (13 runs: worst 0.964); shed to one child; no
teardowns. 10/10 alone, 3/3 under taskset -c 0.

Witnesses: media_is_stale_past_800_ms_above_its_floor_whatever_the_clock_skew,
a_stream_that_starts_late_is_judged_from_its_first_on_time_chunk,
a_publisher_clock_step_for_one_chunk_is_forgotten_at_the_roll,
a_capped_publisher_sheds_to_one_child_and_the_rest_are_relayed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012q7dLdkP5wzJXrqz2tEsf8
…ot dead

A relay offers a stream only while it forwards it (its upstream healthy),
and under AGE it drops stale media rather than pass it on: a child of such
a relay saw an offering parent send nothing and failed over. A subscribed
parent is now not charged silence while its offer for the stream is fresh
(2.5 s), says forwarding, and advertises an upstream past the 800 ms
budget. When that ends it owes chunks from then (the excused span is not
charged at once), under the unchanged bound; a parent offering an on-time
upstream and sending nothing is still a black hole and is failed over.

The offers say how late they are: the publisher's own offer carries its
send-clock backlog; a relay's upstream latency is at least its parent's
advertised one plus half the RTT, and at least what it drops as stale in
the last 2.5 s (its smoothed meter lagged a building queue). No wire
change. A debug line (target ciris_edge::c3_rx) logs each C3 frame
received, with an offer's advertised upstream latency.

Witnesses: a_parent_that_still_offers_is_alive_and_one_that_stops_is_not,
and a_capped_publishers_children_move_themselves_and_come_back with its
bars unchanged (no parentless listener, <= 2 moves), 5/5.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012q7dLdkP5wzJXrqz2tEsf8
…e stalled

(a) The stall verdict stops detecting within seconds under a standing
queue (its age restarts at each proof), and every stall behaviour (one
direct child, standbys get nothing, offers to non-children at the
liveness minimum) lapsed with the queue still full. A backlog episode
now counts as a detection.
(b) A stalled node relays one stream's room at most and has none to
offer; its relay offers were 4 of the 5 offers a second m0 sent every
member under the W6 cap. They are not sent while stalled; the own
stream's offer, each leg's liveness, goes on.

Witness: a_draining_uplink_is_stalled_and_offers_nothing_it_relays.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012q7dLdkP5wzJXrqz2tEsf8
Unreleased entry: the backlog reading, the egress budget with FIRST class
and the bulk floor, rows STALE and AGE, offer-as-life, the stall fixes;
known: a relay drops and admits per chunk (the fragment marker is inside
the end-to-end AEAD), and audio on the faithful bench is still under its
bar.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012q7dLdkP5wzJXrqz2tEsf8
…5 schedules the uplink; keyframes, NAT observer, peer reach, one address rule

Calls (models R24-R33, CIRISEdge branch model/45.3-rules):
- Offer-as-life on the publisher's signed word only. A backlog STAMP (C3
  0x08, 124 B, CAP_BACKLOG_STAMP; stream, epoch, send time, declared
  backlog, highest chunk sealed; the stream's bound chunk key signs it)
  sent from a 300 ms queue word and whenever the publisher withholds
  media, to every member each second; a relay forwards the latest it
  verified byte for byte and never mints one. A verified stale chunk is
  the publisher's word too: forwarded one a stream per second, usable once
  by seq and under 6 s late, never delivered, never an arrival; stale
  chunks alone excuse at most 5 s until the parent delivers. The excuse
  needs a stamp declaring > 800 ms fresh net of it, or a fresh stale
  chunk; a first chunk's grace is a stamp's backlog. A relay's own claim
  excuses nothing.
- leviculum v0.34.0+ciris.5: the transport's egress scheduler follows the
  budget at 2x R (at 1.10x it bound first and the call never came back);
  media carries its kind; Channel sends their class; its queue joins the
  backlog reading; FIRST envelopes ride the Channel before any Resource.
- AGE floors need a confirming pair (R27); the most late stale drop is
  advertised (R29b); one leg's backlog is read and a drain ends on every
  leg (R25); the bulk floor is debited only by what it serves (R28); G8
  reads the send clock (R24); withdraws, duty and ownership ride FIRST,
  counted by family.
- CallEvent::KeyframeWanted, at most once a second per stream.
- Logs: ciris_edge::alm_decision and ciris_edge::stamp at debug, key ids
  only.

NAT and reach:
- The second NAT observer (the bundle facilitator's dial port + 1).
- Edge::peer_reach (Live / Dialable / Unreachable / Unknown), PyO3 and
  UniFFI; bindings regenerated.
- One address predicate on both sides of a direct link (a known peer
  sharing a room or named as a contact, never while anonymous), re-read
  on every standing change; a link whose peer no longer passes is
  retired and its background re-proposals dropped. identified_only now
  follows the rule.

Gates: wide clippy -D warnings; lib 3068 passed; alm_mesh_stage2 44 passed
(3 ignored) in 8 batches; av_call_805 11; av_call_nat_805 12; direct_links_805
42; link_stall_926 3; log_citations; observability_metrics 7; uniffi drift
clean.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012q7dLdkP5wzJXrqz2tEsf8
Version 45.3.0 (MINOR: additive API, one additive capability-gated C3
frame). leviculum v0.34.0+ciris.5 by tag; persist and Verify unchanged.
Evidence rows, README (and its plain-language P2P section) and MISSION
status, CHANGELOG and release notes. Operations: the bridge publishes the
canonical's dial port + 1 over UDP, with canonical-1's firewall allow.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012q7dLdkP5wzJXrqz2tEsf8
@chatgpt-codex-connector

Copy link
Copy Markdown
Codex Review Summary: ❌ Failed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ❌ Failed 2026-11-28T11:01:42.478307Z
We couldn’t complete this review. Comment @codex review to try again.
f4fab68 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

emooreatx and others added 2 commits November 28, 2026 07:29
… pool witness sends bulk

The backlog stamp lives in av_chunk_auth, which only the Reticulum module
builds: the C3 STAMP variant, its encoder and decoder arm are gated the
same way (core, packet-radio and the uniffi drift lane compile without
it). The cancelled-send pool witness holds Resource ships; an unclassed
send is FIRST and now rides the Channel first, so its send is BULK.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012q7dLdkP5wzJXrqz2tEsf8
…; hand-out AGE allows for the hand-off; FIRST no longer rides the Channel on dialled lanes

- R34 ShedMovers.tla: the movers spare the lowest-ranked direct child they
  hear offering the stream on; the publisher shed by rank over its whole
  ledger and could keep a lower-ranked child the movers could not see,
  shedding the relay they had moved to (the come-back witness, ~1 run in
  3: three primary changes). The publisher now records its children's
  relay offers of its own stream and sheds that spared child last.
  Witness: an_over_commit_shed_keeps_the_relay_the_movers_chose.
- Hand-out staleness is judged 20 ms inside the budget, for the hand-off.
- A FIRST envelope on a dialled lane goes as a Resource again: on the
  Channel it counted Delivered once handed to leviculum, so a send over a
  link the far side refused read as delivered (link_seal_e1).
- The ALM decision trace carries the stream; one witness line per period.

Gates: come-back witness 5/5; shed, removal, kept-child-lost; link_seal_e1
53; link_pool_819 6; lib av_call + realtime_av_alm 315; wide clippy clean.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012q7dLdkP5wzJXrqz2tEsf8
@emooreatx
emooreatx merged commit 38b063d into main Nov 28, 2026
20 checks passed
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