← Commit history

Add advanced SPICE bridge showcase (PSpice for TI, encrypted models, waveform decimation)

John Lauer ·b0f893f14f ·10d ago ·parent 1edc0bc
2 files changed +43−23
README.md+31−17
@@ -22,19 +22,29 @@ A curated notebook and production guide for future YouTube videos showcasing pow  --- -### 2. Building Your Own Bridge with the Bridge SDK-* **Hook:** *"Give the AI hands on your desktop: connect any custom tool or CAD software into Hydrogen."*-* **What to Show:**-  * **Concept:** How Adom Bridge (`ab`) bridges the cloud/container agent to local desktop applications and OS automation.-  * **The `bridge.json` Manifest:**-    * Declaring `verbPrefixes` (e.g. `mytool_connect`, `mytool_export`).-    * Specifying runtime spawn kinds (`python`, `node`, `exe`, or `external-http`).-    * Configuring health checks (`healthEndpoint`, `statusVerb`) and host-app detection (`detect`).-    * Setting timeouts and lifecycle behavior (`persistent: true`).-  * **The Verb Contract:**-    * Handling JSON arguments from the agent.-    * Returning structured payloads with execution status, human-readable hints, and execution duration.-  * **Demo Example:** Scaffolding a lightweight Python or Node bridge that automates a local utility and exposes it as a first-class tool for Hydrogen's AI assistant.+### 2. Building Your Own Bridge with the Bridge SDK (Showcase: The Advanced SPICE Bridge)+* **Hook:** *"Give the AI hands on your desktop: turn clunky, closed-source desktop tools into instant AI superpowers."*+* **The Killer Problem: Vendor-Encrypted SPICE Models:**+  * Power IC vendors like **Texas Instruments** distribute proprietary macromodels encrypted with Cadence keys (`$CDNENCSTART`).+  * Open-source engines like `ngspice` cannot decrypt or run them.+  * **PSpice for TI** is required to simulate them, but it has **no headless batch CLI**—it is strictly a Windows GUI application.+* **The Naive Way (Burning 50k Tokens):**+  * Without a custom bridge, raw AI uses generic OS automation: pushing netlists, spawning `pspice.exe`, sleeping 14 seconds, taking screenshots, vision-clicking the "Run" button, polling `.out` files, and pulling raw text CSDF dumps.+  * *Result:* 16 fragile tool calls, ~49,000 tokens burned per simulation, and easily broken by unexpected popups.+* **The Bridge SDK Solution (`spice_bridge`):**+  * **`bridge.json` Manifest:**+    * Declares domain verbs like `spice_simulate`, `spice_sweep`, `spice_probe`.+    * Manages runtime lifecycle on the Windows host (`python` or `node`).+    * Detects running PSpice/LTspice instances (`detect`).+  * **Superpowers Unlocked by the Bridge:**+    1. **Single-Call Deterministic Verbs:** The AI issues `spice_simulate {"engine": "pspice_ti", "netlist": "buck.cir"}` and gets structured metrics back in **1 call**.+    2. **Local Binary Waveform Decimation:** High-frequency switching simulations produce 500 MB to 2 GB binary `.raw` / `.csd` files. The bridge parses them locally on the Windows host, extracts scalar metrics (`v_ripple_pk`, `overshoot_pct`, `efficiency`), downsamples the million-point curve to a 500-point vector, and passes lightweight JSON to Hydrogen without choking cloud relays.+    3. **Automated Convergence Recovery:** When SPICE hits `Timestep too small` at $t = 1.42\text{ ms}$, the bridge catches the failure, inspects the `.out` log for the oscillating node, relaxes `reltol` or injects `cshunt`, and retries automatically.+    4. **Multi-Threaded Parametric & Monte Carlo Sweeps:** Spawns batch runs across CPU cores on the host for corner/temperature sweeps and returns the statistical yield chart.+    5. **Direct Streaming to Hydrogen Widgets:** Streams real-time simulation progress and decimated curves straight into a Hydrogen webview tab or `<adom-spice>` canvas.+* **Other Engines that Benefit:**+  * **LTspice (Analog Devices):** Bypasses first-run popups, parses proprietary binary `.raw` files directly.+  * **QSPICE (Qorvo):** Interfaces with high-speed C++/Verilog behavioral blocks and encrypted SiC/GaN models.  --- @@ -101,10 +111,14 @@ A curated notebook and production guide for future YouTube videos showcasing pow 2. **Beat 1 - Visual AI Markup (1:00 - 3:00):** Show the pencil icon, draw colored circles, watch the AI pinpoint the exact problem instantly. 3. **Beat 2 - Building a Hydrogen Widget (3:00 - 6:30):** Live code a custom Web Component with Shadow DOM and show it rendering in Hydrogen. 4. **Beat 3 - Generating an AI Avatar (6:30 - 8:30):** Prompt the AI for a custom vector persona, show the SVG output, set it as the profile avatar.-5. **Beat 4 - Custom Bridge with Bridge SDK (8:30 - 12:00):** Walk through `bridge.json`, spawn an external tool, call a custom verb from Hydrogen.-6. **Beat 5 - The Adom Bridge Mesh (12:00 - 15:30):** Open the Mesh UI diagram, run `--target`, approve a prompt from a laptop for an action running on a workstation.-7. **Beat 6 - Recording with H.264 / H.265 (15:30 - 18:00):** Trigger native recording via CLI/Bridge, demonstrate H.265 GPU encoding and file size comparison.-8. **Outro & Resources (18:00 - 19:00):** Link to the Adom Wiki and repo packages.+5. **Beat 4 - Custom Bridge with Bridge SDK: The SPICE Showcase (8:30 - 13:00):**+   * *The Problem:* TI's encrypted buck regulator model in PSpice for TI (no CLI).+   * *The Naive Way:* Show the AI taking 16 calls and 50k tokens clicking the GUI.+   * *The Bridge Way:* Show `bridge.json` + Python worker wrapping the engine into `spice_simulate`.+   * *The Result:* 1 tool call, local waveform decimation, and live streaming into a Hydrogen widget.+6. **Beat 5 - The Adom Bridge Mesh (13:00 - 16:30):** Open the Mesh UI diagram, run `--target`, approve a prompt from a laptop for an action running on a workstation.+7. **Beat 6 - Recording with H.264 / H.265 (16:30 - 19:00):** Trigger native recording via CLI/Bridge, demonstrate H.265 GPU encoding and file size comparison.+8. **Outro & Resources (19:00 - 20:00):** Link to the Adom Wiki and repo packages.  --- 
SKILL.md+12−6
@@ -1,6 +1,6 @@ --- name: hydrogen-tips-and-tricks-description: "Reference guide and production tracker for YouTube video episodes and power-user tips on Adom Hydrogen and Adom Bridge. Use when the user asks for tips, tricks, demo ideas, or tutorials on Adom Hydrogen; when planning or authoring YouTube videos about Hydrogen; or when looking up how to build custom Hydrogen widgets, create custom bridges with the Bridge SDK, design AI vector avatars, use the built-in pencil markup tool for visual bug reporting, leverage Adom Bridge Mesh for multi-machine control, or record hardware-accelerated H.264/H.265 video. Trigger words: hydrogen tips, cool things to do with hydrogen, hydrogen video, hydrogen tricks, hydrogen youtube, make a hydrogen widget, custom bridge, bridge sdk, ai avatar, pencil icon hydrogen, draw circles hydrogen, adom bridge mesh, record h264 h265."+description: "Reference guide and production tracker for YouTube video episodes and power-user tips on Adom Hydrogen and Adom Bridge. Use when the user asks for tips, tricks, demo ideas, or tutorials on Adom Hydrogen; when planning or authoring YouTube videos about Hydrogen; or when looking up how to build custom Hydrogen widgets, create custom bridges with the Bridge SDK (including advanced SPICE engines for vendor-encrypted models like TI PSpice and LTspice), design AI vector avatars, use the built-in pencil markup tool for visual bug reporting, leverage Adom Bridge Mesh for multi-machine control, or record hardware-accelerated H.264/H.265 video. Trigger words: hydrogen tips, cool things to do with hydrogen, hydrogen video, hydrogen tricks, hydrogen youtube, make a hydrogen widget, custom bridge, bridge sdk, spice bridge, pspice for ti bridge, encrypted spice models, ai avatar, pencil icon hydrogen, draw circles hydrogen, adom bridge mesh, record h264 h265." ---  # Hydrogen Tips & Tricks: Cool Things to Do with Hydrogen@@ -21,16 +21,22 @@ Build interactive, drop-in web components that integrate directly into Hydrogen'  --- -## 2. Building Bridges with the Adom Bridge SDK+## 2. Building Bridges with the Adom Bridge SDK (SPICE Showcase) Extend Hydrogen's AI assistant with hands on the desktop to automate EDA software, 3D CAD, or local instruments.+- **Showcase Application: Advanced SPICE Bridge:**+  - *Problem:* Vendor-encrypted models (TI PSpice `$CDNENCSTART`, ADI LTspice, Qorvo QSPICE) cannot run in open-source engines like `ngspice`. PSpice for TI has no headless batch CLI.+  - *Naive Automation:* Raw AI takes ~16 fragile steps and burns ~50k tokens clicking the GUI.+  - *Bridge SDK Solution:* A dedicated `spice_bridge` provides a deterministic `spice_simulate` verb.+- **Key Bridge Superpowers:**+  - **Local Waveform Decimation:** High-frequency switching simulations generate 500 MB–2 GB `.raw`/`.csd` files. The bridge parses them locally on the Windows host, extracts metrics (`v_ripple_pk`, `efficiency`, `settle_time_ms`), downsamples waveforms to 500 points, and passes lightweight JSON to Hydrogen.+  - **Convergence Failure Recovery:** Parses simulation error logs, identifies non-converging nodes (`Timestep too small`), tweaks `reltol`/`cshunt`/`gmin`, and automatically re-executes.+  - **Multi-Threaded Sweeps:** Parallelizes Monte Carlo and temperature sweeps locally across CPU cores.+  - **Streaming to Hydrogen Widgets:** Streams real-time progress and waveforms directly into a Hydrogen canvas or webview tab. - **Manifest (`bridge.json`):**-  - `verbPrefixes`: Namespace for commands exposed to the AI (e.g., `altium_*`, `kicad_*`, `scope_*`).+  - `verbPrefixes`: Namespace for commands exposed to the AI (`spice_*`, `kicad_*`, `altium_*`).   - `spawn`: Execution runtime (`python`, `node`, `exe`, or `external-http`).   - `persistent`: Keep processes running across multiple calls to preserve state.   - `detect`: Automatic detection of target desktop applications.-- **The Verb Contract:**-  - Bridges receive JSON command payloads from the agent over local IPC or WebSocket relay.-  - Responses return `{ ok: true, data: ..., hint: ... }` with standard error codes and millisecond timing.  ---