Skip to main content

engine.solvers.grounding

engine.solvers.grounding

Grounded-intent solvers: how long a learned target stays true, and the lease that bounds it.

Domain implementations behind mlsysim.solvers (the public import path, derived from engine.solvers.__init__). The equations live in physics.robotics (the evidence horizons, the stopping distance) and physics.statistics (the conformal rank, the chi-square quantile); these models compose them for one stated target, arm, and aisle, so a chapter, a slide deck, and a lab read the same arithmetic (added 2026-10-20).

Classes

Name Description
ConfidenceRegionModel A Gaussian estimate’s confidence region compared with a tolerance, axis by axis.
DynamicReachModel The transit lower bound: no trajectory covers d faster than d / v_max.
ForwardOccupancyModel Growth term of a person’s forward occupancy set, v_h dt, against an aisle.
IntentCadenceModel A moving target’s evidence horizons against a slow proposer’s cadence.
IntentLeaseExpiryModel The intent lease’s expiry: the earliest of evidence, host silence, and the stopping deadline.
ReferentSetModel Open-vocabulary candidates normalized and screened by a split-conformal threshold.

ConfidenceRegionModel

engine.solvers.grounding.ConfidenceRegionModel()

A Gaussian estimate’s confidence region compared with a tolerance, axis by axis.

The region holding probability coverage has principal semi-axes r sigma_i, where r^2 is the chi-square quantile for one degree of freedom per axis.

Methods

Name Description
solve A Gaussian estimate’s confidence region compared with a tolerance, axis by axis.
solve
engine.solvers.grounding.ConfidenceRegionModel.solve(
    sigmas,
    coverage,
    tolerance,
)

A Gaussian estimate’s confidence region compared with a tolerance, axis by axis.

Parameters
Name Type Description Default
sigmas sequence of Quantity Positive principal-axis standard deviations, length. required
coverage float Gaussian-region probability in the open interval (0, 1). required
tolerance Quantity Positive allowed spatial error, length. required
Returns
Name Type Description
ConfidenceRegionResult Dimensionless chi-square quantile and radius multiplier, principal semi-axes in millimeters, count inside tolerance, and worst axis-to-tolerance ratio.
See Also

calc_chi_square_quantile : Composed numerical primitive.

Notes

Equation: The region holding probability coverage has principal semi-axes r sigma_i, where r^2 is the chi-square quantile for one degree of freedom per axis.

Assumptions: A jointly Gaussian estimate is expressed in principal axes with the supplied standard deviations and dimension equal to their count.

Excludes: Non-Gaussian tails, uncertain covariance estimates, and obstacle geometry beyond the scalar per-axis tolerance comparison.

References

Derivation: Whiten the Gaussian error so squared radius follows chi-square with one degree of freedom per axis; multiply each standard deviation by the square root of its coverage quantile.

Examples
>>> from mlsysim.core.units import Q_
>>> from mlsysim.engine.solvers.grounding import ConfidenceRegionModel
>>> result = ConfidenceRegionModel().solve(sigmas=[Q_('1 mm'), Q_('1 mm')], coverage=0.95, tolerance=Q_('10 mm'))
>>> bool(result.axes_within == 2)
True

DynamicReachModel

engine.solvers.grounding.DynamicReachModel()

The transit lower bound: no trajectory covers d faster than d / v_max.

A terminal move is admissible only if that floor fits the evidence window; otherwise the reach is staged on at least ceil(floor / window) fresh captures. The reach inside a window at the speed ceiling is v_max T.

Methods

Name Description
solve The transit lower bound: no trajectory covers d faster than d / v_max.
solve
engine.solvers.grounding.DynamicReachModel.solve(
    speed_ceiling,
    target_distance,
    tracked_horizon,
    untracked_horizon,
)

The transit lower bound: no trajectory covers d faster than d / v_max.

Parameters
Name Type Description Default
speed_ceiling Quantity Positive admitted speed limit, length/time. required
target_distance Quantity Nonnegative target travel distance, length. required
tracked_horizon Quantity Positive remaining evidence window with tracking, time. required
untracked_horizon Quantity Positive remaining evidence window without tracking, time. required
Returns
Name Type Description
DynamicReachResult Transit floor and shortfall in milliseconds, reach distances in millimeters, a fits boolean, and integer fresh-capture count.
Notes

