Skip to content

About

QNX National level eHack 2026 Submission

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

36 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PowerGuard

Deterministic Power and Thermal-Budget Management for QNX Edge Systems

Protect the control loop. Shed noncritical work. Restore only when it is safe.

Team Schedulix · QNX eHACK National Finals · Problem 16 · QNXHACK-HYD-014

PowerGuard runs one critical-control process and two noncritical workloads on a single QNX Raspberry Pi. When temperature, CPU utilization, estimated demand or sensor integrity crosses a declared limit, it restricts NC2 before NC1 while leaving critical control running. Recovery uses lower thresholds, continuous observation and NC1-before-NC2 restoration.

Jury demo → · Requirements and answers → · Architecture and source → · Evidence → · Documentation →

Real sensor integration now Pi-tested: 730 physical /dev/thermal readings at 25 ms pulse releases; managed CPU restriction, stale-producer fail-safe and staged recovery passed. 2,135 critical jobs, zero misses; 0.9865 ms maximum response. Live demo, results and raw evidence →

Physical temperature-trip demo also passes: an explicitly labelled 56.5 / 57.0 / 57.5 °C demo profile shows all five states, temperature-driven restrictions and staged recovery with 4,118 critical jobs and zero misses. Run the lower-temperature executable →

Results at a glance

Recorded on Raspberry Pi 4B · QNX 8.0.0 · aarch64le release. Each result below identifies its measured scenario; the linked captures retain exact counts, profiles and timestamp definitions.

Jury metric Recorded result Scope
Limit detection → effective restriction 13.820500 ms worst effect; 14.798204 ms worst supervisor receipt 36 pre-watchdog restrictions; zero late or unconfirmed, against a 20 ms target
Critical-task deadline misses 0 / 21,601 captured jobs; 1.148518 ms maximum response 10 ms period, 5 ms deadline; zero missing job records
Thermal / workload overshoot 0.4 °C physical thermal excess; 6 CPU percentage points / 2 demand-index points workload excess 100 ms score windows; thermal from the physical demo, workload from the separate standard integration campaign
State-transition jitter 2.051 ms Normal → Warning spread Recorded matched-pair reference, n=2; expanded repetition tracked in the qualification checklist
Controlled restoration 3,057.061 ms worst across 35 recoveries Includes the declared 2 s + 1 s observation

Performance investigation · PG-PERF-01: the physical demo records 18.729 ms with tracing off. Under full kernel tracing, one restriction took 20.646278 ms, 0.646278 ms above the 20 ms target; critical control still completed 5,161 captured jobs with zero misses or gaps. The investigation tracks trace cost, management scheduling and ordered worker wake-ups, with an optimization and regression plan. Trace-on diagnostics and passing trace-off measurements retain their separate scopes.

Fault resilience: 30/30 manager stalls confirmed within the 20 ms bound from the unchanged 50 ms progress-expiry deadline; worst receipt 12.135167 ms. Ten manager restarts preserved complete job delivery. A separate supervisor-loss test observed the persistent off latch by 235.188630 ms, within its 270 ms bound. The deliberately stopped supervisor also caused a late IPC receipt; that failure is retained in the report.

The machine-readable evidence records timing origins, sample counts, binary hashes and retained failures. Download the raw Pi evidence: 21,601 critical jobs, telemetry, 30 stall receipts, restart logs, both scorecards and watchdog proof, with a SHA-256 manifest. The evidence guide shows how to reproduce the analysis.

See it in one terminal

On the prepared, previously qualified Pi, from its deployed bundle:

cd /tmp/pg-t3-merge-2111
sh jury-demo.sh 1 2 3 4

The numbers are the four verified procnto idle-thread IDs in CPU order for that image. Verify them again on another image or boot. The wrapper starts the stack, waits for confirmed Normal, and records each run in jury-evidence-<pid>/.

Menu Demonstration Expected behavior
1 Live CLI Temperature, source and age; per-core CPU; requested/applied caps; state and cause; critical latency, misses, job gaps and recovery progress
2 → 5 Real noncritical CPU spike → recovery Restrict NC2 first; suspend both if Critical; restore progressively
3 → 5 Gradual simulated temperature ramp → recovery Warning at 65 °C, Throttled at 70 °C, Critical at 75 °C
4 → 5 Frozen temperature input → fresh input Age expires; conservative Critical with both noncritical workloads off; dwell before restoration
6 → 7 Manager stall → scorecard Independent enforcer confirms restrictions while the manager remains stopped
8 → 9 Supervisor stall → new run Watchdog latches noncritical work off; a fresh run is needed to requalify
0 Exit Stops only processes started by this demo

Show 7 before 8 to distinguish ordinary restriction scoring from the separate supervisor-loss watchdog test. The jury runbook includes a presentation script, deployment manifest and troubleshooting.

How QNX makes the design work

flowchart LR
    T[Temperature input and measured per-core CPU] --> M[Workload manager]
    M -->|QNX messages: samples, jobs, progress| S[Power and thermal supervisor]
    S -->|State and leased caps| E[Independent enforcer]
    E --> R[Runtime coordinator]
    R --> C[Critical control · CPU1 · FIFO30]
    R --> N1[NC1 · CPU2 · FIFO10]
    R --> N2[NC2 · CPU3 · FIFO8]
    R -->|Applied effects| E
    E -->|Effect confirmation| S
    S --> P[Shared monotonic progress]
    P --> W[Independent watchdog]
    W -->|Persistent forced-off latch| R
    S --> CLI[CLI and GPIO state observer]
