Back to projects
Solo project

FaultWatch

FaultWatch is an engine health monitor that replays NASA's simulated jet-engine telemetry. You can play or scrub any of 100 held-out engine recordings, inspect sensor trends, and see how many operating cycles the model estimates are left. I built the replay application, model pipeline, and its optional native inference and ingestion services.

Exact C++ and Python prediction parity11,196 held-out windows matched across both ONNX backends.
  • Python
  • C++
  • ONNX
  • Kafka
Select a held-out engine and scrub through its simulated sensor readings to see how estimated remaining life compares with NASA's reference. Open video · Open screenshot

Estimating remaining life from sensor readings

The model reads 20 consecutive cycles at a time. Each window uses the latest sensor values, their averages, and how they changed. The monitor starts estimating at cycle 20 and shows a reference line derived from NASA's remaining-life labels.

Across 100 held-out endpoints, the model had a mean absolute error of 19.35 cycles, compared with 36.32 for a constant baseline. The simulated tests cover one operating condition and degradation mode. The chart shows point estimates without confidence intervals.

Recovering the Kafka consumer after interruption

I batched Kafka events into PostgreSQL transactions and advanced consumer offsets after the database committed. The recovery tests covered a failed write inside a transaction and a restart after commit but before checkpointing. Replayed rows were counted as duplicates.

In a local M2 Pro replay of 1,388 events per trial, batching 16 events raised mean throughput from 263 to 800 events/s and cut transactions from 1,388 to 87. The workload used one broker, one consumer, and one database over loopback.

C++ inference and exact parity

I built a C++20 scoring engine with a pybind11 interface and an ARM NEON feature path. The C++ and Python ONNX outputs matched exactly across all 11,196 held-out windows, and the verifier checked the same estimates in all 100 native replay API responses.

In a separate feature-only experiment on the M2 Pro, median extraction for one validated window took 162 ns with scalar C++ and 107 ns with NEON. That timing isolates feature processing from model inference and HTTP serving.

Earlier HTTP inference benchmarks

This earlier M2 Pro test measured the separate FastAPI/PostgreSQL serving path. Four 20-second trials used eight clients and the same ONNX graph, with a mix of predictions, history, and engine listings. All 48,718 requests succeeded. These timings measure neither the current browser replay workflow nor Kafka ingestion.

Implementation references

API throughput

Python ONNX
434 requests/s
C++ ONNX
783 requests/s

Prediction p95 latency

Python ONNX
29.34 ms
C++ ONNX
17.67 ms
Local HTTP benchmark on Apple M2 Pro. Values are means across two trials per backend. Each metric has its own scale starting at zero.

Other infrastructure experiments

I also tested local Kubernetes deployment, PySpark feature processing, Redis cache fallback, and a private S3 artifact round trip. The browser replay runs locally from the NASA data and model without those services.