Skip to content

Improvement: the test procedure base sets, soak bridge and prices after its first unit run - #1877

Closed
repeat98 wants to merge 14 commits into
mainfrom
improvement/procedure-unit-run-fixes
Closed

repeat98 wants to merge 14 commits into
mainfrom
improvement/procedure-unit-run-fixes

Conversation

@repeat98

@repeat98 repeat98 commented Nov 20, 2026 •

Copy link
Copy Markdown
Owner
  • What was wrong or hard: the test procedure's first real base run on a unit (base 0.7.11, docs/verification/2026-11-19-octatrack-project-load-dsp.md on base/octatrack-next, Octatrack base 0.7.11 (cumulative) — project loads with restored modules #1840) found three things the runner or its tools got wrong.
    • Step 7 put every USB package into one whole-set trial: 36 packages, 439,244 bytes. That does not fit the module pool, so the base refused the set whole (loader refusal 2, RUNTIME_MEMORY).
    • Step 8 assumed the MIDI bridge on 50124. A bridge left from before a power cycle refused every message, and only a fresh one on 50125 carried the soak.
    • Step 9's in-use reading for SC Ringmod failed with "No SC Ringmod in the FX2 chooser". The cause is in the tools, not the module: the chooser shows the effect descriptor's name, RINGMOD SC. device:price passes the package's name unless it is given --fx-name, and device.mjs's pick: matched names exactly. device:test already looks names up word-order-free (chooser_name in octatrack-qualify.py).
    • Also, a restoring boot took 72 s, past boot's 60 s wait.
  • What this changes:
    • Step 7 for a base (scripts/test-procedure.mjs):
      • It reads the pool's free bytes (do memory) and packs the packages into the fewest sets that cover them all. The packages not yet covered go in first, largest first; the set is then filled up with covered ones, so each set is as large as fits, the shape of the owner's 24-package sets for 0.7.10 (Octatrack base 0.7.10 (cumulative) — large module sets, quiet delays and Undo #1757). Nothing is hard-coded.
      • Package file bytes stand in for the pool footprint, so a set the base still refuses for memory is halved (at most four times).
      • The runner caps its planned sets at 32 modules including the starting inventory.
    • Each set is a 30 s whole-set trial, rolled back, with do inventory checked against the start after it. The run stops at the first set that fails or leaves the unit changed.
      • The record lists every set with its packages, bytes and result, and the step fails unless every package ran in a set that passed. The step is now titled "Large sets and Undo".
    • Step 8:
      • Before the soak the runner sends ping to the bridge on --midi (default 127.0.0.1:50124).
      • If the answer is not ok, it leaves that bridge alone and starts its own on the next port where nothing listens, then stops it after the run, even when the soak fails. It never kills another session's process.
      • Where the unit hangs off another computer, MODWERK_MIDI_BRIDGE names the command that starts a bridge there. The record names the port and why that one was used.
      • scripts/octatrack-midi-bridge.py answers ping with the output it holds, reopening it first when winmm says its handle no longer holds (midiOutGetID), and reopens it once when a send fails, which covers the stale-after-power-cycle case.
    • Step 9: the runner reads price.json back. A module whose pick failed or that was not installed is a line of its own, and the others still count. The receipt counts measured and processed packages separately. A single-module run fails if installation was refused or a required at-rest or in-use reading is missing. A base run keeps the completed measurements and lists what is missing. A short run or failed rollback still fails.
    • SC Ringmod's name: device.mjs's pick: falls back to the same rule as device:test: the exact name, a chooser name that starts with it, or the same words in another order (scripts/effect-names.mjs). So SC Ringmod finds RINGMOD SC with no --fx-name.
    • device.mjs set exits with an error on a rejected set or unsuccessful Undo. It still prints the refusal, tries transaction cleanup and reports the inventory.
    • device.mjs boot (and flash's restart) waits up to 150 s for the unit to come back.
    • Docs: docs/TEST_PROCEDURE.md steps 7 to 9 and the base section say all of this. The base section points to the guide text on booting into a kept twin from another image, which is already on base/octatrack-next; I did not duplicate it. docs/OCTATRACK_DRIVING.md has one sentence on the bridge's ping. Changelog entry.
  • How I checked it: npm run pr:ready with the m68k toolchain on PATH: Ready, sdk:check passing in full.
    • New runner tests with fake tools:
      • set packing: coverage, the budget, each set filled up, an oversized package alone;
      • the pool line;
      • step 7 with a set the base refuses for memory and its halves, and with an inventory that does not come back;
      • step 8 with a bridge that answers, a refusing bridge plus another session's on the next port, a failed soak that still stops its own bridge, and no bridge at all;
      • step 9 retaining measured prices beside a failed pick, failing a short base run, and rejecting single-module receipts for a refused installation or incomplete readings;
      • the chooser name lookup.
    • sdk/tests/test_midi_bridge.py: ping, a stale output reopened, a failed send reopened and sent again, the unit gone.
    • In the emulator (development twin of 0.7.10, npm run device:emulator), do memory read the pool (786,432 bytes, all free) and the packing ran as designed: 36 packages became sets of at most 32. But this twin refused every whole-set offer at verify ("rejected", loader refusal 0), even four ColdFire-only packages, while a single try passes; I did not pin down why. So the sets themselves need a unit run, and the runner splits a set only on a memory refusal, never on that.
    • With a disposable card mounted in the adapted emulator, an intentionally rejected set on the 0.7.13 development twin returned exit 1 and preserved the empty starting inventory. A Temp-save set ran for two seconds, returned exit 0 and restored that inventory. E-Verb loaded, then returned needs-recovery during Undo on both the 0.7.12 twin d24c5acb and 0.7.13 twin ba9129f5. Large-set qualification is still pending.
  • Tested on a unit: not applicable, no package or base changes. To confirm on a unit:
    • the set sizes against the real pool;
    • the Windows bridge's midiOutGetID check after a power cycle (not run here);
    • SC Ringmod's in-use pick by its package name;
    • a restoring boot within the 150 s.
  • Edge cases: none, because no package or base changes; the runner's own boundaries are in its tests.
  • What the guides lacked or got wrong, and where I fixed it: TEST_PROCEDURE.md said step 7 for a base installs every package at once, which the pool cannot hold, and said nothing about a stale MIDI bridge. Both are fixed there.

Still needs a real unit run

Run each on a development twin of the current base, behind npm run device -- serve --share /tmp/modwerk-share.sock, through the unit queue. On a contributor's unit, get their OK first.

  1. Step 7, base sets: npm run test:procedure -- --base.
    • Confirm the record's "Step 7" lines: the pool and free bytes do memory reported, then each set with its packages and bytes, all passed, rolled back, and every USB package in at least one passing set.
    • Check that no set needed a memory split. If one did, the file bytes understate the pool footprint by more than expected: note by how much. The runner still covers every package.
    • Confirm do inventory after the last set equals step 6.
  2. Step 8, MIDI bridge:
    • (a) With a healthy bridge on 50124, the record should say it answered ping. A bridge started from this branch's octatrack-midi-bridge.py is needed for that; an older copy answers ping with an error, and the runner then starts its own.
    • (b) Leave a bridge running across a power cycle, then run the procedure again. The old bridge should now reopen its output on ping (midiOutGetID failing, then a reopen) and answer ok. If it still refuses, the runner should start its own on the next free port, name it in the record, and stop it after the run, leaving the old process alone.
    • On Windows from WSL, set MODWERK_MIDI_BRIDGE to the Windows Python and a copy of the bridge outside any non-ASCII path. Check that stopping the runner's own bridge also ends the Windows python.exe (WSL interop); this was not verified here.
  3. Step 9, SC Ringmod by name:
    • Either npm run device:price -- --share /tmp/modwerk-share.sock --out /tmp/price.json ring-sc with no --fx-name; its in-use reading should now be taken on FX2.
    • Or, inside a trial of Ring SC: npm run device -- do 'pick:T1:FX2:SC_Ringmod ui', which should pick RINGMOD SC.
    • In a full base run, check that a module whose pick fails is its own line under step 9 and the other packages keep their prices.
  4. Restoring boot: RAM boot a twin that has kept modules from another image (npm run device -- boot DIR), right after a power cycle. It should come back within the new 150 s wait (72 s was measured on 20 November 2026).

The emulator could not stand in for 1: the development twin under ot_emu refused every whole-set offer at verify, whatever the set.

🤖 Generated with Claude Code

Refresh verification

Merged the at-rest policy from #1864 and retained the separate requirements for measurement and rollback. All 33 focused procedure tests passed. npm run pr:ready passed on dc0a67765 with 3,592 Vitest tests and 709 SDK unittest cases. The unit follow-up above is still pending.

The queued unit process now receives both the selected MIDI bridge and the requested module list for pricing. The queue regression uses a custom port and two module IDs. All 34 focused tests passed. Full readiness passed on 48d2d847a with 3,621 Vitest tests in the main run and 724 SDK unittest cases. The physical run above is still pending.

repeat98 and others added 3 commits November 20, 2026 14:38
…fter its first unit run

Step 7 for a base runs the USB packages as the fewest whole-set trials
that cover them, each as large as the module pool the base reports
(do memory) takes, halving a set the base refuses for memory, with the
inventory checked after each and the sets in the record. Step 8 asks the
MIDI bridge for ping and starts its own on a free port when that one does
not answer, never touching another session's; the bridge answers ping and
reopens a stale output. Step 9 reads price.json back, so a failed in-use
pick is that module's line; device.mjs finds an effect by its package's
name (SC Ringmod is RINGMOD SC). device.mjs boot waits 150 s for a base
restoring its kept set.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…d ones; only a memory refusal splits a set

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

Copy link
Copy Markdown
Owner Author

Step 9 can pass without measuring the module under review. I ran the single-module step with a price receipt containing one refused installation and rolledBack: true, which is what device:price records for a clean refusal. It reported “1 of 1 packages priced” and marked the step passed.

Please count successful measurements separately from processed packages. A single-module qualification needs to fail or explicitly remain unmeasured when that module was refused or its required reading is missing. The base sweep can still collect and report the other modules. A regression using the refused receipt would cover this before the bridge and soak checks on the unit.

@repeat98

Copy link
Copy Markdown
Owner Author

The refused-installation case from my earlier review is fixed in 1fba3480. I found one more issue before the next unit run. I passed a custom MIDI bridge and selected only ring-sc for pricing, then captured the child command with the PR’s mock queue. Both values disappeared. The soak falls back to the default bridge and the pricing step can try the full catalogue.

Please forward --midi and --price-modules when runProcedure starts the queued child, and extend the queue regression to check that both values reach it.

@repeat98

Copy link
Copy Markdown
Owner Author

Closing this: most of it landed differently since 21 November. Step 7's set handling (split on a full pool, fail on a refusal) came in with #2072, and step 9 was rebuilt by #2043 into the curve and admission runs, with --price-modules already on main.

Three pieces are not on main yet and are worth a small new pull request if we still want them:

  • the MIDI bridge's ping and reopening a stale handle (octatrack-midi-bridge.py), which octatrack-soak.mjs still talks to;
  • effect-names.mjs, so SC Ringmod finds RINGMOD SC;
  • the longer wait after a boot (main still reconnects within 60 s).

@repeat98 repeat98 closed this Nov 24, 2026
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