Skip to content

feat(ml): T7 tier A training tooling, ignore-aware eval and results - #30

Merged
Mani212005 merged 1 commit into
mainfrom
fm/digisim-t7-train
Nov 18, 2026
Merged

Mani212005 merged 1 commit into
mainfrom
fm/digisim-t7-train

Conversation

@Mani212005

@Mani212005 Mani212005 commented Nov 18, 2026 •

Copy link
Copy Markdown
Owner

T7 results: the accuracy targets are NOT met

This PR ships the training and evaluation tooling and an honest record of the runs. The trained detector does not meet the phase 2 accuracy targets, so phase 2 is not reached. No weights are committed; they stay outside git. Full tables, configuration, hashes and notes are in agent_docs/ml-pipeline.md ("T7 Results").

The best model is the GPU stage B (mixed) run: Kaggle 2x T4, yolov8s at 960 px, digisim-t7-run-a, private. It was evaluated with the T6 harness on the hash-verified frozen sets (conf 0.35, IoU 0.5, Wilson 95% CIs).

Real held-out test (real_t4_test, 99 images). Targets: F1 >= 0.85 per class with >= 30 instances, JUNCTION recall >= 0.90.

class (test n) stage B F1 [95% CI] synthetic-only stage A F1 target met?
NMOS (116) 0.601 [0.53, 0.67] 0.000 no
PMOS (78) 0.564 [0.47, 0.65] 0.000 no
VDD (140) 0.215 [0.17, 0.28] 0.000 no
GND (551) 0.630 [0.60, 0.66] 0.119 no
INPUT_PORT (52) 0.147 [0.08, 0.25] 0.000 no
JUNCTION (5124) 0.758 [0.75, 0.77] 0.187 no
AND (101) 0.507 [0.43, 0.59] 0.188 no
OR (35) 0.436 [0.31, 0.57] 0.301 no
JUNCTION recall 0.729 [0.72, 0.74] 0.154 no
tier A F1, all classes pooled 0.722 0.163 -

Six classes have too few real test instances to judge, so the synthetic test is the only evidence for them: OUTPUT_PORT (28), NOT (10), NAND (1), NOR (1), XOR (1), XNOR (0).

Synthetic held-out-style test (391 images in styles never seen in training; target F1 >= 0.95 and accuracy >= 0.95). 12 of 14 classes pass. Two fail:

  • VDD: F1 0.734, accuracy 0.669.
  • XOR: F1 0.961, accuracy 0.942.

On the seen-style half, every class is at 0.98 or above.

Likely causes and data fixes:

  • Only 231 real training images from 2 drafters (the people who drew the images).
  • The stage B checkpoint was chosen on a validation set that is 90% synthetic (best epoch 18, early stop at 33).
  • Junctions are only about 10 px at 960 px input.
  • The held-out circle VDD symbol and sketch strokes are not in the training styles.

A retrain cycle aimed at these causes follows on a separate branch.

Intent

DigiSim is a neglected project. Pull up the latest changes in Linux. It is high time to start training the model for it. I have not been able to provide the data. Figure out, get the data, train a model, make improvements and fix that. Do not come to me until you absolutely need me.

Context: the ML scout report found that the only trained detector uses 12 gate-era classes and detects nothing on the transistor-first schematics the app now uses, that the transistor-level training data does not exist yet, and that the wire/net tracing assumes left-to-right gates. It split the work into tasks T1-T11. T1 (class schema), T2 (synthetic generator v2), T4 (real data), T5 (training harness), T6 (evaluation harness v2) and T8 (net tracing v2) are merged on the default branch.

This task is T7, the training runs: train the transistor-first detector on the synthetic and real data now on the default branch and measure it with the evaluation harness.