Loading
  • Message-based control: versioned QNX messages carry telemetry, decisions, job batches and effective acknowledgements. Commands and actual effects have separate timestamps.
  • High-resolution timing: monotonic timer pulses and absolute worker releases track expiries without a busy polling supervisor. A 1 ns tolerance request is not a claim of 1 ns scheduling accuracy.
  • Priority and placement: verified ThreadCtl affinity and FIFO priorities place critical control on CPU1 at priority 30; management runs on CPU0. Affinity is not a CPU reservation; OS and interrupt interference remain possible.
  • Independent protection: the enforcer remains available during manager stalls. Shared progress lets the watchdog detect supervisor loss without waiting for the stopped supervisor to reply.
  • Auditable behavior: complete critical-job records, first accepted effect receipts, freshness checks and five explicit policy states.

Declared policy

Activation thresholds are inclusive upward; recovery limits are inclusive downward. The highest active severity controls escalation. A previous restriction is retained until recovery qualifies.

Input Recovery limit Warning Throttled Critical
Temperature (°C) ≤ 62 ≥ 65 ≥ 70 ≥ 75
Busiest-core CPU (%) ≤ 55 ≥ 70 ≥ 85 ≥ 95
Estimated demand index (0–100) ≤ 45 ≥ 60 ≥ 75 ≥ 90
State Noncritical capacity / exit condition
Normal NC1 100%, NC2 100%
Warning Full capacity if no earlier restriction is held; signal approaching limits
Throttled NC1 100%, NC2 0%
Critical NC1 0%, NC2 0%; critical control remains running
Recovery Fresh, continuously clear conditions and acknowledged effects; from Critical, NC1 after 2 s, then NC2 after another 1 s. From Throttled, NC2 after 3 s

The system starts in Critical until valid inputs, readiness and recovery qualify. Temperature and CPU data expire at 150 ms; manager progress and worker grants have 50 ms limits. Invalid or unavailable temperature causes conservative Critical. Replaying a sample cannot refresh its acquisition time. Recovery observation resets on unsafe input or an excessive acquisition gap (35 ms). A watchdog latch requires a new run.

The default demand index is (2 × requested NC1% + 3 × requested NC2%) / 5, using integer arithmetic. An explicit index is also supported. It is an estimate of requested workload demand, not measured watts.

Build and verify

Requires QNX SDP 8, its configured compiler environment and a qualified four-core QNX Pi image. Momentics 8 users can import the existing project and select aarch64le-debug.

make BUILD_PROFILE=release CCFLAGS='-Wextra -Werror'
make -C testbench

The root build produces the supervisor, runtime, enforcer, manager, CLI, thermal monitor, LED observer and regression tools in build/aarch64le-release/. Rebuild all bench-protocol-v4 components together. Deploy the files in the runbook manifest; a fresh clone does not include compiled binaries or an already running Pi stack.

For portable checks with a C11 compiler and Python 3 on Linux/macOS:

sh scripts/check-host.sh

These exercise policy, metrics, manager expiry, watchdog latching and evidence-analysis rejection cases. They do not establish QNX scheduling or hardware timing. See tests for target validation.

For the verified real-temperature integration, see the live thermal guide. It connects the pulse reader to the managed runtime without mixing simulated temperature into the policy stream. Run validate-real-thermal.sh from the deployed release bundle to repeat its live acceptance sequence.

For the separate lower-temperature executable and bounded heating fixture, build make BUILD_PROFILE=release thermal-demo; see its physical demonstration guide.

Repository map

PowerGuard/
├── src/             QNX supervisor service
├── supervisor/      Five-state policy and five-metric scorekeeper
├── runtime/         Coordinator, separate workers and independent enforcer
├── manager/         Telemetry, progress and complete critical-job forwarding
├── platform/        ThreadCtl qualification and shared watchdog progress
├── telemetry/       Real thermal reader and characterization instructions
├── gpio/            Five-state GPIO observer
├── include/         Policy, versioned IPC, metrics and platform contracts
├── tools/           CLI, readiness and live fault-check executables
├── testbench/       Scenario client and legacy threaded benchmark
├── tests/           Regressions, analyzers and archived evidence
├── scripts/         Jury demo, validation and optional remote-console tools
├── docs/            Jury checklist, architecture, runbooks and evidence summaries
├── Makefile         QNX application and regression builds
└── LICENSE          Licensing and attribution

Momentics metadata and .launch files remain at the root for IDE import. The .milestone-* files support archived teammate benchmark builds and retain their original paths. Generated build/ and results/ directories are ignored. See the scripts guide before using historical remote menus.

Validation coverage

The original jury menu uses simulated temperature, real measured per-core CPU, and a demand index. The separate real-sensor demo verifies the integrated physical input path, CPU restriction, producer freshness and recovery. The labelled lower-temperature profile adds actual physical trips, all five states and staged restoration. The GPIO observer implements all five state outputs; physical wiring acceptance is tracked separately. The qualification checklist defines the next coverage for standard-profile thermal peak/cooldown, Pi 5/BSP, repeated jitter, total split-stack overhead and sustained interference. Hardware power measurement and dynamic frequency control are optional stretch goals. GPIO uses 3.3 V logic; verify board mapping and series resistors.

Team and acknowledgements

Team Schedulix · Vasavi College of Engineering, Hyderabad

Team member Roll number
Abdul Aleem 1602-23-735-001
Kritika G 1602-23-735-018
Rishi N. 1602-23-735-033

QNX provided us with an amazing platform to discover ourselves, explore real-time systems, and turn our learning into PowerGuard. We are grateful for the opportunity to build, test, and grow together.

About

QNX National level eHack 2026 Submission

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages