SEP 54 — Sharing one haCC response plan between propagations#

SEP

54

Title

Sharing one haCC response plan between propagations

Author

John Travers

Drafting agent

Fable 5.2 (2026-12-04)

Status

Draft

Review status

In review

Reviewers

Opus 5.5 (AI)

Type

Feature

Created

2026-12-04

Resolution

—

Requires

SEP 12 and SEP 20 (the TDSE response and its haCC target); SEP 49 (the provider worker); SEP 25 (agreement to an error bound); SEP 42 and ADR-066 (the resume identity)

Supersedes

—

Superseded-by

—

Implementation

—

Manual pages

—

Part I — Proposal#

1. Abstract#

A haCC TDSE run asks its provider, Pyroraptor, for the atomic response at a few radial nodes once per optical step, and on a GPU those few rows use a small part of the card. The provider has accepted a design, not yet built, in which one server process owns the device and one response plan, and several propagation processes on the same machine send it their rows, so that all of them are marched together. This SEP proposes solprop’s side: an execution setting that names the server, one submission per step, the checks and records a run keeps when it holds no atomic model of its own, and what a run does when it has to wait, when the server is lost and when it is stopped. Nothing in the physics or in the resume identity changes. Success is judged by tests that run without a GPU against a manufactured server, by a comparison with the real provider on a host, and by whole short propagations on a device that agree with the same runs on private plans to a tolerance fixed before they are run.

2. Motivation and scope#

The use. A parameter scan of a helium-filled capillary runs many haCC propagations. Each makes 450 to 600 atomic calls, and each call marches 6 rows (one per radial node of the field-scale rule) over the whole atomic window. Run as separate processes on one GPU, the propagations each build their own plan and compete for the card. The cost of a march on a device grows much more slowly than its row count, so one plan of all rows is cheaper. The provider’s measurements on one AMD Instinct MI300X (HIP), for the fast haCC(1) preset on its production window of 9,593 samples and 124,696 RK4 steps per call:

Rows in the plan

Propagations served

Time per complete call

6

1

91.7 s

24

4

133 s

On short windows of the same shape, four separate 6-row processes on the card each took about 1.8 times as long per step as one 24-row plan, and two took 1.6 times as long. The gain after the provider’s planned work on large-batch kernels is not known, since that work also makes small batches cheaper. Separate processes on an NVIDIA card, with or without its multi-process service, have not been measured.

Who needs it. Anyone running several haCC propagations at once on a GPU. A single run gains nothing, and neither does a host: the provider’s cost per row on a CPU is flat, so a shared plan there only moves work between processes. The shared plan runs on a host all the same, which is what lets solprop test it without a GPU.

In scope.

  • A shared mode of TDSEExecution, for haCC responses, on both backends.

  • One provider call per evaluation in that mode, for all radial nodes.

  • The checks, the memory admission and the records of a run that prepares no model.

  • Waiting, stopping, a lost or restarted server, a refused attachment, a stalled run.

  • The weak-field consistency check in that mode.

  • Tests without a GPU, a qualification of whole propagations, and the manual.

  • The requests solprop made of the provider’s interface before the provider builds it, and the provider’s answers (§5.4).

Out of scope.

  • The server. It is the provider’s, with its protocol, its round rule and its qualification of a single call. solprop writes no server, no pooling and no substitute for either.

  • Starting the server. The user or the job script starts it (§5.3). Having the scan driver start one server for each group of compatible points is tempting and is left to #962.

  • SAE responses. The provider’s shared plan is a haCC plan.

  • Clients on other machines, and runs of one server that differ in model, lattice or output selection. The provider refuses them; a scan that mixes them needs one server for each group.

  • Bitwise agreement between a shared and a private run, which SEP 25 does not ask for (§4).

3. Context#

3.1 The haCC response today#

The settings are TDSEExecution (solprop.nonlinear.tdse): device, memory_limit, max_batch_rows (32), max_atomic_calls, complement and hacc_cache. They are execution settings, outside the resume identity: the configuration hash (RunMetadata.configuration_hash) takes the TDSE descriptor and no fact of the provider’s execution. The manual page is TDSE response.

The run’s binding (_ProviderBinding in solprop.driver.tdse) keeps the provider out of solprop’s process. It starts a worker process (solprop.driver._source_worker) that serves Pyroraptor’s adapter (solprop.driver._pyroraptor), and both backends evaluate the source through that one binding (SEP 49). What matters here:

  • Preparation. The worker prepares the haCC model, which takes minutes. For a preset it first compares the installed provider’s preset with the record the run carries (_verified_preset): the identity, every numeric field, and whether the preset is admitted on the requested device. The plans are deferred until the consistency check has run (prepare_binding(..., defer_plans=True) in solprop.driver.tdse_run).

  • Chunks and plans. _row_chunks cuts the radial nodes into contiguous chunks of at most max_batch_rows. The worker builds one hacc.ResponsePlan for each distinct chunk size (_build_hacc_plans), and an evaluation calls the plans chunk by chunk, one worker request each. The 6-node runs are one chunk.

  • The output selection. A preset’s plans ask for outputs="total_current", which carries the escaped-electron closure. A velocity-gauge basis asks for "full". A custom mixed-gauge basis tries "total_current" and falls back to "full" when the provider refuses with a ValueError naming the closure. A full raw archive makes every plan full (_HaccModel.plan, _prepare_hacc).

  • The plan record. Each plan’s info, and each result’s, must name the run’s rows, samples and spacing, shadow order 1, the output selection, the cut, the model’s atom, basis and gauge, and a closure flag that agrees with the selection (check_info, in the worker for a plan and in the parent for every result).

  • Memory. memory_limit is applied to an estimate before the worker starts, to the model’s measured ledger, to the plans’ entries that are not marked shared, and to the parent’s reserve for results and for the copies on the pipe (_admit_memory).

  • The consistency check. Before its first propagation call a haCC run checks the model’s weak-field linear response against optmat’s helium (SEP 20; solprop.driver.tdse_consistency). The result is cached under the basis identity, the provider’s source revision, the material, the reference wavelength and the protocol version. Only on a miss does the run make a call: a temporary one-row plan on the protocol lattice (1,601 samples at 25 as), which is another lattice than the propagation’s, charged to the run as one diagnostic call. check_consistency runs the same check on its own, with a model prepared for it alone (DiagnosticSession).

  • Calls in a step. The adaptive march makes one predictor evaluation for each trial, and a startup evaluation as well when its history is empty. A rejected trial discards its result, and the next trial evaluates again. Between two evaluations the run decides the step and, with tdse=, saves every accepted step and its running checkpoint. SEP 49 measured the hook, the copies on the pipe and the source assembly at below \(10^{-3}\) of a call; the saves and checkpoints were not in that measurement.

  • The call budget. AtomicCallBudget (solprop.translate.tdse) charges every attempted provider call before it is made, never refunds a charge, and counts failed calls apart. max_atomic_calls bounds the attempts.

  • Failures. Any exception from a call kills the worker, records a failed call and raises BackendError, which ends the run at its last accepted step. A later evaluation would start a fresh worker, which must report the same build and prepares the model again (_ensure_worker).

  • Stops. While a reply is awaited the parent polls the stop flag and held signals every 0.2 s (Worker._wait). A stop kills the worker’s process group; the call stays charged and is recorded as interrupted, not as a failure.

  • Records. The run’s execution record has a tdse entry (_ProviderBinding.metadata) with the execution settings, the worker’s build, each plan’s info, the chunks, the call ledger, the memory, the last call and the failures. The optional raw archive (solprop.output.tdse_archive) stores every call’s drive and returned record.

  • Scans. run_scan (solprop.driver.scan) runs each point through Simulation.run: one after another in the calling process on the Local executor, and in processes of their own on Pool, Queue and Slurm. Either way each TDSE point has its own worker and its own plan.

3.2 What the provider will offer#

