QCrit is an autonomous, low-overhead runtime governor designed for safety-critical mixed-criticality systems running on QNX Neutrino RTOS 8.0 (targeting x86_64).
It monitors execution time trajectories using EWMA and linear trend prediction, dynamically degrades non-critical workloads before deadlines are missed, preserves strict immunity for safety-critical tasks, and coordinates upstream quality changes across functional dependency graphs.
-
Predictive Slack Estimation:
- Tracks per-task execution histories and computes EWMA with linear trend extrapolation.
- Detects upcoming deadline violations before they occur, providing early-warning headroom to shed CPU contention.
-
Mixed-Criticality Hierarchy & Degradation Reasoning:
- Tasks are assigned static criticality tiers:
CRITICAL(Tier 3): e.g.,safety_controller— Never degraded, immune to resource reclamation.HIGH(Tier 2): e.g.,adas_perception— Degrades only if critical tier is at risk.STANDARD(Tier 1): e.g.,infotainment— Primary target for shedding CPU load.LOW(Tier 0): e.g.,diagnostics— First to be suspended under system stress.
- Modes supported:
FULL(0),REDUCED(1),MINIMAL(2),SUSPENDED(3).
- Tasks are assigned static criticality tiers:
-
Functional Dependency Notifications:
- When an upstream workload degrades (e.g., perception quality drops), QCrit sends a
QCRIT_PULSE_DEP_CHANGEDpulse to downstream consumers (e.g., safety controller) so they can switch to conservative fallback posture without cascading system panic.
- When an upstream workload degrades (e.g., perception quality drops), QCrit sends a
-
Microkernel-Native IPC & Zero-Lock Dispatch:
- Uses native QNX Neutrino channels, connection IDs, and non-blocking real-time pulses (
MsgSendPulse). - Senders authenticated via
ConnectClientInfoon 64-bit QNX 8.0.
- Uses native QNX Neutrino channels, connection IDs, and non-blocking real-time pulses (
-
Autonomous Health Monitoring & Flight Recorder:
- Periodic heartbeat verification detects hung or crashed workloads.
- Lockless in-memory circular ring buffer logs all lifecycle events, mode changes, and verification passes for post-incident diagnostics.
QCrit/
├── QNX/
│ ├── Qcrit_vm/ # QNX Momentics IDE Project (x86_64 target)
│ │ ├── Makefile # Multi-binary QNX Makefile (qcc + ntox86_64-gcc-ar)
│ │ ├── .project / .cproject # Eclipse CDT / Momentics project metadata
│ │ ├── build/x86_64-debug/ # Output directory for all 8 binaries + client library
│ │ └── src/
│ │ ├── include/qcrit/ # Public headers (types.h, protocol.h, client.h, config.h)
│ │ ├── daemon/ # Governor core (main, registry, predictor, reasoner, etc.)
│ │ ├── lib/ # Workload client library (client.c)
│ │ ├── workloads/ # Mixed-criticality test tasks (safety, adas, info, diag)
│ │ ├── tools/ # Utilities (stress_injector, fault_injector, qcrit_dump)
│ │ └── demo/ # run_demo_vm.sh & analyze_results.py
│ ├── vm1/ # Target connection profile (VirtualBox QNX 8.0 VM)
│ └── vm2/ # Secondary target connection profile
├── daemon/ # Original daemon source tree
├── include/ # Original public API headers
├── lib/ # Original client library source tree
├── workloads/ # Original workload source trees
├── tools/ # Original tools source trees
├── demo/ # Demo runner scripts and evaluation utilities
├── tests/ # Offline host unit tests (predictor & dependency graph)
├── Makefile # Root Makefile for command-line builds
└── common.mk # Root toolchain configuration
- Open QNX Momentics IDE with workspace set to
d:\Projects\QCrit\QNX. - Right-click the
Qcrit_vmproject in the Project Explorer. - Click Build Project.
- All 8 executables and
libqcrit_client.awill be generated inQNX/Qcrit_vm/build/x86_64-debug/.
From Command Prompt or PowerShell:
call C:\Users\<user>\qnx800\qnxsdp-env.bat
make -C d:\Projects\QCrit\QNX\Qcrit_vm clean all- Start the Governor Daemon:
- In Momentics, right-click
build/x86_64-debug/Qcrit_vm➔ Run As ➔ QNX C/C++ Application. - Select your target VM (
vm1). - The daemon console will display:
[daemon] listening on 'qcrit'
- In Momentics, right-click
- Start Workloads:
- While
Qcrit_vmis running, right-click and launchadas_perceptionorsafety_controller. - The workload connects to the governor, authenticates, and begins periodic execution.
- Switch between process consoles using the Display Selected Console (
🖥️▾) icon in Momentics.
- While
Copy the built binaries and run_demo_vm.sh to /tmp/qcrit/ on the QNX VM, then run:
cd /tmp/qcrit
chmod +x run_demo_vm.sh
./run_demo_vm.shThe script executes 3 phases:
- Phase A: Measures deadline misses under contention without QCrit.
- Phase B: Runs under QCrit supervision — observes predictive degradation of
infotainmentand protection ofsafety_controller. - Phase C: Injects a task crash via
fault_injectorand monitors autonomous recovery.
Launch the terminal dashboard directly on the target (via Momentics Terminal Console or SSH):
# Read-Only monitoring
/tmp/qcrit/qcrit_dashboard
# Interactive Demonstration Mode (enables hotkeys)
/tmp/qcrit/qcrit_dashboard --demoDashboard Features:
- Split-Screen Layout:
- Upper Panel: Active task table showing criticality tiers, dynamic operating modes (🟢
FULL, 🟡REDUCED, 🔴SUSPENDED), heartbeat freshness, period/deadline, and graphical predicted slack bar (+12.4ms [====| ]). - Lower Panel: Live-scrolling Flight Recorder events color-coded by severity (risk detections, degradations, recoveries, and health watchdog restarts).
- Upper Panel: Active task table showing criticality tiers, dynamic operating modes (🟢
- Interactive Hotkeys (in
--demomode):s: Launchstress_injector(8s burst) to induce CPU contention and watch lower-tier workloads degrade live on screen while critical tasks stay protected.k: SendSIGKILLto an active non-critical workload to test QNX health watchdog timeout detection and auto-recovery.p: Pause / resume flight recorder stream to inspect event details.q: Clean exit.
- Fail-Safe Resilience: Uses 250ms QNX
TimerTimeout()to prevent blocking if the daemon is loaded, and includes an auto-reconnect engine if the daemon is restarted.
Query live telemetry events recorded in the daemon's ring buffer:
/tmp/qcrit/qcrit_dump --last 50Analyze the generated timing logs (qcrit_*.log) on your host machine:
python analyze_results.py --log-dir /path/to/logsLaunch the real-time scheduling trace viewer and flight recorder dashboard (runs on Host or Raspberry Pi):
# Run with demo logs
python run_viewer.py --demo
# Or run against target / VM logs
python run_viewer.py --log-dir /path/to/logs --port 8000Open http://localhost:8000 (or http://<pi-ip>:8000) in your browser to inspect:
-
Multi-Lane Gantt Scheduling: Real-time mode degradation across tiers (
FULL,REDUCED,MINIMAL,SUSPENDED). -
Execution Time vs. Hard Deadline: Measured execution (
$C_i$ ) vs. deadline ($D_i$ ) with smoothed EWMA extrapolation and slack warning margins. - Real-Time Live Simulation: Interactive playback with contention burst injection and auto-recovery.
- A/B Comparative Evaluation: Side-by-side verification proving 0 deadline misses under QCrit governance.
- Flight Recorder Stream: Real-time event feed with filterable severity tags.
Designed for mixed-criticality real-time operating systems under QNX Neutrino 8.0.