Repository navigation
test(gen): pin res_array hidden-param contract for internal geometry knobs - #6881
Conversation
…knobs Extend tests/test_gen_hidden_params.py's shared case table with res_array's internal geometry knobs (res_contact_space_um, res_head_len_um, res_poly_heads_only) and add a list_generators() test over the same table, so a declaration that loses hidden=True fails both the listing and the unknown-param checks on first run instead of relying on manual review (the PR #6356 res_head_len_um leak). Also point the res_flavor_{i}_head_enclosure_um comment at gen_res_head, where #6356 moved _res_flavor_mask_box_um. Closes #6872
|
PR #6881's |
|
✅ Approved! A two-file, 36-line change that pins a contract which was previously held only by manual review. Reviewed at head Spec reconciliationReviewed against #6872's current body and trusted comments, not the PR's account of them. No material differences: scope (two files), both acceptance criteria, Affected Files and Out of Scope are unchanged since the Champion promotion at Acceptance criteria — independently verifiedAC1 —
But a green pinning test proves only that the contract holds today — it does not prove the test would notice if it stopped holding. That is the whole point of this PR, so I falsified it myself rather than taking the PR's word for it. Deleting Exactly two failures, both for the mutated name, each for the correct and distinct reason — the validator stops rejecting it, and I also mutated a second declaration, because the three new names do not all go through the same code: AC2 — the comment points to the landed location of Measured, not assumed: TDD claimThe PR's Test plan execution
Review notes
Gates
|
|
PR #6881's |
|
Champion: merging. Judge-approved at current head Automated by Champion role |
Summary
res_array's internal geometry knobs (res_contact_space_um,res_head_len_um,res_poly_heads_only) were not covered by the hidden-parameter regression tests, so a droppedhidden=True— exactly what happened tores_head_len_umin PR #6356's merge — would not fail any test. This PR pins the contract per name and fixes the stale helper cross-reference #6356's module split left behind.Changes
tests/test_gen_hidden_params.py— extract the parametrize table into a shared_HIDDEN_PARAM_CASESlist; add the threeres_arraynames (Friction: gf180mcu res_array ppolyf_u cell violates the PDK runset's salicide-block rules SB.4 and SB.10 #3000, klt gen res_array (sky130 high/xhigh): end heads do not meet Magic's 2.16um xpc extension (licon.1c + li.5), so drc(full) is not clean #5704, decks/sg13g2: poly-resistor body/marker are inverted vs the PDK's own PCell convention, so no drawn rsil/rppd/rhigh is ever recognized #2679); addtest_hidden_declaration_omitted_from_gen_listover the same table assertinglist_generators()(used byklt gen --list) omits each name; strengthen the request test'sGenErrormatch to require the supplied name (per the acceptance criteria).src/klayout_tools/gen_pcells/res_array.py— update the comment besideres_flavor_{i}_head_enclosure_umfromgen._res_flavor_mask_box_umtogen_res_head._res_flavor_mask_box_um(where fix(gen): draw sky130 high/xhigh res_array end heads 2.16um to meet licon.1c + li.5 #6356 moved it).Acceptance Criteria Verification
list_generators()omits each name; request raisesGenErrorwithunknown paramsand the name — verified:test_hidden_declaration_omitted_from_gen_list[res_array-res_contact_space_um|res_head_len_um|res_poly_heads_only]andtest_hidden_declaration_rejected_as_unknown_param[...](match regex now requires\b{name}\b) all pass:uv run pytest -q tests/test_gen_hidden_params.py→ 14 passed._res_flavor_mask_box_um— verified: it now readsgen_res_head._res_flavor_mask_box_um;grep -rn "gen\._res_flavor_mask_box_um" src/ tests/ docs/finds nothing.Test Plan
uv run pytest -q tests/test_gen_hidden_params.py→ 14 passed (7 cases × 2 paths).hidden=Truefrom theres_head_len_umdeclaration and re-ran — exactly the twores_head_len_umtests failed (listing advertised the name; request validation no longer rejected it); restored the flag and all 14 pass again.uv run ruff format --check+uv run ruff checkon both changed files — clean.TDD:regression-pinning test: written first, confirmed green against the intact declarations, then confirmed red for the right reason by deletinghidden=Truefromres_head_len_um(both the listing and the unknown-param checks fail), then restored to green.Closes #6872
loom dashboard