MMruDocs

F´ components

Layer 1 as components for NASA JPL's F´ framework, version 4.4.1. Every decision comes from the quorum crate, through a C interface that Kani proves equal to it.

F´ v4.4.1C++1459 unit testsv0.9.0

The source is in fprime/ of mruspace/flight. The requirements and the design were written and approved in F´'s own order, requirements first, then the model, then the code: requirements, design and results. The fault model maps each simulated fault to the failure it stands for on a real system.

Components

ComponentKindWhat it does
RedundancyManageractiveAsks the replicas for a result each cycle, decides with the core, delivers or rejects, steps the mode down as replicas are lost, runs known-answer tests, and resets a replica that falls silent.
HealthRegistrypassiveHolds the strike record per replica: three outvotes within 200 cycles start a diagnosis.
ReplicaHostactive, one per replicaRuns the payload and answers requests and known-answer tests. A disabled host does not answer.
SensorVoterpassiveChooses one value each cycle from up to three readings of one quantity, within a tolerance, and excludes a sensor that keeps disagreeing (MRU-SV-001 to 007).
FaultInjectorpassive, test builds onlySits between the manager and the replicas in a test topology: silence (kill, hang), a stuck value, and bit flips in a replica's working memory, with the same random upsets as the demo for a seed. A reset on resetIn ends a hang that has started (MRU-FI-004, event ResetApplied).
RunRecorderpassive, test builds onlyStands in for the ground in an experiment: checks every delivered result against the payload computed without a fault, counts correct and wrong results, and reads the manager's last telemetry for the summary. The manager never sees it.
SensorSimpassive, test builds onlySends three noisy readings of a known value, with spike, drift, stuck and drop faults. Scores each chosen value against the true value, and a plain average as a baseline (MRU-SS-001 to 005).

In a flight topology the manager connects to the replicas directly, so no test code is in the flight path.

In MruOpsSat, the first deployment, the replicas run as three threads of one process. Since v0.7.0, MruQuorum runs each replica as its own MruReplica process. The processes link to the manager through F´'s GenericHub over a SOCK_SEQPACKET socket pair, driven by the SeqPacketDriver component. That deployment flew in run 3 on October 28, 2026. Both use the same components.

RedundancyManager

ElementName
Input portsschedIn (rate group, once per cycle), replyIn[3], pingIn
Output portsrequestOut[3], enableOut[3], resetOut[3], resultOut, healthStrike, healthClear, pingOut
CommandsSET_POLICY, STANDBY_REPLICA, ADMIT_REPLICA
ParametersKatPeriod (U32, 64 cycles), StateSavePeriod (U32, 1,000 cycles; 0 saves on change only), ResetLimit (U8, default 0: automatic resets off)
TelemetryCurrentPolicy, CurrentMode, LiveReplicas, Retired, Slots, Resets on change; Delivered, Caught, Late each cycle
EventsMode changes, caught disagreements (throttled), diagnoses, retirements with their reason, standby and admission, withheld cycles (CycleWithheld), automatic resets (ReplicaReset, ResetsExhausted), the state file, and the halt

The full model: RedundancyManager.fpp in fprime/Mru/Components/RedundancyManager.

A replica is retired when its known-answer result is wrong or missing, or after three missed cycles in a row. The event gives the reason: a diagnosis that failed or was not answered, a periodic test on the last replica that failed or was not answered, or lost. With ResetLimit above 0, a replica retired for silence gets an automatic reset (below).

F´ returns 0 for a parameter that was never loaded. The manager then uses the model's defaults, so a topology that skips loadParameters() does not run the known-answer test every cycle.

Spares and standby

Each of the three slots is ACTIVE, STANDBY or RETIRED. Only ACTIVE slots get requests. These follow section 8 of the whitepaper, where salvaged processors join as spares and declining nodes are set aside.

  • STANDBY_REPLICA disables an ACTIVE slot to save power. It is refused if the policy could not run on the slots left. A power accountant will use it; that accountant is not built.
  • ADMIT_REPLICA enables a STANDBY slot, or new hardware in a RETIRED slot, and asks for its known answer. The slot becomes ACTIVE only if the right answer arrives by the end of the next cycle.

Automatic resets

A replica can fall silent for a reason that a reset cures: for example, a device on a bus that stops answering until it is reset. Since v0.8.0 the manager handles this case (MRU-RM-024). It is off by default: ResetLimit is 0.

  • Reset, then test. When a replica is retired for silence (lost, or its known answer missing), the manager sends a reset on resetOut and emits ReplicaReset. At the next cycle it starts an admission, the same as ADMIT_REPLICA's. The slot becomes ACTIVE again only on the right known answer. Admissions after resets wait behind an admission in progress.
  • Bounded. A unit still silent gets the next reset. After ResetLimit resets the manager emits ResetsExhausted and the slot stays RETIRED, so a dead unit cannot cause a reset loop. The limit counts every reset of the slot since the manager started. An admission that passes does not clear it.
  • Never after a wrong answer. A wrong answer is not silence. A replica retired for a wrong answer is never reset.

In the runs, resetOut goes to FaultInjector. There a reset ends a hang that has started. A hang scheduled for later still comes, and a kill or a stuck value stays. On a real system, resetOut would drive the platform's reset line for that unit. Mru decides when to reset and whether to take the unit back. It does not reset hardware itself.

State across resets

The manager saves the policy, the slot states and the cycle counter when one of them changes, and every StateSavePeriod cycles. The record is 21 bytes with a CRC-32. It writes a new file, flushes it and renames it over the old one, so a power cut leaves the old state or the new one. At start it restores a valid file and reports it, or starts with all slots ACTIVE and warns. Strikes are not saved: after a reset each replica starts a fresh window. Automatic reset counts are not saved either. After the manager restarts, each slot starts again with no resets used.

SensorVoter and SensorSim

Readings of one quantity by three sensors never match exactly. Noise, calibration and timing make them differ a little, so the replicas' exact vote does not fit them. SensorVoter compares readings within a tolerance instead. It is a flight component, added in v0.8.0. It makes no decision itself: it calls quorum_sensor_select and quorum_sensor_observe (MRU-SV-001).

