Add tiptop-rerun CLI and extract run_tiptop - #16
Conversation
Extract run_tiptop() as a general-purpose function that takes an Observation and runs perception + planning, making it reusable beyond H5 files. Add tiptop_rerun.py which loads observations from saved run directories and feeds them into run_tiptop, with planning parameters defaulting to the original run's cuTAMP config. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Both viz_tiptop_run and tiptop_rerun load from a previous run directory, so use run_dir consistently instead of save_dir. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add command reference documentation for the new tiptop-rerun CLI. Update viz-tiptop-run docs to reflect the save-dir → run-dir rename for consistency. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Both share run_tiptop() and only differ in how they load the observation. Merging them into a single module reduces duplication and keeps all offline (no real robot) pipeline code together. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Both tiptop-h5 and tiptop-rerun now default to tiptop_offline_outputs/. Simplify gitignore with tiptop_*_outputs/ glob to cover all variants. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
More realistic to show rerunning from a live robot run directory. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Follows the run_tiptop / run_tiptop_h5 / run_tiptop_rerun naming pattern. Also fixes stale tiptop_rerun_outputs default that was missed earlier. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
That's what TiPToP is — no need to spell it out every time. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
d21c978 to
28ca5fd
Compare
The module has two entrypoints (h5, rerun) — picking one for __main__ is misleading. Use the CLI commands instead. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Simplify tiptop_offline.py by removing unnecessary section divider comments and inlining the 3-line _load_cutamp_config helper into its sole caller. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
This PR consolidates TiPToP’s offline execution paths by extracting a reusable run_tiptop() pipeline function and adding a new tiptop-rerun CLI to re-run from previously saved run directories.
Changes:
- Added
tiptop/tiptop_offline.pywithrun_tiptop(), plustiptop-h5and newtiptop-rerunCLI entrypoints. - Removed the old
tiptop/tiptop_h5.pyimplementation and rewired entrypoints/tests to the new module. - Updated run visualization CLI/docs to use
run_dirnaming and documented the newtiptop-reruncommand.
Reviewed changes
Copilot reviewed 6 out of 7 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| tiptop/tiptop_offline.py | New shared offline pipeline + H5 loader + rerun loader/CLI entrypoints |
| tiptop/tiptop_h5.py | Deleted legacy H5-only runner in favor of consolidated offline module |
| tiptop/scripts/viz_tiptop_run.py | Renamed CLI arg to run_dir and made point cloud logging static |
| tests/test_tiptop_h5.py | Updated import path for run_tiptop_h5 |
| pyproject.toml | Added tiptop-rerun entrypoint and repointed tiptop-h5 to new module |
| docs/command-reference.md | Updated tiptop-h5 defaults and added tiptop-rerun docs + run_dir rename |
| .gitignore | Generalized ignore pattern for tiptop_*_outputs/ |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Replace asserts in run_tiptop() with explicit ValueError so validation survives python -O - Fix H5 loader docstring: pi-sim-evals -> droid-sim-evals to match the rest of the docs - run_tiptop_rerun now loads the saved tiptop.yml from the run directory via new set_tiptop_cfg_from_file() helper, so downstream tiptop_cfg() consumers see the original run's robot/perception settings instead of drifting with the local config
Older runs (or runs where planning failed before the config was written) may not have a cutamp/config.yml. Instead of hard-failing, run_tiptop_rerun now warns and uses the same defaults as tiptop-h5. Defaults are lifted into module-level constants so both entrypoints share a single source of truth.
- Split offline output dirs per command: tiptop-h5 -> tiptop_h5_outputs, tiptop-rerun -> tiptop_rerun_outputs. Both still covered by the tiptop_*_outputs/ gitignore glob. Easier to tell at a glance which command produced which run. - Drop DEFAULT_* module-level constants; inline 60.0/500/256 in run_tiptop_h5 signature and in the rerun fallback with a comment pointing at tiptop-h5 as the source of truth. Matches the magic-number pattern used in tiptop_run.py. - Make console and file log levels separable: setup_logging now pins its stdout handler to the requested level explicitly, and add_file_handler lowers the root logger when the file handler is more verbose. Net for tiptop-h5 / tiptop-rerun: console stays at INFO, the run log captures DEBUG detail for post-mortem.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 8 out of 9 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Split logging responsibilities cleanly: `setup_logging()` + banner are now called once per entrypoint (`h5_entrypoint`, `rerun_entrypoint`) with `root_level=DEBUG` so the later-added file handler captures debug, while the stdout handler stays at INFO. `add_file_handler` / `remove_file_handler` are back to simple add/remove pairs with no root-level juggling. `save_run_outputs` now writes the effective merged OmegaConf to `run_dir/tiptop.yml` instead of copying the file on disk, so CLI overrides are captured and reproducible via `tiptop-rerun`. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Drop the `root_level` parameter. Root is pinned at DEBUG so later-added handlers (per-run file handler) can filter at their own level — the standard Python logging idiom per the cookbook. `level` only controls the stdout console handler, which is what callers actually care about. Net effect across call sites: - `tiptop-h5` / `tiptop-rerun`: console=INFO, file=DEBUG (unchanged) - `tiptop_run`: setup_logging(DEBUG) → console=DEBUG, file=DEBUG (unchanged) - `tiptop_websocket_server`: setup_logging() → console=INFO, file now correctly captures DEBUG (was silently dropped before) - All script entrypoints: identical console output (no file handler) Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
…ents `tiptop_cfg()` and `set_tiptop_cfg_from_file()` now stash the source path alongside the cached config, exposed via `get_tiptop_cfg_path()`. `save_run_outputs` uses `shutil.copy2` on that cached path so: - Comments and formatting in `tiptop.yml` are preserved in the run dir. - Rerun-of-a-rerun chains forward the original source file correctly (previously the hardcoded `tiptop_config_path` would always copy the repo default, masking the actual config used). Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Keep `_cached_cfg` and `_cached_cfg_path` in sync via a single `_load_and_cache()` helper so both globals can only be set together. `tiptop_cfg()` and `set_tiptop_cfg_from_file()` become thin wrappers. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Only referenced inside config/__init__.py now — callers go through get_tiptop_cfg_path(), which respects set_tiptop_cfg_from_file() overrides. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Only one reference now — no reason to keep a module-level variable. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Drop the private `_load_and_cache` helper; `set_tiptop_cfg_from_file` is the cache mutator, and `tiptop_cfg` delegates to it for the default path. One function, not two, does the work. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 10 out of 11 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
All entrypoints use tyro; no one feeds CLI args into OmegaConf, so the merge was a no-op. Removing it makes the loader's behaviour honest and confirms the cached cfg always equals the source file. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 10 out of 11 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Document all changes since v0.1.0, including the breaking CLI/API changes (viz-tiptop-run --save-dir -> --run-dir, tiptop_cfg() dropping force_reload and OmegaConf.from_cli) and the new tiptop-rerun CLI. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…released Address PR #16 feedback on changelog hygiene: - Convert #NN references to reference-style links that work in rendered md - Collect the two breaks into a dedicated Breaking Changes section - Set the release date instead of "Unreleased" (tagged on merge) - Verified coverage of all PRs since v0.1.0 (#14, #19, #20, #21, #23, #26, #27) Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Summary
tiptop-rerunCLI re-runs TiPToP from a saved run directory (rgb, depth, intrinsics, metadata, gripper mask). Task instruction and planning params (num_particles,max_planning_time,opt_steps_per_skeleton) default to the original run's values but can be overridden via flags.run_tiptop()fromtiptop_h5.pyinto a newtiptop/tiptop_offline.pymodule that takes anObservationand runs perception + planning.run_tiptop_h5is now a thin wrapper, andrun_tiptop_rerunreuses the same core. Split offline output dirs per command (tiptop_h5_outputs/,tiptop_rerun_outputs/).save_dir→run_dirinviz-tiptop-runfor consistency with the new CLI.tiptop.yml(viashutil.copy2, preserving comments) into each run dir for reproducibility, and havetiptop-rerunload it via a newset_tiptop_cfg_from_file()helper so downstream consumers see the original run's values. Falls back to the current config / built-in cuTAMP defaults with a warning when saved files are missing.tiptop-h5/tiptop-rerun.assertwithraise ValueErrorinrun_tiptop()so input checks survivepython -O.Test plan
pixi run test-integrationpasses on the rebased branchtiptop_offline.py,config/__init__.py,utils.pyrun_dir/tiptop.ymlandrun_dir/cutamp/config.ymlpresent🤖 Generated with Claude Code