Equation: A terminal move is admissible only if that floor fits the evidence window; otherwise the reach is staged on at least ceil(floor / window) fresh captures. The reach inside a window at the speed ceiling is v_max T.

Assumptions: The speed ceiling can be sustained and each positive evidence window can be renewed when a staged reach needs another capture.

Excludes: Acceleration and braking ramps, capture latency, obstacles, and proof that a staged trajectory is executable.

References

Derivation: Distance divided by maximum speed bounds transit from below; ceiling the ratio of transit time to evidence window counts the minimum windows needed under this ideal staging convention.

Examples
>>> from mlsysim.core.units import Q_
>>> from mlsysim.engine.solvers.grounding import DynamicReachModel
>>> result = DynamicReachModel().solve(speed_ceiling=Q_('1 m/s'), target_distance=Q_('1 m'), tracked_horizon=Q_('2 s'), untracked_horizon=Q_('1 s'))
>>> bool(result.fits)
True

ForwardOccupancyModel

engine.solvers.grounding.ForwardOccupancyModel()

Growth term of a person’s forward occupancy set, v_h dt, against an aisle.

Over a screening horizon dt the set centered on the last measurement grows by v_h dt (before the body envelope and tracking error); past w / v_h one person’s growth term alone spans an aisle of width w.

Methods

Name Description
solve Growth term of a person’s forward occupancy set, v_h dt, against an aisle.
solve
engine.solvers.grounding.ForwardOccupancyModel.solve(
    approach_speed,
    aisle_width,
    untracked_horizon,
    tracked_horizon,
    forecast_horizon,
)

Growth term of a person’s forward occupancy set, v_h dt, against an aisle.

Parameters
Name Type Description Default
approach_speed Quantity Positive constant approach speed, length/time. required
aisle_width Quantity Positive aisle width, length. required
untracked_horizon Quantity Positive remaining evidence window without tracking, time. required
tracked_horizon Quantity Positive remaining evidence window with tracking, time. required
forecast_horizon Quantity Nonnegative forecast duration, time. required
Returns
Name Type Description
ForwardOccupancyResult Growth distances in millimeters (forecast growth in meters), aisle-span horizon in milliseconds, and forecast-to-aisle ratio.
Notes

Equation: Over a screening horizon dt the set centered on the last measurement grows by v_h dt (before the body envelope and tracking error); past w / v_h one person’s growth term alone spans an aisle of width w.

Assumptions: A constant positive approach speed expands the forward set linearly from the last measurement.

Excludes: Body envelope, tracking error, lateral approach geometry, and acceleration; growth alone is not a complete occupancy set.

References

Derivation: Integrate constant speed over each horizon; solve speed*time equals aisle width for the time when growth alone spans it.

Examples
>>> from mlsysim.core.units import Q_
>>> from mlsysim.engine.solvers.grounding import ForwardOccupancyModel
>>> result = ForwardOccupancyModel().solve(approach_speed=Q_('1 m/s'), aisle_width=Q_('1 m'), untracked_horizon=Q_('1 s'), tracked_horizon=Q_('2 s'), forecast_horizon=Q_('3 s'))
>>> bool(result.growth_tracked > result.growth_untracked)
True

IntentCadenceModel

engine.solvers.grounding.IntentCadenceModel()

A moving target’s evidence horizons against a slow proposer’s cadence.

Untracked, the target leaves its tolerance after (r_tol - e_0) / v; tracked, only residual slip remains, sqrt(2 (r_tol - e_0) / a_slip). A proposer that renews the target from its own inference computes it from a frame captured one inference earlier and holds it one period, so the oldest evidence behind a model-only target is period + inference, and the drift it can follow is the margin over that age. A stall of T leaves the target e_0 + v T (untracked) or e_0 + a_slip T^2 / 2 (tracked) off; a stop begins one tick, one bus cycle, and one brake onset after expiry.

Methods

Name Description
solve A moving target’s evidence horizons against a slow proposer’s cadence.
solve
engine.solvers.grounding.IntentCadenceModel.solve(
    tolerance,
    initial_error,
    target_speed,
    slip_acceleration,
    intent_rate,
    inference_latency,
    stall,
    tick,
    bus,
    brake_onset,
)

A moving target’s evidence horizons against a slow proposer’s cadence.

Parameters
Name Type Description Default
tolerance Quantity Positive allowed spatial error, length. required
initial_error Quantity Nonnegative initial spatial error, length. required
target_speed Quantity Positive untracked target drift speed, length/time. required
slip_acceleration Quantity Positive residual acceleration under tracking, length/time**2. required
intent_rate Quantity Positive proposal frequency, inverse time. required
inference_latency Quantity Nonnegative proposal computation time. required
stall Quantity Nonnegative proposal outage duration, time. required
tick Quantity Nonnegative stop-dispatch tick delay, time. required
bus Quantity Nonnegative bus-cycle delay, time. required
brake_onset Quantity Nonnegative actuator onset delay, time. required
Returns
Name Type Description
IntentCadenceResult Spatial margins and errors in millimeters, horizons and delays in milliseconds, renewal speed in millimeters per second, and dimensionless horizon and speed ratios.
See Also

calc_linear_invalidation_horizon : Composed numerical primitive. calc_tracked_evidence_horizon : Composed numerical primitive.

Notes

Equation: Untracked, the target leaves its tolerance after (r_tol - e_0) / v; tracked, only residual slip remains, sqrt(2 (r_tol - e_0) / a_slip). A proposer that renews the target from its own inference computes it from a frame captured one inference earlier and holds it one period, so the oldest evidence behind a model-only target is period + inference, and the drift it can follow is the margin over that age. A stall of T leaves the target e_0 + v T (untracked) or e_0 + a_slip T^2 / 2 (tracked) off; a stop begins one tick, one bus cycle, and one brake onset after expiry.

Assumptions: Positive tolerance margin; untracked motion uses constant target speed and tracked residual motion uses constant slip acceleration.

Excludes: Tracking resets within the interval, time-varying slip, and physical stop-distance verification.

References

Derivation: Solve margin=v*t and margin=a*t*t/2 for evidence horizons; renewal age adds proposal period and inference latency. Stop onset adds tick, bus, and brake-onset delays.

Examples
>>> from mlsysim.core.units import Q_
>>> from mlsysim.engine.solvers.grounding import IntentCadenceModel
>>> result = IntentCadenceModel().solve(tolerance=Q_('10 mm'), initial_error=Q_('1 mm'), target_speed=Q_('1 mm/s'), slip_acceleration=Q_('1 mm/s**2'), intent_rate=Q_('1 Hz'), inference_latency=Q_('10 ms'), stall=Q_('1 s'), tick=Q_('1 ms'), bus=Q_('1 ms'), brake_onset=Q_('1 ms'))
>>> bool(result.untracked_horizon > result.stop_onset)
True

IntentLeaseExpiryModel

engine.solvers.grounding.IntentLeaseExpiryModel()

The intent lease’s expiry: the earliest of evidence, host silence, and the stopping deadline.

The credible deceleration is the arm’s worst-case stop averaged over a stop from its velocity limit; at the admitted speed ceiling the stop takes v t_onset + v^2 / (2 a), and the stopping deadline is the time the remaining clearance allows at that speed. With all three countdowns started together, the lease expires at the minimum.

Methods

Name Description
solve The intent lease’s expiry: the earliest of evidence, host silence, and the stopping deadline.
solve
engine.solvers.grounding.IntentLeaseExpiryModel.solve(
    untracked_horizon,
    tracked_horizon,
    administrative_lease,
    stop_onset,
    speed_ceiling,
    velocity_limit,
    worst_stop_time,
    clearance,
)

The intent lease’s expiry: the earliest of evidence, host silence, and the stopping deadline.

Parameters
Name Type Description Default
untracked_horizon Quantity Positive remaining evidence window without tracking, time. required
tracked_horizon Quantity Positive remaining evidence window with tracking, time. required
administrative_lease Quantity Nonnegative host-silence lease, time. required
stop_onset Quantity Nonnegative combined delay before braking, time. required
speed_ceiling Quantity Positive admitted speed limit, length/time. required
velocity_limit Quantity Positive speed at which the stop-time bound was obtained, length/time. required
worst_stop_time Quantity Positive worst-case stopping duration, time. required
clearance Quantity Nonnegative available separation, length. required
Returns
Name Type Description
IntentLeaseExpiryResult Credible deceleration in meters per second squared, stop distance in millimeters, signed deadlines and expiries in milliseconds, and the name of each binding constraint.
See Also

calc_safe_stopping_distance : Composed numerical primitive.

Notes

Equation: The credible deceleration is the arm’s worst-case stop averaged over a stop from its velocity limit; at the admitted speed ceiling the stop takes v t_onset + v^2 / (2 a), and the stopping deadline is the time the remaining clearance allows at that speed. With all three countdowns started together, the lease expires at the minimum.

Assumptions: Countdowns share an origin; averaged worst-stop deceleration applies at the admitted speed. Negative deadlines remain visible.

Excludes: Stop variability beyond the supplied bound, jerk-dependent transients, and certification of the resulting lease as safe.

References

Derivation: Infer a=velocity_limit/worst_stop_time and compute stopping distance v*onset+v*v/(2*a). Divide remaining clearance by v, then take the earliest of that deadline and the other leases.

Examples
>>> from mlsysim.core.units import Q_
>>> from mlsysim.engine.solvers.grounding import IntentLeaseExpiryModel
>>> result = IntentLeaseExpiryModel().solve(untracked_horizon=Q_('1 s'), tracked_horizon=Q_('2 s'), administrative_lease=Q_('0.5 s'), stop_onset=Q_('1 ms'), speed_ceiling=Q_('1 m/s'), velocity_limit=Q_('1 m/s'), worst_stop_time=Q_('1 s'), clearance=Q_('10 m'))
>>> bool(result.binding_tracked == "administrative")
True

ReferentSetModel

engine.solvers.grounding.ReferentSetModel()

Open-vocabulary candidates normalized and screened by a split-conformal threshold.

Raw per-box scores are normalized over the retained candidates; the set keeps every candidate whose normalized score is at least 1 - qhat, where qhat is the calibration score at rank ceil((n + 1)(1 - alpha)). A set of any size other than one is refused.

Methods

Name Description
solve Open-vocabulary candidates normalized and screened by a split-conformal threshold.
solve
engine.solvers.grounding.ReferentSetModel.solve(
    scores,
    calibration_count,
    alpha,
    threshold_score,
)

Open-vocabulary candidates normalized and screened by a split-conformal threshold.

Parameters
Name Type Description Default
scores sequence of float Nonnegative candidate scores with positive total; not assumed calibrated probabilities. required
calibration_count int Positive exchangeable calibration-set size. required
alpha float Miscoverage probability in the open interval (0, 1). required
threshold_score float Supplied calibrated nonconformity threshold in [0, 1]. required
Returns
Name Type Description
ReferentSetResult Normalized scores, entropy in natural-log units, conformal rank, threshold, integer admitted-set size, and a refusal boolean.
See Also

calc_split_conformal_rank : Composed numerical primitive.

Notes

Equation: Raw per-box scores are normalized over the retained candidates; the set keeps every candidate whose normalized score is at least 1 - qhat, where qhat is the calibration score at rank ceil((n + 1)(1 - alpha)). A set of any size other than one is refused.

Assumptions: Nonnegative retained scores have positive total; the supplied threshold was calibrated for these scores under exchangeability.

Excludes: Calibration fitting, proof of exchangeability, and interpreting normalized detector scores as calibrated correctness probabilities.

References

Derivation: Normalize each score by their sum and count those at least 1-threshold_score; refuse every count except one. The rank ceil((n+1)*(1-alpha)) identifies the intended calibration order statistic.

Examples
>>> from mlsysim.core.units import Q_
>>> from mlsysim.engine.solvers.grounding import ReferentSetModel
>>> result = ReferentSetModel().solve(scores=[0.9, 0.1], calibration_count=100, alpha=0.1, threshold_score=0.2)
>>> bool(not result.refuse)
True
Back to top