// project · 99 commits · April to November 2026
Spots when a chip factory's yield starts dropping and points to the machine that caused it.
72%of yield drops traced to the true cause first
out of about 129 suspect machines and recipes. A random guess gets 0.8%
Replay of one run of a simulated fab. Nothing is computed live on this page.
// pick a story from the simulated fab
The plasma power on one strip chamber, STRIP-01/A, slowly drifts upward over 14 days (2.48 times its normal spread at the end). Nothing breaks outright, but the wafers it touches come out slightly worse.
The question is how quickly a chart on that chamber notices, and whether the analysis then points at the right machine. Here both work.
Readings the chamber took after the drift began, before each method raised the alarm. Shorter is better.
Given only the time window, the analysis compares low-yield wafers with all wafers: a chamber or recipe that the bad wafers passed through more often than chance (a higher "lift") is more suspect. Here the true cause comes out 1st of 131 suspects.
| Rank | Suspect | Type | Lift | Low-yield / wafers through | Sensor alarms |
|---|---|---|---|---|---|
| 1 | STRIP-01/A✓ true cause | chamber | 1.37 | 356 / 1,632 | 5,293 |
| 2 | RTP-01/A | chamber | 1.10 | 410 / 2,346 | 467 |
| 3 | STI_ETCH_PMIC65 v1 | recipe | 1.31 | 145 / 696 | n/a |
| 3 | STI_LITHO_PMIC65 v1 | recipe | 1.31 | 145 / 696 | n/a |
| 5 | STI_STRIP_PMIC65 v1 | recipe | 1.27 | 146 / 721 | n/a |
Daily yield of wafers that went through STRIP-01/A, against the tool's other chambers. The shaded band is the excursion. In total 1,632 affected wafers yielded 87.68% against 90.28% for comparable wafers: 31,853 chips lost.
One square per excursion. The number is where the true cause landed among about 129 suspects.


step 1
Six months of production: lots, wafers, the exact chamber each wafer visited at every step, sensor readings and test results. Faults are injected on purpose and logged, so every method can be scored against the truth.
step 2
PostgreSQL with TimescaleDB, modelled with dbt into a star schema. Dagster runs the whole pipeline.
step 3
Statistical process control charts (Shewhart, Western Electric, EWMA, CUSUM) on frozen limits, for every chamber and sensor.
step 4
Commonality analysis in SQL ranks every chamber and recipe by how much more often low-yield wafers passed through it.
step 5
Grafana for live monitoring and alerts, Power BI for yield reporting, both built from version-controlled files.
// tap a step to see what it does
5/6 SPC + root causeThe core of the project. Control charts watch every chamber and sensor for drift, and when yield drops a commonality analysis in SQL ranks which chamber or recipe the bad wafers share.
| What | Result | Compared with |
|---|---|---|
| Wafers affected before the first alarm (median over the simulated excursions) | 8 to 9 | Shewhart chart 33, random alarms 140 to 200 (EWMA and CUSUM charts) |
| Yield drops where the true cause is ranked first | 72% | 23 of 32. Random pick among about 129 suspects: 0.8% |
| Defect patterns visible only on the wafer, caught and traced to the right chamber | 13 of 13 | Sensor charts (SPC) catch none of them |
| Live monitoring: time from a sensor event to an alarm (Kafka stream) | ~270 ms | A +2 sigma step caught after 3 readings |
| Real fab data (UCI SECOM): how much a random train/test split overstates a fail predictor | 2.7x | PR-AUC 0.065 on a time-ordered holdout against 0.177 on a random split, chance 0.055 |
docs/ reports; the replay above was exported from the warehouse by tools/export_web_replay.py, which checks its alarm points against the published ones.Stack. Python, SQL, PostgreSQL 16 with TimescaleDB, dbt (staging, intermediate, star-schema marts), Dagster, Kafka API on Redpanda, MLflow, Grafana (dashboards and alerts provisioned from git), Power BI (PBIP in git: 39 DAX measures, row-level security), Docker, GitHub Actions. Version 2.0.0, 195 test functions run in CI against a Postgres service container.
SPC. Phase I limits frozen on a 30-day baseline (median and moving-range sigma, one trimming pass), then Western Electric rules 1 to 4, EWMA (λ 0.2, L 3), tabular CUSUM (k 0.5, h 5, reset after a signal) and Hotelling T². Simulated average run lengths match published tables to within 3%. Every detection is scored against a placebo window of the same length just before the excursion: in this replay Shewhart false-alarmed after 13 readings in the placebo window, CUSUM after 153 and EWMA after 583.
Root cause. Commonality over chamber and recipe genealogy in SQL: for each suspect, the share of low-yield wafers among wafers that passed through it, against the window's base rate. True cause first for 23 of 32 excursions that measurably cost yield, top 3 for 75%. SPC and commonality together find 35 of 40 excursions.
Wafer maps. WaferLens calls FabEye's API for every sorted wafer (24,090). Macro-F1 on these simulated maps is 0.909, higher than FabEye's 0.858 on real WM-811K lots because simulated patterns are cleaner than real ones. The useful finding is where it breaks: Random-class coverage falls to 52%, because strong uniform defect fields read as Near-full. Starting from the pattern, commonality ranks the true chamber first for 13 of 13 spatial excursions.
Real time. Tool agents replay a day of the fab as 17,632 Kafka events; a consumer keeps EWMA and CUSUM state per chamber and sensor. Alarms, chart state and Kafka offsets commit in one Postgres transaction, so a crash or replay cannot lose or duplicate an alarm.
Real data. UCI SECOM: 590 anonymised sensors, 1,567 runs, 6.6% fails, fail rate drifting from 22% to 3%. Trained on the first 70% of runs, model chosen by walk-forward CV, scored once on the last 30%: LightGBM PR-AUC 0.065 (95% CI 0.054 to 0.091) against chance 0.055. The same model on a random split scores 0.177, which is how most published SECOM results are evaluated.