Skip to content

Fix: an Octatrack sync that stalls while sending tries again in smaller pieces - #2457

Open
repeat98 wants to merge 7 commits into
mainfrom
fix/sync-stage-small-frames
Open

repeat98 wants to merge 7 commits into
mainfrom
fix/sync-stage-small-frames

Conversation

@repeat98

@repeat98 repeat98 commented Nov 30, 2026 •

Copy link
Copy Markdown
Owner
  • What was wrong or hard: On a few computers every USB sync to the Octatrack stopped while sending. Shared diagnostics from 31 Oct to 30 Nov 2026 show 121 syncs failing in the staging step on 11 units (6 of them account for 104), on every base from 0.7.4 to 0.8.4, on macOS and Windows, in Chrome, Edge and Opera. The Octatrack's own USB counters show the upload stopping after 2-3 transfers, with no USB reset and nothing abandoned: the next 4 KB control transfer never arrived. Two units never kept a sync. Related to [configuration] Cannot send, no reply #2305 and Octatrack base: USB submissions refused while the MISSING MODULES notice is shown (maybe) #1596.
  • What this changes: When a piece of the upload stalls, the site cleanly undoes the half-sent transfer and sends the set again in 1 KB pieces, then 256 B (at most two restarts per sync). Verify, hash, activate and rollback are unchanged; refusals by the unit are never retried. The piece size that worked is remembered in that browser (modwerk.octatrack.stageChunk). Every published base already accepts shorter pieces (sdk/runtime/upload/upload.c mu_chunk, vendor.c mv_setup), so this is a site change only. A failed or kept sync now reports the piece size used, so the field data will show whether smaller pieces get those units through. The privacy page names the stored size and the new report field.
  • How I checked it: npm run pr:ready. New tests with the pretend Octatrack: a unit that stalls above 1 KB syncs at 1 KB with identical bytes and nothing left half-sent, and the size is reused; a unit that stalls at every size fails exactly as before and still gets the card-file offer; no restart after a refusal, a lost reply or a cancelled sync; chunks of 1 KB and 256 B go at consecutive offsets and are never a multiple of 64. Reviewed by a second agent; its two findings (a refused submission counted as a stall, the privacy page's storage list) are fixed.
  • Tested on a unit: the owner's Octatrack MKII, 30 Nov 2026, on development twin base 16c87945 (the upload path is unchanged since 0.7.4). E-Verb, Mini Verb, Tapehead and Air Chorus were each tried and undone at full, 256 B and 1 KB pieces: 12/12 trials, 12/12 Undo verified, nothing kept. The stall-and-restart path happens only on affected computers, so it is covered by tests, not hardware.
  • Edge cases:
Case Why this change makes it a risk How run Result
Normal sync on a computer that never stalls The default path must stay full-size and unchanged Test with the pretend unit; 4 trials + Undo on the unit pass
Forced 256 B and 1 KB pieces Many more control transfers; verify and hash over small pieces Test; 4 trials + Undo at each size on the unit pass (Keep not run: the change is before activation)
Stall at every size Must end as before, nothing half-sent, card file offered Test pass
Unit refuses a submission Must not be mistaken for a stall and retried Test pass
Base update over USB with a stored small size Uses the same staging path Not run not run: unit run pending
  • What the guides lacked or got wrong, and where I fixed it: nothing missing; docs/OCTATRACK_HARDWARE_TRAPS.md already said the base accepts any chunk length, and now says the site falls back to smaller pieces.

🤖 Generated with Claude Code

repeat98 and others added 5 commits November 30, 2026 09:47
On some computers every USB sync stopped at its first CHUNK: ENTER and
BEGIN (48 and 120 bytes) arrived, the 4 KiB CHUNK's data stage was primed
on the unit and never arrived. Shared diagnostics show 121 such syncs on
11 units (macOS and Windows, every base from 0.7.4 to 0.8.4).

Every published base takes a CHUNK of any length from 1 to 4,096 bytes at
the next offset (upload.c mu_chunk, wire.c, vendor.c mv_setup, unchanged
since the upload protocol landed), so this is site-only. After a CHUNK
whose transfer failed or timed out, the link undoes the half-staged
transaction on a fresh session (adopt, abort, leave: the running set was
never touched) and sends the set again from the start in 1,024-byte, then
256-byte pieces. Verify, hash and rollback are unchanged. The size that
got through is kept in this browser (localStorage
modwerk.octatrack.stageChunk, which can be set by hand to test) and also
used for base updates. Refusals, lost replies to other commands and
cancelled syncs are not retried; when the smallest pieces stall too the
sync fails as before, and the second time offers the card file.

Shared sync_failed and kept reports carry `frames` (piece size, restarts)
when the sync did not use full frames alone; the Worker validates it, the
privacy page names it, the support text and diagnostics pull show it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…y page names the stored piece size

A SUBMIT the unit kept refusing (notExecuted) no longer restarts the sync in smaller pieces, so no piece size is
remembered for a refusal. Section 5 of the privacy page now says the browser keeps the piece size that worked.

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

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added the bug Something isn't working label Nov 30, 2026
@repeat98

Copy link
Copy Markdown
Owner Author

Ran on the owner's Octatrack MKII (30 Nov 2026): every trial synced and undid cleanly at all three piece sizes. Nothing was kept. The unit was left with the same empty set it started with.

What ran
  • Build: this branch's OctatrackLink, driven through scripts/verify-octatrack-module-sets.mjs (single-package trials, each followed by Undo) over the Windows USB bridge.
  • Base: 16c87945…. That is a development twin another session had RAM-booted for USB Audio 0.4.3 tests, not a published base. The upload path is the same on every base since 0.7.4 (upload.c is unchanged).
  • Modules: E-Verb, Mini Verb, Tapehead, Air Chorus, each tried alone on an empty set, then undone.
Piece size How forced Trials Undo verified Time for all four
Full (4,044 B) default 4/4 4/4 2 s
256 B localStorage modwerk.octatrack.stageChunk = 256 4/4 4/4 3 s
1 KB same key = 1024 4/4 4/4 3 s
  • What this shows: the base accepts and verifies sets sent in 256 B and 1 KB pieces, and Undo restores the set.
  • Not shown: the stall-and-restart path itself. This computer never stalls, so that path is covered by the tests only. Whether smaller pieces get the affected computers through will show in the new frames field of their reports after deploy.
  • Not run: a base update over USB with a stored small size.

🤖 Generated with Claude Code

@repeat98
repeat98 marked this pull request as ready for review November 30, 2026 13:12
@repeat98
repeat98 enabled auto-merge (squash) November 30, 2026 13:12
…frames

# Conflicts:
#	src/dev/octatrack-link-fake.ts
#	src/engine/elekloader/octatrack-link.test.ts

This branch has not been deployed

No deployments
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