Inspiration
When one requirement changes on a real-time machine, the same command can flip from denied to allowed. Before that change ships, someone has to answer three questions: did the code really change, does the binary running on QNX match the new contract, and can a third party check the answer without trusting us?
Today those answers live in prose specs, hand-edited C, ad-hoc scripts and screenshots — and a stale binary can slip through unnoticed. We wanted the answer to be a file anyone can verify offline.
What it does
GENESIS RT turns a machine requirement into QNX-native software and proof, in one loop:
- Specify — a machine is a strictly validated Machine IR contract (kinds, units, limits, safety contracts). Unknown fields are rejected, never guessed.
- Compile — deterministic codegen emits QNX C headers pinned by SHA-256: identical IR → byte-identical source.
- Run on QNX 8.0 —
qcc12.2 builds six isolated processes (guard, controller, device,/dev/genesis/statusresource manager, supervisor, fault injector) that run on QNX SDP 8.0 under QEMU x86_64. - Break it — a 16-check native matrix, including 9 fault probes over real IPC and 1,000 latency samples; crash tests assert that no write ever bypasses the guard (
NONGUARD=0). - Prove it — transcripts are sealed into a hash-chained evidence passport behind a fail-closed release gate. Packs verify offline with a stdlib-only
verify.py; flip one byte and the pack is rejected.
The signature demo: raise max_linear_speed_mps from 1.2 to 1.6 m/s. Codegen updates the #define, qcc builds a new guard, and on QNX the 1.5 m/s probe flips DENY → ALLOW — both revisions pass 16/16. Pair the new contract with the old binary and the gate refuses it (15/16, no passport sealed).
A causal engine goes one step further: one incident, one command — six hypotheses ranked on the host, then grounded in a single hermetic run on QNX (16/16, sealed dossier, verifiable offline).
How we built it
Machine IR → strict validation → deterministic codegen → qcc build with binary digests → staged to the QNX target over SSH → contract-aware native oracle (expected ALLOW / DENY / SAFE_STOP derived from the validated IR, never hard-coded) → transcripts sealed into a 15-link passport bound to the IR digest → replay → release decision.
On the QNX side we used what makes Neutrino distinctive:
- synchronous message passing (
name_attach,MsgSend/MsgReceive/MsgReply) so the guard is the only path to the device; - a resource manager (
resmgr_attach) serving live telemetry at/dev/genesis/status; CLOCK_MONOTONICtiming with wrap-safe sequence arithmetic — a command is fresh only if $(s_{\text{new}} - s_{\text{last}}) \bmod 2^{32} \in [1,\, 2^{31})$;- a supervisor with bounded respawn and an explicit
GIVE_UP.
Everything is driven from GENESIS Studio (a local web UI) or the CLI, and covered by 1,629 automated tests (44 browser end-to-end). An optional AI planner can draft a contract from plain text, but it only proposes: deterministic code validates, and the model can never mark a build verified or release-eligible.
Challenges we ran into
- Making "fail-closed" really closed. Missing, skipped, crashed or tampered evidence must yield FAIL — every path had to be pinned by tests, including the stale-binary control.
- An oracle that knows the difference between a change and a regression. Hard-coded expectations would have flagged the intended DENY → ALLOW flip as a failure; deriving expectations from the contract fixed that.
- Red before green on target. The first live causal run failed 15/16 because the oracle refused industrial-cell predictions by design. We traced it, extended the oracle, and reran on QNX.
- Honest AI. Blind holdout sets kept exposing unsafe accepts in the planner; we publish every result, including the residual failures, instead of a single flattering number.
- Reproducibility. Rebuilding the same sources with
qccproduced bit-for-bit identical binaries (18/18), which is what makes the evidence portable.
What we learned
- QNX's message-passing model is a natural fit for a provable safety guard: when the device only accepts commands forwarded by the guard, "nothing bypassed the guard" becomes a measurable fact.
- Evidence is only useful if a stranger can check it in minutes, without our SDK, our machine, or our word.
- Being explicit about limits builds more trust than polish.
Scope and limitations
QNX 8.0 under QEMU x86_64 (no physical hardware yet); QEMU timing is a relative regression check, not WCET; simulated machines; no safety certification; evidence packs are hash-chained but unsigned. Full list: docs/jury/KNOWN_LIMITATIONS.md.
Try it (≈5 minutes, no QNX SDK needed)
git clone https://github.com/toskaman/genesis-rt.git
cd genesis-rt && pip install -e ".[dev]"
python evidence/qnx8-x86_64-omega2-after/verify.py evidence/qnx8-x86_64-omega2-after
PYTHONPATH=host python -m genesis_rt.cli serve # Studio at http://127.0.0.1:8077/
Built With
- c
- css
- fastapi
- github-actions
- html
- javascript
- llama
- ollama
- playwright
- pytest
- python
- qcc
- qemu
- qnx
- qnx-neutrino
- qnx-sdp-8.0
- qwen
- sha-256
- uvicorn