Skip to content

Examples on the new multimer; the REPL proofs and the timing benchmarks - #149

Merged
bdbarnett merged 7 commits into
mainfrom
timing-redesign
Sep 26, 2026
Merged

bdbarnett merged 7 commits into
mainfrom
timing-redesign

Conversation

@bdbarnett

@bdbarnett bdbarnett commented Sep 26, 2026 •

Copy link
Copy Markdown
Collaborator

Every example on the new multimer API (no timer_async, no AsyncTimer, from multimer import auto as timer becomes import multimer), lv_timer_test_kit.py with one mode, and prove_hostloop on the one-timer model. New under tools/:

  • prove_repl/: the REPL goal as a check that can fail. prove.py runs each interpreter's -i on a real pty, types statements, and checks the tick count grew and report() answered; --planted-fault (no wake source, input hook off) must fail. prove_jupyter.py and wasm_host.mjs do the same where there is no prompt. prove_windows.py runs the same three checks under a Windows pseudo console (ConPTY), where the REPL goal on python.exe and micropython.exe is decided.
  • timing_bench/: bench_timer.py (jitter, callback latency, CPU, idle and busy main thread) and lv_pace.py (frame pacing), old layer against new, same script, with the raw .jsonl results behind the design doc's tables.

Needs PyDevices/pydevices#101 (and PyDevices/lvgl-bindings#22 for the LVGL examples). Design: docs/timing-design.md in pydevices. Companion: PyDevices/micropython-pydevices#24. Draft until the hardware phases are in the ledger.

bdbarnett and others added 3 commits September 26, 2026 01:35
app.every() loses async_=; from multimer import auto as timer becomes
import multimer; lv_test_timer reports the wake source instead of a mode.
tools/prove_repl proves the REPL goal on a pty for CPython, MicroPython
and (with multimer.repl()) CircuitPython, plus a Jupyter kernel and the
direct wasm build under node. The kit's PYDEVICES_TIMER_ASYNC split is
retired.
…esign doc, with the cloud session's raw results
… are kept; bench lateness on multimer's clock

CreateProcess duplicates a parent's redirected std handles into the
child unless STARTF_USESTDHANDLES is set, so a child launched from a WSL
shell never saw the pseudo console; with the flag and null handles it
does, as node-pty does. The console keeps a program's last lines in its
pipe until it is closed, so wait() now closes and drains before the
transcript is read, or keepalive and crash checks fail on a truncated
transcript with the right exit code.

bench_timer measures lateness on multimer's own clock: time.ticks_ms and
multimer.ticks_ms need not share a base (they do not on the windows
port).
@bdbarnett
bdbarnett marked this pull request as ready for review September 26, 2026 11:17
@bdbarnett
bdbarnett merged commit e6514b2 into main Sep 26, 2026
4 checks passed
@bdbarnett
bdbarnett deleted the timing-redesign branch September 26, 2026 11:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant