solprop.backends.host.marches#

What every reference march holds, and what it asks of its session (SEP 52).

A march – RungeKuttaMarch, HostAdamsMarch or HostLowStorageMarch – keeps its position, proposal, replay cursor and accepted norms in a MarchState of its own, hands every state-sized operation to its engine (solprop.backends.engines) and asks the session that schedules it (HostSession) only through the narrow MarchHost: whether to stop, how far a step may go, and what to record when an attempt ends. It touches no other object’s fields; the session reads its state, and holds the dense observation of a plane a step crossed (SEP 52 section 5.2).

Functions

in_flight_refusal(name, z, dz)

Return why a state a low-storage step left in flight cannot be used.

Classes

MarchHost(*args, **kwargs)

What a march asks of the session that schedules it.

MarchState(z, proposal[, cursor, norms])

A march's position, proposal, replay cursor and accepted norms (SEP 45 4.2).

class solprop.backends.host.marches.MarchHost(*args, **kwargs)[source]#

Bases: Protocol

What a march asks of the session that schedules it.

The reference’s session implements it (HostSession); a decision-trace harness scripts it.

absorb(record)[source]#

Accumulate an accepted step’s split collar’s sums (SEP 52 section 5.2).

Parameters:
recordsolprop.backends.engines.AcceptRecord

What the step’s finish reported.

cap(proposal, z)[source]#

Return a proposal held to the boundary monitor’s and the edge’s limits.

Parameters:
proposalfloat

The controller’s proposal, m.

zfloat

Where the step starts, m.

Returns:
float

The proposal, or the quiet collar’s interval, the transverse edge’s read spacing or the split collar’s crossing limit when shorter, m.

property collar_quiet: bool[source]#

Whether the stages leave a quiet in-stage temporal collar out (SEP 21).

natural_stop(target)[source]#

Count an accepted step; return whether to stop at its end.

Parameters:
targetfloat

The position the call is stepping to, m.

Returns:
bool

Whether a step plane, a halt or a warning barrier stops the march here.

poll_stop()[source]#

Raise when the run’s stop flag is set; called before every attempt.

record(end, dz, norm, accepted)[source]#

Record one attempt in the history since the last observation.

Parameters:
endfloat

The attempt’s end, m.

dzfloat

Its length, m.

normfloat

The scaled error norm as executed.

acceptedbool

Whether it was accepted.

stepped()[source]#

Account the step just committed: the monitor, the edge and the row.

class solprop.backends.host.marches.MarchState(z, proposal, cursor=0, norms=<factory>)[source]#

Bases: object

A march’s position, proposal, replay cursor and accepted norms (SEP 45 4.2).

Attributes:
zfloat

The committed state’s position, m.

proposalfloat

The controller’s proposal, m: its own state, never the executed step.

cursorint

A replay’s next step: how many steps of the schedule are consumed.

normscollections.deque

The accepted steps’ norms the controller reads, oldest first, at most its lag and two more.

cursor: int = 0#
load(z, proposal, cursor)[source]#

Start afresh at a loaded position.

Parameters:
zfloat

The position, m.

proposalfloat

The first proposal, m.

cursorint

The replay cursor at z.

norms: deque[float]#
proposal: float#
z: float#
solprop.backends.host.marches.in_flight_refusal(name, z, dz)[source]#

Return why a state a low-storage step left in flight cannot be used.

The step accepts in place (SEP 24 section 6.2): from its start to its commit the state is neither the step’s start nor its end, so an exception or a signal between them leaves nothing a reader may use and nothing a march may continue from.

Parameters:
namestr

The backend’s name.

zfloat

Where the step started, m.

dzfloat

The step, m.

Returns:
str

The message.