-
-
The same contract checks a learned policy, then the kernel in secure mode refuses the backdoor
-
Perfetto: every message is an arrow between threads; display keeps running while its camera reader waits
-
GitHub Actions: the Blueprint action fails the job on the deadlock trace and passes the fixed build
-
Every scenario report and the codelab, online with nothing to install
-
The HTML report for the hung camera: the broken edge in red, the finding first, the trace events behind it
-
QNX traceprinter and Blueprint read the same 25 traces: 1,071,509 events, none missing or different
In one minute
In 2025 more than a million cars were recalled because the rear camera picture could freeze on the centre screen while the driver was backing up. NHTSA put the cost plainly: less view behind the car, "increasing the risk of a crash" (campaign 25V-315). The camera was fine. The software between the camera and the screen was not.
Blueprint lets a QNX team write down, in one small file, the message-passing design: which program may send to which and how long each may keep the others waiting. Every build is checked against that file in CI, and the same file becomes a QNX security policy, so the kernel itself refuses a connection the design never allowed. A camera that hangs should not freeze the screen; Blueprint fails the build that lets it happen.
Check it yourself in a minute, with no QNX target, SDP or API key:
pip install qnx-blueprint
blueprint demo
It replays fifteen recorded QNX 8.0 scenarios and writes an HTML report for each, with the broken connection in red. Or open every report in the browser, nothing to install: https://dmitriytopka.github.io/qnx-blueprint/
Other trace tools check a QNX trace against general rules: priority inversion, a deadline, a blocked thread. Blueprint checks it against this system's own design, the file that says who may talk to whom and how long each may wait, and the same file becomes the policy the kernel enforces. It reads the binary tracelogger file itself and agrees with QNX's own traceprinter on all 1,071,509 events of 25 traces, so CI needs no SDP and no traceprinter.
For judges
Links point at release v0.3.2, so the lines stay where they are.
| Criterion | Where to look | What it shows |
|---|---|---|
| Technological Implementation | kev.py, ipc.py, checks.py, docs/TRACEPRINTER.md |
the trace format read from scratch and compared with QNX's traceprinter: 1,071,509 events in 25 traces, none missing or different; 137 tests |
| Design | blueprint demo, the reports, action.yml |
one command with no target: after a clean pip install it writes 15 HTML reports in 3.6 s on an M2 Mac; JUnit XML and a GitHub Action for CI |
| Potential Impact | demo/external/qpp, demo/external/socketcan | car cockpits on QNX, where the screen has to keep its deadline (cycle_ms, reply_budget_ms) even when a process behind it hangs, a promise that needs a real-time kernel underneath; tried on two BlackBerry systems we did not write: a stopped server found, and eight weak spots in Blueprint fixed on their traces |
| Innovation & AI Creativity | explain.py, review.py, mcp_server.py |
Claude explains and reviews but never judges: the 14 explanations and one review on record cite 140 trace events, and each id is checked against the events Claude was given; one it was not given is dropped |
| Codelab bonus | the contract codelab, the secure-image codelab | a secure QNX 8.0 image from a policy you can check, with a recorded live run. Submitted to the QNX codelabs repository as pull request #74, which the organizers confirmed is what enters it for the Best Codelab prize |
| QNX-specific bonus | demo/cockpit/secpol/evidence | mkqnximage --secpol=secure on x86_64 and aarch64: serial logs, the compiled policy matching /proc/boot/secpol.bin, the kernel saying Operation not permitted |
Inspiration
Blueprint is for the engineers who integrate QNX systems with real-time deadlines: a cockpit, an infusion pump, a robot controller. These systems fail in ways a unit test never sees, because the bug lives between processes.
On QNX that class of failure has a precise shape. Processes talk through native message passing: a client calls MsgSend() and stays blocked until the server calls MsgReply(). This is what makes QNX dependable, and it also lets a display wait forever on a camera that stopped answering, or two servers wait on each other.
Teams keep the intended architecture in their heads: display asks nav, nav asks gps, nobody calls back up the chain, a dead camera must not take the screen with it. Nothing in the toolchain checks a build against that intent. Four seconds of a two-thread test program gave us 87,314 lines of traceprinter output, and none of them says which line breaks the design.
What it does
You write the design down once, in a short YAML contract:
system: cockpit
processes: [gps, nav, camera, logger, display]
allow: # who may send messages to whom
- display -> nav
- display -> camera
- display -> logger
- nav -> gps
- nav -> logger
reply_budget_ms: # how long a server may keep a client waiting
nav: 50
default: 20
isolation: # if camera dies or hangs, display keeps working
camera:
must_survive: [display]
min_progress: 3
cycle_ms: # real-time loop: display needs a route every 100 ms
display -> nav: 100
Two things then enforce it.
Before release, CI checks the kernel trace. Blueprint rebuilds every message from a tracelogger -w trace: client, server, channel, timing, and who was still blocked on whom at the end. A build that breaks the contract fails with exit code 1, an HTML report and JUnit XML that name the process, the call and the trace events behind it.
The application is not touched: no library to link, no line of code to add. Every check, deadlines included, comes from the kernel trace that tracelogger already records, so the build you check is the build you ship.

