Repository navigation
feat(agent): add trajectory replay and rolling admission - #27
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a new trajectory replay workload mode to batchbench-agent, enabling empirical token-shape replay from a versioned JSONL manifest, plus FIFO rolling admission to cap active concurrency while preserving stable DP-rank routing balance. This extends the Rust agent benchmarker and CLI to support replay-specific calibration knobs, lifecycle reporting, and manifest identity tracking.
Changes:
- Introduces JSONL trajectory-plan parsing/validation and compiles replay specs into agent plans with explicit reset boundaries and overhead calibration.
- Implements rolling admission (active-agent cap + reusable routing slots) and records per-trajectory lifecycle metrics in the benchmark report.
- Improves synthetic text generation to target exact token counts while avoiding special tokens; adds CLI outputs/CSV fields/events JSONL to persist replay metadata.
Reviewed changes
Copilot reviewed 7 out of 9 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| rust/src/lib.rs | Re-exports new lifecycle record type from the agent module. |
| rust/src/agent.rs | Core implementation: trajectory JSONL replay, rolling admission, lifecycle reporting, and exact-length synthetic text generation. |
| rust/src/agent_cli.rs | CLI wiring for replay mode, max-active admission, manifest hashing, CSV extensions, and lifecycle JSONL output. |
| rust/README.md | Documents replay mode usage and rolling admission at the Rust CLI level. |
| rust/Cargo.toml | Adds sha2 dependency for manifest hashing. |
| rust/Cargo.lock | Locks new sha2 (and transitive) crates. |
| README.md | Adds end-to-end docs for trajectory replay, overhead calibration, rolling admission, and events output. |
| examples/trajectory-replay/plans.jsonl | Provides an example replay manifest with reset and delay semantics. |
| .gitignore | Re-includes the trajectory-replay example directory/file under examples/. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Why
The existing sampler draws initial prompt, output, environment growth, and invocation count independently. Empirical replay preserves their within-trajectory correlations and lets us run a complete queued workload at a fixed active concurrency.
Validation
Accuracy boundary
This replays token shape, not original customer content. Live usage.prompt_tokens remains authoritative because chat-template/tool framing is backend-specific; the new initial/turn overhead flags allow calibration. Exact output targets likewise depend on the backend honoring min/max generation constraints.
No GPU or Modal benchmark was launched as part of this PR.