Skip to content

feat: live performance feed for a watching controller, and strobe --watch-perf (D567, L-10) - #121

Merged
lnorton89 merged 4 commits into
masterfrom
feat/l10-live-perf-feed
Nov 26, 2026
Merged

lnorton89 merged 4 commits into
masterfrom
feat/l10-live-perf-feed

Conversation

@lnorton89

Copy link
Copy Markdown
Owner

What

A second computer can now watch a show's frame timing as it happens, without the JPEG stream of the control window (which costs the host redraws of its own).

  • Protocol (strobe-remote): perf_open / perf_close from the controller, perf from the host once a second, only to connections that asked. Only desktop controllers (approved or venue-trusted) may ask; phones get unauthorized. No lease and no picture stream needed. Latest-only slot in the bridge (AppEnd::publish_perf), nothing queues.
  • Counting (strobe-app): PerfWindow::take_after now returns a PerfSummary; the minute perf: log line and the one-second sample are both built from it, so they agree. The live window is fed only while the listener runs.
  • Desktop viewer: a strip under the toolbar with the second's numbers and a one-minute frame-rate trend; warning colour on late/missed frames, a slowed control window, an output that lost the focus, or numbers older than 3 s.
  • strobe --watch-perf HOST:PORT --remote-trust FILE [--perf-csv FILE] [--perf-seconds N]: no window; proves the venue trust file, prints a line a second, appends flushed CSV rows, reconnects on the venue schedule, exits non-zero on a refusal or when no sample arrived.

Mixed versions: a host never sends perf unasked (older controllers close on unknown types). An older host answers perf_open with "that message was not understood" (now strobe_remote::NOT_UNDERSTOOD), and the controller carries on without the feed (the D513 pattern).

Decision: docs/decisions/D567.md. Backlog: L-10. Docs: DEBUGGING.md, USER_GUIDE.md, ROADMAP.md, strobe-remote README.

Verified

  • cargo fmt, clippy -D warnings on strobe-remote and strobe-app (all targets, all features), rustdoc with CI's flags.
  • Tests: strobe-remote (frozen messages, bridge slot, end-to-end over sockets: phone refused, nothing unasked, samples after perf_open without the lease, none after perf_close), strobe-conventions, strobe-app (summary agreement, feed/strip logic, watcher with a real trusted host incl. CSV, wrong trust file, closed stdout, CLI).
  • On LIGHTNING: a real host on loopback (--remote --allow-desktop-control --remote-trust) watched for 8 s with --watch-perf; samples every second, whole CSV rows, host log shows the trusted pairing and "is watching the performance feed".

Not done

  • The cost of watching is not measured: L-10's soak on the T480 (30 min with a watcher, 30 without, compare perf: lines).
  • The strip has not been looked at in a real two-machine session.
  • strobe-remote's a_command_the_phone_was_told_is_busy_is_not_run_when_the_app_catches_up failed once under a parallel full run (50 ms command timeout) and passed 5/5 alone and 2/2 as a suite; it does not touch the rig this PR changed.

…d strobe --watch-perf prints it with no window (D567, L-10)

A controller sends perf_open and gets one perf sample a second: frame
rate, late and missed frames, worst gap, GPU and CPU time, render scale,
the control window's cost by part, and the slowed and not-foreground
states. The numbers come from the same counting as the minute perf: log
line (PerfWindow::take_after). Only desktop controllers may ask; no lease
and no picture stream are needed. Nothing is sent unasked, and an older
host's "not understood" reply leaves the controller working without it.

The desktop viewer draws a strip with a one-minute trend that warns on
trouble and on old numbers. strobe --watch-perf HOST:PORT --remote-trust
FILE proves the venue trust file, prints a line a second, appends CSV
rows with --perf-csv, and stops after --perf-seconds.
@github-actions

github-actions Bot commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @lnorton89's task in 20s —— View job


Review of PR #121 (live perf feed, D567 / L-10)

I read the core of the change: strobe-remote (bridge.rs, server/session.rs) and stats.rs. I skimmed the app.rs hook. I did not read perf_watch.rs, perf_feed.rs, desktop.rs or the tests in detail, and I did not build or run anything.

Rule checks

  • I found no unsafe, unwrap/expect/panic!, #[allow] or wildcard arms in what I read.
  • Nothing touches GL.
  • The perf path doesn't allocate or query the driver. The bridge keeps one Copy slot behind a mutex, and publish_perf runs once a second.
  • Docs are updated: D567, ROADMAP, backlog L-10 and the decisions-by-area file. CHANGELOG.md is untouched.

Correctness

  • Gating is sound. PerfOpen and PerfClose are refused before pairing and refused with unauthorized for non-desktop sessions. The mid-session arm also closes the connection with Gone, so no message type falls through unhandled.
  • Because PerfSample::sanitized runs on publish, non-finite floats never reach the wire.
  • take_after shares its counting between the minute log line and the one-second sample. The agreement test covers that.

Minor, non-blocking

  • Stale slot. Shared.perf is never cleared when the listener stops, or when the app stops publishing. publish_perf only resets the local window (app.rs, when !self.lan.running()).
    • A controller that sends perf_open after a listener restart gets the old sample immediately, via the push_state() call in the PerfOpen arm. If the host's frame loop is paused or the output is minimized, no new sample follows.
    • The strip's "older than 3 s" warning only works if the viewer ages samples by arrival time. The sample carries no host timestamp, so I'd check that.
    • Clearing the slot (or adding a clear_perf on AppEnd) when the listener stops would avoid it.
  • Test flake. The flaky a_command_the_phone_was_told_is_busy… test you mention uses a 50 ms timeout. That makes it timing-sensitive under parallel load, and it would be worth widening the margin, although it isn't part of this PR.

Summary: No blocking issues found in the parts I read. The stale-slot point is the one thing I'd consider fixing before merge. The T480 soak and the two-machine look at the strip are still open, as the PR says.

@lnorton89
lnorton89 merged commit 94638a2 into master Nov 26, 2026
10 checks passed
@lnorton89
lnorton89 deleted the feat/l10-live-perf-feed branch November 26, 2026 21:42
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