Skip to content

reshuffle-sim: model confirmation & portal catch-up lag (multistep)#48

Open
define-null wants to merge 1 commit into
defnull/net-681-multi-step-scheduling-3from
defnull/reshuffle-sim-confirmation
Open

reshuffle-sim: model confirmation & portal catch-up lag (multistep)#48
define-null wants to merge 1 commit into
defnull/net-681-multi-step-scheduling-3from
defnull/reshuffle-sim-confirmation

Conversation

@define-null

@define-null define-null commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

What is this PR about?

stacked on top of #46

The reshuffle-sim's multistep path confirmed every assignment the instant it published it, so a superseded copy was cleared to drain the same step it was replaced — reshuffles looked free. That's the "0 confirmation percent" case: the scheduler never waits for workers to download the new copies, nor for the portal to route to them, before removing the old ones. In production both take time, during which old and new copies coexist and occupy capacity.

This adds two knobs (multistep only) that model that lag as whole simulation steps by holding back the storage's monotonic confirmation watermark:

  • confirm_lag_steps — steps the fleet takes to download a published assignment.
  • portal_lag_steps — extra steps for the portal to route a confirmed assignment before its superseded copies may drain.

run_cycle now records each publication in order and confirms only the id confirm_lag_steps + portal_lag_steps cycles back (clamped to the baseline), instead of pinning the watermark to the newest assignment. Everything else — stale accumulation, drains, capacity — falls out of the existing MVCC storage, which already handles delayed confirmation (that's what the property tests exercise).

Both knobs default to 0, which confirms the just-published assignment — the previous confirm-immediately behaviour, byte-identical. The overhang surfaces in the existing Stale (% cap) / used % columns, so no report plumbing changed. The stateless path has no watermark, so the knobs are validated as multistep-only.

The multistep path confirmed every assignment the instant it published it, so a
superseded copy drained the same step it was replaced — reshuffles looked free.
That is the "0 confirmation percent" case: the scheduler never waits for workers.

Add two uniform step-delay knobs that hold back the storage's confirmation
watermark, so superseded copies keep occupying capacity until the fleet+portal
catch up:

- confirm_lag_steps — steps the fleet takes to download a published assignment.
- portal_lag_steps  — extra steps for the portal to route it before the old
  copies may drain.

run_cycle records each publication and confirms only the id (confirm_lag_steps +
portal_lag_steps) cycles back (clamped to the baseline). Both default to 0, which
confirms the just-published assignment — the previous behaviour, byte-identical.
The overhang surfaces in the existing Stale/used-% columns; a higher lag inflates
them and can bring a capacity shortage forward. Multistep only (the stateless path
has no watermark); validated as such.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.

1 participant