Skip to content

Octatrack base 0.8.5: IN USE, where a sync would be refused as in use, before it is sent - #2463

Merged
repeat98 merged 9 commits into
base/octatrack-nextfrom
base/octatrack-in-use-query
Nov 30, 2026
Merged

repeat98 merged 9 commits into
base/octatrack-nextfrom
base/octatrack-in-use-query

Conversation

@repeat98

Copy link
Copy Markdown
Owner
  • What was wrong or hard: 83 USB syncs on 42 units (31 Oct–30 Nov 2026) were refused because a track was using a module the sync changes or removes. The site could only explain the refusal afterwards, and people retried while hunting for the track.

  • What this changes:

    • New read-only request IN USE (vendor IN, bRequest 44, feature bit 14). For an installed module and "removed" or "updated in place", the base answers where it is held: effect slots (track, FX1/FX2) in the current Part, the Parts (working or saved copy, track) of a machine being removed, an open page, or a hold without a place.
    • Same checks as the refusal: it calls the refusal's own checks, now shared functions (modwerk_dsp_in_use, machine_contributor_held, machine_part_signature_where, table_metadata_held, modwerk_controller_in_use, ui_open, modwerk_machine_holds), so it cannot disagree with a refusal.
    • Engine task only: the answer is computed on the engine task under the level-4 lock. It is BUSY during any transaction, trial, journal or restore, and it changes nothing.
    • Site: before a sync, the site asks when the base has bit 14 and stops with "Track 3 runs Tape Echo as its FX2 effect, and this sync removes it… Nothing was sent." On older bases, or when the answer is uncertain, the sync runs as before. npm run device -- inuse reads it.
    • To fit the flash slot, part_menu.c and midi_generators.c are built for size: UI-task only. Each holds the machine mask once for a table copy of at most 16 rows, the same length at -Os, and SIZE_OPTIMIZED's comment names this exception. Base 0.8.5 is 849,924 of 851,712 bytes (1,788 free).
    • Regenerated as ddb56b72. Analog BD's reviewed recipe was recaptured. Sidechain, Output Matrix and Analog BD were rebound, with only the four moved base symbols changed. Other base-bound packages take the new requiredBase.
  • How I checked it: npm run pr:ready -- --base-branch base/octatrack-next. Host tests check that the query and the admission agree for each refusal path (effects FX1/FX2, Part copies in RAM and SRAM mirrors, open pages, Analog BD, controllers), plus the wire format (malformed, pending, answer once, stale answers). There is an m68k compile under -Werror and the sdk recipe, base-bound, runtime-loader and codegen suites. A separate safety review found every refusal path unchanged; its two findings (a leftover answer taken for a new question, the reply buffer on the scanned stack) are fixed with a test.

  • Tested on a unit: owner's MKII, 30 Nov 2026, development twin ad5835d6 (the --dev build of ddb56b72, without --stream-channel), with Tape Echo 0.1.9 and FM Synth 0.1.5 kept on the twin, on a scrap project. The site was driven through the developer tool service with this branch's OctatrackLink. The twin advertises feature bit 14 (features 32647). Since this start: 0 DSP stalls, 0 loader errors.

    • Nothing in use: IN USE reads free for both modules, removed and updated.
    • Tape Echo on T3 FX2: {refusal 7, slots [T3 FX2]} for removed and updated. The sync stopped before sending: "Track 3 runs Tape Echo as its FX2 effect, and this sync removes it. Pick another effect for FX2 on Track 3, then sync again. Nothing was sent." The set was unchanged.
    • FM Synth on T5 in Part 2, working copy, Part 1 active: removed {refusal 7, parts [PART 2 T5]}, updated free. The sync stopped: "FM Synth is still the machine on Track 5 in Part 2 of this bank, and this sync removes it. Give that track another machine and save Part 2, then sync again. Nothing was sent."
    • Both tracks freed: IN USE reads free, the same sync goes through to a trial, and Undo verified it ("back to how it was").
    • Fix: an Octatrack sync refused as in use names the effect, track and slot #2456 on the same twin (no pre-check): the unit refuses with code 7, and the message names T3 FX2.
    • Not run: the saved-copy-only case (needs a Part save), the open-page case, and the base's own Part edit window and MIDI generators built for size. Only the stock Part menu was opened.
  • Edge cases:

Case Why this change makes it a risk How run Result
Refusal decisions unchanged Refusal checks refactored into shared functions Host agreement tests, line-by-line review; on the twin the unit refused exactly where IN USE said pass
Query during an open sync or trial Must never interfere with a transaction Host test of BUSY gating; trials and Undo on the twin after queries pass (host); no interference seen on the unit
Machine in an inactive Part Part scan of both copies Host test; twin: working copy in Part 2 pass (working copy on the unit; saved copy host only)
Base without bit 14 Site must behave as before Site tests with the pretend unit pass
Size-optimized UI units Slower code on the UI task, mask held once Disassembly compared at -O2 and -Os pass (masked loop same length); not run on the unit: Part edit window and MIDI generators not opened
  • What the guides lacked or got wrong, and where I fixed it: the base README lists IN USE with the other USB requests, and SIZE_OPTIMIZED's comment states the masked-copy exception.

