Skip to content

[codex] Allow combined trace and turn idle caps#11

Draft
cquil11 wants to merge 2 commits into
cquil11/agentx-v0.4-syncfrom
cquil11/agentx-request-budget-experiments
Draft

[codex] Allow combined trace and turn idle caps#11
cquil11 wants to merge 2 commits into
cquil11/agentx-v0.4-syncfrom
cquil11/agentx-request-budget-experiments

Conversation

@cquil11

@cquil11 cquil11 commented Jun 29, 2026

Copy link
Copy Markdown

Summary

Allows Weka / AgentX replay to use both idle-gap controls together:

  • trace_idle_gap_cap_seconds compresses aggregate request-start idle gaps within each root trace first.
  • inter_turn_delay_cap_seconds then caps the derived per-stream parent/subagent delays.

This restores separate control over engine-idle gaps and per-conversation dormancy, matching the behavior discussed for AgentX trace replay experiments.

Details

Previously, enabling trace_idle_gap_cap_seconds disabled the per-turn delay cap to avoid accidental double-capping. That made it impossible to express policies like:

--trace-idle-gap-cap-seconds 30
--inter-turn-delay-cap-seconds 300

where the benchmark keeps the engine moving while still bounding long per-conversation gaps.

This PR updates the Weka loader semantics, scenario/config descriptions, generated CLI docs, and regression tests for serial/parallel conversion parity.

Validation

  • uv run pytest tests/unit/dataset/loader/test_weka_trace.py::test_trace_idle_gap_cap_is_per_trace_and_uses_request_starts tests/unit/dataset/loader/test_weka_flat_split_parallel_adv.py::test_convert_fanout_idle_gap_warp_parallel_byte_identical tests/unit/dataset/loader/test_weka_flat_split_parallel_adv.py::test_convert_think_time_only_with_delay_cap_parallel_byte_identical tests/unit/dataset/loader/test_delay_cap.py tests/unit/common/scenario/test_scenario_validator.py::test_inter_turn_delay_cap_explicit_other_value_does_not_raise tests/unit/common/scenario/test_scenario_registry.py
  • uv run ruff check src/aiperf/common/config/loadgen_config.py src/aiperf/common/scenario/base.py src/aiperf/dataset/loader/weka_trace.py tests/unit/common/scenario/test_scenario_validator.py tests/unit/dataset/loader/test_weka_flat_split_parallel_adv.py tests/unit/dataset/loader/test_weka_trace.py
  • uv run ruff format --check src/aiperf/common/config/loadgen_config.py src/aiperf/common/scenario/base.py src/aiperf/dataset/loader/weka_trace.py tests/unit/common/scenario/test_scenario_validator.py tests/unit/dataset/loader/test_weka_flat_split_parallel_adv.py tests/unit/dataset/loader/test_weka_trace.py
  • Pre-commit hooks on commit, including generated CLI docs

@github-actions

github-actions Bot commented Jun 29, 2026

Copy link
Copy Markdown

Try out this PR

Quick install:

pip install --upgrade --force-reinstall git+https://github.com/ai-dynamo/aiperf.git@230e3d5559bf32ff7a5232a6e5e15fd991278565

Recommended with virtual environment (using uv):

uv venv --python 3.12 && source .venv/bin/activate
uv pip install --upgrade --force-reinstall git+https://github.com/ai-dynamo/aiperf.git@230e3d5559bf32ff7a5232a6e5e15fd991278565

Last updated for commit: 230e3d5Browse code

@github-actions

Copy link
Copy Markdown

Fern Docs Preview: generation failed — see the Actions log for details. This does not block merge; ask a maintainer to retry if needed.

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.

1 participant