Repository navigation
12.1: save and restore pipeline - #16
Merged
Merged
Conversation
A live process that computes features must save their state with its input position and continue after a restart. Without saved state it can only replay recent history, and filters with infinite memory (ema, kalman, cusum, bocpd, ...) and running sums then give other values than a run without the restart, so backfill and live features differ. The serde feature derives Serialize and Deserialize for every view. Serde covers arrays of up to 32 elements only, so the two 50-element arrays of the Hilbert transform views use a small serde_array helper. Tests save views with bincode at many points and check that they continue with the same bits as views that run without a break. CI also runs the tests with all features, because the default run skips them.
A process that computes features from a pipeline must continue after a restart with the same values as without it, so that backfilled and live features agree. Pipeline::save_state returns a PipelineState: the states of the views, the last values, and the identity of the pipeline (its inputs in order and its canonical text). Pipeline::restore_state continues from it in a pipeline compiled from the same text. It rejects a state of another pipeline, of another format or with other operations and then leaves the pipeline unchanged. Feature delegates to both. The program is not saved with the state, because the caller's text is the source of truth, and a saved program could carry indices that do not fit. With the serde feature PipelineState is serializable. Tests move a pipeline that calls every function at two parameter sets to a fresh pipeline compiled from its text, after every update and at longer steps, in memory and through bincode, and check every output bit for bit. The README documents the API and why the format must keep f64 exact and NaN.
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.
No description provided.