Repository navigation
Fix: no base package may write into the table the stock DELAY reads - #1457
Merged
Merged
Conversation
…hat writes into the table the stock DELAY reads. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What was wrong or hard: The stock DELAY reads a table of 1,024 coefficients at
0x400d1ce0..0x400d2cdf. From0x400d24d0on the table is zero in the stock OS, so it looks like free space. Card builds put overflow code there, and that dulled DELAY repeats (Overflow region 0x400d24d0..0x400d2ce0 is the stock DELAY's coefficient table (synth builds dull DELAY repeats) #1176). The card composer left the repository this morning (Improvement: retire the Octatrack card firmware builder; modules go through the base, over USB or as a card file #1451, Improvement: Octatrack modules prove a base package only; the card composer and its checks are removed #1453), and the draft that fixed it there went with it (Fix: Octatrack card builds keep the 16 bytes the stock DELAY reads past its table #1045). What stayed open: nothing stopped a module's package for the Modwerk base, or a site of the base itself, from writing into the same bytes.What this changes:
npm run modules:compatrefuses any write into the table. For a module that is what its package installs on the base: a detour, poke, reference, pinned unit, emitted poke, declared run-time write or grown table. For the base it is its own sites, hooks and tables. Kept bytes and stock copies only read the table, so they pass. The message names the module, the bytes it writes and the table, and the fix line sends the author to free space or to a unit the build places.0x400d1ce0up to0x400d2ce0, not the 16 bytes Fix: Octatrack card builds keep the 16 bytes the stock DELAY reads past its table #1045 kept. Every address comes from a file already in the repository:sdk/octabam/docs/FAILURE_MODES.md, "A cave at 0x400d24d0 changes the stock DELAY": the routine reads0x400d1ce0 + 4 * (x >> 6); the low-pass index is(BASE + WDTH) >> 6, up to 1016 with both knobs at 127; boot reads entry 1023; "the whole run0x400d24d0..0x400d2ce0is table data (entries 508..1023, zero in stock)".sdk/octabam/docs/remixer/PLACEMENT.mdlists the same run as not free, anddocs/OCTATRACK_HARDWARE_TRAPS.mdcarries the trap.0x400d1ce0end at0x400d2ce0, so the two ends agree.0x400d24d0,0x400d2ca8and0x400d2cb0. That was the card form; their packages bind those addresses to symbols of their own (fm_runtime.py,quantizer_runtime.pyinsdk/machines/octatrack/module-adapters), and this check does not read the native pins.docs/OCTATRACK_HARDWARE_TRAPS.md: the stale sentence "Card builds still put overflow code there" now says thatmodules:compatrefuses any write there. The file is one byte shorter than on main (57,189 against 57,190).How I checked it:
python3 -X utf8 -B -m unittest discover -s sdk/tests -p test_module_compat.py: 18 tests pass. The new one proves a write inside the table is refused at both ends, one just outside passes at both ends, reads pass, a base site is refused and a native pin is not judged.test_repository_passesruns the new rule over every active module and the base.python3 -B scripts/module-compat.pywith main merged (41aa57a, the modules insdk/octatrack/modules): 36 active modules, 630 pairs, 0 problems.public/octatrack-modules, decoded withsdk/runtime/loader/verify_static.py: 196 sites and 133 stock copies, none in the table, and no word in a package image holds a table address. The base package (src/engine/assets/octatrack-base.elemod): none of its 304 sites, none of the 92 hook and table sites and none of its 145 absolute symbols is in the table, and no word in its code holds a table address. So the rule flags nothing that is committed, and I added no exception.npm run pr:ready,npm run check,sdk:checkand the app tests. CI runs them. Nothing was tried on a unit or in an emulator: this is a check on declarations.What the guides lacked or got wrong, and where I fixed it:
docs/OCTATRACK_HARDWARE_TRAPS.mdstill said card builds put overflow code in the table. Fixed in that line.Two limits, as for the gate's other byte rules: a pinned unit counts with its first six bytes, because the gate knows where a pinned unit starts and not how long it is, so a unit pinned just below the table that runs into it is not seen. A run-time write a manifest does not declare is not seen either.
Related to #1176
🤖 Generated with Claude Code