Skip to content

Implement state checkpointing for CollectionNode#587

Draft
arcondello wants to merge 8 commits into
dwavesystems:mainfrom
arcondello:feature/decision-checkpoints
Draft

Implement state checkpointing for CollectionNode#587
arcondello wants to merge 8 commits into
dwavesystems:mainfrom
arcondello:feature/decision-checkpoints

Conversation

@arcondello

@arcondello arcondello commented Jul 17, 2026

Copy link
Copy Markdown
Member

Closes #510
Closes #552 by replacing it

AI Generation Disclosure

No AI was used to write the code. I intend to use it to review this PR.

@arcondello arcondello added the enhancement New feature or request label Jul 17, 2026
@arcondello
arcondello force-pushed the feature/decision-checkpoints branch from 6df7006 to 953304e Compare July 17, 2026 23:25

CollectionCheckpoint_::CollectionCheckpoint_(CollectionStateData_* state_ptr) :
updates_(),
drop_(state_ptr->all_updates_.size()), // so we ignore any updates added before we're made

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.

What happens if some mutations are made to the node, then you make a checkpoint (causing the drop_ to be set > 0), and then you revert, make more mutations, and commit? Won't this cause some updates to be "dropped" that are actually relevant to the checkpoint?

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.

Actually, I think I mean "make another checkpoint" as final step in the example rather than commit.

@arcondello arcondello Jul 20, 2026

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Yup! Good catch. Fixed in 214c5e2

@arcondello
arcondello force-pushed the feature/decision-checkpoints branch 2 times, most recently from b4679c2 to 214c5e2 Compare July 20, 2026 18:59
This avoids using GCC11 which had some bugs in their ranges
implementation.
@arcondello
arcondello force-pushed the feature/decision-checkpoints branch from 86b97e8 to 9cd035b Compare July 20, 2026 19:18
virtual ~NodeStateCheckpoint() = default;

/// Whether the checkpoint is still available to be used.
virtual bool valid() const = 0;

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This is unused and I should drop it.

@arcondello
arcondello force-pushed the feature/decision-checkpoints branch 2 times, most recently from f1aa563 to 06b9dc5 Compare July 21, 2026 21:20
@arcondello
arcondello force-pushed the feature/decision-checkpoints branch from 06b9dc5 to f70699e Compare July 21, 2026 21:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add checkpointing method(s) for decision array nodes

2 participants