Skip to content

test(remote-interop): measure image latency segment by segment on a weak link - #1380

Merged
huichen merged 2 commits into
mainfrom
pr/huichen
Oct 27, 2026
Merged

huichen merged 2 commits into
mainfrom
pr/huichen

Conversation

@huichen

@huichen huichen commented Oct 27, 2026

Copy link
Copy Markdown
Collaborator

What this brings

A measurement harness for the question "how long until a picture is on screen on a
remote link", split into the parts that can be measured on one machine and the parts
that cannot.

tests/remote-interop/tests/image_latency.rs measures three segments separately,
so a slow picture can be attributed instead of guessed at:

  • host-side preview encode — the same resize (Lanczos3 to a 1600 px edge) and
    re-encode (JPEG q65 / PNG) that host/src/remote_host/files.rs performs, repeated
    in --release because this crate depends on the remote protocol crates and not on
    future-host;
  • transfer — the real client, the real host, real 512 KiB chunking, real seal and
    a real Core NATS broker, with delay and loss injected on the client's leg only;
  • client-side decode — turning the received bytes back into pixels with the same
    image crate version the host uses.

WebView/GPU upload, frame composition and scan-out are named in the module docs as
not measured rather than estimated. The two measured benchmarks are #[ignore]d
(they build multi-megapixel sources and open real sockets); the sampling helpers they
share run as ordinary unit tests.

Supporting changes: tests/remote-interop/Cargo.toml gains an image dependency
(PNG + JPEG only) and the image_latency test target, which requires the existing
network-tests feature like the other interop executables; Cargo.lock follows.

Commits

  • test(remote-interop): measure image latency segment by segment on a weak link

Verification

Run locally at a08d04b67 with the pinned toolchain (rustc/clippy 1.99.1):

  • cargo fmt --all -- --check → clean
  • cargo test -p future-remote-interop --features network-tests --test image_latency →
    6 passed, 0 failed, 2 ignored (the two ignored ones are the opt-in benchmarks)
  • cargo clippy -p future-remote-interop --features network-tests --all-targets -- -D warnings
    → one clippy::type_complexity error in tests/remote-interop/src/server_host.rs:192,
    a pre-existing condition: that file is byte-identical to main, and the
    feature-gated interop lint only runs in the opt-in Misc → remote-interop suite,
    never on a PR or push. Left untouched here rather than mixed into a measurement PR.

Notes

The new test target does not run in PR CI: like the other interop executables it is
gated behind network-tests, and scripts/ci/remote-checks.mjs runs only the
--lib and rust_client_server targets. It is a measurement tool, invoked by hand.

…eak link

One picture on the remote link costs a host-side preview encode, two to
three and a half round trips, and a client decode. This adds an ignored
benchmark that measures each of those with production shapes: the real
1600 px preview encode (decode, Lanczos3 resize, JPEG q65 / PNG), the real
512-KiB chunked transfer through the real client, host and Core NATS with
the weak-link fixture on the client leg only, and the client-side decode of
the bytes that transfer delivered.

Reported per cell as median, p95 and p99 over 20 repetitions, with 100-rep
arms for the two representative payloads so a p99 is a percentile rather
than the second-worst of 20, plus one lossy arm for the tail.
@huichen
huichen enabled auto-merge (squash) October 27, 2026 00:29
@huichen
huichen merged commit 733f131 into main Oct 27, 2026
33 checks passed
@huichen
huichen deleted the pr/huichen branch October 27, 2026 00: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