Aggregate E2E normalized interactivity in AgentX CI results / 在 AgentX CI 结果中聚合端到端归一化交互性 - #2544
Aggregate E2E normalized interactivity in AgentX CI results / 在 AgentX CI 结果中聚合端到端归一化交互性#2544Duyi-Wang wants to merge 1 commit into
Conversation
Compute slow-tail E2E normalized interactivity from per-request E2EL/OSL ratios and emit it in compact AgentX benchmark results. Reject incomplete, nonpositive, and nonfinite samples while preserving a stable empty schema. Add end-to-end and edge-case coverage. 中文:从逐请求 E2EL/OSL 比值计算慢尾端到端归一化交互性,并将其写入紧凑的 AgentX 基准测试结果。过滤字段不完整、非正数及非有限值样本,同时保持稳定的空对象 schema;补充端到端与边界条件测试。
|
Claude finished @Duyi-Wang's task in 3m 29s —— View job Review of PR #2544
LGTM - no blocking issues found Verification notes:
I could not execute |
There was a problem hiding this comment.
LGTM — small, well-tested additive metric in the AgentX aggregation pipeline.
What was reviewed: the new _e2e_normalized_interactivity_stats E2EL/OSL pairing and percentile-then-invert math (verified by hand against the new test fixtures), the missing/nonpositive/nonfinite sample filtering, and the empty-{} fallback path. Also checked that e2e_norm_intvty is additive to the schema (existing intvty/full_response_intvty keys and top-level aliases are untouched) and that no other code in this repo reads the request-metrics schema keys, so there's no forward-compat break.
Extended reasoning...
Overview
This PR adds a new derived metric, request_metrics.latency.e2e_norm_intvty (E2E-normalized interactivity, i.e. output tokens/s/user), to the AgentX CI aggregation pipeline. It reads E2EL and OSL from the same profiling record in profile_export.jsonl, computes a per-request seconds-per-output-token ratio, applies the repo's existing linear percentile interpolation to that ratio, and inverts mean/P50/P75/P90/P95 into the new metric. It reuses the existing _interactivity_stats helper (previously only used for ITL-based intvty), so the percentile/invert logic itself is not new — only its application to the E2EL/OSL ratio is. Two small defensive fixes are bundled in: to_int now also catches OverflowError, and _ms_to_s now filters non-finite values via math.isfinite. The bulk of the diff is new unit tests covering missing-field pairing, non-positive/non-finite sample rejection, and the empty-object fallback when no sample is valid.
Security risks
None. This is CI result aggregation/reporting code operating on locally-produced benchmark JSON files — no user input, network calls, auth, or credential handling involved.
Level of scrutiny
Low-to-moderate is appropriate: this is non-production, CI-artifact-generation code, purely additive to the output schema (no existing keys changed or removed), and covered by 8 new targeted unit tests plus the existing 56-test suite (per the PR description). I manually verified the percentile/inversion arithmetic against the new test fixtures (e.g. ratios 0.02/0.04 → mean 1/0.03, p75 1/0.035, p90 1/0.038, std 12.5) and it is correct.
Other factors
No other code in this repository consumes the specific new schema key, so there's no risk of breaking existing downstream readers within this repo (the PR notes a separate consumer in SemiAnalysisAI/InferenceX-app#638, which is out of scope for this review). There are no outstanding review comments to address, and this is a first-pass review with no prior approvals from me on this PR.
Summary
profile_export.jsonlduring AgentX aggregation.output tokens/s/user.request_metrics.latency.e2e_norm_intvtyin compactbmk_agentic_*JSON artifacts.{}object when no sample is valid.full_response_intvtyunchanged and do not add P99 or duplicate top-level aliases.Motivation
The E2E normalized interactivity formula and Pareto policy were documented in #2502, but current CI results do not contain the metric. Consumers therefore have to download the much larger raw
agentic_*artifact and reparseprofile_export.jsonl. Computing it in the existing aggregation pass makes P75/P90 available from the compact result artifact without changing artifact upload workflows. The calculation follows the reference semantics in SemiAnalysisAI/InferenceX-app#638.Output schema
{ "request_metrics": { "latency": { "e2e_norm_intvty": { "mean": 33.33333, "p50": 33.33333, "p75": 28.57143, "p90": 26.31579, "p95": 25.64103, "std": 12.5 } } } }Validation
python -m pytest -q utils/agentic— 56 passedgit diff --checkpython -m compileall -q utils/agentic/aggregation中文说明
profile_export.jsonl,为每个有效的性能分析请求计算 E2EL/OSL。output tokens/s/user的指标。bmk_agentic_*JSON,路径为request_metrics.latency.e2e_norm_intvty。{}。full_response_intvty保持不变,不增加 P99,也不复制顶层 alias。背景
#2502 已定义端到端归一化交互性公式与帕累托策略,但当前 CI 结果尚未包含该指标。消费者因此必须下载体积大得多的
agentic_*原始产物,并重新解析profile_export.jsonl。本 PR 在现有聚合流程中完成计算,使 P75/P90 可直接从小体积结果产物读取,无需修改 artifact 上传 workflow。计算语义与 SemiAnalysisAI/InferenceX-app#638 的参考实现一致。验证
python -m pytest -q utils/agentic— 56 项测试通过git diff --checkpython -m compileall -q utils/agentic/aggregation