Skip to content

Add FiberSequencer::reset#111

Open
vadimskipin wants to merge 1 commit into
mainfrom
vskipin/sequencer-reset
Open

Add FiberSequencer::reset#111
vadimskipin wants to merge 1 commit into
mainfrom
vskipin/sequencer-reset

Conversation

@vadimskipin

Copy link
Copy Markdown
Collaborator

Rebase the counter to an arbitrary value, up or down, under a caller- guaranteed quiescence contract: no registered waiter (asserted against the waiter tree) and no concurrent operation. advance stays monotone; reset serves callers that re-derive a baseline, like a storage recovery attempt whose durable prefix legitimately regresses.

Rebase the counter to an arbitrary value, up or down, under a caller-
guaranteed quiescence contract: no registered waiter (asserted against
the waiter tree) and no concurrent operation. advance stays monotone;
reset serves callers that re-derive a baseline, like a storage
recovery attempt whose durable prefix legitimately regresses.
@praktika-gh

praktika-gh Bot commented Jul 24, 2026

Copy link
Copy Markdown

Workflow [PR], commit [74575f2]

Summary:

job_name test_name status info comment
Test AMD (asan) FAIL
Bench FAIL

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Adds a FiberSequencer::reset() API to explicitly rebase the sequencer counter (including decreasing it) under a caller-enforced quiescence contract, and validates the behavior with a new unit test.

Changes:

  • Add FiberSequencer::reset(uint64_t) public API and implementation to set the counter to an arbitrary value.
  • Add a unit test covering rebasing the counter downward and re-waiting/advancing to re-satisfy tokens.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
src/fibers/tests/sequencer-test.cpp Adds a test that rebases the counter downward and verifies wait/advance behavior afterwards.
src/fibers/sequencer.cpp Implements FiberSequencer::reset() with a quiescence assertion and counter store.
include/silk/fibers/sequencer.h Declares reset() and documents the intended quiescence contract.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/fibers/sequencer.cpp
Comment on lines +10 to +14
void FiberSequencer::reset(uint64_t value) noexcept
{
SILK_ASSERT(waiters.empty());
counter.store(value, std::memory_order_release);
}
Comment on lines +129 to +132
/**
* Rebase the counter to @p value, up or down. The caller guarantees quiescence: no registered waiter
* and no concurrent increment / advance / wait.
*/
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