Skip to content

Design broadcast mode: one IVS stream of the whole wall past the direct capacity - #1384

Merged
ejc3 merged 2 commits into
mainfrom
feat/broadcast-mode
Oct 27, 2026
Merged

ejc3 merged 2 commits into
mainfrom
feat/broadcast-mode

Conversation

@ejc3

@ejc3 ejc3 commented Oct 27, 2026 •

Copy link
Copy Markdown
Owner

Design for broadcast mode: past the direct-mode capacity, viewers get one composite of the whole wall delivered by Amazon IVS, with a toggle every viewer has, forced on and locked for a late viewer.

Contract

docs/fleet/ARCHITECTURE.md gains "Broadcast mode", the architecture pass for the stack that follows:

  • Who gets it: --direct-capacity seats (default 500, the elbow measured in fleet/renderer/README.md "Viewers per renderer"), a seat ticket kept 60 s across a reconnect, a toggle for every viewer, locked on for a viewer admitted with every seat held, no promotion mid-session (offered on reload).
  • Server-side enforcement: HMAC direct tokens (admit=) that renderers and aggregators check when they hold the coordinator's key; a late viewer never receives one, and claim_gpu is refused to it.
  • The composite: a coordinator child aggregator reading every placed tile, one 1280x720 x264 encode, IVS standard-channel renditions (720p/480p/360p/160p).
  • Overlay sync: the scene time t in a per-frame SEI, matched to the presented frame by media time; the overlay draws the snapshot in effect at that frame.
  • Reduced controls (words, lights, votes, restart now stay), staging access (private channel, ES384 playback tokens minted per /live connection behind Access), failure behavior, the coordinator's ~5,000-socket limit, cost per 1000 viewer-hours.
  • Two invariants added (8, 9).

fleet/tools/ivsmeasure is the page that took the numbers.

Measurements (2026-10-27)

One g4dn.2xlarge from the tile AMI: its renderer drawing the whole image at 1280x720, the broadcast aggregator from the next PR, an IVS standard low-latency channel in us-east-1, headless Chrome 156 with IVS player 1.57.0 on the same instance (one clock). Five cycles of 60 s each.

IVS
glass to glass per presented frame (7,514 frames) 1.79 s median, 1.87 s p95
of which the composite 84 ms median
IVS getLiveLatency() 1.62 s median
startup, load() to the first frame 0.21 s median (0.18 to 0.32)
the same stream with no audio track 5.18 s median
CPU of the 720p composite 1.69 cores (Xeon)

CloudFront + a self-packaged LL-HLS origin was not built: the owner approved IVS ("IVS is good") and asked for the LL-HLS arm only if IVS did not measure as expected. The cost comparison is in the doc: IVS is $72 per 1000 viewer-hours at 720p against about $126 for CloudFront at the same rendition.

Downstream impact and evidence

Documentation and a measurement page only; nothing runs differently. Evidence is the table above and the command in fleet/tools/ivsmeasure/serve.py.

Stack: this PR, then #1385 (push and coordinator broadcast), then admission, the page, enforcement, and the ejc3/aws infrastructure.

…direct capacity

docs/fleet/ARCHITECTURE.md gains "Broadcast mode": who gets the broadcast
(--direct-capacity seats, default 500 from the measured elbow; a toggle for every
viewer, forced on and locked for a viewer admitted after the seats are held; no
promotion mid-session), server-side enforcement with HMAC direct tokens that
renderers and aggregators check, the composite (a coordinator child reading every
tile, one 720p x264 encode, IVS standard channel renditions), the overlay synced
to the shown frame's t carried in a per-frame SEI, the reduced controls, staging
access through private-channel playback tokens, failure behavior, the coordinator's
5,000-socket limit, and the IVS against CloudFront comparison. Two invariants added.

fleet/tools/ivsmeasure is the page that measured it: per presented frame, display
time minus the frame's wall time from its SEI.

Measured on a g4dn.2xlarge (renderer, composite and headless Chrome on one clock),
five 60 s cycles: glass to glass 1.79 s median, 1.87 s p95 over 7,514 frames;
the composite 84 ms of it; startup 0.21 s median; 5.18 s median without an audio
track.
@coderabbitai

coderabbitai Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 5 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 69bbfc88-6d6e-46d1-a0ac-7399fea5d03f
Commits

Reviewing files that changed from the base of the PR and between 12a83dc and 9ce5823.

Files selected for processing: 5
  • docs/fleet/ARCHITECTURE.md
  • fleet/tools/ivsmeasure/player.html
  • fleet/tools/ivsmeasure/serve.py
  • fleet/tools/ivsmeasure/summarize.py
  • fleet/tools/ivsmeasure/test_player.mjs
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

Codex Review Summary

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-27T08:42:18.277158Z 9ce5823 Manual request
ℹ️ 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.

@ejc3

ejc3 commented Oct 27, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 779947655c

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread fleet/tools/ivsmeasure/player.html
Each cycle's requestVideoFrameCallback loop stayed registered on the shared
<video>, so later cycles ran every earlier cycle's callback per frame. The
cycle now cancels its callback before deleting the player.

test_player.mjs runs the page's loop against a mocked player and video: three
frame callbacks stayed registered after three cycles before the fix, none after.
@ejc3

ejc3 commented Oct 27, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 🎉

Reviewed commit: 9ce5823e7c

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@ejc3 ejc3 left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

NOT-A-DEFECT: Codex's review bodies on this PR carry no finding of their own; each inline finding they announced is answered with a disposition in its thread.

@ejc3
ejc3 merged commit 5260e51 into main Oct 27, 2026
15 checks passed
@ejc3
ejc3 deleted the feat/broadcast-mode branch October 27, 2026 09:44
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