Repository navigation
Description
Parent workstream: #3000
Slowdown path
flowchart LR
A[Run request model] --> B[Full model dump]
B --> C[Merge model response]
C --> D[Validate verify model]
D --> E[Full model dump]
Current behavior
When verification is enabled, SimpleAgent.run dumps the complete run request, merges in model_response_json, validates the merged dictionary as SimpleAgentVerifyRequest, then dumps that model again for ServerClient.post. See SimpleAgent.run.
The resources server validates the same wire payload against its typed /verify handler after the HTTP hop. The local construction pass therefore repeats traversal of the largest rollout object before the actual trust-boundary validation.
Impact and provenance
Measured
The evidence report did not publish an isolated benchmark for these duplicate passes. Its serialization ledger identifies this path as one full dump, one local validation, and a second full dump per rollout; that accounting is from source inspection, not a timing measurement.
Expected
Building one wire dictionary should remove repeated Python-object traversal and allocation before every verify call. Benefits should increase with response and token-metadata size, but no throughput gain is claimed until the focused benchmark runs.
Implementation constraints
- Keep resources-server ingress validation as the trust boundary.
- Preserve all run-request extras, rollout identity, verifier metadata, response content, token metadata, and terminal attribution.
- Preserve
skip_verificationbehavior and the finalSimpleAgentVerifyResponsevalidation. - Avoid mutating
body,model_response_json, or nested caller-owned data.
Acceptance criteria
- The verify wire dictionary is constructed once without local full-model validation and a second dump.
- Serialized
/verifypayloads are equivalent before and after the change for base fields and allowed extras. - Stateful verification, skipped verification, trajectory attachment, and failure paths retain behavior.
- Resources-server validation still rejects malformed payloads.
Benchmark plan
Use a stub resources server to benchmark verify-payload construction and the complete agent → resources hop with small responses, 64K-token training-shaped responses, and large verifier metadata. Measure CPU time, allocations, requests/s, and p50/p99 latency at concurrency 1 and 32. Compare exact decoded request bodies and report any intentional ordering-only differences.
Related work/PRs
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
HuiyingLi commentedon Sep 13, 2026
Draft implementation: #3339.
Builds the verify payload once while preserving resources-server ingress validation and final response validation. The PR includes the fix and regression tests; performance measurements and live Gym validation results are in its description.
Local validation: 299 related tests passed, 96.15% simple-agent coverage, full pre-commit passed, and local GPU model rollouts completed with 3/3 healthy results. A separate live-HTTP check with deterministic model replies also passed 32 isolated stateful sessions.
perf(simple-agent): avoid duplicate verify conversion (NVIDIA-NeMo#3048)