Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
a9107fd
initial commit
ruthwikdasyam Mar 31, 2026
1905ef0
program md + precommit fixes
ruthwikdasyam Apr 11, 2026
90017f8
Merge branch 'dev' into ruthwik/autoresearch
ruthwikdasyam Apr 14, 2026
572ea01
feat(replay): add --exit-on-eof + fix --viewer=none import order
ruthwikdasyam Apr 14, 2026
46e654d
chore(autoresearch): scaffold harness on flat layout, drop legacy go2…
ruthwikdasyam Apr 14, 2026
55f3b40
docs(autoresearch): clarify stop_timer patch reference, drop stale link
ruthwikdasyam Apr 14, 2026
d7a0cd8
refactor(autoresearch): target unitree-go2-basic, use test-venv, +exi…
ruthwikdasyam Apr 14, 2026
73ded96
fix(autoresearch): raise DEFAULT_TIMEOUT to 300s (full replay ~4min)
ruthwikdasyam Apr 14, 2026
99f5674
feat(autoresearch): expand optimizations.py to a structured knob menu
ruthwikdasyam Apr 14, 2026
4ae3692
fix - unwanted + fixes
ruthwikdasyam Apr 14, 2026
1cbc1d6
feat(autoresearch): add multi-score metrics (TTFM, ctx switches) and …
ruthwikdasyam Apr 14, 2026
d6ed6cd
knob7=skip_websocket score=14.94 ttfm=34.35
ruthwikdasyam Apr 14, 2026
b721b1d
fix: eval.py cli_args insertion (use 'run' anchor)
ruthwikdasyam Apr 14, 2026
bde92d5
knob4=n_workers=2 score=15.06 rss=1141 ctx=7340
ruthwikdasyam Apr 14, 2026
82a51c8
knob4=n_workers=1 score=14.85 rss=1062 ctx=4313
ruthwikdasyam Apr 14, 2026
1ffc7cf
knob9=lazy_asyncio score=14.93 threads=152
ruthwikdasyam Apr 14, 2026
da11b85
knob6=log_warning score=14.80
ruthwikdasyam Apr 14, 2026
4ea5a09
knob5=blas_pin score=12.44 threads=66
ruthwikdasyam Apr 14, 2026
6c3ca6e
knob1=lcm_500ms score=12.01
ruthwikdasyam Apr 14, 2026
2e881ce
knob3=cam_info_once score=12.17 threads=65
ruthwikdasyam Apr 14, 2026
220a629
knob11=skip_tf score=11.22
ruthwikdasyam Apr 14, 2026
2c78078
knob12=skip_sensor_publish score=5.76
ruthwikdasyam Apr 14, 2026
806ee63
knob12+=skip_odom_publish score=5.57
ruthwikdasyam Apr 14, 2026
93e7a99
knob13=skip_robot_init score=5.61
ruthwikdasyam Apr 14, 2026
81baa8b
knob14=replay_speed_10x score=3.05 real=38s
ruthwikdasyam Apr 14, 2026
128b2f3
knob14=replay_speed_100x score=2.83 real=13s
ruthwikdasyam Apr 14, 2026
db2b95b
disable_lcm_knob rss=1021 (-50MB)
ruthwikdasyam Apr 14, 2026
869589e
lazy rerun import in connection.py
ruthwikdasyam Apr 14, 2026
1e97414
fix: validation checks exit code
ruthwikdasyam Apr 14, 2026
0ce9ab4
inline camera_info publish when once
ruthwikdasyam Apr 14, 2026
7d71671
lazy-load open3d (import 2.9s→1.5s)
ruthwikdasyam Apr 14, 2026
efa926b
skip websocket_vis import when env flag set score=2.58
ruthwikdasyam Apr 14, 2026
f19fd5e
defer matplotlib import in OccupancyGrid score=2.54
ruthwikdasyam Apr 14, 2026
ce2bfe0
lazy rerun import in Image threads=41 rss=977
ruthwikdasyam Apr 14, 2026
6a4ef23
skip cmd_vel sub score=2.54 threads=37
ruthwikdasyam Apr 14, 2026
ded2390
disable GC score=2.27
ruthwikdasyam Apr 14, 2026
997770f
speed=1000 real=11s
ruthwikdasyam Apr 14, 2026
17c837e
replay-only mode skip webrtc imports score=2.05 rss=883
ruthwikdasyam Apr 14, 2026
4834a26
conditional ClockSync import
ruthwikdasyam Apr 14, 2026
4844c71
camera_info=skip threads=37
ruthwikdasyam Apr 14, 2026
77bd7de
noop odom sub when skip_tf+skip_publish
ruthwikdasyam Apr 14, 2026
0b55009
docs: final results summary
ruthwikdasyam Apr 14, 2026
22022f0
defer ModuleCoordinator import via TYPE_CHECKING
ruthwikdasyam Apr 14, 2026
2faea3c
comment: add CRITICAL log level option
ruthwikdasyam Apr 14, 2026
e95aa26
MALLOC_ARENA_MAX=1 rss=864
ruthwikdasyam Apr 14, 2026
a5f9ec2
conditional pSHMTransport import (mac only)
ruthwikdasyam Apr 14, 2026
07fc687
defer Image import in blueprint
ruthwikdasyam Apr 14, 2026
e9e5c6e
fix: optimizing for unitree-go2 blueprint
ruthwikdasyam Apr 14, 2026
a000961
data: logs commit
ruthwikdasyam Apr 15, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions autoresearch/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# transient per-run stdout (overwritten each run)
# results.txt

