Skip to content

refactor(mv12): fence stale GUI transactions across native device lifecycle - #791

Draft
masarray wants to merge 1 commit into
mainfrom
refactor/mv12-native-lifecycle-fence-20261118
Draft

masarray wants to merge 1 commit into
mainfrom
refactor/mv12-native-lifecycle-fence-20261118

Conversation

@masarray

@masarray masarray commented Nov 18, 2026 •

Copy link
Copy Markdown
Owner

MV-12 — Device lifecycle lease / deterministic stale GUI transaction cancellation

Base: merged MV-10 main cfa922e1eb30e258e193d6865b638d0d525b414b. The active MV-11 identity PR #790 modifies other sections of the same bridge and must be reconciled before merging this branch; do not discard its improvements.

Source-proven problem

Current onNativeReadback cleared transient native UI commands mainly for NEEDS_REMAP retained snapshots. A driver reconnect/switch can publish two consecutive valid, admitted ChannelId PCM snapshots with a different device epoch, with no retained intermediate frame. The old ChannelId/M4 source, FX, scalar, WIRE and identity queues could survive across that transition even while the native controller fences its own pending request.

Implemented boundary

  • web/approved-device-view-model.js: pure nativeLifecycleLease and nativeLifecycleDecision. Exact canonical uint64 epoch, physical backend/capture/playback identity, and canonical native read-model authority. Changes to graph revision / roster / telemetry do not cancel valid same-device work.
  • web/approved-native-bridge.js: one existing accepted onNativeReadback path now compares leases and expires transient WebView requests on physical identity or PCM-authority changes. Late ACKs no longer have matching pending IDs. Reset only UI-side queues/timestamps and stale pending cosmetic migration; native device Apply state, durable .smix, accepted JUCE session, DSP/FX leases and renderer remain untouched. No second controller or transport.
  • tests/approved_device_pin_identity_contract.test.cjs: deterministic new tests for fully admitted-to-admitted reconnect, same-epoch vendor switch, exact uint64, M4/retained/offline authority transitions, same-epoch gesture preservation, and single-bridge ownership.

Non-goals: JUCE/native PCM/DSP/ASIO/multi-device topology, CSS/HTML/PNG or visual redesign. One approved /preview/ remains unchanged. This is NOT a claim of physical ASIO reconnection FAT or a built installer.

Qualification/merge gate

Run Fast UI and Fast Native exact-HEAD plus existing /preview/ UI suite. Reconcile MV-11 #790 head and tests before merge. main promotion only after checks actually pass; physical device-switch, vendor ASIO, installer and two-device FAT remain NOT RUN.

Reconciled MV-11 + MV-12 exact-HEAD verification — 2026-11-18

Integration safety: No extra device manager, PCM graph, command controller or WebView transport. Expire only transient GUI requests on physical device/authority change; native saved state, FX instance leases, .smix and admitted audio remain authoritative.

@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: 1a66361
Status: ✅  Deploy successful!
Preview URL: https://3fe84f28.arsonmix.pages.dev
Branch Preview URL: https://refactor-mv12-native-lifecyc.arsonmix.pages.dev

View logs

Copy link
Copy Markdown
Owner Author

/arsonmix-ci ui fde9bbb

@masarray
masarray force-pushed the refactor/mv12-native-lifecycle-fence-20261118 branch from fde9bbb to 1a66361 Compare November 18, 2026 09:05

Copy link
Copy Markdown
Owner Author

/arsonmix-ci ui 1a66361

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

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant