Skip to content

Improvement: Octatrack base 0.7.8, a module that no track uses rests - #1694

Closed
repeat98 wants to merge 12 commits into
mainfrom
base/modules-off-until-used
Closed

repeat98 wants to merge 12 commits into
mainfrom
base/modules-off-until-used

Conversation

@repeat98

@repeat98 repeat98 commented Nov 17, 2026 •

Copy link
Copy Markdown
Owner

Octatrack base 0.7.8: a module that no track uses rests, and costs the frame interrupt next to nothing

What changed

  • New hook ev_in_use (index 53, claimed on the agent board). The base's UI tick asks each module that subscribes whether it acts on a track now. While it answers 0 the module rests: the loader leaves its handlers out of the per-frame hooks marked rests (ev_play_increment, ev_voice_bind, ev_voice_bind_run, ev_tail_kill). Its other hooks, tables and setup UI stay. A module that does not subscribe never rests. Installing, replacing or removing a module wakes its position.
  • A resting module's own detours go back to stock. "rests": ["0x…"] in a module's runtime.json names its own detours. The builder sets bit 7 of those sites' length byte (RUNTIME_SITE_RESTS), only on a hashed site of a module that subscribes ev_in_use; an older base reads such a length as malformed and refuses the package. When the rest poll changes a module's state it writes those sites masked, together with the rows: stock's bytes while it rests, its patch when it wakes. A wake waits while a paused task would resume inside such a site past its first byte. The site checks (switch, self-test intact/broken, journal) expect stock's bytes in a resting module's resting sites.
  • Where. sdk/runtime/loader/loader.c/loader.h, sdk/runtime/loader/build.py, verify_static.py, src/engine/elekloader/module-set.ts (reads the length without the flag), sdk/machines/octatrack/events.json/events.py and the generated files. The reviewed recipes and base sources re-pin build.py and verify_static.py, as Improvement: Octatrack base 0.7.5 never removes a module whose window is open, and drops the stock-run scans #1475 did.
  • Base 0.7.8 regenerated; the base-bound packages name it (Sidechain's lagging row by hand).
  • No module adopts it in this pull request. Repitch 0.2.2 will be the first, in its own release after this base is live: its ev_in_use answer and "rests" on rate_gate and pitch_gate. tstr_resolve stays patched, because it keeps stock's voice renderer away from TSTR 4, a value only Repitch adds.

Evidence

  • Host tests.
    • sdk/runtime/loader/tests/events_test.c covers resting rows. It also covers resting sites: stock while resting, patch on wake, the wake waiting under a paused task, a site someone else wrote, removal while resting, an unflagged site and a flag without ev_in_use refused. The site tests were checked to fail when the resting write is broken on purpose.
    • test_runtime_loader.py covers the builder's rests declaration and the flag.
    • module-set.test.ts passes.
  • On a unit. The owner's MKII on 17 November 2026, with development twins of this branch RAM-booted (f24d6e97: rows only; 98637a13: rows and sites). The scene was bank C pattern C01 with three static loops sounding, measured with npm run device:price, two alternating runs each. Every trial rolled back and nothing was kept.
    • A test module whose ev_play_increment handler spends 400 loop passes cost +12.5 frame points on no track, and +1.0 when it answered ev_in_use 0.
    • Repitch on no track (TSTR OFF where a loop carries REPITCH; increments read at unity): 0.2.0 +1.2 / +1.2, 0.2.1 +0.8 / +0.8, and 0.2.1 answering ev_in_use with rate_gate and pitch_gate resting +0.1 / +0.1.
    • Waking and resting while the pattern played, read over USB during the trial. At rest both sites held stock's bytes and T2's increment was unity. With T2 switched to TSTR AUTO, both sites were patched again and T2's increment was scaled (0x04199999) by the next read. With T2 back to OFF, both sites were stock again 1.5 s later. No stall record and no crash; frame gaps on time.

Tested on a unit: base 8d1db124 (this exact release build, RAM-booted), the owner's MKII, 17 November 2026. Every trial was a set trial without Keep.

  • Trial A, 20 modules: Kits, MIDI Scenes, Amiga, Sidechain, Output Matrix, POLY8, Tape Echo, Euclid, Mini Verb, E-Verb, BBD, TapeHead, LoFi 2, VECTOR, Slow LFO, Apply Scene, Mute Modes, Tuner, FM Synth, and Repitch with ev_in_use and resting detours.
    • The self-test passed before and after the owner played bank A pattern 1 with a Part switch: 20/20 intact, the 7 effects together, longest frame 407 and 395 µs.
    • The unit's log shows one frame-guard skip of one render on T3, at CPU 70.5 %. No stall, no crash. The 5-minute window had a CPU mean of 40 %, a longest frame gap of 430 µs, and one UI-tick gap of 1.3 s during the install.
    • The trial rolled back cleanly.
  • Trial B, 13 modules: Analog BD (admitted through this base's trust rows) with Kits, MIDI Scenes, Amiga, POLY8, Air Chorus, E-Verb, Mini Verb, BBD, Tape Echo, Euclid, Slow LFO and Repitch.
    • The self-test passed before and after the owner's play-through: 13/13 intact, 6 effects together, longest frame 389 and 390 µs. No new incident.
    • The rollback stopped at "needs-recovery" with Analog BD, Kits, MIDI Scenes and Amiga still installed. The project still names them, which is the documented "machine still named by tracks" case; the owner power-cycles.

Not tested

  • The USB base update from 0.7.7 to 0.7.8, and a power cycle with a kept set on 0.7.8.
  • The self-test or a power cycle with a module actually resting on the release build. In these scenes Repitch acted on two tracks, because the project's loops carry REPITCH, so it stayed awake. Resting and waking were proven on the development twin 98637a13.
  • How a waking track sounds in the tick before its module wakes, and a Part or bank change that brings a module's track in while playing.
  • Whether the single T3 skip is 0.7.8's doing: it was not compared with 0.7.7 under the same set.

What the guides lacked

Guides: sdk/machines/octatrack/HOOKS.md and docs/MODULE_PERFORMANCE.md now describe resting and "rests", including the rule that a detour guarding stock from a module-only value must stay patched. The performance guide also says to check that a module acts on no track before pricing it at rest: in the owner's project two loops carry REPITCH as their own TIMESTRETCH, so every "at rest" Repitch reading that day was first taken with Repitch at work.

🤖 Generated with Claude Code

repeat98 and others added 12 commits November 14, 2026 15:47
…ooks

A module that subscribes the new ev_in_use (hook 38, asked by the base from the
UI tick, each module on its own) and answers 0 is left out of the rows of the
events marked "rests" in events.json (ev_play_increment, ev_voice_bind,
ev_voice_bind_run, ev_tail_kill), so the frame interrupt never enters its code
there; its other hooks, tables and setup UI stay. The loader keeps a resting
and an asking bit per position; a switch wakes its position, and
modwerk_runtime_rest_poll restages and commits the rows only when an answer
changed, under the lock, fenced against a paused task inside the dispatch and
written masked, as a switch is. Modules that do not subscribe never rest.

Host tests only; no base regeneration (the base-identity pins are stale until
the owner rebuilds the base from a stock OS file).

Co-Authored-By: Claude <noreply@anthropic.com>
Main took hooks 38-52 for project, bank and Part events (#1564). The generator keeps both
new kinds: hooks the base raises itself, and ev_in_use, which the base asks each module.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ckages name it

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…e's own detours

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… rests

A runtime.json may name the module's own detours under "rests". The builder sets bit 7 of
those sites' length byte (loader.h RUNTIME_SITE_RESTS), only for a hashed site of a module
that subscribes ev_in_use; an older base reads the length as malformed and refuses it.
When the rest poll changes a module's state it writes those sites masked, with its rows:
stock's bytes while it rests, its patch when it wakes. A wake waits while a paused task
would resume inside such a site past its first byte; the site checks (switch, intact,
broken, journal) expect stock's bytes in a resting module's resting sites. The reviewed
recipes re-pin build.py and verify_static.py.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ges name it

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ack before an at-rest price

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added the enhancement New feature or request label Nov 17, 2026
@repeat98
repeat98 marked this pull request as draft November 17, 2026 18:18
repeat98 added a commit that referenced this pull request Nov 17, 2026
…il its exact build ran on a unit (#1697)

* Improvement: a change to what runs on an instrument stays a draft until its exact build ran on a unit

pr:ready says Ready to open as a draft when a branch changes a .mwrm package or .elemod base, and
CI's description check refuses a ready pull request of that kind unless a line names the build
that ran (Tested on a unit: … with its hash) or says plainly that it was not tested. Drafts pass.
The check also runs when a pull request is marked ready or turned back into a draft. Base 0.7.8
(#1694) went up ready to merge after only development twins had run.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* AGENTS.md: the draft rule within the word budget

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
@repeat98

Copy link
Copy Markdown
Owner Author

Folded into #1745, the single Octatrack base 0.7.9 release that merges every open base change, so the base is rebuilt and tested once. This branch is merged into it unchanged. Closing in favour of #1745.

@repeat98 repeat98 closed this Nov 18, 2026
repeat98 added a commit that referenced this pull request Nov 18, 2026
Octatrack base 0.7.9: Part Edit menu, resting modules, kept effects after a power cycle, status word, CPU in the pick box (folds #1678 #1694 #1610 #1742 #1711)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant