ossia: do not queue control outputs nobody reads - #208
Merged
Merged
Conversation
finish_run enqueues the control outputs onto outs_queue on every tick where any of them was written. The host does not always install a reader -- score only does so when its "execution update" setting is on -- and an unread moodycamel queue grows without bound, allocating a block inside the audio callback every few hundred ticks. A node that writes a control output every tick, which is the natural shape for a playhead or a meter, therefore leaks for the length of the run. Let the host say whether anything is listening; default true, so a binding that does not set it behaves as before. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01H4N6KsxzvT1o9qoPvBThyz
jcelerier
added a commit
to ossia/score
that referenced
this pull request
Sep 21, 2026
celtera/avendish#208 merged with a rebase, so the commit the pointer named only ever existed on its PR branch. Point at what landed on main instead, before that branch goes away and the submodule stops resolving. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01H4N6KsxzvT1o9qoPvBThyz
jcelerier
added a commit
to ossia/score
that referenced
this pull request
Sep 21, 2026
celtera/avendish#208 merged with a rebase, so the commit the pointer named only ever existed on its PR branch. Point at what landed on main instead, before that branch goes away and the submodule stops resolving. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01H4N6KsxzvT1o9qoPvBThyz
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
finish_runenqueues the control outputs ontoouts_queueon every tick where any of them was written. The host does not always install a reader — ossia score only does so when its execution update setting is on — and an unread moodycamel queue grows without bound, allocating a block inside the audio callback every few hundred ticks.A node that writes a control output every tick, which is the natural shape for a playhead or a meter, therefore leaks for the length of the run.
controls_output_queue<T>gains:std::atomic_bool notify_ui{true};checked before the enqueue. The
outputs_setbitset is still set and reset as before — it costs nothing and other code reads it; it is the enqueue that allocates.Defaults to
true, so every binding that does not set it (Max, PD, VST, standalone) behaves exactly as today. Only a host that explicitly opts out is affected.Read on the audio thread, written by the host at setup; relaxed ordering is sufficient, since a stale read costs at most one extra or one skipped enqueue and nothing else depends on the ordering.
Needed by ossia/score#2295, which sets it from the setting that decides whether the reader is installed.
🤖 Generated with Claude Code
https://claude.ai/code/session_01H4N6KsxzvT1o9qoPvBThyz