// project · 78 commits · October to November 2026
Watches wafer results at the machine in real time and stops a bad lot before more wafers are processed.
13 of 13defect excursions put on hold
With the cross-lot rule, a median 2.0 h after the first bad wafer, against 3.0 h for the batch alarm. Simulated fab.
Results from benchmark runs against tool emulators, not real equipment. Nothing runs live here.
edge › waferedge-edge: tool 127.0.0.1:5077
edge › HOLD LOT-000081 (near_full, after wafer 2018)
tool › HOLD LOT-000081: HCACK 0
0.16 ms
decision
118 ns
decode
5 / 211
false holds
When a machine starts damaging wafers, every wafer it processes after that is money lost. So the stop command has to reach the machine before it starts on the next wafer. A tool tests a wafer every few seconds to minutes, and WaferEdge decides in well under a millisecond, so speed is never the bottleneck. What decides how early a problem is caught is the rule for when to stop, which is why the rules were tested on a simulated fab too.
Log scale. Each step to the right is ten times longer.
The machine on the left, WaferEdge on the right. Amber lines are lot holds.
// tool emulator (the machine)
$ build/release/tools/tool-emulator data/waferlens_demo.wmap --port 5077 --rate 250 --limit 6000 tool-emulator: 6000 wafers from data/waferlens_demo.wmap, 250 wafers/s, listening on port 5077
// WaferEdge edge host
$ build/release/tools/waferedge-edge --port 5077
Microseconds (1,000 µs = 1 ms). Lower is better.
Wafer maps checked per second, log scale. Higher is better.
WaferLens's 24,090 simulated wafers, replayed in the order they were tested, through WaferEdge's detector and hold rule. Hours from the first bad wafer reaching test to the hold, median over 13 excursions. The default per-lot rule is slower than the batch alarm, a negative result kept on purpose. The perfect-detector row shows how much of the gap is the rules missing patterned wafers, and the last row is the cost of doing nothing: all 1,891 patterned wafers reach test.
| Monitor | Held | Hours | Bad wafers tested first | False holds |
|---|---|---|---|---|
| WaferLens batch alarm (3 in 24 h, all lots) | 13 of 13 | 3.0 | 72 | n/a |
| Rules, 3 of a lot's last 5 wafers (default) | 13 of 13 | 8.1 | 147 | 2 |
| Rules, 2 of 5 per lot | 13 of 13 | 2.5 | 37 | 2 |
| Rules, 2 of 5, or 3 in 24 h across lots | 13 of 13 | 2.0 | 31 | 5 |
| Perfect detector, 3 of 5, or 3 in 24 h | 13 of 13 | 3.2 | 39 | 0 |
| No hold at all | 0 of 13 | n/a | 1891 | 0 |
step 1
A tool emulator sends wafer test results over SEMI HSMS and SECS-II, the standard protocol between fab equipment and the factory host.
step 2
The decoder reads every field in place in the network buffer, with no copying and no memory allocation, so it never stalls.
step 3
Fast rules on the CPU (AVX2) or FabEye's CNN on the GPU decide whether the wafer map shows a spatial pattern such as an edge ring or a scratch.
step 4
If 3 of a lot's last 5 wafers show the same pattern, the edge host sends a hold command (S2F41) back to the tool, which stops processing that lot.
// tap a step to see what it does
4/6 DetectionThe core step: decides whether the wafer map shows a spatial defect pattern. Fast rules on the CPU with AVX2, or FabEye's CNN on WaferEdge's own CUDA kernels.
| What | Result | Compared with |
|---|---|---|
| Wafer result to the decision to hold the lot, median | 0.13 to 0.18 ms | Across all four benchmark runs. A tool sorts a wafer every few seconds to minutes |
| Same, slowest 1 in 100 wafers (p99) | 0.26 to 0.35 ms | Measured open loop at 1,000 to 10,000 wafers per second, so stalls are counted |
| Defect excursions put on hold, replaying 24,090 simulated wafers | 13 of 13 | Cross-lot rule: 2.0 h after the first bad wafer, against 3.0 h for WaferLens's batch alarm |
| Decoding one 40×40 wafer report from the equipment protocol | 118 ns | 0 memory allocations, about 8 million reports per second on one core |
| FabEye's CNN on WaferEdge's own GPU kernels (batch 256) | 19,448 to 25,516 maps/s | PyTorch fp16 on the same GPU 9,756, ONNX Runtime on CPU 1,092 |
| Pattern checks on the GPU (batch 1,024) | 986k maps/s | About 6 times the whole 6-core CPU (152k maps/s) |
Source: the WaferEdge README, re-measured on 2026-11-10. The CNN timings on this laptop should be read as plus or minus 10 to 20%.
Stack. C++23 (GCC 13, Clang 18), CUDA 13, AVX2, Asio coroutines, CMake presets, Google Benchmark, pybind11 Python bindings over the buffer protocol.
Protocol. SEMI HSMS framing, SECS-II items and a GEM subset (implemented from public descriptions, not certified). Wafer reports decode in place to views over the receive buffer: 118 ns for a 40×40 report, 120 ns for 200×200, 40 ns for an S2F41 hold, 0 allocations. An HSMS transaction over TCP loopback takes about 7 µs (p99 20 µs).
Threads. One network thread, analytics workers, single-producer single-consumer lock-free rings between them, no allocation on the hot path. Overload turns into counted drops, not an unbounded queue: one worker keeps up with 30,000 synthetic maps per second and starts dropping at 40,000.
Measurement. Latency is taken from each wafer's scheduled time in an open-loop schedule, so a stall delays the wafers behind it and coordinated omission is counted. WSL2 can pause the whole process; those stalls are reported, not removed.
GPU. Batched spatial-signature kernels (features, Hough line, clusters), CUDA Graphs, double-buffered streams (about 1.30M maps per second at 16,384 maps). FabEye's CNN on WaferEdge's own kernels keeps FabEye's conformal coverage in every precision (90% target: 0.8925, 0.8926, 0.8951 for fp32, fp16, int8). The CNN beats the rules on accuracy (macro-F1 0.858 against 0.655 on WM-811K test lots).
CI. GitHub Actions builds the dev, Clang and release presets, runs AddressSanitizer with UBSan and ThreadSanitizer, fuzzes the SECS-II decoder, HSMS framing and GEM layer with libFuzzer, and compiles the CUDA code. GPU tests run locally because CI runners have no GPU.
Limits. The excursions, their timing and their ground truth come from WaferLens's simulator. All timings are from one laptop under WSL2.