What Changed

  • Added Kaggle training tooling for the transistor-first detector: ml/kaggle/build_dataset.py assembles a self-contained dataset from the synthetic v2 output and converted real data (tier A labels only, downsized real images, uncertain_* ignore regions painted out of training copies), and ml/kaggle/t7_session.py runs stage A (synthetic pretrain) then stage B (mixed fine-tune with real images oversampled) in one GPU session. Added a --time wall-clock budget option to ml/train.py and ml/kaggle/train_kaggle.py, recorded as time_hours in the plan and metrics.
  • Made the evaluation harness ignore-region aware: ml/eval_metrics.py adds drop_ignored, and ml/evaluate.py applies it by default for the uncertain_fet, uncertain_supply and uncertain_terminal reasons (new --ignore-reason flag, none disables), so unmatched predictions on objects that could not be labelled are not counted as false positives. Synthetic images flagged as held-out styles in the generator manifest get their own _heldout_style domain, predict_split now predicts one image at a time to avoid running out of RAM, and the Markdown report notes ignore masking. ml/eval_frozen.py now includes ignore-region files in the split digest, and ml/frozen_sets.json is updated.
  • Documented the T7 workflow in agent_docs/ml-pipeline.md and added tests for the Kaggle dataset build, ignore-region masking, the evaluate changes and the frozen-set hashing.

Risk Assessment

✅ Low: The change is ML tooling, evaluation masking, and results docs. No committed weights, no production paths touched, the new logic traced correct on concrete inputs, tests exercise behavior, and the docs state honestly that the phase gate was missed.

Testing

I drove the changed ML tooling live on disposable data in /tmp, which I removed afterwards. The training --time budget, the ignore-region masking, the frozen-set hash guard and the Kaggle dataset builder all behaved as intended, and the 33 targeted unit tests pass. The real trained model and the real CGHD data (ml/data_real) are not in the worktree, so I could not evaluate a trained transistor-first detector against the real frozen sets. The smoke models detect almost nothing, so the F1 gates are not exercised. Nothing is left in the worktree.

  • Live validation: ✅ go - 6 of 7 scenarios driven live against the product
Scenario Result Live Evidence
Train with a wall-clock budget: train.py --preset smoke --time 0.01 runs real CPU training, --time overrides the preset's epoch count, and the budget is recorded in metrics.json ✅ pass live summary.txt; args.yaml time=0.01 with 14 epoch rows vs epochs=2; metrics.json settings.time_hours=0.01
Evaluate on generator output: held-out-style test images are reported under their own _heldout_style domain ✅ pass live eval_heldout_style_domain.md; per_domain has unknown and unknown_heldout_style
Ignore-region masking removes only unmatched predictions inside masked-reason regions (433 to 189 false positives, 244 dropped), and the report states it ✅ pass live eval_with_ignore_masking.md and summary.txt
Adversarial: an ignore region with a non-default reason is not masked by default, and --ignore-reason none disables masking ✅ pass live summary.txt; none gave regions 0 and fp 433; the unrelated reason on one image dropped 59 vs 244
Adversarial: adding ignore files to a frozen split is caught by the frozen-set hash check ✅ pass live evaluate.py refused with a sha mismatch until the set was re-frozen under a new name
Kaggle dataset builder paints out uncertain regions in training images but never over labelled boxes, and fails clearly when the real data is missing ✅ pass live summary.txt; pixel 0 to 254 inside the region; the region over a labelled box left it unchanged (painted_regions 0); FileNotFoundError without real data
Train the transistor-first detector on the full synthetic and real data and evaluate it against the real frozen sets (the T7 end goal) ⏸️ untested no The real CGHD and Roboflow data (ml/data_real, built by python -m real_data.build) and a GPU or Kaggle session are not in this worktree. I exercised the full train, evaluate and build path on dispos…
Evidence: Evaluation report with ignore masking line
# DigiSim evaluation - c2

- generated: 2026-11-18T03:17:45+00:00
- weights: `best.pt` sha256 `2aa45845ff6ab4fb...`
- dataset: `smoke2` split `test`, 4 images, sha256 `419d978420ba43a9...` (verified)
- params: {'imgsz': 640, 'conf': 0.001, 'iou': 0.5, 'small_px': 24.0, 'device': 'cpu'}

## Detection - overall

| images | GT | precision | recall | F1 | small-object recall | unmapped preds |
|---|---|---|---|---|---|---|
| 4 | 81 | 0.000 [0.000, 0.020] | 0.000 [0.000, 0.045] | 0.000 [0.000, 0.014] | 0.000 [0.000, 0.114] (side <= 24px) | 0 |

Operating point: conf >= 0.001, IoU >= 0.5.
Ignore regions (uncertain_fet, uncertain_supply, uncertain_terminal): 2 regions, 244 unmatched predictions inside them not counted.
Verdicts: F1 >= 0.95 and accuracy >= 0.95 (synthetic / overall), F1 >= 0.85 (real domains); `low n` = fewer than 30 GT instances.

JUNCTION recall: 0.000 [0.000, 0.114] (gate: >= 0.9)

## Detection - per class (all domains)

| class | GT | TP | FP | FN | precision | recall = accuracy | F1 | verdict |
|---|---|---|---|---|---|---|---|---|
| NMOS | 11 | 0 | 11 | 11 | 0.000 [0.000, 0.259] | 0.000 [0.000, 0.259] | 0.000 [0.000, 0.149] | low n (fail) |
| PMOS | 11 | 0 | 12 | 11 | 0.000 [0.000, 0.243] | 0.000 [0.000, 0.259] | 0.000 [0.000, 0.143] | low n (fail) |
| VDD | 4 | 0 | 27 | 4 | 0.000 [0.000, 0.125] | 0.000 [0.000, 0.490] | 0.000 [0.000, 0.110] | low n (fail) |
| GND | 6 | 0 | 11 | 6 | 0.000 [0.000, 0.259] | 0.000 [0.000, 0.390] | 0.000 [0.000, 0.184] | low n (fail) |
| INPUT_PORT | 11 | 0 | 16 | 11 | 0.000 [0.000, 0.194] | 0.000 [0.000, 0.259] | 0.000 [0.000, 0.125] | low n (fail) |
| OUTPUT_PORT | 6 | 0 | 18 | 6 | 0.000 [0.000, 0.176] | 0.000 [0.000, 0.390] | 0.000 [0.000, 0.138] | low n (fail) |
| JUNCTION | 30 | 0 | 19 | 30 | 0.000 [0.000, 0.168] | 0.000 [0.000, 0.114] | 0.000 [0.000, 0.073] | FAIL |
| AND | 0 | 0 | 17 | 0 | 0.000 [0.000, 0.184] | n/a | 0.000 [0.000, 0.184] | no GT |
| OR | 0 | 0 | 11 | 0 | 0.000 [0.000, 0.259] | n/a | 0.000 [0.000, 0.259] | no GT |
| NOT | 1 | 0 | 19 | 1 | 0.000 [0.000, 0.168] | 0.000 [0.000, 0.793] | 0.000 [0.000, 0.161] | low n (fail) |
| NAND | 0 | 0 | 7 | 0 | 0.000 [0.000, 0.354] | n/a | 0.000 [0.000, 0.354] | no GT |
| NOR | 1 | 0 | 2 | 1 | 0.000 [0.000, 0.658] | 0.000 [0.000, 0.793] | 0.000 [0.000, 0.562] | low n (fail) |
| XOR | 0 | 0 | 4 | 0 | 0.000 [0.000, 0.490] | n/a | 0.000 [0.000, 0.490] | no GT |
| XNOR | 0 | 0 | 15 | 0 | 0.000 [0.000, 0.204] | n/a | 0.000 [0.000, 0.204] | no GT |

## Detection - domain `unknown` (3 images, 61 GT)

| class | GT | TP | FP | FN | precision | recall = accuracy | F1 | verdict |
|---|---|---|---|---|---|---|---|---|
| NMOS | 8 | 0 | 11 | 8 | 0.000 [0.000, 0.259] | 0.000 [0.000, 0.324] | 0.000 [0.000, 0.168] | low n (fail) |
| PMOS | 8 | 0 | 12 | 8 | 0.000 [0.000, 0.243] | 0.000 [0.000, 0.324] | 0.000 [0.000, 0.161] | low n (fail) |
| VDD | 3 | 0 | 26 | 3 | 0.000 [0.000, 0.129] | 0.000 [0.000, 0.562] | 0.000 [0.000, 0.117] | low n (fail) |
| GND | 5 | 0 | 9 | 5 | 0.000 [0.000, 0.299] | 0.000 [0.000, 0.434] | 0.000 [0.000, 0.215] | low n (fail) |
| INPUT_PORT | 8 | 0 | 16 | 8 | 0.000 [0.000, 0.194] | 0.000 [0.000, 0.324] | 0.000 [0.000, 0.138] | low n (fail) |
| OUTPUT_PORT | 5 | 0 | 18 | 5 | 0.000 [0.000, 0.176] | 0.000 [0.000, 0.434] | 0.000 [0.000, 0.143] | low n (fail) |
| JUNCTION | 22 | 0 | 19 | 22 | 0.000 [0.000, 0.168] | 0.000 [0.000, 0.149] | 0.000 [0.000, 0.086] | low n (fail) |
| AND | 0 | 0 | 16 | 0 | 0.000 [0.000, 0.194] | n/a | 0.000 [0.000, 0.194] | no GT |
| OR | 0 | 0 | 11 | 0 | 0.000 [0.000, 0.259] | n/a | 0.000 [0.000, 0.259] | no GT |
| NOT | 1 | 0 | 19 | 1 | 0.000 [0.000, 0.168] | 0.000 [0.000, 0.793] | 0.000 [0.000, 0.161] | low n (fail) |
| NAND | 0 | 0 | 7 | 0 | 0.000 [0.000, 0.354] | n/a | 0.000 [0.000, 0.354] | no GT |
| NOR | 1 | 0 | 2 | 1 | 0.000 [0.000, 0.658] | 0.000 [0.000, 0.793] | 0.000 [0.000, 0.562] | low n (fail) |
| XOR | 0 | 0 | 4 | 0 | 0.000 [0.000, 0.490] | n/a | 0.000 [0.000, 0.490] | no GT |
| XNOR | 0 | 0 | 15 | 0 | 0.000 [0.000, 0.204] | n/a | 0.000 [0.000, 0.204] | no GT |

## Detection - domain `unknown_heldout_style` (1 images, 20 GT)

| class | GT | TP | FP | FN | precision | recall = accuracy | F1 | verdict |
|---|---|---|---|---|---|---|---|---|
| NMOS | 3 | 0 | 0 | 3 | n/a | 0.000 [0.000, 0.562] | 0.000 [0.000, 0.562] | low n (fail) |
| PMOS | 3 | 0 | 0 | 3 | n/a | 0.000 [0.000, 0.562] | 0.000 [0.000, 0.562] | low n (fail) |
| VDD | 1 | 0 | 1 | 1 | 0.000 [0.000, 0.793] | 0.000 [0.000, 0.793] | 0.000 [0.000, 0.658] | low n (fail) |
| GND | 1 | 0 | 2 | 1 | 0.000 [0.000, 0.658] | 0.000 [0.000, 0.793] | 0.000 [0.000, 0.562] | low n (fail) |
| INPUT_PORT | 3 | 0 | 0 | 3 | n/a | 0.000 [0.000, 0.562] | 0.000 [0.000, 0.562] | low n (fail) |
| OUTPUT_PORT | 1 | 0 | 0 | 1 | n/a | 0.000 [0.000, 0.793] | 0.000 [0.000, 0.793] | low n (fail) |
| JUNCTION | 8 | 0 | 0 | 8 | n/a | 0.000 [0.000, 0.324] | 0.000 [0.000, 0.324] | low n (fail) |
| AND | 0 | 0 | 1 | 0 | 0.000 [0.000, 0.793] | n/a | 0.000 [0.000, 0.793] | no GT |
| OR | 0 | 0 | 0 | 0 | n/a | n/a | n/a | no GT |
| NOT | 0 | 0 | 0 | 0 | n/a | n/a | n/a | no GT |
| NAND | 0 | 0 | 0 | 0 | n/a | n/a | n/a | no GT |
| NOR | 0 | 0 | 0 | 0 | n/a | n/a | n/a | no GT |
| XOR | 0 | 0 | 0 | 0 | n/a | n/a | n/a | no GT |
| XNOR | 0 | 0 | 0 | 0 | n/a | n/a | n/a | no GT |

