Skip to content

perf(agent): add generation-7 raw bulk transport - #1359

Open
appcypher wants to merge 2 commits into
appcypher/agent-copy-foundationfrom
appcypher/agent-raw-bulk
Open

perf(agent): add generation-7 raw bulk transport#1359
appcypher wants to merge 2 commits into
appcypher/agent-copy-foundationfrom
appcypher/agent-raw-bulk

Conversation

@appcypher

@appcypher appcypher commented Aug 16, 2026

Copy link
Copy Markdown
Member

TL;DR

Move filesystem and TCP payloads out of nested CBOR into generation-7 raw records with bounded credit.

Description

  • Add negotiated raw records for filesystem and direct-TCP payloads.
  • Keep requests, errors, credits, cancellation, and terminal results as typed control messages.
  • Preserve generation-6 CBOR fallback whenever either peer does not support raw bulk.
  • Keep the high-level SDK API unchanged.

The same fresh exact-head comparison is shown on every PR in this stack. “After” means all four PRs together at 7f3f44ce, with automatic dual-port selection and local-shm-v1 enabled; the original baseline is 05f53e7a. Both profiles ran twice in ABBA order.

Workload Original baseline Complete stack Change
FS host to guest, 256 MiB 153.5 MiB/s 323.4 MiB/s +110.6%
TCP host to guest, 64 MiB 198.8 MiB/s 210.1 MiB/s +5.7%
FS guest to host, 256 MiB 254.6 MiB/s 564.9 MiB/s +121.9%
TCP guest to host, 64 MiB 511.8 MiB/s 649.7 MiB/s +26.9%
TCP full duplex, 64 MiB each way 244.4 MiB/s 381.8 MiB/s +56.2%
Idle ping median 0.1383 ms 0.1471 ms +0.0088 ms
Ping under FS load, p95 480.3 ms 1.929 ms 99.60% lower

Environment: OVH Advance-4, Linux/KVM, 1-vCPU guest, host CPU 8 affinity, guest tmpfs, public Rust SDK, verified payload hashes, and empty stderr. After artifacts were rebuilt from 7f3f44ce against libkrun ff087a1.

Test Plan

  • Protocol, agentd, agent-client, SDK, and lint suites pass
  • Mixed new/old peer tests prove generation-6 fallback
  • Run the same baseline-versus-complete-stack Linux transport benchmark shown across all four PRs

@appcypher
appcypher requested a review from toksdotdev as a code owner August 16, 2026 04:52
Comment thread crates/agentd/lib/session.rs
@appcypher
appcypher force-pushed the appcypher/agent-raw-bulk branch 2 times, most recently from 10d10f1 to ed826cb Compare August 16, 2026 09:28
Add exclusive raw bulk records with explicit credit, offsets, completion, and cancellation while preserving generation-6 fallback. Route filesystem and direct-TCP data through the bounded bulk path across agentd, the host relay, agent-client, and the Rust SDK.
Retire correlation IDs only after their operation's ordinary terminal
response and never reuse IDs during one relay connection.

Make agentd emit typed filesystem or TCP terminal failures after
cancellation, keep SDK routes alive while dropping late raw records, and
use the same cancellation path when an SSH bulk channel closes.
@appcypher
appcypher force-pushed the appcypher/agent-raw-bulk branch from ed826cb to e29bc98 Compare August 16, 2026 09:34
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