Skip to content

test(benchmark): measure live-model native Rust, Rig and Deep Agents - #1203

Merged
PurpleCHOIms merged 7 commits into
mainfrom
experiment/minimal-agent-comparison-20261116
Nov 16, 2026
Merged

PurpleCHOIms merged 7 commits into
mainfrom
experiment/minimal-agent-comparison-20261116

Conversation

@PurpleCHOIms

@PurpleCHOIms PurpleCHOIms commented Nov 16, 2026 •

Copy link
Copy Markdown
Member

Summary

Add a reproducible minimum comparison of a handwritten Rust tool loop, Rig 0.46.0 AgentBuilder, and the real Deep Agents 0.7.32 create_deep_agent. Each fresh process completes the same live gpt-6.1-sol task: model-selected echo, one execution, then an exact final answer. Measure local resources separately from the common model relay.

Final batch: 9/9 correct cases, 18/18 successful real model calls, three processes per implementation in balanced execution order. Each run has the same normalized 120-character system prompt, identical tool schema, and 184 input / 28 output tokens. No model response is mocked or replayed.

Median Native Rust loop Rig Deep Agents
Post-exec peak RSS, MiB 5.375 16.672 123.953
Whole-process CPU, ms 7.861 27.960 2,883.047
Library-ready startup, ms 1.783 2.652 1,681.023
Work wall time, ms 4,823.587 4,185.909 5,062.795

CPU includes initialization and teardown. Remote request duration dominates wall time; these three trials do not establish a latency ranking or framework maturity equivalence.

Evidence and intent

The custom Rust loop is a baseline, not a delivered framework. Deep Agents uses its beta harness profile to hide built-in tools and disable the default subagent; required middleware remains. Rig uses single-thread Tokio, while native uses blocking reqwest. Both Rust builds enable rustls. Provider authentication and conversion reuse the existing OSS Codex handler in an unmeasured common Python parent. Its own 182.19–195.93 MiB RSS and CPU are recorded separately; this is not an entirely Rust authentication stack or whole-system RAM result.

End-to-end verification statement

Built both feature-specific release executables with cargo +1.97.1 build --locked --release --no-default-features --features <case> --manifest-path benchmark/agent-runtime/Cargo.toml, and ran both corresponding cargo clippy ... -- -D warnings commands, all under /home/catow/.local/bin/with-build-slot. Ran benchmark/agent-runtime/.venv/bin/python tests/agent_runtime_measure.py --bin-dir benchmark/agent-runtime/target --trials 3 --output benchmark/agent-runtime/results.json under that same coordinator: all nine actual tool loops and all 18 model requests passed. Verified every recorded source and binary hash against the measured files at 5a85add. The later CodeQL response adds only an explanatory sampler comment (parsed AST unchanged); preserve the raw original hashes and explicitly identify their source commit. Ran all three candidate executables against a closed loopback endpoint and observed nonzero failure before tool/final output. Calibrated the profiler with a real 32 MiB allocation, added descriptors/thread and CPU work; confirmed why inherited pre-exec wait4 max RSS cannot be the headline metric. The relay rejected an invalid tool surface before any provider call; a real sleeping child hit the deadline.

Ruff check/format, Rust fmt, uv lock check, focused Basedpyright (zero errors/warnings), Markdownlint (zero issues), git diff --check and skill audit (329 files, zero violations) passed locally. The connection/preflight used 3 extra live calls; an initial 18-call experiment with unmatched native TLS was excluded and preserved locally. 39 live requests total, 18 in the final comparison.

Scope, dependencies and review

Ten files; 187 lines in the Rust/Python case implementations, isolated manifests, generated locks/raw evidence, and a standalone measurement harness under tests. No production manifest or deployment path changes. The separate uv/Cargo projects are required to run the actual frameworks without adding them to product dependencies; the existing provider adapter is reused rather than copied. Rig's agent/core crates avoid the facade's optional database integrations.

Package manifests and lockfiles require supply-chain review even though this experiment is isolated. This PR is ready for review; no merge or publication is performed. No full product suite, Docker build, make quality, make smoke or CI success is claimed. GitHub Actions remains constrained by the user's account billing limit; repository protections are preserved.

Integration review: fetched current main78cae5c5 and resolved only the CHAGELOG conflict with merged #1202, retaining both entries. All ten changed files and connected relay/measurement behavior reviewed, including isolated supply-chain locks (99 Python packages /625 hashed artifacts and236 Cargo packages, only canonical registries). Independently recomputed all nine sample outcomes,18 successful request records, seven original source hashes and reported medians. Frozen offline uv lock check, Python compilation, Ruff check/format, Rust formatting and diff checks pass. No benchmark executable behavior changed and no additional paid model calls were made. The sole CodeQL Empty except thread is addressed with an explanation of the expected child-exit sampling race; pipe EOF/deadline failures remain fatal. No current hosted CI pass or product suite/build/release is claimed.

Comment thread tests/agent_runtime_measure.py Fixed
@PurpleCHOIms
PurpleCHOIms merged commit 309a9b5 into main Nov 16, 2026
24 checks passed
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.

2 participants