ElementName
Input portreadingsIn (cycle, three I32 values, three presence flags)
Output portselectedOut (cycle, value, checked)
CommandINCLUDE_SENSOR
ParametersTolerance (U32, default 0, in the readings' units), ExcludeAfter (U8, default 5; 0 never excludes)
TelemetryAgreed, Unchecked, Disagreed, Outliers each cycle; Excluded on change
EventsSensorOutlier and SensorsDisagree (both throttled at 10), UncheckedValue (throttled at 5), SensorExcluded, SensorIncluded, IncludeRefused

The full model: SensorVoter.fpp in fprime/Mru/Components/SensorVoter.

Each cycle the voter marks the readings of excluded sensors absent and chooses from the rest:

  • Three readings: the median, if at least one other reading is within the tolerance of it. A reading further away is an outlier, with an event, and is never chosen. If no other reading is that close, the readings disagree.
  • Two readings: their midpoint, if they are within the tolerance of each other. If not, nothing says which is right, and the voter delivers nothing for the cycle.
  • One reading: delivered, marked unchecked.
  • Exclusion: a sensor that is an outlier in ExcludeAfter agreed cycles in a row is excluded, and its readings are no longer used. A short spike is forgiven. A cycle with no agreed value changes no count. INCLUDE_SENSOR brings an excluded sensor back with its count at 0.

SensorSim is for test builds only. After SENSORS_ON(noise, accuracy, seed) it sends three readings of a known value each cycle: a triangle wave from 20,000 to 22,000 and back every 400 cycles, with seeded uniform noise. SENSOR_FAULT schedules a SPIKE, DRIFT, STUCK or DROP on one sensor. It counts correct, wrong and unchecked values, cycles with no value, and cycles in which a plain average of the readings was wrong (Correct, Wrong, UncheckedValues, Withheld, AverageWrong). Both components are in MruQuorum, off until SENSORS_ON. When on, the summary adds a sensors: line.

Run 4, segment 4 runs them for 40 s: a spike on sensor 1 at cycle 60 (three cycles), a drift on sensor 2 from cycle 120, and sensor 0 frozen from cycle 260. Tolerance 2.00, noise up to 0.50 (the readings are in hundredths), exclusion after 5 outlier cycles. In orbit in run 4, on November 20, 2026, and in a full-length native run in the build container, 399 cycles gave 279 correct values, 0 wrong, and 120 cycles with no value. The spike was masked and sensor 1 kept. Sensor 2 was excluded at cycle 137. From cycle 279 the two readings left disagreed, so the voter delivered nothing. A plain average of the same readings was wrong in 261 of the 399 cycles. Source: the fault model. The readings are simulated, with a known true value.

One cycle

The order follows a tick of the demo, so the same seed gives the same counts:

  • Close the last cycle. Decide it if it is not yet decided, with a missing reply as absent. Count missed replies, and fail tests that had a full cycle to answer.
  • Start the next. Ask every ACTIVE slot. On the last replica, ask for two results on even cycles only, and add the known-answer test every KatPeriod cycles.
  • Decide as soon as every answer is in. Strikes, the test of two disagreeing replicas, and the periodic test follow at once.

A replica that dies stops answering, so the manager finds the death by silence. When a death leaves one replica, the cycles until it is marked lost end as caught disagreements. The demo kills its replicas itself and knows at once; this is the one place the counts differ.

Deployment

MruOpsSat is the first F´ deployment of the components. It runs them with F´'s own services: the command dispatcher, the event manager, the telemetry database, health pings and a command sequencer (the CdhCore subtopology), driven by a Linux timer every 100 ms. The faults and the policy come from F´ command sequences, as an operator would send them. It has no communications stack: events are written as text lines and the summary as a file.

It is built as a static, optimized 32-bit ARM binary for the SEPP, the Cortex-A9 payload processor of OPS-SAT PRETTY. In ESA's OPS-SAT experiment environment, on a laptop under emulation, the package ran full length on October 22, 2026: 148 seconds, 0 wrong results, the counts of the demo within the system test's rule, a restore from the state file after a kill, and 1.2% to 1.5% CPU in the timed run. The second deployment flew in its place. See the operations note.

A second deployment puts each replica in a process of its own: MruQuorum, the manager process, starts three MruReplica processes, linked through F´'s GenericHub over SOCK_SEQPACKET Unix socket pairs (no network), and pins them to the SEPP's two cores. The kill is real: the manager sends SIGKILL to a replica process at the start of a cycle. In ESA's environment under emulation it gave the same counts and events as the first deployment, with the three processes pinned in every segment. It ran on the SEPP, on the FlatSat and in orbit, on October 28, 2026 (below). Both deployments wire manager.resetOut to injector.resetIn. Only MruQuorum holds SensorVoter and SensorSim.

On one processor the manager and the replicas share the processor. A manager that falls behind used to close cycles before their answers were dispatched, so healthy replicas looked silent and were retired as lost. Since v0.6.0 a cycle that closes late, with other messages still in the manager's queue or every expected answer missing at once, counts against no replica; with an answer missing it is withheld and counted (MRU-RM-023). In a container starved of processor time, the old rule halted 9 of 15 runs and the new one none; no run gave a wrong result.

In MruQuorum every reply crosses a socket. Since v0.9.0 the manager process checks each message from a replica on its link, before the hub decodes it (MRU-DEP-008). A message passes only if it is exactly one well-formed ReplicaReply on hub port 0: the right type, port and length, a valid RequestKind, and nothing left over. The manager takes at most four messages from a replica in one cycle. It drops and counts anything else. The summary gives the count per replica on its links: dropped= line. A replica that sends only garbage is silent to the manager, and is lost.

Real bit flips made by software found the need for this check (MRU-DEP-009), in the package for run 4, segment 6. A corrupted replica sent a reply too short to decode. F´'s generated port code in the manager asserted on it and ended the manager process, in 1 of 64 native runs at 200 flips per second from start-up. After the fix, the manager did not crash in 160 native runs. See the fault model.

On OPS-SAT

The second deployment ran in orbit on ESA's OPS-SAT PRETTY satellite on October 28, 2026, at 09:13 UTC, as run 3 of experiment exp4051, after ESA's software environment and the TU Graz FlatSat the same morning. It was the first run of these components on flight hardware: the SEPP, with each replica process pinned to a core (0, 1, 1). Three segments in 148 s, the faults of run 1 from an F´ command sequence. Segment 1: the shrinking quorum; a bit flip at cycle 60 outvoted, replica 1 stuck at 120 and retired at 122, replica 0's process killed with SIGKILL at the start of cycle 240 and retired as lost at 242, then self-check on the last replica from 243. Segment 2: fixed TMR on the same faults. Segment 3: the shrinking quorum with replica 1 retired at 202; the manager killed 35 s in and started again, restored from its state file at cycle 303 with replica 1 still retired. Results matched the prediction written before the run.

Run 31 · Shrinking quorum2 · Fixed TMR3 · RestartTotal
FlatSat, 2026-10-28342 correct, 3 caught, 0 wrong, 1 withheld239 correct, caught to cycle 348, 1 withheld299 correct, 0 wrong, restored at 303148 s
In orbit, 2026-10-28342 correct, 3 caught, 0 wrong239 correct, caught to cycle 348299 correct, 0 wrong, restored at 303148 s

From the summary, event and state files and run-info.txt in theresult files. On the FlatSat the kill landed while the manager was behind, so it withheld cycle 240 (MRU-RM-023) and retired replica 0 one cycle later; the counts did not change. In orbit no cycle was withheld. On the SEPP the manager used 1.7 MB resident and 11.8 MB of address space, and 0.40% to 0.46% of wall time; all four processes together 0.79% to 0.96%. Scope: one payload processor with two cores, in user space, faults from a command sequence; not a hardware-redundancy test. Write-up:№ 008.

Run 4

Run 4 was approved by the OPS-SAT team on November 16, 2026. The v0.9.0 package ran on TU Graz's FlatSat and in orbit on OPS-SAT PRETTY on November 20, 2026: 244 seconds in orbit, every exit 0, 0 wrong results in every segment. It runs MruQuorum with three MruReplica processes and the cFS app, in six segments of 40 s, at 100 ms per cycle. Segments 1 to 3 share their faults: replica 1 hangs at cycle 60 and again at 300, and replica 2's process is killed with SIGKILL at cycle 150, a real dead unit.

SegmentResultWhere
1 · Shrinking quorum, resets on (ResetLimit 3)394 correct, 3 caught, 0 wrong; replica 1 reset and taken back at cycles 63 and 303; replica 2 kept out after 3 resets at 159; 2 units live at the endIn orbit, 2026-11-20
2 · Shrinking quorum, resets off271 correct, 3 caught, 0 wrong; replica 0 alone in self-check from cycle 154In orbit, 2026-11-20
3 · Fixed TMR148 correct, 0 wrong; halted at cycle 153In orbit, 2026-11-20
4 · Sensors (above)399 cycles: 279 correct, 0 wrong, 120 with no value; sensor 2 excluded at cycle 137In orbit, 2026-11-20
5 · cFS app (below)400 cycles: 318 correct, 3 caught, 0 wrongIn orbit, 2026-11-20
6 · Real bit flips173 flips, 149 in code; replica 2 crashed and was lost at cycle 229; 399 correct, 0 caught, 0 wrongIn orbit, 2026-11-20

Source: the files the satellite sent down, in opssat/results, and the fault model. On the FlatSat the same morning every count was the same, except where a cycle closed late and the manager withheld it (MRU-RM-023): replica 1 back at 304, and fixed TMR 149 correct. Replicas 0 and 1 of segment 6 crashed at shutdown, after the last result. Before flight, in ESA's environment image (32-bit ARM emulated on a laptop), three full runs took 246 s each, every exit 0, 0 wrong in every segment. Faults are simulated. In segment 6 they are real bit flips made by software, in user space, one bit at a time. The runs show the recovery logic, not a recovered device: a reset ends a simulated hang.

In segment 6 a thread in each replica process flips one random bit at a time in that process's own memory: its code, read-only data, data, heap and stacks. It logs each flip before it makes it. The manager runs the shrinking quorum with no resets and a known-answer test on the last replica every cycle, and is told nothing about the flips. A flipped replica stops at 2 s of CPU time and 256 KB of files, and no process writes a core file.

cFS application

cfs/ runs the same decision core as an application of NASA's core Flight System (cFS), added in v0.8.0. cFE, OSAL and PSP are pinned at the commits of the cFS bundle v7.0.1, unchanged. The Mru app is C99. It runs three replicas as cFE child tasks, with the payload of the F´ deployment, and takes every decision through quorum.h. Faults come from a schedule in /cf/mru.cfg. No sample or lab application is built, so nothing opens a network socket.

Around the core the app keeps the F´ manager's rules: strikes, known-answer tests, loss after three silent cycles, self-check on the last replica, and a withheld cycle when every answer is missing. It does not have the automatic resets or the sensor voter: those are F´ only. cfs/build.sh builds it in the F´ build container, static 32-bit ARM by default and native with NATIVE=1. CI builds it natively.

Natively, under an enforced 128 MB address-space limit with MALLOC_ARENA_MAX=1, the process used 9.0 MB of address space (November 13, 2026). In ESA's OPS-SAT environment image on November 13, 2026, run 4 segment 5 ran 40 s at 100 ms with the faults of run 1: 400 cycles, 318 correct, 3 caught, 0 wrong. The stuck replica 1 was retired on its known answer at cycle 122, and the hung replica 0 was lost at cycle 242. No socket was open, and nothing was left behind. Source: cfs/README.md. On November 20, 2026, it ran in orbit on OPS-SAT PRETTY in run 4 with the same counts, its first run on flight hardware, and peaked at 4.5 MB of address space on the SEPP.

C interface

quorum-ffi builds the core as a no_std static library with a C header, quorum.h. It is not tied to F´: any C or C++ framework can use it. The cFS app uses it too.

uint8_t quorum_mode(uint8_t policy, uint32_t alive);
quorum_verdict quorum_decide(uint8_t policy, const quorum_reply *replies);
void quorum_health_init(quorum_health *health);
bool quorum_health_strike(quorum_health *health, uint32_t replica, uint64_t cycle);
void quorum_health_clear(quorum_health *health, uint32_t replica);
quorum_sensor_selection quorum_sensor_select(const quorum_reading *readings, uint32_t tolerance);
quorum_sensor_run quorum_sensor_observe(uint8_t run, bool outlier, uint8_t limit);

The sensor functions use these constants and types:

/* sensors (quorum::sensor) */
#define QUORUM_SENSORS 3
#define QUORUM_SENSOR_AGREED 0    /* two or more readings agree within the tolerance */
#define QUORUM_SENSOR_UNCHECKED 1 /* the only reading, not cross-checked */
#define QUORUM_SENSOR_DISAGREE 2  /* readings disagree; nothing delivered */
#define QUORUM_SENSOR_NOTHING 3   /* no reading */

/* One sensor's reading; present is false for no reading or a sensor excluded. */
typedef struct {
    bool present;
    int32_t value;
} quorum_reading;

/* The choice for one cycle. */
typedef struct {
    uint8_t outcome;                  /* AGREED, UNCHECKED, DISAGREE or NOTHING */
    int32_t value;                    /* meaningful only for AGREED and UNCHECKED */
    bool outlier[QUORUM_SENSORS];     /* readings beyond the tolerance (three readings, AGREED) */
} quorum_sensor_selection;

/* A sensor's outlier count after one cycle. */
typedef struct {
    uint8_t run;  /* outlier cycles in a row */
    bool exclude; /* the count reached the limit: exclude the sensor */
} quorum_sensor_run;

Only plain values cross. The health record lives in the caller's memory. Out-of-range input gets the safe answer: a policy that is not 0 or 1 halts, an unknown reply kind counts as absent, a replica above 2 changes nothing, and a null pointer does the same. Seven Kani proofs show that quorum_mode, quorum_decide, quorum_health_strike, quorum_health_clear, quorum_sensor_select and quorum_sensor_observe give the core's answer for every valid input, and the safe answer for a bad policy, an unknown reply kind or a replica above 2. Unit tests check the null pointers. See Kani proofs.

Verification

CheckResult
Kani, core and C interface16 of 16 proofs: 4 core, 5 sensor selection, 7 C interface
C test of quorum.hSizes, layout and known cases pass
F´ unit tests59, by requirement: HealthRegistry 5, ReplicaHost 5, FaultInjector 9, RedundancyManager 27, RunRecorder 4, SensorVoter 6, SensorSim 3. Built with address and undefined-behavior sanitizers.
System test against the demo60 cases: the five bench schedules, both policies, three upset rates, two seeds, 4,000 cycles. 36 identical to the demo. In the other 24, a kill that leaves one replica costs 2 correct results and adds 3 caught disagreements. Wrong results are identical in all 60.
Deployments end to endscripts/fprime-deployment.sh: the MruOpsSat package with short caps, each segment's counts against the demo on the same faults, the events on their cycles, the restore from the state file, and a second run in the same folder. VERSION=2 scripts/fprime-deployment.sh: the same for MruQuorum, with a real kill.
Run 4 package end to endscripts/opssat-run4.sh, with short caps, on a native build that includes the cFS mission: a hung replica reset and taken back, a killed one kept out after three resets, the sensor segment, the cFS segment, and segment 6 at 20 flips per second. No segment delivers a wrong result.

All of these run in CI on every change. The expected counts are written by the demo itself, and CI checks they are current.

Build and test

# in a clone of mruspace/flight
git submodule update --init --recursive
cd fprime
python3 -m venv fprime-venv && . fprime-venv/bin/activate
pip install -r requirements.txt
fprime-util generate && fprime-util build
fprime-util generate --ut && fprime-util check --all
# the deployment, from the repository root, in the build container
cd .. && ./opssat/fprime/build.sh  # static 32-bit ARM build and its sequences
./opssat/run4/build.sh  # run 4: MruQuorum, MruReplica and the sequences
./cfs/build.sh  # the cFS mission, static 32-bit ARM

The build calls cargo to compile the core, so it needs a Rust toolchain. On macOS 27, the CMake that F´ v4.4.1 pins fails; CMake 4.4 works. Linux works with the pinned version.

Limits

  • Two runs on flight hardware. The second deployment ran twice in orbit, 148 and 244 seconds on one payload processor with two cores, in user space, with faults from a command sequence and, in run 4, real bit flips made by software. Not a hardware-redundancy test and not a radiation test. Everything else runs in tests on general-purpose processors, the ARM build under emulation. See the architecture status.
  • Simulated faults. The runs reproduce the symptoms of hardware faults, not their causes. The one exception is run 4, segment 6: real bit flips made by software, in user space, one bit at a time. The resets end a simulated hang, so the runs show the recovery logic, not a recovered device. The readings of SensorSim are simulated. See the fault model.
  • No ground link yet. The first deployment has no communications stack. A deployment with commands and telemetry from the ground is planned.
  • Not built: the retry of a cycle after a disagreement on two replicas (the whitepaper's "dual with checkpointing"), a step that makes every replica's input equal before it computes, the health score by error rate and response time, the power accountant, and memory scrubbing.

Updated November 18, 2026 · Source: fprime/Mru/Components · Edit on GitHub · Questions? Get in touch