After release, the kernel enforces it. blueprint secpol writes the channel rules of a QNX security policy from the same file and checks any learned policy against it. We booted QNX 8.0 with mkqnximage --secpol=secure on x86_64 and aarch64. The md5 of the policy we compiled equals /proc/boot/secpol.bin on both running targets, and there the same display binary gets three different answers:
# COCKPIT_FAULT=ok on -T display_t display 3
display 00: route via pos 50.450 | frame 1
# COCKPIT_FAULT=backdoor on -T display_t display 3
cockpit: cannot open cockpit-gps: Operation not permitted
# COCKPIT_FAULT=ok display 3
cockpit: cannot open cockpit-nav: Operation not permitted
The refusal is in the trace as well: a denied ConnectAttach exits with ret_val:-1, errno:1, and Blueprint fails that trace with kernel-denied: the kernel refused display's connection to gps, which the contract forbids. The policy blocked the backdoor, and the build still contains it. Serial logs, both sessions and the secure-mode traces are in the repository.
Where the time went
A slow reply or a missed frame comes with its cause, read from the thread states in the trace. The parts add up to the whole:
FAIL [cycle-overrun] display -> nav cycle missed its period: worst gap 114 ms against 100 ms
where: in the longest gap (113.8 ms) display spent: sleeping (NANOSLEEP) 55.3 ms,
waiting on logger 48.5 ms (there: server preempted 46.6 ms (mostly media at priority 20, 45.1 ms))
Display missed its frame because logger, on a fixed priority 10 channel, sat preempted by a media job at priority 20. Blueprint names the thread, its thread priority and the milliseconds it took.
The checks
| Check | Fails when |
|---|---|
unexpected-edge |
a process sends to a server the contract does not allow |
wait-cycle |
threads end the trace waiting on each other in a loop |
stuck-reply |
a server took a message and never replied |
reply-budget |
a server answered slower than its budget |
cycle-overrun |
a real-time loop went longer than cycle_ms without an answer, or stopped |
kernel-denied |
the kernel refused a connection with EPERM: the security policy at work |
isolation |
a process died or hung and took a protected one down with it |
no-traffic, trace-loss |
the trace proves nothing: no answered message, or lost kernel buffers |
priority-inversion |
experimental: a client waits on a lower priority server while threads in between run |
A checker that passes an empty or broken trace is worse than none, so the last two refuse to.
blueprint record root@target -c blueprint.yaml --inject [email protected] traces a running target over ssh and kills the camera mid-trace. blueprint init run.kev drafts a contract from a system that already runs. Claude (claude-opus-5-5) works in three places, never as the judge. --explain explains each error from the events behind it, the contract and your source. init --review marks the edges of a draft contract worth a question, so a backdoor in the trace is not approved by habit. blueprint mcp is an MCP server, so a coding assistant can check a trace, read where the time went and propose the fix in one conversation. Any event id or edge the model cites that Blueprint did not give it is removed.
Why not the tools in Momentics
| System Information | System Profiler | Blueprint | |
|---|---|---|---|
| Knows the intended design | no | no | the contract |
| Deadlocked threads | live, on the target | you find them in the timeline | fails the build, even for a deadlock that began before the trace |
| A connection that works but should not exist | shown, not judged | shown, not judged | unexpected-edge |
| Reply time against a budget | measured by hand | reply-budget, cycle_ms |
|
| Why a reply was slow | you read it off the timeline | preempted by media at priority 20 for 45 ms | |
| Runs headless in CI | no, IDE | no, IDE | exit code, JUnit, GitHub Action, MCP |
| Security policy | writes it from the contract, checks what secpolgenerate learned |
Blueprint does not replace them. Its Perfetto export opens the same trace as arrows between threads when you need the timeline.
How much would a plain health check catch? We ran one over the same 23 traces: fail the build if a server in the contract died. It caught 4 of the 15 runs Blueprint fails, all four of them deaths. It missed the other 11, five hangs, two deadlocks, two backdoors and two timing faults, because in each of them every process was still alive. And it failed one healthy design, where the camera dies and the display keeps working as the contract asks. The script is tools/baseline_liveness.py.
How it uses QNX
| File | QNX feature |
|---|---|
blueprint/kev.py |
the tracelogger -w file format: syspage, 16-byte events, multi-part events, lost-buffer detection |
blueprint/ipc.py |
MsgSendv, MsgReceivev, MsgReplyv, MsgError, ConnectAttach, ChannelCreate flags, COMM events, resource manager messages |
blueprint/snapshot.py |
the pidin blocked-on column, for waits that began before the trace |
blueprint/checks.py |
thread priorities, priority inheritance and _NTO_CHF_FIXED_PRIORITY |
blueprint/secpol.py |
the policy language, secpolcompile, secpolgenerate, on -T |
demo/cockpit/cockpit.c |
name_attach, name_open, pulses, _NTO_CHF_UNBLOCK, a resource manager with resmgr_attach, built with qcc for x86_64 and aarch64 |
The parser is what every check stands on, so we printed every trace with QNX's own traceprinter and compared event by event: 1,071,509 events in 25 traces, secure mode included, none missing, extra or different.

