soma.cell

Robustness for robotics

Bounded loops, timing and interlocks for control programs. Part of the guide to the Soma programming language.

These scenarios exercise Soma behavior relevant to robot controllers. They do not qualify hardware, real-time performance or a lunar system. Each scenario is a separate Rust integration test in compiler/tests/robotics_robustness.rs.

Results — Soma 2.8.3, 2026-09-20

  • Robotics campaign: 100 passed, 0 failed, 0 ignored.

  • Complete Rust suite: 523 passed, 0 failed, 0 ignored.

  • Core CLI fixtures: 118 passed, 0 failed.

  • Published corpus: 321 programs passed the website build checks.

Measured locally on macOS ARM64. Linux CI reruns the full suite on every push and pull request. This campaign confirmed the tested behavior without finding an additional runtime defect. The source of every scenario is in robotics_robustness.rs.

Scope and reproduction

Added in Soma 2.8.3 on 2026-09-20. This is a regression campaign for the language, with inputs chosen for robot-controller use. The motor and sensor values are simulated data; no physical hardware is driven.

Run all 100 independently named scenarios from the repository root:

cargo test --release --locked --manifest-path compiler/Cargo.toml --test robotics_robustness

Run them with every existing Rust test:

cargo test --release --locked --manifest-path compiler/Cargo.toml --no-fail-fast

IDs 001–080 cover numeric boundaries, sensor validation, mission transitions, storage invariants, rollback and collection/JSON boundaries. IDs 081–090 test the distinction between static rejection, proof, runtime checks and unproved distribution. IDs 091–095 run native handlers, including comparison with the interpreter. IDs 096–099 use fresh processes to check committed data and rollback persistence; 100 distinguishes recorded errors from returned data. verify_fail and check_fail mean the expected rejection is asserted, including its diagnostic. A refusal is a passing test, not a waived failure.

The separate existing compiler/tests/cluster.rs suite covers actual network replicas, seed failure, reconnect, stale updates, restart, and partition recovery. The 100 scenarios below do not add consensus or distributed safety proofs.

Limits

These are finite examples, not a proof for every input. They do not measure worst-case execution time, memory exhaustion, radiation tolerance, sensor or actuator faults, abrupt power loss, or hardware fail-safe behavior. Restart tests exit processes normally after a commit or a rejected handler; they do not inject power loss during a disk write. Local transaction rollback cannot undo a command already sent to a physical actuator. The cluster remains experimental and eventually consistent, with local reads and no fenced scheduler. Use the guarantees and cluster limits when assessing a design.

IDScenarioCheck
001encoder counts above float precisionruntime
002odometer integer promotionruntime
003negative odometer promotionruntime
004wide distance productsruntime
005large finite calibration ratioruntime
006negative fixed point divisionruntime
007subnormal measurement ratioruntime
008nearby large sensor varianceruntime
009high dynamic range medianruntime
010exact message sequence sortingruntime
011divide zero is catchableruntime
012integer divide zero is catchableruntime
013remainder zero is catchableruntime
014nan rejected by sensor guardruntime
015positive infinity rejected by sensor guardruntime
016negative infinity rejected by sensor guardruntime
017nan cannot become integer commandruntime
018huge integer cannot silently become infinityruntime
019non numeric actuator math is rejectedruntime
020failed math does not poison later commandsruntime
021sensor guard accepts exact endpointsruntime
022sensor guard rejects out of rangeruntime
023missing telemetry is not zeroruntime
024false telemetry is not missingruntime
025zero measurement survives coalescingruntime
026control vector arithmeticruntime
027vector shape mismatch is rejectedruntime
028large sequence dedup is exactruntime
029sensor maps compare structurallyruntime
030no sensor fusion from empty setruntime
031new rover is dockedruntime
032nominal mission round tripruntime
033cannot drive before armingruntime
034repeated arm is not a second commandruntime
035low power prevents armingruntime
036abort is terminalruntime
037abort stops driving motorruntime
038different robots have independent statesruntime
039cannot skip to samplingruntime
040unknown transition is rejectedruntime
041battery bounds are inclusiveruntime
042battery underflow preserves old valueruntime
043battery overflow preserves old valueruntime
044invalid battery type is rejectedruntime
045nan motor command is rejectedruntime
046infinite motor command is rejectedruntime
047motor bounds are inclusiveruntime
048command queue capacity is enforcedruntime
049immutable audit cannot be rewrittenruntime
050immutable audit cannot be deletedruntime
051failed sample rolls back state and dataruntime
052failed batch rolls back every slotruntime
053create then delete is undoneruntime
054delete rollback restores existing recordruntime
055repeated overwrites restore originalruntime
056failed immutable append does not burn idruntime
057try is a nested savepointruntime
058error kind and detail survive catchruntime
059short circuit and avoids invalid readruntime
060short circuit or avoids invalid readruntime
061negative list index reads lastruntime
062out of range list index raisesruntime
063fractional list index is not truncatedruntime
064invalid range step is rejectedruntime
065long command stream can stop earlyruntime
066queue elements obey declared typeruntime
067map cannot silently accept list pushruntime
068json preserves large command idruntime
069json overflow is rejectedruntime
070untrusted json cannot forge unknown variantsruntime
071empty string value is presentruntime
072null value is distinct from missing keyruntime
073null cannot be an accidental keyruntime
074private storage keys are reservedruntime
075key and value views stay consistentruntime
076missing delete has no side effectruntime
077text command ids are not coercedruntime
078nested map update does not alias another valueruntime
079unicode command payload roundtripsruntime
080integer clock difference stays exactruntime
081unbounded recursion is not a proofverify_fail
082guarded counter induction is provableverify_ok
083invalid state target is static errorcheck_fail
084unsafe literal write cannot verifyverify_fail
085dynamic state target cannot pass strictverify_fail
086replica count does not prove consensusverify_fail
087eventual cluster is not a strict safety proofverify_fail
088missing handler is rejectedcheck_fail
089proven decreasing recursion terminatesverify_ok
090typed boundary mismatch is reportedruntime
091native encoder add promotionruntime
092native distance multiply promotionruntime
093native negative integer divisionruntime
094native zero divisor is catchableruntime
095native wide bit shift preserves encoder bitsruntime
096committed telemetry survives process restartprocess
097failed handler leaves no persistent writesprocess
098failed transition leaves no persistent stateprocess
099immutable audit survives process restartprocess
100record replay preserves failure classificationprocess