Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog/2026-12-03-procedure-update-price-waits.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Development: `npm run test:procedure` on an update of a listed Octatrack module no longer stops at step 1 because the price and instance curve still name the previous version. In step 1 (`module:doctor -- --procedure`) they wait for the run, as the qualification record already does: step 9 measures them and `module:qualify -- <id> --procedure DIR --write` records them. The plain `module:doctor` still refuses a stale price or curve.
2 changes: 1 addition & 1 deletion docs/TEST_PROCEDURE.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ Each step proves only what it ran. Steps 1 to 5 prove the code paths they exerci

- **1-2.** The doctor runs the module's host tests, the contract, the performance record and the compatibility lines. A draft is judged beside every other module by the doctor itself.
- **1, a base.** Run it with the m68k-elf toolchain on PATH and the Elekloader checkout `npm run upstream:tools` keeps: without them `sdk:check` skips every package rebuild, as CI's SDK job does, so a stale reviewed recipe goes unseen. A failure there is the change's to fix, not the computer's (20 November 2026: Tape Echo's and Euclid's standalone recipes had gone stale on main).
- **A first release runs this as a draft.** Listed, a module's step 1 is the release doctor, which wants the price and curve this run measures; `module:qualify` writes them in (Midiverb, 25 November 2026). An update of a listed module runs step 1 as `module:doctor -- --procedure <id>`: its qualification record still names the version before it, which `module:qualify -- <id> --procedure DIR --write` replaces from this run (Midiverb 0.2.0, 27 November 2026).
- **A first release runs this as a draft.** Listed, a module's step 1 is the release doctor, which wants the price and curve this run measures; `module:qualify` writes them in (Midiverb, 25 November 2026). An update of a listed module runs step 1 as `module:doctor -- --procedure <id>`: its qualification record still names the version before it, which `module:qualify -- <id> --procedure DIR --write` replaces from this run (Midiverb 0.2.0, 27 November 2026). Its price and curve wait for the run too: step 9 measures them and `module:qualify` records them (Loopbox 0.1.1, 3 December 2026).
- **3. A rebuild starts again at step 1.** The record names the source revision (and says when the tree had uncommitted changes) and the package's SHA-256. Every later result is about this build only. A draft DSP module with no published figures is built with the builder's placeholders (600 modeled cycles, buffer 0), which the loader refuses at verify with refusal 6, `RUNTIME_CYCLES` (Ghost Cut, 21 November 2026), and the runner takes no figures. Build it yourself with the measured ones and hand it over: `npm run module:dev -- <id> --build-only --cycles N --cycles-kind modeled --state N --buffer N --out PKG`, then `--package PKG`. `--buffer` is the Y words of the slot buffer the effect reads.
- **4.** The check fails a cycle-scan record whose module source changed since its scan. After changing a module's DSP code, scan it again on a computer with the scan's tools: `node scripts/cycle-scan.mjs record <id>` ([sdk/cycle-scan](../sdk/cycle-scan/README.md), [MODULE_PERFORMANCE.md](MODULE_PERFORMANCE.md)).
- **5.** The runner starts `ot_emu` on a development twin of the base and a session on it ([below](#one-set-of-cases-two-targets)), runs the commands of steps 6, 7 and 10 there, and stops both, so a fault shows before any unit time. It needs [the adapted `ot_emu`](../scripts/octatrack-emulator/README.md) (the plain port refused the trial with loader refusal 5, 20 November 2026) and a twin's build folder, both outside Git: set `MODWERK_OT_EMU` and `MODWERK_OT_TWIN` once in your shell profile, or pass `--emulator` and `--twin`. Without them the step is not run and says which is missing. A failure there stops the procedure before the unit (`--no-emulator` skips the step); a session that does not start leaves it not run. A package with DSP code, and a base, run with `--dsp`; a ColdFire module without, about ten times faster. What passes here can still fail on the unit: read [what `ot_emu` does not show](OCTATRACK_HARDWARE_TRAPS.md#the-emulator-and-the-tools). It does not show a pick the unit refuses for load (CPU FULL), since the emulator measures none ([below](#one-set-of-cases-two-targets)): Mackity's refusal on a busy eight-track pattern (25 November 2026) showed only on the unit. Build the twin with `build_core.py --dev` and the beta flags; on main it links only with `--resident-stock-hooks --resident-on-demand` among them, and without them stops at "Core has unexpected unresolved imports" (the arena, bss and run symbols and the `ev_` hooks). This set linked on 21 November 2026: `--dsp-loader --dev --usb-midi --packaged-usb-audio --site-events --table-owners sdk/machines/octatrack/module-adapters/table-owners.json --resident-stock-hooks --resident-on-demand --cached-modules --module-sets --sample-editor --module-ui-roots --part-menu`, with `ELEKLOADER_DSP_ASM` naming `dsp_asm` in the `dsp56300` build tree and `dsp56kDisassemble` built beside it.
Expand Down
4 changes: 2 additions & 2 deletions scripts/module-cpu-price.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ export function cpuPriceStatus({ root, document, pending, glue = null }) {
// Tape Echo 0.1.9 carried the price read on 0.1.6: a release from RELEASE_COST_FROM measures its own.
const date = releaseDate({ root, document }), logged = existsSync(resolve(root, 'src/community/module-changelogs', id + '.json'))
if (record.version !== document.version && logged && (!date || date >= RELEASE_COST_FROM))
return { state: 'fail', detail: 'its price was measured on ' + record.version + ', not ' + document.version + ': a release measures its own cost', fix: howTo }
return { state: 'fail', stale: true, detail: 'its price was measured on ' + record.version + ', not ' + document.version + ': a release measures its own cost', fix: howTo }
if (measuredPrice(record.result) !== declared.value) return { state: 'fail', detail: 'it names ' + declared.value + ' % of a frame, but the reading in ' + declared.source + ' gives ' + measuredPrice(record.result), fix: 'write the price with npm run device:price -- --write, never by hand' }
}
const disagree = descriptors.find(item => item.price !== declared.value)
Expand Down Expand Up @@ -429,7 +429,7 @@ export function frameCostStatus({ root, document, glue = null }) {
return strict ? { state: 'fail', detail: problem, fix: frameCostHowTo(id) }
: { state: 'ok', detail: detail + '; ' + problem + ' (reported, not refused, for a release dated before ' + RELEASE_COST_FROM + ')' }
}
return { state: refused ? 'fail' : 'warn', detail: (valid ? 'its curve is for ' + record.version + ', not ' + document.version : 'no instance curve measured') +
return { state: refused ? 'fail' : 'warn', stale: valid, detail: (valid ? 'its curve is for ' + record.version + ', not ' + document.version : 'no instance curve measured') +
(refused ? '' : '; reported, not refused, for a release dated before ' + FRAME_COST_FROM), fix: frameCostHowTo(id) }
}

Expand Down
7 changes: 4 additions & 3 deletions scripts/module-cpu-price.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ describe('a release of an effect or a machine carries its instance curve', () =>
const document = { ...module('echo', 'FX2', { ...share(1.3), source: 'evidence/cpu-price.json' }), version: '0.2.0' }
const status = (version, date) => cpuPriceStatus({ root: fixture({ ...reading(version), ...dated('echo', '0.2.0', date) }), document, pending: new Map(), glue: {} })
expect(status('0.2.0', RELEASE_COST_FROM).state).toBe('ok')
expect(status('0.1.0', RELEASE_COST_FROM)).toMatchObject({ state: 'fail', detail: expect.stringContaining('measured on 0.1.0, not 0.2.0') })
expect(status('0.1.0', RELEASE_COST_FROM)).toMatchObject({ state: 'fail', stale: true, detail: expect.stringContaining('measured on 0.1.0, not 0.2.0') })
expect(status('0.1.0', FRAME_COST_FROM).state).toBe('ok') // Tape Echo 0.1.9 carried 0.1.6's price, released before the rule
})

Expand All @@ -332,13 +332,14 @@ describe('a release of an effect or a machine carries its instance curve', () =>

it('refuses a new or undated release without a curve for its version, and only reports an earlier one', () => {
const undated = fixture({ ...curve('echo', '0.1.0', 13, 3.7), ...dated('echo', '0.1.0', '2026-11-14') }) // 0.2.0 has no entry yet
expect(frameCostStatus({ root: undated, document: effect('echo', '0.2.0'), glue: {} })).toMatchObject({ state: 'fail', detail: expect.stringContaining('not 0.2.0') })
// stale: the curve of the version before, which an update's test procedure measures again (module:doctor --procedure)
expect(frameCostStatus({ root: undated, document: effect('echo', '0.2.0'), glue: {} })).toMatchObject({ state: 'fail', stale: true, detail: expect.stringContaining('not 0.2.0') })
const legacy = fixture({}) // no changelog file at all: a module from before the release notes
expect(frameCostStatus({ root: legacy, document: effect('echo', '0.2.0'), glue: {} }).state).toBe('warn')
const old = fixture({ ...dated('echo', '0.2.0', '2026-11-14') })
expect(frameCostStatus({ root: old, document: effect('echo', '0.2.0'), glue: {} }).state).toBe('warn')
const fresh = fixture({ ...dated('echo', '0.2.0', FRAME_COST_FROM) })
expect(frameCostStatus({ root: fresh, document: effect('echo', '0.2.0'), glue: {} })).toMatchObject({ state: 'fail', fix: expect.stringContaining('--curve') })
expect(frameCostStatus({ root: fresh, document: effect('echo', '0.2.0'), glue: {} })).toMatchObject({ state: 'fail', stale: false, fix: expect.stringContaining('--curve') })
})

it('asks nothing of a module that is neither an effect nor a machine', () => {
Expand Down
10 changes: 8 additions & 2 deletions scripts/module-doctor.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,12 @@ function octatrack(id) {

// Every module names its CPU price; a machine's is also its descriptor's reserved[0] (scripts/module-cpu-price.mjs, docs/MODULE_PERFORMANCE.md).
const price = cpuPriceStatus({ root, document, pending: cpuPending })
if (price.state === 'fail') fail('cpu price', price.detail, price.fix)
// In the test procedure an update's price and curve are the version before it's: step 9 measures this one's, and
// module:qualify -- <id> --procedure DIR --write records both from that run, as it does the qualification record.
const priceWaits = procedure && document.tests?.qualification?.moduleVersion !== document.version
const waitsForStep9 = ', waits for this run: step 9 measures it and npm run module:qualify -- ' + id + ' --procedure DIR --base TEXT --write records it'
if (price.state === 'fail' && price.stale && priceWaits) info('cpu price', price.detail + waitsForStep9)
else if (price.state === 'fail') fail('cpu price', price.detail, price.fix)
else if (price.state === 'pending') info('cpu price', price.detail)
else ok('cpu price', price.detail)
// What it costs installed and used nowhere (test procedure step 9): above the limit it must rest (answer ev_in_use), unless a machine.
Expand All @@ -246,7 +251,8 @@ function octatrack(id) {
else info('cost at rest', rest.detail + (rest.fix ? '. Fix: ' + rest.fix : ''))
// What one more instance costs on a Part (base 0.8 admission): a release of an effect or a machine measures its curve on a unit.
const curve = frameCostStatus({ root, document })
if (curve.state === 'fail') fail('frame cost', curve.detail, curve.fix)
if (curve.state === 'fail' && curve.stale && priceWaits) info('frame cost', curve.detail + waitsForStep9)
else if (curve.state === 'fail') fail('frame cost', curve.detail, curve.fix)
else if (curve.state === 'ok') ok('frame cost', curve.detail)
else info('frame cost', curve.detail + (curve.fix ? '. Fix: ' + curve.fix : ''))

Expand Down