Skip to content

Fix: the Octatrack status word no longer shows a module you removed - #1610

Closed
repeat98 wants to merge 1 commit into
mainfrom
fix/1314-status-word-after-removal
Closed

repeat98 wants to merge 1 commit into
mainfrom
fix/1314-status-word-after-removal

Conversation

@repeat98

@repeat98 repeat98 commented Nov 16, 2026 •

Copy link
Copy Markdown
Owner

Draft until the next base. runtime.c is a base input. Its hash no longer matches src/engine/assets/octatrack-base-sources.json, so src/engine/elekloader/octatrack-base.test.ts ("is rebuilt whenever a file the base is built from changes") fails until the base is regenerated. I did not regenerate it. That and the unit run follow with the next base. The fix is reproduced only in a host test, not on the unit.

  • What was wrong or hard: The shared status word (modwerk_runtime_api.value, the value that diagnostics and npm run device print) was never cleared. Every module's tick writes it, and the last one to write it wins (Docs: the trial's value word is shared by every module's tick #1524). After a module was removed, its value stayed until some remaining tick wrote the word. If no remaining module writes it, it stayed until a power cycle. That is the part of Octatrack base: the shared status word keeps a removed module's value until a power cycle #1314 the host can reproduce.
    In the reported trials, Pattern Sample Locks was still installed, and its tick writes the word on every tick. So the word staying on Beat Slicer's 0x42530000 means Sample Locks' tick was not writing it at the time. This change does not explain that, or the missing FUNC+PART rows. In the host test, the loader and the Octatrack dispatch never run a removed module's tick: live[] changes only in switch_locked, and modwerk_runtime_tick reads it again on every tick. That cause is still open and needs the unit.
  • What this changes: modwerk_runtime_tick now checks for a changed installed set before it runs the ticks, not after. It uses the same epoch and set mix the screen redraw already used. On a change it sets the word to 0 first. So a value in the word was written by a module that is installed now, and 0 means none of them wrote it. The clear runs in the task that runs the ticks, so a removed module's tick that was paused halfway has finished before the clear. An install clears the word too, until the next tick writes it again. Ticks with the set unchanged leave the word alone. The redraw after a change still happens once, after the ticks, as before. docs/OCTATRACK_API.md says so, and the changelog says it ships with the next base.
  • How I checked it:
    • New host test sdk/tests/runtime_removed_tick.c, run by sdk/tests/test_runtime_removed_tick.py, with and without -DMODWERK_CACHED_MODULES. It uses the actual loader with real install and removal packages, and runtime.c's tick dispatch. Host functions stand in for two modules' ticks.
    • On main the test fails at the two checks where the word should be 0 (runtime_removed_tick.c:66 and :71). With the fix it passes.
    • On main, the checks that the removed tick no longer runs and the remaining tick does already passed.
    • test_recipe.RuntimeSlotTests (including test_runtime.c and its cached-modules build, and test_boot.c): 17 run, 2 skipped, all passed.
    • The changelog check against origin/main passes.
    • I did not run npm run check, pr:ready or the whole sdk check here (machine load limits), and I did not run the unit, the emulator or a base build.
  • What the guides lacked or got wrong, and where I fixed it: docs/OCTATRACK_API.md said only that the last writer wins. It now also says when the word goes back to 0.

Three checks are red, and all of them expect the regeneration (module-paths-windows fails on the same reconstruction pin; module-pr-ok sums up the others):

  • module-suites (test:2/2): octatrack-base.test.ts says the committed base is stale (runtime.c).
  • module-suites (sdk): test_host_reconstruction.py says Pattern Sample Locks' reconstruction recipe pins runtime.c's old hash (sdk/machines/octatrack/module-adapters/reconstruction-recipes.json). As in Fix: Octatrack base, leaving USB DISK MODE no longer stops the audio until a power cycle (finding 72) #1390, that pin is refreshed with the regeneration, after checking that the rebuilt package is byte-identical to the pinned one. I did not edit it by hand.

Still to do, outside this PR:

  • Regenerate the base and refresh the Sample Locks reconstruction pin (this makes both checks green).
  • On the unit, repeat the issue's sequence on the new base. Remove Beat Slicer and leave Pattern Sample Locks alone. If the word then reads 0 instead of Sample Locks' value, Sample Locks' tick is not running, and that is the real cause behind the missing rows.

Related to #1314

🤖 Generated with Claude Code

…alled set changes, so it never shows a removed module.

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

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant