Skip to content

refactor(mv10): identity-scoped fader/PAN scheduling and native dispatch policy - #789

Merged
masarray merged 1 commit into
mainfrom
refactor/mv10-scalar-scheduler-identity-20261118
Nov 18, 2026
Merged

masarray merged 1 commit into
mainfrom
refactor/mv10-scalar-scheduler-identity-20261118

Conversation

@masarray

Copy link
Copy Markdown
Owner

MV-10 — Native scalar scheduler policy as a pure Channel Strip ViewModel decision

Initial base: main@040578eb9c4aeaef507e4af667c58c0e6d69ba12 (merged MV-9 #787). Existing FX-gating PR #788 is in parallel and must be preserved when main advances. No alternate GUI, DSP or transport.

Verified maintenance and reliability gap

Native bridge kept a lastNativeControlSent Map keyed only by local strip/parameter. Its raw timestamp survived device-reconnect, native ChannelId remapping, native graph rejection and strip reuse. That meant a newly admitted physical channel could inherit a short throttle from an unrelated prior native identity. Pure dispatch/coalescing rules were also still hard-coded in the 4,000-line bridge.

Implementation — four files, no duplicate owner

  • web/approved-channel-strip-view-model.js: pure scalarDispatchLease, scalarGestureFlushPlan, scalarDispatchPlan. Exact decimal-string 64-bit native device epoch/ChannelId/authority scopes every send-time throttle. Emits only decisions: SEND/QUEUE on pointermove, unconditional release flush, offline logical draft defer until release, REJECT/WAIT/M4/INTENT for actual live dispatch. No DOM/timer/PCM.
  • web/approved-native-bridge.js: one existing pendingNativeControl, liveFaderVisualTargets, lastNativeControlSent, arMixAction transport and one 32ms retry timer remain the only owners. Uses pure plans and stores time+exact identity instead of bare time. Clears stale throttle leases on lost/rejected graph, preserves 30ms coalescing, last-writer-wins, pointerup release, per-ChannelId ACK+readback, M4/MAIN and logical .smix workflow. Does not change existing native dispatch functions or repaint.
  • tests/approved_scalar_scheduler_contract.test.cjs: 9 new deterministic contracts for huge IDs, reconnect/strip reuse, 30ms throttle boundary, clock jumps, pointerup, offline edits, two concurrent strips, rejected/blocked control transactions, M4/MAIN path, one bridge transport and zero ViewModel browser/PCM state.
  • .github/workflows/ui-smoke.yml: runs new contracts in both Fast UI and Full Chromium and triggers when the file changes.

Invariants: one approved /preview/ GUI and one JUCE native ChannelId/EdgeId/VST3 PCM owner; no C++/JUCE/ASIO/DSP/.smix/HTML/CSS/PNG modifications. M4 compatibility remains secondary and cannot pretend to be ChannelId PCM. No installer/FAT claim.

STATUS: CODE COMMITTED / DRAFT. Fast UI/native and exact-HEAD full Chromium plus Required Merge Gate must pass before merging; physical hardware/ASIO FAT and installer NOT RUN. No user action required.

Copy link
Copy Markdown
Owner Author

/arsonmix-ci ui abc2fd9

@masarray
masarray force-pushed the refactor/mv10-scalar-scheduler-identity-20261118 branch from abc2fd9 to 713fe4e Compare November 18, 2026 08:26
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

Deploying arsonmix with  Cloudflare Pages  Cloudflare Pages

Latest commit: 713fe4e
Status:🚫  Build failed.

View logs

Copy link
Copy Markdown
Owner Author

/arsonmix-ci ui 713fe4e

@masarray
masarray marked this pull request as ready for review November 18, 2026 08:36
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-18T08:37:46.124136Z 713fe4e Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@masarray
masarray merged commit cfa922e into main Nov 18, 2026
41 of 42 checks passed

Copy link
Copy Markdown
Owner Author

OWNER DELIVERY — MV-10 identity-scoped scalar scheduling (2026-11-18)

STATUS: MERGED MAIN. PR #789 squash commit cfa922e1eb30e258e193d6865b638d0d525b414b from qualified exact HEAD 713fe4eba00e943eed19582a0abed76983e33e49. The branch was cleanly rebuilt on merged global/M4 FX ViewModel PR #788 (main@e32982ba3bc33074098137fa4c388e581a9a7fe5) using only the four intended scoped files; every FX hunk was preserved. Compare: 1 ahead, 0 behind, no unresolved review threads at promotion.

WHY: The native bridge had been keeping lastNativeControlSent as a bare performance.now() timestamp indexed by view-local fader/PAN key. That survives a remapped ChannelId, device epoch, authority or session graph failure; a newly accepted native channel could inherit the old strip's 30ms dispatch throttle. Scheduling and native dispatch backpressure policy also sat in the 4k-line bridge.

WHAT: Pure web/approved-channel-strip-view-model.js now exposes scalarDispatchLease, scalarGestureFlushPlan, and scalarDispatchPlan to choose FLUSH/QUEUE, reject/WAIT/M4/INTENT with the exact native epoch/authority/ChannelId token. web/approved-native-bridge.js still owns ONLY ONE pending scalar Map, one 32ms flush timer, ONE native transport, controller/subscriptions, and display-only fader pending target; it stores identity-scoped throttle leases, ignores stale ones and clears them on graph invalidation/rejection. Pointerup always flushes the last target; offline logical .smix still writes only on release. Existing 30ms coalescing, one JUCE PCM owner, native ACK + independently accepted readback and M4/MAIN paths remain unchanged.

TESTS: independent tests/approved_scalar_scheduler_contract.test.cjs adds 9 deterministic contracts for uint64 exact identities, 30ms boundary, pointerup, timeline/clock reset, recycled local strip, two concurrent strips, native backpressure, offline logical state, M4/MAIN and one bridge transport. Wired into both fast and full CI by .github/workflows/ui-smoke.yml. Fast UI PASS; Fast Native PASS; Full Chromium #44267137266 PASS 109/109, including Stage C visual parity, native fader/PAN/WIRE, FX and I/O. Required Merge Gate SUCCESS: All scoped checks passed.

Postmerge: main Chromium #44268696444 QUEUED and main native #44268696499 PENDING at last inspection. Do not claim those passed until completed. No JUCE/C++/DSP/ASIO/.smix/HTML/CSS/PNG/installer changed. No physical ASIO FAT or new Windows installer qualification. Owner action: NONE.

NEXT: preserve single authoritative bridge and pure ViewModels while addressing remaining bounded device lifecycle/gesture supersession policies; audit fresh main before any next change.

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