## Confusion matrix (all domains)

| pred \ GT | NMOS | PMOS | VDD | GND | INPUT_PORT | OUTPUT_PORT | JUNCTION | AND | OR | NOT | NAND | NOR | XOR | XNOR | background |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| **NMOS** | . | . | . | . | . | . | . | . | . | . | . | 1 | . | . | 10 |
| **PMOS** | . | . | . | . | 1 | . | . | . | . | . | . | . | . | . | 11 |
| **VDD** | . | . | . | . | . | 2 | . | . | . | . | . | . | . | . | 25 |
| **GND** | . | . | . | . | 2 | . | . | . | . | . | . | . | . | . | 9 |
| **INPUT_PORT** | . | . | . | . | . | . | . | . | . | . | . | . | . | . | 16 |
| **OUTPUT_PORT** | . | . | . | . | . | . | . | . | . | . | . | . | . | . | 18 |
| **JUNCTION** | . | . | . | . | 1 | . | . | . | . | 1 | . | . | . | . | 17 |
| **AND** | . | . | . | . | 1 | . | . | . | . | . | . | . | . | . | 16 |
| **OR** | . | . | . | . | . | . | . | . | . | . | . | . | . | . | 11 |
| **NOT** | . | . | . | . | . | . | . | . | . | . | . | . | . | . | 19 |
| **NAND** | . | . | . | . | . | . | . | . | . | . | . | . | . | . | 7 |
| **NOR** | . | . | . | . | . | . | . | . | . | . | . | . | . | . | 2 |
| **XOR** | . | . | . | . | . | . | . | . | . | . | . | . | . | . | 4 |
| **XNOR** | . | . | . | . | . | . | . | . | . | . | . | . | . | . | 15 |
| **background** | 11 | 11 | 4 | 6 | 6 | 4 | 30 | . | . | . | . | . | . | . | . |
Evidence: Evaluation report showing held-out-style domain
# DigiSim evaluation - base

- generated: 2026-11-18T03:17:21+00:00
- weights: `best.pt` sha256 `aaf8438586060494...`
- dataset: `smoke_test` split `test`, 4 images, sha256 `3ee16f232e3bcbcb...` (verified)
- params: {'imgsz': 640, 'conf': 0.35, 'iou': 0.5, 'small_px': 24.0, 'device': 'cpu'}

## Detection - overall

| images | GT | precision | recall | F1 | small-object recall | unmapped preds |
|---|---|---|---|---|---|---|
| 4 | 81 | n/a | 0.000 [0.000, 0.045] | 0.000 [0.000, 0.045] | 0.000 [0.000, 0.114] (side <= 24px) | 0 |

Operating point: conf >= 0.35, IoU >= 0.5.
Verdicts: F1 >= 0.95 and accuracy >= 0.95 (synthetic / overall), F1 >= 0.85 (real domains); `low n` = fewer than 30 GT instances.

JUNCTION recall: 0.000 [0.000, 0.114] (gate: >= 0.9)

## Detection - per class (all domains)

| class | GT | TP | FP | FN | precision | recall = accuracy | F1 | verdict |
|---|---|---|---|---|---|---|---|---|
| NMOS | 11 | 0 | 0 | 11 | n/a | 0.000 [0.000, 0.259] | 0.000 [0.000, 0.259] | low n (fail) |
| PMOS | 11 | 0 | 0 | 11 | n/a | 0.000 [0.000, 0.259] | 0.000 [0.000, 0.259] | low n (fail) |
| VDD | 4 | 0 | 0 | 4 | n/a | 0.000 [0.000, 0.490] | 0.000 [0.000, 0.490] | low n (fail) |
| GND | 6 | 0 | 0 | 6 | n/a | 0.000 [0.000, 0.390] | 0.000 [0.000, 0.390] | low n (fail) |
| INPUT_PORT | 11 | 0 | 0 | 11 | n/a | 0.000 [0.000, 0.259] | 0.000 [0.000, 0.259] | low n (fail) |
| OUTPUT_PORT | 6 | 0 | 0 | 6 | n/a | 0.000 [0.000, 0.390] | 0.000 [0.000, 0.390] | low n (fail) |
| JUNCTION | 30 | 0 | 0 | 30 | n/a | 0.000 [0.000, 0.114] | 0.000 [0.000, 0.114] | FAIL |
| AND | 0 | 0 | 0 | 0 | n/a | n/a | n/a | no GT |
| OR | 0 | 0 | 0 | 0 | n/a | n/a | n/a | no GT |
| NOT | 1 | 0 | 0 | 1 | n/a | 0.000 [0.000, 0.793] | 0.000 [0.000, 0.793] | low n (fail) |
| NAND | 0 | 0 | 0 | 0 | n/a | n/a | n/a | no GT |
| NOR | 1 | 0 | 0 | 1 | n/a | 0.000 [0.000, 0.793] | 0.000 [0.000, 0.793] | low n (fail) |
| XOR | 0 | 0 | 0 | 0 | n/a | n/a | n/a | no GT |
| XNOR | 0 | 0 | 0 | 0 | n/a | n/a | n/a | no GT |

## Detection - domain `unknown` (3 images, 61 GT)

| class | GT | TP | FP | FN | precision | recall = accuracy | F1 | verdict |
|---|---|---|---|---|---|---|---|---|
| NMOS | 8 | 0 | 0 | 8 | n/a | 0.000 [0.000, 0.324] | 0.000 [0.000, 0.324] | low n (fail) |
| PMOS | 8 | 0 | 0 | 8 | n/a | 0.000 [0.000, 0.324] | 0.000 [0.000, 0.324] | low n (fail) |
| VDD | 3 | 0 | 0 | 3 | n/a | 0.000 [0.000, 0.562] | 0.000 [0.000, 0.562] | low n (fail) |
| GND | 5 | 0 | 0 | 5 | n/a | 0.000 [0.000, 0.434] | 0.000 [0.000, 0.434] | low n (fail) |
| INPUT_PORT | 8 | 0 | 0 | 8 | n/a | 0.000 [0.000, 0.324] | 0.000 [0.000, 0.324] | low n (fail) |
| OUTPUT_PORT | 5 | 0 | 0 | 5 | n/a | 0.000 [0.000, 0.434] | 0.000 [0.000, 0.434] | low n (fail) |
| JUNCTION | 22 | 0 | 0 | 22 | n/a | 0.000 [0.000, 0.149] | 0.000 [0.000, 0.149] | low n (fail) |
| AND | 0 | 0 | 0 | 0 | n/a | n/a | n/a | no GT |
| OR | 0 | 0 | 0 | 0 | n/a | n/a | n/a | no GT |
| NOT | 1 | 0 | 0 | 1 | n/a | 0.000 [0.000, 0.793] | 0.000 [0.000, 0.793] | low n (fail) |
| NAND | 0 | 0 | 0 | 0 | n/a | n/a | n/a | no GT |
| NOR | 1 | 0 | 0 | 1 | n/a | 0.000 [0.000, 0.793] | 0.000 [0.000, 0.793] | low n (fail) |
| XOR | 0 | 0 | 0 | 0 | n/a | n/a | n/a | no GT |
| XNOR | 0 | 0 | 0 | 0 | n/a | n/a | n/a | no GT |

## Detection - domain `unknown_heldout_style` (1 images, 20 GT)

| class | GT | TP | FP | FN | precision | recall = accuracy | F1 | verdict |
|---|---|---|---|---|---|---|---|---|
| NMOS | 3 | 0 | 0 | 3 | n/a | 0.000 [0.000, 0.562] | 0.000 [0.000, 0.562] | low n (fail) |
| PMOS | 3 | 0 | 0 | 3 | n/a | 0.000 [0.000, 0.562] | 0.000 [0.000, 0.562] | low n (fail) |
| VDD | 1 | 0 | 0 | 1 | n/a | 0.000 [0.000, 0.793] | 0.000 [0.000, 0.793] | low n (fail) |
| GND | 1 | 0 | 0 | 1 | n/a | 0.000 [0.000, 0.793] | 0.000 [0.000, 0.793] | low n (fail) |
| INPUT_PORT | 3 | 0 | 0 | 3 | n/a | 0.000 [0.000, 0.562] | 0.000 [0.000, 0.562] | low n (fail) |
| OUTPUT_PORT | 1 | 0 | 0 | 1 | n/a | 0.000 [0.000, 0.793] | 0.000 [0.000, 0.793] | low n (fail) |
| JUNCTION | 8 | 0 | 0 | 8 | n/a | 0.000 [0.000, 0.324] | 0.000 [0.000, 0.324] | low n (fail) |
| AND | 0 | 0 | 0 | 0 | n/a | n/a | n/a | no GT |
| OR | 0 | 0 | 0 | 0 | n/a | n/a | n/a | no GT |
| NOT | 0 | 0 | 0 | 0 | n/a | n/a | n/a | no GT |
| NAND | 0 | 0 | 0 | 0 | n/a | n/a | n/a | no GT |
| NOR | 0 | 0 | 0 | 0 | n/a | n/a | n/a | no GT |
| XOR | 0 | 0 | 0 | 0 | n/a | n/a | n/a | no GT |
| XNOR | 0 | 0 | 0 | 0 | n/a | n/a | n/a | no GT |

## Confusion matrix (all domains)

| pred \ GT | NMOS | PMOS | VDD | GND | INPUT_PORT | OUTPUT_PORT | JUNCTION | AND | OR | NOT | NAND | NOR | XOR | XNOR | background |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| **NMOS** | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| **PMOS** | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| **VDD** | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| **GND** | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| **INPUT_PORT** | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| **OUTPUT_PORT** | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| **JUNCTION** | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| **AND** | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| **OR** | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| **NOT** | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| **NAND** | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| **NOR** | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| **XOR** | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| **XNOR** | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
| **background** | 11 | 11 | 4 | 6 | 11 | 6 | 30 | . | . | 1 | . | 1 | . | . | . |
Evidence: Scenario results summary
train.py --preset smoke --time 0.01: args.yaml time=0.01 (epochs 2 overridden; 14 epoch rows), metrics.json settings.time_hours=0.01
evaluate.py ignore masking (untrained-for-this-data weights, conf 0.001, 4 synth test images, 2 full-image ignore regions):
  --ignore-reason none            : fp 433, regions 0, dropped 0
  default reasons                 : fp 189, regions 2, dropped 244  (433-244=189)
  unrelated reason on 1 image only: fp 374, dropped 59
Adding ignore/*.json to a frozen split -> evaluate refuses (hash mismatch) until re-frozen.
build_dataset.py: uncertain_fet region painted out (pixel 0 -> 254); region over a labelled box left untouched.

Pipeline

Updates from git push no-mistakes

✅ **intent** - passed

✅ No issues found.

✅ **Rebase** - passed

✅ No issues found.

✅ **Review** - passed

✅ No issues found.

✅ **Test** - passed

✅ No issues found.

  • Live validation: ✅ go - 6 of 7 scenarios driven live against the product
Scenario Result Live Evidence
Train with a wall-clock budget: train.py --preset smoke --time 0.01 runs real CPU training, --time overrides the preset's epoch count, and the budget is recorded in metrics.json ✅ pass live summary.txt; args.yaml time=0.01 with 14 epoch rows vs epochs=2; metrics.json settings.time_hours=0.01
Evaluate on generator output: held-out-style test images are reported under their own _heldout_style domain ✅ pass live eval_heldout_style_domain.md; per_domain has unknown and unknown_heldout_style
Ignore-region masking removes only unmatched predictions inside masked-reason regions (433 to 189 false positives, 244 dropped), and the report states it ✅ pass live eval_with_ignore_masking.md and summary.txt
Adversarial: an ignore region with a non-default reason is not masked by default, and --ignore-reason none disables masking ✅ pass live summary.txt; none gave regions 0 and fp 433; the unrelated reason on one image dropped 59 vs 244
Adversarial: adding ignore files to a frozen split is caught by the frozen-set hash check ✅ pass live evaluate.py refused with a sha mismatch until the set was re-frozen under a new name
Kaggle dataset builder paints out uncertain regions in training images but never over labelled boxes, and fails clearly when the real data is missing ✅ pass live summary.txt; pixel 0 to 254 inside the region; the region over a labelled box left it unchanged (painted_regions 0); FileNotFoundError without real data
Train the transistor-first detector on the full synthetic and real data and evaluate it against the real frozen sets (the T7 end goal) ⏸️ untested no The real CGHD and Roboflow data (ml/data_real, built by python -m real_data.build) and a GPU or Kaggle session are not in this worktree. I exercised the full train, evaluate and build path on dispos…
  • uv run pytest tests/test_evaluate.py tests/test_eval_metrics.py tests/test_eval_frozen.py tests/test_kaggle_build.py (33 passed)
  • uv run python train.py --preset smoke --time 0.01 --device cpu on a disposable dataset: real CPU training, val and ONNX export; args.yaml time=0.01 overrode epochs=2 (14 epoch rows), metrics.json records time_hours
  • train.py --dry-run --time 0.01 prints time_hours in the plan
  • python -m data_gen.generate_v2 --count 60 real generator output, smoke-trained on it, evaluated with evaluate.py: held-out-style images get their own unknown_heldout_style domain
  • evaluate.py --freeze then evaluation on the generator output; adding ignore/*.json changed the split hash and the frozen check refused to evaluate until it was re-frozen
  • evaluate.py --conf 0.001 with --ignore-reason none, the default reasons, a non-masked reason, and uncertain_fet only: false positives 433, 189, 374 and 189; dropped-prediction counts and the Markdown ignore line matched
  • ml/kaggle/build_dataset.py with the synthetic output plus a disposable real-data tree: uncertain_fet region painted out (pixel 0 to 254), region over a labelled box left untouched, painted_regions recorded in build_info.json; default real path missing gives a clear FileNotFoundError
✅ **Document** - passed

✅ No issues found.

✅ **Lint** - passed

✅ No issues found.

✅ **Push** - passed

✅ No issues found.

Adds what the T7 training runs needed and records their results:
- ml/kaggle/build_dataset.py assembles the stage-A/B Kaggle dataset (tier A
  labels, downsized real images, uncertain_* regions painted out of real
  train/valid); ml/kaggle/t7_session.py runs stage A then stage B in one
  time-budgeted GPU session.
- train.py and train_kaggle.py take --time HOURS (wall-clock budget).
- evaluate.py masks T4 uncertain_* ignore regions (unmapped stay scored),
  reports generate_v2 held-out-style test images as their own domain, and
  predicts one image at a time (a list source made ultralytics decode the
  whole split up front and run out of memory on the synthetic test set).
- Frozen-set hash covers ignore regions; registers real_t4_test and
  synth_v2_seed1_n8000_test.
- agent_docs/ml-pipeline.md: T7 results. The phase 2 gate is not met:
  synthetic held-out styles miss VDD and XOR, and every gateable real class
  plus JUNCTION recall (0.729) misses; the notes say which data would fix it.
@vercel

vercel Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
digisim Ready Ready Preview Nov 18, 2026 3:20am UTC

@netlify

netlify Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for digisim canceled.

Name Link
🔨 Latest commit bd9356f
🔍 Latest deploy log https://app.netlify.com/projects/digisim/deploys/6afd19438c3caaa7310320f0

@Mani212005
Mani212005 merged commit 611dc8d into main Nov 18, 2026
9 checks passed

This branch was successfully deployed

1 active deployment
Preview — bd9356f4 Deployed Nov 18, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant