ansonantony_
  • Home
  • Projects
  • Blog
  • CV
  • Guestbook
  • Newsletter
  • Contact

// stay updated

new posts and project updates, by email

© 2026 Anson Antony

githubinstagramcoffeerss

built with next.js + supabase · privacy

← all projects

// project · 99 commits · April to November 2026

WaferLens

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%

See the replay ↓View code on GitHub ↗

●Replay of one run of a simulated fab. Nothing is computed live on this page.

  • Python
  • SQL
  • dbt
  • Kafka
  • Power BI
drift startsCUSUM42 readingsEWMA60 readingsShewhart174 readings132 readings sooner
A slow drift begins on chamber STRIP-01/A in the simulated fab. How many sensor readings each control chart needed before its first alarm. Fewer is better.

01 Replay: one excursion, start to finish

// 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.

The race to the first alarm

Readings the chamber took after the drift began, before each method raised the alarm. Shorter is better.

  1. CUSUM · adds up small deviations42 readings · 9.4 h
  2. EWMA · watches a running average60 readings · 11 h
  3. Shewhart · the classic chart, one reading at a time174 readings · 23.4 h
Here the fastest chart fired 132 readings before the slowest. Across all the simulated excursions the median is 8 to 9 affected wafers for EWMA and CUSUM, against 33 for Shewhart.

Which machine caused it?

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.

Commonality ranking for excursion 40
RankSuspectTypeLiftLow-yield / wafers throughSensor alarms
1STRIP-01/A✓ true causechamber1.37356 / 1,6325,293
2RTP-01/Achamber1.10410 / 2,346467
3STI_ETCH_PMIC65 v1recipe1.31145 / 696n/a
3STI_LITHO_PMIC65 v1recipe1.31145 / 696n/a
5STI_STRIP_PMIC65 v1recipe1.27146 / 721n/a

What it cost

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.

Text summary: inside the shaded window, wafers through STRIP-01/A yielded 87.68% on average, against 90.28% for comparable wafers. Days with few wafers are noisy.

Behind the 72%: every excursion that cost yield

One square per excursion. The number is where the true cause landed among about 129 suspects.

  1. Excursion 1, rank 1
  2. Excursion 2, rank 1
  3. Excursion 3, rank 1
  4. Excursion 4, rank 1
  5. Excursion 6, rank 1
  6. Excursion 7, rank 1
  7. Excursion 12, rank 1
  8. Excursion 13, rank 1
  9. Excursion 15, rank 1
  10. Excursion 17, rank 1
  11. Excursion 18, rank 1
  12. Excursion 19, rank 1
  13. Excursion 24, rank 1
  14. Excursion 25, rank 1
  15. Excursion 27, rank 1
  16. Excursion 28, rank 1
  17. Excursion 30, rank 1
  18. Excursion 31, rank 1
  19. Excursion 32, rank 1
  20. Excursion 35, rank 1
  21. Excursion 36, rank 1
  22. Excursion 38, rank 1
  23. Excursion 40, rank 1
  24. Excursion 9, rank 3
  25. Excursion 16, rank 4
  26. Excursion 22, rank 8
  27. Excursion 33, rank 9
  28. Excursion 10, rank 10
  29. Excursion 5, rank 12
  30. Excursion 29, rank 24
  31. Excursion 14, rank 27
  32. Excursion 34, rank 32
Ranked first for 23 of 32 (72%), in the top three for 24. Amber squares are misses. Ringed squares are stories you can open above. The other 8 injected excursions cost less than one yield point and are not counted.

The dashboards

Grafana excursion review dashboard: a sensor chart with the true excursion window shaded red, first alarms of each chart as orange lines, and a ranked suspect table
Grafana, excursion review for a different excursion (a step change on a PVD chamber). Red band: true window. Orange lines: first alarm of each chart.
Power BI root cause page: chambers and recipes ranked by lift for one excursion, the injected cause highlighted in green, with SPC alarms per chamber
Power BI, root cause page on excursion 10, the honest miss: commonality ranks the true chamber 10th while its sensor charts raised thousands of alarms.

02 How it works

  1. step 1

    Simulate a fab, with the answers written down

    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.

  2. step 2

    Load it into a warehouse

    PostgreSQL with TimescaleDB, modelled with dbt into a star schema. Dagster runs the whole pipeline.

  3. step 3

    Watch every chamber for drift

    Statistical process control charts (Shewhart, Western Electric, EWMA, CUSUM) on frozen limits, for every chamber and sensor.

  4. step 4

    When yield drops, find what the bad wafers share

    Commonality analysis in SQL ranks every chamber and recipe by how much more often low-yield wafers passed through it.

  5. step 5

    Show it

    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

  1. ↓→
  2. ↓→
  3. ↓→
  4. ↓→
  5. ↓→

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.

Data flow. The fab simulator also replays events through Kafka (Redpanda) for real-time SPC.

03 Summary

WhatResultCompared with
Wafers affected before the first alarm (median over the simulated excursions)8 to 9Shewhart chart 33, random alarms 140 to 200 (EWMA and CUSUM charts)
Yield drops where the true cause is ranked first72%23 of 32. Random pick among about 129 suspects: 0.8%
Defect patterns visible only on the wafer, caught and traced to the right chamber13 of 13Sensor charts (SPC) catch none of them
Live monitoring: time from a sensor event to an alarm (Kafka stream)~270 msA +2 sigma step caught after 3 readings
Real fab data (UCI SECOM): how much a random train/test split overstates a fail predictor2.7xPR-AUC 0.065 on a time-ordered holdout against 0.177 on a random split, chance 0.055
Simulated fab unless marked as real data. Sources: the waferLens repo README and 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.
04 Technical details, for engineers›

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.

// other projects

FabEye →Classifies defect patterns on semiconductor wafer maps and flags the uncertain ones for human review.WaferEdge →Watches wafer results at the machine in real time and stops a bad lot before more wafers are processed.Robot Navigation →Drives a small robot to its goals in simulation, steering around the obstacles its laser scanner sees.