🤖 Generated with Claude Code

repeat98 and others added 9 commits November 30, 2026 12:12
…se, before it is sent

A new read-only vendor request (0xC1, bRequest 44, wValue entry | how << 8, wLength 24; capability
feature bit 14, in_use.h) asks, for one installed module and a removal or a same-module update, what
the unit's own admission would refuse as RUNTIME_IN_USE (or RUNTIME_UI_OPEN): the effect's slots in the
current Part, a removed contributed machine's Part copies (working and saved, per track), an open page,
or a hold with no place to name (a resident controller, a table owner's consumer, a retirement that
cannot plan, an unreadable Part copy). The ISR only notes the question and wakes the engine, which
answers under the stable lock with the prepare's paused-task context; the host asks again until the
reply is no longer PENDING, and BUSY while a transaction, trial, journal or export holds the loader.

The answer calls the refusal's own predicates, now shared: dsp.c held_slots (modwerk_dsp_in_use),
machine_contributor_held over machine_part_signature_where, table_metadata_held over consumers(),
controller_board.c outgoing_held (modwerk_controller_in_use) and machine_admission_runtime.c ui_open;
modwerk_machine_holds walks them in the admission's order. Host tests check the answer against the
admission in each case. The resident dsp.c patch follows the new line numbers. The base is not
regenerated here.

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

On a base with capability feature bit 14 (0.8.5 on), a sync first reads INVENTORY and asks IN USE for
each module it removes or replaces (packageTarget reads the module and removal from the package
header). A finding stops the sync before any session opens, with what to do in the musician's words
("Track 3 runs Tape Echo as its FX2 effect, and this sync removes it. Pick another effect for FX2 on
Track 3, then sync again.", or the Part, its saved copy and track keeping a machine, or an open page).
No capability, BUSY, no answer or a failed read and the sync goes ahead exactly as before; the
post-refusal texts are untouched. OctatrackLink.whereInUse asks outside a sync, the pretend unit
answers request 44 (PENDING once, then its answer), and `npm run device -- inuse` (also a `do` step and
a read for the unit queue) prints each installed module's answer for a removal and an update.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The README says where the request is documented and which vendor numbers are taken; to keep it from
growing, two paragraphs of the USB profile section drop history their linked evidence records keep.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…stion; the reply buffer is off the scanned stack

Review fixes: the site asks again when the first reply is already ANSWERED (a question asked earlier and never read),
and ep0.c keeps the 24-byte reply static so the machine checks' stack scan cannot read stale bytes as a hold.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
With IN USE the base packed to 851,872 bytes, 160 more than a flash slot
holds. Both units run on the UI task only: part_menu.c from stock's three
Part Edit openers and ev_key/ev_enc/ev_tick/ev_draw, midi_generators.c
from its four UI sites (events.json ot_midi_generators), its key layers
and the UI tick (mw_tick_hook -> mw_ui_tick -> mg_tick). Nothing from
ep0, vendor, transfer, manager, status or the frame calls into them, and
no caller holds the machine lock or mask. Their one masked stretch is a
copy of a table of at most 7 or 16 rows (pm_entries, mg_generators), a
loop no longer at -Os than at -O2. SIZE_OPTIMIZED's comment names the
rule for them and the units that stay at -O2 (settings, diag, the sample
editor, the LFO PMTR table).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…he base with IN USE

IN USE and the size-built UI units moved the base symbols Analog BD's
package links against (the controller write lease, cue_cfg_clamp,
raise_ev_mute_keep), so its image changed and the reviewed recipe refused
it. Captured with build.py --capture-stock-recipe against the empty-row
build's symbols: only imageSha256 changes (0b8421fe -> 48ba77e8); its
stock copies and source pins are the same.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
base ddb56b72d1ac0b60…, browser .bin 16126056… (849,940 bytes; 1,788
container bytes free, +1,472 since 0.8.4), with IN USE and part_menu.c
and midi_generators.c built for size. The lease entries moved, so
Sidechain 0.2.2, Output Matrix 0.1.1 and Analog BD 0.1.7 are rebound:
they differ from a14144f5's packages only in their words for the four
base symbols, and their trust rows follow. CC Map, Recorder Loop fix and
USB Audio keep their bytes; every base-bound package takes the new
requiredBase.

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

Output Matrix, Analog BD and Sidechain Compressor are a14144f5's packages
with only the base symbol words substituted (the controller write lease,
cue_cfg_clamp, raise_ev_mute_keep), checked byte for byte, so their
active-load readings are rebound to the new digests
(resource-indicators.test.ts passes).

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

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@repeat98
repeat98 merged commit c21a7c9 into base/octatrack-next Nov 30, 2026
2 checks passed
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.

1 participant