Pyroraptor is solprop’s sibling package, by the same maintainers, and is not yet public (#248). Its design for a shared plan is accepted and not implemented; the provider builds it after its work on large-batch device kernels. On 2026-12-04 its maintainers also accepted the additions solprop asked for (§5.4), and checked this section against their design. This section records the contract solprop relies on, so that the SEP stands alone. A difference found when the provider ships is recorded in a phase report.

# One server per machine owns the device, the prepared model, the kernel and the plan.
python -m pyroraptor.hacc.serve --socket PATH --preset 1 fast --cache DIR \
    --max-rows 72 [--fixed-rows] [--stall-timeout SECONDS]

# The same server as an object, for any haCC model:
hacc.PlanServer(PATH, model, cache=DIR, max_rows=72, fixed_rows=False,
                stall_timeout=300.0).serve()

# The server's state, without attaching:
python -m pyroraptor.hacc.serve --socket PATH --status [--timeout SECONDS]
status = hacc.server_status(PATH, timeout=0.0)
status.refusal(model_spec, rows=6, spacing=..., ...)   # the SharedPlan arguments

# In each propagation process, in place of hacc.ResponsePlan:
client = hacc.SharedPlan(PATH, model_spec, rows=6, spacing=..., samples=...,
                         max_step_au=..., field="electric_field", shadow_order=1,
                         norm_growth_limit=2.0, outputs="total_current",
                         attach_timeout=None, reconnect_timeout=0.0)
result = client.evaluate(electric_field)   # blocks until the round is marched
result.shared                              # the round's record (below)
client.info, client.instance, client.neutral_cache
client.endpoints, client.memory_ledger(); client.close()
  • The server holds the model. The model is fixed when the server starts: a preset on the command line, or any haCC model through the server object. The server requires a cache directory, so that the kernel is built once for each lattice. It creates its socket once its model is prepared, so a server that answers is ready.

  • The client holds no model. model_spec is the unprepared description: a preset, or the atom, basis, gauge and cut of a custom model. The client never prepares it. Constructing the client attaches it.

  • No device use in a client. Importing the package, constructing a client, evaluating through it and reading its records do not initialise the execution runtime, so a client holds nothing on a card. The provider tests this on a host build and checks it on each card in its device phase.

  • One client per process, one submission per round. A process sends all the rows it needs for a step in one evaluate. The server refuses a second client from a process. A client serves one thread at a time.

  • Rounds. A round waits for one submission from every attached client, marches once and answers each client with its rows. All runs of a server therefore step together, at the pace of the march plus the longest time any of them spends between two calls. A client that attaches during a march joins the next round.

  • Identical settings. Every client’s declared model is compared with the server’s, the first client’s included. The first client fixes the lattice (spacing, samples, step), the field kind, the shadow order and route, the norm-growth limit and outputs, until the last client has left. A client that differs in any of these, or that has more rows than --max-rows, is refused (the errors are below).

  • Versions. The server refuses a client of another protocol version or another source revision. Revisions compare as hashes: the mark of a modified tree is dropped, and two revisions are equal when one abbreviated hash is a prefix of the other. Equal hashes with either side modified, and a build that reports no revision, are allowed with a warning. Every other build field may differ, so a host-build client attaches to a device-build server.

  • Admission. When the first client has fixed the lattice, the server builds its plan at --max-rows before it answers, so that its memory is known to suffice. With no cached kernel that includes building the kernel, measured at 119 s on the production window. A client that arrives during the build waits for it and is then compared with the lattice. If the build fails, the first client gets the exception the build raised, and the first of those waiting takes its part.

  • Waiting for a place. A client whose rows do not fit beside the present ones waits, in order of arrival. attach_timeout bounds that wait, and only that wait, with a TimeoutError: the admission build is not counted. Nothing else bounds the constructor; a process that ends is detached at once.

  • Stalls. A client silent for the stall timeout (300 s by default) after the first submission of a round is suspended: the round marches without it, and it rejoins with its next submission. It loses its place, and its connection is closed, after a second timeout if another client is waiting, and after ten otherwise. Each suspension and each return changes the batch of the clients that stay, with a rebuild each time, except under --fixed-rows.

  • Departures. A client whose connection closes is detached at once and its submission discarded.

  • Membership. When the set of active clients changes, the server rebuilds the plan at the new row count from its cached kernel, in 0.5 to 0.7 s on the production window. With --fixed-rows it keeps one plan of --max-rows instead and marches unused rows with a zero field; a client then needs a contiguous block of free rows.

  • The degraded state. If a rebuild fails, the server falls back to its admitted plan of --max-rows, marches the clients it has in it and makes no further rebuild. Until its last client has left it refuses every newcomer at once, the clients already waiting in line included. If the fallback fails too, the server stops. There is no degraded state under --fixed-rows.

  • Results. A result is the type a plan returns, with the client’s rows, and one new field, shared, which is None from a private plan (the table below). info is the record of the plan of the latest result, and before the first result of the plan at attachment, with rows set to the client’s. neutral_cache is the server model’s cache record, instance identifies the server, and memory_ledger() is the server plan’s, marked shared.

  • A failed march is reported to every client of the round. It is never one row’s fault: submissions are checked before the batch is formed, a bad one is refused for its client only, and a row that fails its monitors is reported invalid to its client only. The clients stay attached, and the server builds its plan again before the next round. If that build fails the server becomes degraded, or stops if it already was or runs with --fixed-rows.

  • A lost server. evaluate reports it after trying to attach again for reconnect_timeout seconds; zero, the default, leaves reconnection to the consumer. The timeout never covers an eviction. A client that was closed by a lost server or an eviction is not used again: the consumer constructs a new one.

  • Restarts. Calls carry no state, so a client that attaches to a restarted server continues where it was. A restarted server has another instance and no lattice until its first client brings one, and it gives its places again in the order the clients return. A client keeps its rows for the life of one attachment only.

  • Rounding. On a host a row’s result does not depend on its batch, given the same prepared model, kernel entry and thread count. On a device it may, within the provider’s device rounding allowance (§4).

  • The socket. A Unix-domain socket in a directory of mode 700; the server checks that each peer is its own user, refuses a path too long for the platform and holds a lock file while it runs. A path left by a dead server is used again. Clients on other machines are not served.

The round’s record, result.shared:

Field

Meaning

batch_rows

Rows of the plan the round was marched in

first_row

The client’s first row in that batch

round

The number of the march, from 1 for each server instance; a failed march counts

instance

The server instance: 32 hexadecimal digits, new at every start

plan_serial

Serial number of the plan the round was marched in, from 1 for each instance and one higher at every successful build. A first result normally has 2, because the admitted plan is replaced before the first march

missed_rounds

Rounds marched without a submission of this client since its previous result on this attachment

suspensions

Times the client was suspended since its previous result on this attachment

wait_seconds

From the server’s receipt of the submission to the start of the march: the other clients and any rebuild

march_seconds

Wall time of the march

The server’s status, from hacc.server_status or the --status command, is not an attachment and holds no place. With no server at the path it waits up to timeout seconds. It gives the instance, the protocol version and build, the declared model and its neutral’s cache record, the state (idle without a lattice, admitting, collecting, marching or rebuilding), the present plan’s record with every fixed setting (none while idle or admitting), max_rows, fixed_rows and stall_timeout, the rows of the active, suspended and waiting clients, the round and whether the server is degraded. refusal returns the error an attachment with the given arguments would get from that state, or None, by the server’s own comparison. It checks the model, the row limit and, when a plan is recorded, the settings. It does not predict the closure refusal or a wait for a place.

The errors, all exported from the provider’s package:

Error

Raised by

Meaning

The client afterwards

ServerUnavailableError

the constructor and server_status

No server answers at the socket

—

ServerUnavailableError

evaluate

The connection ended without an eviction notice; a server stopped on purpose is the same

Closed

EvictedError

the first evaluate after the eviction

The server took the client’s place away after stalls

Closed

RoundFailedError

evaluate

The march of the round failed, for every client of it

Attached; submit again

ServerDegradedError

the constructor

The server takes no newcomers after a failed rebuild

—

SettingsMismatchError

the constructor

settings names every SharedPlan argument that differs; a server fixed at the other output selection names outputs alone

—

RowLimitError

the constructor

More rows than the server’s limit; rows and max_rows

—

VersionMismatchError

the constructor and server_status

Another protocol version or source revision; client and server

—

TimeoutError

the constructor

No place within attach_timeout

—

the ValueError or TypeError of a private plan

the constructor; evaluate

The closure refusal, unchanged; the client’s own bad submission

—; attached

The first four are subclasses of PlanServerError, itself a DrivenError: the server or the round failed, not this client’s call. The three mismatches are subclasses of AttachRefusedError, a ValueError.

3.3 Decisions and records this SEP builds on#

  • SEP 12 and SEP 20: the TDSE response, TDSEExecution, the call budget, the haCC target, its presets, the consistency check and the raw archive.

  • SEP 49: the provider runs in a worker; the worker’s protocol, lifetime and cancellation; one binding for both backends.

  • SEP 25: independent computations are compared by numerical error, never by bits. It names this case: “No bitwise agreement is required across backends, builds, machines, thread counts, batch membership, scan execution or repeated propagation runs.”

  • SEP 42 and ADR-066: a resume continues on an exact configuration hash, which holds the science and leaves the execution settings out.

  • ADR-078: solprop pins no provider revision and records the one it used (dependencies.md).

4. Theory#

The model does not change. A call maps the field rows \(E_r(t_m)\) of one window to the current rows \(j_r(t_m)\) of the same window, each row started from the prepared ground state and independent of the others. A shared plan evaluates the same map; only the batch a row is marched in differs. The numerical consequence is rounding.

The provider’s bound. On a host build a row’s result does not depend on its batch, given the same prepared model, kernel entry and thread count. On a device it may, at any batch size: the device kernels form their exchange products over the whole batch, from the first row on HIP and from the eleventh on CUDA. A row’s result may then differ within the provider’s device rounding allowance. In atomic units of velocity, for \(N\) RK4 steps, a state of dimension \(d\) and an observable of scale \(s\),

\[ |\delta v| \le 2 \cdot 4N \cdot 2\gamma_d \cdot 2s, \qquad \gamma_d = \frac{d\,u}{1 - d\,u}, \qquad u = 2^{-53}, \]

with \(\gamma_d\) the usual constant of a rounding-error analysis [6] and \(s\), for the current, the largest velocity the basis represents plus the largest vector potential of the drive. This is the one place where the SEP leaves SI units, because the provider states its allowance in the units of its march. For the fast haCC(1) preset \(d = 11{,}527\), so \(\gamma_d = 1.3\times10^{-12}\); with \(N = 124{,}696\) and \(s = 18.5\) atomic units the bound is \(9\times10^{-5}\) atomic units, or \(3\times10^{-17}\) C m/s per atom, which is 0.4% of the peak current of the strongest row of the production drive.

The bound is a guarantee against a wrong row or a wrong route, and it gates nothing in solprop: it is far above what is seen. What has been measured so far is over short windows, and gates nothing either:

  • between two device routes at 1 and 6 rows, over 12,987 steps: 1 to \(2\times10^{-10}\) of a row’s peak;

  • a row alone and in batches of 6 and 12, over 2,600 steps: bitwise equal on an AMD Instinct MI300X, and up to \(3.0\times10^{-13}\) of the row’s peak apart on an NVIDIA A40. Independence is guaranteed on neither.

A short-window figure does not scale to a complete call. Two host builds whose start states differed by \(1.9\times10^{-13}\) gave complete calls up to \(3.0\times10^{-10}\) of a row’s peak apart, and the difference was not proportional to the perturbation. The spread over complete calls is therefore expected nearer \(10^{-10}\) than \(10^{-13}\). The provider measures it between batch sizes in its own device phase, after its work on large-batch kernels, and gates its later runs at a hundred times the measured spread. Write \(\epsilon\) for that spread: the largest difference of a row’s current between two batches, relative to that row’s peak. Only \(\epsilon\) enters solprop’s tolerances (§7.4).

What it does to a propagation. A shared run differs from the same run on a private plan by a perturbation of size \(\epsilon\) times the row’s peak in every source evaluation, and the perturbation changes whenever the batch does. It is not proportional to the current: it is as large, relative to the peak, where the current’s spectrum is weak as where it is strong. Two things follow.

  1. The step sequence. The adaptive march chooses each step from an error estimate, which is a continuous function of the source. While both runs make the same accept and reject decisions, their fields differ by the accumulated effect of the perturbations: to first order \(\delta E(L) = \sum_k G_k\,\delta S_k\), where \(\delta S_k\) is the perturbation of the source in call \(k\) and \(G_k\) the linearised propagator from that call to the end. Its size in a band is \(A\,\epsilon\), where the amplification \(A\) is a property of the propagation and of the band. Perturbations that are independent from call to call add in quadrature, and a bias of one sign adds linearly, so \(A\) depends on the perturbation’s correlation as well; §7.4 measures both cases. A call’s own response to so small a change of its drive need not be proportional to it either, so §7.4 measures \(A\) at the size of \(\epsilon\) as well as above it.

  2. A changed decision. The error estimate moves by \(A'\epsilon\), with an amplification \(A'\) of its own. An estimate that lies within that distance of the tolerance can be accepted in one run and rejected in the other. The two runs then take different steps, and they agree only as two adaptive solutions of the same problem do: within the accuracy envelope of the tolerance. SEP 25 says so of any replay: “Replay need not reproduce the original adaptive trajectory or agree with it at rounding level.”

So a shared run is as accurate as a private one and is not a bitwise or rounding-level copy of it. §7.4 turns the two cases into two tolerances, both fixed before the device runs, and measures \(A\) on a host instead of deriving it.

Reproducibility. A shared run’s result depends, at the level \(A\,\epsilon\), on which other runs shared each of its rounds, so the run is not reproducible bit for bit against a private run, nor against itself in other company. This is the batch-membership case of SEP 25, and it needs no new rule. It does need a record: every call’s batch and the run’s position in it are stored (§6.7). A server started with --fixed-rows keeps the batch size constant for a whole run, at the price of idle rows, for a user who wants the rounding to be the same throughout; that also needs the run’s rows to keep their position in the batch, which the record shows. A run keeps its rows for one attachment and may get others after an eviction or a restart. That a row’s device result does not depend on what its neighbours hold is expected, and the provider’s device phase measures it.

5. Proposed interface#

5.1 The setting#

A new frozen record names the server, and a new field of TDSEExecution carries it:

from solprop.nonlinear.tdse import TDSEExecution, TDSESharedPlan

execution = TDSEExecution(
    device="hip",
    shared_plan=TDSESharedPlan(
        "/scratch/hacc/plan.sock",  # the server's socket
        attach_timeout=None,        # s to wait for a place; None waits without limit
        reconnect_timeout=600.0,    # s to wait for a lost server; 0 stops at once
    ),
)
run = prop_capillary(..., tdse=response, tdse_execution=execution)

Field

Meaning

socket

Path of the server’s Unix-domain socket, held as a string

attach_timeout

Positive seconds to wait for a place on the server, at the first attachment and at any later one, or None for no limit (the default)

reconnect_timeout

Non-negative seconds to wait for a server that is lost, or that takes no new runs after a failed rebuild, before the run stops; 600 by default

TDSEExecution.shared_plan is None by default, and nothing changes then. With a TDSESharedPlan:

  • the response must be haCC; an SAE response is refused by name;

  • device names the execution family the server must report, with no fallback as today: a server on another family is refused, at preparation and at any later attachment. It is not applied to the worker’s own build, in a run or in check_consistency; that build is recorded;

  • max_batch_rows is the largest number of rows the run may submit. A run with more radial nodes is refused at preparation, naming the setting, because the rows cannot be sent in turn (§6.2);

  • memory_limit bounds the run’s own memory; the server’s is its own (§6.3);

  • hacc_cache is used only by the consistency check’s private model, on a host build (§6.4);

  • max_atomic_calls counts as today (§6.5).

The record is an execution setting: outside the scientific identity and the resume hash, recorded with the run. A run may be resumed on a shared plan after it started on a private one, and the reverse (§4).

5.2 What a user sees#

  • A run that cannot attach yet waits, and the log says at intervals how long it has waited: for the server’s first plan, which takes about two minutes when the server has no cached kernel, or for a place. A stop ends the wait at once.

  • A call that takes long says at intervals how long it has been awaited; whether the time went to the other runs, the march or a reconnection is in the record afterwards.

  • A run whose settings differ from the server’s is refused with the provider’s reason and the names of the solprop settings that fix it (the time grid, TDSESampling, the atomic window, the basis and the archive’s outputs). The refusal comes at preparation when the server already has its lattice, and at the first evaluation otherwise.

  • A socket path with no server behind it is refused at preparation, naming the path.

  • A lost server is reported as such. The run waits reconnect_timeout for it, continues if it returns, and otherwise stops at its last accepted step with its terminal checkpoint, to be resumed.

  • A server that takes no new runs after a failed plan rebuild is reported as such, with the advice to restart it. The run tries again for reconnect_timeout and then stops, to be resumed.

  • On a device build of the provider, a run with no cached consistency result is refused, with the instruction to run check_consistency before the server is started (§6.4).

  • The run’s record says that it used a shared plan, on which server build and instance, and what batch each call was marched in.

5.3 Starting the server#

The user or the job script starts the provider’s server before the runs and stops it after them. solprop does not start, supervise or stop a server, and a run never becomes one. The manual gives the command, and the settings every run of one server must share.

  • A preset is named on the server’s command line.

  • A custom basis needs a server started from Python with the provider’s atom, basis and gauge objects, which are the ones the user gave solprop.driver.tdse.hacc_basis to make the HaccBasis.

  • The runs start after the server answers. The provider’s --status command waits for a server and exits nonzero when none answers, and a server that answers has its model prepared. A job script runs it before the runs; a run that finds no server at the path is refused (§6.5).

  • The consistency check comes first on a device build: check_consistency is run before the server is started (§6.4).

  • One machine. Every run of a server is on the server’s machine. A scan over several nodes needs a server on each node and a socket path that is the node’s own.

A scan needs nothing new: every point’s TDSEExecution names the same socket, and the points become clients as they start. With more points running at once than the server has rows for, the later ones wait for a place. The Local executor runs one point at a time and so shares nothing.

5.4 Requests to the provider, and its answers#

solprop made eight requests before the provider builds its client. The provider’s maintainers accepted all eight on 2026-12-04, three in another form than asked (P1, P2 and P6). The answers are additions to the provider’s accepted design and are not yet implemented; §3.2 states the contract with them.

Asked

Answer

What solprop does with it

P1

A lost server, an evicted client and a failed march told apart; a refusal that names the setting that differs, and that tells a mismatch from a row count above the limit and from a server that takes no newcomers

Exception classes, with no reason attribute: four under DrivenError and three under ValueError (§3.2)

The cases of §6.5, by class. The adapter’s classify tests the new classes before DrivenError, which they inherit from

P2

A status query that needs no attachment

hacc.server_status, with a refusal method that applies the server’s own comparison, and a --status command

The refusals at preparation (§6.3); the server’s limits in the record (§6.7); a job script’s wait for a ready server (§5.3)

P3

The helium neutral’s setup-cache record

SharedPlan.neutral_cache; None for a server model prepared without a cache directory

The run’s neutral_cache record

P4

A statement of whether a client and a server of different source revisions may attach

The server itself refuses another protocol version or source revision, by the hash rule of §3.2

solprop relies on the refusal and compares nothing itself (§6.3)

P5

Nothing allocated on the card by importing the package or holding a client

A requirement, tested on a host build and checked on each card in the provider’s device phase

Until that check has run on a device, the manual names clients on a host build of the same revision as the safe route

P6

A record of missed rounds, reconnections, rebuilds and the seconds a call waited and was marched

Fields of result.shared (§3.2), with a plan serial number in place of a rebuild count. No reconnection count, since the consumer constructs the new client

Recorded with each call (§6.7). The adapter counts its own reattachments and times its own waits to attach

P7

Whether attach_timeout covers the admission build

It does not: it bounds only the wait in line

A short timeout cannot lose the first run of a scan to the build. The log of §6.6 names both waits

P8

An identifier of the server instance

instance, in the status, the client and shared

A restart is recorded, and a restarted server told from the one before

Three points of the answers changed this design:

  • A degraded server refuses at once and does not queue. The earlier draft had a run wait for its place there; §6.5 now gives the case a rule of its own (Q12).

  • A failed march is never one row’s fault, so the third option of Q10, a retry only when no submitted row caused the failure, had nothing to distinguish.

  • A private model on the card can make a later rebuild in the server fail, which leaves the server degraded. §6.4 no longer lets a run on a device build prepare one (Q1).

The provider does not expect its names to change before it ships. A change is recorded in a phase report.

6. Implementation strategies#

6.1 Layers#

Everything is in the driver: TDSEExecution and the new record in solprop.nonlinear.tdse (physics-layer records that load no native code), the binding in solprop.driver.tdse and the provider’s adapter in solprop.driver._pyroraptor. The adapter gains two request kinds, attach and detach, beside prepare and evaluate; its prepare and build_plans read the server’s status (§6.3), and its classify names the provider’s new error classes. The worker (solprop.driver._source_worker) and its protocol are unchanged: one reply or error for each request, and the same frames. So are the backends: both evaluate through the binding, so the mode runs on numpy_ref and on the native CPU build as soon as the binding has it. The session loop gains one call (§6.6). The kernel contract, RunRequest and the frozen tables of tests/backends/test_driver.py are not touched; the tables do not name the TDSE execution settings.

6.2 One submission per evaluation#

In shared mode the binding has one chunk of all the radial nodes, and AtomicCallBudget is built with one call per evaluation. The adapter holds one hacc.SharedPlan in place of the dictionary of plans.

Option for more nodes than max_batch_rows

Trade-off

Refuse at preparation (recommended)

max_batch_rows keeps its meaning, the largest number of rows in one provider call, and nothing is exceeded silently. The user raises it, and the server’s --max-rows is the second, independent limit

Ignore max_batch_rows in shared mode

One rule, the server’s; but a setting the user gave is silently overridden

Send the chunks in turn

Not possible: a round waits for every client, and the server admits one client per process

6.3 Checks without a local model#

The worker prepares no model in shared mode. The binding’s life is then:

  1. Construction. The worker starts, and its build is recorded without applying device to it. The prepare request verifies the preset or builds the custom basis’s provider objects, and prepares no model and no plan. It then reads the server’s status with a zero timeout: no server at the path, a server of another version or of another execution family than device ends the preparation there.

  2. build_plans, after the consistency check, attaches nothing. It reads the status again and asks it for the refusal an attachment with the run’s arguments would get (refusal), and raises it: another model, more rows than the server’s limit or a differing setting. A server that has no lattice yet, or that is admitting its first client, has no settings to compare; they are then compared at the attachment. The binding is marked ready, and plans_built is true from then on. reserve and the check that plans exist behave as today.

  3. The first evaluate sends attach and then proceeds (§6.6).

  4. A fresh worker after a failure (_ensure_worker) sends prepare again, which now takes seconds, and the next evaluation attaches again.

  5. detach closes the client and keeps the worker and the records (§6.6).

What each present check rests on:

Check

Today

In shared mode

Preset identity, fields and device admission (_verified_preset)

on the unprepared preset the installed provider returns

Unchanged. The same unprepared preset is the client’s model_spec; device admission is judged for the server’s family

A custom basis’s provider objects (_hacc_objects)

built in the worker

Unchanged; they are the model_spec

device against the build (_build_record)

the worker’s execution_space, at construction

Skipped for the worker, whose build is recorded as the client’s. Applied to the server’s: from the status at preparation, and from client.info.build at each attachment

One provider revision

a fresh worker must report the first one’s build

Also: the server refuses a client of another protocol version or source revision, at the status query and at every attachment, by the rule of §3.2. solprop compares nothing itself, so that the two cannot disagree on what equal means. The provider allows a revision it cannot verify (a modified tree, a build that reports none) with a warning; the run warns once as well and records it

The plan record (check_info)

each plan in the worker, each result in the parent

Unchanged, on client.info at each attachment and on each result, with the run’s rows. The record’s kernel and build fields are not compared, as today

The output selection and the closure

decided by the first plan

Decided by the first attachment, by the same sequence. A server already fixed at the other selection refuses with a SettingsMismatchError that names outputs alone, which tells it from the closure refusal, a plain ValueError

The neutral and kernel cache records

from the model and from each plan’s info

The kernel’s from client.info; the neutral’s from client.neutral_cache

Memory (_admit_memory)

estimate, model, plans, host reserve, transport

The model and plan parts leave the run’s admission: the server admitted them at max_rows when it took its first client. memory_limit bounds the host reserve, the transport copies on the pipe and, in the worker, on the socket, the archive’s buffers and the private model of §6.4 while it lives. The server’s ledger is recorded under its own key, as shared, and never added to the run’s total

A refusal by any of these is a configuration error of the run, raised as today.

When several runs of a custom mixed-gauge basis start together on a server without a lattice, each is refused for the closure in its turn, until one attaches with the full selection. The runs then get their places in another order than they started in, and nothing else differs.

6.4 The consistency check#

The check’s one-row plan is on the protocol lattice, so it cannot go through a server whose lattice is the propagation’s. It normally makes no call at all: the result is cached by basis, provider revision, material and reference wavelength, so of the runs of a scan that share those at most the first to arrive computes it. A scan over the wavelength has an entry for each point, and every point misses the first time.

A run that computes the check must prepare a model of its own. On a device build that model is on the card, beside the server and outside the memory the server admitted. The provider confirms that the check, or a later rebuild in the server, can then fail for want of memory, and a failed rebuild leaves the server degraded (§3.2).

Option on a cache miss

Trade-off

By the worker’s build: a private model on a host build, a refusal on a device build (recommended)

A shared-mode run never puts a model on the card. On a host build the worker prepares the model, builds the one-row plan, makes the call and closes both, before the run attaches, so it delays nobody; the cost is the preparation (minutes, less with hacc_cache) and host memory. On a device build the run is refused at preparation, with the instruction to run check_consistency before the server is started, or to run the clients from a host build of the same revision. One more step for the user of a device build, and a run that can fail at its start for want of it

A private model on every build

No refusal and no extra step. On a device build one model is loaded on the card beside the server, and where it does not fit the check fails or the server becomes degraded for every later run. This was the recommendation before the provider’s answers

Require the record on every build

The least code: no lock and no second worker. The extra step falls on host builds too, where a private model harms nothing

Skip the check in shared mode

Gives up SEP 20’s rule that nothing rescales the haCC current unchecked

The recommended option in detail:

  • The build decides. The worker’s build names its execution space, which is recorded today. A host space computes; any other refuses. The cache is read first, so a run with a cached result is never refused, on any build.

  • One lock for the cache. Before it computes, the parent process, which runs the gate, takes an exclusive advisory lock (flock) on one lock file of the cache directory, and then reads the entry a second time. One lock for the directory, not one for each entry, so that the points of a wavelength scan compute one at a time and at most one private model exists at once. The operating system releases the lock when its holder ends, however it ends, so a killed run leaves no stale lock on a local filesystem. The file records the holder’s process and host for the log. The wait polls the stop flag.

  • Where locks do not hold. The cache is under the user’s cache directory, which may be on a network filesystem where advisory locks are unreliable. Two runs can then compute at once, which is today’s behaviour and is harmless but for the memory. The manual says to put SOLPROP_CACHE_DIR on a local disk for scans.

  • A holder that leaves no entry. An invalid result is not cached today, and a failed holder writes nothing. Each waiter then finds no entry when it gets the lock and computes in its turn, one at a time.

  • The model is not kept. The worker that computed the check is ended and replaced by a fresh one before the run attaches, so that the run holds no prepared model while it is a client. A fresh worker costs seconds in shared mode.

  • check_consistency with an execution that names a shared plan ignores the setting and checks on the installed build, whatever device says (§5.1). It is not refused on a device build: it is the step the refusal asks for, and it is run before the server is started. Phase 2 also makes it read the cache before it prepares a model; today it prepares one even on a hit.

The manual tells the user of a device build to run check_consistency once for each basis and wavelength of a scan before the server is started. The cache key keeps the worker’s provider revision, which the provider requires to be the server’s (§6.3).

6.5 Failures#

Today every exception from a call is one case. Shared mode has more, told apart by the provider’s error classes (§3.2). Each stop is recorded with its cause.

Case

The provider’s signal

What the run does

Budget

The run’s own call: a refused submission, a row that fails its monitors, a broken record

The ValueError or TypeError of a plan from evaluate, or an invalid row

Today’s rule: the failure is recorded and archived, the worker is ended, BackendError ends the run at its last accepted step

Charged, and counted as a failed call

A failed march (cause march)

RoundFailedError from evaluate; the client stays attached

The adapter submits the same drive once more on the same client, and the failure is recorded. The server has built its plan again before that round. If the second march fails too, today’s rule applies

Charged once. A failed call is counted only if the resubmission fails

The server is lost or restarting (cause server)

ServerUnavailableError from evaluate; the client is closed

The adapter constructs a new client, trying for up to reconnect_timeout in all for this call, then submits the same drive. The worker is kept. If the time runs out the run stops at its last accepted step, resumable. A returned server of another revision refuses the attachment, and one of another family stops the run (§6.3)

The call was charged once, before it was first submitted. A resubmission is the same call and is not charged again. The stop is not a failed call

The client was evicted after a stall (cause evicted)

EvictedError from the first evaluate after it; the client is closed

The adapter constructs a new client and submits the same drive. The server is there, so reconnect_timeout does not apply; the wait for a place counts against attach_timeout, as below

As above

No place at the first attachment or at a later one (cause place)

The constructor waits in line, and raises TimeoutError after attach_timeout

The run waits. If the time runs out it stops, resumable, saying how long it waited

Nothing is charged at a first attachment (§6.6)

The server is degraded (cause degraded)

ServerDegradedError from the constructor, at once

The run tries again at intervals, for up to reconnect_timeout, and warns that the server takes no new runs after a failed plan rebuild and needs a restart. It attaches if the server is restarted or its last run leaves in that time, and otherwise stops, resumable

Nothing is charged at a first attachment. The stop is not a failed call

The attachment is refused for a mismatch, a row count above the server’s limit or another version

SettingsMismatchError, RowLimitError or VersionMismatchError, from the status at preparation or from the constructor

A configuration error: no retry. The run stops with the provider’s reason and solprop’s names for the settings in the error’s settings

Nothing is charged

No server at the path

ServerUnavailableError from the status at preparation, or from the constructor at a first attachment

A configuration error, naming the path: no retry. It covers a mistyped path and a scan point started on another machine than the server’s

Nothing is charged

ServerUnavailableError is one class for a lost server and for a missing one. The run tells them apart by whether it had attached before.

A degraded server is retried in two places. At a first attachment the attach request fails with the cause, and the binding logs the warning and sends the request again at intervals, so the user sees the reason while the run waits. Inside a call that is already charged, after an eviction or a restart, the adapter retries, and the reason is in the record and in the message of the stop. The state means that a plan rebuild failed on the card, so it usually ends only with a restart of the server.

After a server restart the places are given again in the order the runs return, so a run that held a place may wait for one; that wait is the place case.

Option for reconnection

Trade-off

In the adapter, with the provider’s reconnect_timeout left at zero (recommended)

The worker stays, the binding sees one long call, and the adapter counts and times each reattachment for the record, which the provider leaves to the consumer

The provider’s own reconnect_timeout

Less code; but the reattachment is invisible to solprop, and the provider’s timeout never covers an eviction

Today’s rule (end the worker, fail the run)

One server restart would end every run of the scan and charge each a failed call

Option for a degraded server

Trade-off

Try again for reconnect_timeout (recommended)

The remedy is the restart that a lost server needs, so the same bound serves. In a scan that starts a point as each one ends, new points wait instead of failing one after another

Stop at once

Simplest; but every remaining point of such a scan is started and fails within seconds, while the earlier runs are still finishing

Wait under attach_timeout

Its default is no limit, so a run would wait for as long as the server stays degraded

The time waited does not count against max_atomic_calls, which counts attempts. The default of 600 s covers a restart by hand of a server that has its setup cache (Q3); phase 3 measures a real restart against it.

6.6 Attaching, waiting and stopping#

When to attach. A round waits for every attached client, so a run should take its place only when it is ready to step.

Option

Trade-off

At the first evaluation (recommended)

Preparation, the consistency check, the restored ledger and the opened output are all behind the run when it attaches, so its first submission follows at once. A refused attachment is then found after the output was opened; the run stops with the opened record and no plane. The status query finds most refusals at preparation instead, without attaching (§6.3). Left for the attachment are a server that had no lattice at preparation, the closure refusal and a server that changed in between

When the plans are built today (build_plans)

The refusal comes earlier, but the run holds a place while it opens its output and builds its backend, and the others wait for it

The order inside an evaluation. Today evaluate opens the archive’s evaluation, counts the logical evaluation and charges the call before it sends the worker anything. In shared mode, when no client is attached, the binding first sends the worker an attach request, after its own checks of the arguments and before the archive, the count and the charge. A refusal, a missing server or a wait for a place that runs out therefore charges nothing and leaves no open evaluation. Only then does the evaluation proceed as today. A reattachment during a call that is already charged happens inside the evaluate request (§6.5). A resume attaches the same way, at its first evaluation.

Waiting. The parent’s wait on the worker already polls the stop flag and the held signals every 0.2 s, whatever the worker waits for. The parent knows which request is pending, and logs the time waited at intervals: to attach while attach is pending, for the call while evaluate is. A wait to attach is for a place, or for the server’s first plan, which takes about two minutes with no cached kernel and does not count against attach_timeout. A call can wait for the other runs’ submissions, for the march or for a lost server; which of these took the time is not known to the parent during the call and is recorded after it (the wait_seconds and march_seconds of the call’s shared record, and the adapter’s own count and timing of reattachments). No message from the worker during a request is needed.

Stopping. A stop flag, Ctrl-C and SIGTERM end the worker’s process group as today. The closed socket detaches the run at once, and the server discards its submission. The call in flight stays charged and is recorded as interrupted.

Leaving. A run that has made its last evaluation must not keep its place while it writes its records, or every other run waits for it, up to the stall timeout. Today the session loop (serve in solprop.driver.session_loop) writes the terminal record and any checkpoint before the run’s failure or its end reaches Simulation.run, where _close_run then closes the backend before the binding. So:

  • the binding gains detach, which closes the client and keeps the worker and every record;

  • the session loop calls it as soon as the run will make no further evaluation: when the march reaches its end, on a stop, when the budget refuses a trial, and on any error, in each case before the terminal records are written;

  • _close_run detaches before it closes the backend.

A binding with no client, or not in shared mode, does nothing on detach.

Pauses between calls. Whatever a run does between two calls delays every other run, and more than the stall timeout suspends it. What solprop does there:

Between two calls

Duration

Action

The step decision and the source assembly

1 to 2 ms (SEP 49’s measurement of the hook, the pipe copies and the assembly)

None

The save of an accepted step and the running checkpoint

Not measured against a call; phase 2 measures it

None expected

A rejected trial

the next call follows at once

None

The end of the run, a stop, a refused trial, an optical-side failure

the terminal records

detach first

A slow or stalled filesystem, a suspended process

unbounded

The server suspends the run after its stall timeout and the round goes without it. Its next submission rejoins. If it was evicted meanwhile, §6.5 attaches it again. The missed_rounds and suspensions of its next result count what it missed. Each suspension and each return also changes the batch of the other runs, with a rebuild each, except under --fixed-rows

6.7 Records#

  • The run’s tdse entry gains a shared_plan record: the socket; the server’s build, its instance and, from the status, its max_rows, fixed_rows and stall timeout; the client’s (worker’s) build; the number of calls marched at each batch size; the reattachments with their positions and causes, and every change of instance; the sums of the calls’ missed_rounds, suspensions, wait_seconds and march_seconds; and the time spent waiting to attach, which the adapter measures. The plans entry holds the latest client.info under the run’s row count, and memory_bytes the run’s own memory, with the server’s ledger beside it.

  • The last call (last_call) gains the call’s shared record, with the nine fields of §3.2.

  • The raw archive. The archive stores only the fields its record serializers list (RecordSchema in solprop.output.tdse_archive), and a change of the stored fields raises a serializer’s version. hacc.total_current_response and hacc.grid_response therefore go from version 1 to 2, each with one more field, shared, an optional structured field of the nine values of §3.2 that is None from a private plan; the reader accepts both versions. The archive’s own schema, TDSE_ARCHIVE_SCHEMA, does not change, because an existing archive must be continued across a resume that moves between private and shared plans, and a session is refused on any other schema. The session’s context names the shared plan. This is the per-call history. Without an archive the run keeps the counts by batch size and the last call, not every call.

  • The optical output’s schema. The additions are new keys inside existing records. Whether they need the output schema’s number raised is settled in phase 1 by the rule of releasing.md, which allows one rise between releases.

6.8 Cost#

Shared mode adds no measurable time to a call on solprop’s side: one worker request for all rows instead of one per chunk, and the same arrays over the pipe, plus the same arrays once more over the socket (0.46 MB each way for a 6-row client on the production window). The run’s memory falls by the model and the plans.

Expected size, to be compared at Final: about 700 lines of code (the record and its validation, the adapter’s client path, attachment and reattachment, the binding’s single chunk, detach and its calls, the failure classes and records, the cache lock, the serializer versions), 180 of docstrings and 1,700 of tests, of which about 500 are the manufactured server and its harness. No new dependency: the client is the provider’s, and the provider stays optional and undeclared.

7. Verification and validation#

Pyroraptor is not installed in CI, so the tests there use a manufactured provider, as the present TDSE tests do (tests/hacc_cases.py, tests/source_adapters.py). The real provider is exercised on a host by a test that is skipped without it, and on a device by hand.

7.1 The manufactured server (CI)#

The harness. The manufactured provider gains a SharedPlan that speaks to a manufactured server over a real Unix-domain socket, because the clients live in the runs’ worker processes. The server runs in the test’s own process and follows the contract of §3.2: rounds, identical settings, versions, places, stalls, rebuilds, fixed_rows, the degraded state, loss and restart, with the status query, the round’s record and the error classes under the provider’s names. Its clock is an object the test advances, and it holds a round or a place until the test releases it, so that the order of joins, submissions and departures is the test’s and not the scheduler’s. Each run is a subprocess with its own worker, as in production. Sockets are created under a short temporary directory, since the usual one exceeds the length a socket path may have on macOS.

The server’s currents are the analytic histories the manufactured provider already returns, a different one for every row, so that a swapped or misplaced row cannot pass. It can perturb a row by a set amount when the batch changes, to stand for device rounding.

Test

Quantity compared

Tolerance and what sets it

T1

Two runs share a plan

every drive the server received and every current each run got back, against the same runs on private manufactured plans; then the saved fields and the call ledgers

Drives and currents exact: with no perturbation the transport is a lossless copy (SEP 25’s structural contracts). Ledgers exact. Fields within the matched-computation budget the present TDSE march tests use on each backend

T2

A run joins and leaves, in an order the test sets

the batch recorded for each call of the run that stays

Exact integers: the batch sizes before, during and after

T3

A stalled run; an evicted run; a run that ends, and one that fails on the optical side, while another waits

suspension and rejoining; reattachment after eviction with its wait for a place; the leaving run is detached before its terminal records are written, and the other’s round does not wait for the stall timeout

Exact: the server’s log of attachments and rounds against its clock; counts, causes and positions in the record

T4

A server restart during a call; a restarted server of another revision

the run continues within reconnect_timeout, charged once with no failure counted, and records the new instance; with a zero timeout it stops resumably and resumes; the other revision refuses the run, which stops

Exact: the ledger and the record; drives and currents as in T1

T5

A stop during each wait (place, round, march, lost server)

the run ends within the poll interval, the client is detached, the call is recorded as interrupted

Time below a stated bound; exact records

T6

A refused mismatch, one setting at a time, on a server that has its lattice and on one that gets it between the run’s preparation and its first evaluation; no server at the path; a row count above the server’s limit; another version

the error names the provider’s reason and solprop’s settings, or the path; it comes at preparation in every case but the lattice fixed in between, which comes at the attachment; nothing is charged and no archive evaluation is opened

Exact

T7

More nodes than max_batch_rows; an SAE response; a server on another family; a provider without hacc.SharedPlan

each refused by name at preparation or attachment

Exact

T8

The consistency check on a cache miss. On a host build: several runs started together on one entry, and on an entry each; a holder killed while it computes; a holder whose result is invalid. On a build that reports a device space: a miss, and a hit

Host: one diagnostic call between the runs of one entry, and never two private models at once across entries; the next waiter computes after the kill; each waiter computes in turn and is refused after an invalid result; the worker that computed is not the one that attaches. Device: the miss is refused at preparation naming check_consistency, with no model prepared; the hit runs

Exact: the counts, the worker process identifiers and the server’s log

T9

A perturbed batch

two runs whose rows are perturbed additively at size \(\eta\) of the row’s peak when the batch changes, against private plans, with the band norm and the gate of §7.4

At \(\eta\) the difference is non-zero and passes the gate \(100\,A\,\eta\), with \(A\) measured as in §7.4. At \(10^{3}\,\eta\) the same gate must fail

T10

The memory admission

a memory_limit below the run’s own shared-mode total is refused, and one between that and the private-plan total is admitted; the server’s ledger is recorded and not summed

Exact

T11

The archive

each call’s shared record read back through the version 2 serializers; an archive begun on a private plan continued by a resume on a shared one, and the reverse; a version 1 record still read

Exact

T12

The closure of a custom mixed-gauge basis

the first attachment falls back to the full selection on the closure refusal; a second run attaches to the server so fixed

Exact

T13

A failed march

one resubmission on the same client, recorded, charged once; a second failure ends the run with one failed call

Exact

T14

A degraded server: at a first attachment, and at a reattachment after an eviction

the warning is logged while the run waits; the run attaches when the server’s last run leaves, or the server is restarted, within reconnect_timeout; otherwise it stops resumably with nothing charged as a failure

Exact: the server’s log against its clock, the ledger and the record

Each agreement test has a scale guard and is shown to fail on a planted defect (a swapped row, a dropped resubmission, a detach left out), as testing.md asks.

7.2 Both backends#

T1 runs on numpy_ref and on the native CPU build. The drives and currents are exact on both; the fields are held to each backend’s existing budget, not to equality, since a threaded reduction may differ between two runs without any defect. The mode adds no backend code.

7.3 The real provider on a host#

Once the provider ships the client, a test skipped without it starts the provider’s server object on a host build with the tiny custom basis the present installed-provider test uses. The server and the private plans share one kernel cache directory and one thread count, which is the condition of the provider’s statement that a row does not depend on its batch on a host.

  • Single calls. The rows two concurrent clients get back for given drives are bitwise those of a private plan on the same drives.

  • Two concurrent short propagations on numpy_ref through the server, against the same two on private plans. With bitwise rows the drives of every later call are the same, so the returned rows of every call, and the saved fields, are asserted bitwise equal.

A failure of either is reported with its largest difference and is a defect unless it is traced to a different kernel entry or thread count.

7.4 Whole propagations on a device, by hand#

One short segment of at most ten accepted steps, in the production shape (fast haCC(1) preset, 6 nodes), run as 2 and as 4 simultaneous runs on a shared plan and again on private plans, on one card. Everything below is fixed before the device runs.

The quantity. For a band \(B\) (the full band, and 90 to 200 nm) and two runs \(a\) and \(b\), at the final plane, which both land on exactly,

\[ \Delta_B(a, b) = \frac{\lVert P_B(\hat E_a - \hat E_b) \rVert_2} {\lVert P_B \hat E_b \rVert_2}, \]

with \(\hat E\) the spectral amplitude of the mode at that plane and \(P_B\) the restriction to the band’s frequency bins. Planes saved at step positions are not compared, because matched runs place them at positions that differ at rounding level.

The spread \(\epsilon\). The provider’s measured spread for complete calls on the backend family of the card, as defined in §4. It does not exist yet: the provider measures it in its device phase and gives the value with the card, the backend and the build, which are written in the phase 4 report, since the provider’s own record is not public. No short-window figure of §4 stands in for it. Phase 4 also measures the spread itself on its card, from one complete call of the segment’s first drive marched on a private plan and in the shared batch, and requires it within a hundred times the provider’s figure, which is the provider’s gate.

The amplification, on a host. A private-plan run of the segment is repeated with an additive perturbation of every returned current,

\[ j_r(t_m) \;\to\; j_r(t_m) + \eta\,\max_m |j_r(t_m)|\;\xi_{k,r,m}, \]

with \(\xi\) uniform on \([-1, 1]\) from a seeded generator, so that the perturbation is broadband and at most \(\eta\) of the row’s peak, as \(\epsilon\) is defined. Two patterns are used: independent draws for every call \(k\), row \(r\) and sample \(m\), with five seeds; and one draw for every row and sample, repeated in every call, which is a bias that adds from call to call.

The six runs are made at two sizes: \(\eta = 10^{-8}\), and \(\eta\) equal to \(\epsilon\) rounded up to a power of ten, which is expected to be \(10^{-10}\). A call’s response to a change of its drive this small need not be proportional to it (§4), so the size that matters is measured and not inferred from the larger one. Each perturbed run must make the same accept and reject decisions as the unperturbed one. If one at the larger size does not, that size is divided by ten and its set repeated; if one at the size of \(\epsilon\) does not, the segment is shortened, as for the device runs. \(A_B\) is the largest \(\Delta_B(\text{perturbed}, \text{unperturbed})/\eta\) over the twelve runs, and the report says whether the two sizes agree.

The two criteria. For each shared run \(s\) and its private counterpart \(p\):

  1. Matched sequences. Where \(s\) and \(p\) made the same decisions, \(\Delta_B(s, p) \le 100\,A_B\,\epsilon\) in both bands. The factor of 100 is the provider’s own margin on its measured spread; it is stated beforehand and is not derived.

  2. Unmatched sequences. Where a decision differs, \(\Delta_B(s, p) \le \max\bigl(\Delta_B(s, \mathrm{ref}), \Delta_B(p, \mathrm{ref})\bigr)\), with the reference a private-plan run on the same card and build at a tenfold tighter rtol. This holds a shared run to the accuracy envelope and no more, so it is the weaker test.

Phase 4 passes when every pair meets its criterion and, for each of the two run counts, at least one pair was matched. If none was, the segment is shortened and the comparison repeated.

Also recorded, not gated: wall time per accepted step for the shared and the private runs, the time between calls, and the batch of every call. The runs need the provider’s device phase to have measured \(\epsilon\), and device time that the maintainers approve.

8. Documentation#

  • Manual. A section “Sharing a GPU between runs” in TDSE response: when it helps and when it does not; how to start the server for a preset and, from Python, for a custom basis; that the runs are on the server’s machine and start after its socket exists; the settings every run of one server must share and which solprop arguments fix them; what a run does while it waits; what happens when the server is restarted, when a march fails and when the server takes no new runs after a failed rebuild, which needs a restart; that a run on a device build needs its consistency result cached before the server starts, and that clients on a host build of the same revision are the safe route until the provider has checked a client on each card; what the record holds; and what is and is not reproducible, with --fixed-rows. The TDSEExecution table gains the field.

  • Scans. A short example in the scan guide (scans.md): one socket in every point’s execution settings, the consistency check run beforehand for every wavelength of the scan with the cache on a local disk, the --status command to wait for the server, and one server on each node for a scan over several.

  • Docstrings on TDSESharedPlan and the new field.

  • Design pages. dependencies.md (the provider’s optional capability and how its absence is refused) and architecture.md (the binding’s two modes).

  • No tutorial: the feature needs a provider that is not yet public.

9. Compatibility and impact#

  • Defaults. None changes. shared_plan=None is today’s behaviour, bit for bit.

  • Public interface. One new record and one new field. max_batch_rows gains a refusal in shared mode only, and so does a missing consistency result on a device build.

  • Provider. A provider without hacc.SharedPlan refuses shared mode by name, as a provider without the haCC surface is refused today. Private plans keep working with any provider that works now.

  • Output. New keys in the tdse execution record, and version 2 of the raw archive’s two haCC record serializers, whose reader keeps version 1 (§6.7). Readers that ignore unknown keys are unaffected.

  • Resume. Unchanged identity. A run moves between private and shared plans across a resume.

  • Validated results. None is affected: no existing run uses the mode. A shared run differs from a private one as §4 says.

  • Luna.jl. No counterpart, and no difference to record.

  • Risks. The provider’s contract may shift before it ships; §3.2 is then corrected in a phase report, or the SEP returns to Draft if the change is large. Runs that step together go at the pace of the slowest, so one run on a slow filesystem slows a scan until the server suspends it. A failed march reaches every run of the server (Q10). A plan rebuild that fails on the card leaves the server taking no new runs until it is restarted (Q12).

10. Alternatives considered#

Alternative

Why not

Separate processes on the card, as today

Measured at 1.6 to 1.8 times the cost of one plan at 2 and 4 propagations on one AMD card

One solprop process that steps several propagations and calls one plan

Couples the lifetimes, step control, outputs and restarts of independent runs, and every executor of a scan would have to change. The provider considered and rejected it for the same reason

A pooling server in solprop

The device, the model, the kernel and the round rule are the provider’s; a second implementation would have to be qualified against it

The scan driver starts and owns the server

Useful, and separable: it needs this SEP’s mode first. Left to #962

A socket named by an environment variable alone

An execution setting that changes the run’s company should be in the run’s record, as hacc_cache is, not only in its environment

Three flat fields on TDSEExecution

The two timeouts mean nothing without the socket; one record keeps them together and validates them once

11. Phases#

Implementation starts when the provider has shipped its server and client, on one branch as SEP 0 asks. Each phase is reported in Part II.

Phase

Deliverables

Verifies

1. The mode

TDSESharedPlan and the field; the adapter’s client path and its attach request, sent at the first evaluation before the archive and the charge; the binding’s single chunk; the checks of §6.3, with the status query at preparation; the records and serializer versions of §6.7; the manufactured server and its harness

T1, T2, T6, T7, T10, T11 and T12 (§7.1); §7.2

2. Waiting and failing

The failure cases, reattachment, resubmission and the degraded server of §6.5; detach and its calls; stops in every wait; the consistency check by build, with its private model, lock and fresh worker on a host build and its refusal on a device build; check_consistency reading its cache first; the time between calls measured

T3, T4, T5, T8, T9, T13 and T14 (§7.1)

3. The real provider

The installed-provider test on a host; corrections to §3.2 where the shipped contract differs; the manual section and design pages

§7.3

4. The device

The amplification on a host, the spread on the card, then the comparison; the measured times in the manual

§7.4

Phases 1 and 2 need no provider. They wait for it all the same (Q8), so that the manufactured server follows a contract that exists.

Phase 4 needs the provider’s measured spread and approved device time. If either is still missing when phases 1 to 3 are complete, the maintainers may make the SEP Final without it, as the exception SEP 0 allows: phase 4 then moves to an issue under the standing device-qualification policy of backends.md, and the manual says that the mode is not yet qualified on a device.

12. Open questions#

None is open. John Travers decided each on 2026-12-04, in every case as the section named recommends. Q1 was decided again and Q9 amended after the provider’s answers (§5.4), which also brought Q12.

  • Q1. The consistency check on a cache miss (§6.4): by the worker’s build. On a host build, a private model in the worker before attaching, one run at a time under one lock for the cache. On a device build the run is refused, and the user runs check_consistency before the server is started. The first decision allowed the private model on every build; the provider then confirmed that such a model on the card can leave the server degraded.

  • Q2. More nodes than max_batch_rows (§6.2): the run is refused at preparation.

  • Q3. Reconnection (§6.5): reconnect_timeout is 600 s by default. Phase 3 measures whether that covers a real restart.

  • Q4. outputs across a scan (§3.2, §6.3): no negotiation. Every run of one server uses the same selection, and a run that differs is refused.

  • Q5. Who starts the server (§5.3): the user, decided before drafting. Scan-driver start-up is #962.

  • Q6. When to attach (§6.6): at the first evaluation.

  • Q7. The setting’s name and shape (§5.1): TDSEExecution(shared_plan= TDSESharedPlan(...)), as sketched.

  • Q8. When to start (§11): after the provider has shipped its server and client.

  • Q9. The gate of the device comparison (§7.4): \(100\,A_B\,\epsilon\) for matched sequences, the larger of the two distances from a tighter reference otherwise, and at least one matched pair for each run count. Amended: \(A_B\) is measured at the size of \(\epsilon\) as well as at \(10^{-8}\), and is the larger of the two.

  • Q10. A failed march (§6.5): one resubmission of the same drive, charged once. Today’s rule applies if the second march fails. The provider’s answer removed the third option: a failed march is never one row’s fault.

  • Q11. No server at the path (§6.5): refused at once, naming the path, and with the status query already at preparation. A job script waits for the server before it starts the runs.

  • Q12. A degraded server (§6.5): the run tries again for reconnect_timeout, with a warning that the server needs a restart, and then stops, resumable.

Deferred to a phase: the optical output’s schema number (phase 1, §6.7); the time between calls and whether the default of reconnect_timeout covers a real restart (phases 2 and 3).

13. References#

  1. SEP 12, TDSE-driven nonlinear response for gas-filled capillaries.

  2. SEP 20, haCC helium TDSE target.

  3. SEP 25, Rounding-level reproducibility and the performance it frees.

  4. SEP 42, Resuming by what matters to the run, and ADR-066 in decisions.md.

  5. SEP 49, The TDSE response on native.

  6. N. J. Higham, Accuracy and Stability of Numerical Algorithms, 2nd ed. (SIAM, 2002), for the constant \(\gamma_d\). doi:10.1137/1.9780898718027

Part II — Implementation record#

Nothing is implemented.

Part III — History#

  • 2026-12-04: Drafted, from the provider’s accepted design for a shared plan and its device measurements. Before drafting, John Travers chose a server started by the user (Q5). Tracking issue: #963. The scan that starts the server itself was given back to #962.

  • 2026-12-04: Independent AI review of Part I at 3f26c016 (Opus 5.5), recorded below with its findings R1 to R16. The human review is pending.

  • 2026-12-04: Part I revised in response to the AI review; the responses follow the review. Q10 and Q11 are new, and the requests to the provider are now P1 to P8.

  • 2026-12-04: John Travers decided the open questions Q1 to Q4 and Q6 to Q11, each as recommended (§12). The human review of the SEP is pending.

  • 2026-12-04: The provider’s maintainers accepted the requests P1 to P8, three in another form than asked, and checked §3.2 against their design. Part I was revised to their answers, after the AI review below, which did not see this revision: the contract of §3.2 and the figures of §4; the answers in §5.4; the status query at preparation (§6.3); the failure cases by error class and the degraded server (§6.5); the round’s record (§6.7); T14 and the changes to T4, T6, T8 and T13 (§7.1). John Travers decided Q1 again (no private model on a device build), amended Q9 (the amplification at the size of the spread) and decided the new Q12 (a degraded server), each as recommended.

  • 2026-12-04: Second independent AI review (Opus 5.5), of Part I at 50eb4a72, recorded at the end of this part with its findings R17 to R31. It is not yet answered, and Part I is as the reviewer read it. The human review is pending.

AI review — 2026-12-04#

An independent review of Part I at 3f26c016 by Opus 5.5, which had no part in the drafting. It checked the draft against SEP 0, solprop’s code and the provider’s accepted design. The reviewer’s text follows, with its priorities: blocking (fix before acceptance), should, minor. One home-directory path spelling was replaced by words, as the public tree requires.

The proposal is well grounded. Most of what §3.1 says about present behaviour is accurate, the options tables are honest, and the decision to leave the server to the provider is right. It is not yet fit for acceptance. Three gaps must be fixed first: the order of attaching, charging and archiving inside an evaluation is not specified and cannot be what §6.5 promises; the long-wait reporting of §6.6 contradicts the claim of §6.1 that the worker protocol is unchanged; and the device gate of §7.4 has a criterion that is either vacuous or undefined, plus a perturbation model that does not match the error it gates. Several further points concern the end of a run, reattachment and the consistency check. Each has a run stall or stop in a way the draft does not describe. The draft is ready for human review provided R1 to R3 are read as blocking.

R1. Attaching, charging and archiving happen in an order the draft does not specify, and it cannot keep its own promises#

Sections: 6.5, 6.6, 7.1 (T6), 11. Priority: blocking.

§6.5 says a refused attachment, or no place within attach_timeout, charges nothing. §6.6 attaches “at the first evaluation”. Today _ProviderBinding.evaluate (src/solprop/driver/tdse.py) works in this order:

  1. it writes the evaluation’s input to the archive (_archive_begin);

  2. it counts a logical evaluation (AtomicCallBudget.begin_evaluation);

  3. it charges the call (charge);

  4. only then does it send the worker its evaluate request.

If the client is constructed inside the worker’s first evaluate request, which is where the provider attaches, the call is already charged and an archive evaluation is already open when the refusal or time-out arrives. T6’s oracle (“nothing is charged”) would then fail against the design as written. A separate attach request would also tell the parent which phase it is waiting in (see R2).

The phases make this worse. Phase 1 must pass T6 and T7 (refusal at attachment), but “attachment at the first evaluation” is a phase 2 deliverable, so phase 1 has no defined attach point.

Recommendation: State that shared mode adds an attach worker request. The binding sends it in evaluate after its own checks and before _archive_begin, begin_evaluation and charge, and only when no client is attached. Reattachment inside a charged call (§6.5) stays inside the evaluate request. Move the attach point into phase 1, or move T6 and T7 to phase 2.

R2. Reporting the phase of a long wait contradicts “the worker and its protocol are unchanged”#

Sections: 5.2, 6.1, 6.6. Priority: blocking.

§6.6 says “the adapter reports the phase of a long wait to the parent, which logs it at intervals”. §5.2 promises a log of the time spent waiting for a place. The worker cannot do either as it stands:

  • main in src/solprop/driver/_source_worker.py sends exactly one reply or error per request, after adapter.handle returns.

  • The adapter has no channel to send anything earlier.

  • Worker.request treats any message other than reply as a protocol error and kills the worker.

Two implementers would resolve this differently: one changes the protocol (bumping PROTOCOL_VERSION, against §6.1), the other drops the phase reporting.

Recommendation: Keep the protocol unchanged. With R1’s separate attach request, the parent knows by itself whether it is waiting for a place (attach pending) or for a round, march or reconnection (evaluate pending), and it logs the elapsed time from Worker._wait. Say so in §6.6. If finer phases are wanted, list the protocol change as a deliverable and drop the “unchanged” claim.

R3. The §7.4 gate: the unmatched criterion is vacuous or undefined, and the amplification is measured with the wrong perturbation#

Sections: 4, 7.4, 12 (Q9), 7.1 (T9). Priority: blocking.

  • Unmatched sequences. The criterion “No further apart than each is from a reference at a tenfold tighter rtol” has three possible readings:

    • against the sum of the two errors, it cannot fail, because \(|a-b| \le |a-r| + |b-r|\) always holds;

    • against the smaller error, it fails for correct runs;

    • against the larger error, it is usable, but the draft does not say this is meant.

    Nor does it say on which device and plan the reference runs.

  • The perturbation model. \(A\) is measured by multiplying each returned current row by \(1 + \eta\xi\), which leaves each row’s spectrum unchanged in shape. Device rounding is not proportional to the signal. It is measured “relative to a row’s peak”, and the provider reports it as a difference spectrum relative to the peak spectral amplitude. In a weak band such as 90 to 200 nm, its relative content is therefore far larger than a scaled copy of the current. \(A\) measured this way underestimates the 90 to 200 nm amplification, so the gate \(100\,A\,\epsilon\) can fail for a correct implementation.

  • Undefined details.

    • “Relative change of the output field over a band” is not defined (which norm, at which plane).

    • “A fixed draw of unit size” does not say whether it is a random sign or a normal variate, or whether it is drawn per row or per sample.

    • A single draw gives a single sample of \(A\).

    • Independent draws per call add in quadrature, while a systematic route bias adds linearly: up to about √(number of calls).

  • Where to compare. With step_planes=1 (the TDSE default, Simulation docstring), matched runs save at step positions that differ at \(O(\epsilon)\). The comparison must be at landed planes.

  • The value of \(\epsilon\). “\(\epsilon\) the spread the provider has measured and published”: the provider is not public (#248), so the gate’s value would rest on private material. \(\epsilon\) measured on another card or backend may not apply to the phase 4 device.

  • T9. T9 shows that a legitimate perturbation passes. It never shows that the gate fails on a defect.

Recommendation:

  • Define the perturbation as additive, \(\eta\,\max|j_r|\) times a fixed, seeded broadband pattern drawn per row, per sample and per call.

  • Define the band norm (for example, the L2 norm of the band-limited spectral difference over that of the reference) and the plane (the final landed plane).

  • Take \(A\) as the maximum over several seeds, and also measure it with a perturbation of one sign throughout.

  • Require the perturbed host run to make the same decisions as the unperturbed one, or reduce \(\eta\).

  • State the unmatched criterion as \(|E_s - E_p| \le \max(|E_s - E_{\rm ref}|, |E_p - E_{\rm ref}|)\), name the reference’s device and plan, and say it is meaningful only when that maximum exceeds rounding.

  • Record \(\epsilon\), its card and build in the phase 4 report, in solprop’s tree.

  • Add to T9 a perturbation of \(10^3\,A\,\eta\) that must fail.

R4. A run that ends, or fails on the optical side, stays attached while it writes its records, which stalls every other run#

Sections: 6.6 (pauses table, “Stopping”), 9 (Risks). Priority: should.

“A run that ends for any reason closes its client before its other resources” has no mechanism behind it:

  • run_service in src/solprop/driver/session_loop.py writes the terminal record and any checkpoint before the run’s error propagates.

  • After success, the final plane and terminal record are written before Simulation.run reaches _close_run.

  • _close_run (src/solprop/driver/tdse_run.py) closes the backend before the binding.

The client stays attached until all of that is done, and so does the client of a run that stopped at reserve on its budget. Every round meanwhile waits for it: up to the stall timeout (300 s by default), then two plan rebuilds. Only a worker kill (a TDSE failure or a stop) detaches at once.

Recommendation:

  • Add a binding method that detaches the client (closes the SharedPlan, keeping the worker and the records).

  • The session loop calls it when the march has made its last evaluation, and first on every exit path before records are written.

  • Close the binding’s client before the backend in _close_run.

  • Add the end of a run and an optical-side failure to the pauses table and to T3.

R5. Reattachment after eviction or restart has two timeouts and no rule; some failure cases are not covered#

Sections: 3.2, 5.1, 6.5, 5.3. Priority: should.

  • Eviction. Under the provider’s rule, a suspended client loses its place after a second timeout only when another client is waiting. The evicted run’s reattachment therefore normally has to wait for a place, and that wait can last until some other run ends (hours). The draft does not say whether reconnect_timeout (600 s, cause server) or attach_timeout (no limit by default) governs it. A cause of server would also be wrong, since the server is fine.

  • Restart. After a restart, places are given again in order of reattachment, and runs that held places may now wait. The provider adds a proviso §3.2 omits: a restarted server has no lattice until the first client reattaches, and that client fixes it.

  • No server at the path. Not covered: no socket at the path at the first attachment (ENOENT or connection refused), as happens for a mistyped path or a Slurm or Queue scan point on another node. Is that “lost” (retry for 600 s) or a configuration error?

  • A degraded server. After a failed rebuild, the provider refuses newcomers “with the reason”. §6.5 would treat that as a configuration error of the run, with no retry.

Recommendation:

  • Specify: a reattachment wait for a place counts against attach_timeout, and the loss of the server against reconnect_timeout, each recorded with its own cause.

  • Treat “no server at the path” at first attachment as a configuration error, naming the path.

  • Add the degraded-server refusal to P1.

  • Say in §5.3 and §8 that all clients must run on the server’s machine. A multi-node Slurm scan needs one server per node and per-node socket paths.

R6. §3.2 misstates or omits parts of the provider’s contract that solprop’s design depends on#

Sections: 3.2, 5.3, 4, 7.3. Priority: should.

Against the provider’s accepted design:

  • The model. The model is fixed when the server starts (--preset on the command line; any hacc model only through the PlanServer object), not by “the first client”. The first client fixes the lattice and settings. A custom HaccBasis therefore needs a server started from Python with exactly the provider objects that _hacc_objects (src/solprop/driver/_pyroraptor.py) builds. Neither §5.3 nor §8 says how a user does that.

  • Admission. The first client’s attachment makes the server build its plan at max_rows. With a cold kernel cache, that includes building the kernel, measured at 119 s on the production window. Whether attach_timeout covers that build is not stated by either side.

  • Host batch-independence. It holds only given bitwise-identical setup (the same kernel entry and thread count). The solprop worker’s private plan uses the whole thread budget and the run’s hacc_cache, so §4’s “on a host a row’s result does not depend on its batch” does not carry over to a private-against-shared comparison without that proviso.

  • Identical settings. The shadow route is among them (ResponsePlanInfo.shadow_route).

  • Omissions. The restart proviso (R5), the degraded-server mode (R5), and “one thread at a time” are missing.

Once these are added, §3.2 is enough for an implementer who cannot see the provider’s repository.

Recommendation: Correct the model sentence, add the items above, and add a manual paragraph on starting a server for a custom basis.

R7. The §5.4 requests: some are already provided, one is missing, and the provider’s design is frozen#

Sections: 5.4, 6.5, 11. Priority: should.

  • P1. An attachment time-out is already a distinct TimeoutError, and a refusal already raises ValueError or TypeError, not DrivenError. The real gaps are:

    • a lost server, an evicted client and a failed march all raise DrivenError;

    • nothing structured names the setting that differs;

    • a capacity or degraded refusal cannot be told from a mismatch.

  • P4. Attaching happens in the SharedPlan constructor, so client.info.build is available before the first evaluate. Only the statement of the revision rule is missing.

  • P5. It is partly provided: BuildInfo in the provider’s _build.py is documented to describe the build “without initializing its execution runtime”. What remains is importing the package and holding a client.

  • P2, P3 and P6 are real gaps. On P3: the neutral’s cache record is an attribute of the prepared model, not of the plan’s info.

  • Missing requests.

    • What attach_timeout covers.

    • A server-instance identifier in info or shared, so that solprop can record a restart and refuse a server that changed in between.

  • Process. The provider’s design is accepted and frozen. The requests need an agreed route (provider issues, or an amendment), and §11 should say which phases depend on which answers. The fallbacks in the “Without it” column, such as parsing messages for P1, should be costed: the recommended reconnection option needs P1.

Recommendation: Rewrite P1, P4 and P5 as above, add the two missing requests, and add a column for “already provided”.

R8. The consistency check on a cache miss: the lock, device context and standalone check are underspecified#

Sections: 6.4, 8, 12 (Q1). Priority: should.

  • The lock. The draft does not say which process holds it (it should be the parent), or what happens to a lock left by a run killed with SIGKILL or preempted. cache_directory() (src/solprop/driver/tdse_consistency.py) defaults to a directory under the user’s home, often on a network filesystem shared by several nodes, where file locks are unreliable.

  • Invalid results. They are not cached (evaluate_consistency writes the cache only for a valid reduction). After an invalid result or a failed holder, each waiter in turn prepares its own model, one after another.

  • Device context. On a device build, the worker that prepared the private model keeps its device runtime for the rest of the run: the worker never finalises the provider’s runtime (the _source_worker exit path). That is the very context P5 tries to avoid. Its device memory is also outside the server’s admission at max_rows, which was made earlier.

  • The standalone check. The manual is to recommend running check_consistency first, but that function builds a DiagnosticSession, whose _build_record(worker.identity, execution) refuses device="hip" on a host build, which is exactly P5’s fallback set-up. It also prepares a model even on a cache hit, because the session is constructed before the cache is read.

Recommendation:

  • Specify the lock: held by the parent, with an flock on a local cache, a stale-lock rule (holder process id and host, plus an age), and what waiters do when they find no entry.

  • State that the worker that computed the check is ended and replaced by a fresh worker before attaching, so that it holds no device context. _ensure_worker machinery exists for this.

  • Say how check_consistency treats an execution with shared_plan: ignore the setting and check on the local build.

R9. “Every run of the server stops on a failed march” is presented as settled; it should be an open question#

Sections: 6.5, 9, 12. Priority: should.

Today a failure ends only the run whose plan failed. In shared mode, one transient device fault ends every run of the scan, and each is charged a failed call. A lost server, by contrast, is retried for 600 s. The asymmetry is a design choice with a large blast radius, and the draft gives only “the march is the shared computation” as its reason.

Recommendation: Add a question Q10. The options are: today’s rule; one resubmission of the same drive after a failed march, recorded and not charged again, as for a lost server; or reattach-and-retry only when the provider marks the failure as not caused by any submitted row (another P1 distinction).

R10. The CI verification has gaps: the exact oracle for T1, the concurrency harness, and missing tests#

Sections: 7.1, 7.2. Priority: should.

  • T1 on native. T1 asserts that the saved fields are exactly equal to a private run, and §7.2 runs it on native. SEP 25 and AGENTS.md require no bitwise agreement across “repeated propagation runs”, and keep exact equality for structural contracts. A threaded native reduction can break T1 without any defect.

  • The harness. Clients live in the run’s worker processes, so the “in-process” manufactured server must be reachable across processes. The draft does not say whether the two concurrent runs are threads of the test process (where only a StopFlag cancels a run, and one thread budget serves the process) or subprocesses, nor how the controlled clock reaches the server. T2’s exact batch sequence depends on when a join lands relative to a round; the test must order joins explicitly.

  • Missing tests for promised behaviour.

    • The memory admission of §6.3.

    • The archive’s shared field (R12).

    • The closure fallback of a custom mixed gauge in shared mode.

    • Refusal by a provider without hacc.SharedPlan (§9).

    • A revision change at reattachment.

    • No server at the path (R5).

    • The detach at the end of a run (R4).

    • The lock’s stale and invalid cases (R8).

  • macOS socket paths. pytest’s tmp_path usually exceeds the roughly 104-byte limit for a Unix socket path, which the provider refuses.

Recommendation:

  • Make T1 exact on the drives and currents crossing the transport (structural), and on numpy_ref fields. On native fields, use the existing matched-computation budget.

  • Specify the harness: subprocess runs, a socket server in the test process, and a clock advanced over a control channel.

  • Add the tests listed.

  • Create sockets under a short temporary directory.

R11. The oracle of §7.3 (“the rounding budget of a matched computation”) is undefined for whole propagations#

Sections: 7.3. Priority: should.

No matched-computation budget exists for a whole adaptive propagation. A rounding-level difference can flip a decision, after which only an accuracy envelope applies. The two shared runs must also run concurrently, which the draft does not say.

Recommendation: Give the server and the private plans the same kernel cache directory and the same PYRORAPTOR_THREADS, and assert bitwise equality of the returned rows and of the numpy_ref fields. Alternatively, compare single calls rather than propagations.

R12. The archive change is larger than “the serializer is extended”#

Sections: 6.7, 5.1, 9. Priority: should.

_write_record (src/solprop/output/tdse_archive.py) stores only the fields its RecordSchema lists and silently drops others. RecordSchema’s own rule is that a change of the stored fields bumps its version, so hacc.total_current_response.v1 and hacc.grid_response.v1 become v2, and the reader must accept both. If the archive’s TDSE_ARCHIVE_SCHEMA were raised instead, _validate_existing (exact match) would refuse to continue an existing archive on resume. That contradicts §5.1, which says a run may move between private and shared plans across a resume. §6.7 discusses only the optical output’s schema.

Recommendation: Name the serializer versions, keep TDSE_ARCHIVE_SCHEMA unchanged, and make shared an optional structured field that is None for a private plan.

R13. Claims in §2 and §3.1 that are wrong or imprecise#

Sections: 2, 3.1, 6.6. Priority: minor.

  • Local runs points one after another in the calling process (src/solprop/driver/executors/local.py), not each “in its own process”. The conclusion (each point has its own worker and plan) still holds.

  • SEP 49 measured the hook, the pipe copies and the host source assembly (1 to 2 ms). It did not measure plane saves or running checkpoints, which the pauses table attributes to it.

  • “The gain is expected to grow as the provider’s large-batch kernels improve”: the provider states the gain after those changes is not known, and those changes also cheapen small batches.

  • _EXECUTION_SETTINGS lists the settings that may change after translation. TDSE execution stays out of the resume hash because RunMetadata excludes provider execution facts.

Recommendation: Correct the four sentences, and mark the first line of the pauses table as unmeasured until phase 2.

R14. Two implementers would build the binding’s shared-mode behaviour differently#

Sections: 5.1, 6.3. Priority: minor.

  • Today _build_record refuses at binding construction a worker whose execution space differs from device. State that shared mode skips that check for the worker and applies it to client.info.build.

  • The revision check is weak when either side reports source_revision == "unversioned".

  • Say what plans_built, build_plans, reserve (_ensure_plans) and _ensure_worker (which re-prepares the model today) do in shared mode.

  • The transport memory should add the client’s socket copies in the worker.

Recommendation: Add these to the §6.3 table, and refuse or warn on an unversioned revision.

R15. Theory: small gaps#

Sections: 4. Priority: minor.

  • The scale \(s\) is not defined. The provider defines it as the largest represented velocity plus \(\max|A|\).

  • The draft should say that the bound gates nothing in solprop; only \(\epsilon\) does.

  • An error estimate moves by \(A'\epsilon\), not \(\epsilon\).

  • Under --fixed-rows, reproducibility needs the row’s position in the batch to stay fixed as well as the batch size.

Recommendation: Add one sentence for each.

R16. Documentation#

Sections: 8, 11. Priority: minor.

  • “The scan guide” is ambiguous: there are both docs/guide/workflows/scans.md and docs/guide/front-end/scans.md.

  • Phase 4 depends on the provider publishing \(\epsilon\) and on approved device time. Say what happens to the SEP if either never comes.

Recommendation: Name the scan page, and state the fallback for phase 4.

Checked and found correct#

  • TDSEExecution’s fields and the default of 32 for max_batch_rows.

  • _verified_preset: identity, numeric fields and device admission.

  • defer_plans in _prepare_atomic.

  • _row_chunks and _build_hacc_plans (one plan per chunk size, one request per chunk).

  • The closure fallback on a ValueError containing “closure”, and full plans for a full archive.

  • The fields that check_info compares.

  • The consistency cache key, and the protocol lattice of 1,601 samples at 25 as.

  • AtomicCallBudget: charge before the call, no refund, failed calls counted apart.

  • A failure kills the worker and raises BackendError; _ensure_worker requires the same build.

  • Polling every 0.2 s in Worker._wait, and the process-group kill on a stop; the interrupted archive record.

  • The order of calls in Simulation.run: prepare, backend, restore, gate, then open_run in the session loop.

  • Resume compares only the ledger against max_atomic_calls.

  • The frozen tables in tests/backends/test_driver.py do not name TDSE execution.

  • The SEP 25 quotations.

  • The provider’s measurements (1.6 and 1.8 times; 91.7 s and 133 s) and the bound’s arithmetic (\(9\times10^{-5}\) atomic units, \(3\times10^{-17}\) C m/s, 0.4% of the peak).

Not checked#

  • The open issues named (#246 to #963), as GitHub was not reachable.

  • The provider’s server and client, which do not exist yet.

  • Whether Simulation.estimate touches the binding.

Response to review — 2026-12-04#

By the drafting agent (Fable 5.2), with Part I revised accordingly. Every point was accepted; where the revision goes beyond or beside the recommendation, it says so. The reviewer has not read these responses. Checked before revising: the order inside _ProviderBinding.evaluate, the one reply per request of the worker, RecordSchema’s version rule, the Local executor, the two scan pages, the order in _close_run and the session loop’s terminal records.

  • R1 (blocking). Accepted. The adapter gains an attach request, which the binding sends in evaluate when no client is attached, after its own argument checks and before the archive’s evaluation, the count and the charge (§6.6, “The order inside an evaluation”; §6.1; the life of the binding in §6.3). A reattachment inside a charged call stays in the evaluate request (§6.5). The attach point moved to phase 1 (§11), and T6 now also asserts that no archive evaluation is opened.

  • R2 (blocking). Accepted, without a protocol change. The parent logs the time waited from the request that is pending: a place while attach is pending, the call while evaluate is. What a call’s time went to is recorded after it (§5.2, §6.6 “Waiting”, §6.1).

  • R3 (blocking). Accepted. §7.4 now defines the band norm \(\Delta_B\) at the final plane; an additive, broadband perturbation of at most \(\eta\) of the row’s peak, drawn uniformly for every call, row and sample with five seeds, and once more as a pattern repeated in every call; \(A_B\) as the largest of the six, each required to keep the unperturbed decisions; the unmatched criterion against the larger of the two distances from a named reference; and \(\epsilon\) written into the phase 4 report with its card and build. Beyond the recommendation: phase 4 measures the spread on its own card and holds it to the provider’s gate, and it passes only with at least one matched pair for each run count, because the unmatched criterion is the weaker one. §4 now says that the perturbation is not proportional to the current, that independent and biased perturbations add differently, and that the estimate moves by \(A'\epsilon\). T9 gained the perturbation that must fail. Q9 is restated.

  • R4. Accepted. The binding gains detach; the session loop calls it as soon as the run will make no further evaluation, before the terminal records, and _close_run detaches before the backend closes (§6.6, “Leaving”). The session loop’s function is serve, which the review calls run_service; its docstring confirms the order the review describes. The pauses table has the end of a run and an optical-side failure, and T3 covers both.

  • R5. Accepted. §6.5 separates the causes: server under reconnect_timeout; evicted, whose wait for a place counts against attach_timeout; place, which also takes the server that refuses newcomers after a failed rebuild; a refused attachment; and no server at the path at the first attachment, a configuration error naming the path. The last is also put to the maintainers as Q11, because a job script that starts the server and the runs together would meet it. The restart’s reassignment of places is stated, the degraded refusal is in P1, and §5.3 and §8 say that the runs are on the server’s machine, with one server on each node of a larger scan.

  • R6. Accepted. §3.2 now says that the server holds the model from its start and the first client fixes the lattice and settings; it adds the server object, the admission build and its 119 s, the shadow route, one thread at a time, the degraded state, the restart proviso and the condition of the host statement, which §4 and §7.3 repeat. §5.3 and §8 say how a server is started for a custom basis.

  • R7. Accepted. The table of §5.4 has a column for what the design already gives. P1, P4 and P5 are rewritten to the real gaps; P7 (what attach_timeout covers) and P8 (a server instance identifier) are new. The route (issues against the provider’s frozen design, answered or amended there) and the phases that depend on each answer are stated, with the cost of P1’s fallback.

  • R8. Accepted. §6.4 specifies the lock: held by the parent, an flock that the operating system releases with its holder, the holder’s process and host written for the log only. Beside the recommendation, no age rule is given: on a local filesystem it is not needed, and where locks do not hold the runs fall back to today’s behaviour, which the text states with the advice to keep the cache on a local disk. Waiters after a holder that left no entry compute in turn. The worker that computed the check is replaced before the run attaches. check_consistency ignores the shared plan, does not apply device to the installed build, and reads its cache before it prepares a model (phase 2). T8 covers the killed and the invalid holder.

  • R9. Accepted. A failed march is its own case in §6.5 and the question Q10, with the three options. The draft now recommends one resubmission of the same drive, charged once, with a failed call counted only if it fails again; the maintainers decide. T13 tests it.

  • R10. Accepted. T1 is exact on the drives and currents that cross the transport and on the ledgers; the fields are held to each backend’s existing budget, on numpy_ref as well as on native, which is more cautious than the recommendation and is what SEP 25 asks of two runs (§7.1, §7.2). The harness is specified: subprocess runs, a socket server in the test’s process with a clock and gates the test controls directly, and short socket paths. The missing tests are T10 to T13 and the additions to T3, T4, T6, T7 and T8.

  • R11. Accepted. §7.3 gives the server and the private plans one kernel cache directory and one thread count, compares single calls bitwise, and runs the two propagations concurrently on numpy_ref with bitwise rows and fields.

  • R12. Accepted. §6.7 names the two serializers that go to version 2 with an optional structured shared field, keeps TDSE_ARCHIVE_SCHEMA so that a resume continues an archive across the two modes, and T11 tests it.

  • R13. Accepted. The four sentences are corrected (§2, §3.1, §5.3, §6.6), and the save and checkpoint between calls are marked unmeasured until phase 2.

  • R14. Accepted. §6.3 lists the life of the binding in shared mode and, in its table, the skipped build check for the worker, the socket copies in the memory and a warning, recorded, for a build that reports no revision. A warning was chosen over a refusal because development installs report none.

  • R15. Accepted. §4 defines \(s\), says that the bound gates nothing in solprop, gives the estimate its own amplification and adds the position in the batch to what --fixed-rows needs.

  • R16. Accepted. §8 names the scan page, and §11 states what happens to phase 4 if the provider’s spread or the device time does not come.

AI review (second) — 2026-12-04#

An independent review of Part I at 50eb4a72 by Opus 5.5, which had no part in drafting it. It was checked against SEP 0 and the template, against solprop’s code at origin/main, and against the provider’s accepted design and its answers to P1 to P8.

The revision follows the provider’s answers closely. I checked §3.2 point by point against those answers and found it correct, apart from a few small omissions. The error classes, the status query, the round’s record, the version rule and the degraded state are all stated the way the provider gives them. The new consistency rule (§6.4) is a real improvement. The trouble is in how the revised sections meet the code. Two things are wrong as written:

  • The degraded-server retry at a first attachment assumes the worker survives a failed request. The worker never survives one.

  • T12 expects a second custom mixed-gauge run to attach to a server fixed at the full selection. Under §6.3 and §6.5 as written, that run is refused for a settings mismatch.

Several reattachment cases inside a charged call also have no rule, and the adapter keeps records in the worker that are lost whenever the worker is killed. I would send Part I to the human review now, but not to acceptance until R17 and R18 are fixed. R19 to R26 should be fixed before implementation starts.

R17. A failed attach request kills the worker, so the binding cannot “send the request again at intervals”, and §6.1’s “the worker is unchanged” does not hold#

Sections: 6.1, 6.5 (degraded server; the paragraph on the two retry places), 6.6 (Waiting), 7.1 (T14). Priority: blocking.

§6.5 says: “At a first attachment the attach request fails with the cause, and the binding logs the warning and sends the request again at intervals.” §6.1 says: “The worker (solprop.driver._source_worker) and its protocol are unchanged.”

In src/solprop/driver/_source_worker.py, Worker.request wraps its wait in except BaseException: self.kill(); raise. A RemoteError, which is what an adapter exception becomes, is raised from Worker._wait inside that block. Every failed request therefore ends the worker. The docstring says so too: “Either way the worker is ended: it is never used again after a failure.” Each retry of attach after a ServerDegradedError would therefore have to go through _ensure_worker: a new worker, its handshake, a prepare request with its own status query, and the build comparison. The text says none of this. It also does not say how the retry interval relates to that cost, or what happens when the status query inside the repeated prepare itself reports the server as degraded.

There is a second, smaller point. The parent “logs the time waited at intervals” (§6.6), but the only loop that runs while a reply is awaited is Worker._wait, which is in that same module. Logging from it means changing _source_worker.py, even though the frames stay the same.

Two implementers would solve this differently. One restarts the worker on every retry. Another changes Worker.request to keep the worker alive after a RemoteError from attach. A third moves the retry into the adapter, as for a charged call, and gives up the warning during the wait.

Recommendation: Choose one design and state it. The least invasive is this: Worker.request keeps the worker alive after a RemoteError from attach and from detach, and only from those, because neither leaves state that could be stale. Say so in §6.1 as a change to _source_worker.py that leaves the frames and PROTOCOL_VERSION alone. Add the logging hook in Worker._wait to the same item. If restarting the worker on each retry is preferred instead, say that each retry repeats prepare and the status query, and set the interval accordingly. T14 should assert which of the two happens (the worker process identifiers).

R18. T12 contradicts §6.3 and §6.5: a second custom mixed-gauge run is refused, not attached, by a server fixed at the full selection#

Sections: 6.3 (the output selection; build_plans), 6.5 (refused attachment), 7.1 (T12), 11. Priority: blocking.

T12’s oracle reads: “the first attachment falls back to the full selection on the closure refusal; a second run attaches to the server so fixed.”

§6.3 says the selection is “Decided by the first attachment, by the same sequence”. Today that sequence is _HaccModel.plan: try total_current, and fall back to full on a ValueError naming the closure. §6.3 also says: “A server already fixed at the other selection refuses with a SettingsMismatchError that names outputs alone, which tells it from the closure refusal.” §6.5 makes every SettingsMismatchError “A configuration error: no retry.”

The second run uses the same custom mixed-gauge basis. It tries total_current first, so the server, already fixed at full, raises SettingsMismatchError with settings == ("outputs",). The provider’s answers confirm this: the server compares the settings before any plan is built, and only a server without a lattice produces the closure refusal. As written, the second run stops. T12 would fail against the design.

The same gap reaches build_plans. refusal(...) needs an outputs argument. For a custom mixed-gauge basis the selection is not decided until the first plan exists (outputs is None in _prepare_hacc for that case), so the text does not say what to pass.

Recommendation: Add a rule. For a binding whose selection is still undecided (a custom mixed-gauge basis with no full raw archive), a SettingsMismatchError whose settings is exactly ("outputs",) from a server fixed at full means “fall back to full and attach again”. That run is then recorded as a run without the closure, with the same warning as today. At build_plans, either take the selection from status.plan when a plan is recorded, or leave outputs out of the refusal comparison for an undecided binding. Every other outputs mismatch stays a refusal (Q4). T12 then tests the rule as stated, and a preset run against a server fixed at full is refused.

R19. A missing server at the first attachment is treated as a configuration error even after the status query at preparation found one#

Sections: 6.3, 6.5 (no server at the path; the ServerUnavailableError paragraph), 12 (Q11). Priority: should.

§6.5 says: “ServerUnavailableError is one class for a lost server and for a missing one. The run tells them apart by whether it had attached before.” With Q11 and the status query at preparation, a run reaches its first attachment only after prepare has seen a server at the path.

On a host build, a cache miss means preparing a private model, which takes minutes (§6.4). A run that waits for the cache lock behind other points of a wavelength scan can wait for several of those preparations. If the server is restarted in that time, the first attach gets ServerUnavailableError and the run is stopped as a mistyped path. The same restart during a call would have been waited for, for up to reconnect_timeout. Q11’s reason, a wrong path or a point on another machine, has already been ruled out by the status query.

Recommendation: Tell the cases apart by whether any status query or attachment has succeeded for this binding, not by whether the run has attached. A ServerUnavailableError at the first attachment after a successful status query is the server case, retried for reconnect_timeout. Charge nothing, since no call is open. Add the case to T4 or T6.

R20. Reattachment inside a charged call has no complete rule when the causes combine#

Sections: 6.5, 6.6, 3.2. Priority: should.

The table in §6.5 gives each cause its own clock: reconnect_timeout for server and degraded, and attach_timeout for place and evicted. Inside one call the causes can follow one another, and the text does not say what happens then:

  • A lost server, then a wait in line. After a restart, places are given again in the order the runs return (§6.5), so the new constructor can block in line. Does reconnect_timeout (“in all for this call”) keep running while it does? The constructor cannot be interrupted except by attach_timeout, whose default is no limit.

  • A failed march, then a lost server. If the rebuild after a failed march fails a second time, the server stops (§3.2), and the resubmission sees ServerUnavailableError. After reconnecting, does a further RoundFailedError count as “the second march” that ends the run (Q10), or as a first one?

  • A refusal at a reattachment. A restarted server whose lattice was fixed first by a run with other settings, a smaller --max-rows, or a server of another family. §6.5 says another revision “refuses the attachment” and another family “stops the run”. It does not say whether that stop counts as a failed call, how it is classified, or what is recorded.

  • A failed admission build. §3.2 says the first client “gets the exception the build raised”. At a first attachment, or at the first reattachment to a restarted server, that is neither a closure refusal nor any row of §6.5 (it could be a DrivenError from the device, for example).

  • No place at a later attachment. The budget column says “Nothing is charged at a first attachment”; for a later one the call is already charged, and whether running out of time there counts as a failed call is not stated.

Recommendation: Replace the per-cause rows for a charged call with one state table for the adapter’s reattachment loop. For each outcome of a constructor or of evaluate, give the next action, the clock it uses, whether that clock is shared across causes within the call, and whether the stop is a failed call. For example:

  • reconnect_timeout bounds the whole loop.

  • attach_timeout bounds each wait in line.

  • At most one RoundFailedError resubmission per call, whatever reconnections lie between.

  • Refusals and a failed admission build end the run with a failed call and the classification of R21.

R21. The adapter’s records and the errors’ attributes do not reach the parent as the worker stands#

Sections: 6.3, 6.5, 6.6, 6.7, 5.4 (P1, P6). Priority: should.

Several items of §6.7 live in the worker. The adapter “counts and times each reattachment for the record”, and “the failure is recorded” after a first failed march. The time spent waiting to attach is “measured” by the adapter. Two facts about the code matter here:

  • The only thing that crosses back on success is the evaluate reply ({"kind", "raw", "model_match"} in PyroraptorAdapter._result).

  • On failure, _error_report sends exactly type, message, classification and traceback.

Any count kept in the adapter is lost when the worker is killed, and a call that ends after reattachments is exactly the case where it is killed. The settings, rows/max_rows and client/server attributes of the provider’s refusals do not cross either, yet §6.5 promises “solprop’s names for the settings in the error’s settings”. The provider’s answers say both relays work, because each message names what its attributes hold. The design still has to choose one.

classify “names the provider’s new error classes” (§6.1), but the SEP does not give the strings. Today’s vocabulary is native, contract, interface and unexpected (plus worker and interrupted in the binding), and TDSEArchiveWriter.write_failure documents only the first four.

Recommendation:

  • State that every attach and evaluate reply in shared mode carries the adapter’s events since its previous reply: reattachments with cause, duration and new instance, a failed march, and the time waited to attach. The binding keeps them, so nothing of record lives only in the worker.

  • State that the adapter maps a refusal’s attributes to solprop’s setting names before it raises. For example, it can raise a solprop error whose message is already the user-facing one, which _local_error rebuilds by class.

  • List the classification strings, extend the write_failure docstring to match, and say which ones the binding retries on.

R22. The host-build consistency path needs a model the shared-mode prepare no longer prepares, and the text does not say where it is prepared or where the worker is replaced#

Sections: 6.1, 6.3, 6.4, 11. Priority: should.

In shared mode, prepare “prepares no model and no plan” (§6.3). Today the diagnostic depends on the prepared model. PyroraptorAdapter._diagnostic_plan refuses with “the consistency diagnostic needs a haCC binding” unless self._hacc exists, and builds its plan from model.plan(...) on that prepared model. _prepare prepares the model even when defer_plans is true. On a host-build cache miss, then, something has to prepare the model inside the lock. §6.1 lists only attach and detach as new requests, so either diagnostic_plan gains that role or a further request is needed.

“The worker that computed the check is ended and replaced by a fresh one before the run attaches” also has no place in the code. _ensure_worker replaces only a dead worker. _consistency_gate calls gate_run and then binding.build_plans(), and build_plans now needs a live worker for its status query.

Three further gaps:

  • §6.4 does not say whether check_consistency takes the same lock. A user who runs it for several wavelengths at once on a device build, which is what §6.4 tells that user to do, can still put several models on the card.

  • flock can fail outright, rather than merely be unreliable, on some network or parallel filesystems, and the text does not say what happens then.

  • In phase 1, before §6.4 exists (phase 2), a shared-mode run that misses the cache has no defined behaviour.

Recommendation:

  • Say which request prepares the private model on a host build (for example, diagnostic_plan prepares it when none exists), and that the binding kills that worker and starts a fresh one before build_plans, inside _consistency_gate or the binding’s diagnostic_currents.

  • Say that check_consistency takes the same lock when it computes, and that an flock error is logged and the run continues without the lock.

  • State that in phase 1 a cache miss in shared mode is refused, and that phase 1 tests seed the cache.

R23. The worker does more on a device build than the provider’s “no device use in a client” covers#

Sections: 3.2 (no device use in a client), 5.4 (P5), 6.3, 6.4. Priority: should.

The provider’s requirement covers four things: importing the package, constructing a SharedPlan, evaluating through it, and reading its records. In shared mode the worker on a device build also does the following:

  • builds the handshake identity (build_info());

  • calls hacc.helium_preset(...) and builds the preset’s unprepared fields in _verified_preset;

  • builds the provider’s atom, basis and gauge objects (_hacc_objects);

  • calls hacc.server_status and ServerStatus.refusal.

None of these is named in the requirement. §6.4’s claim, “A shared-mode run never puts a model on the card”, is about the model. The question for the card is the execution runtime, and a context that a worker holds for the whole run is the very thing §6.4 was revised to avoid.

Recommendation: Ask the provider to extend the requirement and its device-phase check to the unprepared preset and model objects and to server_status and refusal, or record why they cannot initialise the runtime. Until then, keep the host-build route as the safe one in the manual, as §8 already does for clients.

R24. T1’s exact comparison of drives and currents against separate private runs can fail without a defect#

Sections: 7.1 (T1), 7.2. Priority: should.

T1 compares “every drive the server received and every current each run got back, against the same runs on private manufactured plans”, with “Drives and currents exact”. §7.2 runs T1 on native and says the fields may differ “since a threaded reduction may differ between two runs without any defect”. A field that differs at the level of rounding gives a different drive at the next call, and so a different manufactured current. Only the first call’s drive is guaranteed to be identical. The exactness belongs to the transport, not to two separate runs.

Recommendation: Make T1’s exact part a check on each call:

  • the drive the server received equals, bit for bit, the drive the binding sent (log it at the binding);

  • the rows returned equal the manufactured function of that drive at the run’s rows.

Compare the shared run with the private run only on the fields and within the budget, as now. Keep exact ledgers only where they do not depend on the step sequence, or compare them under a fixed step sequence.

R25. The §7.4 gate leaves out run-to-run repeatability and has undefined edge cases#

Sections: 7.4, 4, 12 (Q9), 11. Priority: should.

  • No baseline. The criterion \(\Delta_B(s,p) \le 100\,A_B\,\epsilon\) assumes that batch membership is the only difference between \(s\) and \(p\). §7.2 says two runs on the native backend may differ with no defect, and §7.4 does not name the backend of the device runs. If two private runs of the same configuration differ, that difference is not covered by \(A_B\,\epsilon\), and the gate can fail for correct code. Equally, a gate that passes says nothing about batch dependence.

  • \(\epsilon = 0\). The provider’s short-window figure on the MI300X was bitwise equality. If its measured \(\epsilon\) for a family is zero, “rounded up to a power of ten” is undefined, and the gate becomes bitwise equality, which SEP 25 does not ask for.

  • The runs. “Run as 2 and as 4 simultaneous runs” does not say whether the runs are identical or differ (in energy, say), nor whether the private runs are simultaneous on the card. Runs that differ can finish at different steps, which changes the batch during the segment.

  • Shortening. When no pair is matched, “the segment is shortened and the comparison repeated”, but \(A_B\) was measured on the longer segment and is not re-measured.

  • Spectral shape. \(A_B\) is measured with a white pattern of a given maximum, and \(\epsilon\) is a maximum relative to the peak. The ratio of in-band norm to maximum depends on the spectrum of the real difference. The factor of 100 has to absorb that, and the text should say so.

Recommendation:

  • Name the optical backend of the device runs (numpy_ref, unless native is shown to repeat bit for bit on that machine).

  • Add a private-against-private repeat on the card. Gate on \(\max(100\,A_B\,\epsilon,\ \text{that baseline})\), or require the baseline to be zero.

  • Define the effective size as \(\max(\epsilon, \epsilon_{\min})\) with a stated floor.

  • Specify the run set: identical configurations, private runs started together.

  • Re-measure \(A_B\) whenever the segment is shortened.

  • Add one sentence saying that the factor of 100 also covers the unknown spectral shape.

R26. Several rules of the last revision have no test#

Sections: 7.1, 11. Priority: should.

Not covered by T1 to T14:

  • a stop while waiting on the cache lock (§6.4: “The wait polls the stop flag”), during the degraded retries, and during the admission build (T5 lists only place, round, march and lost server);

  • a revision the provider cannot verify, which “warns once as well and records it” (§6.3);

  • a restarted server of another family stopping the run (§6.5; T4 covers only another revision);

  • the case of R19;

  • the cases of R20 (a failed march followed by a lost server; a refusal or failed admission build at reattachment);

  • whatever rule R27 settles for a server that reports itself degraded at preparation.

Recommendation: Extend T4, T5 and T14, or add tests, for each item. Put each in the phase that delivers its rule (the lock and degraded stops in phase 2).

R27. The status query’s degraded flag and its latency are not used or bounded#

Sections: 6.3, 3.2. Priority: minor.

The status gives “whether the server is degraded”, and the provider’s answers say that the consumer reads that flag itself, because refusal does not check it. §6.3 does nothing with it at prepare or at build_plans. The provider also states only a target, not a promise, for how fast the status is answered while the server marches or builds. timeout=0.0 bounds only the wait for a server at the path, not a slow answer.

Recommendation: At preparation, log the warning of §6.5 when degraded is true and continue (the first attachment then applies Q12). State that the parent’s poll of the stop flag is the only bound on a slow status answer, or give it one.

R28. T9’s “must fail” depends on which perturbation pattern sets \(A\)#

Sections: 7.1 (T9), 7.4. Priority: minor.

T9 perturbs rows “when the batch changes” and holds the result to \(100\,A\,\eta\), with \(A\) “measured as in §7.4”. That \(A\) is the largest over an independent and a biased pattern. If T9’s own perturbation is the independent one and \(A\) comes from the biased one, which adds linearly from call to call, then \(10^{3}\,\eta\) may pass a gate set by the larger \(A\), and the “must fail” oracle does not hold.

Recommendation: In T9, measure \(A\) with the same pattern and the same calls as T9’s perturbation, or state the number of perturbed calls needed for the factor of 10 to hold.

R29. §7.3 asserts bitwise numpy_ref fields while T1 holds numpy_ref fields to a budget; and the setup cache is not shared#

Sections: 7.1 (T1), 7.2, 7.3. Priority: minor.

T1 and §7.2 hold the fields to “each backend’s existing budget, not to equality”, and the earlier response called this “more cautious” for numpy_ref. §7.3 then asserts the saved numpy_ref fields bitwise equal. Both cannot be the right expectation of the same backend. §7.3 also shares “one kernel cache directory and one thread count”. The provider’s condition is “the same prepared model”, which also needs the same setup cache: the private runs’ hacc_cache should be the server’s cache.

Recommendation: Settle whether numpy_ref repeats bit for bit and use that answer in both places. In §7.3, give the private runs’ hacc_cache the server’s cache directory.

R30. Where and how the device-build refusal happens is loosely stated#

Sections: 5.2, 6.4, 7.1 (T8), 9. Priority: minor.

§6.4 and T8 say the run is “refused at preparation”. The cache is read in _consistency_gate, which runs after _prepare_atomic, after the backend is selected and after _restore_atomic (Simulation.run). The gate’s existing refusals call open_run to write the opened record before raising. The text does not say whether this refusal does the same, or which exception it raises. “A host space” is not defined. In the code it is the set {"openmp", "serial", "threads"} in _build_record.

Recommendation: Say “in the consistency gate, before any model is prepared”. Name the exception and whether the opened record is written. Define a host build by that set of execution spaces.

R31. Small inaccuracies#

Sections: 3.2, 6.8. Priority: minor.

  • §6.8: “0.46 MB each way for a 6-row client” is right for the drive (6 × 9,593 × 8 bytes). The compact reply also carries the order-one shadow total current of the same size, plus the validity mask and the time axis, so the return is about 1 MB.

  • §3.2 omits two points of the provider’s answers: a round in which the server refused the client’s submission counts in missed_rounds, and under --fixed-rows a client gets the lowest free block that fits. Neither changes the design.

Recommendation: Correct the figure and add the two clauses.

Checked and found correct#

  • Worker.request sends one request and gets one reply or error, and ends the worker on any exception, including a RemoteError. _error_report carries only type, message, classification and traceback. The worker ignores SIGINT and SIGTERM, and a stop kills its process group.

  • PyroraptorAdapter.classify tests DrivenError first. In the provider, TDSEError is the base and DrivenError its subclass, so the new PlanServerError classes would be classed native unless tested first. AttachRefusedError (a TDSEError and a ValueError) classes as interface. §5.4’s instruction for P1 is right.

  • _ProviderBinding.evaluate runs in this order: _ensure_worker, archive input, begin_evaluation, charge, then the request. An interruption releases the reservation and archives interrupted without counting a failure. Any other exception kills the worker, counts a failed call and raises BackendError.

  • The run’s order in Simulation.run: _prepare_atomic (with defer_plans for haCC), backend selection, _start, _restore_atomic, _consistency_gate (gate_run, then build_plans), then run_problem. serve calls open_run first, writes the terminal record and checkpoint in its except before re-raising, and records completion on the COMPLETED event. _close_run closes the backend, the binding, the archive and the output, in that order.

  • evaluate_consistency reads the cache, computes on a miss and writes only a valid reduction. The key is basis identity, provider revision, material, reference wavelength and protocol version. check_consistency builds its DiagnosticSession before reading the cache, so it prepares a model even on a hit, and the session applies _build_record with device.

  • _build_record refuses a mismatched execution space; the host set is openmp, serial and threads. _ensure_worker requires the same build record.

  • The adapter’s _prepare prepares the haCC model even with defer_plans. _diagnostic_plan requires a prepared model. _verified_preset judges device admission from the request’s device.

  • AtomicCallBudget(limit, calls_per_evaluation); one chunk gives one call per evaluation.

  • The two haCC record serializers are at version 1, there is one per model and selection, and write_failure does not validate the classification.

  • §3.2 against the provider’s answers: the error classes, what raises them and the state of the client afterwards; the fields of the status and what refusal does and does not check; the nine fields of result.shared, including plan_serial normally being 2; the revision rule; attach_timeout not covering the admission build; the degraded state, its refusal of clients already waiting, and its absence under --fixed-rows; the rebuild after a failed march; the instance identifier; the socket rules. The provider’s corrections 1 to 7 are all applied.

  • §4’s figures against the provider’s answers: the batched exchange from the first column on HIP and the eleventh on CUDA; 1 to 2 × 10⁻¹⁰ over 12,987 steps; bitwise on the MI300X and 3.0 × 10⁻¹³ on the A40 over 2,600 steps; 1.9 × 10⁻¹³ giving 3.0 × 10⁻¹⁰ between host builds. Also the bound’s arithmetic (γ_d ≈ 1.3 × 10⁻¹², bound ≈ 9.6 × 10⁻⁵ atomic units).

  • The provider’s accepted design text does not yet contain the additions (it still reports failures as DrivenError), which agrees with §5.4’s “not yet implemented”.

Not checked#

  • The provider’s server and client, which do not exist yet.

  • Whether building the provider’s unprepared preset and model objects, build_info(), or server_status initialises a device runtime (R23).

  • Whether numpy_ref and the native backend repeat bit for bit from one run to the next on one machine (R24, R25, R29).

  • The host cost of the twelve host runs of §7.4 at the production window, which the SEP does not estimate.

  • The internals of the native session. I found no Python threads in the backends or the session loop, and assumed evaluations are synchronous within advance.

  • The open issues the SEP cites, on GitHub.