Headline result

Our simulation of a lab-automation cell (evidence/compare_checks.txt, evidence/stray_checks.txt). Cell A is cellguard's configuration: each driver in its own process under its own user ID. Cell D runs the same three drivers as threads of one process, restarted by the same supervisor, with one heartbeat per driver thread.

  • Hung gripper thread while tube 3 of 4 is in the gripper: A and D both detect the hang and deliver 4 of 4 tubes. A ramps the arm down and restarts only the gripper driver; D brakes at once and restarts all three drivers.
  • Stray write by the gripper code into the motor driver's command object, 10 rounds per cell: in A the open for writing fails in 10 of 10 rounds and 40 of 40 tubes are delivered. In D the write reaches the drive in 10 of 10 rounds; 27 of 40 tubes are delivered and 3 of 10 runs abort.

Cell C, the baseline with one heartbeat for the whole process, does not detect the hang: it delivers 2 of 4 tubes and reports the run as completed.

Inspiration

A lab-automation arm carries sample tubes between a rack and an analyzer; its gripper driver may come from another supplier. When one driver crashes or hangs mid-run, the run can stop with a tube in the gripper, and vendor manuals (Opentrons, Hamilton, Automata) describe the cost: lost reagents or samples and a manual recovery of the cell. That a fault of one driver stops their products in this way is our inference, not tested on them. We wanted a driver fault to mean: stop the arm safely, restart only that driver, continue.

Why QNX for this market: QNX's medical-devices page names the "precision processing of assays or analyzers to reduce loss of samples from errors and restarts", and QNX states that its OS for Safety 8.0, certified among others to IEC 62304 Class C, is binary compatible with SDP 8.0. cellguard itself has no certification and was tested only on QEMU images.

Simulation only: cellguard moves a simulated arm in shared memory. It is not for real robots or medical devices.'

What it does

Seven faults and what the cell does (each passes its checks in the repository's evidence/):

  • Motor driver killed while a tube is in the gripper (fault 1): the drive ramps the arm down along its path, the brake engages, only the motor driver restarts, the planner resumes, and the jaw stays closed.
  • Encoder driver killed while the planner uses its device path (fault 3): the brake engages at once and the planner pauses; the new encoder driver registers the same path, the planner's calls work again, and the brake is released.
  • Busy threads at FIFO 63 on every CPU (fault 5), also while the supervisor holds a low-priority page query (fault 13): the motor driver cannot raise its threads above 63, so the supervisor's watchdog at FIFO 70 still detects it, the brake engages and the driver restarts; the held query does not delay the watchdog.
  • Brake attack (fault 7): the motor driver tries seven ways to release the brake or to kill the safety monitor or the drive; all seven are refused, and its stray store into the read-only brake flag ends it.
  • Driver without the client library (fault 14): a test driver tries FIFO 255, the motor driver's device path and a busy loop. The first two are refused because the supervisor set its limits before its first instruction; the watchdog stops the loop.
  • Supervisor killed on the boot image (fault 15): the drive brakes on its own, slm starts the supervisor again, and the new supervisor keeps the arm braked until an operator reset.
  • Policy probe (fault 17): the motor driver tries to register the encoder's path, to add a brake link and to connect to the safety monitor. The security policy refuses all three; on the plain image without the policy all three succeed.

How it works:

  • cellsup, the supervisor, reads cell.conf: one line per process with its user ID, priority, abilities, heartbeat, reaction to its loss and security-policy type. A third-party gripper driver (src/gripperd.c, 122 lines) joins with two records.
  • Each brake flag lives in a shared-memory object that only its owner may write. The stop depends on the lost process: a ramp, then the brake, for the motor driver or the gripper; the brake at once for the drive, the encoder driver or the safety monitor. The brake is released when every critical process is READY again.
  • Every process that the supervisor starts runs under its own non-root user ID. The supervisor starts as root and switches to its own user ID before it starts the first child; on the boot image, cellguard's own slm instance runs as root to start the supervisor.
  • A browser page draws the cell live and names the brake that holds the arm (supervisor, safety monitor or the drive's own brake).

How we built it

  • C on QNX SDP 8.0 with qcc -Vgcc_ntox86_64 and GNU make on a Linux host, after sourcing the SDP's qnxsdp-env.sh; run on the QNX 8.0 QEMU image (x86_64) and on our own boot image.
  • Where the QNX-specific code is:
    • src/cellsup.c: start_held() (posix_spawn() with POSIX_SPAWN_SETCRED and POSIX_SPAWN_HOLD, and the policy type with secpol_posix_spawnattr_settypeid()), limit_child() (SchedSet() and procmgr_ability() on the held child), lock_down() (ability subranges for the supervisor itself), take_over() (braked takeover after an slm restart), restart_main() (the restart thread), create_objects() (shared memory owned by its writer), and in main() the supervision channel with _NTO_CHF_DISCONNECT | _NTO_CHF_FIXED_PRIORITY.
    • src/cg_client.c: cg_child_timer() (timer pulses on a fixed-priority channel) and cg_shm_map(); src/cg_resmgr.c, src/armdrv.c, src/sensord.c: the resource managers of /dev/cellguard/arm and /dev/cellguard/enc.
    • image/build_image.sh (boot image with mkqnximage), image/slm_cellsup_secpol.xml (slm starts the supervisor with its policy type), image/cellguard.secpol (8 security-policy types).
    • Evidence: evidence/slmboot_checks.txt (faults 15 and 17 on the booted image with the policy), evidence/checks.txt (the demo's 46 checks), evidence/build.txt (clean build).
  • Host tests: make host-test runs without the SDP: 70 of 70 (23 parser cases, 47 decision cases).
  • How the AI coding agents were used: AI coding agents (Claude Code) wrote the code, scripts and documentation, compiled with the SDP and ran every change on the QEMU target. I solved the problems in a question-and-answer dialogue with the coding agents.
  • All code was written from 2026-11-11 on, inside the submission period.

Challenges we ran into

  • Making "a faulty driver has no write access to the brake" true: the first version kept the simulated hardware in one object that the motor driver mapped read-write; now each object has one writer.
  • Keeping the watchdog running while a driver takes every CPU: the critical processes run above priority 63, the motor driver's limit, and the watchdog has its own fixed-priority thread.

Accomplishments that we're proud of

  • 46 of 46 checks for faults 1-14 and 16 in the recorded demo run; 20 of 20 repeated runs passed all 46; 12 of 12 for faults 15 and 17 on the booted image with the policy; 9 of 9 on the plain image; 13 of 13 for the comparison; 70 of 70 host tests. Every evidence file names the hash of its sources.
  • Through faults 1, 2, 3 and 5 the planner delivers 3 of 3 tubes and drops none.
  • A hazard table in docs/DESIGN.md names, for each injected fault, the hazard, the measure, the check and the evidence file (not a conformance claim).

What we learned

  • QNX mechanisms map directly onto machine-safety needs: a disconnect pulse on the driver's own channel, sender identity from the kernel, ability subranges, fixed-priority channels (gallery image 6: what a Linux build of this cell would have to add).
  • Testing the premise changed the claim: separate processes add that only the faulty driver restarts and that one driver's stray write cannot reach another driver's objects.
  • A security policy expresses what abilities cannot: one device path and a list of channels per driver.

What's next for cellguard: a robot-cell supervisor for QNX 8.0

  • A secure-mode image with a policy for every service.
  • A real drive: the stop would be requested from a certified safety controller that switches the drive's Safe Torque Off input (not implemented); a product would rebuild for QNX OS for Safety 8.0 and certify its own parts (not done).
  • An operator reset input for LOCKOUT and safety stops.

Values in ms in the repository and on the page are configured settings, not measurements; no timing figures are published.

Built With

  • c
  • html5
  • javascript
  • mkqnximage
  • posix
  • python
  • qcc
  • qemu
  • qnx
  • qnx-neutrino
  • qnx-sdp-8.0
  • real-time
  • security-policy
  • shared-memory
  • slm
Share this project:

Updates

Submission history