shanto268 commited on
Commit
5e1eb19
·
verified ·
1 Parent(s): 90f2250

sync from registry v1

Browse files
LIMITS.md CHANGED
@@ -89,3 +89,55 @@ families): use `self_from_rows=True` when a strictly consistent Maxwell matrix i
89
  Not measured yet: the push to the Hub was not performed (blocked pending the user's explicit approval). After
90
  `python deploy/sync.py --push`, run `python deploy/tests/test_app.py --url SQuADDS/PlanarCapacitanceModel` (HF_TOKEN in
91
  the environment for private Spaces) and the same stress cases through gradio_client, and fill this section.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
89
  Not measured yet: the push to the Hub was not performed (blocked pending the user's explicit approval). After
90
  `python deploy/sync.py --push`, run `python deploy/tests/test_app.py --url SQuADDS/PlanarCapacitanceModel` (HF_TOKEN in
91
  the environment for private Spaces) and the same stress cases through gradio_client, and fill this section.
92
+
93
+ ## 5. Known biases and reporting (review fixes, 2026-10-08)
94
+
95
+ * **Self-capacitance from row sums.** `self_from_rows=True` uses C_ii = sum_j |C_ij| / (1 - eps) with eps = 0.0143, the
96
+ training-family median of the row-sum fraction. On the never-seen components the median is 0.0099 (0.986 % over
97
+ 2,477 signal conductors of the 926-design evaluation set), so the default overestimates C_Sigma (and underestimates
98
+ E_C) by about 0.45 % there. eps is a parameter (`predict(..., row_sum_eps=...)`); the default is kept at the training
99
+ value and is not tuned on held-out data.
100
+ * **Mesh coarsening.** When a layout needs more than the cell cap (8,000 standard / 16,000 fine), the MoM mesh is
101
+ coarsened until it fits. This is now reported: `result["prior_mesh"]` (achieved and target h_min, smallest gap, cells
102
+ across it, `cap_hit`; for v3-rich also `extrapolated`), a warning in `warnings` and `expected_error["mesh_warning"]`.
103
+ * **Conductor order.** Networks and the MoM prior are invariant to the polygon order of the file (shuffling test:
104
+ MoM exact to 4e-16, network outputs to 5e-5 float32 round-off). The published blend assigns entry kinds by file order;
105
+ deployment blends use order-invariant kinds (conductor-conductor / conductor-ground) when `blend.kinds: invariant`
106
+ is set in the registry (`deploy/tests/test_review_fixes.py`).
107
+
108
+ ## 6. Flagship tiers: `all-data-v3s` (fast, default) and `all-data-v3-rich` (accurate), 2-thread latency
109
+
110
+ Measured on HPC main-partition nodes (`torch.set_num_threads(2)`, OMP/BLAS 2 threads, `OPENBLAS_CORETYPE=Haswell`;
111
+ fastest of the runs per case). These nodes are ~2.5x slower than the Apple M host of section 1 (pair-local comb_f400:
112
+ 277 s here, 86 s there). End to end from the GDS, s, after the v3 non-positive-definite fix (deploy/MODEL_SELECTION.md,
113
+ amendment 5):
114
+
115
+ | layout | all-data-v3s (fast) | all-data-v3-rich (accurate) | all-data-base (fallback) | pair-local (previous flagship) |
116
+ |---|---|---|---|---|
117
+ | comb, 25 / 50 / 100 fingers | 8.0 / 24.4 / 23.1 | 26.6 / 58.6 / 101.7 | 10.8 / 20.9 / 36.8 | 10.8 / 20.9 / 36.8 |
118
+ | comb, 200 / 400 fingers | 91.0 / 161.4 | 257.3 / 293.2 | 98.3 / 276.7 | 98.3 / 276.7 |
119
+ | two pads, size 5 / 10 / 20 / 50 (x) | 4.4 / 6.5 / 15.9 / 27.8 | 17.2 / 36.9 / 48.1 / 53.4 | 4.0 / 12.0 / 17.9 / 27.1 | 4.0 / 12.1 / 17.9 / 27.1 |
120
+ | 7 conductors | 2.0 | 8.6 | 0.7 | 0.7 |
121
+ | 212 held-out designs: median / p90 / max | 3.0 / 8.0 / 12.8 | 12.8 / 33.3 / 50.4 | 1.9 / 9.7 / 30.9 | 1.9 / 9.8 / 30.9 |
122
+
123
+ Findings
124
+ * **v3 non-positive-definite systems (fixed).** On long fine combs the cell cap coarsens the v3 lattice beyond the finger
125
+ pitch (h = 6.7 µm for 5 µm gaps at 50 fingers, 27-34 µm at 200-400 fingers); the 3 x 3 near-field average then
126
+ over-estimates the coupling of panels closer than their size (smallest eigenvalue -0.15). Only when the Cholesky fails,
127
+ the v3 solve is repeated with the exact potential of a uniformly charged rectangle for near pairs (solves the 50- and
128
+ 200-finger combs), and if that still fails, with whole finest cells owned by the majority metal (as the v2 mesh; solves
129
+ the 400-finger comb, where cut panels of different conductors overlap). Priors that solved before are bit-identical.
130
+ `all-data-v3s` no longer needs its fallback model on any stress, held-out or robustness layout; the fallback stays as a
131
+ safety net.
132
+ * **Resolution floor.** At 200-400 fingers every prior (v2 included) is far from converged (0.15-0.75 cells across the
133
+ gap; e.g. 50 fingers: v2 standard C_NS 480 fF, v3 691 fF, v3 with a 4x cell cap 725 fF, fine 704 fF). The result
134
+ carries the mesh-coarsening warning; treat such layouts as indicative.
135
+ * The accurate tier's worst case (400-finger comb, 293 s on these nodes) is close to a 300 s request budget; on the Space
136
+ hardware measure it with `deploy/tests/test_app.py` after deployment.
137
+ * OpenBLAS's SkylakeX Cholesky kernel segfaulted on one v3 system (Qiskit Metal TransmonInterdigitated sample, 15.5k
138
+ panels); the Space apps set `OPENBLAS_CORETYPE=Haswell` on x86 before numpy loads.
139
+ * Robustness (`deploy/tests/results/robustness_all-data-v3s.json`, `robustness_all-data-v3-rich.json`): 219/219 files
140
+ pass for both (matrices or clean rejections, invariance to translation, rotation, units); C_ii < sum |C_ij| in 98
141
+ (fast) / 80 (accurate) of 213 matrices (use `self_from_rows=True` for a consistent Maxwell matrix).
142
+ * Bundle: flagship Space 10.4 MB (both tiers + `all-data-base` + `all-data`, the accurate tier's fallback), paper-models
143
+ Space 25.7 MB (`python deploy/sync.py`, dry run).
README.md CHANGED
@@ -16,6 +16,19 @@ models:
16
  - SQuADDS/2026PaperModels-blend-pair-local
17
  - SQuADDS/2026PaperModels-blend-message-passing
18
  - SQuADDS/2026PaperModels-geometry-only
 
 
 
 
 
 
 
 
 
 
 
 
 
19
  ---
20
 
21
  # Planar Capacitance Model
 
16
  - SQuADDS/2026PaperModels-blend-pair-local
17
  - SQuADDS/2026PaperModels-blend-message-passing
18
  - SQuADDS/2026PaperModels-geometry-only
19
+ - SQuADDS/2026PaperModels-pair-local-fine
20
+ - SQuADDS/2026PaperModels-message-passing-fine
21
+ - SQuADDS/2026PaperModels-all-data
22
+ - SQuADDS/2026PaperModels-all-data-base
23
+ - SQuADDS/2026PaperModels-all-data-v3s
24
+ - SQuADDS/2026PaperModels-all-data-v3-rich
25
+ - SQuADDS/2026PaperModels-pair-local-fast
26
+ - SQuADDS/2026PaperModels-message-passing-fast
27
+ - SQuADDS/2026PaperModels-pair-local-accurate
28
+ - SQuADDS/2026PaperModels-message-passing-accurate
29
+ - SQuADDS/2026PaperModels-charge-corrected-prior-fast
30
+ - SQuADDS/2026PaperModels-blend-pair-local-fast
31
+ - SQuADDS/2026PaperModels-blend-pair-local-accurate
32
  ---
33
 
34
  # Planar Capacitance Model
app.py CHANGED
@@ -1,9 +1,13 @@
1
  """Flagship Space: GDS -> zero-shot Maxwell capacitance matrix. Names and links come from registry.yaml."""
2
 
3
  import os
 
4
  import sys
5
  from pathlib import Path
6
 
 
 
 
7
  HERE = Path(__file__).resolve().parent
8
  if (HERE / "tlsq_infer").exists(): # built Space bundle (deploy/sync.py): vendored package, registry and weights
9
  sys.path.insert(0, str(HERE))
@@ -18,15 +22,17 @@ from tlsq_infer.registry import load_registry # noqa: E402
18
  reg = load_registry()
19
  hub = reg["hub"]
20
  space = os.environ.get("SPACE_ID", hub["flagship_space"])
21
- models = [m for m in ("pair-local", "blend-pair-local", "message-passing") if m in reg.deployable()]
22
  default = reg["defaults"]["flagship_model"]
23
- d = reg.model(default)["paper"]["never_seen"]
24
- header = (f"Zero-shot Maxwell capacitance of planar superconducting layouts. Default model: **{reg.model(default)['title']}** "
25
- f"({d['median_pct']} % median error, MAE {d['mae_ff']} fF, RMSE {d['rmse_ff']} fF on 926 never-seen designs). "
 
 
 
26
  f"All paper models: [{hub['paper_models_space']}](https://huggingface.co/spaces/{hub['paper_models_space']}). "
27
  f"Weights: [{reg.model(default)['repo_id']}](https://huggingface.co/{reg.model(default)['repo_id']}). "
28
  f"Programmatic use: `gradio_client.Client(\"{space}\")` (see the API page and examples/client.py).")
29
- demo = build_app(hub["flagship_title"], models, default, header, examples_dir=HERE / "examples")
30
  demo.queue(default_concurrency_limit=int(os.environ.get("TLSQ_CONCURRENCY", 2)), max_size=32)
31
 
32
  if __name__ == "__main__":
 
1
  """Flagship Space: GDS -> zero-shot Maxwell capacitance matrix. Names and links come from registry.yaml."""
2
 
3
  import os
4
+ import platform
5
  import sys
6
  from pathlib import Path
7
 
8
+ if platform.machine() in ("x86_64", "AMD64"): # OpenBLAS SkylakeX Cholesky kernel segfaulted on a v3 MoM system (LIMITS.md)
9
+ os.environ.setdefault("OPENBLAS_CORETYPE", "Haswell") # must be set before numpy loads OpenBLAS
10
+
11
  HERE = Path(__file__).resolve().parent
12
  if (HERE / "tlsq_infer").exists(): # built Space bundle (deploy/sync.py): vendored package, registry and weights
13
  sys.path.insert(0, str(HERE))
 
22
  reg = load_registry()
23
  hub = reg["hub"]
24
  space = os.environ.get("SPACE_ID", hub["flagship_space"])
 
25
  default = reg["defaults"]["flagship_model"]
26
+ models = [default] + ([reg["defaults"]["flagship_accurate_model"]] if reg["defaults"].get("flagship_accurate_model") else [])
27
+ t = reg["defaults"].get("tiers", {}).get("fast") or {}
28
+ d = t if t.get("median_pct") is not None else reg.model(default)["paper"]["never_seen"]
29
+ where = t.get("set", "926 never-seen designs") if t else "926 never-seen designs"
30
+ header = (f"Zero-shot Maxwell capacitance of planar superconducting layouts. Default (fast) model: **{reg.model(default)['title']}** "
31
+ f"({d['median_pct']} % median error, MAE {d['mae_ff']} fF, RMSE {d['rmse_ff']} fF on {where}). "
32
  f"All paper models: [{hub['paper_models_space']}](https://huggingface.co/spaces/{hub['paper_models_space']}). "
33
  f"Weights: [{reg.model(default)['repo_id']}](https://huggingface.co/{reg.model(default)['repo_id']}). "
34
  f"Programmatic use: `gradio_client.Client(\"{space}\")` (see the API page and examples/client.py).")
35
+ demo = build_app(hub["flagship_title"], models, default, header, examples_dir=HERE / "examples", tiers=True)
36
  demo.queue(default_concurrency_limit=int(os.environ.get("TLSQ_CONCURRENCY", 2)), max_size=32)
37
 
38
  if __name__ == "__main__":
models/all-data-base/config.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"name": "all-data-base", "files": ["seed0.pt", "seed1.pt", "seed2.pt"]}
models/all-data-base/seed0.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:60f29f22b4ee0fe2b10a29131f0d1c56b7af4b9537f1c17208a1f7ade567044b
3
+ size 848449
models/all-data-base/seed1.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b6f9f861c4a65f711b081e3f90e396bf5540178335d8588375c71ec590e7fc85
3
+ size 848449
models/all-data-base/seed2.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1b4a2a15a1d9f6e2b19281e213f56a22278ef93e753ec61f656bed99c66391ae
3
+ size 848449
models/all-data-v3-rich/config.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"name": "all-data-v3-rich", "files": ["seed0.pt", "seed1.pt", "seed2.pt"]}
models/all-data-v3-rich/seed0.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e3305b5d522abccc52c31b46f13cf424be197aa7fcfbd1d9a70bb9ea3d7c8ce9
3
+ size 848449
models/all-data-v3-rich/seed1.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:cecfb8d90711dbd0d37446f1dcff7154443fe487d45a3bd9af99ba686e6c4f31
3
+ size 848449
models/all-data-v3-rich/seed2.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:4bbcfc763a63eeb8dd3f781051a359cd78f2cf8ef7b54818067f9f9d75788269
3
+ size 848449
models/all-data-v3s/config.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"name": "all-data-v3s", "files": ["seed0.pt", "seed1.pt", "seed2.pt"]}
models/all-data-v3s/seed0.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a445b7f10bb9fa82f4d6c7a1d95c02ddc0d5979180ab50da39e9e7bc27f0017d
3
+ size 848449
models/all-data-v3s/seed1.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:634dbf3699ec8f4355ada5c51ccb08c881d0ea74801e70c328a9fcae4d0b0102
3
+ size 848449
models/all-data-v3s/seed2.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d186d67cb5a4b4ccfbd52e4e288d56fc3b98c45850e994e66d18ae49ef09a3ba
3
+ size 848449
models/all-data/config.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"name": "all-data", "files": ["seed0.pt", "seed1.pt", "seed2.pt"]}
models/all-data/seed0.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:803ac1db3b05f41fc8d6368dc6f666eb88406c0c52d7e087a49668d57c6a9e3c
3
+ size 848449
models/all-data/seed1.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:5a579faeee0a2aa2fdcf89c216e313eb4683ee8111f6b5962a9f6d11faca21df
3
+ size 848449
models/all-data/seed2.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2b97ae3d84ef2c8a36a93c16051d81472caf55ddf27a230ceda842e29750807d
3
+ size 848449
registry.yaml CHANGED
@@ -48,6 +48,9 @@ eval_sets:
48
  blend:
49
  weights_gnn_side: {signal-signal: 0.6, signal-ground: 0.7, pad: 0.8} # log-space; rest = charge-corrected prior
50
  note: "pad = any entry involving the third or later signal body (file order), as in the paper"
 
 
 
51
 
52
  self_capacitance:
53
  row_sum_eps: 0.0143 # C_ii = sum_j |C_ij| / (1 - eps) (IMPROVE_IDEAS.md, training median)
@@ -72,13 +75,19 @@ artifacts:
72
  stack_error: deploy/artifacts/stack_error.json # built by `python deploy/stack_error.py fit`
73
 
74
  defaults:
75
- flagship_model: pair-local
76
- paper_space_model: blend-pair-local
 
 
 
 
 
 
77
 
78
  models:
79
  # ---------------------------------------------------------------- learned, released
80
  pair-local:
81
- title: "Pair-local network + MoM prior (R=0)"
82
  repo_id: SQuADDS/2026PaperModels-pair-local
83
  kind: gnn
84
  prior: standard
@@ -86,7 +95,7 @@ models:
86
  status: available
87
  checkpoints: [data_local/mega/ckpt/ALL_mom_r0_s0.pt, data_local/mega/ckpt/ALL_mom_r0_s1.pt, data_local/mega/ckpt/ALL_mom_r0_s2.pt]
88
  parameters: 209410
89
- summary: "Default. Cheapest learned model; best accuracy-per-second for screening many layouts."
90
  paper:
91
  appears_in: [tab:candidates, tab:costacc, fig:costacc, tab:splits, fig:zs-arch, fig:stack, tab:stack]
92
  never_seen: {median_pct: 1.73, mae_ff: 0.83, rmse_ff: 1.62}
@@ -95,7 +104,7 @@ models:
95
  cost_s_per_design: {never_seen: 8.75, ood60: 0.60, note: one CPU core, all stages from the GDS}
96
 
97
  message-passing:
98
- title: "Message-passing network + MoM prior (R=3)"
99
  repo_id: SQuADDS/2026PaperModels-message-passing
100
  kind: gnn
101
  prior: standard
@@ -103,7 +112,7 @@ models:
103
  status: available
104
  checkpoints: [data_local/mega/ckpt/ALL_mom_s0.pt, data_local/mega/ckpt/ALL_mom_s1.pt, data_local/mega/ckpt/ALL_mom_s2.pt]
105
  parameters: 752386
106
- summary: "Best in-family accuracy with the standard prior; transfers slightly worse than pair-local."
107
  paper:
108
  appears_in: [tab:candidates, tab:costacc, fig:costacc, tab:sota, fig:zs-arch, fig:infamily]
109
  never_seen: {median_pct: 2.08, mae_ff: 0.97, rmse_ff: 1.88}
@@ -112,13 +121,13 @@ models:
112
  cost_s_per_design: {never_seen: 8.77, ood60: 0.61}
113
 
114
  charge-corrected-prior:
115
- title: "Charge-corrected MoM prior (cell GBM)"
116
  repo_id: SQuADDS/2026PaperModels-charge-corrected-prior
117
  kind: charge_prior
118
  prior: standard
119
  status: available
120
  checkpoints: [deploy/artifacts/charge_gbm.joblib]
121
- summary: "MoM prior with its cell charges corrected by a gradient-boosted model of local geometry; no capacitance labels. Smallest worst-case error."
122
  paper:
123
  appears_in: [tab:candidates, tab:costacc, fig:zs-cell, tab:splits]
124
  never_seen: {median_pct: 2.18, mae_ff: 0.95, rmse_ff: 1.62}
@@ -126,12 +135,12 @@ models:
126
  cost_s_per_design: {never_seen: 17.5, ood60: 1.06, note: "paper timing re-solves the MoM; tlsq_infer reuses the prior's solve"}
127
 
128
  blend-pair-local:
129
- title: "Blended model: pair-local network x charge-corrected prior"
130
  repo_id: SQuADDS/2026PaperModels-blend-pair-local
131
  kind: blend
132
  components: [pair-local, charge-corrected-prior]
133
  status: available
134
- summary: "Best zero-shot model on never-seen components (paper headline)."
135
  paper:
136
  appears_in: [tab:candidates, tab:costacc, fig:costacc, fig:blend, fig:stack, tab:stack, fig:invdesign, tab:invdes]
137
  never_seen: {median_pct: 1.64, mae_ff: 0.71, rmse_ff: 1.36}
@@ -139,12 +148,12 @@ models:
139
  cost_s_per_design: {never_seen: 17.5, ood60: 1.06}
140
 
141
  blend-message-passing:
142
- title: "Blended model: message-passing network x charge-corrected prior"
143
  repo_id: SQuADDS/2026PaperModels-blend-message-passing
144
  kind: blend
145
  components: [message-passing, charge-corrected-prior]
146
  status: available
147
- summary: "Blend with the R=3 network."
148
  paper:
149
  appears_in: [tab:costacc, fig:costacc, fig:blend]
150
  never_seen: {median_pct: 1.84, mae_ff: 0.82, rmse_ff: 1.56}
@@ -152,7 +161,7 @@ models:
152
  cost_s_per_design: {never_seen: 17.5, ood60: 1.07}
153
 
154
  geometry-only:
155
- title: "Geometry-only network (no physics prior)"
156
  repo_id: SQuADDS/2026PaperModels-geometry-only
157
  kind: gnn
158
  prior: none
@@ -169,7 +178,7 @@ models:
169
 
170
  # ---------------------------------------------------------------- training-free
171
  mom-prior:
172
- title: "MoM prior alone (training-free)"
173
  repo_id: null
174
  kind: prior
175
  prior: standard
@@ -181,7 +190,7 @@ models:
181
  ood60: {median_pct: 8.09, mae_ff: 2.26, rmse_ff: 3.56}
182
 
183
  fine-mom-prior:
184
- title: "Fine MoM prior alone (training-free)"
185
  repo_id: null
186
  kind: prior
187
  prior: fine
@@ -193,15 +202,14 @@ models:
193
 
194
  # ---------------------------------------------------------------- pending (trained on HPC; copy checkpoints, flip status)
195
  pair-local-fine:
196
- title: "Pair-local network + fine MoM prior (R=0)"
197
  repo_id: SQuADDS/2026PaperModels-pair-local-fine
198
  kind: gnn
199
  prior: fine
200
  rounds: 0
201
- status: pending
202
- pending_reason: "checkpoints on HPC (results/mega/fine/); copy to data_local/mega/ckpt_fine/"
203
  checkpoints: [data_local/mega/ckpt_fine/ALL_mom_r0_s0.pt, data_local/mega/ckpt_fine/ALL_mom_r0_s1.pt, data_local/mega/ckpt_fine/ALL_mom_r0_s2.pt]
204
- summary: "Best on arbitrary or unusual geometry."
205
  paper:
206
  appears_in: [tab:candidates, tab:costacc, fig:costacc, tab:wonky-shape-main]
207
  never_seen: {median_pct: 1.74, mae_ff: 0.98, rmse_ff: 1.87}
@@ -209,15 +217,14 @@ models:
209
  cost_s_per_design: {never_seen: 38.0, ood60: 1.84}
210
 
211
  message-passing-fine:
212
- title: "Message-passing network + fine MoM prior (R=3)"
213
  repo_id: SQuADDS/2026PaperModels-message-passing-fine
214
  kind: gnn
215
  prior: fine
216
  rounds: 3
217
- status: pending
218
- pending_reason: "checkpoints on HPC (results/mega/fine/); copy to data_local/mega/ckpt_fine/"
219
  checkpoints: [data_local/mega/ckpt_fine/ALL_mom_s0.pt, data_local/mega/ckpt_fine/ALL_mom_s1.pt, data_local/mega/ckpt_fine/ALL_mom_s2.pt]
220
- summary: "Lowest MAE on the never-seen components among single networks."
221
  paper:
222
  appears_in: [tab:candidates, tab:costacc, fig:costacc]
223
  never_seen: {median_pct: 1.74, mae_ff: 0.74, rmse_ff: 1.39}
@@ -226,18 +233,210 @@ models:
226
  cost_s_per_design: {never_seen: 38.0, ood60: 1.85}
227
 
228
  all-data:
229
- title: "All-data deployment model (fine prior, all families + random layouts)"
230
  repo_id: SQuADDS/2026PaperModels-all-data
231
  kind: gnn
232
  prior: fine
233
  rounds: 0
234
- status: pending
235
- pending_reason: "training in progress on HPC (paper: \\needs{all-data model})"
236
- checkpoints: []
237
- summary: "Trained on every labelled design (no held-out family). Not zero-shot on any paper test set."
238
  paper:
239
  appears_in: [sec:res-opt (All-data model paragraph)]
240
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
241
  # ---------------------------------------------------------------- baselines (paper comparison; not deployable on a GDS)
242
  parameter-mlp:
243
  title: "Parameter MLP (published surrogate, MLQubitDesign)"
 
48
  blend:
49
  weights_gnn_side: {signal-signal: 0.6, signal-ground: 0.7, pad: 0.8} # log-space; rest = charge-corrected prior
50
  note: "pad = any entry involving the third or later signal body (file order), as in the paper"
51
+ kinds: invariant # deployment: order-invariant kinds (deploy/MODEL_SELECTION.md amendment 3); "published" = paper file-order kinds
52
+ weights_gnn_side_invariant: {conductor-conductor: 0.6, conductor-ground: 0.9} # LOFO on the 5 training families (scripts/blend_lofo.py --kinds invariant)
53
+ note_invariant: "conductor-conductor = any pair of floating conductors, conductor-ground = pairs with ground; independent of polygon order"
54
 
55
  self_capacitance:
56
  row_sum_eps: 0.0143 # C_ii = sum_j |C_ij| / (1 - eps) (IMPROVE_IDEAS.md, training median)
 
75
  stack_error: deploy/artifacts/stack_error.json # built by `python deploy/stack_error.py fit`
76
 
77
  defaults:
78
+ flagship_model: all-data-v3s # fast tier (deploy/MODEL_SELECTION.md, amendment 1 rule)
79
+ flagship_accurate_model: all-data-v3-rich # accurate tier (MODEL_SELECTION.md, amendment 5 re-score)
80
+ paper_space_model: pair-local-fast # this work's headline (paper abstract)
81
+ tiers: # shown in the flagship UI; held-out = OOD-60 + pocket3 random-36 + Qiskit Metal new 116, pooled mutual entries
82
+ fast: {latency_s: 3.0, median_pct: 1.75, mae_ff: 0.534, rmse_ff: 1.173, set: "212 held-out designs (OOD-60, random TransmonPocket-3, 6 new Qiskit Metal classes)",
83
+ note: "Median 3 s per layout (2 threads, HPC node), up to ~3 min for very long interdigitated combs."}
84
+ accurate: {latency_s: 13, median_pct: 1.31, mae_ff: 0.403, rmse_ff: 0.877, set: "212 held-out designs (OOD-60, random TransmonPocket-3, 6 new Qiskit Metal classes)",
85
+ note: "Median 13 s per layout (2 threads, HPC node), up to ~5 min for very long interdigitated combs. Richardson-extrapolated v3 prior."}
86
 
87
  models:
88
  # ---------------------------------------------------------------- learned, released
89
  pair-local:
90
+ title: "Pair-local network + earlier standard MoM prior (R=0, published v2 mesh)"
91
  repo_id: SQuADDS/2026PaperModels-pair-local
92
  kind: gnn
93
  prior: standard
 
95
  status: available
96
  checkpoints: [data_local/mega/ckpt/ALL_mom_r0_s0.pt, data_local/mega/ckpt/ALL_mom_r0_s1.pt, data_local/mega/ckpt/ALL_mom_r0_s2.pt]
97
  parameters: 209410
98
+ summary: "Earlier prior (published v2 mesh). Former flagship; superseded by the fast-prior models of this work."
99
  paper:
100
  appears_in: [tab:candidates, tab:costacc, fig:costacc, tab:splits, fig:zs-arch, fig:stack, tab:stack]
101
  never_seen: {median_pct: 1.73, mae_ff: 0.83, rmse_ff: 1.62}
 
104
  cost_s_per_design: {never_seen: 8.75, ood60: 0.60, note: one CPU core, all stages from the GDS}
105
 
106
  message-passing:
107
+ title: "Message-passing network + earlier standard MoM prior (R=3, published v2 mesh)"
108
  repo_id: SQuADDS/2026PaperModels-message-passing
109
  kind: gnn
110
  prior: standard
 
112
  status: available
113
  checkpoints: [data_local/mega/ckpt/ALL_mom_s0.pt, data_local/mega/ckpt/ALL_mom_s1.pt, data_local/mega/ckpt/ALL_mom_s2.pt]
114
  parameters: 752386
115
+ summary: "Earlier prior (published v2 mesh). Transfers slightly worse than pair-local."
116
  paper:
117
  appears_in: [tab:candidates, tab:costacc, fig:costacc, tab:sota, fig:zs-arch, fig:infamily]
118
  never_seen: {median_pct: 2.08, mae_ff: 0.97, rmse_ff: 1.88}
 
121
  cost_s_per_design: {never_seen: 8.77, ood60: 0.61}
122
 
123
  charge-corrected-prior:
124
+ title: "Charge-corrected earlier MoM prior (cell GBM, published v2 mesh)"
125
  repo_id: SQuADDS/2026PaperModels-charge-corrected-prior
126
  kind: charge_prior
127
  prior: standard
128
  status: available
129
  checkpoints: [deploy/artifacts/charge_gbm.joblib]
130
+ summary: "Earlier prior (published v2 mesh): MoM cell charges corrected by a gradient-boosted model of local geometry; no capacitance labels."
131
  paper:
132
  appears_in: [tab:candidates, tab:costacc, fig:zs-cell, tab:splits]
133
  never_seen: {median_pct: 2.18, mae_ff: 0.95, rmse_ff: 1.62}
 
135
  cost_s_per_design: {never_seen: 17.5, ood60: 1.06, note: "paper timing re-solves the MoM; tlsq_infer reuses the prior's solve"}
136
 
137
  blend-pair-local:
138
+ title: "Blended model (earlier prior): pair-local network x charge-corrected earlier prior"
139
  repo_id: SQuADDS/2026PaperModels-blend-pair-local
140
  kind: blend
141
  components: [pair-local, charge-corrected-prior]
142
  status: available
143
+ summary: "Earlier prior (published v2 mesh); was the headline of the first draft. Deployed with order-invariant blend weights."
144
  paper:
145
  appears_in: [tab:candidates, tab:costacc, fig:costacc, fig:blend, fig:stack, tab:stack, fig:invdesign, tab:invdes]
146
  never_seen: {median_pct: 1.64, mae_ff: 0.71, rmse_ff: 1.36}
 
148
  cost_s_per_design: {never_seen: 17.5, ood60: 1.06}
149
 
150
  blend-message-passing:
151
+ title: "Blended model (earlier prior): message-passing network x charge-corrected earlier prior"
152
  repo_id: SQuADDS/2026PaperModels-blend-message-passing
153
  kind: blend
154
  components: [message-passing, charge-corrected-prior]
155
  status: available
156
+ summary: "Earlier prior (published v2 mesh); blend with the R=3 network."
157
  paper:
158
  appears_in: [tab:costacc, fig:costacc, fig:blend]
159
  never_seen: {median_pct: 1.84, mae_ff: 0.82, rmse_ff: 1.56}
 
161
  cost_s_per_design: {never_seen: 17.5, ood60: 1.07}
162
 
163
  geometry-only:
164
+ title: "Geometry-only network (no physics prior; earlier ablation)"
165
  repo_id: SQuADDS/2026PaperModels-geometry-only
166
  kind: gnn
167
  prior: none
 
178
 
179
  # ---------------------------------------------------------------- training-free
180
  mom-prior:
181
+ title: "Earlier standard MoM prior alone (training-free, published v2 mesh)"
182
  repo_id: null
183
  kind: prior
184
  prior: standard
 
190
  ood60: {median_pct: 8.09, mae_ff: 2.26, rmse_ff: 3.56}
191
 
192
  fine-mom-prior:
193
+ title: "Earlier fine MoM prior alone (training-free, published v2 mesh)"
194
  repo_id: null
195
  kind: prior
196
  prior: fine
 
202
 
203
  # ---------------------------------------------------------------- pending (trained on HPC; copy checkpoints, flip status)
204
  pair-local-fine:
205
+ title: "Pair-local network + earlier fine MoM prior (R=0, published v2 mesh)"
206
  repo_id: SQuADDS/2026PaperModels-pair-local-fine
207
  kind: gnn
208
  prior: fine
209
  rounds: 0
210
+ status: available
 
211
  checkpoints: [data_local/mega/ckpt_fine/ALL_mom_r0_s0.pt, data_local/mega/ckpt_fine/ALL_mom_r0_s1.pt, data_local/mega/ckpt_fine/ALL_mom_r0_s2.pt]
212
+ summary: "Earlier fine prior (published v2 mesh, 16k cells). Trained on 35,283 designs (star families subsampled to 300 each)."
213
  paper:
214
  appears_in: [tab:candidates, tab:costacc, fig:costacc, tab:wonky-shape-main]
215
  never_seen: {median_pct: 1.74, mae_ff: 0.98, rmse_ff: 1.87}
 
217
  cost_s_per_design: {never_seen: 38.0, ood60: 1.84}
218
 
219
  message-passing-fine:
220
+ title: "Message-passing network + earlier fine MoM prior (R=3, published v2 mesh)"
221
  repo_id: SQuADDS/2026PaperModels-message-passing-fine
222
  kind: gnn
223
  prior: fine
224
  rounds: 3
225
+ status: available
 
226
  checkpoints: [data_local/mega/ckpt_fine/ALL_mom_s0.pt, data_local/mega/ckpt_fine/ALL_mom_s1.pt, data_local/mega/ckpt_fine/ALL_mom_s2.pt]
227
+ summary: "Earlier fine prior (published v2 mesh, 16k cells). Trained on 35,283 designs (star families subsampled to 300 each)."
228
  paper:
229
  appears_in: [tab:candidates, tab:costacc, fig:costacc]
230
  never_seen: {median_pct: 1.74, mae_ff: 0.74, rmse_ff: 1.39}
 
233
  cost_s_per_design: {never_seen: 38.0, ood60: 1.85}
234
 
235
  all-data:
236
+ title: "All-data pair-local network + earlier fine MoM prior (R=0)"
237
  repo_id: SQuADDS/2026PaperModels-all-data
238
  kind: gnn
239
  prior: fine
240
  rounds: 0
241
+ status: available
242
+ checkpoints: [data_local/mega/alldata/fine_r0_s0.pt, data_local/mega/alldata/fine_r0_s1.pt, data_local/mega/alldata/fine_r0_s2.pt]
243
+ summary: "Trained on every labelled design (no held-out family). Not zero-shot on any paper test set. Candidate E of deploy/MODEL_SELECTION.md."
244
+ validation: {median_pct: 2.25, mae_ff: 0.778, rmse_ff: 2.27, set: "212 deploy held-out designs (deploy/MODEL_SELECTION.md)"}
245
  paper:
246
  appears_in: [sec:res-opt (All-data model paragraph)]
247
 
248
+ all-data-base:
249
+ title: "All-data pair-local network + earlier standard MoM prior (R=0)"
250
+ repo_id: SQuADDS/2026PaperModels-all-data-base
251
+ kind: gnn
252
+ prior: standard
253
+ rounds: 0
254
+ status: available
255
+ checkpoints: [data_local/mega/alldata/base_r0_s0.pt, data_local/mega/alldata/base_r0_s1.pt, data_local/mega/alldata/base_r0_s2.pt]
256
+ summary: "Trained on every labelled design, standard 8k-cell MoM prior. Safety fallback of the flagship if its v3 prior cannot be solved (not needed on any test layout since the non-positive-definite fix). Candidate D of deploy/MODEL_SELECTION.md."
257
+ validation: {median_pct: 2.77, mae_ff: 0.96, rmse_ff: 2.657, set: "212 deploy held-out designs (deploy/MODEL_SELECTION.md)"}
258
+
259
+ all-data-v3s:
260
+ title: "All-data pair-local network + fast prior (v3, gap/3, R=0)"
261
+ repo_id: SQuADDS/2026PaperModels-all-data-v3s
262
+ kind: gnn
263
+ prior: v3
264
+ rounds: 0
265
+ status: available
266
+ fallback: all-data-base
267
+ checkpoints: [data_local/mega/alldata/v3s_r0_s0.pt, data_local/mega/alldata/v3s_r0_s1.pt, data_local/mega/alldata/v3s_r0_s2.pt]
268
+ summary: "Flagship (fast tier). Trained on every labelled design on the conductor-anchored v3 MoM prior (one gap/3 solve). Candidate V3S-PLall of deploy/MODEL_SELECTION.md."
269
+ validation: {median_pct: 1.75, mae_ff: 0.534, rmse_ff: 1.173, set: "212 deploy held-out designs (deploy/MODEL_SELECTION.md)"}
270
+ paper:
271
+ appears_in: [tab:candidates, tab:wonky-shape-main]
272
+ ood60: {median_pct: 1.06, mae_ff: 0.45, rmse_ff: 0.90, note: "OOD-60 not in training; never-seen families are"}
273
+ heldout:
274
+ ood60: {median_pct: 1.06, mae_ff: 0.449, rmse_ff: 0.898}
275
+ pocket3_random36: {median_pct: 1.90, mae_ff: 0.319, rmse_ff: 0.563}
276
+ qiskit_metal_new116: {median_pct: 1.84, mae_ff: 0.654, rmse_ff: 1.416}
277
+ pocket3_biased20: {median_pct: 3.10, mae_ff: 0.503, rmse_ff: 0.836}
278
+ cost_s_per_design: {median: 3.0, p90: 8.0, max: 12.8, note: "end to end from the GDS, 2 threads, HPC main-partition node"}
279
+
280
+ all-data-v3-rich:
281
+ title: "All-data pair-local network + accurate prior (v3-rich, Richardson, R=0)"
282
+ repo_id: SQuADDS/2026PaperModels-all-data-v3-rich
283
+ kind: gnn
284
+ prior: v3-rich
285
+ rounds: 0
286
+ status: available
287
+ fallback: all-data
288
+ checkpoints: [data_local/mega/alldata/v3_r0_s0.pt, data_local/mega/alldata/v3_r0_s1.pt, data_local/mega/alldata/v3_r0_s2.pt]
289
+ summary: "Flagship accurate tier. Trained on every labelled design on the Richardson-extrapolated v3 MoM prior. Candidate V3R-PLall of deploy/MODEL_SELECTION.md."
290
+ validation: {median_pct: 1.31, mae_ff: 0.403, rmse_ff: 0.877, set: "212 deploy held-out designs (deploy/MODEL_SELECTION.md)"}
291
+ paper:
292
+ appears_in: [tab:candidates, tab:wonky-shape-main]
293
+ ood60: {median_pct: 0.66, mae_ff: 0.23, rmse_ff: 0.48, note: "OOD-60 not in training; never-seen families are"}
294
+ heldout:
295
+ ood60: {median_pct: 0.66, mae_ff: 0.230, rmse_ff: 0.481}
296
+ pocket3_random36: {median_pct: 1.75, mae_ff: 0.268, rmse_ff: 0.506}
297
+ qiskit_metal_new116: {median_pct: 1.40, mae_ff: 0.505, rmse_ff: 1.064}
298
+ pocket3_biased20: {median_pct: 3.15, mae_ff: 0.536, rmse_ff: 1.017}
299
+ cost_s_per_design: {median: 12.8, p90: 33.3, max: 50.4, note: "end to end from the GDS, 2 threads, HPC node; stress layouts up to 293 s (400-finger comb)"}
300
+
301
+ # ---------------------------------------------------------------- this work: conductor-anchored v3 priors (paper_ml, 2026-10-08)
302
+ # fast prior = v3s (one gap/3 solve), accurate prior = v3-rich (gap/3 + gap/6, Richardson). Metrics: paper tab:candidates
303
+ # (median % / MAE fF / RMSE fF, all mutual entries); in_family_test = held-out test split of the 5 families.
304
+ pair-local-fast:
305
+ title: "Pair-local network + fast prior (v3, R=0) - paper headline"
306
+ repo_id: SQuADDS/2026PaperModels-pair-local-fast
307
+ kind: gnn
308
+ prior: v3
309
+ rounds: 0
310
+ status: available
311
+ fallback: pair-local
312
+ checkpoints: [data_local/mega/v3s/ALL_mom_r0_s0.pt, data_local/mega/v3s/ALL_mom_r0_s1.pt, data_local/mega/v3s/ALL_mom_r0_s2.pt]
313
+ summary: "This work's headline: zero-shot on never-seen components 1.23 % median. Five training families, fast conductor-anchored prior."
314
+ paper:
315
+ appears_in: [abstract, tab:candidates, tab:costacc, fig:costacc, tab:infamily-v3, tab:wonky-shape-main, fig:newtopo-all]
316
+ never_seen: {median_pct: 1.23, mae_ff: 0.57, rmse_ff: 1.02}
317
+ ood60: {median_pct: 1.33, mae_ff: 0.47, rmse_ff: 0.92}
318
+ in_family_test: {median_pct: 0.30, mae_ff: 0.047, rmse_ff: 0.144}
319
+ deploy_heldout: {median_pct: 2.63, mae_ff: 0.616, rmse_ff: 1.193, set: "212 deploy held-out designs (deploy/MODEL_SELECTION.md)"}
320
+
321
+ message-passing-fast:
322
+ title: "Message-passing network + fast prior (v3, R=3)"
323
+ repo_id: SQuADDS/2026PaperModels-message-passing-fast
324
+ kind: gnn
325
+ prior: v3
326
+ rounds: 3
327
+ status: available
328
+ fallback: message-passing
329
+ checkpoints: [data_local/mega/v3s/ALL_mom_s0.pt, data_local/mega/v3s/ALL_mom_s1.pt, data_local/mega/v3s/ALL_mom_s2.pt]
330
+ summary: "Five training families, fast prior, three message-passing rounds."
331
+ paper:
332
+ appears_in: [tab:candidates, tab:costacc, fig:costacc, tab:infamily-v3, fig:newtopo-all]
333
+ never_seen: {median_pct: 1.67, mae_ff: 0.72, rmse_ff: 1.32}
334
+ ood60: {median_pct: 1.33, mae_ff: 0.64, rmse_ff: 1.48}
335
+ in_family_test: {median_pct: 0.21, mae_ff: 0.032, rmse_ff: 0.078}
336
+ deploy_heldout: {median_pct: 2.70, mae_ff: 0.638, rmse_ff: 1.259, set: "212 deploy held-out designs (deploy/MODEL_SELECTION.md)"}
337
+
338
+ pair-local-accurate:
339
+ title: "Pair-local network + accurate prior (v3-rich, R=0)"
340
+ repo_id: SQuADDS/2026PaperModels-pair-local-accurate
341
+ kind: gnn
342
+ prior: v3-rich
343
+ rounds: 0
344
+ status: available
345
+ fallback: pair-local-fine
346
+ checkpoints: [data_local/mega/v3/ALL_mom_r0_s0.pt, data_local/mega/v3/ALL_mom_r0_s1.pt, data_local/mega/v3/ALL_mom_r0_s2.pt]
347
+ summary: "Five training families, accurate (Richardson-extrapolated) prior."
348
+ paper:
349
+ appears_in: [tab:candidates, tab:costacc, fig:costacc, tab:infamily-v3, tab:wonky-shape-main, fig:newtopo-all]
350
+ never_seen: {median_pct: 1.57, mae_ff: 0.92, rmse_ff: 1.57}
351
+ ood60: {median_pct: 1.02, mae_ff: 0.35, rmse_ff: 0.66}
352
+ in_family_test: {median_pct: 0.23, mae_ff: 0.040, rmse_ff: 0.140}
353
+ deploy_heldout: {median_pct: 1.91, mae_ff: 0.484, rmse_ff: 1.022, set: "212 deploy held-out designs (deploy/MODEL_SELECTION.md)"}
354
+
355
+ message-passing-accurate:
356
+ title: "Message-passing network + accurate prior (v3-rich, R=3)"
357
+ repo_id: SQuADDS/2026PaperModels-message-passing-accurate
358
+ kind: gnn
359
+ prior: v3-rich
360
+ rounds: 3
361
+ status: available
362
+ fallback: message-passing-fine
363
+ checkpoints: [data_local/mega/v3/ALL_mom_s0.pt, data_local/mega/v3/ALL_mom_s1.pt, data_local/mega/v3/ALL_mom_s2.pt]
364
+ summary: "Five training families, accurate prior, three message-passing rounds. Best in family (0.18 % on the held-out test split)."
365
+ paper:
366
+ appears_in: [tab:candidates, tab:costacc, fig:costacc, tab:infamily-v3, fig:newtopo-all]
367
+ never_seen: {median_pct: 1.34, mae_ff: 0.60, rmse_ff: 1.07}
368
+ ood60: {median_pct: 1.22, mae_ff: 0.43, rmse_ff: 0.82}
369
+ in_family_test: {median_pct: 0.18, mae_ff: 0.031, rmse_ff: 0.100}
370
+ deploy_heldout: {median_pct: 2.11, mae_ff: 0.695, rmse_ff: 2.074, set: "212 deploy held-out designs (deploy/MODEL_SELECTION.md)"}
371
+
372
+ charge-corrected-prior-fast:
373
+ title: "Charge-corrected fast prior (v3c cell GBM)"
374
+ repo_id: SQuADDS/2026PaperModels-charge-corrected-prior-fast
375
+ kind: charge_prior
376
+ prior: v3
377
+ status: available
378
+ checkpoints: [deploy/artifacts/charge_gbm_v3c.joblib]
379
+ summary: "Fast (gap/3 v3) prior with its panel charges corrected by a gradient-boosted model of local geometry fit on the training families' surface charge; no capacitance labels."
380
+ paper:
381
+ appears_in: [tab:candidates]
382
+ never_seen: {median_pct: 2.67, mae_ff: 0.96, rmse_ff: 1.50}
383
+ ood60: {median_pct: 1.22, mae_ff: 0.43, rmse_ff: 0.75}
384
+ in_family_test: {median_pct: 0.87, mae_ff: 0.24, rmse_ff: 0.76}
385
+
386
+ blend-pair-local-fast:
387
+ title: "Blended model: pair-local fast-prior network x charge-corrected fast prior"
388
+ repo_id: SQuADDS/2026PaperModels-blend-pair-local-fast
389
+ kind: blend
390
+ components: [pair-local-fast, charge-corrected-prior-fast]
391
+ status: available
392
+ summary: "Log-space blend. Paper numbers use the published file-order weights (0.6 / 0.7 / 0.8); the package uses the order-invariant weights (0.6 / 0.9), see deploy_heldout."
393
+ paper:
394
+ appears_in: [tab:candidates]
395
+ never_seen: {median_pct: 1.28, mae_ff: 0.52, rmse_ff: 0.90, note: published file-order weights}
396
+ ood60: {median_pct: 0.98, mae_ff: 0.36, rmse_ff: 0.74, note: published file-order weights}
397
+ in_family_test: {median_pct: 0.35, mae_ff: 0.082, rmse_ff: 0.264}
398
+ deploy_heldout: {median_pct: 2.33, mae_ff: 0.547, rmse_ff: 1.097, ood60: "1.09 / 0.405 / 0.799", set: "212 deploy held-out designs, order-invariant weights"}
399
+
400
+ blend-pair-local-accurate:
401
+ title: "Blended model: pair-local accurate-prior network x charge-corrected fast prior"
402
+ repo_id: SQuADDS/2026PaperModels-blend-pair-local-accurate
403
+ kind: blend
404
+ components: [pair-local-accurate, charge-corrected-prior-fast]
405
+ status: available
406
+ summary: "Log-space blend. Paper numbers use the published file-order weights (0.6 / 0.7 / 0.8); the package uses the order-invariant weights (0.6 / 0.9), see deploy_heldout."
407
+ paper:
408
+ appears_in: [tab:candidates]
409
+ never_seen: {median_pct: 1.75, mae_ff: 0.87, rmse_ff: 1.48, note: published file-order weights}
410
+ ood60: {median_pct: 0.96, mae_ff: 0.31, rmse_ff: 0.54, note: published file-order weights}
411
+ in_family_test: {median_pct: 0.32, mae_ff: 0.081, rmse_ff: 0.266}
412
+ deploy_heldout: {median_pct: 2.02, mae_ff: 0.485, rmse_ff: 1.048, ood60: "1.11 / 0.329 / 0.594", set: "212 deploy held-out designs, order-invariant weights"}
413
+
414
+ fast-prior:
415
+ title: "Fast prior alone (v3, gap/3, training-free)"
416
+ repo_id: null
417
+ kind: prior
418
+ prior: v3
419
+ status: available
420
+ summary: "Untrained thin-film MoM on the conductor-anchored v3 mesh, one gap/3 solve (8,000 panels)."
421
+ paper:
422
+ appears_in: [tab:candidates, tab:prior]
423
+ never_seen: {median_pct: 5.68, mae_ff: 2.67, rmse_ff: 3.91}
424
+ ood60: {median_pct: 6.35, mae_ff: 1.66, rmse_ff: 2.56}
425
+ in_family_test: {median_pct: 4.38, mae_ff: 0.70, rmse_ff: 1.73}
426
+
427
+ accurate-prior:
428
+ title: "Accurate prior alone (v3-rich, Richardson, training-free)"
429
+ repo_id: null
430
+ kind: prior
431
+ prior: v3-rich
432
+ status: available
433
+ summary: "Untrained thin-film MoM, gap/3 and gap/6 solves on the v3 mesh with Richardson extrapolation."
434
+ paper:
435
+ appears_in: [tab:candidates, tab:prior]
436
+ never_seen: {median_pct: 2.71, mae_ff: 1.42, rmse_ff: 2.34}
437
+ ood60: {median_pct: 5.05, mae_ff: 1.30, rmse_ff: 2.08}
438
+ in_family_test: {median_pct: 2.71, mae_ff: 0.53, rmse_ff: 1.54}
439
+
440
  # ---------------------------------------------------------------- baselines (paper comparison; not deployable on a GDS)
441
  parameter-mlp:
442
  title: "Parameter MLP (published surrogate, MLQubitDesign)"
tlsq_infer/_vendor/mom.py CHANGED
@@ -12,6 +12,7 @@ import shapely
12
  from scipy.linalg import cho_factor, cho_solve
13
 
14
  EPS0_FF_PER_UM = 8.8541878128e-3
 
15
  SELF = 4 * np.log(1 + np.sqrt(2))
16
 
17
 
@@ -60,6 +61,7 @@ def mesh(metals: list, max_cells: int = 8000, cells_per_gap: float = 3.0, grade:
60
  size = max(bbox[2] - bbox[0], bbox[3] - bbox[1])
61
  gap = min(shapely.distance(metals[i], metals[j]) for i in range(len(metals)) for j in range(i + 1, len(metals)))
62
  h_min = max(gap / cells_per_gap, size / 4096)
 
63
  while True:
64
  c, h, o = quadtree_cells(metals, bbox, size / 16, h_min, grade)
65
  if len(c) <= max_cells:
@@ -99,4 +101,221 @@ def mom_solve(metals: list, eps_r: float = 11.45, max_cells: int = 8000, cells_p
99
  Q = cho_solve(cho_factor(P, lower=True, overwrite_a=True, check_finite=False), B, check_finite=False)
100
  del P
101
  C = np.stack([Q[o == a].sum(0) for a in range(len(metals))])
102
- return {"C": 0.5 * (C + C.T), "cen": c, "h": h, "own": o, "Q": Q, "n_cells": len(c), "h_min": h_min}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
12
  from scipy.linalg import cho_factor, cho_solve
13
 
14
  EPS0_FF_PER_UM = 8.8541878128e-3
15
+ MESH_INFO: dict = {} # last mesh: target h_min and smallest gap (reporting only; does not change any number)
16
  SELF = 4 * np.log(1 + np.sqrt(2))
17
 
18
 
 
61
  size = max(bbox[2] - bbox[0], bbox[3] - bbox[1])
62
  gap = min(shapely.distance(metals[i], metals[j]) for i in range(len(metals)) for j in range(i + 1, len(metals)))
63
  h_min = max(gap / cells_per_gap, size / 4096)
64
+ MESH_INFO.update(h_target=h_min, min_gap=gap)
65
  while True:
66
  c, h, o = quadtree_cells(metals, bbox, size / 16, h_min, grade)
67
  if len(c) <= max_cells:
 
101
  Q = cho_solve(cho_factor(P, lower=True, overwrite_a=True, check_finite=False), B, check_finite=False)
102
  del P
103
  C = np.stack([Q[o == a].sum(0) for a in range(len(metals))])
104
+ info = _mesh_report(h_min, max_cells)
105
+ return {"C": 0.5 * (C + C.T), "cen": c, "h": h, "own": o, "Q": Q, "n_cells": len(c), "h_min": h_min, "mesh": info}
106
+
107
+
108
+ def _mesh_report(h_min, max_cells, **extra):
109
+ ht, gap = MESH_INFO.get("h_target", h_min), MESH_INFO.get("min_gap", float("nan"))
110
+ return {"h_min_um": float(h_min), "h_min_target_um": float(ht), "min_gap_um": float(gap), "max_cells": int(max_cells),
111
+ "cells_per_min_gap": float(gap / h_min), "cap_hit": bool(h_min > ht * 1.0001), **extra}
112
+
113
+
114
+ # ---------------------------------------------------------------- v3 mesh (vendored from tlsq.embed.proxy, opt-in)
115
+ # Conductor-anchored lattice with exact edge panels (`anchored_cells`) and the panel solve; "v3-rich" adds Richardson
116
+ # extrapolation between gap/3 and gap/6. The v2 path above (`mesh`, `mom_solve`) is untouched.
117
+
118
+ def anchored_cells(metals: list, h_f: float, grade: float = 2.0, majority: bool = False):
119
+ """Same as tlsq.embed.proxy.anchored_cells. Returns centres (n, 2), panel sizes (n, 2), owner (n,)."""
120
+ for g in metals:
121
+ shapely.prepare(g)
122
+ edges = shapely.union_all([g.boundary for g in metals])
123
+ shapely.prepare(edges)
124
+ sig = metals[1:] if len(metals) > 1 else metals
125
+ ax, ay = shapely.union_all(sig).bounds[:2]
126
+ X0, Y0, X1, Y1 = shapely.union_all(metals).bounds
127
+ span = max(X1 - X0, Y1 - Y0)
128
+ K = max(0, int(np.ceil(np.log2(max(span / 16, h_f) / h_f))))
129
+ h0 = h_f * 2**K
130
+ ix0, iy0 = int(np.floor((X0 - ax) / h0)), int(np.floor((Y0 - ay) / h0))
131
+ ix1, iy1 = int(np.ceil((X1 - ax) / h0)), int(np.ceil((Y1 - ay) / h0))
132
+ gx, gy = np.meshgrid(ax + h0 * np.arange(ix0, ix1), ay + h0 * np.arange(iy0, iy1))
133
+ xs, ys, h = gx.ravel(), gy.ravel(), np.full(gx.size, h0)
134
+ out_c, out_h, out_o = [], [], []
135
+ while len(xs):
136
+ boxes = shapely.box(xs, ys, xs + h, ys + h)
137
+ cov = np.stack([shapely.area(shapely.intersection(boxes, g)) for g in metals]) / h**2
138
+ keep = cov.sum(0) > 1e-3
139
+ xs, ys, h, cov, boxes = xs[keep], ys[keep], h[keep], cov[:, keep], boxes[keep]
140
+ cx, cy = xs + h / 2, ys + h / 2
141
+ full = cov.max(0) > 0.999
142
+ last = h <= h_f * 1.0001
143
+ d = shapely.distance(boxes, edges)
144
+ leaf = full & (last | (h <= grade * d + 1e-12))
145
+ out_c.append(np.stack([cx[leaf], cy[leaf]], 1))
146
+ out_h.append(np.stack([h[leaf], h[leaf]], 1))
147
+ out_o.append(cov[:, leaf].argmax(0))
148
+ cut = last & ~leaf
149
+ if majority and cut.any(): # v2-style finest cells: whole square to the metal covering >= 50 % (no overlaps)
150
+ take = cut & (cov.max(0) >= 0.5)
151
+ out_c.append(np.stack([cx[take], cy[take]], 1))
152
+ out_h.append(np.stack([h[take], h[take]], 1))
153
+ out_o.append(cov[:, take].argmax(0))
154
+ cut = cut & False
155
+ if cut.any():
156
+ for k, g in enumerate(metals):
157
+ sel = np.nonzero(cut & (cov[k] > 1e-3))[0]
158
+ if not len(sel):
159
+ continue
160
+ pcs = shapely.intersection(boxes[sel], g)
161
+ bb = shapely.bounds(pcs)
162
+ cen = shapely.get_coordinates(shapely.centroid(pcs))
163
+ inside = shapely.contains_xy(g, cen[:, 0], cen[:, 1])
164
+ if not inside.all():
165
+ rp = shapely.get_coordinates(shapely.point_on_surface(pcs[~inside]))
166
+ cen[~inside] = rp
167
+ out_c.append(cen)
168
+ out_h.append(np.maximum(np.stack([bb[:, 2] - bb[:, 0], bb[:, 3] - bb[:, 1]], 1), 1e-6))
169
+ out_o.append(np.full(len(sel), k))
170
+ split = ~leaf & ~last
171
+ hs = h[split] / 2
172
+ xs = np.concatenate([xs[split], xs[split] + hs, xs[split], xs[split] + hs])
173
+ ys = np.concatenate([ys[split], ys[split], ys[split] + hs, ys[split] + hs])
174
+ h = np.concatenate([hs] * 4)
175
+ return np.concatenate(out_c), np.concatenate(out_h), np.concatenate(out_o)
176
+
177
+
178
+ def rect_self(a, b):
179
+ r = np.sqrt(a**2 + b**2)
180
+ return (2 * a * np.log((b + r) / a) + 2 * b * np.log((a + r) / b)) / (a * b)
181
+
182
+
183
+ def _G(x, y):
184
+ """Antiderivative of 1 / sqrt(x^2 + y^2) over x and y: x asinh(y / |x|) + y asinh(x / |y|) (0 on the axes)."""
185
+ ax, ay = np.abs(x), np.abs(y)
186
+ with np.errstate(divide="ignore", invalid="ignore"):
187
+ g1 = np.where(ax > 0, x * np.arcsinh(y / np.where(ax > 0, ax, 1.0)), 0.0)
188
+ g2 = np.where(ay > 0, y * np.arcsinh(x / np.where(ay > 0, ay, 1.0)), 0.0)
189
+ return g1 + g2
190
+
191
+
192
+ def rect_potential(p, cq, wh):
193
+ """Exact potential (x 4 pi eps) at points p (n, 2) of uniformly charged rectangles (unit total charge) centred at cq
194
+ with sizes wh (n, 2): (1 / (w h)) * integral of 1 / r over the rectangle. Equals rect_self at the centre."""
195
+ x1, x2 = cq[:, 0] - wh[:, 0] / 2 - p[:, 0], cq[:, 0] + wh[:, 0] / 2 - p[:, 0]
196
+ y1, y2 = cq[:, 1] - wh[:, 1] / 2 - p[:, 1], cq[:, 1] + wh[:, 1] / 2 - p[:, 1]
197
+ return (_G(x2, y2) - _G(x1, y2) - _G(x2, y1) + _G(x1, y1)) / (wh[:, 0] * wh[:, 1])
198
+
199
+
200
+ def _mesh_v3(metals: list, max_cells: int, cells_per_gap: float, grade: float = 2.0):
201
+ bbox = shapely.union_all(metals).bounds
202
+ size = max(bbox[2] - bbox[0], bbox[3] - bbox[1])
203
+ gap = min(shapely.distance(metals[i], metals[j]) for i in range(len(metals)) for j in range(i + 1, len(metals)))
204
+ h_min = max(gap / cells_per_gap, size / 4096)
205
+ MESH_INFO.update(h_target=h_min, min_gap=gap)
206
+ while True:
207
+ c, h, o = anchored_cells(metals, h_min, grade)
208
+ if len(c) <= max_cells:
209
+ return c, h, o, h_min
210
+ h_min *= 2.0
211
+
212
+
213
+ NONPD_FALLBACKS: list = [] # (n_cells, smallest pivot info) of solves that needed the exact near-field retry
214
+
215
+
216
+ def _solve_panels(c, wh, o, n_metals: int, eps_r: float):
217
+ """tlsq.embed.proxy.mom_solve (CPU path) for (width, height) panels; if the 3x3-quadrature system is not positive
218
+ definite, the solve is repeated with exact near-field entries (`_solve_panels_exact`). Solves that succeed are unchanged."""
219
+ try:
220
+ return _solve_panels_quad(c, wh, o, n_metals, eps_r)
221
+ except np.linalg.LinAlgError as e:
222
+ NONPD_FALLBACKS.append((len(c), str(e)))
223
+ return _solve_panels_exact(c, wh, o, n_metals, eps_r)
224
+
225
+
226
+ def _solve_panels_exact(c, wh, o, n_metals: int, eps_r: float):
227
+ """Panel solve with the exact potential of a uniformly charged rectangle (`rect_potential`) for every near pair
228
+ (d < 1.5 max side) instead of the 3x3 point average; far pairs 1 / d and self terms as in the quadrature solve."""
229
+ hm = wh.max(1)
230
+ d = np.sqrt(((c[:, None, :] - c[None, :, :]) ** 2).sum(-1))
231
+ np.fill_diagonal(d, 1.0)
232
+ P = 1.0 / d
233
+ near = d < 1.5 * np.maximum(hm[:, None], hm[None, :])
234
+ np.fill_diagonal(near, False)
235
+ ii, jj = np.nonzero(near)
236
+ del near, d
237
+ if len(ii):
238
+ P[ii, jj] = rect_potential(c[ii], c[jj], wh[jj])
239
+ P = 0.5 * (P + P.T)
240
+ np.fill_diagonal(P, rect_self(wh[:, 0], wh[:, 1]))
241
+ P /= 4 * np.pi * EPS0_FF_PER_UM * (eps_r + 1) / 2
242
+ B = (o[:, None] == np.arange(n_metals)[None, :]).astype(float)
243
+ return cho_solve(cho_factor(P, lower=True), B)
244
+
245
+
246
+ def _solve_panels_quad(c, wh, o, n_metals: int, eps_r: float):
247
+ """tlsq.embed.proxy.mom_solve (CPU path) for (width, height) panels: 3x3 point average for near pairs."""
248
+ hm = wh.max(1)
249
+ d = np.sqrt(((c[:, None, :] - c[None, :, :]) ** 2).sum(-1))
250
+ np.fill_diagonal(d, 1.0)
251
+ P = 1.0 / d
252
+ near = d < 1.5 * np.maximum(hm[:, None], hm[None, :])
253
+ np.fill_diagonal(near, False)
254
+ ii, jj = np.nonzero(near)
255
+ del near, d
256
+ if len(ii):
257
+ off = (np.arange(3) - 1) / 3
258
+ ox, oy = np.meshgrid(off, off)
259
+ sx = c[jj, 0, None] + ox.ravel()[None] * wh[jj, 0, None]
260
+ sy = c[jj, 1, None] + oy.ravel()[None] * wh[jj, 1, None]
261
+ r = np.sqrt((c[ii, 0, None] - sx) ** 2 + (c[ii, 1, None] - sy) ** 2)
262
+ P[ii, jj] = (1.0 / np.maximum(r, 1e-9)).mean(1)
263
+ P = 0.5 * (P + P.T)
264
+ np.fill_diagonal(P, rect_self(wh[:, 0], wh[:, 1]))
265
+ P /= 4 * np.pi * EPS0_FF_PER_UM * (eps_r + 1) / 2
266
+ B = (o[:, None] == np.arange(n_metals)[None, :]).astype(float)
267
+ return cho_solve(cho_factor(P, lower=True), B)
268
+
269
+
270
+ LAST_V3: dict = {} # cells of the last single v3 solve (centres, panel sizes, owners, charges) for the v3 charge correction
271
+
272
+
273
+ def _cap_v3(metals, eps_r, max_cells, cells_per_gap, grade=2.0):
274
+ c, wh, o, h_min = _mesh_v3(metals, max_cells, cells_per_gap, grade)
275
+ try:
276
+ Q = _solve_panels(c, wh, o, len(metals), eps_r) # 3x3 quadrature; exact near field if that is not positive definite
277
+ except np.linalg.LinAlgError as e: # coarse cut panels of different conductors overlap: whole finest cells by majority
278
+ NONPD_FALLBACKS.append((len(c), "majority cells: " + str(e)))
279
+ c, wh, o = anchored_cells(metals, h_min, grade, majority=True)
280
+ Q = _solve_panels_exact(c, wh, o, len(metals), eps_r)
281
+ C = np.stack([Q[o == a].sum(0) for a in range(len(metals))])
282
+ LAST_V3.update(cen=c, wh=wh, own=o, Q=Q)
283
+ return 0.5 * (C + C.T), len(c), h_min
284
+
285
+
286
+ def mom_solve_v3(metals: list, eps_r: float = 11.45, max_cells: int = 8000, cells_per_gap: float = 3.0, grade: float = 2.0,
287
+ rich: bool = False):
288
+ """v3 prior (tlsq.uge.proxies.CapacitanceMoM(mesh="v3" | "v3-rich")): dict(C, n_cells, h_min). No cell charges (the
289
+ charge correction always uses the v2 standard solve). rich: Richardson between gap/(2 cells_per_gap) with 2 max_cells
290
+ and gap/cells_per_gap with max_cells, as tlsq.embed.proxy.mom_capacitance_gds_rich."""
291
+ if not rich:
292
+ try:
293
+ C, n, h = _cap_v3(metals, eps_r, max_cells, cells_per_gap, grade)
294
+ return {"C": C, "n_cells": n, "h_min": h, "mesh": _mesh_report(h, max_cells), **LAST_V3}
295
+ except np.linalg.LinAlgError: # sliver edge panels can make the gap/3 system indefinite: gap/6 (as in training)
296
+ C, n, h = _cap_v3(metals, eps_r, 2 * max_cells, 2 * cells_per_gap, grade)
297
+ return {"C": C, "n_cells": n, "h_min": h, "mesh": {**_mesh_report(h, 2 * max_cells),
298
+ "note": "gap/3 system indefinite: solved at gap/6"}, **LAST_V3}
299
+ try:
300
+ Cf, nf, hf = _cap_v3(metals, eps_r, 2 * max_cells, 2 * cells_per_gap, grade)
301
+ except np.linalg.LinAlgError:
302
+ Cc, nc, hc = _cap_v3(metals, eps_r, max_cells, cells_per_gap, grade)
303
+ return {"C": Cc, "n_cells": nc, "h_min": hc, "mesh": {**_mesh_report(hc, max_cells), "extrapolated": False,
304
+ "note": "fine mesh not positive definite: coarse solve only"}}
305
+ fine = _mesh_report(hf, 2 * max_cells)
306
+ try:
307
+ Cc, nc, hc = _cap_v3(metals, eps_r, max_cells, cells_per_gap, grade)
308
+ except np.linalg.LinAlgError:
309
+ return {"C": Cf, "n_cells": nf, "h_min": hf, "mesh": {**fine, "extrapolated": False,
310
+ "note": "coarse mesh not positive definite: fine solve only"}}
311
+ r = hc / hf
312
+ C = Cf if r < 1.01 else Cf + (Cf - Cc) / (r - 1)
313
+ note = "" if r >= 1.01 else "cell cap forced both meshes to the same resolution: fine solve only, no extrapolation"
314
+ return {"C": C, "n_cells": nc + nf, "h_min": hf, "mesh": {**fine, "extrapolated": bool(r >= 1.01), "note": note}}
315
+
316
+
317
+ def solve_prior(metals: list, mesh: str = "v2", **kw):
318
+ """Dispatch: mesh "v2" -> mom_solve (published priors, unchanged), "v3" / "v3-rich" -> mom_solve_v3."""
319
+ if mesh == "v2":
320
+ return mom_solve(metals, **kw)
321
+ return mom_solve_v3(metals, rich=(mesh == "v3-rich"), **kw)
tlsq_infer/app_ui.py CHANGED
@@ -5,7 +5,7 @@ API endpoints (gradio_client, api_name):
5
  /prepare (gds, layers table, margin, ...) -> preview, warnings, summary, simplified GDS
6
  /predict (gds, layers table, margin, ..., substrate) -> matrix table, CSV, JSON, report
7
  /predict_gds (gds, ground "1/0", conductor "1/10", margin_gaps (0 auto, <0 no crop), substrate, eps, thickness_um, model,
8
- self_from_rows)
9
  -> result dict (one call, for scripts; see examples/client.py)
10
  """
11
 
@@ -150,7 +150,7 @@ def report_md(res: dict, reg) -> str:
150
  f"(1+eps)/(1+11.45) = {res['eps_correction_factor']:.4f}",
151
  "**Timing** " + ", ".join(f"{k.replace('_s', '')} {v:.2f} s" for k, v in res["timing_s"].items()),
152
  "",
153
- f"**Expected error.** On the 926 never-seen validation designs this model has median {v.get('median_pct')} % "
154
  f"(MAE {v.get('mae_ff')} fF, RMSE {v.get('rmse_ff')} fF) over all mutual capacitances."]
155
  if "expected_median_pct" in e:
156
  lines.append(f"For this layout and stack: expected median {e['expected_median_pct']:.2f} %, MAE ≈ {e['expected_mae_ff']:.2f} fF, "
@@ -230,8 +230,36 @@ def _model_md(reg, k):
230
  + (f" \nWeights: [{repo}](https://huggingface.co/{repo})" if repo else ""))
231
 
232
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
233
  def build_app(title: str, model_choices: list[str], default_model: str, header_md: str = "", examples_dir=None,
234
- extra_tab=None):
235
  import gradio as gr
236
 
237
  reg = load_registry()
@@ -280,9 +308,14 @@ def build_app(title: str, model_choices: list[str], default_model: str, header_m
280
  substrate = gr.Dropdown(subs, value=subs[0], label="substrate")
281
  custom_eps = gr.Number(value=11.45, label="custom eps_r (when 'custom')")
282
  thickness = gr.Number(value=350, label="substrate thickness (µm)")
283
- if not top_pick:
 
 
284
  model = gr.Dropdown(model_choices, value=default_model, label="model")
285
  self_rows = gr.Checkbox(False, label="self-capacitance from row sums")
 
 
 
286
  pred_btn = gr.Button("Predict", variant="primary")
287
  gr.Markdown("## 4. Maxwell capacitance matrix (fF)")
288
  with gr.Row():
 
5
  /prepare (gds, layers table, margin, ...) -> preview, warnings, summary, simplified GDS
6
  /predict (gds, layers table, margin, ..., substrate) -> matrix table, CSV, JSON, report
7
  /predict_gds (gds, ground "1/0", conductor "1/10", margin_gaps (0 auto, <0 no crop), substrate, eps, thickness_um, model,
8
+ self_from_rows); model = "fast" (default) / "accurate" or an explicit registry name
9
  -> result dict (one call, for scripts; see examples/client.py)
10
  """
11
 
 
150
  f"(1+eps)/(1+11.45) = {res['eps_correction_factor']:.4f}",
151
  "**Timing** " + ", ".join(f"{k.replace('_s', '')} {v:.2f} s" for k, v in res["timing_s"].items()),
152
  "",
153
+ f"**Expected error.** On {v.get('set', 'the 926 never-seen validation designs')} this model has median {v.get('median_pct')} % "
154
  f"(MAE {v.get('mae_ff')} fF, RMSE {v.get('rmse_ff')} fF) over all mutual capacitances."]
155
  if "expected_median_pct" in e:
156
  lines.append(f"For this layout and stack: expected median {e['expected_median_pct']:.2f} %, MAE ≈ {e['expected_mae_ff']:.2f} fF, "
 
230
  + (f" \nWeights: [{repo}](https://huggingface.co/{repo})" if repo else ""))
231
 
232
 
233
+ def tier_choices(reg) -> list[tuple[str, str]]:
234
+ """Flagship model choice: [("Fast (default, ~X s) ...", "fast"), ("Accurate (~Y s) ...", "accurate")] with the measured
235
+ latency and held-out accuracy from registry defaults.tiers; the accurate entry only when one is configured."""
236
+ d = reg["defaults"]
237
+ info = d.get("tiers", {})
238
+ out = []
239
+ for tier, key in (("fast", "flagship_model"), ("accurate", "flagship_accurate_model")):
240
+ name = d.get(key)
241
+ if not name:
242
+ continue
243
+ t = info.get(tier, {})
244
+ lat = f", ~{t['latency_s']:.0f} s" if t.get("latency_s") is not None else ""
245
+ acc = (f" — held-out median {t['median_pct']:.2f} %, MAE {t['mae_ff']:.2f} fF, RMSE {t['rmse_ff']:.2f} fF"
246
+ if t.get("median_pct") is not None else "")
247
+ label = ("Fast (default" + lat + ")" if tier == "fast" else "Accurate (" + lat.lstrip(", ") + ")") + acc
248
+ out.append((label.replace("()", ""), tier))
249
+ return out
250
+
251
+
252
+ def _tier_md(reg, tier):
253
+ from .predict import resolve_model
254
+
255
+ name = resolve_model(reg, tier)
256
+ t = reg["defaults"].get("tiers", {}).get(tier, {})
257
+ note = t.get("note", "")
258
+ return f"Model: **{reg.models[name]['title']}** (`{name}`). {note}"
259
+
260
+
261
  def build_app(title: str, model_choices: list[str], default_model: str, header_md: str = "", examples_dir=None,
262
+ extra_tab=None, tiers: bool = False):
263
  import gradio as gr
264
 
265
  reg = load_registry()
 
308
  substrate = gr.Dropdown(subs, value=subs[0], label="substrate")
309
  custom_eps = gr.Number(value=11.45, label="custom eps_r (when 'custom')")
310
  thickness = gr.Number(value=350, label="substrate thickness (µm)")
311
+ if tiers: # flagship: fast (default) / accurate choice instead of a model list
312
+ model = gr.Radio(tier_choices(reg), value="fast", label="model")
313
+ elif not top_pick:
314
  model = gr.Dropdown(model_choices, value=default_model, label="model")
315
  self_rows = gr.Checkbox(False, label="self-capacitance from row sums")
316
+ if tiers:
317
+ tier_info = gr.Markdown(_tier_md(reg, "fast"))
318
+ model.change(lambda k: _tier_md(reg, k), model, tier_info, api_visibility="private")
319
  pred_btn = gr.Button("Predict", variant="primary")
320
  gr.Markdown("## 4. Maxwell capacitance matrix (fF)")
321
  with gr.Row():
tlsq_infer/charge.py CHANGED
@@ -60,6 +60,36 @@ def corrected_matrix(gbm, metals: list, mom: dict) -> np.ndarray:
60
  return 0.5 * (C + C.T)
61
 
62
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
63
  def load_gbm(path):
64
  import joblib
65
 
 
60
  return 0.5 * (C + C.T)
61
 
62
 
63
+ def corrected_matrix_v3(gbm, metals: list, mom: dict) -> np.ndarray:
64
+ """Charge-corrected Maxwell matrix on the v3 gap/3 mesh (scripts/charge_v3.py: rectangular panels, log_h =
65
+ log sqrt(w h), density |q| / (w h), float64 charges). `mom` = a v3 solve with cell arrays (mom_solve_v3, rich=False)."""
66
+ import pandas as pd
67
+
68
+ cen, wh, own, Q = mom["cen"], mom["wh"], mom["own"], mom["Q"]
69
+ n = len(metals)
70
+ pts = shapely.points(cen)
71
+ d_own, d_other, other_id = np.zeros(len(cen)), np.full(len(cen), np.inf), np.full(len(cen), -1)
72
+ for k, g in enumerate(metals):
73
+ sel = own == k
74
+ d_own[sel] = shapely.distance(g.boundary, pts[sel])
75
+ for k2, g2 in enumerate(metals):
76
+ if k2 != k:
77
+ dk = shapely.distance(g2, pts[sel])
78
+ better = dk < d_other[sel]
79
+ ix = np.nonzero(sel)[0][better]
80
+ d_other[ix], other_id[ix] = dk[better], k2
81
+ area = wh[:, 0] * wh[:, 1]
82
+ lh = 0.5 * np.log(area)
83
+ base = {"owner_ground": (own == 0).astype(float), "other_is_ground": (other_id == 0).astype(float), "log_h": lh,
84
+ "log_d_own": np.log(d_own + 0.05), "log_d_other": np.log(d_other + 0.05), "log_h_over_d": lh - np.log(d_own + 0.05)}
85
+
86
+ def frame(j):
87
+ return pd.DataFrame({**base, "owner_driven": (own == j).astype(float), "other_is_driven": (other_id == j).astype(float),
88
+ "log_sig_mom": np.log(np.abs(Q[:, j]) / area + 1e-12)})[FEATS].astype(np.float32)
89
+ C = np.stack([np.bincount(own, weights=Q[:, j] * np.exp(gbm.predict(frame(j))), minlength=n) for j in range(n)], 1)
90
+ return 0.5 * (C + C.T)
91
+
92
+
93
  def load_gbm(path):
94
  import joblib
95
 
tlsq_infer/predict.py CHANGED
@@ -9,9 +9,9 @@ import numpy as np
9
 
10
  from . import __version__
11
  from ._vendor.graph import prior_dict, scene_graph
12
- from ._vendor.mom import mom_solve
13
  from ._vendor.scene import make_scene
14
- from .charge import corrected_matrix
15
  from .layout import PreparedLayout
16
  from .registry import PRIORS, get_component, load_registry
17
  from .stack_error import EPS_TRAIN, eps_factor, expected_error, lateral_extent, load_params
@@ -28,6 +28,21 @@ def _kind(a: str, b: str) -> str:
28
  return "signal-ground" if "G" in (a, b) else "signal-signal"
29
 
30
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
31
  def _logC(C: np.ndarray) -> np.ndarray:
32
  n = C.shape[0]
33
  out = np.zeros_like(C)
@@ -37,7 +52,23 @@ def _logC(C: np.ndarray) -> np.ndarray:
37
  return out
38
 
39
 
40
- def run_pipeline(metals: list, names: list[str], model: str, reg=None, model_dir=None, timing=None) -> tuple[np.ndarray, dict]:
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
41
  """Core: log|C| matrix (diag: log C_ii, off-diag: log -C_ij) on the training stack, in `metals` order (0 = ground)."""
42
  reg = reg or load_registry()
43
  m = reg.model(model)
@@ -52,9 +83,9 @@ def run_pipeline(metals: list, names: list[str], model: str, reg=None, model_dir
52
  mom = None
53
  if prior != "none":
54
  t = time.perf_counter()
55
- mom = mom_solve(metals, **PRIORS[prior])
56
  timing["prior_s"] = time.perf_counter() - t
57
- debug.update(mom_cells=int(mom["n_cells"]), h_min_um=float(mom["h_min"]), prior_matrix=mom["C"])
58
  if kind == "prior":
59
  return _logC(mom["C"]), debug
60
  out_gnn = out_corr = None
@@ -78,35 +109,48 @@ def run_pipeline(metals: list, names: list[str], model: str, reg=None, model_dir
78
  t = time.perf_counter()
79
  gbm = get_component(reg, cname, model_dir)
80
  timing["load_s"] = timing.get("load_s", 0.0) + time.perf_counter() - t
 
 
 
 
 
 
81
  t = time.perf_counter()
82
- out_corr = _logC(corrected_matrix(gbm, metals, mom))
83
  timing["charge_correction_s"] = time.perf_counter() - t
84
  if kind == "gnn":
85
  return out_gnn, debug
86
  if kind == "charge_prior":
87
  return out_corr, debug
88
- w = reg["blend"]["weights_gnn_side"]
89
  out = out_gnn.copy()
90
  for i in range(len(names)):
91
  for j in range(len(names)):
92
  if i != j:
93
- wk = w[_kind(names[i], names[j])]
94
  out[i, j] = wk * out_gnn[i, j] + (1 - wk) * out_corr[i, j]
95
  debug["gnn_logC"], debug["corr_logC"] = out_gnn, out_corr
96
  return out, debug
97
 
98
 
99
  def predict(prepared: PreparedLayout, model: str | None = None, substrate="Si (cryogenic, training)", thickness_um: float = 350.0,
100
- self_from_rows: bool = False, registry=None, model_dir=None, return_debug: bool = False) -> dict:
 
101
  """Maxwell capacitance matrix (fF) of a prepared layout.
102
 
103
- model: a deployable registry name (default: the flagship model). substrate: a registry substrate name or eps_r.
 
104
  The networks always see the training stack (Si 11.45, 350 µm); other permittivities are handled by the validated
105
  half-space factor (1 + eps) / (1 + 11.45), and thickness / material residuals are reported in `expected_error`.
106
  The ground self-capacitance is not predicted (it depends on the chip boundary, excluded from training): NaN.
 
 
 
 
 
107
  """
108
  reg = registry or load_registry()
109
- model = model or reg["defaults"]["flagship_model"]
110
  m = reg.model(model)
111
  if m.get("status") != "available" or m.get("kind") == "baseline":
112
  raise ValueError(f"model {model!r} is not deployable ({m.get('status')}); available: {reg.deployable()}")
@@ -116,14 +160,24 @@ def predict(prepared: PreparedLayout, model: str | None = None, substrate="Si (c
116
  n = prepared.n_conductors
117
  names = ["G"] + _internal_names(n)
118
  metals = [prepared.ground] + list(prepared.conductors)
119
- logC, debug = run_pipeline(metals, names, model, reg, model_dir, timing)
 
 
 
 
 
 
 
 
 
 
120
  k = len(metals)
121
  Cabs = np.exp(logC[:k, :k])
122
  M = -Cabs.copy()
123
  for i in range(k):
124
  M[i, i] = Cabs[i, i]
125
  if self_from_rows:
126
- e = float(reg["self_capacitance"]["row_sum_eps"])
127
  for i in range(1, k):
128
  M[i, i] = sum(Cabs[i, j] for j in range(k) if j != i) / (1 - e)
129
  M[0, 0] = np.nan
@@ -133,14 +187,17 @@ def predict(prepared: PreparedLayout, model: str | None = None, substrate="Si (c
133
  labels = ["G"] + list(prepared.names)
134
  iu = [(i, j) for i in range(k) for j in range(i + 1, k)]
135
  mut = np.array([abs(M[i, j]) for i, j in iu])
136
- base = m.get("paper", {}).get("never_seen")
137
- if base is None and m["kind"] == "blend":
138
- base = reg.model(m["components"][0])["paper"]["never_seen"]
 
139
  P = load_params()
140
  L = lateral_extent(prepared.conductors, P)
141
- exp_err = expected_error(P, eps, float(thickness_um), L, {kk: base[kk] for kk in ("median_pct", "mae_ff", "rmse_ff")},
142
  float(np.mean(mut)), float(np.sqrt(np.mean(mut**2))))
143
- exp_err["validation_sets"] = {s: m.get("paper", {}).get(s) for s in ("never_seen", "ood60") if m.get("paper", {}).get(s)}
 
 
144
  out = {"names": labels, "matrix_fF": [[None if np.isnan(v) else float(v) for v in row] for row in M], "units": "fF",
145
  "convention": "Maxwell matrix: diagonal = self-capacitance, off-diagonal = -mutual; row/column 0 = ground (its self term not predicted)",
146
  "self_capacitance": "row sums / (1 - eps_rs)" if self_from_rows else "network self term",
@@ -149,6 +206,23 @@ def predict(prepared: PreparedLayout, model: str | None = None, substrate="Si (c
149
  "eps_r": eps, "eps_correction_factor": f, "thickness_um": float(thickness_um),
150
  "training_stack": {"eps_r": EPS_TRAIN, "thickness_um": 350.0}, "timing_s": timing, "expected_error": exp_err,
151
  "warnings": list(prepared.warnings) + ([exp_err["warning"]] if exp_err.get("warning") else [])}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
152
  if m.get("warning"):
153
  out["warnings"].insert(0, m["warning"])
154
  if return_debug:
 
9
 
10
  from . import __version__
11
  from ._vendor.graph import prior_dict, scene_graph
12
+ from ._vendor.mom import solve_prior
13
  from ._vendor.scene import make_scene
14
+ from .charge import corrected_matrix, corrected_matrix_v3
15
  from .layout import PreparedLayout
16
  from .registry import PRIORS, get_component, load_registry
17
  from .stack_error import EPS_TRAIN, eps_factor, expected_error, lateral_extent, load_params
 
28
  return "signal-ground" if "G" in (a, b) else "signal-signal"
29
 
30
 
31
+ def _kind_invariant(a: str, b: str) -> str:
32
+ """Order-invariant entry kind (deploy/MODEL_SELECTION.md amendment 3): independent of the conductor file order."""
33
+ return "conductor-ground" if "G" in (a, b) else "conductor-conductor"
34
+
35
+
36
+ def blend_weights(reg, blend_kinds: str | None = None) -> tuple[dict, object]:
37
+ """(weights, kind function). blend_kinds: "invariant" (default when the registry provides invariant weights) or
38
+ "published" (file-order kinds of the paper; reproduction only)."""
39
+ b = reg["blend"]
40
+ mode = blend_kinds or b.get("kinds", "published")
41
+ if mode == "invariant":
42
+ return b["weights_gnn_side_invariant"], _kind_invariant
43
+ return b["weights_gnn_side"], _kind
44
+
45
+
46
  def _logC(C: np.ndarray) -> np.ndarray:
47
  n = C.shape[0]
48
  out = np.zeros_like(C)
 
52
  return out
53
 
54
 
55
+ TIER_KEYS = {"fast": "flagship_model", "accurate": "flagship_accurate_model"}
56
+
57
+
58
+ def resolve_model(reg, model: str | None) -> str:
59
+ """Model name from an explicit registry name or the tier aliases "fast" (default) / "accurate"."""
60
+ if not model or str(model).lower() == "fast":
61
+ return reg["defaults"]["flagship_model"]
62
+ if str(model).lower() == "accurate":
63
+ name = reg["defaults"].get("flagship_accurate_model")
64
+ if not name:
65
+ raise ValueError("no accurate-tier model is configured (defaults.flagship_accurate_model); use 'fast'")
66
+ return name
67
+ return model
68
+
69
+
70
+ def run_pipeline(metals: list, names: list[str], model: str, reg=None, model_dir=None, timing=None,
71
+ blend_kinds: str | None = None) -> tuple[np.ndarray, dict]:
72
  """Core: log|C| matrix (diag: log C_ii, off-diag: log -C_ij) on the training stack, in `metals` order (0 = ground)."""
73
  reg = reg or load_registry()
74
  m = reg.model(model)
 
83
  mom = None
84
  if prior != "none":
85
  t = time.perf_counter()
86
+ mom = solve_prior(metals, **PRIORS[prior])
87
  timing["prior_s"] = time.perf_counter() - t
88
+ debug.update(mom_cells=int(mom["n_cells"]), h_min_um=float(mom["h_min"]), prior_matrix=mom["C"], prior_mesh=mom.get("mesh", {}))
89
  if kind == "prior":
90
  return _logC(mom["C"]), debug
91
  out_gnn = out_corr = None
 
109
  t = time.perf_counter()
110
  gbm = get_component(reg, cname, model_dir)
111
  timing["load_s"] = timing.get("load_s", 0.0) + time.perf_counter() - t
112
+ cprior = reg.model(cname).get("prior", "standard") # the mesh the cell GBM was fit on
113
+ mom_c = mom
114
+ if prior != cprior:
115
+ t = time.perf_counter()
116
+ mom_c = solve_prior(metals, **PRIORS[cprior])
117
+ timing["charge_prior_s"] = time.perf_counter() - t
118
  t = time.perf_counter()
119
+ out_corr = _logC(corrected_matrix_v3(gbm, metals, mom_c) if cprior == "v3" else corrected_matrix(gbm, metals, mom_c))
120
  timing["charge_correction_s"] = time.perf_counter() - t
121
  if kind == "gnn":
122
  return out_gnn, debug
123
  if kind == "charge_prior":
124
  return out_corr, debug
125
+ w, kfun = blend_weights(reg, blend_kinds)
126
  out = out_gnn.copy()
127
  for i in range(len(names)):
128
  for j in range(len(names)):
129
  if i != j:
130
+ wk = w[kfun(names[i], names[j])]
131
  out[i, j] = wk * out_gnn[i, j] + (1 - wk) * out_corr[i, j]
132
  debug["gnn_logC"], debug["corr_logC"] = out_gnn, out_corr
133
  return out, debug
134
 
135
 
136
  def predict(prepared: PreparedLayout, model: str | None = None, substrate="Si (cryogenic, training)", thickness_um: float = 350.0,
137
+ self_from_rows: bool = False, registry=None, model_dir=None, return_debug: bool = False,
138
+ row_sum_eps: float | None = None, blend_kinds: str | None = None) -> dict:
139
  """Maxwell capacitance matrix (fF) of a prepared layout.
140
 
141
+ model: a deployable registry name, or the aliases "fast" (default: defaults.flagship_model) / "accurate"
142
+ (defaults.flagship_accurate_model). substrate: a registry substrate name or eps_r.
143
  The networks always see the training stack (Si 11.45, 350 µm); other permittivities are handled by the validated
144
  half-space factor (1 + eps) / (1 + 11.45), and thickness / material residuals are reported in `expected_error`.
145
  The ground self-capacitance is not predicted (it depends on the chip boundary, excluded from training): NaN.
146
+ self_from_rows: C_ii = sum_j |C_ij| / (1 - row_sum_eps); row_sum_eps defaults to the training median 0.0143 (the
147
+ never-seen components have a median of 0.0099, so the default overestimates C_ii by ~0.45 % there; deploy/LIMITS.md).
148
+ blend_kinds: "invariant" (conductor-conductor / conductor-ground, independent of polygon order) or "published"
149
+ (paper file-order kinds); default from registry blend.kinds. Mesh coarsening by the cell cap and a v3-rich prior
150
+ without extrapolation are reported in `prior_mesh`, `warnings` and `expected_error["mesh_warning"]`.
151
  """
152
  reg = registry or load_registry()
153
+ model = resolve_model(reg, model)
154
  m = reg.model(model)
155
  if m.get("status") != "available" or m.get("kind") == "baseline":
156
  raise ValueError(f"model {model!r} is not deployable ({m.get('status')}); available: {reg.deployable()}")
 
160
  n = prepared.n_conductors
161
  names = ["G"] + _internal_names(n)
162
  metals = [prepared.ground] + list(prepared.conductors)
163
+ fallback_note = None
164
+ try:
165
+ logC, debug = run_pipeline(metals, names, model, reg, model_dir, timing, blend_kinds)
166
+ except np.linalg.LinAlgError as e: # v3 MoM system not positive definite at gap/3 and gap/6 (e.g. long fine combs)
167
+ fb = m.get("fallback")
168
+ if not fb:
169
+ raise
170
+ fallback_note = (f"the {m.get('prior')} MoM prior of {model!r} failed on this layout ({e}); predicted with the fallback "
171
+ f"model {fb!r} ({reg.model(fb).get('title')}) instead")
172
+ timing.clear()
173
+ logC, debug = run_pipeline(metals, names, fb, reg, model_dir, timing, blend_kinds)
174
  k = len(metals)
175
  Cabs = np.exp(logC[:k, :k])
176
  M = -Cabs.copy()
177
  for i in range(k):
178
  M[i, i] = Cabs[i, i]
179
  if self_from_rows:
180
+ e = float(reg["self_capacitance"]["row_sum_eps"] if row_sum_eps is None else row_sum_eps)
181
  for i in range(1, k):
182
  M[i, i] = sum(Cabs[i, j] for j in range(k) if j != i) / (1 - e)
183
  M[0, 0] = np.nan
 
187
  labels = ["G"] + list(prepared.names)
188
  iu = [(i, j) for i in range(k) for j in range(i + 1, k)]
189
  mut = np.array([abs(M[i, j]) for i, j in iu])
190
+ mu = reg.model(out_model) if (out_model := (m.get("fallback") if fallback_note else model)) != model else m
191
+ base = mu.get("validation") or mu.get("paper", {}).get("never_seen") # deploy held-out sets for models trained on all data
192
+ if base is None and mu["kind"] == "blend":
193
+ base = reg.model(mu["components"][0]).get("validation") or reg.model(mu["components"][0])["paper"]["never_seen"]
194
  P = load_params()
195
  L = lateral_extent(prepared.conductors, P)
196
+ exp_err = expected_error(P, eps, float(thickness_um), L, {kk: base[kk] for kk in ("median_pct", "mae_ff", "rmse_ff", "set") if kk in base},
197
  float(np.mean(mut)), float(np.sqrt(np.mean(mut**2))))
198
+ exp_err["validation_sets"] = {s: mu.get("paper", {}).get(s) for s in ("never_seen", "ood60") if mu.get("paper", {}).get(s)}
199
+ if mu.get("validation"):
200
+ exp_err["validation_sets"]["deploy_heldout"] = mu["validation"]
201
  out = {"names": labels, "matrix_fF": [[None if np.isnan(v) else float(v) for v in row] for row in M], "units": "fF",
202
  "convention": "Maxwell matrix: diagonal = self-capacitance, off-diagonal = -mutual; row/column 0 = ground (its self term not predicted)",
203
  "self_capacitance": "row sums / (1 - eps_rs)" if self_from_rows else "network self term",
 
206
  "eps_r": eps, "eps_correction_factor": f, "thickness_um": float(thickness_um),
207
  "training_stack": {"eps_r": EPS_TRAIN, "thickness_um": 350.0}, "timing_s": timing, "expected_error": exp_err,
208
  "warnings": list(prepared.warnings) + ([exp_err["warning"]] if exp_err.get("warning") else [])}
209
+ mesh = debug.get("prior_mesh") or {}
210
+ if mesh:
211
+ out["prior_mesh"] = mesh
212
+ msg = []
213
+ if mesh.get("cap_hit"):
214
+ msg.append(f"MoM prior mesh coarsened by the cell cap ({mesh['max_cells']} cells): h_min {mesh['h_min_um']:.3g} µm vs "
215
+ f"target {mesh['h_min_target_um']:.3g} µm ({mesh['cells_per_min_gap']:.2f} cells across the smallest gap "
216
+ f"{mesh['min_gap_um']:.3g} µm); expect a larger prior error than on the validation sets")
217
+ if mesh.get("extrapolated") is False:
218
+ msg.append("v3-rich prior not extrapolated (" + (mesh.get("note") or "fine solve only") + ")")
219
+ out["warnings"] += msg
220
+ exp_err["mesh_warning"] = "; ".join(msg) if msg else None
221
+ if self_from_rows:
222
+ out["row_sum_eps"] = float(reg["self_capacitance"]["row_sum_eps"] if row_sum_eps is None else row_sum_eps)
223
+ if fallback_note:
224
+ out["model_used"] = m["fallback"]
225
+ out["warnings"].insert(0, fallback_note)
226
  if m.get("warning"):
227
  out["warnings"].insert(0, m["warning"])
228
  if return_debug:
tlsq_infer/registry.py CHANGED
@@ -12,7 +12,8 @@ import numpy as np
12
  import yaml
13
 
14
  GNN_KINDS = {"gnn"}
15
- PRIORS = {"standard": dict(max_cells=8000, cells_per_gap=3.0), "fine": dict(max_cells=16000, cells_per_gap=6.0)}
 
16
 
17
 
18
  def find_registry(path=None) -> Path:
 
12
  import yaml
13
 
14
  GNN_KINDS = {"gnn"}
15
+ PRIORS = {"standard": dict(max_cells=8000, cells_per_gap=3.0), "fine": dict(max_cells=16000, cells_per_gap=6.0),
16
+ "v3": dict(mesh="v3", max_cells=8000, cells_per_gap=3.0), "v3-rich": dict(mesh="v3-rich", max_cells=8000, cells_per_gap=3.0)}
17
 
18
 
19
  def find_registry(path=None) -> Path: