Loading files
This file is pinned to the selected release. Download the original to open it in your design tool.
#!/usr/bin/env python3
"""Fetch set3monster .kicad_pcb sources listed in manifest_set3monster.json (raw download).
set3monster is the "extreme / intractable" monster batch: boards whose
size or stackup puts a single route step near (or past) the RUNBOOK 3h/command
cap. lora_cubesat_cm (485 nets / 6 layers) was moved here out of set11 for
exactly that reason. The rest are 8-14 copper layer Antmicro boards -- the
first >8-layer boards in the corpus, admitted once validate_candidate.py's
upper layer bound was removed in favour of the `monster` tier.
smartprint_h7x (BoltzRnD/SmartPrintCoreH7x) joined 2026-09-13 from the
awesome-kicad-projects mining pass. It is monster by PART COUNT, not
stackup -- 567 footprints and 383 routable nets on TWO layers, 170x97mm --
so it lands here for lora_cubesat_cm's reason rather than the Antmicro
boards'. classify() puts any board at fps >= 500 in this tier regardless of
layer count, and with no inner layers every net competes for the same two
planes (the human routing spent 1506 vias).
Downloads each board and its sibling project files -- the .kicad_pro (DRC floor,
#441) and the .kicad_dru (per-layer clearance rules, #498) --
into $STRESS_DIR/sources/github_set3monster/. After fetching, run `bash prep_set3monster.sh`
(needs KiCad's bundled python / pcbnew) to produce boards_set3monster/ (routed
reference) + boards_unrouted_set3monster/ (stripped).
python3 fetch_set3monster.py
bash prep_set3monster.sh
Auto-generated by assemble_corpus.py.
"""
import json
import os
import shutil
import subprocess
import sys
import tempfile
import zipfile
from pathlib import Path
HERE = Path(__file__).resolve().parent
STRESS = Path(os.environ.get("STRESS_DIR", str(Path.home() / "Documents/kicad_stress_test")))
MANIFEST = HERE / "manifest_set3monster.json"
def fetch_archive(b, dest):
"""Board shipped as a .zip (e.g. attached to a GitHub issue) rather than a
raw .kicad_pcb URL. Download the archive, extract `archive_member` as the
board, and take its siblings from the SAME directory inside the archive --
the .kicad_pro (DRC floor, #441) and .kicad_dru (per-layer clearance, #498)
travel with it. Returns True on success.
"""
with tempfile.TemporaryDirectory() as td:
zp = Path(td) / "src.zip"
r = subprocess.run(["curl", "-sL", "--fail", b["archive_url"], "-o", str(zp)],
capture_output=True)
if r.returncode != 0 or not zp.exists() or zp.stat().st_size == 0:
return False
try:
with zipfile.ZipFile(zp) as z:
z.extractall(Path(td) / "x")
except zipfile.BadZipFile:
return False
member = Path(td) / "x" / b["archive_member"]
if not member.exists():
return False
shutil.copy(member, dest)
for ext in (".kicad_pro", ".kicad_dru"):
sib = member.with_suffix(ext)
if sib.exists():
shutil.copy(sib, dest.with_suffix(ext))
return True
def main():
boards = json.loads(MANIFEST.read_text())
out_dir = STRESS / "sources/github_set3monster"
out_dir.mkdir(parents=True, exist_ok=True)
ok = 0
for b in boards:
dest = out_dir / Path(b["file"]).name
if b.get("archive_url"):
if fetch_archive(b, dest):
ok += 1
print(f" OK {b['repo']:42} {dest.stat().st_size // 1024}KB "
f"[{b.get('tier','?')}] (archive)")
else:
print(f" FAIL {b['repo']} <- {b['archive_url']}")
continue
r = subprocess.run(["curl", "-sL", "--fail", b["raw_url"], "-o", str(dest)],
capture_output=True)
if r.returncode != 0 or not dest.exists() or dest.stat().st_size == 0:
print(f" FAIL {b['repo']} <- {b['raw_url']}")
continue
# siblings: never drop them. Without the .kicad_pro a board resolves its
# DRC floor from the STOCK netclass (#441); without the .kicad_dru every
# routing step and check_drc lose the per-layer/conditioned clearance
# rules that OUTRANK --clearance (#498). A 404 under --fail can still
# leave a zero-byte file, which reads as "rules present, none" -- drop it.
for ext in (".kicad_pro", ".kicad_dru"):
sib = dest.with_suffix(ext)
subprocess.run(["curl", "-sL", "--fail",
b["raw_url"][: -len(".kicad_pcb")] + ext,
"-o", str(sib)], capture_output=True)
if sib.exists() and sib.stat().st_size == 0:
sib.unlink()
ok += 1
print(f" OK {b['repo']:42} {dest.stat().st_size // 1024}KB [{b.get('tier','?')}]")
print(f"\n{ok}/{len(boards)} set3monster sources -> {out_dir}")
return 0 if ok == len(boards) else 1
if __name__ == "__main__":
sys.exit(main())
8b2a3278aThis file is pinned to the selected release. Download the original to open it in your design tool.