Skip to content

feat(task): support seconds-based task horizons resolved against control rate (#160)#162

Open
Adityakk9031 wants to merge 1 commit into
robocurve:mainfrom
Adityakk9031:#160
Open

feat(task): support seconds-based task horizons resolved against control rate (#160)#162
Adityakk9031 wants to merge 1 commit into
robocurve:mainfrom
Adityakk9031:#160

Conversation

@Adityakk9031

Copy link
Copy Markdown
Contributor

Summary

Resolves #160 (and #161).

Task.max_steps was previously a fixed integer step budget set at task construction time. However, benchmark tasks defined in physical time (e.g. KitchenBench) allot per-task seconds (max_seconds). Because task factories behind string registries are zero-arg and Task is embodiment-agnostic, tasks had no way to resolve physical durations into step counts prior to pairing with an embodiment.

This PR adds support for declaring task horizons in physical seconds (Task(max_seconds=...)), which eval() resolves into integer step budgets (max_steps = math.ceil(max_seconds * control_hz)) after pairing with an embodiment.


Key Changes

  • inspect_robots.task.Task: Made max_steps: int | None = None optional and added max_seconds: float | None = None. Added __post_init__ validation enforcing mutual exclusion (exactly one of max_steps or max_seconds must be set) and positive numeric ranges. task.envelope raises ConfigError if called on an unresolved max_seconds task.
  • inspect_robots.compat: Added a preflight compatibility check (control_hz_missing error issue) ensuring embodiment.info.control_hz is present and $> 0$ whenever task.max_seconds is specified.
  • inspect_robots.eval: Computes max_steps = math.ceil(task.max_seconds * control_hz) at eval() time, passing the resolved integer budget to bind_task hooks and rollout().
  • inspect_robots.log: Added max_seconds: float | None = None to EvalSpec for reproducible log schema persistence.
  • tests/test_task_horizon.py: Added unit tests covering task horizon validation, preflight control_hz compatibility checks, fractional math.ceil resolution, and EvalLog persistence.

Verification

  • Unit Tests: Executed full test suite (pytest --cov). All 716 tests passed.
  • Coverage: 100% statement and branch coverage maintained across all core modules.
  • Linting & Types: Passed ruff check ., ruff format --check ., and mypy.

@Adityakk9031

Copy link
Copy Markdown
Contributor Author

@jeqcho have a look

@Adityakk9031
Adityakk9031 force-pushed the #160 branch 2 times, most recently from 5b21a7b to 10ebd03 Compare July 22, 2026 19:48
@Adityakk9031

Copy link
Copy Markdown
Contributor Author

@jeqcho all check pass

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.

[design] Seconds-based task horizons resolved against the embodiment's control rate at eval() time

1 participant