How we built it
Dmytro Topka built Blueprint from November 3, 2026 with Claude Code as the coding agent, and checked every claim about QNX on a running QNX 8.0 target before it went into code. No board: mkqnximage images in QEMU, so anyone with the free SDP can repeat it. The demo cockpit switches in one of six faults by an environment variable. We wrote down the expected result of fifteen scenarios before running the checks. All fifteen match on x86_64, and eleven re-recorded on aarch64 match with no change to Blueprint. About 4,100 lines of Python, one dependency, 137 tests.
Challenges we ran into
Our first parser matched zero transactions. In a COMM send event the pid is the server, not the client, and kernel call events carry no caller pid, so we take it from the last THRUNNING on the same CPU.
We "fixed" the hung camera with TimerTimeout and it froze exactly as before. Channels from name_attach() set _NTO_CHF_UNBLOCK, so a REPLY-blocked client waits until the server handles the unblock pulse, and a stuck server never does. Reading the camera from its own thread works.
A deadlock passed once. We had started tracing after the lockup, and blocked threads emit no events. Now Blueprint reads a pidin snapshot, and no-traffic refuses an empty trace.
Our first learned policy had no rules at all: secpolgenerate learns from kernel trace events, and our script ran tracelogger at the same time. Then x86_64 refused ssh in secure mode. A debug sshd showed initgroups: root: Operation not permitted, and two abilities for sshd_t fixed it. aarch64 never needed them, and we still don't know why.
Accomplishments that we're proud of
Blueprint's parser agrees with QNX's own traceprinter on every one of 1,071,509 events. A policy written from the contract runs in secure mode on x86_64 and aarch64, and its md5 equals /proc/boot/secpol.bin on both targets. On BlackBerry's own QPP service Blueprint caught a stopped server with its publisher blocked for 3.2 s. And all of it installs with one pip line and replays fifteen recorded scenarios with no target at all.
What we learned
Read the kernel, not your assumptions: the pid in a send event is the server's, and a send timeout cannot free a client REPLY-blocked on a stuck server behind a name_attach() channel. A learned policy is only as good as the run that taught it, since one bad run poisons it until reboot; that is why we check it against the contract. Code we did not write was the best tester we had. Two BlackBerry projects found eight weak spots in Blueprint that our own demo never hit.
On code we did not write
Two systems we did not write, both BlackBerry's: in its QPP service Blueprint found a stopped server that left a publisher blocked for 3.2 s, and its SocketCAN stack found a bug in Blueprint itself, now fixed and pinned by tests.
We built BlackBerry's open-source QNX POSIX Publish Subscribe service unchanged and traced it on QNX 8.0 three ways: healthy, with its server stopped, and with its server killed. Blueprint drafted a contract from the healthy run, and the check passed. With qpp stopped, the build failed on the publisher left REPLY-blocked for 3.2 s, and the finding named the STOPPED server thread. The same run found four weak spots in Blueprint itself, such as a stopped server read as busy and exited shells listed as blocked. All four are fixed and pinned by tests on these traces, which are in the repository.
We did the same with BlackBerry's SocketCAN for io-sock on a virtual CAN bus. Its prebuilt module needed a small shim of ours to load on our io-sock; the driver and the samples are BlackBerry's. This time Blueprint was the one that failed: it called a healthy reader, waiting in read() for the next frame, a stuck server. It now tells a read parked in the server from a server that stopped answering, and a frame that must come on time is a cycle_ms deadline. A stopped or killed CAN stack still fails the build, and --inject 'io-sock[prefix=/can]@2:stop' stops that stack without touching the one ssh runs on.
What's next
On an image running only QNX's own services, init --all mapped eight message paths and the check passed. Next: traces from shipping products, and mutex and condvar waits in the breakdown.
AI use
- Building it: Claude Code (Anthropic) wrote most of the code and the docs as the coding agent, directed and reviewed by the author. Every claim about QNX was checked on a running QNX 8.0 target first.
- Inside the tool:
--explainandinit --reviewcallclaude-opus-5-5, and the MCP server lets a coding assistant run the checks. The model explains and suggests; only the checks decide pass or fail, and an event id it cites that the trace does not have is removed. - The video: the narration is an AI clone of the author's own voice, and the typing in the terminal recordings is replayed. The commands and their output are real runs on QNX 8.0 in QEMU.
- The codelab: its four test runs from an empty folder were made by AI agents, not people, and are reported as such in the repository.
Try it
pip install qnx-blueprint
blueprint demo
No target, SDP or API key needed. QNX SDP 8.0 (QNX Everywhere), QEMU x86_64 and aarch64le, Python 3.10+.
- Repository: https://github.com/DmitriyTopka/qnx-blueprint
- PyPI: https://pypi.org/project/qnx-blueprint/
- Video: https://youtu.be/rqJFxPH5Bjs
- Codelab: https://dmitriytopka.github.io/qnx-blueprint/codelab/
- Codelab 2, a fully secure QNX 8.0 image from a policy you can check: https://dmitriytopka.github.io/qnx-blueprint/codelab/secure-image/
- Every report, no install: https://dmitriytopka.github.io/qnx-blueprint/
New project, first commit November 3, 2026. QNX is a trademark of BlackBerry Limited. This project is not affiliated with or endorsed by BlackBerry.