fabric: efficiency and discipline fixes#43
Open
lePereT wants to merge 17 commits into
Open
Conversation
…Fabric reactor directly
…topics and wait on a single coalesced readiness channel
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.
I've taken the initial Fabric/update implementation and pulled it back into the shape of the original dc-go design: reactors remain shallow, readiness-driven, and non-blocking. HAL serial_raw is again only a UART/session byte pump; it no longer contains timing-based quiet drains. Fabric no longer relies on OTA quiet windows or silence periods to avoid corrupting transfers. Bus readiness is now coalesced through a SubscriptionSet, so Fabric can wake on real events without polling a periodic tick
(or adding a goroutine per subscription).
The transfer path has also been made much more efficient. Fabric no longer buffers a whole firmware image in RAM (possibly lethal on an RP2350). It streams chunks into an updater-owned A/B staging sink, asks for the next UART chunk only after the sink has accepted the current one, and uses a serialised sink worker so WriteChunk, Commit and Abort cannot race each other (RPi FW prob handles this but dangerous). Longer work such as flash staging, streamed commit and updater stage calls no longer runs inline in the Fabric session loop; completions and deadlines are explicit events. This restores the actualy boundary: Fabric owns the protocol and pacing, the updater owns verification and flash state, and neither leaks blocking work into the other’s reactor.