Skip to content

Improvement: Octatrack base rests machine modules no track uses - #1849

Merged
repeat98 merged 86 commits into
base/octatrack-nextfrom
improvement/octatrack-unused-module-cost
Nov 20, 2026
Merged

repeat98 merged 86 commits into
base/octatrack-nextfrom
improvement/octatrack-unused-module-cost

Conversation

@repeat98

@repeat98 repeat98 commented Nov 20, 2026 •

Copy link
Copy Markdown
Owner

For the owner

Tested on a unit: base a08a1557c5bd7d04b6b0615361f059ac99ba2bc40f8a7e3b86842db2ccbbb5bd, Octatrack MKII on OS 1.40C, 30-second stopped VECTOR Undo restored the starting inventory and set digest.

The matched pre-fix A/B on Part 4 measured +6.2 points of mean frame time for 24 portable packages on the control and +5.0 on the candidate. The same set with a private resting POLY8 measured +3.1. All 18 wake picks landed. The two uncaptured POLY8 wakes cost +2.6 and +2.7 points. The 24-package self-test passed. Keep the provisional 3% wake margin pending data near the 85% admission line. A/B and wake measurements

The original 30-second stopped VECTOR rollback failed on the MKII and required a power cycle. With this fix the matched development build passed the original sequence, a stopped repeat and a playback trial. A controller-enabled build and the exact release image also passed a stopped Undo. All 36 portable packages were subsequently measured individually on the controller-enabled build. Nine exceeded +0.2 points in their first paired readings. Seven exceeded +0.2 in the table using the warm E-Verb and matched-Part Kits and Tuner repeats. Kits changed playback from Part 4 to Part 1 and initially read +5.1 points. With both windows on Part 1 it measured −0.1. Tuner repeated at +0.2 on Part 4. SC Ringmod installed and rolled back normally. The record includes all ten assigned-FX readings, the empty controls, the repeat measurements and each build identity. Individual package costs and Undo

The initial 20-operations/s MIDI soak was interrupted by the owner at 86.1 s. The requested slower two-minute run completed 120 operations, with 16 observed pattern changes. Final checks matched the entry pattern and Part hashes, original flashed 0.7.9 base and ordered ten-module set. All device trials ran in RAM.

The set offer still covers 32 positions and the module pool is 768 KiB. These results cover the 36 portable releases on this scene. Base-bound packages require their matching release identity.

Goal (owner, 20 November 2026): an installed module that nothing uses should cost no CPU, so a large set costs only what is played.

What was wrong or hard

On an MKII (OS 1.40C, development twin of base 0.7.10 acc111da, bank A pattern A01 Part 1, seven FLEX tracks playing, no module assigned), the 24 packages of the 0.7.10 dispatch record added 6.1 points of frame interrupt while playing (56.6 % to 62.7 %) and took the longest frame from 94.9 % to 107.2 % of a frame. Package by package (device:price, playing):

Module Kind What runs in the frame while unused Points
POLY8 0.3.3 machine 3 handlers on hooks that rest, 11 frame-path detours 2.3
Repitch 0.2.1 playback policy ev_play_increment handler, 3 detours 1.4
Slow LFO 0.1.0 LFO setting 4 detours in the LFO engines 0.5
Mute Modes 0.2.2 mute policy ev_voice_bind handler, 5 detours 0.3
Track Solo 0.2.5 panel tool 2 detours at the frame's entry and exit 0.2
Tuner 0.1.0 panel tool 1 detour at the frame's exit 0.1
the other 18, Amiga and SYNTIZ included nothing in the frame 0.0

Those seven together cost 5.6 points; the other 17 together 0.1. No measurable part is base work that grows with the number of installed modules, and none is DSP: it is module code the frame interrupt enters while nothing uses the module. The ev_in_use resting contract has existed since 0.7.8, but no module answers it.

