Merged
Conversation
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.
This work was performed by Codex (GPT-5) in response to the prompt: "after reviewing agent_context.md, please analyze the app modalPSDs (app/modalPSDs) looking for data races, restart bugs, memory management problems, etc. This app routinely crashes when the inputs resize or are recreated."
Summary
This PR adds a fixed-size SPSC specialization for
mx::sigproc::circularBufferIndexto support low-latency, restart-safe producer/consumer handoff formodalPSDs.The new specialization is intended for:
maxEntries()Motivation
modalPSDsneeded a way to keep its steady-state source-pointer buffering zero-copy and low-overhead while still avoiding the unsynchronizedpush_back()/growth behavior and metadata races present in the generic dynamic circular-buffer path.This PR introduces a dedicated fixed-size SPSC mode rather than changing behavior for existing users of the legacy circular buffer.
Scope
The new specialization adds:
latest/nextEntry/validEntries/monopublication stateExisting non-fixed-size users remain on the legacy implementation.
Validation
This change was validated through the downstream
modalPSDsintegration and test pass in MagAO-X.Affected Files
include/sigproc/circularBuffer.hppFollow-Up / Edge Cases