feat: write AgentX E2E accuracy as aisim-eval records #1171
All Vouch review confidence checks passed
Residual risk 0.38 = Change Risk (0.64) × (1 − Review Confidence (0.40)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.64 · 650 lines diff across 8 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 10%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.388
Shallow Review Depth
shallow_review_depth
0.344
No Reviewer Assigned
no_reviewer_assigned
0.120
Real PR Conversation Timeline
1 comments
"Review active on #1171"
general
weight: 0.35
simone-chen
Why and what changed
AISim can write step accuracy as
aisim-eval/v1records (write_step_eval_records.py), but there was no in-repo writer for end-to-end AgentX serving accuracy. This PR addsscripts/fpm_accuracy/write_e2e_eval_records.pynext to the step writer.It reads the AgentX benchmark bundles of one serving configuration and the engine replay of each point. It writes two records, one for TTFT (
ttft_ms) and one for TPOT (tpot_ms).Inputs (one
--pointper lane count):aisim_core.data.agentx_convert. All bundles must be one serving configuration.scripts/e2e_accuracy/agentx_predict.py(native.json,compiled-replay.json,config.json,outcome.json), asagentx_cache_points.py runandrun_agentx_accuracy.py runwrite it.Scoring reuses the AgentX implementation; nothing is re-implemented:
normalize_nativeandagentx_contract.scorepair the silicon and replay requests;agentx_metrics.request_metricsgives each point's mean (e2e) and p5 to p95 quantile (quantile) errors with their bootstrap SEs, stored underresults.replay_coverage.points.<point>.Output per record:
<point>:<request_id>, point =l<lanes>).inputs_jsonholds the point, request ID, conversation, turn index, tokens and cached tokens; for TPOT of a drafting replay it also holdsaccept_len.aisim-eval-cases/v1, the step writer's columns) withpredicted,predicted_cached_tokens,predicted_queue_msandpredicted_accept_len.measured_requests) is either a case or a counted entry oftruth_drops. A request the replay missed or mismatched is an exclusion with aprediction_error:<scorer status>reason, never dropped. No warm-up rule is added. Silicon TPOT under 1 ms stays a case; the AgentX metric reports it inexcluded.host_cost_path,engine.tokenization,engine.extra_cpu_overhead,engine.detokenization(in the engine config'sper_*_usunits, null when not priced),host_cost_source(hand-entered, the--host-cost-pin<repo>@<revision>when the measured lookup filled it, ornone) andserving_cpu. A stage isverifiedonly when the lookup supplied it for the stated serving CPU.code_pathengine_replay,code_version, and the data pinsop(SHA-256 ofop_latency_pin.json),host_cost(SHA-256 ofhost_cost_pin.json, only when the lookup was used) andreplay_config(the replay configs by point, with corpus paths replaced by the corpus digest).offload_modefrom the bundle'scache.g2/cache.g3features. A drafting cell namesspeculative_algorithmandspeculative_num_steps, given with--identity-settingwhen the bundle lacks them;speculative_num_stepsmust equal the replaynextn.framework_version), the bundle's implementation identity (image digest, framework commit), each bundle's SHA-256, the replay worker timing,gpu_timefrom--gpu-time,--snapshot-idand--frontend.Refusals:
native.jsonper-request rows andcompiled-replay.json, for example acli_estimateresult);fallback_policydeny;measured_requests.Example:
The README section "AgentX E2E records" in
scripts/fpm_accuracy/README.mddocuments every field and refusal.Review map
build_cases(case vs truth drop vs exclusion, official-count invariant),load_replay(what counts as an engine replay),host_costs/host_cost_assumptions,cell_identity.aisim-eval/v1records (code_pathengine_replay, layere2e) and the assumption names listed above.Evidence
python -m pytest -c pytest.ini tests/fpm_accuracy/test_write_e2e_eval_records.py(14 passed). The tests cover:- one record per metric;
- per-case rows and inputs;
- TPOT drops and the under-1-ms rule;
- official counts, including a refused bundle whose profile phase does not match
measured_requests;- AgentX metrics equal to
request_metrics(score(...));- multi-point cells and lane pairing;
- host costs: none, lookup, hand-entered;
- refusal of
cli_estimate, aggregate-only,fpm_learned, fallback and failed replays;- deployment mismatch;
- speculative identity and accept lengths;
- the validators:
load_record, theaisim-eval/v1JSON schema fromaisim_core.data.schemas,aisim_core.data.mirror.validate_tree, and the benchmark skill'scheck_eval_record.py, found by glob rather than a hard-coded path;- malformed options.
tests/fpm_accuracy/test_write_step_eval_records.py,tests/test_agentx_metrics.py,tests/test_agentx_accuracy.py,tests/test_agentx_inputs.py(241 passed; the only skips need the native runtime, which this checkout had not built).ruff checkandruff format --checkwithpython/aisim/pyproject.toml, and the documentation link checks, pass.Modeling or data provenance
N/A. The writer records measured and predicted values; it does not change a model or collect data. The records state each host-cost stage as measured (
verified) or not (estimated), and the GPU time and its authority from--gpu-time(unknownwithout it).Tracking