What this changes

  • The base answers ev_in_use for machines. The loader asks the machine (modwerk_machine_in_use) about a module that contributes to a table events.json marks judged (the Octatrack's ot_machines) and does not answer ev_in_use itself, and admits such a module's detours marked rests.

  • When a machine is in use: while a track of any Part of the project, working or saved, is that machine, from the machine map's scan (every 2 s, at once after a change). Pattern, Part and bank changes never need a wake. Its module rests after two idle scans in a row, never on a scan during a project load, and every machine stays awake for two scans after a set change (install, removal, Undo, a rolled-back trial). A RENDER_FLEX machine never rests.

  • Builder: a machine port carries its resting detours (machine_ports.declaration, build.py), so POLY8 0.3.4 (POLY8 0.3.4-experimental: rests while no track uses it (needs base 0.7.11) #1863) can mark them; the reviewed recipes re-pin the two files, and POLY8, VECTOR, FM Synth and Scale Quantizer rebuild byte for byte. The loader reports capability 2048 so such a package goes only to a base that judges machines.

  • Wake: a pick of a resting machine wakes its module before the pick commits (mw_assign runs the rest poll) and is judged with mw_wake_mille (30 per mille) on top of its price, for its hooks and detours coming back into the frame. A track that names a resting machine without a pick (a paste, a load) renders stock's silent source and starts no voice until the next UI tick wakes it.

  • Generated HOOKS.md, runtime_events.h and modwerk_events.h from events.json; the API and performance guides, the base README, a changelog entry and the verification record.

  • Regenerated on 0.7.11: this branch merged base/octatrack-next with the 0.7.11 fix (Fix: defer Octatrack DSP residency until project load completes #1826) and regenerated the base and the base-bound packages. Effect modules rest too (the registry asks fxmap.c and the live slots; modwerk_status_effect_busy wakes one before stock writes its pick), the builder takes a machine port's or an effect's "rests", and the loader reports capability 2048.

  • Track-machine Undo now reads its outgoing, owned stock-menu entries as restored and continues to check independently cached callbacks and working and saved Parts. The host regression covers the owned handler, a cached copy, an occupied Part and unreadable data.

How I checked it

  • Host: test_machine_registry.c (and test_machine_charge.c on it) and events_test.c at 32 and 128 modules; each fails with its new path removed. test_machine_events.py passed.
  • Hardware trials, wake and audio checks, soak and individual readings are documented against each image. MKII records

Edge cases

Case Why this change makes it a risk How run Result
Installed, used nowhere: rests the frame path must equal the one without the module host: two machines resting, eight FLEX renders straight to stock pass on the host and in the MKII comparison windows
A machine used only in another Part, another bank or a saved copy a pattern change while playing must not need a wake host: scans keep it awake pass (host)
Pick of a resting machine while playing the wake runs masked; one frame must not run long host: awake before the commit; unit: guard over the pick window, STATIC pick as control host passed, all 18 MKII picks landed with zero additional skipped renders
A paste or load onto a track of a resting machine stock would read its bytes as FLEX host: silent source, no START, awake next tick pass (host)
Busy unit, pick that wakes the meter does not hold the woken hooks host: refused at the line with the margin pass (host)
Last track leaves it should rest again, not stay awake host: rests two scans later pass (host)
A project load half-written banks must not rest a used machine host: no idle scans while loading pass (host)
Undo and a rolled-back trial over a resting and over a woken module a site restored while resting, a position switched loader host test, both host passed, MKII trial inventories and scene hashes restored
A machine registered late, a set change an old idle count must not rest the new set host: awake for two scans pass (host)
RENDER_FLEX machine it serves unowned FLEX tracks host: never rests pass (host)
Module answering ev_in_use itself, or neither its own answer must win; others never rest loader host test pass (host)
24-package set self-test, soak, USB capture across a wake MKII self-test and matched capture pairs, then slower MIDI soak on controller-enabled build self-test passed, Main continuous in the six captures, slower soak passed

Owner decisions

  1. POLY8's detours. This change rests POLY8's handlers but not its 11 frame-path detours: those need "rests" in its port entry, a POLY8 release (you are its author), plus two build-side lines (build.py's machine path and machine_ports.declaration pass rests through). Those lines invalidate every reviewed machine recipe, so they belong in that release's pull request with the recaptured recipes. A development POLY8 0.3.3 with the 11 marked was built for the unit run. Recommendation: yes, as the next POLY8 release.
  2. The five non-machine modules (Repitch, Slow LFO, Mute Modes, Track Solo, Tuner: 2.5 of the 6.1 points) cannot be judged by the base. Each needs its own ev_in_use answer and "rests" on its frame detours, a release by each author. Recommendation: ask them, and make module:doctor fail a module whose at-rest frame figure (evidence/cpu-price.json, atRestAdds.frame) is above 0.2 points unless it answers ev_in_use or is a machine, for modules listed from a date you set; 17 of the 24 read 0.0 to 0.1.
  3. mw_wake_mille = 30 per mille (POLY8 measured 2.3 frame, 2.6 meter points at rest). A per-machine figure would need a descriptor field.

Guides: OCTATRACK_API.md and MODULE_PERFORMANCE.md said a module that does not subscribe never rests; both now say machines rest without an answer and what other modules must do. HOOKS.md (generated) and the base README describe it. The test procedure's step 9 measures exactly the at-rest figure in the table above.

ZOGV and others added 21 commits November 14, 2026 16:13
…in SETTINGS, off at power-on)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ch and locks saved in the project, pastes never overwrite the bank

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…S, message after the reselection, captures and tests refreshed

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…a Digitone, OS 1.44), XX07 emulator checks

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…e OS 1.44 package

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…oader:update --overlay)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… system category, PTN+YES in chains, one build's evidence)

- kb_projsave rewrites only the KBLK record of the header's ELKP list and keeps
  every other tool's record; kb_projload finds KBLK anywhere in the list.
- PTN+YES hands no trig when a trig was already pressed under the same PTN, so
  a chain built with PTN+trigs is not changed.
- category system; key:PTN+YES claimed; README stock-flow entries and the three
  project save/load sites in Compatibility; TESTING.md and the captures describe
  the submitted build (XX08), captures redone with digiemu c1b5735.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The loader asks the machine whether a module it judges (a contributor to
ot_machines without its own ev_in_use) is in use. The registry answers from
the machine map scan of every Part of the project, working and saved: a
machine nobody plays rests after two idle scans, its handlers leave the
resting hooks and its detours marked rests hold stock bytes. A pick wakes it
before it commits and is judged with its hooks back on top; a track that
names a resting machine renders silence until the next UI tick wakes it.

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

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

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

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…oes only to a base that judges machines

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

machine_ports.declaration passes rests from the runtime.json and the port, build.py flags them on a machine package and accepts them for a judged contributor. The reviewed recipes re-pin the two builder files; POLY8, VECTOR, FM Synth and Scale Quantizer rebuild byte for byte.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
repeat98 and others added 2 commits November 20, 2026 13:52
…s them before it is written

The loader asks the machine about a module with DSP code and no ev_in_use. The registry answers from fxmap.c (every bank Part) and the live slots; modwerk_status_effect_busy judges a pick with the wake margin and wakes the module before stock writes it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
….json with rests), since the base judges effects

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
repeat98 and others added 3 commits November 20, 2026 13:59
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The unit queue (20 November 2026) was only in the driving guide and the test-on-unit skill, so sessions that read
AGENTS.md alone still asked whether the unit was free or stopped another session's link. Room made in the same file
without dropping a rule.

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

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

# Conflicts:
#	docs/README.md
repeat98 and others added 24 commits November 20, 2026 18:30
Publish 28 MultiStomp effects for the Zoom MS-70CDR
Docs: point the cycle scan's README at upstream's COSTS.md
…8 (6c94a77e, about 10 minutes, step by step), source identity for the submitted source

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Fix: npm run check names an old Python instead of crashing in the module gates
digitone/kitbank 0.2.0-experimental: one kit per bank
Fix: compare machine CPU prices with measured mean frame cost
@repeat98
repeat98 marked this pull request as ready for review November 20, 2026 19:38
@repeat98
repeat98 merged commit 6e58554 into base/octatrack-next Nov 20, 2026
26 of 28 checks passed
twwwy added a commit to twwwy/modwerk-beat_slicer that referenced this pull request Nov 20, 2026
… 0.7.11 rebuilt

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
twwwy added a commit to twwwy/modwerk-beat_slicer that referenced this pull request Nov 20, 2026
… 0.7.11 rebuilt

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants