Skip to content

spawn resume: relaunched params are recorded by position in the pending list, not their parameter index (and TotalParams shrinks) #1248

Closed

Description

@scttfrdmn

Found while reviewing #1234 (resume region fix). Confirmed by reading origin/main; not reproduced on AWS.

The bug:

  • spawn resume builds launch configs only for the pending parameter indices (cmd/resume.go, the for _, idx := range pending loop). It then calls launchWithRollingQueue(ctx, …, launchConfigs, …).
  • That function writes the sweep state from scratch (cmd/launch_sweep.go ~650–670):
    • TotalParams: len(launchConfigs) is the size of the pending subset, not the sweep's size.
    • Each instance is recorded as Index: i, its position in the subset, not the parameter index it was launched for.
  • Example: resume a 10-parameter sweep where params 3 and 7 are pending. The new state says TotalParams=2, with instances at Index 0 and 1.

Consequences:

  • A second spawn resume (or status) reads that state, believes parameters 0 and 1 ran and the others are unknown or pending.
  • It can therefore relaunch parameters that already completed, which is a duplicate-compute cost, and it loses the record of 3 and 7.
  • The sweep's progress counts are wrong after any resume.

Fix:

  • Pass each pending config's real parameter index through to the recorder, e.g. a parallel []int of indices, or an Index field on the launch config.
  • On resume, merge into the existing state instead of overwriting it, keeping the completed and running instances and the original TotalParams.

Gate:

  • Resume a sweep state with completed {0,1,2,4,5,6,8,9} and pending {3,7}.
  • After the relaunch the state must still have TotalParams=10, and must record the new instances at Index 3 and 7.
  • A second reconcile must find nothing pending.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions