You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
perf(autoresearch): replace sleep-based reset waits with spin-poll validation #2265
The autoresearch tool currently uses fixed sleep(3.0) calls after device reset and between phases. These should be replaced with fast spin-polls that check for specific validation signals and break early.
Current behavior
# After DTR resetawaitasyncio.sleep(3.0) # Wait for device to reboot# After pin discovery awaitasyncio.sleep(2.0) # Wait for RPC to become available# Boot drainawaitasyncio.sleep(boot_wait) # Fixed 3s wait
Proposed behavior
Replace sleeps with poll loops that check for expected output:
# Instead of sleep(3.0), poll for boot signaturedeadline=time.time() +5.0# max timeoutwhiletime.time() <deadline:
lines=awaitread_lines(timeout=0.1)
ifany("entry 0x"inlineor"RESULT:"inlineforlineinlines):
break# Device is booted, proceed immediatelyawaitasyncio.sleep(0.05) # 50ms spin
Benefits
Fast devices (ESP32-S3 with USB-CDC) could be ready in <500ms instead of waiting 3s
Slow devices still work via the max timeout
Each phase exits as soon as validation passes, not after a fixed delay
Total autoresearch cycle time could drop significantly
Activity
perf(autoresearch): spin-poll for boot/reset signals instead of fixed…
perf(autoresearch): spin-poll for boot/reset signals instead of fixed…