# legacy per-run result files (superseded by results.jsonl)
# results/

# regenerated monkeypatch scaffolding
# _patches/
_startup_patch.py

# generated profiling artifacts
profile.svg
profile.prof
profile_output.txt
84 changes: 84 additions & 0 deletions autoresearch/GUIDELINES.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
# Autoresearch Guidelines

## Scope

Autoresearch targets **current dev**
env-var names, `pip install -e .` between refs, version sniffing). That file
benchmarks across history; the autoresearch harness optimizes current HEAD.

## Environment

- **Always use `test-venv`, never `.venv`** for running, installing, or
profiling anything under `myprojects/autoresearch/`. Applies to every shell
command (`uv run`, `pip install`, `python`, `py-spy`, etc.) and every
subprocess spawned by the harness.
- Activate explicitly: `source test-venv/bin/activate`, or invoke directly:
`test-venv/bin/python …`.
- Harness subprocesses (e.g. `eval.py` → `dimos …`) must resolve to
`test-venv` — set `VIRTUAL_ENV=test-venv` / prepend `test-venv/bin` to
`PATH` in the env passed to `subprocess.Popen`. Don't rely on caller's
ambient activation.

## Current DimOS hooks for autoresearch

State as of this doc — update if DimOS adds/renames flags.

- **`--exit-on-eof`** ([dimos/core/global_config.py](dimos/core/global_config.py)):
replay streams run once and signal shutdown at EOF instead of looping.
Wired via `GlobalConfig.exit_on_eof` → `ReplayConnection(..., exit_on_eof=...)`
→ `stream(loop=False)`. `GO2Connection.start()` subscribes to all three
replay streams' `on_completed` and, when all complete, sends `SIGINT` to
`DIMOS_MAIN_PID` to break `coordinator.loop()`. **Use this — it's what
makes benches fixed-work instead of timeout-killed.**

- **`--viewer=none`**: the rerun/foxglove workaround in `perf_bench.py`
(forcing via `VIEWER` / `VIEWER_BACKEND` env vars) is **no longer needed**.
The CLI flag works correctly — CLI applies `cli_config_overrides` to
`global_config` *before* importing blueprints, so the top-level
`if global_config.viewer == …` branch in `unitree_go2_basic.py` sees the
override. `RerunBridgeModule` is not deployed when `viewer=none`.

- **`DIMOS_MAIN_PID`** env var: set by `dimos run` CLI to its own PID. Worker
processes use this to signal the coordinator for graceful shutdown (survives
forkserver/multi-level fork layers where `getppid()` would be wrong).

## Canonical benchmark invocation

```bash
test-venv/bin/dimos --replay --viewer=none --exit-on-eof \
--replay-dir=unitree_go2_bigoffice \
run unitree-go2-basic
```

Target the **basic** blueprint (`unitree-go2-basic`), not the smart one
(`unitree-go2`). The smart blueprint adds VoxelGridMapper, CostMapper,
ReplanningAStarPlanner, WavefrontFrontierExplorer, PatrollingModule — each
adds CPU noise unrelated to the replay pipeline we're optimizing, and
PatrollingModule also has a graceful-stop bug that inflates shutdown wall
time by 5s. Basic is the minimum that exercises the LCM / RPC / replay
stack.

This runs one full replay pass and exits cleanly with `user+sys` reflecting
CPU-per-fixed-workload rather than CPU-per-wall-second.

## Known rough edges (as of current dev)

- `stop_timer` attribute error on `ReplayConnection.stop()` — patched via
a no-op `stop()` override at
[dimos/robot/unitree/go2/connection.py:142](dimos/robot/unitree/go2/connection.py#L142).
If the error reappears in a run log, that patch was reverted.

## What's still missing for a real autoresearch harness

In priority order:

1. Pipeline recorder + `baseline_record.json` diff → real validation
(currently stubbed `PASS`).
2. `py-spy record` integration (replace `run_profile()` placeholder).
4. Promote monkeypatched knobs (`lcm_loop_timeout_ms`,
`rpc_thread_pool_max_workers`, `camera_info_publish_hz`) to
`GlobalConfig` fields so optimizations become declarative config instead
of `sitecustomize.py` injection.

`--exit-on-eof` (#1 prerequisite for any of the above being meaningful) is
now done.
2 changes: 2 additions & 0 deletions autoresearch/_patches/sitecustomize.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
import dimos.protocol.service.lcmservice as _lcm_mod
_lcm_mod._LCM_LOOP_TIMEOUT = 500
Loading