Skip to content

Fix: Octatrack base: a module own patched UI handler no longer blocks its Undo - #1788

Merged
repeat98 merged 2 commits into
base/octatrack-nextfrom
fix/ui-root-own-site-1386
Nov 19, 2026
Merged

repeat98 merged 2 commits into
base/octatrack-nextfrom
fix/ui-root-own-site-1386

Conversation

@repeat98

Copy link
Copy Markdown
Owner

Related to #1386 (the 19 November case from #1744). For the cumulative base draft #1757.

  • What was wrong or hard: a timed trial of Micro Timing that ended with its TRACK TRIG EDIT row open was refused its rollback (needs-recovery), and so was every later recover, even after the page was closed; unplugging USB did not clear it either, only a power cycle. Before the base retires an image it walks the stock UI roots (MODWERK_RUNTIME_UI_ROOTS, machine_lifetime.c) and refuses while any names the image. Once TRACK TRIG EDIT had been opened, its layer record 0x400d0140 stayed reachable from the key cache, and its encoder definition at 0x400d01f0 holds Micro Timing's own patch (its SymbolRef pointing LEVEL at mt_level). That word is a site of the leaving module, put back to stock in the same masked write that retires the image, but the scan counted it as a live root. None of the loader's refusals records a reason, so nothing showed this; it was found by porting the walk to Python and running it on the unit's memory.
  • What this changes: the loader offers modwerk_runtime_site_view(image, address, out, n), which reads the bytes inside a live module's sites as their stock bytes; the admission walks the UI roots through it, so it asks whether the roots name the image once the switch has run. Every other root into the image still refuses (RUNTIME_UI_OPEN), including stock's own copy of the handler in the encoder cache while the page is open, so an Undo with the page open still waits until it closes. Source only: the beta base's assets are not regenerated here, because Fix: Octatrack base 0.7.10 binds Analog BD again after a rolled-back trial that removed it #1774 regenerates the same files; one regeneration once both are in base/octatrack-next avoids a conflict.
  • How I checked it: test_module_ui_roots.c: a stock encoder definition naming the module is refused when stock wrote it, admitted at SWITCH and PREPARE when it is the module's own site, and refused again with a second handler outside the site; the new assertions fail without the admission change. test_machine_events (17 tests, which builds it), test_runtime_loader, test_resident_engines_board, test_controller_board, test_module_sets, test_runtime_journal, test_resident_journal and test_analog_bd_ui pass. npm run pr:ready not run: it waits behind other sessions in the build queue long enough for main to move (twice today on Fix: Octatrack base 0.7.10 binds Analog BD again after a rolled-back trial that removed it #1774).
  • Tested on a unit: see the line below. The owner's MKII, OS 1.40C, Micro Timing's package f5b96821 (the contributor's), project MODWERK-TEST2:
    • before the fix, twin f9f8cfb9 (Fix: Octatrack base 0.7.10 binds Analog BD again after a rolled-back trial that removed it #1774's code): 120 s device.mjs try, during it T3, REC, FUNC+BANK (TRACK TRIG EDIT), MICRO T, one LEVEL step; at the end needs-recovery. With the page closed: still recovery after 40 s of polling and after 16 s with no USB requests; recover refused; unplugging USB for 15 s did not clear it. Task stacks held no word in its sites or image, all 38 sites still held its patch; the UI walk found the one root above.
    • with the fix, twin 7c991c1c (this branch): the same steps; with the page open the rollback still answered needs-recovery (the walk found stock's encoder-cache copy of the handler and the module's own definition); after closing the page the walk found only the module's own definition and recover rolled the trial back: normal, nothing installed.
    • Two 180 s trials with the page never opened (stopped, and playing) rolled back cleanly on f9f8cfb9.

Not tested on a unit: the release build (the beta base is not regenerated in this pull request), and the 9 November SYNTIZ case of #1386, which is a different path (a contributed machine still named, for example in a Part copy) that this does not change.

  • What the guides lacked or got wrong, and where I fixed it: nothing fixed in the guides here. Worth a follow-up: the device tool's advice after needs-recovery ("unplug USB") does not help when a module's page is open; "close the module's page, then npm run device -- recover" would. And the loader records no reason for a refused restore, which made this slow to find.

🤖 Generated with Claude Code

repeat98 and others added 2 commits November 19, 2026 13:01
…s Undo (#1386)

A trial of Micro Timing that ended with TRACK TRIG EDIT open was refused
its rollback with needs-recovery, and so was every later recover, even
with the page closed, until a power cycle or unplugging USB (a
contributor's MKII and the owner's MKII, 19 November 2026). The base
refuses to retire an image while the stock UI roots name it
(MODWERK_RUNTIME_UI_ROOTS), and the walk reached TRACK TRIG EDIT's layer
record 0x400d0140, whose encoder definition at 0x400d01f0 holds
0x40d80740: Micro Timing's own patch, its SymbolRef pointing LEVEL at
mt_level. Once the page had been opened, that layer stayed reachable from
the key cache, so the scan refused every switch out.

That word is a site of the leaving module: the switch puts stock's handler
back in the same masked write that retires the image. The loader now
offers modwerk_runtime_site_view, which reads a live module's sites as its
stock bytes, and the admission walks the UI roots through it, so it asks
whether the roots name the image once the switch has run. Any other root
into the image still refuses (RUNTIME_UI_OPEN).

Host test: test_module_ui_roots.c, a stock encoder definition naming the
module: refused when stock wrote it, admitted at SWITCH and PREPARE when
it is the module's own site, refused again with a second handler outside
the site. It fails without the admission change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.

1 participant