Skip to content

Manufacturing Quality Control

The capstone use case: a real process engineer’s workflow on real UCI SECOM semiconductor manufacturing telemetry: 1,567 real production runs, 590 real anonymized sensors, 104 real failures (6.6%), genuinely messy (116 dead sensors, 538 with real missing readings).

Drop dead and >50%-missing sensors, rank survivors by |correlation| with the real fail label, greedily decorrelate (skip anything >0.9 correlated with an already-picked sensor). A naive top-15-by-correlation pick turns out to produce a covariance matrix within 1e-14 of singular, a real numerical trap this triage avoids.

Standardizing against the pass-only reference distribution turns a near-singular raw covariance (det ~ 7e-31, condition number ~8e12) into a well-behaved one (det ~ 0.11, condition ~10), a textbook illustration of why standardizing before a covariance-based method isn’t just convention:

LET XcT = TRANSPOSE Xc_pass_ds_array
LET cov_raw = MATMUL XcT Xc_pass_ds_array
LET cov = SCALE cov_raw BY 0.000684
LET cov_det = DETERMINANT cov
LET cov_inv = INVERSE cov

DETERMINANT/INVERSE matched numpy to 3.00e-05 max difference. Flagging the top 200 of 1,567 runs by T² score catches 20/104 real fails, a modest, honestly-reported 1.5x lift over baseline, not oversold.

Predicting one sensor from 14 others (a real fab technique for expensive-to-measure signals), solved via the normal equations, with QR/LU used as real decomposition-correctness checks rather than a second way to derive the same answer:

LET beta = SOLVE XtX Xty
LET q, r = QR XtX -- Q@R reconstructs X^T X; Q^T@Q ~= I
LET p, l, u = LU XtX -- P @ X^T X reconstructs L @ U

R² = 0.278 predicting one sensor from the others, modest and honest, these are weakly-correlated fab sensors.

Named, chained pipelines: first time in this project

Section titled “Named, chained pipelines: first time in this project”
DATASET runs COLUMNS (run_id: Int, batch_id: String, label: Int, t2_score: Float)
DEFINE PIPELINE flagged AS WHERE t2_score > 10.0 THEN ORDER BY t2_score DESC
APPLY PIPELINE flagged ON runs INTO stage_flagged
SELECT * FROM stage_flagged

Two pipelines chained (the second’s input is the first’s output), mirroring a real analyst’s “filter, then rank the survivors” workflow, then round-tripped through SAVE/LOAD PIPELINE.

Relational analytics untested before this notebook

Section titled “Relational analytics untested before this notebook”

HAVING on a real aggregate condition, LAG/LEAD for trend detection, COALESCE/NULLIF on genuinely missing sensor readings: all new DSL surface for this project:

SELECT batch_id, COUNT(*) AS n, AVG(label) AS fail_rate FROM runs
GROUP BY batch_id HAVING AVG(label) > 0.15 AND COUNT(*) >= 5

ATTACH/AUDIT DATASET (referential-integrity governance), EXPLAIN LINEAGE, and EXPORT, including a dataset with a real Vector(15) column, which used to crash the CSV writer outright. In a clearly separated bonus section: the same unmodified DSL submitted as a real background job and registered as a real recurring /schedule task against an actual linal serve process, closing the “can this run unattended?” question directly.

Two real engine bugs, found and fixed here

Section titled “Two real engine bugs, found and fixed here”
  1. LET <new_name> = <existing_tensor_name> (bare-identifier alias) silently failed to bind the new name: no error, and the success message even named the old variable.
  2. EXPORTing a dataset with a Vector/Matrix column to CSV crashed outright.

Both fixed and shipped same-session, in PR #101 and PyPI linaldb 0.1.8; this notebook, re-run against that real published wheel, demonstrates both fixes directly with zero workarounds.