Skip to content

P1E: real ASIO/WASAPI 10-channel DRY routing LAB with native ACK, epoch-safe RT graph - #119

Closed
masarray wants to merge 24 commits into
mainfrom
feature/p1e-live-port-registry-epoch-20261028
Closed

masarray wants to merge 24 commits into
mainfrom
feature/p1e-live-port-registry-epoch-20261028

Conversation

@masarray

Copy link
Copy Markdown
Owner

P1E MAJOR MILESTONE — native real hardware 10-channel DRY routing FAT, not another offline prototype

This PR connects the already merged P1D immutable 10-strip physical mono/stereo mixer to the real JUCE audio callback behind an explicit operator-controlled DRY ROUTING LAB. The original CH1 VST3 production path is completely unchanged and remains default whenever LAB is OFF.

Delivered

  • Opened ASIO/WASAPI device's actual enabled physical input channel mask → packed callback-port mapping, with strict zero-based physical identities, 256-port limit and per-device monotonic epoch fence.
  • P1D prepared DSP executes on the audio callback: up to ten independent mono/stereo physical input assignments → individual low-level channel paths → stereo output channels 1/2. Unassigned channels are truly silent, other output channels cleared; no VST3, no AUX/send or phantom GUI meters.
  • Off-RT prepared routing graph compile, revision+epoch ACK/reject and atomic publication. Reader-held graphs are retired off callback, bounded backlog; stale device/hotplug renders silence instead of falling back to CH1.
  • User-accessible SIGNAL CHECK → ROUTING LAB · 10 CH inspector with ten independent MONO/STEREO/NONE assignments, real available hardware port dropdowns, per-channel test gain, APPLY/STOP and native ACK. No changes to the approved 10-strip GUI geometry, faders or FX rack artwork; no blur or new animation timers.
  • Fail-closed: APPLY requires OUTPUT MUTED and zero loaded VST3; LAB blocks Add/Remove VST3, preset recall/save, clock switching, other diagnostic modes. STOP explicitly mutes output before restoring the old CH1 path. 256-sample bounded route-revision fade, truthful STALE flag.
  • New Release assertion-safe C++ test for sparse physical masks, device epochs, graph revisions, held-reader safe retirement, 8000 rapid edit transactions, and concurrent publisher/RT-reader loops. New Node UI contract. Added to existing Windows CI, no extra jobs. Full real-device FAT instructions docs/P1E_NATIVE_DRY_LAB_FAT_20261028.md.

Cross-thread reconciliation: starts from merged P1D #114 d30cf35 and merges current main 4951f3b preserving P3 Backup #116 and pre-fader/DAG correction #118. Old GUI/FX #102 remains isolated. P0 zero-VST crackle #15 is still a physical release gate.

Scope guards

This is an actual live dry-routing path but an opt-in hardware diagnostic, NOT full performance mode. No independent 10× VST3 chains, AUX sends, per-strip production fader binding, automatic external port restore, guaranteed click-free physical operation or hardware-verified output. No final artifact/HW FAT claim without exact-head Windows CTest, Chromium and user physical interface exercise.

Acceptance gate

  • Exact PR-head Windows MSVC Release full native CTest (includes bypass de-click, Orbit, Studio backup) PASS
  • Chromium UI/parity PASS, JS syntax and native routing contract PASS
  • No concurrent main regressions before merge, no overwrite of PR Fix P0: true DAW FX insert drag, atomic realtime order, flat fader recess & single-instance #102
  • Artifact from exact passing head available in Actions for real-device FAT, not stale artifact
  • Hardware FAT owner required before qualifying audio quality

Refs #109 #95 #15 #85.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

Codex Review Summary

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-28T00:12:17.026660Z a311c36 PR opened
ℹ️ 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.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a311c36ab2

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread engine/core/RealtimeRoutePublisher.h Outdated
Comment on lines +97 to +98
if(readers_.load(std::memory_order_acquire)!=0) return false;
for(std::size_t i=0;i<retiredCount_;++i) retired_[i].reset();

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Synchronize graph reclamation with concurrent reader entry

During concurrent publication and audio processing, this acquire-only reader-count check does not establish sufficient ordering with active_ publication and ReadLease entry: the control thread can observe zero readers while a reader still acquires a retired snapshot, then free that snapshot underneath it. I reproduced a heap-use-after-free in SpyGraph::value by running the new publisher test with AddressSanitizer and increasing its concurrent publication loop from 1,000 to 1,000,000 iterations. Use a proven reclamation protocol with the required cross-atomic ordering so callback-held snapshots cannot be destroyed.

Useful? React with 👍 / 👎.

Comment thread web/monitor.js
Comment on lines +128 to +130
api.emitEvent("arMixAction",{action:"routingDryApply",value:{
deviceEpoch:Number(d.epoch)||0,revision:Number(d.revision)||0,
channels:draftRoutes.map(c=>({...c}))

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Bind routing drafts to the device epoch they were drawn from

If the device changes while the routing inspector is open, arMixStatus replaces state and updates the displayed epoch, but the dropdowns and draftRoutes still describe the previous device. APPLY then sends those old assignments with the new device's epoch, bypassing the native stale-device rejection. When both devices have the same numeric port IDs, the command succeeds against different physical inputs without the operator remapping them. Capture the epoch when drawing the draft and invalidate or rebuild the assignments when that epoch changes instead of substituting the latest epoch at submission.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Owner Author

Cross-thread reconciliation 2026-10-28: do not merge this stale branch wholesale. It has Windows CI PASS but UI smoke FAILURE 40608546037, and predates merged #120 fader baseline. The exact P1E-only changed blobs were moved to PR #121, based on current main@61b2971; SHA comparisons confirmed its five shared source files had no independent main drift. #121 preserves current UI smoke/Orbit/meter/FX de-click/backup; Chromium/Firefox PASS, Windows CI still running. When #121 passes and merges, close #119 as superseded. Actual 10-channel physical FAT and #15 zero-VST crackle still require hardware tests.

Copy link
Copy Markdown
Owner Author

Superseded and fully integrated via PR #121, merged at main@e5c95a90441471cfd5d866c106a3ee9dba4c8fb3. #121 was rebuilt on latest approved GUI rather than old #119 source; it fixed the stale UI baseline and two valid audio safety review findings (STOP race must zero output, MUTE must block old fade). Exact PR-head Chromium/Firefox and Windows MSVC CTests PASS (40615893589 / 40615893553); final-main CI is running (40616813262 / 40616813252). Closing this stale PR to avoid accidental overwrite/redundant merges. Real hardware lab FAT remains pending.

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