Skip to content

test(benchmark): unit + golden-file tests for the agentperf porter - #355

Merged
nv-yna merged 1 commit into
NVIDIA:mainfrom
nv-yna:yna/agentperf-porter-golden-tests
Sep 11, 2026
Merged

nv-yna merged 1 commit into
NVIDIA:mainfrom
nv-yna:yna/agentperf-porter-golden-tests

Conversation

@nv-yna

@nv-yna nv-yna commented Aug 27, 2026

Copy link
Copy Markdown
Collaborator

What

Follow-up to #353: locks the behavior of scripts/agentperf/port_harness_run.py (the Step-0 harness-run porter) with two layers of tests.

Unit tests (utility layer)

  • rewrite / rewrite_tree: path-prefix rewriting on single values and nested YAML trees (first-matching-rule semantics, non-prefix strings untouched)
  • absolute_paths: nested absolute-path collection (drives the reachability TODOs)
  • translate_env: env drops (CUDA_VISIBLE_DEVICES, PATH, …), renames (DYN_KV_BLOCK_SIZEDYN_TRTLLM_KV_BLOCK_SIZE, DYN_UCX_TLSUCX_TLS), and the pinned-but-overridable DYN_LOG
  • _quoted_env_tokens: picks the env token list out of an srun line and ignores scalar quoted args like '1010' / '0-0'
  • build_frontend_args: env-driven flag reconstruction, KV-events on/off, and the guarantee that the worker-only --dyn-*-parser flags are never emitted
  • SETTLE_RE: integer and decimal settle stems

Golden e2e test (stability over time)

tests/fixtures/agentperf_porter/c1010/ materializes a real harness run directory as a stable test input — the DSV4 c1010 GB300 baseline with usernames anonymized and content otherwise verbatim: the real prefill/decode engine configs, the real 35-token worker environment, the real client resolved-config banner, and real srun launch-line shapes (5 CTX + 1 GEN over 8 nodes + frontend + etcd).

expected-recipe.yaml / expected-workload.yaml are the checked-in expected outputs (machine-dependent paths normalized to <FIXTURE> / <WORKLOAD_OUT> placeholders). The test runs the porter on the fixture and byte-compares the normalized output against the goldens, so any behavior drift fails loudly with regeneration instructions in the module docstring. A second test round-trips the golden recipe through SrtConfig's schema.

make check: 1494 passed.

🤖 Generated with Claude Code

Unit tests cover the porter's utility layer: path-prefix rewriting
(single value + nested trees), absolute-path collection, worker-env
translation (drop/rename/DYN_LOG pinning), quoted env-token-list
extraction from srun lines, frontend-arg reconstruction from env, and
settle-time recovery from output filename stems.

The golden e2e test materializes a real harness run directory as a
stable fixture (tests/fixtures/agentperf_porter/c1010 — the DSV4 c1010
GB300 baseline, usernames anonymized, content otherwise verbatim: real
engine configs, the real 35-token worker env, the real client banner,
real srun line shapes) plus checked-in expected recipe/workload YAMLs.
The test runs the porter on the fixture and byte-compares normalized
output against the goldens, so any behavior drift over time fails
loudly; regeneration instructions are in the module docstring. A
second test loads the golden recipe through SrtConfig's schema.

Signed-off-by: Yuewei Na <nv-yna@users.noreply.github.com>
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (main@00fc543). Learn more about missing BASE report.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #355   +/-   ##
=======================================
  Coverage        ?   72.09%           
=======================================
  Files           ?       96           
  Lines           ?    13064           
  Branches        ?        0           
=======================================
  Hits            ?     9419           
  Misses          ?     3645           
  Partials        ?        0           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@nv-yna
nv-yna merged commit b943e59 into NVIDIA:main Sep 11, 2026
6 checks passed
ishandhanani added a commit that referenced this pull request Sep 13, 2026
Nine conflicting files, resolved by hand:

- The process exporter (#413) and the wider node-exporter collector set (#415)
  arrive as tachometer-stage exporter launches; on this branch the exporters
  are services. process-exporter is now a service kind (`type:
  process-exporter`, implied while tachometer runs, `placement.node: all`),
  host-native from the `configs/process-exporter` binary `make setup`
  installs (no container, no mounts), skipped with a warning when the binary
  is missing, container launch when a recipe declares a `container`. The
  group file is written by the kind's `prepare` hook; `ServiceKind` gains
  `host_native`, `prepare`, and `skip_reason`. node-exporter's built command
  carries the stat/vmstat/pressure/meminfo_numa/processes collectors and the
  widened vmstat field filter. The templates, the group YAML, and the host
  binary resolver move to `srtctl.services.exporters`; their tests follow.
- Load-window tachometer (#359): start/stop inside run_benchmark is kept;
  `stop_tachometer` now terminates through `ManagedProcess.terminate`, which
  signals the Slurm step (SIGTERM to the srun client would abort the step and
  SIGKILL the scraper). The scraper's `terminate_timeout` is the recipe's
  `shutdown_grace_secs`; the 90 s module constant is gone.
- Ingest timestamp fallback (#414) is taken from main wholesale (it also
  offers `--start-ns`); this branch's own fallback is dropped, its dedup
  module and docstring edits re-applied.
- CPU power telemetry (#410, #422): taken as is (power is frozen); the
  energy report runs before the S3 upload, which returns the URL only.
- Makefile: the `examples`/`golden-check` targets plus the cpu-power targets;
  the `recipes/`-based runner targets stay deleted. SUMMARY: both new pages,
  `analyzing.md` stays deleted. submit.py: the direct-host renderer import
  stays deleted; the arch helpers the cpu-power preflight uses are kept.
  telemetry.py: IPv6-safe host and the SGLang gateway metrics port together.

2355 tests on Python 3.10 and 3.13, lint, schema docs, 21 examples validated,
golden 574 identical / 0 mismatched.
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