mimcap: build with extensions again - #113
Conversation
`mimcap()` raises with its default arguments, on both options:
File "src/glayout/primitives/mimcap.py", line 293, in mimcap
appendix_pos[cord_ref] = appendix_pos[cord_ref] + ...
TypeError: 'tuple' object does not support item assignment
`Port.center` is a tuple, and the line below indexes into it to shift the
appendix. Take a list.
The branch is only reached when `min_via_distance < 0.4`, so it depends on
the requested size -- 5x5 hits it. No CI cell caught this because every
tested cell goes through `mimcap_array`, which passes `with_extension=False`
and skips the path. A direct `mimcap(pdk, size)` -- the obvious way to use
the primitive -- fails.
Verified on gf180: option A, option B, a non-square 10x4, and mimcap_array
all build and write GDS. Option A draws met2/FuseTop/via2/met3, option B
met4/FuseTop/via4/met5.
|
Hi @carloscl03 Thanks for catching this up. It is a bit strange as I remember tested the simple version of mimcap and it built without raising any issue. Let me check again. Can you please, add as part of the PR, an additional check for the individual mimcap? Thanks, |
Every cell in the suite reaches mimcap through mimcap_array, which passes `with_extension=False` and skips the branch that regressed. So the suite stayed green while a direct `mimcap(pdk, size)` raised -- and anyone checking the primitive by hand through the array saw it build fine. Four cases: the default path with extensions, the array path, the no-extension path kept so a fix that trades one branch for the other does not read as a pass, and a check that each option draws the stack it names (A on met2/met3, B on met4/met5) rather than merely building. Against `main` this fails 6 of them with the TypeError; with the fix, 4 tests and 8 subtests pass.
|
Thanks Luighi — added Your recollection is right, and it is exactly why this went unnoticed. There is a second condition worth knowing: the appendix branch is only entered when the requested size leaves The test covers four things:
Verified it discriminates: against |
|
One more data point on this, from measuring the notebook CI on the fork. The bug here is not confined to a direct That matters because the notebooks job is currently the reason six of the eight open PRs show red: Measured on this fork's CI, same container and runners: gdsfactory baseline · gdstk. Full table in #116. The test added earlier still discriminates: 6 failures against |
Two notebooks sit on the 180s per-cell limit and cross it depending on
which runner the job lands on, so the check passes or fails on identical
content. `lvs-pin-filter` has four green runs and two red ones.
GLayout_Cells 290s pass (#112) / 372s error (#113)
glayout_opamp 136s pass (#112) / 198s error (#113)
The native backend builds these cells several times faster, which moves
them off the limit instead of raising it. Measured on this fork's CI --
same container, same runners -- with #102, #104 and #113 applied on both
sides, the only difference being this line:
gdsfactory gdstk
GLayout_Cells 187.8s ERROR 14.2s pass
glayout_opamp 126.4s pass 19.2s pass
5T_OTA_part2 90.8s pass 16.2s pass
test_bjt_custom_pattern 68.2s pass 11.4s pass
whole suite 660s 13/14 158s 14/14
Note the baseline already carries all three PRs and still fails: they are
what lets the notebooks run on gdstk at all, not what fixes the timeouts.
Depends on #102, #104 and #113. Without #113 `GLayout_Cells` raises in
`mimcap.py`; without #102 it raises in `Component.add`; without #104's
`add_ref(columns=)` the BJT notebook raises. This check stays red until
all three land.
mimcap()raises with its default arguments, on both options:Port.centeris a tuple and the line below indexes into it to shift theappendix. Take a list.
The branch is only reached when
min_via_distance < 0.4, so whether it firesdepends on the requested size — 5x5 hits it. No CI cell caught this because
every tested cell goes through
mimcap_array, which passeswith_extension=Falseand skips the path entirely. A directmimcap(pdk, size)— the obvious way to use the primitive — fails.Verified on gf180 with the gdstk backend:
mimcap(pdk, (5,5), option="A")mimcap(pdk, (5,5), option="B")mimcap(pdk, (10,4), option="B")mimcap_array(pdk, 2, 2, (5,5))Layers written are as expected for each option — A: met2 / FuseTop / via2 /
met3; B: met4 / FuseTop / via4 / met5.