solprop.driver.session_loop#
The session loop: Python’s side of an execution session (SEP 47 section 5).
Not to be confused with solprop.service, the front end’s service. A session
(solprop.backends.session) owns the run’s numerical state and its schedule;
serve() advances it and services what it reports (saved planes and their output
transactions, plane observers and progress, snapshot persistence, warnings and the
terminal record), then acknowledges each batch, with what it needs besides the session
and the output in a ServiceContext. It holds no numerical state of its own: it
never rediscovers the next plane, rebuilds a statistic or replays the attempts to
reconstruct a controller. _Exports shares one export per pending ticket among its
consumers, _Chunks gathers the attempts and rows since the last plane,
_MarchKeeper keeps the Adams march’s state beside each save, and _Status and
MONITOR_RECONSTRUCTED feed the execution record. Ordering follows SEP 47
section 5.3: a plane is committed with its method history and its execution record in
one transaction (solprop._interrupts.committing); a snapshot is serviced after that
commit; the plane observer and the reporter follow. A service failure leaves the batch
unacknowledged, so the field it names can still be exported for the terminal
checkpoint, and the primary failure is preserved.
Module Attributes
How a resumed execution's boundary monitor was restored (SEP 47 section 5.5). |
Functions
|
Advance a session to its end, servicing every event it reports. |
Classes
|
What the service loop needs besides the session and the output. |
- solprop.driver.session_loop.MONITOR_RECONSTRUCTED = {'reason': 'persisted_records', 'restarted': ['check_cadence', 'transverse_cap'], 'restored': ['cumulative_totals', 'quiet_state', 'transverse_record'], 'state': 'reconstructed'}#
How a resumed execution’s boundary monitor was restored (SEP 47 section 5.5).
Today’s reconstruction from the persisted records: the cumulative totals, the quiet state and the transverse record are restored, and the check cadence and the transverse cap restart from that restored state; persisting them is not claimed.
- class solprop.driver.session_loop.ServiceContext(problem, request, metadata, reporter, retention, resume_history, snapshots, tdse_binding, tdse_archive, recipe, start_plane, stop=None, restoration=None, interpolated_resume=False)[source]#
Bases:
objectWhat the service loop needs besides the session and the output.
- Attributes:
- problemsolprop.translate.problem.PropagationProblem
The translated problem.
- requestsolprop.translate.run_request.RunRequest
The run’s policies.
- metadatasolprop.output.metadata.RunMetadata
The run’s record.
- reportersolprop.log.ProgressReporter
Where progress goes.
- retentionsolprop.output.store.FieldRetention
Which planes keep their field.
- resume_historybool or None
The public method-history retention choice.
- snapshotssolprop.output.snapshots.SnapshotController or None
Snapshot requests, when enabled.
- tdse_bindingsolprop.translate.tdse.TDSEBinding or None
A live atomic runtime.
- tdse_archivesolprop.output.tdse_archive.TDSEArchiveWriter or None
A live archive to suspend beside the optical writer.
- recipesolprop.output.records.RecipeRecord or None
The recipe the run was built from.
- start_planeint
The first save plane beyond the starting state.
- stopsolprop.log.StopFlag or None
The run’s stop flag, polled between batches as well as inside the session.
- restorationcollections.abc.Mapping or None, optional
What a resumed execution restored of the method history (
solprop.driver.resume._continue_march), for its execution record;Nonefor a fresh run or a caller that says nothing.- interpolated_resumebool, optional
Whether a resumed run continues afresh from a plane interpolated inside a step (
resume="interpolated"), whose position a plane store then records before the first step.
- metadata: RunMetadata#
- problem: PropagationProblem#
- recipe: RecipeRecord | None#
- reporter: ProgressReporter#
- request: RunRequest#
- retention: FieldRetention#
- snapshots: SnapshotController | None#
- tdse_archive: TDSEArchiveWriter | None#
- tdse_binding: TDSEBinding | None#
- solprop.driver.session_loop.serve(session, output, context)[source]#
Advance a session to its end, servicing every event it reports.
Any
RunSessionis served – the reference’sHostSessionor the native backend’s – through its protocol alone (SessionFacts).- Parameters:
- sessionsolprop.backends.session.RunSession
The started session.
- outputsolprop.output.store.Output
Where the planes go; closed when the loop ends, whether or not it succeeded.
- contextServiceContext
Everything else the service needs.
- Raises:
- BaseException
The run’s primary failure, a stop request or a signal, after its terminal record and any checkpoint are written.