Make the automation release's publish-ordering rule a compile-time guard, not an assert

The assert compiled out under Release's NDEBUG and ran in no test target.
AutomationChannel::release now requires a ReleaseProof that only
publishLiveParams() or noRepublishNeeded() can mint.
This commit is contained in:
2026-08-02 19:36:32 -04:00
parent 9b5393098b
commit 056c60c8e1
4 changed files with 49 additions and 30 deletions
+11 -6
View File
@@ -276,16 +276,21 @@ void ReaSamplerProcessor::clearMasterBusClip() {
meterClip_.store(false, std::memory_order_relaxed);
}
void ReaSamplerProcessor::publishLiveParams() {
AutomationChannel::ReleaseProof ReaSamplerProcessor::publishLiveParams() {
const int rate = builtSampleRate_.load(std::memory_order_relaxed);
if (rate <= 0) return;
if (rate <= 0) return AutomationChannel::ReleaseProof::noRepublishNeeded();
const std::uint32_t before = liveParams_.generation();
const InstrumentParams params = instrumentParams();
const instrument::engine::LiveValues block =
instrument::engine::foldLive(resolvePlay(params.play, rate), params.keyTrack);
// livePublishMutex_ enforces the seqlock's single-writer contract (live_params.h) against
// reloadInstrument's publish — held for the publish call only, not the fold above.
std::lock_guard<std::mutex> lock(livePublishMutex_);
liveParams_.publish(block);
{
// livePublishMutex_ enforces the seqlock's single-writer contract (live_params.h)
// against reloadInstrument's publish — held for the publish call only, not the fold
// above.
std::lock_guard<std::mutex> lock(livePublishMutex_);
liveParams_.publish(block);
}
return AutomationChannel::ReleaseProof::fromPublish(before, liveParams_.generation());
}
SampleRefs ReaSamplerProcessor::sampleRefs() {