Skip to content

refactor(mv6): epoch-fenced Channel Strip SOURCE queue and accepted native/M4 ACK projection - #782

Merged
masarray merged 7 commits into
mainfrom
refactor/mv6-source-queue-native-epoch-view-model-20261118
Nov 18, 2026
Merged

masarray merged 7 commits into
mainfrom
refactor/mv6-source-queue-native-epoch-view-model-20261118

Conversation

@masarray

Copy link
Copy Markdown
Owner

MV-6 — SOURCE Queue & Readback reliability, not cosmetic split

Base: main@7f3f4d8f16ccc9a1b4aa53c4f3185f7667f2b3e8 (MV-5 #781 already merged). Distinct from IO-1 dual-device draft #771; no overlapping active GUI PR.

Verified defect being fixed

Existing native pendingNativeSources and M4 pendingSourceQueue stored only the selected input pin. After a device restart/swap the UI could dispatch that old selection with a fresh epoch/revision, potentially pointing at a different physical pin on another interface. Also a subsequent selection of the already-installed source could leave a stale queued edit; an invalid native queue head could strand later channels.

Real ownership extraction

  • Existing pure web/approved-channel-strip-view-model.js now projects:
    • sourceQueueSelection: validates exact choice from current DeviceVM pins, captures device epoch as an immutable draft, allows cancellation to installed PCM, but queues a compensating choice if that channel has an active change.
    • sourceDispatchPlan: validates exact same physical epoch before dispatch, unique pins, native exact decimal-string uint64 ChannelId/installed graph revisions vs M4's 0–9 channel + refreshed routing revision; cannot dispatch M4 when ChannelId mixer owns PCM.
    • sourceAckResult: correlates requestId; M4 checks native accepted-route row and epoch/revision, native ChannelId only ACKs request, awaiting independent PCM readback.
  • web/approved-native-bridge.js removes duplicated native/M4 source field validation and command assembly, but retains the single two existing queue Maps, native arMixAction dispatcher, the 8s timeout, ACK subscriptions and installed PCM readback. Stale queued head is dropped safely and does not starve other channels. No browser-local audio owner or timer-based polling.
  • tests/approved_native_m2_contract.test.cjs: deterministic positive/negative tests for 64-bit IDs, epoch collision/swap, invalid pins, duplicate labels, M4 stale identity and owner upgrade, in-flight revert, request correlation, M4 delayed ACK, preservation of one dispatcher; legacy source-location assertions updated to the actual new ViewModel boundary.

Invariants and risk

ONE approved /preview/ GUI; ONE ChannelId/EdgeId/VST3 native render graph; source-only changes NEVER auto-arm hardware or silently patch a new physical device. No changes to JUCE/C++/ASIO/DSP, CSS/HTML/PNG, external FX, .smix schema, plugin editor or device driver. Source queue is UI transient only. Installed PCM remains authoritative.

Status: KODE DIBUAT / DRAFT. Fast UI/native and one exact-head Chromium qualification pending before merge; Windows installer and physical dual-ASIO FAT NOT RUN. Tindakan Anda: TIDAK PERLU MELAKUKAN APA-APA.

@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: 061a7f3
Status: ✅  Deploy successful!
Preview URL: https://d78d2598.arsonmix.pages.dev
Branch Preview URL: https://refactor-mv6-source-queue-na.arsonmix.pages.dev

View logs

Copy link
Copy Markdown
Owner Author

/arsonmix-ci ui 061a7f3

@masarray
masarray marked this pull request as ready for review November 18, 2026 06:06
@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-18T06:08:13.247748Z 061a7f3 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 1e5df9a into main Nov 18, 2026
42 checks passed

Copy link
Copy Markdown
Owner Author

OWNER DELIVERY — MV-6 SOURCE Queue & Readback (2026-11-18)

HASIL pengguna: Real SOURCE IN picker on the ONE approved /preview/ now rejects stale physical-device choices after a device epoch switch instead of rebasing them onto another interface. A queued channel selection can be cancelled by selecting its installed input; when that same channel already has an in-flight request, a compensating choice is preserved. An invalid native source queue head no longer strands independent channel edits. The legacy first-sound G0/M4 input route still uses its direct JUCE command (no Start/Patch/Arm wizard, no surprise auto-arm). Same one PCM/VST3 native graph; ACK never paints source as installed without later authoritative readback.

Implementation: Pure sourceQueueSelection, sourceDispatchPlan, and sourceAckResult live in the existing web/approved-channel-strip-view-model.js. Bridge web/approved-native-bridge.js removes duplicate M4/ChannelId SOURCE validation/ACK policy while keeping the same single pending Maps, serial request IDs, one arMixAction event transport, 8s timeout and subscribed native readback. Tests in tests/approved_native_m2_contract.test.cjs cover full uint64 native epoch/graph revision and ChannelId, M4 safe numeric epoch, stale pin/role/authority, duplicate selection, cancellation, queued revert, ACK correlation and native first-sound integration.

STATUS: MERGED MAIN — PR #782 squash commit 1e5df9a3cc91c31b4fd457fb9ce360725afcf2d6, source PR HEAD 061a7f39389a91ac5c27cdda622fe1b823421512. Three files changed, no C++/DSP/ASIO/.smix/GUI visual changes, no second store or callback.

Bukti: Fast UI PASS, Fast Native PASS (213 native/source tests), exact-HEAD Full Chromium /preview/ 109/109 PASS run 44247970033 including Stage C pixel parity; Required Merge Gate SUCCESS after Ready on same SHA. Initial fast tests found a real 64-bit epoch overrestriction, repaired to preserve string uint64 for ChannelId and safe numeric only for M4; headless first-sound M4 rejection preserved without a new DOM toast. Neither guard test was disabled. Postmerge main UI run 44248991762 and native run 44248991761 started and were IN PROGRESS at handoff: do not claim PASS or Pages publication until checked.

AMAN DIPAKAI? YA for merged/tested GUI source integrity; BELUM for newly built Windows installer or actual physical 2-vendor ASIO hardware FAT. Tindakan Anda: TIDAK PERLU MELAKUKAN APA-APA. Next: watch main-push CI evidence, then continue one bounded input-source/readback projection or reduce bridge device control coupling; no duplicated accepted PCM owner.

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