perf(isolation): add TCP and DNS benchmark harnesses - #3229
Conversation
|
Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually. Contributors can view more details about this message here. |
|
Label |
3ab20c9 to
cbef8e4
Compare
|
🌿 Preview your docs: https://nvidia-preview-pr-3229.docs.buildwithfern.com/openshell |
cbef8e4 to
1f345c2
Compare
1f345c2 to
1a88b94
Compare
1a88b94 to
002d3e8
Compare
002d3e8 to
be8526a
Compare
378b896 to
e5b5b72
Compare
e5b5b72 to
bdb0acc
Compare
b5f87be to
0cf8481
Compare
0cf8481 to
4152a4f
Compare
3bf1b94 to
94073e7
Compare
94073e7 to
5d27965
Compare
5d27965 to
19abaf4
Compare
19abaf4 to
854860e
Compare
854860e to
84d7d95
Compare
84d7d95 to
d70e714
Compare
Signed-off-by: Drew Newberry <anewberry@nvidia.com>
Signed-off-by: Drew Newberry <anewberry@nvidia.com>
d70e714 to
6ea5a91
Compare
johntmyers
left a comment
There was a problem hiding this comment.
gator-agent
PR Review Status
The incremental performance-harness layer fits RFC 0012 and stays outside production paths, but three concrete correctness issues need fixes before pipeline handoff.
Action required: @drew, please address the three blocking findings and push an updated head for a focused follow-up review.
Blocking findings:
GATOR-6ea5a915-01: Linux-only harness compilation breaks supported macOS check and lint workflows.GATOR-6ea5a915-02: worker setup failures can deadlock the benchmark coordinator.GATOR-6ea5a915-03:tcp-connectreports throughput for bytes it never transfers.
Carried findings:
- None
Non-blocking suggestions:
- None
Gator metadata
- Validation: Maintainer-authored measurement-only layer for the linked RFC 0012 isolation stack and issue #1737.
- Docs: Published Fern docs are not needed because this adds opt-in developer performance harnesses without changing product UX.
- Checks: Current-head Branch Checks and E2E are failing; review blockers take precedence over CI triage.
- E2E:
test:e2eis applied and the current-head Branch E2E workflow completed with failures. - Head SHA:
6ea5a915b928fa8b4b62f4a626f7ea9f24dcd9a6 - Base SHA:
a83bc00027b57eaf852148331f3c92935a4836a5 - Merge base SHA:
a83bc00027b57eaf852148331f3c92935a4836a5 - Patch ID:
093348b2e23d754650572ff00348337fcfce75da - Gator payload:
8 - Review mode:
initial - Previous reviewed SHA: none
- Review budget exhausted: no
- Maintainer decision required: no
- Next state:
gator:in-review
|
|
||
| use clap::builder::{PossibleValue, PossibleValuesParser}; | ||
| use clap::{Parser, Subcommand, ValueEnum as _}; | ||
| use openshell_sandbox::perf::{BenchmarkOptions, Layer, Protocol}; |
There was a problem hiding this comment.
gator-agent
Warning — GATOR-6ea5a915-01 · Linux-only harness breaks macOS checks
Summary: A contributor running the required Rust check, lint, pre-commit, or CI task on macOS now compiles this binary with perf-harness. This import is unconditional, while openshell_sandbox::perf exists only on Linux, so supported macOS workflows fail before completing their checks.
Fix: Gate the binary implementation for Linux and provide a small non-Linux main that reports the platform requirement, or restrict all perf-specific task invocations to Linux while preserving cross-platform feature checks.
Verify: On aarch64 macOS, run mise run rust:check; both Cargo invocations must complete without an unresolved openshell_sandbox::perf import.
Agent context
- Ownership: This PR adds the Linux-gated module and the generic tasks that compile its binary.
- Location:
crates/openshell-sandbox/src/bin/seccomp-perf.rs:10
| })); | ||
| } | ||
| drop(sender); | ||
| barrier.wait(); |
There was a problem hiding this comment.
gator-agent
Warning — GATOR-6ea5a915-02 · Setup errors can deadlock the coordinator
Summary: If any benchmark worker cannot connect or encounters an I/O error during warmup, it returns before reaching this barrier. The coordinator still waits for the original participant count, so the command hangs indefinitely instead of returning the useful setup error.
Fix: Have workers report readiness or initialization failure before timed execution. Release them only after every participant is ready; on failure, cancel or release the remaining participants and return the error promptly.
Verify: Reserve a loopback address, drop its listener, and invoke run_worker(TcpStream, address, 1, 0, 1, 1) through a bounded channel; it must return connection failure before the deadline rather than remain blocked.
Agent context
- Ownership: This PR puts fallible initialization and warmup before a non-cancellable barrier.
- Location:
crates/openshell-sandbox/src/perf.rs:217
| capability_scope: protocol.capability_scope().to_string(), | ||
| elapsed_ms: seconds * 1_000.0, | ||
| operations_per_second: operations as f64 / seconds, | ||
| throughput_mbit_per_second: operations as f64 * payload_bytes as f64 * 8.0 |
There was a problem hiding this comment.
gator-agent
Warning — GATOR-6ea5a915-03 · Connect throughput counts bytes never transferred
Summary: An operator running tcp-connect receives application-throughput output computed from payload_bytes, although that protocol only opens connections and never transfers the payload. Changing --payload-bytes therefore changes the reported throughput without changing the measured work, making comparisons misleading.
Fix: Compute transferred bytes per protocol: report zero or an explicit unavailable value for TcpConnect, and define whether TcpStream counts sent bytes or both request and echoed response bytes. Add a regression check for that contract.
Verify: Run native tcp-connect twice with identical iterations and concurrency but different payload sizes; the connect workload must no longer report payload-dependent data throughput.
Agent context
- Ownership: This PR introduces the report schema and protocol-independent calculation.
- Location:
crates/openshell-sandbox/src/perf.rs:241
Summary
Add benchmark harnesses for the completed RFC 0012 stack. The tests separate startup, DNS, new TCP connections, reused TCP streams, policy denial, and representative live-Internet workloads.
This is a measurement-only layer. General application UDP remains out of scope; DNS still supports its normal UDP and TCP behavior through supervisor mediation.
Related Issue
Part of #1737.
Changes
perf-harnessfeature and outside production paths.Testing
mise run pre-commitChecklist
Stack