Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
15 commits
Select commit Hold shift + click to select a range
b6e992f
feat(wire): stable EdgeId and atomic native WIRE transaction on exist…
masarray Nov 4, 2026
59a02b2
feat(wire): atomically publish native WIRE batch through existing acc…
masarray Nov 4, 2026
b359d2c
feat(wire): project exact stable edge IDs from accepted native routing
masarray Nov 4, 2026
a307831
test(wire): native atomic MAIN detach, fan-out, 3-hop sample alignmen…
masarray Nov 4, 2026
de5c4ac
feat(wire): apply canonical atomic WIRE to installed JUCE ChannelId P…
masarray Nov 4, 2026
ca0fa07
feat(wire): route JUCE native intent into real ChannelId PCM publication
masarray Nov 4, 2026
5bc0807
feat(wire): strict native WebView WIRE batch decoding and epoch-fence…
masarray Nov 4, 2026
baeddf0
feat(wire): advertise only installed scoped native WIRE transaction
masarray Nov 4, 2026
6ee19f7
test(wire): native WebView batch ACK exact edge IDs and malformed int…
masarray Nov 4, 2026
d31f7c7
feat(wire): one-transaction default MAIN edge for new native channels
masarray Nov 4, 2026
7ec8c77
fix(wire): atomically create native input and MAIN edge in one accept…
masarray Nov 4, 2026
b8ebf19
test(wire): default MAIN edge created exactly once, saved disconnecte…
masarray Nov 4, 2026
af2823b
test(wire): expose exact native feedback rejection fault without weak…
masarray Nov 4, 2026
4eeac29
fix(wire): reject stale device before edits, preserve MAIN edge ID an…
masarray Nov 4, 2026
de347b3
feat(wire): publish verified internal routing while output armed with…
masarray Nov 4, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
65 changes: 62 additions & 3 deletions engine/core/DynamicAcceptedSession.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,61 @@ class DynamicAcceptedSession final {
std::move(result),std::move(fx));
}


// A single native structural operation over accepted ChannelSendRef.
// No JS DSP or independent router: same compiled PCM, routing readback,
// device epoch, revision and FX leases as all other native edit paths.
Result wireTransaction(std::uint64_t expectedRosterRevision,
std::uint64_t expectedGraphRevision,
std::span<const WireChange> changes,
const DynamicGraphRequest& route,
std::uint64_t expectedDeviceEpoch,
std::uint64_t activeDeviceEpoch,
bool allOutputsDisarmed,
DynamicNativeSessionPublisher::FxPlan fx={}) {
Result result=preflight(expectedRosterRevision,expectedGraphRevision);
if(!result.ok())return result;
// Validate the hardware generation BEFORE inspecting draft edge IDs.
// A stale request may reference an edge removed by a newer device
// epoch; return the stronger device fault without touching the graph.
if(!expectedDeviceEpoch || expectedDeviceEpoch!=activeDeviceEpoch) {
result.fault=Fault::graphRejected;
result.native.fault=DynamicNativeSessionPublisher::Fault::staleDevice;
result.native.revision=publisher_.acceptedRevision();
return result;
}
auto candidate=accepted_;
result.edit=candidate.wireTransaction(expectedRosterRevision,changes);
if(!result.edit.ok()) {
result.fault=Fault::editRejected;return result;
}
// Never trust an armed GUI candidate that quietly changes capture
// pins, DSP block capacity or device admission. Only pure internal
// edges can be published while hardware output is armed.
const bool samePhysical=
route.physicalInputs==acceptedRequest_.physicalInputs &&
route.maxFrames==acceptedRequest_.maxFrames &&
route.maxScratchBytes==acceptedRequest_.maxScratchBytes &&
route.mainMonoAfterFx==acceptedRequest_.mainMonoAfterFx &&
route.sources.size()==acceptedRequest_.sources.size() &&
std::equal(route.sources.begin(),route.sources.end(),
acceptedRequest_.sources.begin(),
[](const DynamicSourcePatch& lhs,const DynamicSourcePatch& rhs) {
return lhs.id==rhs.id && lhs.inputL==rhs.inputL &&
lhs.inputR==rhs.inputR && lhs.stereo==rhs.stereo;
});
if(!allOutputsDisarmed && !samePhysical) {
result.fault=Fault::graphRejected;
result.native.fault=DynamicNativeSessionPublisher::Fault::outputArmed;
result.native.revision=publisher_.acceptedRevision();
result.edit.createdEdgeIds.clear();
return result;
}
return publish(std::move(candidate),route,expectedGraphRevision,
expectedDeviceEpoch,activeDeviceEpoch,allOutputsDisarmed,
std::move(result),std::move(fx),samePhysical);
}

// Studio Pro: one independent Bus ChannelId and automatic assignment of
// selected primary OUTs; FX Return leaves those OUTs intact and adds sends.
Result createBusForSelected(std::uint64_t expectedRosterRevision,
Expand Down Expand Up @@ -221,7 +276,8 @@ class DynamicAcceptedSession final {
std::uint64_t previousGraphRevision,
std::uint64_t requestedEpoch,std::uint64_t currentEpoch,
bool outputsDisarmed,Result&& result,
DynamicNativeSessionPublisher::FxPlan fx) {
DynamicNativeSessionPublisher::FxPlan fx,
bool verifiedInternalWireOnly=false) {
// Existing SOURCE targets belong to the accepted native session.
// For already-patched ChannelIds with the same input format, ignore
// stale physical pin ordinals supplied by an old GUI draft during
Expand All @@ -236,6 +292,7 @@ class DynamicAcceptedSession final {
result.native.fault=DynamicNativeSessionPublisher::Fault::invalidCandidate;
result.native.revision=publisher_.acceptedRevision();
result.edit.createdIds.clear();
result.edit.createdEdgeIds.clear();
return result;
}
// A structural OUT/GROUP/Return edit does NOT implicitly change IN.
Expand All @@ -260,17 +317,19 @@ class DynamicAcceptedSession final {
result.native.graphError={DynamicGraphFault::invalidSource,source.id};
result.native.revision=publisher_.acceptedRevision();
result.edit.createdIds.clear();
result.edit.createdEdgeIds.clear();
return result; // old audible SOURCE and VST3 leases unchanged
}
}
auto effective=route; // CONTROL-only; preallocated before commit
const bool nextHasFx=static_cast<bool>(fx.owner);
result.native=publisher_.commit(candidate,effective,previousGraphRevision,
requestedEpoch,currentEpoch,outputsDisarmed,
std::move(fx));
std::move(fx),verifiedInternalWireOnly);
if(!result.native.ok()) {
result.fault=Fault::graphRejected;
result.edit.createdIds.clear(); // NEVER advertise phantom Bus
result.edit.createdIds.clear();
result.edit.createdEdgeIds.clear(); // NEVER advertise phantom Bus
return result; // candidate destroyed; accepted state intact
}
static_assert(std::is_nothrow_move_assignable_v<DynamicChannelRoster>);
Expand Down
Loading
Loading