Skip to content

feat: Cbor restart file - #2596

Open
rprospero wants to merge 4 commits into
develop2from
cbor-restart-file
Open

feat: Cbor restart file#2596
rprospero wants to merge 4 commits into
develop2from
cbor-restart-file

Conversation

@rprospero

Copy link
Copy Markdown
Contributor

This PR puts in the framework for saving and loading restart files/directories. Nodes can overload virtual functions to save information to a restart file (which is named after the Node).

Currently, only the state of the configuration is saved, but other nodes will likely need restart information as well. Also, there's a larger question about when to save and/or load restart files. I suspect that it will need to go into IteratorGraph, but there are still some questions about how loading will work.

@rprospero rprospero changed the title feature: Cbor restart file feat: Cbor restart file Aug 25, 2026
@rprospero
rprospero marked this pull request as ready for review August 25, 2026 08:35

@trisyoungs trisyoungs left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The intent here is good, I think, but it brings up a discussion regarding the data sources we need to serialise into a node restart file (incidentally, I think we should move away from calling this data "restart" data, and think about it just in terms of "data the node needs to save to ensure its state").

What you have here focuses quite rightly on the core member variable data of Configuration - although the finished product needs Molecule-centred information rather than Atomic data which brings its own complications. This data isn't calculated per se - it's inherent to the object. Other nodes specifically calculate data - this is already captured to a large degree with the addSerialisable(), serialiseData() and deserialiseData() functions, so to generate a full restart state packet for a node in general both the inner and "calculated" data must be written.

Comment thread tests/nodes/restart.cpp
std::vector<ConfigurationAtom> after = configNode->configuration().atoms();

auto getR = [](const auto x) { return x.r(); };
EXPECT_TRUE(std::ranges::equal(before | std::views::transform(getR), after | std::views::transform(getR)));

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a lovely little construction!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants