Skip to content

Execution shapes: job-array --min-viable is missing, MPI is tag-only (and MPI orchestration should not be chased) #52

Closed

Description

@scttfrdmn

Execution shape is the researcher-facing question — "how do I run this", not "which instance type". This issue records where spawn-ts stands on each of the three shapes, so the two genuinely-portable gaps are visible and the one non-gap isn't chased.

Single node — tier A

src/aws/ec2.ts:78 launch() → RunInstances with the lifecycle tag set. At parity modulo #51 (the identity tags) and the deliberate tier-C/D omissions (FSx, DCV, on-node staging).

Job array — tier B, one real gap: --min-viable

src/core/jobarray.ts ports the launch path faithfully — generateJobArrayId matches the Go <name>-<YYYYMMDD>-<6hex> shape, buildJobArray stamps the spawn:job-array-* contract, and the header at line 11 already scopes out logs/collect/retry --failed as needing a node shell or a persisted record.

What's missing is the partial-cohort contract. Go routes a plain array through buildCohort (cmd/launch_jobarray.go:572):

mv := minViable
if mv < 1 { mv = 1 }
if mv > len(members) { mv = len(members) }
// nil Assembler: a plain array has no collective assembly phase, so a partial
// cohort is legal (NewPartialCohort rejects a non-nil Assembler).
return cohort.NewPartialCohort(cohort.CohortID(jobArrayID), members, cohortBudget(spec), mv, nil)

--min-viable is a threshold on the whole array: fewer than mv members up ⇒ the array is not viable and the launched members are wound down. FanOut has no equivalent. Its closest knob is onFailure (src/core/fanout.ts:75), which is "continue" | "stop" — a per-member policy that decides whether to keep launching, and stopping leaves the already-launched members running. So an array that comes up 2-of-100 in spawn-ts is reported as a mostly-failed array with 2 billable instances alive, where Go would have declined it as non-viable.

That is cost-safety-relevant, which is why it's tier B rather than a nicety. The port is small and pure — a minViable?: number on the fan-out options plus a viability check in summary() — but it must be clamped exactly as Go clamps it, and the sparse-index consequence has to be handled: cmd/arraygroup.go:99 and :224 both exist specifically to reason about "an index with no live member — the gap a --min-viable partial launch leaves behind". A port that adds the threshold without teaching the summary about index gaps trades one wrong answer for another.

MPI — tier C/D, and deliberately not a porting task

This is the one to not chase, and the reason is upstream, not browser-side.

spawn/pkg/mpicohort/adapter.go (496 lines in pkg/mpicohort/) is a self-declared spike. It does not replace launchJobArray: Go's launch still branches at cmd/launch_single.go:717 into launchMPICohort vs launchPlainArrayCohort, and the adapter's own header flags the unresolved design problem — cohort's Placement is per-entity, but an MPI cluster's placement group and EFA fabric are collective constraints. One rank's placement is not independent of another's; the current abstraction can't express that.

Porting a spike would mean committing spawn-ts to a shape Go is still deciding. The honest classification is "spike upstream, don't chase it".

What is portable now, and worth doing, is the tag half. Go stamps two tags at cmd/launch_single.go:704:

config.Tags["spawn:mpi-enabled"] = "true"
if mpiProcessesPerNode > 0 {
	config.Tags["spawn:mpi-processes-per-node"] = fmt.Sprintf("%d", mpiProcessesPerNode)
}

Neither exists in spawn-ts. Emitting them (tier C — write the tag, spored acts) lets a spawn-ts-launched array be recognised as MPI by the CLI and the portal even though the browser can't orchestrate the collective launch.

The other collective knobs Go validates in that same block are honestly out of reach and should be documented as such rather than half-ported:

  • EFA — ValidateInstanceTypeForEFAInRegion (launch_single.go:685) must run in the launch region, because some HPC types only exist in specific regions and DescribeInstanceTypes returns InvalidInstanceType when queried cross-region (#307). truffle-ts could supply this, but only after truffle-ts#33 gives InstanceType a region identity.
  • Placement groups — --auto-placement-group creates a real AWS resource. Provisioning, so tier D by the same line drawn for FSx.

Summary

shape tier gap
single node A — (see #51)
job array B --min-viable partial-cohort threshold + sparse-index awareness
MPI orchestration D upstream spike; per-entity vs collective placement unresolved
MPI tags (spawn:mpi-enabled, spawn:mpi-processes-per-node) C not emitted — small, do it
EFA validation D→B blocked on truffle-ts#33 (region identity)
placement groups D provisioning

Part of the parity audit.

Activity

  1. added
    enhancement
    area: core
    cost-safety
    on Jul 31, 2026
  2. scttfrdmn commented on Jul 31, 2026

    @scttfrdmn
    ContributorAuthor

    Part of #57 (spawn-ts vs spawn parity audit).

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: corecost-safetyenhancement

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions