Skip to content

SEP 47: Backend-owned execution sessions #588

Open

Description

@jtravs

Tracks SEP 47: Backend-owned execution sessions, proposal PR #589.

Make the backend the sole owner of a propagation's mutable numerical state and schedule. Python constructs the scientific problem and handles files, reporters and external callbacks. Native owns its complete numerical session, including controller/monitor state, observations, accounting, export preparation and workspace lifetime. NumPy uses an independent host session in both retained precisions; native has no host-over-native kernel executor. MLX is retired early without an adapter or numerical migration/qualification work.

Where it stands

  • Status: Draft. Review: In review, with both Opus 5.5 reviews and individual responses to R1–R17 and A1–A6 recorded in Part III. The re-review accepts the original responses; its remaining checkpoint/device-scope gaps and smaller corrections are addressed. Implementation: not started.
  • Requires: SEPs 21, 22, 24, 25, 29, 33, 39, 44, 45 and 46. SEP 46 / SEP 46: calibrating the native backend to its machine #582 is now Final.
  • Revised against main at eee57c65. Original measurements retain their own baseline and window.
  • Reports were read, not rerun. No new performance measurement or universal speedup is claimed.

What comes next

Agreed direction — 2026-11-09

  • Complete backend-owned numerical sessions; structured scientific descriptions with backend-owned packing/execution; private backend layouts.
  • Native session only. Custom Python controllers and benchmark-only comparison methods remain reference-only. Built-in production capabilities, including coupled flows and carrier tables, are ported.
  • Explicit group ownership and coarse native scheduling, preserving the existing distinction between per-member boundary outcomes and group-fatal numerical failures.
  • API compatibility is not a constraint. Freely break APIs for cleaner code or structure; keep solprop working and tests meaningful/passing, update callers and documentation, and list changes in the changelog. No shims, deprecation periods or migration guides.
  • Record restart retention/restoration/reset decisions and reasons, with one warning on resume for unexpectedly omitted Adams history. Full RK continuation is separate work in Qualify full Runge–Kutta checkpoint continuation #596.
  • Native atomic stop token checked between attempts, finishing the current attempt safely; retain bounded returns for Python signals. Snapshot requests are independent of step_planes=1 and persist valid checkpoint/history before copying.
  • Retire MLX at the start of phase 2. Retain NumPy single precision; Julia is a separate future possibility, not a replacement dependency.
  • Include A saved plane of a large Cartesian field costs about 3 s in copies, and a kept native save on Linux is unexplained #346 copy reduction, The node chunk is sized at translation, whatever the device, and each chunk is a kernel launch #361 backend-owned device chunks and the measured Native CPU: a stage's forward transforms as one batched region (#560 item 4) #584 CPU transform experiment. They need no separate prerequisite PRs; a documented negative Native CPU: a stage's forward transforms as one batched region (#560 item 4) #584 result does not block the architecture. Attribute their gains separately from session changes.
  • Phase 1 is a design-readiness checkpoint: single ownership, lifecycle correctness, bounded traffic/storage, deletion plan and small difficult-case probes. A sound prototype with neutral performance can proceed; protocol defects are revised, and unavoidable tradeoffs come to the maintainer with context and alternatives.
  • Land descriptors/reference/service loop early (phases 1–2); common native observations/export/groups follow (phase 3); bulk difficult ports and CUDA/HIP qualification come later (phase 4). Timeboxes trigger reports and explicit decisions, never automatic capability cuts. Final deletion and qualification are phase 5.
  • Structural simplification is a valid primary benefit. Exact identical-input controller/lifecycle tests accompany independent numerical qualification. Per-case and aggregate non-regression checks prevent small widespread slowdowns being hidden by the 5% investigation threshold.

These decisions do not constitute formal acceptance of the whole proposal. The SEP remains Draft until John Travers has read it and explicitly requests acceptance.

Related

Drafting or accepting the SEP does not close implementation issues.

Done when

The SEP reaches Final, Rejected, Withdrawn or Superseded, and this tracking issue closes with it. A Deferred SEP keeps it open. At Final, replaced driver machinery and transitional adapters are removed, the admitted capabilities are working, and numerical, lifecycle, export, actual-device and performance qualification is complete.

Activity

  1. added
    priority: mediumReal work that should not wait long
    performanceSlower or larger than it should be, with no wrong result
    refactorInternal restructuring with no change in behaviour
    area: nativeThe native backend, threading and FFT planning
    sepTracks an enhancement proposal (SEP)
    on Nov 8, 2026
  2. jtravs commented on Nov 9, 2026

    @jtravs
    ContributorAuthor

    Implementation started: milestone 1 (phases 1–2) is draft PR #605 on feature/sep-0047-contract. Phase 3 (native session) is developed on a branch stacked on it plus #598 and #602.

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: nativeThe native backend, threading and FFT planningperformanceSlower or larger than it should be, with no wrong resultpriority: mediumReal work that should not wait longrefactorInternal restructuring with no change in behavioursepTracks an enhancement proposal (SEP)

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions