{
  "url": "https://github.com/0xSufi/fieldforge",
  "title": "GitHub - 0xSufi/fieldforge: Open-source, GPU-first EM simulation + automated meshing for KiCad",
  "siteName": "GitHub",
  "leadImage": "https://github.com/0xSufi/fieldforge/raw/master/docs/images/bridge3090_pair_sdd.png",
  "wordCount": 704,
  "readingTimeMinutes": 3,
  "cacheStatus": "HIT",
  "markdown": "# GitHub - 0xSufi/fieldforge: Open-source, GPU-first EM simulation + automated meshing for KiCad\n\nOpen-source, GPU-first EM simulation + automated meshing for KiCad (1–50 GHz PCB SI).\n\nSelect a net or differential pair in KiCad → exact geometry + stackup extracted over the IPC API → auto-meshed openEMS / Palace model → Touchstone S-parameters plotted back in the plugin. No Gerber round-trip, no manual meshing.\n\n**Status: board extraction, automated meshing, GPU FDTD and shielded-MoM S-parameter production are working end to end, including mixed-mode pairs and via-transition sweeps through 50 GHz.**\n\nShipped so far (each with tests + a committed validation report):\n\n-   Headless KiCad 9 IPC extraction (nets → layered polygons + vias + stackup), verified on Antmicro Jetson Orin (8L), HackRF One, Castor & Pollux, StickHub — three .kicad\\_pcb format generations through one code path.\n-   Auto graded grid (1/3–2/3 edge snapping, smoothness ≤ 1.5) + openEMS backend: **microstrip Z0 −1.74% / stripline +1.21% vs analytic** (2 % gates, zero manual mesh edits) — `validation/reports/p04_z0_gates.*`.\n-   gerber2ems head-to-head on identical coupons: **diff pair |ΔSDD21| p95 0.32 dB, |ΔSDD11| 2.34 dB (0.2–6 GHz, gates 0.5/3 dB) — PASS**; reference-tool passivity limits documented above 12 GHz — `validation/reports/p05_crosscheck.*`.\n-   Palace/Gmsh emitter (prism extrusion, SIBC tags, lumped ports) — solve queued for the lab server (`docs/server-runbook.md`).\n-   PyQt6 plugin: net picker → extract → simulate → S-param panel, with automatic net-region cutout meshing.\n-   CUDA Yee kernels (sm\\_61 + sm\\_86) with exact-advection gates, plus the `ff_yee3d_*` physics-module ABI described below. Via-transition validation reaches 50 GHz (`validation/reports/p40_fdtd_via.json`).\n-   Shielded-MoM production path (`mom`): board or cached geometry in, dense GPU solve where available, adaptive band synthesis, Touchstone output, and honest linear-point fallback when a rational fit is not passive or cannot converge. Coupled pairs produce mixed-mode SDD/SCC files (`--diff`), with passivity and reciprocity recorded in the report (`docs/product_loop.md`).\n\n## SI plots\n\nMixed-mode SDD parameters and the corresponding Smith chart for a real bridge3090 differential pair (12 solved points, 0.2–6 GHz):\n\n[![Mixed-mode SDD parameters and Smith chart for a bridge3090 differential pair](https://github.com/0xSufi/fieldforge/raw/master/docs/images/bridge3090_pair_sdd.png)](https://github.com/0xSufi/fieldforge/blob/master/docs/images/bridge3090_pair_sdd.png)\n\nThe same SDD loci projected onto the Riemann hemisphere:\n\n[![Bridge3090 SDD loci on the Riemann hemisphere](https://github.com/0xSufi/fieldforge/raw/master/docs/images/bridge3090_pair_sdd_sphere.png)](https://github.com/0xSufi/fieldforge/blob/master/docs/images/bridge3090_pair_sdd_sphere.png)\n\nAn |S(i,j)| heatmap for the NVCLK1\\_P four-port network at 2 GHz:\n\n[![NVCLK1_P four-port S-matrix heatmap at 2 GHz](https://github.com/0xSufi/fieldforge/raw/master/docs/images/bridge3090_nvclk1_heatmap.png)](https://github.com/0xSufi/fieldforge/blob/master/docs/images/bridge3090_nvclk1_heatmap.png)\n\nGenerate these views with `mom.plot`: `--mm` for mixed-mode labels and `--sphere` for the hemisphere projection. The solver also writes the underlying Touchstone and JSON reports, so every figure remains machine-checkable.\n\nQuick start (dev box):\n\n```\n./ci/run_ci.sh all                # unit + KiCad + solver + CUDA tiers\npython -m fieldforge_gui.app --board <your.kicad_pcb>   # from kicad-plugin/\n```\n\nShielded-MoM product loop — one command to S-parameters:\n\n```\npython -m mom board.kicad_pcb --nets NET_P,NET_N --band 0.5:4\npython -m mom geoms.pkl --name jetson_can --band 0.5:4 --loss --thick\npython -m mom pair.pkl --name pair --diff NET_P,NET_N   # mixed-mode SDD/SCC\npython -m mom.plot out/pair_mm.s4p --mm --sphere        # Smith charts\n```\n\nWrites `<name>.sNp` + `<name>.report.json` (and `<name>_mm.sNp` with `--diff`); adaptive band synthesis solves ~8–12 points for a full band and falls back to honest point solves when the fit can't be trusted (`band_mode` in the report); GPU auto-detected. Details: [`docs/product_loop.md`](https://github.com/0xSufi/fieldforge/blob/master/docs/product_loop.md).\n\n## Next milestones\n\n-   Close the unattended convergence loop across the public mesh gauntlet.\n-   Complete open-media MoM and SI-aware routing integrations.\n-   Correlate additional coupon measurements above 6 GHz against the solvers.\n\n## Layout\n\n```\ncore/            C++20 + CUDA: ffdtd kernels (P1+), C ABI          [Apache-2.0]\npyff/            geometry model, extractors, emitters, drivers     [Apache-2.0]\nkicad-plugin/    IPC-API client + PyQt6 panel                      [GPL-3.0-or-later]\nvalidation/      benchmark defs, golden data, report generator\ndocs/            licenses audit, design notes\ntests/           pytest suite (V0 analytic gates run in CI)\n```\n\n## Credits\n\n-   IPC-API board-access patterns adapted from [OrthoRoute](https://github.com/bbenchoff/OrthoRoute) (MIT, © 2025 bbenchoff).\n-   Cross-validation baseline: [gerber2ems](https://github.com/antmicro/gerber2ems) (Apache-2.0, Antmicro).\n-   Solvers integrated, not reinvented: [openEMS](https://openems.de/) (GPL-3), [Palace](https://github.com/awslabs/palace) (Apache-2.0), Gmsh, scikit-rf.\n\n## License\n\nApache-2.0 for `core/` and `pyff/`; GPL-3.0-or-later for `kicad-plugin/`; see `docs/licenses.md` for the full dependency audit.\n\n## Solver module ABIs (composition contract)\n\nThe naive Yee engine (`ff_yee3d_*`) is the spine; physics modules compose around the public step call — no engine-internal coupling:\n\n```\nper step:  ff_debye_pre(dctx)                # E^n snapshot (trap ADE)\n           ff_yee3d_step(ctx, 1, ...)        # H, CPML, E, CPML, source\n           ff_debye_post(dctx)               # dispersion correction\n           ff_sibc2_apply(damp)              # per-face conductor damping\n           ff_sibc_apply(pin)                # thin-sheet E_t (v2 hybrid)\n           ff_ports_*(pctx)                  # V/I gather + on-device DFT\n```\n\n-   Accessors for sibling modules: `ff_yee3d_get_fields / _get_meta / _get_spacing_tables / _get_material_map` (additive-only ABI).\n-   `ff_march3d_*`: fused z-march throughput engine (ping-pong buffers; no CPML/ports yet — capacity/speed path, bit-compatible physics).\n-   CPML profiles: `pyff.cpml` (physical-distance grading) is canonical; `ffdtd_driver.cpml_tables` is deprecated on graded axes.\n-   Field dumps/viewer: `pyff.fielddump` + `python -m pyff.ffview`.\n-   Measurement instruments: two-probe gated transmission (`pyff.msl_sibc`, ±25% window systematics — documented) and the sealed-box resonator-Q (`pyff.resonator_q`, window-immune).\n\nReports index: `validation/reports/p1*_*.json` — every number regenerable by the matching `validation/gen_*.py`.",
  "html": "<h1>GitHub - 0xSufi/fieldforge: Open-source, GPU-first EM simulation + automated meshing for KiCad</h1>\n<p>Open-source, GPU-first EM simulation + automated meshing for KiCad (1–50 GHz PCB SI).</p>\n<p>Select a net or differential pair in KiCad → exact geometry + stackup extracted over the IPC API → auto-meshed openEMS / Palace model → Touchstone S-parameters plotted back in the plugin. No Gerber round-trip, no manual meshing.</p>\n<p><strong>Status: board extraction, automated meshing, GPU FDTD and shielded-MoM S-parameter production are working end to end, including mixed-mode pairs and via-transition sweeps through 50 GHz.</strong></p>\n<p>Shipped so far (each with tests + a committed validation report):</p>\n<ul>\n<li>Headless KiCad 9 IPC extraction (nets → layered polygons + vias + stackup), verified on Antmicro Jetson Orin (8L), HackRF One, Castor &amp; Pollux, StickHub — three .kicad_pcb format generations through one code path.</li>\n<li>Auto graded grid (1/3–2/3 edge snapping, smoothness ≤ 1.5) + openEMS backend: <strong>microstrip Z0 −1.74% / stripline +1.21% vs analytic</strong> (2 % gates, zero manual mesh edits) — <code>validation/reports/p04_z0_gates.*</code>.</li>\n<li>gerber2ems head-to-head on identical coupons: <strong>diff pair |ΔSDD21| p95 0.32 dB, |ΔSDD11| 2.34 dB (0.2–6 GHz, gates 0.5/3 dB) — PASS</strong>; reference-tool passivity limits documented above 12 GHz — <code>validation/reports/p05_crosscheck.*</code>.</li>\n<li>Palace/Gmsh emitter (prism extrusion, SIBC tags, lumped ports) — solve queued for the lab server (<code>docs/server-runbook.md</code>).</li>\n<li>PyQt6 plugin: net picker → extract → simulate → S-param panel, with automatic net-region cutout meshing.</li>\n<li>CUDA Yee kernels (sm_61 + sm_86) with exact-advection gates, plus the <code>ff_yee3d_*</code> physics-module ABI described below. Via-transition validation reaches 50 GHz (<code>validation/reports/p40_fdtd_via.json</code>).</li>\n<li>Shielded-MoM production path (<code>mom</code>): board or cached geometry in, dense GPU solve where available, adaptive band synthesis, Touchstone output, and honest linear-point fallback when a rational fit is not passive or cannot converge. Coupled pairs produce mixed-mode SDD/SCC files (<code>--diff</code>), with passivity and reciprocity recorded in the report (<code>docs/product_loop.md</code>).</li>\n</ul>\n<h2>SI plots</h2>\n<p>Mixed-mode SDD parameters and the corresponding Smith chart for a real bridge3090 differential pair (12 solved points, 0.2–6 GHz):</p>\n<p><a href=\"https://github.com/0xSufi/fieldforge/blob/master/docs/images/bridge3090_pair_sdd.png\"><img src=\"https://github.com/0xSufi/fieldforge/raw/master/docs/images/bridge3090_pair_sdd.png\" alt=\"Mixed-mode SDD parameters and Smith chart for a bridge3090 differential pair\" /></a></p>\n<p>The same SDD loci projected onto the Riemann hemisphere:</p>\n<p><a href=\"https://github.com/0xSufi/fieldforge/blob/master/docs/images/bridge3090_pair_sdd_sphere.png\"><img src=\"https://github.com/0xSufi/fieldforge/raw/master/docs/images/bridge3090_pair_sdd_sphere.png\" alt=\"Bridge3090 SDD loci on the Riemann hemisphere\" /></a></p>\n<p>An |S(i,j)| heatmap for the NVCLK1_P four-port network at 2 GHz:</p>\n<p><a href=\"https://github.com/0xSufi/fieldforge/blob/master/docs/images/bridge3090_nvclk1_heatmap.png\"><img src=\"https://github.com/0xSufi/fieldforge/raw/master/docs/images/bridge3090_nvclk1_heatmap.png\" alt=\"NVCLK1_P four-port S-matrix heatmap at 2 GHz\" /></a></p>\n<p>Generate these views with <code>mom.plot</code>: <code>--mm</code> for mixed-mode labels and <code>--sphere</code> for the hemisphere projection. The solver also writes the underlying Touchstone and JSON reports, so every figure remains machine-checkable.</p>\n<p>Quick start (dev box):</p>\n<pre><code>./ci/run_ci.sh all                # unit + KiCad + solver + CUDA tiers\npython -m fieldforge_gui.app --board &lt;your.kicad_pcb&gt;   # from kicad-plugin/\n</code></pre>\n<p>Shielded-MoM product loop — one command to S-parameters:</p>\n<pre><code>python -m mom board.kicad_pcb --nets NET_P,NET_N --band 0.5:4\npython -m mom geoms.pkl --name jetson_can --band 0.5:4 --loss --thick\npython -m mom pair.pkl --name pair --diff NET_P,NET_N   # mixed-mode SDD/SCC\npython -m mom.plot out/pair_mm.s4p --mm --sphere        # Smith charts\n</code></pre>\n<p>Writes <code>&lt;name&gt;.sNp</code> + <code>&lt;name&gt;.report.json</code> (and <code>&lt;name&gt;_mm.sNp</code> with <code>--diff</code>); adaptive band synthesis solves ~8–12 points for a full band and falls back to honest point solves when the fit can't be trusted (<code>band_mode</code> in the report); GPU auto-detected. Details: <a href=\"https://github.com/0xSufi/fieldforge/blob/master/docs/product_loop.md\"><code>docs/product_loop.md</code></a>.</p>\n<h2>Next milestones</h2>\n<ul>\n<li>Close the unattended convergence loop across the public mesh gauntlet.</li>\n<li>Complete open-media MoM and SI-aware routing integrations.</li>\n<li>Correlate additional coupon measurements above 6 GHz against the solvers.</li>\n</ul>\n<h2>Layout</h2>\n<pre><code>core/            C++20 + CUDA: ffdtd kernels (P1+), C ABI          [Apache-2.0]\npyff/            geometry model, extractors, emitters, drivers     [Apache-2.0]\nkicad-plugin/    IPC-API client + PyQt6 panel                      [GPL-3.0-or-later]\nvalidation/      benchmark defs, golden data, report generator\ndocs/            licenses audit, design notes\ntests/           pytest suite (V0 analytic gates run in CI)\n</code></pre>\n<h2>Credits</h2>\n<ul>\n<li>IPC-API board-access patterns adapted from <a href=\"https://github.com/bbenchoff/OrthoRoute\">OrthoRoute</a> (MIT, © 2025 bbenchoff).</li>\n<li>Cross-validation baseline: <a href=\"https://github.com/antmicro/gerber2ems\">gerber2ems</a> (Apache-2.0, Antmicro).</li>\n<li>Solvers integrated, not reinvented: <a href=\"https://openems.de/\">openEMS</a> (GPL-3), <a href=\"https://github.com/awslabs/palace\">Palace</a> (Apache-2.0), Gmsh, scikit-rf.</li>\n</ul>\n<h2>License</h2>\n<p>Apache-2.0 for <code>core/</code> and <code>pyff/</code>; GPL-3.0-or-later for <code>kicad-plugin/</code>; see <code>docs/licenses.md</code> for the full dependency audit.</p>\n<h2>Solver module ABIs (composition contract)</h2>\n<p>The naive Yee engine (<code>ff_yee3d_*</code>) is the spine; physics modules compose around the public step call — no engine-internal coupling:</p>\n<pre><code>per step:  ff_debye_pre(dctx)                # E^n snapshot (trap ADE)\n           ff_yee3d_step(ctx, 1, ...)        # H, CPML, E, CPML, source\n           ff_debye_post(dctx)               # dispersion correction\n           ff_sibc2_apply(damp)              # per-face conductor damping\n           ff_sibc_apply(pin)                # thin-sheet E_t (v2 hybrid)\n           ff_ports_*(pctx)                  # V/I gather + on-device DFT\n</code></pre>\n<ul>\n<li>Accessors for sibling modules: <code>ff_yee3d_get_fields / _get_meta / _get_spacing_tables / _get_material_map</code> (additive-only ABI).</li>\n<li><code>ff_march3d_*</code>: fused z-march throughput engine (ping-pong buffers; no CPML/ports yet — capacity/speed path, bit-compatible physics).</li>\n<li>CPML profiles: <code>pyff.cpml</code> (physical-distance grading) is canonical; <code>ffdtd_driver.cpml_tables</code> is deprecated on graded axes.</li>\n<li>Field dumps/viewer: <code>pyff.fielddump</code> + <code>python -m pyff.ffview</code>.</li>\n<li>Measurement instruments: two-probe gated transmission (<code>pyff.msl_sibc</code>, ±25% window systematics — documented) and the sealed-box resonator-Q (<code>pyff.resonator_q</code>, window-immune).</li>\n</ul>\n<p>Reports index: <code>validation/reports/p1*_*.json</code> — every number regenerable by the matching <code>validation/gen_*.py</code>.</p>\n"
}