<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Miroslav Šotek</title>
    <description>The latest articles on DEV Community by Miroslav Šotek (@anulum).</description>
    <link>https://dev.to/anulum</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3848490%2F36416691-0a81-4276-9be0-1a32852ed99a.jpeg</url>
      <title>DEV Community: Miroslav Šotek</title>
      <link>https://dev.to/anulum</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/anulum"/>
    <language>en</language>
    <item>
      <title>Coordinating multiple AI coding agents on one repo or multiple in your own ecosystem — without git worktrees</title>
      <dc:creator>Miroslav Šotek</dc:creator>
      <pubDate>Mon, 22 Jun 2026 18:22:18 +0000</pubDate>
      <link>https://dev.to/anulum/coordinating-multiple-ai-coding-agents-on-one-repo-or-multiple-in-your-own-ecosystem-without-git-3fde</link>
      <guid>https://dev.to/anulum/coordinating-multiple-ai-coding-agents-on-one-repo-or-multiple-in-your-own-ecosystem-without-git-3fde</guid>
      <description>&lt;p&gt;If you have run more than one AI coding agent at once, you have met the failure&lt;br&gt;
mode: agent A is editing &lt;code&gt;src/auth.py&lt;/code&gt; while agent B rewrites the same file. One of them loses. The usual fixes are real, but they both dodge the actual problem.&lt;/p&gt;
&lt;h2&gt;
  
  
  The two usual answers, and what they dodge
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Git worktrees.&lt;/strong&gt; Give each agent its own checkout sharing one &lt;code&gt;.git&lt;/code&gt;. They cannot collide on disk, and conflicts surface at merge time. This is &lt;em&gt;isolation&lt;/em&gt; — it keeps agents apart so they never have to coordinate. Great until the merges fight.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Agent frameworks&lt;/strong&gt; (LangGraph, CrewAI, AutoGen). You write the agents and their control flow in one process; one orchestrator spawns sub-agents. Powerful, but it assumes you are &lt;em&gt;building&lt;/em&gt; the agents. If you are running off-the-shelf terminal assistants from different vendors, that is not your situation.&lt;/p&gt;

&lt;p&gt;Neither lets several independent agents &lt;em&gt;coordinate in real time on a shared tree&lt;/em&gt;:&lt;br&gt;
claim work, see a shared plan, talk to each other. That layer — call it a&lt;br&gt;
coordination bus — is what was missing for us, so we built one: &lt;strong&gt;SYNAPSE CHANNEL&lt;/strong&gt;, a local-first WebSocket hub. One dependency, runs on your machine.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pip &lt;span class="nb"&gt;install &lt;/span&gt;synapse-channel
synapse hub &lt;span class="nt"&gt;--port&lt;/span&gt; 8876 &lt;span class="nt"&gt;--db&lt;/span&gt; ./synapse.db   &lt;span class="c"&gt;# the coordination hub (crash-safe)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  1. Claim before you edit
&lt;/h2&gt;

&lt;p&gt;The core primitive is an advisory file-scope claim. An agent leases a task and declares the paths it will touch; the hub refuses an overlapping claim. The hub never reads your filesystem — the globs are agent-declared.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;synapse_channel&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;SynapseAgent&lt;/span&gt;

&lt;span class="n"&gt;agent&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;SynapseAgent&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;backend&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;uri&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;ws://localhost:8876&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="c1"&gt;# ... after connect():
&lt;/span&gt;&lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;agent&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;claim&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;auth-refactor&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;paths&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;src/auth.py&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;src/session.py&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;
&lt;span class="c1"&gt;# A second agent claiming any overlapping path is denied — they never touch
# the same file. Leases expire and carry an epoch, so a crashed agent never
# holds a claim forever.
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;No central orchestrator decides this. Each agent claims for itself; the hub is the single arbiter of overlap.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. A shared plan, on the command line
&lt;/h2&gt;

&lt;p&gt;There is a dual-ledger blackboard — tasks and progress, with dependencies — that you can drive without writing a client:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;synapse task &lt;span class="nb"&gt;declare &lt;/span&gt;BUILD &lt;span class="nt"&gt;--title&lt;/span&gt; &lt;span class="s2"&gt;"compile"&lt;/span&gt; 
synapse task &lt;span class="nb"&gt;declare &lt;/span&gt;TEST &lt;span class="nt"&gt;--title&lt;/span&gt; &lt;span class="s2"&gt;"run tests"&lt;/span&gt; &lt;span class="nt"&gt;--depends-on&lt;/span&gt; BUILD
synapse task update BUILD &lt;span class="nt"&gt;--status&lt;/span&gt; &lt;span class="k"&gt;done&lt;/span&gt;      &lt;span class="c"&gt;# unblocks TEST&lt;/span&gt;
synapse board                                &lt;span class="c"&gt;# print the shared plan&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A held task can be handed off atomically to another agent (scope, status, and context preserved), and an LLM-free supervisor re-offers work that stalls.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. The interesting bit: waking a turn-based agent
&lt;/h2&gt;

&lt;p&gt;Here is the problem nobody talks about. A turn-based assistant (the kind in your terminal) cannot hold a socket open between turns. So how does it learn a message arrived without burning turns polling?&lt;/p&gt;

&lt;p&gt;SYNAPSE turns it into a push. &lt;code&gt;synapse wait&lt;/code&gt; blocks on the connection and &lt;strong&gt;exits the instant a message addressed to you arrives&lt;/strong&gt;. You run it as a background task; when it exits, your harness re-invokes the agent. No message → it costs nothing.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# backgrounded: exits + wakes the agent the moment a directed message lands synapse wait --name backend-rx --for backend --directed-only&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# from anywhere — message one agent, a project group, or everyone&lt;/span&gt;
synapse send &lt;span class="nt"&gt;--target&lt;/span&gt; backend &lt;span class="s2"&gt;"rebased main, re-pull"&lt;/span&gt;
synapse send &lt;span class="nt"&gt;--target&lt;/span&gt; &lt;span class="s2"&gt;"quantum/*"&lt;/span&gt; &lt;span class="s2"&gt;"freeze, I'm tagging"&lt;/span&gt;
synapse send &lt;span class="nt"&gt;--target&lt;/span&gt; all &lt;span class="nt"&gt;--priority&lt;/span&gt; &lt;span class="s2"&gt;"[deploy] prod is green"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;--directed-only&lt;/code&gt; keeps routine broadcasts from waking you, while priority messages still get through. Serialise the things that must not overlap — commits above all — by wrapping them in a lease:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;synapse lock myrepo:git &lt;span class="nt"&gt;--&lt;/span&gt; git push   &lt;span class="c"&gt;# holds the lease while pushing; others wait&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  4. It survives a restart
&lt;/h2&gt;

&lt;p&gt;Every claim, release, task, and checkpoint goes into an append-only SQLite log and is replayed on start-up, so a hub restart resumes live leases instead of dropping them. A lapsed claim keeps its checkpoint, so the next agent to take the task resumes rather than restarts. The same log doubles as a cross-agent audit trail — who claimed what, when, and who handed off to whom.&lt;/p&gt;

&lt;h2&gt;
  
  
  The honest part
&lt;/h2&gt;

&lt;p&gt;We did not design this in the abstract. SYNAPSE coordinates the agents that develop SYNAPSE, every day. Most of the rough edges in the changelog — a missed wake, a waiter that hung after a restart, a ghost connection blocking a re-arm — were problems we hit &lt;em&gt;using&lt;/em&gt; it, fixed the same day because they annoyed us directly. A tool its authors depend on gets sharp quickly.&lt;/p&gt;

&lt;p&gt;It is local-first by design: a loopback hub, single owner, no cloud. Licence is AGPL-3.0 (free for OSS / research / personal); a pay-what-you-want commercial licence from CHF 9.99 covers closed-source and SaaS use.&lt;br&gt;
Also, you still can buy me a &lt;a href="https://buymeacoffee.com/anulum" rel="noopener noreferrer"&gt;coffee&lt;/a&gt; :)&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pip &lt;span class="nb"&gt;install &lt;/span&gt;synapse-channel
synapse team   &lt;span class="c"&gt;# hub + a couple of local workers, to kick the tyres&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Source: &lt;a href="https://github.com/anulum/synapse-channel" rel="noopener noreferrer"&gt;https://github.com/anulum/synapse-channel&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Docs: &lt;a href="https://anulum.github.io/synapse-channel/" rel="noopener noreferrer"&gt;https://anulum.github.io/synapse-channel/&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Product page: &lt;a href="https://anulum.li/synapse/" rel="noopener noreferrer"&gt;https://anulum.li/synapse/&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you coordinate parallel agents some other way, I would like to hear it — what breaks at three agents? At ten?&lt;/p&gt;

</description>
      <category>ai</category>
      <category>agents</category>
      <category>devtools</category>
      <category>opensource</category>
    </item>
    <item>
      <title>We Built a Universal Language for Synchrony — And It Might Be Too Ambitious</title>
      <dc:creator>Miroslav Šotek</dc:creator>
      <pubDate>Mon, 08 Jun 2026 12:54:31 +0000</pubDate>
      <link>https://dev.to/anulum/we-built-a-universal-language-for-synchrony-and-it-might-be-too-ambitious-3ceg</link>
      <guid>https://dev.to/anulum/we-built-a-universal-language-for-synchrony-and-it-might-be-too-ambitious-3ceg</guid>
      <description>&lt;p&gt;&lt;em&gt;How SCPN Phase Orchestrator v0.8.0 turns Kuramoto dynamics into a domain-agnostic control compiler, why we verify math across five languages, and the honest truth about building a Boeing 747 when most people need a bicycle.&lt;/em&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  The $5.2 Billion Blackout That Started This
&lt;/h2&gt;

&lt;p&gt;On August 14, 2003, a cascading failure in the US Northeast power grid left 55 million people without electricity. The final report cited something deceptively simple: &lt;strong&gt;synchrony loss&lt;/strong&gt;. A generation unit in Ohio drifted out of phase. The protective relays, designed to prevent damage, tripped in sequence. One desynchronized oscillator triggered a cascade that propagated across 265 power plants in nine minutes.&lt;/p&gt;

&lt;p&gt;The grid had controllers. It had models. What it lacked was a &lt;strong&gt;shared, reviewable language for coherence&lt;/strong&gt; — a way to ask, in real time: &lt;em&gt;"Is this synchrony valuable or dangerous? And if I touch this knob, can I prove what will happen before the electrons move?"&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;That question is why I built &lt;a href="https://github.com/anulum/scpn-phase-orchestrator" rel="noopener noreferrer"&gt;SCPN Phase Orchestrator&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;It is not a Kuramoto simulator. It is a &lt;strong&gt;coherence control compiler&lt;/strong&gt; — a system that takes any cyclic process (power waves, cloud retries, neural spikes, traffic signals) and compiles it into a unified phase space where synchrony can be observed, classified, and modified with bounded, auditable, replayable actions.&lt;/p&gt;

&lt;p&gt;Version 0.8.0 just shipped. It includes something I have not seen in any other open-source oscillator library: &lt;strong&gt;cross-language mathematical parity verification&lt;/strong&gt; and &lt;strong&gt;Lean proof obligations&lt;/strong&gt; for safety-critical control chains. This post is the honest story of why we built it, how it works, and where we might have gone too far.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Fragmentation Problem
&lt;/h2&gt;

&lt;p&gt;If you work on synchrony in 2026, you live in silos.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Power engineers&lt;/strong&gt; use PSS/E or PowerFactory with swing-equation models.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Cloud operators&lt;/strong&gt; use Airflow, Kestra, or Temporal for workflow orchestration — none of which understand phase dynamics.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Neuroscientists&lt;/strong&gt; use FieldTrip or MNE-Python for EEG phase analysis, but the tools stop at visualization; they do not close the loop.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Roboticists&lt;/strong&gt; write custom Vicsek models for swarm consensus.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Plasma physicists&lt;/strong&gt; maintain separate MHD codes for tokamak control.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Every domain has its own vocabulary, its own numerics, its own safety culture. When a power engineer and a cloud architect talk about "retry storms," they are describing the same underlying phenomenon — coupled oscillators with delayed feedback — but they have no shared formalism to prove it.&lt;/p&gt;

&lt;p&gt;SCPN Phase Orchestrator (SPO) is an attempt to build that shared formalism without forcing anyone to abandon their domain expertise.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Core Insight: Phase as a Universal Compiler Target
&lt;/h2&gt;

&lt;p&gt;The Kuramoto model is usually taught as a toy system: N oscillators, sine coupling, an order parameter R. But Strogatz and Acebr\u00f3n showed something deeper in the early 2000s: &lt;strong&gt;the Kuramoto model is a mean-field reduction of almost any weakly coupled limit-cycle system&lt;/strong&gt;. If your system has repeating behavior and weak coupling, it is secretly a Kuramoto network.&lt;/p&gt;

&lt;p&gt;SPO treats that insight literally. We built a pipeline that compiles domain-specific cycles into a universal phase space:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Domain Binder -&amp;gt; Oscillator Extractors (P/I/S) -&amp;gt; UPDE Engine -&amp;gt; Supervisor -&amp;gt; Actuation Mapper
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  The Three Channels
&lt;/h3&gt;

&lt;p&gt;Not all cycles look like sine waves. SPO separates extraction into three channels:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Channel&lt;/th&gt;
&lt;th&gt;Source&lt;/th&gt;
&lt;th&gt;Phase Extraction&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Physical (P)&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Continuous waveforms&lt;/td&gt;
&lt;td&gt;Hilbert transform, zero-crossing&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Informational (I)&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Event/decision streams&lt;/td&gt;
&lt;td&gt;Event-phase from message timing&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Symbolic (S)&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Discrete state sequences&lt;/td&gt;
&lt;td&gt;Ring-phase $\theta = 2\pi s / N$, graph-walk&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;A power grid voltage trace goes through &lt;strong&gt;P&lt;/strong&gt;. A microservice retry log goes through &lt;strong&gt;I&lt;/strong&gt;. A traffic light state machine goes through &lt;strong&gt;S&lt;/strong&gt;. All three land in the same phase space.&lt;/p&gt;

&lt;h3&gt;
  
  
  The Four Knobs
&lt;/h3&gt;

&lt;p&gt;Once in phase space, every control problem reduces to four parameters:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Knob&lt;/th&gt;
&lt;th&gt;Meaning&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;K&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Coupling strength (K_nm matrix)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;alpha&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Phase lag (transport/actuator delays)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;zeta&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Driver strength (external forcing)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Psi&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Reference phase (control target)&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;This is not abstraction for abstraction's sake. It is a &lt;strong&gt;contract&lt;/strong&gt;. When a supervisor proposes a control action, it proposes a bounded change to one of these four knobs. The action is reviewable because the contract is universal.&lt;/p&gt;

&lt;h3&gt;
  
  
  R_good vs. R_bad
&lt;/h3&gt;

&lt;p&gt;The most important design decision in SPO: &lt;strong&gt;coherence is not one scalar&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Most tools give you an order parameter $R$ and assume higher is better. SPO splits the objective:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;R_good&lt;/strong&gt;: Coherence you want to maintain (actuator locked to target phase)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;R_bad&lt;/strong&gt;: Coherence you want to suppress (harmful mode-locking, retry storms, epileptic seizure rhythms)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A power grid wants high R_good between generators and the grid frequency, but it wants R_bad near zero for inter-area oscillations that can trigger cascading failures. A cloud system wants high R_good for cache coherence, but R_bad near zero for thundering-herd retry patterns.&lt;/p&gt;

&lt;p&gt;No other oscillator library makes this distinction explicit.&lt;/p&gt;




&lt;h2&gt;
  
  
  Show Me the Code
&lt;/h2&gt;

&lt;p&gt;SPO is on PyPI. You can install it and run a deterministic simulation in under a minute:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pip &lt;span class="nb"&gt;install &lt;/span&gt;scpn-phase-orchestrator
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The high-level facade does not require understanding the theory:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;scpn&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;Orchestrator&lt;/span&gt;

&lt;span class="n"&gt;orch&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Orchestrator&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;from_yaml&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;domainpacks/minimal_domain/binding_spec.yaml&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;state&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;orch&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;run&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;steps&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;seed&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;42&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;state&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;order_parameter&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For ML researchers, the &lt;code&gt;nn/&lt;/code&gt; module exposes JAX/equinox layers that are JIT-compilable, &lt;code&gt;vmap&lt;/code&gt;-compatible, and fully differentiable:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;scpn_phase_orchestrator.nn&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;KuramotoLayer&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;jax_runtime_info&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;require_accelerator&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;jax_runtime_info&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt;
&lt;span class="n"&gt;device&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;require_accelerator&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;  &lt;span class="c1"&gt;# fails fast on CPU-only runtimes
&lt;/span&gt;
&lt;span class="n"&gt;layer&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;KuramotoLayer&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;n_oscillators&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;64&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="c1"&gt;# K and omega are learnable. Use SAF spectral loss for topology optimization.
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;upde/&lt;/code&gt; module provides advanced dynamics for researchers who need more than the standard Kuramoto model:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Inertial Kuramoto&lt;/strong&gt;: Second-order swing equations for power grid stability&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Market Kuramoto&lt;/strong&gt;: Financial regime detection via Hilbert phase&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Swarmalator&lt;/strong&gt;: Coupled spatial + phase dynamics&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Simplicial Engine&lt;/strong&gt;: 3-body higher-order coupling (Gambuzza 2023)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Ott-Antonsen&lt;/strong&gt;: Exact mean-field reduction for $O(1)$ prediction&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Delay Engine&lt;/strong&gt;: Time-delayed coupling with circular buffers&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Stochastic Engine&lt;/strong&gt;: Euler-Maruyama with auto-tuned optimal noise&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  What v0.8.0 Actually Adds (And Why It Is Not Just Features)
&lt;/h2&gt;

&lt;p&gt;The jump from 0.6.4 to 0.8.0 was not incremental. It introduced the &lt;strong&gt;PHA-C downstream accelerator chain&lt;/strong&gt; — a formal-acceptance pipeline for moving-frame merge safety.&lt;/p&gt;

&lt;h3&gt;
  
  
  Polyglot Parity Gates
&lt;/h3&gt;

&lt;p&gt;Here is something I have not found in any other open-source project: SPO now verifies that &lt;strong&gt;identical mathematical behavior is produced across five languages&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;For every release, the benchmark suite checks parity across Rust, Go, Julia, Mojo, and Python for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Chimera detection (Kuramoto-Battogtokh local-order vector)&lt;/li&gt;
&lt;li&gt;ITPC (Lachaux inter-trial phase-coherence)&lt;/li&gt;
&lt;li&gt;Spectral analysis (D\u00f6rfler-Bullo combinatorial graph Laplacian)&lt;/li&gt;
&lt;li&gt;Hodge decomposition (gradient / curl / harmonic split)&lt;/li&gt;
&lt;li&gt;Transfer entropy (Schreiber histogram estimator)&lt;/li&gt;
&lt;li&gt;Entropy production (Acebr\u00f3n overdamped-Kuramoto dissipation)&lt;/li&gt;
&lt;li&gt;PHA-C handoff, timeline, and acceptance (moving-frame merge safety)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Why? Because if you are going to propose a control action for a power grid or a medical device, &lt;strong&gt;you need to know that the math is the same in the language running on the FPGA, the language running in the browser, and the language running in the Python notebook&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;The benchmark snapshot (dated 2026-06-05) records the evidence. The PHA-C acceptance gate runs at ~29 steps/s — slow, because it is doing formal verification at runtime, not just simulation.&lt;/p&gt;

&lt;h3&gt;
  
  
  Lean Proof Obligations
&lt;/h3&gt;

&lt;p&gt;The PHA-C chain now targets &lt;code&gt;SPOFormal.Kinematic.KinematicBounds&lt;/code&gt; and &lt;code&gt;SPOFormal.Continuous&lt;/code&gt; with Lean proofs. This means:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Kinematic residuals are bounded by Gronwall envelopes&lt;/li&gt;
&lt;li&gt;Phase budgets are discharged by fixed-point certificates&lt;/li&gt;
&lt;li&gt;Acceptance records carry proof metadata that must agree with arithmetic discharge before the row passes&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This is &lt;strong&gt;review-only&lt;/strong&gt; for now. The quantum, neuromorphic, PLC, and medical actuation adapters remain disabled until a separate operator-approved hardware evidence chain exists. We are not claiming live formal verification on hardware yet. We are claiming that the &lt;strong&gt;review artefacts are formally structured&lt;/strong&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Audit Trails That Can Be Replayed
&lt;/h3&gt;

&lt;p&gt;Every run produces a SHA256-chained JSONL log. In v0.8.0, the PHA-C chain adds hash-replay validation: tampered scalar evidence or unsafe claim-boundary edits are rejected without needing the original raw arrays.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;spo run domainpacks/queuewaves/binding_spec.yaml &lt;span class="nt"&gt;--steps&lt;/span&gt; 1000 &lt;span class="nt"&gt;--audit&lt;/span&gt; audit.jsonl
spo replay audit.jsonl &lt;span class="nt"&gt;--output&lt;/span&gt; report.json &lt;span class="nt"&gt;--verify&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is not logging. This is &lt;strong&gt;deterministic evidence&lt;/strong&gt;. If a regulator asks "why did the controller propose $K = 0.3$ at $t = 147$?", you can replay the exact numerical path, the supervisor state, and the regime classification.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Honest Truth: It Might Be Too Much
&lt;/h2&gt;

&lt;p&gt;I need to say this clearly, because dev.to readers deserve honesty: &lt;strong&gt;SCPN Phase Orchestrator is over-engineered for most users&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;The repository has 492 Python modules, 93 Rust files, 544 tests, 186 documentation pages, and a formal-methods backend that most developers will never touch. The polyglot parity gates run at 3–29 steps/s. The Lean proof obligations require understanding fixed-point arithmetic and Gronwall bounds.&lt;/p&gt;

&lt;p&gt;If you just want to simulate 64 Kuramoto oscillators on your laptop, use &lt;a href="https://github.com/fabridamicelli/kuramoto" rel="noopener noreferrer"&gt;fabridamicelli/kuramoto&lt;/a&gt;. It is mature, simple, and has 100+ stars. If you want pure JAX speed, use jaxkuramoto. If you want neuroscience-specific pipelines, use neurolib.&lt;/p&gt;

&lt;p&gt;SPO is for a different use case: &lt;strong&gt;systems where the cost of a wrong control action is measured in millions of dollars or human lives&lt;/strong&gt;, and where the control proposal must be explainable before it reaches hardware.&lt;/p&gt;

&lt;p&gt;That is a narrow gate. We know. We are not trying to replace every oscillator library. We are trying to build the one you use when the other libraries stop.&lt;/p&gt;




&lt;h2&gt;
  
  
  Security Posture: What We Patch and What We Do Not
&lt;/h2&gt;

&lt;p&gt;Because this is a control framework, security is not an afterthought. A few specifics:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;CVE-2026-48710 (BadHost)&lt;/strong&gt;: We patched the Starlette Host-header validation boundary in the QueueWaves FastAPI deployment. If you run SPO behind a reverse proxy, validate the &lt;code&gt;Host&lt;/code&gt; header at the proxy layer. We pin &lt;code&gt;starlette&amp;gt;=1.0.1&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Hardware adapters&lt;/strong&gt;: Real hardware access is adapter-scoped and opt-in. Modbus/TLS SCADA requires mutual TLS client certs. Plain Modbus TCP is explicitly restricted to lab networks. BrainFlow sensor input is read-only with no actuation writes.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Quantum/neuromorphic&lt;/strong&gt;: Compiler outputs are handoff artefacts only. Execution and hardware writes remain disabled until a verified external pipeline is attached.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;YAML sandboxing&lt;/strong&gt;: &lt;code&gt;binding_spec.yaml&lt;/code&gt; files are schema-validated but not yet fully sandboxed. Do not load untrusted domainpacks without review.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;We run CodeQL, dependency scanning, secret scanning, and Rust audit in CI. We generate capability inventories automatically rather than editing them by hand. But we do not yet generate SBOMs or hash-pin all dependencies — that is on the near-term roadmap.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Roadmap: Where This Goes
&lt;/h2&gt;

&lt;p&gt;The next six months are about &lt;strong&gt;lowering the floor without lowering the ceiling&lt;/strong&gt;.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;SPO Core vs. SPO Formal&lt;/strong&gt;: We are splitting the project into two tracks. SPO Core will be a simplified, fast, easy-to-use Kuramoto library with closed-loop control. SPO Formal will contain the PHA-C chain, Lean proofs, and polyglot consensus. Same API, different depth.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Auto-coupling discovery&lt;/strong&gt;: Extend our transfer entropy module to infer $K$ from observational data and validate it against the binding spec. Most users do not know their coupling topology. We should discover it.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Real-time edge bridges&lt;/strong&gt;: ROS2 connector, MQTT for industrial IoT, OPC-UA for process control. The digital twin domainpack is interesting, but it needs to actually connect to hardware.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Web playground&lt;/strong&gt;: Expand the WebAssembly module into a full interactive simulator. Drag coupling sliders. Watch phase portraits update in real time. No installation required.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Neuromorphic compilation&lt;/strong&gt;: Move from review artefacts to actual compilation targets (Intel Loihi, IBM TrueNorth, SpiNNaker). The FPGA kernel (Zynq-7020, sub-15$\mu$s latency) proves we can do hardware targets.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Polyglot consensus control&lt;/strong&gt;: Run the same control loop in Python, Rust, and Julia simultaneously. Require 2/3 agreement before actuation. Byzantine-fault-tolerant control for oscillator networks.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;




&lt;h2&gt;
  
  
  Try It
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pip &lt;span class="nb"&gt;install &lt;/span&gt;scpn-phase-orchestrator
spo demo &lt;span class="nt"&gt;--domain&lt;/span&gt; minimal_domain &lt;span class="nt"&gt;--steps&lt;/span&gt; 20
spo validate domainpacks/queuewaves/binding_spec.yaml
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The repository is AGPL-3.0. Commercial licensing is available. If you are working on power grids, fusion plasmas, cloud infrastructure, neuroscience, or any system where cyclic processes need to lock together (or must be kept apart), we would genuinely appreciate your feedback.&lt;/p&gt;

&lt;p&gt;The code is at &lt;a href="https://github.com/anulum/scpn-phase-orchestrator" rel="noopener noreferrer"&gt;github.com/anulum/scpn-phase-orchestrator&lt;/a&gt;. The docs are built with MkDocs. The benchmarks are reproducible. The physics invariants are executable tests.&lt;/p&gt;

&lt;p&gt;We know the project is not viral yet. We have done almost no marketing. This post is the beginning of that, but more importantly, it is an invitation: &lt;strong&gt;tell us where the friction is&lt;/strong&gt;. We are updating constantly, and the most valuable input we can get is from people who try to use this for real problems and hit the walls we did not see.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;em&gt;We appreciate sharing, Likes, Contributions, Sponsoring / Donations to keep me going. We are open for collaboration.&lt;/em&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;em&gt;Built by ANULUM Institute / Fortis Studio. If you have read this far, thank you. The project is ambitious, possibly too ambitious, but the problem it addresses — the lack of a shared, reviewable language for coherence — is real. We would rather be too ambitious than too narrow.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>kuramoto</category>
      <category>oscillatornetworks</category>
      <category>synchronisation</category>
      <category>powergrids</category>
    </item>
    <item>
      <title>scpn-quantum-control: The Quantum Workbench for Coupled Oscillator Networks — and Why We Built It Differently</title>
      <dc:creator>Miroslav Šotek</dc:creator>
      <pubDate>Mon, 08 Jun 2026 12:26:46 +0000</pubDate>
      <link>https://dev.to/anulum/scpn-quantum-control-the-quantum-workbench-for-coupled-oscillator-networks-and-why-we-built-it-a6p</link>
      <guid>https://dev.to/anulum/scpn-quantum-control-the-quantum-workbench-for-coupled-oscillator-networks-and-why-we-built-it-a6p</guid>
      <description>&lt;p&gt;&lt;em&gt;A fact-based look at v0.9.8, 9,139 tests, 15+ hardware backends, and the only quantum-native automatic differentiation engine for Kuramoto-XY Hamiltonians.&lt;/em&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  The Problem Nobody Was Solving
&lt;/h2&gt;

&lt;p&gt;In 2024, I needed to run a specific experiment: simulate a network of 16 coupled Kuramoto oscillators on a 156-qubit IBM Heron r2 processor and prove whether quantum synchronisation witnesses could be measured on NISQ hardware.&lt;/p&gt;

&lt;p&gt;I looked at the existing tools. Qiskit had the hardware access. PennyLane had the gradients. QuTiP had the dynamics. Cirq had the fine-grained control. But none of them could do what I actually needed:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Take an arbitrary coupling matrix &lt;code&gt;K_nm&lt;/code&gt;, a frequency vector &lt;code&gt;ω&lt;/code&gt;, and compile them into a quantum circuit that evolves an XY Hamiltonian on real hardware — then measure whether the resulting state exhibits synchronisation.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;There was no off-the-shelf tool for this. So I built one.&lt;/p&gt;

&lt;p&gt;Eleven months later, &lt;code&gt;scpn-quantum-control&lt;/code&gt; is at v0.9.8. It is not a general-purpose quantum computing framework. It is a specialised workbench for a specific class of problems: &lt;strong&gt;quantum simulation of coupled oscillator networks&lt;/strong&gt;. And it is built with a level of engineering discipline that I believe is rare in academic quantum software.&lt;/p&gt;

&lt;p&gt;This article is an honest, fact-based account of what it does, how it works, and where it is going.&lt;/p&gt;




&lt;h2&gt;
  
  
  What It Actually Is (and Isn't)
&lt;/h2&gt;

&lt;p&gt;Let's be precise. &lt;code&gt;scpn-quantum-control&lt;/code&gt; is &lt;strong&gt;not&lt;/strong&gt; trying to be the next Qiskit, PennyLane, or Cirq. Those are general-purpose frameworks with millions of users and billions in corporate backing. They own the general quantum computing space.&lt;/p&gt;

&lt;p&gt;What &lt;code&gt;scpn-quantum-control&lt;/code&gt; does is own a narrow, deep slice of that space:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Kuramoto-XY compiler&lt;/strong&gt;: Converts arbitrary coupling matrices &lt;code&gt;K_nm&lt;/code&gt; and frequency vectors &lt;code&gt;ω&lt;/code&gt; into quantum circuits evolving &lt;code&gt;H = Σ K_nm (X_n X_m + Y_n Y_m) + Σ ω_n Z_n&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Synchronisation analysis&lt;/strong&gt;: Measures order parameters &lt;code&gt;R(t)&lt;/code&gt;, entanglement entropy, Schmidt gaps, and OTOC scrambling on those circuits&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Hardware validation&lt;/strong&gt;: Runs on IBM Heron r2 (156 qubits), IonQ, AWS Braket, Azure Quantum, Quantinuum, Rigetti, QuEra, IQM, Pasqal, OQC, D-Wave, qBraid, Quandela, and local simulators&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Evidence ledger&lt;/strong&gt;: Every hardware claim is classified, traceable, and falsifiable&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The codebase is substantial: &lt;strong&gt;767 Python modules&lt;/strong&gt;, &lt;strong&gt;1,501 public classes&lt;/strong&gt;, &lt;strong&gt;55 Rust bindings&lt;/strong&gt;, &lt;strong&gt;27 Rust source files&lt;/strong&gt;, &lt;strong&gt;98 Jupyter notebooks&lt;/strong&gt;, &lt;strong&gt;23 examples&lt;/strong&gt;, and &lt;strong&gt;9,139 tests&lt;/strong&gt; maintaining &lt;strong&gt;97%+ coverage&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;It is maintained by one person (me). It is licensed under AGPL-3.0-or-later with a commercial dual-licensing option. Those are limitations, and I will discuss them honestly.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Core Technical Stack
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1. The Kuramoto-XY Compiler (Unique — No Other Framework Has This)
&lt;/h3&gt;

&lt;p&gt;The heart of the system is the compiler that takes classical oscillator network specifications and produces quantum circuits.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;scpn_quantum_control&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;QuantumKuramotoSolver&lt;/span&gt;

&lt;span class="c1"&gt;# Define a 4-oscillator coupling matrix
&lt;/span&gt;&lt;span class="n"&gt;K_nm&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
    &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mf"&gt;0.0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;1.2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;0.8&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;0.0&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
    &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mf"&gt;1.2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;0.0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;1.5&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;0.9&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
    &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mf"&gt;0.8&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;1.5&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;0.0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;1.1&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
    &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mf"&gt;0.0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;0.9&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;1.1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;0.0&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
&lt;span class="p"&gt;]&lt;/span&gt;

&lt;span class="c1"&gt;# Frequencies
&lt;/span&gt;&lt;span class="n"&gt;omega&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mf"&gt;1.0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;1.1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;0.9&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;1.05&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;

&lt;span class="c1"&gt;# Compile to quantum circuit
&lt;/span&gt;&lt;span class="n"&gt;solver&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;QuantumKuramotoSolver&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;K_nm&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;K_nm&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;omega&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;omega&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;reps&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;  &lt;span class="c1"&gt;# Trotter steps
&lt;/span&gt;    &lt;span class="n"&gt;backend&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;qiskit_aer&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="c1"&gt;# Run and get order parameter trajectory
&lt;/span&gt;&lt;span class="n"&gt;result&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;solver&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;run&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="n"&gt;R_t&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;result&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;order_parameter&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;  &lt;span class="c1"&gt;# R(t) over time
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Under the hood, this compiles to a Trotterised XY Hamiltonian with &lt;code&gt;Ry&lt;/code&gt; rotations for frequencies and &lt;code&gt;Rxx&lt;/code&gt;/&lt;code&gt;Ryy&lt;/code&gt; gates for couplings. The circuit depth scales as &lt;code&gt;O(reps × edges)&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why this matters:&lt;/strong&gt; Most quantum simulation frameworks assume you already have a quantum circuit. This one assumes you have a &lt;strong&gt;classical network graph&lt;/strong&gt; and builds the circuit for you. That is a different user, and a different problem.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Differentiable Programming (v0.9.8 — The Breakthrough)
&lt;/h3&gt;

&lt;p&gt;Released June 1, 2026, v0.9.8 adds what I believe is the &lt;strong&gt;only quantum-native automatic differentiation engine for XY Hamiltonians&lt;/strong&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;scpn_quantum_control.differentiable&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;parameter_shift_gradient&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;scpn_quantum_control.differentiable&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;GradientTape&lt;/span&gt;

&lt;span class="c1"&gt;# Parameters: coupling strengths and frequencies
&lt;/span&gt;&lt;span class="n"&gt;params&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;K_01&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mf"&gt;1.2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;K_12&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mf"&gt;1.5&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;omega_0&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mf"&gt;1.0&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;with&lt;/span&gt; &lt;span class="nc"&gt;GradientTape&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;tape&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;result&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;solver&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;run&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;params&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;energy&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;result&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;expectation_value&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

&lt;span class="c1"&gt;# Exact quantum gradients via parameter-shift rule
&lt;/span&gt;&lt;span class="n"&gt;grads&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;tape&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;gradient&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;energy&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;params&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="c1"&gt;# grads["K_01"] = ∂⟨H⟩/∂K_01 = ½[⟨H(K_01+π/2)⟩ − ⟨H(K_01−π/2)⟩]
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is not a toy wrapper. The implementation includes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Backend-neutral parameter-shift&lt;/strong&gt;: Works on simulators and hardware, not just Qiskit Aer&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;JAX bridging&lt;/strong&gt;: Optional &lt;code&gt;jax&lt;/code&gt; extra for JIT compilation and vectorised gradients&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;PennyLane adapter&lt;/strong&gt;: Use PennyLane's optimisers with Kuramoto-XY circuits&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;QSNN trainer integration&lt;/strong&gt;: Train quantum spiking neural networks with backprop&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Reverse-mode AD for linear algebra&lt;/strong&gt;: Compact reverse replay for &lt;code&gt;det&lt;/code&gt;, &lt;code&gt;inv&lt;/code&gt;, &lt;code&gt;solve&lt;/code&gt;, &lt;code&gt;trace&lt;/code&gt;, &lt;code&gt;diag&lt;/code&gt;, and matrix chains — exact adjoints instead of scalar expansion&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Why this matters:&lt;/strong&gt; PennyLane has excellent general-purpose quantum AD, but it does not have native support for Kuramoto-XY Hamiltonians. Qiskit has EstimatorV2 primitives but lacks native auto-diff. This makes &lt;code&gt;scpn-quantum-control&lt;/code&gt; the only tool where you can &lt;strong&gt;train the coupling matrix itself&lt;/strong&gt; via gradient descent on quantum hardware.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. The Hardware Evidence Ledger (Best-in-Class Reproducibility)
&lt;/h3&gt;

&lt;p&gt;Every hardware run produces a &lt;code&gt;HardwareResultPack&lt;/code&gt; with:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Claim classification&lt;/strong&gt;: &lt;code&gt;A&lt;/code&gt; (analytic), &lt;code&gt;B&lt;/code&gt; (simulation), &lt;code&gt;C&lt;/code&gt; (hardware), &lt;code&gt;D&lt;/code&gt; (extrapolation)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Raw counts&lt;/strong&gt;: IBM job IDs, measurement outcomes, calibration data&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Provenance&lt;/strong&gt;: &lt;code&gt;capture_provenance()&lt;/code&gt; records Python version, dependency versions, git commit, environment&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Falsification criteria&lt;/strong&gt;: Every claim states what would prove it wrong&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This is not just "we ran it on hardware." It is &lt;strong&gt;epistemic hygiene&lt;/strong&gt;: a structured way to know what you know, how you know it, and what would change your mind.&lt;/p&gt;

&lt;p&gt;The system is strict enough that it has a "release-readiness audit helper" that blocks version tags if hardware claims are not properly documented.&lt;/p&gt;

&lt;h3&gt;
  
  
  4. Rust Acceleration (5,401× Speedup)
&lt;/h3&gt;

&lt;p&gt;The Hamiltonian construction bottleneck is written in Rust via PyO3:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight rust"&gt;&lt;code&gt;&lt;span class="c1"&gt;// Rust: builds dense XY Hamiltonian matrix&lt;/span&gt;
&lt;span class="k"&gt;pub&lt;/span&gt; &lt;span class="k"&gt;fn&lt;/span&gt; &lt;span class="nf"&gt;build_kuramoto_hamiltonian&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;K_nm&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nb"&gt;f64&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
    &lt;span class="n"&gt;omega&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nb"&gt;f64&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
    &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;usize&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="nb"&gt;Vec&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;Complex64&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c1"&gt;// O(n²) construction, memory-efficient&lt;/span&gt;
    &lt;span class="c1"&gt;// ...&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Benchmarks on an M3 Max:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;n=4&lt;/strong&gt;: Classical ODE 0.4ms vs Rust 0.02ms&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;n=8&lt;/strong&gt;: Classical ODE 1.4ms vs Rust 30ms&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;n=12&lt;/strong&gt;: Classical ODE 2.8ms vs Rust 5,000ms&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;n=16&lt;/strong&gt;: Classical ODE 11ms vs Rust ~2min&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The Rust crate is not a thin wrapper. It is &lt;strong&gt;27 source files&lt;/strong&gt; with a Criterion benchmark harness and a deterministic test suite.&lt;/p&gt;

&lt;h3&gt;
  
  
  5. The Provider-Neutral HAL (15+ Backends)
&lt;/h3&gt;

&lt;p&gt;v0.9.8 introduced a Hardware Abstraction Layer (HAL) with immutable backend profiles and metadata-only discovery for:&lt;/p&gt;

&lt;p&gt;IBM Quantum, IonQ, AWS Braket, Azure Quantum, Quantinuum, Rigetti, QuEra/Bloqade, IQM, Pasqal, OQC, D-Wave, qBraid, Quandela, and local simulators.&lt;/p&gt;

&lt;p&gt;The Qiskit adapter supports base64-QPY and OpenQASM 3 conversion, with an &lt;strong&gt;approval-gated&lt;/strong&gt; Runtime adapter that requires explicit tokens for cloud submission. This is fail-closed by design.&lt;/p&gt;




&lt;h2&gt;
  
  
  Real Hardware Results
&lt;/h2&gt;

&lt;p&gt;We have run circuits on &lt;strong&gt;IBM Heron r2&lt;/strong&gt; (156 qubits, Feb–May 2026). Here is what actually happened:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Experiment&lt;/th&gt;
&lt;th&gt;Qubits&lt;/th&gt;
&lt;th&gt;Depth&lt;/th&gt;
&lt;th&gt;Raw Error&lt;/th&gt;
&lt;th&gt;Claim Class&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;VQE ground state&lt;/td&gt;
&lt;td&gt;4&lt;/td&gt;
&lt;td&gt;12&lt;/td&gt;
&lt;td&gt;0.05%&lt;/td&gt;
&lt;td&gt;C&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Kuramoto R(t)&lt;/td&gt;
&lt;td&gt;4&lt;/td&gt;
&lt;td&gt;85&lt;/td&gt;
&lt;td&gt;7.3%&lt;/td&gt;
&lt;td&gt;C&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Kuramoto scaling&lt;/td&gt;
&lt;td&gt;6&lt;/td&gt;
&lt;td&gt;147&lt;/td&gt;
&lt;td&gt;9.3%&lt;/td&gt;
&lt;td&gt;C&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;UPDE (uniform)&lt;/td&gt;
&lt;td&gt;16&lt;/td&gt;
&lt;td&gt;770&lt;/td&gt;
&lt;td&gt;46%&lt;/td&gt;
&lt;td&gt;C&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The 46% error at 16 qubits is not a failure. It is a &lt;strong&gt;measurement of the NISQ coherence wall&lt;/strong&gt; at depth 250–400 on Heron r2. We are working on mitigation (ZNE, GUESS, DD), but the raw data is honest.&lt;/p&gt;

&lt;p&gt;The DLA Parity Theorem — an exact closed-form result for the dimension of the dynamical Lie algebra of XY Hamiltonians — has been validated on hardware with 342 circuits across two phases.&lt;/p&gt;




&lt;h2&gt;
  
  
  Real-World Applications
&lt;/h2&gt;

&lt;p&gt;This is not just theory. The framework has application plugins for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Neuroscience&lt;/strong&gt;: 109-subject EEGMMIDB baseline analysis, phase-locking value (PLV) computation on quantum hardware&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Fusion energy&lt;/strong&gt;: ITER disruption prediction bridge contract with classifier API and 11-feature ordering&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Power grids&lt;/strong&gt;: IEEE 5-bus and 14-bus measured-system coupling artefacts&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Plasma physics&lt;/strong&gt;: H-mode pedestal width prediction via quantum regression&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These are not toy examples. The ITER contract includes tamper-evident digests and a downstream non-admission policy.&lt;/p&gt;




&lt;h2&gt;
  
  
  Engineering Discipline
&lt;/h2&gt;

&lt;p&gt;I want to highlight the infrastructure because I think it matters:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;9,139 tests&lt;/strong&gt; with &lt;strong&gt;97%+ coverage&lt;/strong&gt; (measured, not estimated)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;46 Hypothesis fuzz tests&lt;/strong&gt; for property-based checking&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Mutation testing&lt;/strong&gt; via &lt;code&gt;mutmut&lt;/code&gt; to verify test quality&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Performance regression&lt;/strong&gt; suite ensuring Rust stays ≥2× faster than Python&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Cross-validation&lt;/strong&gt; against QuTiP and Dynamiqs (43 tests)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;SBOM generation&lt;/strong&gt; for every release&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Secret scanning&lt;/strong&gt; with gitleaks and custom vault-pattern scanner&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Structured logging&lt;/strong&gt; via &lt;code&gt;structlog&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Capability manifest&lt;/strong&gt; system generating JSON/Markdown inventory&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Software Heritage&lt;/strong&gt; archival (SWHID recorded)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Zenodo&lt;/strong&gt; DOI: &lt;code&gt;10.5281/zenodo.18821930&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This is the kind of engineering I would expect from a production SaaS product, not an academic quantum simulation tool.&lt;/p&gt;




&lt;h2&gt;
  
  
  Honest Limitations
&lt;/h2&gt;

&lt;p&gt;I am not going to pretend this is perfect. Here are the real problems:&lt;/p&gt;

&lt;h3&gt;
  
  
  1. The License
&lt;/h3&gt;

&lt;p&gt;The project is under &lt;strong&gt;AGPL-3.0-or-later&lt;/strong&gt; with a commercial dual-licensing option (CHF 49–999/month). This is a legitimate choice for copyleft, but it creates adoption friction. Many enterprises have "no AGPL" policies. Startups may not afford the commercial license.&lt;/p&gt;

&lt;p&gt;I am documenting a potential lightweight core split (Apache-2.0 for the compiler and AD engine, AGPL for hardware runners and application plugins), but this is not yet implemented. If you are a commercial user, you need to contact me.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Single Maintainer
&lt;/h3&gt;

&lt;p&gt;This is a &lt;strong&gt;one-person project&lt;/strong&gt;. I am the only committer, the only reviewer, and the only release manager. The bus factor is 1. With 767 Python modules, 1,501 public classes, and 55 Rust bindings, this is not sustainable.&lt;/p&gt;

&lt;p&gt;I am actively looking for co-maintainers. If you understand quantum computing and want to work on something genuinely unique, reach out.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Paper 0 - In progress / But it bloats the ecosystem
&lt;/h3&gt;

&lt;p&gt;466 of the 767 Python modules are generated source-accounting fixtures for an unpublished methodology paper (Paper 0). They are coverage-excluded and do not affect runtime, but they inflate the package size. I need to move these to an optional extra.&lt;/p&gt;

&lt;h3&gt;
  
  
  4. No Quantum Advantage (Yet)
&lt;/h3&gt;

&lt;p&gt;At every scale we can access (n≤16), classical ODE integration beats quantum simulation in both accuracy and speed. The quantum approach is not yet faster or better. It is different — it measures quantum-specific observables (entanglement, OTOC scrambling) that classical simulation cannot. But we have not demonstrated quantum advantage.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Roadmap
&lt;/h2&gt;

&lt;p&gt;Here is what is coming:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;v0.9.9–v0.10.0&lt;/strong&gt; (near term):&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;License core restructure (Apache-2.0 core + AGPL extensions)&lt;/li&gt;
&lt;li&gt;Expanded AD test suite (finite-difference verification, JAX agreement tests)&lt;/li&gt;
&lt;li&gt;Documentation tutorials for gradient-based training&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;v0.10.0–v0.11.0&lt;/strong&gt; (medium term):&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Adaptive Trotter error compensation (auto-adjust reps via commutator norms)&lt;/li&gt;
&lt;li&gt;Quantum Graph Neural Networks (QGNN) for learning optimal coupling structures&lt;/li&gt;
&lt;li&gt;QSaaS API prototype (FastAPI REST for cloud synchronisation analysis)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;v0.12.0+&lt;/strong&gt; (long term):&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Real-time quantum feedback control (mid-circuit measurement → classical processing → parameter adjustment)&lt;/li&gt;
&lt;li&gt;Symmetry-based error mitigation using DLA parity as real-time syndrome&lt;/li&gt;
&lt;li&gt;Neuromorphic-quantum hybrid interface (bridge to &lt;code&gt;sc-neurocore&lt;/code&gt;)&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Who Should Use This?
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;You should consider &lt;code&gt;scpn-quantum-control&lt;/code&gt; if:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;You are simulating &lt;strong&gt;coupled oscillator networks&lt;/strong&gt; (Kuramoto, XY, Heisenberg) on quantum hardware&lt;/li&gt;
&lt;li&gt;You need &lt;strong&gt;exact quantum gradients&lt;/strong&gt; for variational optimisation of coupling parameters&lt;/li&gt;
&lt;li&gt;You are building &lt;strong&gt;quantum spiking neural networks&lt;/strong&gt; (QSNN)&lt;/li&gt;
&lt;li&gt;You require &lt;strong&gt;hardware evidence ledgers&lt;/strong&gt; for reproducible NISQ experiments&lt;/li&gt;
&lt;li&gt;You are working on &lt;strong&gt;quantum-classical co-simulation&lt;/strong&gt; for complex systems (EEG, plasma, power grids)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;You should probably use Qiskit or PennyLane if:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;You need general-purpose quantum circuits (arbitrary gates, no network structure)&lt;/li&gt;
&lt;li&gt;You are doing standard quantum ML (QAOA, VQE on molecular Hamiltonians)&lt;/li&gt;
&lt;li&gt;You need a massive community and ecosystem (tutorials, Stack Overflow, enterprise support)&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;&lt;strong&gt;How to Try It&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pip &lt;span class="nb"&gt;install &lt;/span&gt;scpn-quantum-control
&lt;span class="c"&gt;# or with JAX support:&lt;/span&gt;
pip &lt;span class="nb"&gt;install &lt;/span&gt;scpn-quantum-control[jax]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The repository is at &lt;a href="https://github.com/anulum/scpn-quantum-control" rel="noopener noreferrer"&gt;github.com/anulum/scpn-quantum-control&lt;/a&gt;. The documentation is at &lt;a href="https://anulum.github.io/scpn-quantum-control" rel="noopener noreferrer"&gt;anulum.github.io/scpn-quantum-control&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;For hardware access, you will need credentials for your chosen backend (IBM Quantum, AWS Braket, etc.). The framework supports local simulation out of the box via Qiskit Aer.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Final Thoughts&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;scpn-quantum-control&lt;/code&gt; is not trying to be everything to everyone. It is trying to do one thing exceptionally well: &lt;strong&gt;simulate coupled oscillator networks on quantum hardware with rigorous evidence and exact gradients&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;The field of quantum computing has enough general frameworks. What it needs is &lt;strong&gt;specialised tools&lt;/strong&gt; built with production-grade discipline for specific scientific domains. This is one of them.&lt;/p&gt;

&lt;p&gt;If you work on quantum networks, synchronisation theory, or NISQ simulation, I would welcome your feedback, your bug reports, and ideally your contributions.&lt;/p&gt;

&lt;p&gt;The code is there. The tests are there. The hardware evidence is there. The gradients are there.&lt;/p&gt;

&lt;p&gt;Now we need to make it accessible.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;em&gt;I appreciate sharing, Likes, Contributions, Sponsoring / Donations to keep me going. We are open for collaboration.&lt;/em&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;em&gt;Miroslav Šotek is the author of &lt;code&gt;scpn-quantum-control&lt;/code&gt; and &lt;code&gt;sc-neurocore&lt;/code&gt;. He works on quantum simulation of complex networks and neuromorphic computing. The project is archived on Software Heritage and indexed in the Qiskit Ecosystem Catalog.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;License: AGPL-3.0-or-later / Commercial. DOI: 10.5281/zenodo.18821930&lt;/em&gt;&lt;/p&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

</description>
      <category>quantumcomputing</category>
      <category>opensource</category>
      <category>differentiableprogramming</category>
      <category>rust</category>
    </item>
    <item>
      <title>I Built a Tokamak Control System Alone. Here's What I Learned About Writing Software That Can't Fail.</title>
      <dc:creator>Miroslav Šotek</dc:creator>
      <pubDate>Mon, 08 Jun 2026 12:06:41 +0000</pubDate>
      <link>https://dev.to/anulum/i-built-a-tokamak-control-system-alone-heres-what-i-learned-about-writing-software-that-cant-4pdo</link>
      <guid>https://dev.to/anulum/i-built-a-tokamak-control-system-alone-heres-what-i-learned-about-writing-software-that-cant-4pdo</guid>
      <description>&lt;p&gt;&lt;strong&gt;What happens when you apply production-grade security, formal verification, and 3,300+ tests to a physics problem most people solve with MATLAB scripts.&lt;/strong&gt;&lt;/p&gt;




&lt;h3&gt;
  
  
  The Audacity
&lt;/h3&gt;

&lt;p&gt;A year ago, I started building &lt;a href="https://github.com/anulum/scpn-control" rel="noopener noreferrer"&gt;SCPN-Control&lt;/a&gt; — a framework for controlling tokamak fusion reactors. By myself. As a solo developer.&lt;/p&gt;

&lt;p&gt;If you know anything about fusion energy, you know this is absurd. Tokamak control is the domain of national labs, billion-dollar collaborations, and teams of fifty physicists. The &lt;a href="https://fusion.gat.com/global/DIII-D/PCS" rel="noopener noreferrer"&gt;DIII-D Plasma Control System&lt;/a&gt; has been in production for twenty years. &lt;a href="https://doi.org/10.1016/j.fusengdes.2011.04.005" rel="noopener noreferrer"&gt;RAPTOR&lt;/a&gt; at EPFL runs on actual hardware at TCV. &lt;a href="https://omfit.io" rel="noopener noreferrer"&gt;OMFIT&lt;/a&gt; at General Atomics has a thousand users.&lt;/p&gt;

&lt;p&gt;I have none of that. I have a laptop, workstation (former Minig Rig) and two rather old servers, a GitHub account, and an unhealthy tolerance for partial differential equations.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;But I also have something those projects don't:&lt;/strong&gt; a neuro-symbolic controller architecture with formal verification, end-to-end differentiable physics, and a safety-case infrastructure that treats a research codebase like flight software.&lt;/p&gt;

&lt;p&gt;This post isn't a sales pitch. It's a technical autopsy of what happens when you build production-grade scientific software without a production team — and why the result might matter even if it never touches a real tokamak.&lt;/p&gt;




&lt;h3&gt;
  
  
  What It Actually Is
&lt;/h3&gt;

&lt;p&gt;SCPN-Control is a multi-layered framework. At the bottom: physics kernels. At the top: a compiler that turns formal specifications into stochastic computing circuits. In between: everything.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Layer 1: The Physics Kernel&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;The &lt;code&gt;core/&lt;/code&gt; module solves the &lt;a href="https://en.wikipedia.org/wiki/Grad%E2%80%93Shafranov_equation" rel="noopener noreferrer"&gt;Grad-Shafranov equation&lt;/a&gt; — the elliptic PDE that describes magnetohydrodynamic equilibrium in a tokamak. This isn't a toy implementation. It supports:&lt;/em&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Fixed and free-boundary&lt;/strong&gt; solvers (SOR, multigrid, Anderson acceleration, Newton-Kantorovich)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;H-mode pedestal profiles&lt;/strong&gt; via the modified hyperbolic tangent (&lt;code&gt;mtanh&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Coil optimization&lt;/strong&gt; with shape, X-point, and divertor target constraints&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Toroidal 1/R stencil&lt;/strong&gt; (not the naive Cartesian Laplacian that most educational codes use)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The solver is written in Python with a Rust acceleration backend, but it falls back to Python gracefully if the native library isn't available. This matters because fusion researchers run code on everything from laptops to HPC clusters.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="c1"&gt;# From src/scpn_control/core/fusion_kernel.py
# The GS* operator — note the sign-corrected toroidal term
&lt;/span&gt;&lt;span class="n"&gt;a_E&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mf"&gt;1.0&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="n"&gt;dR2&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mf"&gt;1.0&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mf"&gt;2.0&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;R_safe&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;dR&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;   &lt;span class="c1"&gt;# East coefficient
&lt;/span&gt;&lt;span class="n"&gt;a_W&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mf"&gt;1.0&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="n"&gt;dR2&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mf"&gt;1.0&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mf"&gt;2.0&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;R_safe&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;dR&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;   &lt;span class="c1"&gt;# West coefficient
&lt;/span&gt;&lt;span class="n"&gt;a_N&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mf"&gt;1.0&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="n"&gt;dZ2&lt;/span&gt;                                      &lt;span class="c1"&gt;# North
&lt;/span&gt;&lt;span class="n"&gt;a_S&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mf"&gt;1.0&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="n"&gt;dZ2&lt;/span&gt;                                      &lt;span class="c1"&gt;# South
&lt;/span&gt;&lt;span class="n"&gt;a_C&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mf"&gt;2.0&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mf"&gt;1.0&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="n"&gt;dR2&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mf"&gt;1.0&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="n"&gt;dZ2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;                &lt;span class="c1"&gt;# Center
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The free-boundary solver is experimental and documented as such. The fixed-boundary solver is robust enough to generate equilibria for controller testing.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Layer 2: The Controller Stack&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;The &lt;code&gt;control/&lt;/code&gt; module implements five NMPC (Nonlinear Model Predictive Control) backends:&lt;/em&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Internal&lt;/strong&gt; — projected gradient descent (fallback, zero dependencies)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;SciPy&lt;/strong&gt; — SLSQP for general nonlinear problems&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;OSQP&lt;/strong&gt; — first-order ADMM for sparse, real-time problems&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;CasADi&lt;/strong&gt; — IPOPT with exact Hessian for research&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;acados&lt;/strong&gt; — structure-exploiting SQP with HPIPM, the solver used in autonomous vehicles and robotics&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The acados integration is the one I care about. It uses an augmented-state formulation for slew-rate constraints, validates dynamics residuals post-solve, and fails closed if the solver status isn't zero.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="c1"&gt;# From src/scpn_control/control/nmpc_controller.py
# Augmented state: [x_k, u_{k-1}] for slew-rate constraints
&lt;/span&gt;&lt;span class="n"&gt;model&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;disc_dyn_expr&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;ca&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;vertcat&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;x_next&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;  &lt;span class="c1"&gt;# u becomes next u_last
&lt;/span&gt;&lt;span class="n"&gt;model&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;con_h_expr&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;u&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;u_last&lt;/span&gt;                &lt;span class="c1"&gt;# slew-rate constraint
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;But the part that's actually unique is the transport gradient tuning. Using JAX, the controller can backpropagate through the gyrokinetic transport model to optimize source schedules. This means the MPC doesn't just optimize control actions — it optimizes the &lt;em&gt;physics model&lt;/em&gt; it's using.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="c1"&gt;# JAX autodiff through transport — unique in fusion control
&lt;/span&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;tune_transport_coefficients_for_tracking&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;...):&lt;/span&gt;
    &lt;span class="c1"&gt;# Gradient of tracking error w.r.t. transport coefficients
&lt;/span&gt;    &lt;span class="c1"&gt;# Finite-difference audit enforced by default
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;No other fusion control framework has end-to-end differentiable transport. This is either brilliant or insane, and I'm not sure which yet.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Layer 3: The Neuro-Symbolic Compiler&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;This is the part that makes SCPN-Control different from every other plasma control project.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;scpn/&lt;/code&gt; module implements a &lt;strong&gt;Stochastic Petri Net&lt;/strong&gt; compiler. You write a control policy as a Petri net — places, transitions, inhibitor arcs, timing delays — and the compiler turns it into a &lt;strong&gt;stochastic computing circuit&lt;/strong&gt; that runs on deterministic bitstreams.&lt;/p&gt;

&lt;p&gt;Why stochastic computing? Because it's inherently fault-tolerant. A bit-flip in a stochastic bitstream changes the probability by 1/N, not by orders of magnitude. For a fusion reactor where a controller failure means a $2 billion machine eats itself, this matters.&lt;/p&gt;

&lt;p&gt;The compiler produces two paths:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Oracle path&lt;/strong&gt;: standard floating-point arithmetic for debugging&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Stochastic path&lt;/strong&gt;: bitstream-based computation with antithetic variates
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="c1"&gt;# From src/scpn_control/scpn/controller.py
# Antithetic variates for variance reduction
&lt;/span&gt;&lt;span class="n"&gt;base&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;rng&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;random&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="n"&gt;n_pairs&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;_nT&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;span class="n"&gt;low_hits&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;sum&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;base&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;p_fire&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="bp"&gt;None&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;:],&lt;/span&gt; &lt;span class="n"&gt;axis&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;high_hits&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;sum&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;base&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mf"&gt;1.0&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;p_fire&lt;/span&gt;&lt;span class="p"&gt;)[&lt;/span&gt;&lt;span class="bp"&gt;None&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;:],&lt;/span&gt; &lt;span class="n"&gt;axis&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;counts&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;low_hits&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;high_hits&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The stochastic path is deterministic (seeded RNG), reproducible, and formally verifiable. Which brings me to the part I'm actually proud of.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Security Story
&lt;/h2&gt;

&lt;p&gt;Scientific software is usually terrible at security. Researchers write code that reads arbitrary files, executes shell commands, and exposes internal state over the network because "it's just for internal use."&lt;/p&gt;

&lt;p&gt;I treated this like flight software from day one.&lt;/p&gt;

&lt;h3&gt;
  
  
  WebSocket Hardening
&lt;/h3&gt;

&lt;p&gt;The &lt;code&gt;phase/&lt;/code&gt; module exposes tokamak state over WebSockets for real-time monitoring. The original implementation was an unauthenticated pipe. The current version has:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Bearer token + API key authentication&lt;/li&gt;
&lt;li&gt;Token-bucket rate limiting (20 commands/sec per client)&lt;/li&gt;
&lt;li&gt;TLS enforcement with loopback-only default&lt;/li&gt;
&lt;li&gt;Browser origin allowlisting&lt;/li&gt;
&lt;li&gt;Command allowlisting (&lt;code&gt;set_psi&lt;/code&gt;, &lt;code&gt;set_pac_gamma&lt;/code&gt;, &lt;code&gt;reset&lt;/code&gt;, &lt;code&gt;stop&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;64KB payload caps&lt;/li&gt;
&lt;li&gt;Timeout-based backpressure with explicit disconnect counters
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="c1"&gt;# From src/scpn_control/phase/ws_phase_stream.py
&lt;/span&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;_bucket_rate_limited&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;buckets&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;key&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;now&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="n"&gt;capacity&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;float&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;command_rate_limit&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;refill_rate&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;capacity&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;command_rate_window_s&lt;/span&gt;
    &lt;span class="n"&gt;updated_at&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;tokens&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;buckets&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;key&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;now&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;capacity&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
    &lt;span class="n"&gt;elapsed&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;max&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mf"&gt;0.0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;now&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;updated_at&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;tokens&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;min&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;capacity&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;tokens&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;elapsed&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;refill_rate&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;limited&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;tokens&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="mf"&gt;1.0&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="ow"&gt;not&lt;/span&gt; &lt;span class="n"&gt;limited&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;tokens&lt;/span&gt; &lt;span class="o"&gt;-=&lt;/span&gt; &lt;span class="mf"&gt;1.0&lt;/span&gt;
    &lt;span class="n"&gt;buckets&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;key&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;now&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;tokens&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;limited&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  C++ Compilation Sandbox
&lt;/h3&gt;

&lt;p&gt;The Rust/C++ solver is compiled on-demand if the prebuilt binary isn't available. The compilation path now has:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;SHA-256 source verification against a manifest&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;hmac.compare_digest&lt;/code&gt; for timing-safe comparison&lt;/li&gt;
&lt;li&gt;Stack canaries (&lt;code&gt;-fstack-protector-strong&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;Full RELRO binding (&lt;code&gt;-Wl,-z,relro -Wl,-z,now&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;-mtune=generic&lt;/code&gt; instead of &lt;code&gt;-march=native&lt;/code&gt; (CPU feature leak eliminated)&lt;/li&gt;
&lt;li&gt;120-second compilation timeout&lt;/li&gt;
&lt;li&gt;Minimal environment (only PATH, TMPDIR, SystemRoot preserved)&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Fault Injection Gating
&lt;/h3&gt;

&lt;p&gt;The stochastic controller has a bit-flip fault injection mode for testing. It requires &lt;strong&gt;two independent gates&lt;/strong&gt; to enable:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="c1"&gt;# Double-gated — nuclear safety standard
&lt;/span&gt;&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;_sc_bitflip_rate&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="mf"&gt;0.0&lt;/span&gt; &lt;span class="ow"&gt;and&lt;/span&gt; &lt;span class="ow"&gt;not&lt;/span&gt; &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;_allow_fault_injection&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="k"&gt;raise&lt;/span&gt; &lt;span class="nc"&gt;ValueError&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;sc_bitflip_rate &amp;gt; 0 requires allow_fault_injection=True.&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;_sc_bitflip_rate&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="mf"&gt;0.0&lt;/span&gt; &lt;span class="ow"&gt;and&lt;/span&gt; &lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;environ&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;SCPN_ALLOW_CONTROLLER_FAULT_INJECTION&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;1&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="k"&gt;raise&lt;/span&gt; &lt;span class="nc"&gt;ValueError&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;sc_bitflip_rate &amp;gt; 0 requires SCPN_ALLOW_CONTROLLER_FAULT_INJECTION=1.&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is how SCRAM systems work. You don't accidentally enable safety overrides.&lt;/p&gt;

&lt;h3&gt;
  
  
  Path Traversal Elimination
&lt;/h3&gt;

&lt;p&gt;JSONL logging is constrained to a verified root directory with symlink protection:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;_resolve_jsonl_log_path&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;log_path&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;log_root&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="n"&gt;resolved&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;candidate&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;resolve&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;strict&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="bp"&gt;False&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;try&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;resolved&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;relative_to&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;root&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;except&lt;/span&gt; &lt;span class="nb"&gt;ValueError&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;exc&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="k"&gt;raise&lt;/span&gt; &lt;span class="nc"&gt;ValueError&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;log_path must resolve under log_root.&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="n"&gt;exc&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;resolved&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;suffix&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;.jsonl&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="k"&gt;raise&lt;/span&gt; &lt;span class="nc"&gt;ValueError&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;log_path must use a .jsonl suffix.&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Is this overkill for a research project? Yes. But the discipline carries over. When you write every path resolution as if an attacker controls the input, you stop writing bugs even when no attacker exists.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Formal Verification Layer
&lt;/h2&gt;

&lt;p&gt;This is where I think SCPN-Control is genuinely ahead of the curve — not just for fusion, but for control systems in general.&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;scpn/&lt;/code&gt; module includes a &lt;strong&gt;Z3 bounded model checking&lt;/strong&gt; integration for compiled Petri net controllers. It proves:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Place invariants&lt;/strong&gt;: Markings never exceed bounds&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Temporal response&lt;/strong&gt;: If condition A fires, condition B responds within N steps&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Recurrence&lt;/strong&gt;: Certain states are always revisited&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Exclusivity&lt;/strong&gt;: Conflicting actions never fire simultaneously&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Each proof produces a manifest with SHA-256 digests, schema versioning, and mandatory counterexample paths for failed proofs. The safety-case infrastructure requires:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Formal controller proof (Z3/SMT)&lt;/li&gt;
&lt;li&gt;Audited differentiable-transport evidence (JAX + finite-difference validation)&lt;/li&gt;
&lt;li&gt;Digital-twin update evidence (TRANSP/TSC backed)&lt;/li&gt;
&lt;li&gt;All bound to a canonical controller artifact digest&lt;/li&gt;
&lt;li&gt;Explicit readiness gate — &lt;strong&gt;blocked until all evidence is present&lt;/strong&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="c1"&gt;# Safety-case admission — fail-closed
&lt;/span&gt;&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="ow"&gt;not&lt;/span&gt; &lt;span class="n"&gt;manifest&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;has_all_required_evidence&lt;/span&gt;&lt;span class="p"&gt;():&lt;/span&gt;
    &lt;span class="k"&gt;raise&lt;/span&gt; &lt;span class="nc"&gt;SafetyCaseNotReadyError&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Controller artifact lacks required evidence.&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is 10 CFR 50 nuclear safety documentation standard. For a solo project. Written by one person.&lt;/p&gt;

&lt;p&gt;I don't know if this makes me disciplined or delusional. But I know no other fusion control project has formal verification of controller logic.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Honesty Problem
&lt;/h2&gt;

&lt;p&gt;Here's where I stop talking about what's good and tell you what's broken.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;49 out of 50 physics fidelity gaps are still open.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The ROADMAP explicitly states:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;"Local-dispersion path overpredicts the GENE CBC reference"&lt;/li&gt;
&lt;li&gt;"Latest 2000-step adiabatic run did not reach saturated chi_i"&lt;/li&gt;
&lt;li&gt;"Do not publish a saturated CBC chi_i value until the longer campaign passes"&lt;/li&gt;
&lt;li&gt;"Must not be presented as quantitative cross-code agreement"&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The native TGLF-equivalent transport model exists. The nonlinear gyrokinetic solver exists. But they haven't been quantitatively compared against real TGLF or GENE runs. The infrastructure is there — interfaces to GACODE, GENE, GS2, CGYRO, QuaLiKiz — but the evidence isn't.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;There is no real hardware timing evidence yet.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The E2E latency benchmark infrastructure is tamper-evident and schema-versioned, but all measurements are synthetic. I haven't run the control loop on a Raspberry Pi 4 or Jetson Nano and published p50/p95/p99 distributions. The &amp;lt;1ms real-time claim is theoretical.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The H-mode Newton Jacobian is incomplete.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The fixed-boundary Newton solver uses a Jacobian derived for L-mode linear profiles. For H-mode &lt;code&gt;mtanh&lt;/code&gt; profiles, the Jacobian is wrong, which means convergence is unreliable for the most physically relevant regime.&lt;/p&gt;

&lt;p&gt;I document all of this. The ROADMAP is 50+ entries of "not done yet." But documentation doesn't close gaps. Only work does.&lt;/p&gt;




&lt;h2&gt;
  
  
  What I Learned About Building Software Alone
&lt;/h2&gt;

&lt;p&gt;If you're a solo developer building something ambitious, here's what actually matters:&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Test Coverage Is a Forcing Function
&lt;/h3&gt;

&lt;p&gt;I have 3,300+ tests and 99%+ coverage. Not because I'm a testing zealot, but because without a team to catch my mistakes, the tests are the team. The CI runs 25 jobs across Linux, Windows, and macOS. Every PR gate fails if coverage drops by 0.1%.&lt;/p&gt;

&lt;p&gt;The ratchet effect is real: once you have 99% coverage, you can't justify a lazy commit that drops it to 98%. The number forces discipline.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Security Hardening Is Just Input Validation at Scale
&lt;/h3&gt;

&lt;p&gt;Every security fix I implemented was fundamentally about validating assumptions:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Is this file path where I think it is?&lt;/li&gt;
&lt;li&gt;Is this config value finite and positive?&lt;/li&gt;
&lt;li&gt;Is this library the one I compiled?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;When you write every function as if the caller is malicious, you write better code even for internal APIs. The WebSocket hardening made the streaming layer more robust against network partitions. The C++ compilation sandbox caught a &lt;code&gt;-march=native&lt;/code&gt; portability bug. Security and correctness are the same thing viewed from different angles.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Type Hints Are Documentation That Doesn't Lie
&lt;/h3&gt;

&lt;p&gt;The entire codebase uses &lt;code&gt;from __future__ import annotations&lt;/code&gt; and strict type hints. Pydantic v2 models validate configs at the boundary. This isn't just for IDE autocomplete — it's for catching physics bugs.&lt;/p&gt;

&lt;p&gt;When &lt;code&gt;plasma_current_target&lt;/code&gt; is typed as &lt;code&gt;float&lt;/code&gt; and validated as &lt;code&gt;&amp;gt; 0&lt;/code&gt;, you can't accidentally pass a negative current or a string. In scientific computing where a sign error means the plasma goes the wrong way, this matters.&lt;/p&gt;

&lt;h3&gt;
  
  
  4. Honest Documentation Builds Trust Faster Than Hype
&lt;/h3&gt;

&lt;p&gt;The ROADMAP says "49 open fidelity gaps." The README says "requires external resources for experimental validation." The code says &lt;code&gt;raise ValueError("degenerate equilibrium")&lt;/code&gt; instead of silently returning NaN.&lt;/p&gt;

&lt;p&gt;This is terrible marketing. It's excellent engineering. The fusion community is skeptical of unvalidated claims — with good reason. I'd rather have ten people trust the code because the limitations are explicit than a thousand people distrust it because I oversold.&lt;/p&gt;

&lt;h3&gt;
  
  
  5. The "Kitchen Sink" Problem Is Real (for now)
&lt;/h3&gt;

&lt;p&gt;The project has 57+ modules. Equilibrium, transport, MHD, edge physics, neural nets, RL, stochastic computing, FPGA export, real-time control, federated learning, formal verification.&lt;/p&gt;

&lt;p&gt;Each of these is a career. Together, they're a maintenance burden. The risk isn't that any single module is wrong — it's that the integration surface becomes too large to validate.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;My current strategy:&lt;/strong&gt; extract a &lt;code&gt;scpn-core&lt;/code&gt; package with just the GS solver + basic controllers, and keep &lt;code&gt;scpn-control&lt;/code&gt; as the full framework. The Unix philosophy applies even to tokamaks.&lt;/p&gt;




&lt;h2&gt;
  
  
  Where This Goes Next
&lt;/h2&gt;

&lt;p&gt;The immediate priorities are unglamorous:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Hardware timing evidence.&lt;/strong&gt; Run the E2E benchmark on a Raspberry Pi 4. Measure p50/p95/p99. Publish the results.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Close 5-10 physics fidelity gaps.&lt;/strong&gt; Install GACODE. Run native TGLF-equivalent vs real TGLF. Document agreement.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Fix the H-mode Jacobian.&lt;/strong&gt; Implement &lt;code&gt;mtanh&lt;/code&gt; derivative for the Newton solver.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The medium-term goals are where the project gets interesting:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;End-to-end differentiable scenario:&lt;/strong&gt; Couple JAX GS solver → differentiable transport → NMPC. Gradient-through-equilibrium is genuinely unique — no one has this.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Certified neuro-symbolic control:&lt;/strong&gt; Expand Z3 proofs to CTL/LTL specifications. Auto-generate safety certificates. This could be the basis for ITER safety documentation.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Cross-facility federated learning:&lt;/strong&gt; Extend the FedAvg/FedProx disruption predictor with differential privacy guarantees. Multi-site learning without data sharing.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Why You Should Care (Even If You Don't Care About Fusion)
&lt;/h2&gt;

&lt;p&gt;If you're a software engineer, SCPN-Control is a case study in what happens when you apply production discipline to a research problem. Most scientific code is written to produce a paper. This is written to produce a system.&lt;/p&gt;

&lt;p&gt;If you're a physicist, the neuro-symbolic controller architecture is a genuinely new approach to safety-critical control. Stochastic computing + formal verification + differentiable physics is a combination that doesn't exist anywhere else.&lt;/p&gt;

&lt;p&gt;If you're a solo developer wondering if you can build something that competes with teams of fifty people: you can. But you have to be more disciplined than they are. You don't have a colleague to catch your sign errors. You have tests, types, and the humility to document what you don't know.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Code
&lt;/h2&gt;

&lt;p&gt;SCPN-Control is open source under AGPL-3.0-or-later with commercial licensing available.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;GitHub:&lt;/strong&gt; &lt;a href="https://github.com/anulum/scpn-control" rel="noopener noreferrer"&gt;github.com/anulum/scpn-control&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Docs:&lt;/strong&gt; README + ROADMAP (the ROADMAP is the most honest document I've ever written)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Tests:&lt;/strong&gt; &lt;code&gt;pytest&lt;/code&gt; with 3,300+ cases, 99%+ coverage&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Install:&lt;/strong&gt; &lt;code&gt;pip install scpn-control&lt;/code&gt; (with optional dependencies for acados, JAX, etc.)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I'm not asking for stars (yet I don't mind them). I'm asking for scrutiny. If you know plasma physics, tear apart the transport solver. If you know control theory, break the NMPC. If you know security, find the holes I missed.&lt;/p&gt;

&lt;p&gt;The project is only useful if it's correct. And it's only correct if people prove it wrong.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;I appreciate sharing, Likes, Contributions, Sponsoring / Donations to keep me going, we are open for collaboration.&lt;/em&gt;&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Miroslav Šotek builds software for problems that are supposed to require teams. He is usually wrong about how hard things are, but occasionally right about how to build them.&lt;/em&gt;&lt;/p&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

</description>
      <category>rust</category>
      <category>fusionenergy</category>
      <category>formalverification</category>
      <category>lowlatencycontrolsystems</category>
    </item>
    <item>
      <title>SCPN Fusion Core: A Control-First, Neuro-Symbolic Software Stack for Tokamak Plasma Control</title>
      <dc:creator>Miroslav Šotek</dc:creator>
      <pubDate>Mon, 08 Jun 2026 11:28:57 +0000</pubDate>
      <link>https://dev.to/anulum/scpn-fusion-core-a-control-first-neuro-symbolic-software-stack-for-tokamak-plasma-control-1b2a</link>
      <guid>https://dev.to/anulum/scpn-fusion-core-a-control-first-neuro-symbolic-software-stack-for-tokamak-plasma-control-1b2a</guid>
      <description>&lt;p&gt;&lt;a href="https://github.com/anulum/scpn-fusion-core" rel="noopener noreferrer"&gt;SCPN-FUSION-CORE ON GITHUB&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We built an open-source software laboratory that treats tokamak plasma control as a compiler problem. Control logic is expressed in formally verifiable Petri nets, compiled to spiking neural networks, and executed at sub-microsecond latencies against physics-informed plant models. It is not a replacement for billion-dollar physics solvers. It is a framework for building, validating, and hardening control algorithms before they touch billion-dollar hardware.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why Fusion Control Needs a New Software Stack
&lt;/h2&gt;

&lt;p&gt;Nuclear fusion is having a moment. SPARC is aiming for Q ≥ 10. ITER is commissioning its plasma control system. Dozens of private companies are racing toward net energy. But behind the headlines, a quieter crisis is unfolding: &lt;strong&gt;the software that controls these machines is not keeping up with the physics.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Tokamak control is a trilemma. You need:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Physical realism&lt;/strong&gt; — the controller must respect magnetohydrodynamics, transport, and stability limits.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Real-time execution&lt;/strong&gt; — plasma evolution happens in milliseconds; control loops must close in microseconds.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Auditable safety&lt;/strong&gt; — when a plasma disrupts, the cost is measured in millions of dollars and months of downtime. The control logic must be inspectable, reproducible, and bounded.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Most existing tools optimize one vertex of this triangle and leave the others informal. Physics codes like GENE, CGYRO, or TRANSP solve the first problem brilliantly, but they run for hours on supercomputers. Control systems like the ITER Plasma Control System (PCS) solve the second and third, but they are bespoke, proprietary, and hard to test against realistic physics outside of the machine itself.&lt;/p&gt;

&lt;p&gt;We started SCPN Fusion Core with a simple inversion: &lt;strong&gt;make control the primary artifact, and treat physics as the plant model it operates against.&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  The SCPN Approach: Three Unusual Bets
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Bet 1: Control-First Architecture&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Instead of solving transport equations and then "bolting on" a controller, we designed the stack from the control loop outward. The central abstraction is a &lt;strong&gt;stochastic Petri net&lt;/strong&gt; — a graph of places, transitions, and contracts that encodes control logic in a formally inspectable way. This net compiles to a &lt;strong&gt;spiking neural network (SNN)&lt;/strong&gt; of leaky integrate-and-fire (LIF) neurons, which executes at hardware-compatible latencies.&lt;/p&gt;

&lt;p&gt;The pipeline looks like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Petri Net (places + transitions + safety contracts)
    |
    v  compiler.py — structure-preserving mapping
Stochastic LIF Network (neurons + synapses + thresholds)
    |
    v  controller.py — closed-loop execution
Real-Time Plasma Control (sub-millisecond, deterministic replay)
    |
    v  artifact.py — versioned, signed compilation artifact
Deployment Package (JSON + schema + git SHA)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is not a metaphor. The compiler is implemented in Python, the real-time kernel is in Rust, and the compilation artifact is a signed, schema-versioned JSON bundle that can be audited before deployment.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Bet 2: Evidence-Bounded Claims&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Fusion software has a credibility problem. It is easy to write a module called &lt;code&gt;gyrokinetic_transport.py&lt;/code&gt; and imply that it replaces a $50M code. It is much harder to prove it.&lt;/p&gt;

&lt;p&gt;We adopted a &lt;strong&gt;fail-closed&lt;/strong&gt; validation philosophy. Every scientific claim in the repository is tracked in a machine-readable report with an explicit status:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Accepted:&lt;/strong&gt; Same-case evidence exists, checksums match, thresholds pass.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Blocked:&lt;/strong&gt; The claim is not yet supported by external reference data.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For example, our native nonlinear gyrokinetic solver has explicit invariant benchmarks and electromagnetic residual diagnostics, but its full-fidelity status is &lt;strong&gt;blocked&lt;/strong&gt; until it produces same-case comparison artifacts against GENE, CGYRO, or GS2. The report is public, the debug traces are row-level, and the thresholds are declared in advance. We do not hide incomplete work in prose.&lt;/p&gt;

&lt;p&gt;This makes the repository useful &lt;em&gt;before&lt;/em&gt; plant deployment. It is a place to test controller architectures, benchmark kernel choices, and build the documentation discipline needed for later hardware-in-the-loop work.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Bet 3: Formal Verification in Lean 4&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Real-time control of a burning plasma is a safety-critical problem. We believe that claims about safety properties should be machine-checkable, not just well-intentioned.&lt;/p&gt;

&lt;p&gt;SCPN Fusion Core includes a committed &lt;strong&gt;Lean 4&lt;/strong&gt; proof surface. The first machine-checkable theorems prove that:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Invalid Grad-Shafranov case descriptions fail closed (validation errors propagate exactly).&lt;/li&gt;
&lt;li&gt;PID saturation bounds are preserved under normalization and filtering.&lt;/li&gt;
&lt;li&gt;Petri net reachability and token boundedness are preserved by the SNN compiler.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These are intentionally narrow boundaries — we are not claiming to have verified the full plasma solver. But they are a start, and no other open-source fusion project has them.&lt;/p&gt;




&lt;h2&gt;
  
  
  Architecture at a Glance
&lt;/h2&gt;

&lt;p&gt;The repository is a polyglot workspace:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Layer&lt;/th&gt;
&lt;th&gt;Technology&lt;/th&gt;
&lt;th&gt;Role&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Control Compiler&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Python&lt;/td&gt;
&lt;td&gt;Petri net → SNN compilation, contract checking, artifact packaging&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Real-Time Kernels&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Rust (11 crates)&lt;/td&gt;
&lt;td&gt;PID, MPC, transport, ML inference, PyO3 bindings&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Physics Models&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Python + JAX&lt;/td&gt;
&lt;td&gt;Grad-Shafranov, 1.5D transport, gyrokinetic operators, MHD stability&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Validation&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Python + Rust&lt;/td&gt;
&lt;td&gt;Benchmark pipelines, reference data, report generation&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Formal Proofs&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Lean 4&lt;/td&gt;
&lt;td&gt;Safety theorems, CI-checked&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h3&gt;
  
  
  Key Numbers
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;0.52 µs&lt;/strong&gt; — Rust PID kernel step latency (P50), measured via Criterion on an Intel i5-11600K.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;10.5 µs&lt;/strong&gt; — Closed-loop hardware-in-the-loop step latency (P50).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;413 µs&lt;/strong&gt; — Rust full-order Grad-Shafranov SOR solve (33×33).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;~24 ns&lt;/strong&gt; — QLKNN-10D neural transport surrogate per-point inference.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;3,815&lt;/strong&gt; — Test functions (Hypothesis property-based tests in Python, proptest in Rust).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;74&lt;/strong&gt; — Validation scripts producing tracked reports.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  The Three-Path Gyrokinetic Design
&lt;/h3&gt;

&lt;p&gt;We expose three gyrokinetic transport lanes with explicit fidelity limits:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Path&lt;/th&gt;
&lt;th&gt;Fidelity&lt;/th&gt;
&lt;th&gt;Speed&lt;/th&gt;
&lt;th&gt;Module&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;A: External GK&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Reference (when installed)&lt;/td&gt;
&lt;td&gt;Minutes to CPU-hours&lt;/td&gt;
&lt;td&gt;GENE, CGYRO, GS2, TGLF, QUALIKIZ adapters&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;B: Native GK&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Linear + nonlinear 5D operator contracts&lt;/td&gt;
&lt;td&gt;~0.3 s/surface linear&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;gk_eigenvalue&lt;/code&gt;, &lt;code&gt;gk_quasilinear&lt;/code&gt;, &lt;code&gt;gk_nonlinear&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;C: Hybrid Surrogate+GK&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Adaptive&lt;/td&gt;
&lt;td&gt;~24 ns/point&lt;/td&gt;
&lt;td&gt;QLKNN + OOD detector + online corrector&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The hybrid layer validates neural surrogates against GK spot-checks in real time. External adapters carry explicit metadata distinguishing linear from nonlinear electrostatic/electromagnetic models. We do not bundle or replace those solvers; we validate against them.&lt;/p&gt;




&lt;h2&gt;
  
  
  What We Built vs. What We Blocked
&lt;/h2&gt;

&lt;p&gt;Honesty is cheaper than hype. Here is the current capability matrix with explicit blockers:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Built and validated (local contracts):&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Neuro-symbolic SNN compiler with deterministic replay&lt;/li&gt;
&lt;li&gt;Rust real-time PID/MPC kernels&lt;/li&gt;
&lt;li&gt;1.5D coupled transport solver (JAX-differentiable)&lt;/li&gt;
&lt;li&gt;QLKNN-10D and FNO neural surrogates&lt;/li&gt;
&lt;li&gt;Native linear gyrokinetic eigenvalue solver&lt;/li&gt;
&lt;li&gt;7-criterion MHD stability suite&lt;/li&gt;
&lt;li&gt;Disruption chain (thermal quench → current quench → runaway → halo)&lt;/li&gt;
&lt;li&gt;Lean 4 safety proofs for validation error propagation and PID boundedness&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Blocked (waiting for same-case external parity):&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Full nonlinear 5D gyrokinetic turbulence parity vs. GENE/CGYRO/GS2&lt;/li&gt;
&lt;li&gt;Full kinetic runaway-electron distribution parity vs. DREAM&lt;/li&gt;
&lt;li&gt;Charge-state-resolved impurity transport parity vs. Aurora/STRAHL&lt;/li&gt;
&lt;li&gt;EFIT-grade free-boundary equilibrium reconstruction&lt;/li&gt;
&lt;li&gt;Production-scale MPI/multi-GPU scaling evidence&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The blocked items are not hidden. They are tracked in &lt;code&gt;validation/reports/&lt;/code&gt; with row-level debug traces, explicit threshold declarations, and deterministic CI behavior.&lt;/p&gt;




&lt;h2&gt;
  
  
  How It Compares
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Capability&lt;/th&gt;
&lt;th&gt;SCPN&lt;/th&gt;
&lt;th&gt;TORAX&lt;/th&gt;
&lt;th&gt;FUSE&lt;/th&gt;
&lt;th&gt;FreeGSNKE&lt;/th&gt;
&lt;th&gt;DREAM&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Control-first architecture&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;Yes&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Neuro-symbolic SNN compiler&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;Yes&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Real-time kernel &amp;lt;1 µs&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;0.52 µs&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Formal verification&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;Lean 4&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;JAX autodiff transport&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;Yes&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;Yes&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;1.5D coupled transport&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;Yes&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;Yes&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;Yes&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Neural transport surrogate&lt;/td&gt;
&lt;td&gt;QLKNN-10D&lt;/td&gt;
&lt;td&gt;QLKNN-7/10D&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Full GK turbulence&lt;/td&gt;
&lt;td&gt;Blocked&lt;/td&gt;
&lt;td&gt;TGLF only&lt;/td&gt;
&lt;td&gt;TGLF only&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Full kinetic runaway&lt;/td&gt;
&lt;td&gt;Blocked&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;Yes&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Free-boundary GS&lt;/td&gt;
&lt;td&gt;Partial&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;Yes&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;The positioning:&lt;/strong&gt; TORAX is a physics-first transport simulator with excellent JAX autodiff. FUSE is a reactor design framework with OpenMC neutronics. FreeGSNKE is an equilibrium reconstruction tool. DREAM is the runaway-electron gold standard. SCPN is the control layer that can interface with all of them. We are not trying to replace them. We are trying to make it possible to test control algorithms against them without a tokamak.&lt;/p&gt;




&lt;h2&gt;
  
  
  Who This Is For
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Fusion control researchers&lt;/strong&gt; who need a fast, differentiable plant model to prototype controllers.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Validation engineers&lt;/strong&gt; who need reproducible benchmark pipelines with explicit fidelity gates.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Accelerator/GPU teams&lt;/strong&gt; who need deterministic decomposition contracts for production scaling.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Formal methods contributors&lt;/strong&gt; who want to extend machine-checkable safety proofs to physical systems.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Investors&lt;/strong&gt; evaluating whether a fusion team's control software is reproducible before the team has a machine.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Try It
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Install (Python only, Rust optional)&lt;/span&gt;
pip &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-e&lt;/span&gt; &lt;span class="nb"&gt;.&lt;/span&gt;

&lt;span class="c"&gt;# Run a Grad-Shafranov equilibrium&lt;/span&gt;
scpn-fusion kernel

&lt;span class="c"&gt;# Run the tokamak flight simulator&lt;/span&gt;
scpn-fusion flight

&lt;span class="c"&gt;# Run the validation suite&lt;/span&gt;
pytest tests/ &lt;span class="nt"&gt;-x&lt;/span&gt; &lt;span class="nt"&gt;-q&lt;/span&gt;

&lt;span class="c"&gt;# Run the Golden Base notebook&lt;/span&gt;
jupyter notebook examples/neuro_symbolic_control_demo_v2.ipynb

&lt;span class="c"&gt;# Or spin up the Streamlit dashboard&lt;/span&gt;
docker compose up &lt;span class="nt"&gt;--build&lt;/span&gt;  &lt;span class="c"&gt;# localhost:8501&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The Rust backend is optional but recommended for real-time work:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cd &lt;/span&gt;scpn-fusion-rs
cargo build &lt;span class="nt"&gt;--release&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; cargo &lt;span class="nb"&gt;test
&lt;/span&gt;cargo bench  &lt;span class="c"&gt;# Criterion benchmarks&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  The Road Ahead
&lt;/h2&gt;

&lt;p&gt;The next milestones are narrow and specific:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;One accepted full-fidelity artifact.&lt;/strong&gt; We are working to produce a same-case nonlinear gyrokinetic comparison against GENE. One accepted row changes the narrative from "blocked" to "validated."&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Hardware validation.&lt;/strong&gt; We are seeking partnerships with university tokamaks to validate the SNN controller on real hardware. Even a single shot with a compiled Petri-net controller would be a landmark.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Extended formal proofs.&lt;/strong&gt; The Lean surface will expand to cover SNN deterministic replay over seeded stochastic traces, and matrix-level incidence preservation against the Python compiler artifact.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Security hardening.&lt;/strong&gt; We are adding a formal threat model, input fuzzing for GEQDSK/IMAS parsers, and a safety certification roadmap for industrial adoption.&lt;/li&gt;
&lt;/ol&gt;




&lt;h2&gt;
  
  
  License &amp;amp; Commercial Use
&lt;/h2&gt;

&lt;p&gt;SCPN Fusion Core is released under &lt;strong&gt;AGPL-3.0&lt;/strong&gt;. This keeps the open-source stack free and inspectable. For commercial use in proprietary plant software, a separate commercial license is available: &lt;code&gt;protoscience@anulum.li&lt;/code&gt;.&lt;/p&gt;




&lt;h2&gt;
  
  
  Citation
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight bibtex"&gt;&lt;code&gt;&lt;span class="nc"&gt;@software&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nl"&gt;scpn_fusion_core&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;title&lt;/span&gt;   &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;{SCPN Fusion Core: Neuro-Symbolic Tokamak Control Suite}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;author&lt;/span&gt;  &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;{Sotek, Miroslav}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;year&lt;/span&gt;    &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;{2026}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;url&lt;/span&gt;     &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;{https://github.com/anulum/scpn-fusion-core}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;version&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;{3.9.9}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Join Us
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Repository:&lt;/strong&gt; &lt;a href="https://github.com/anulum/scpn-fusion-core" rel="noopener noreferrer"&gt;github.com/anulum/scpn-fusion-core&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Discussions:&lt;/strong&gt; GitHub Discussions for Q&amp;amp;A and ideas&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Documentation:&lt;/strong&gt; &lt;a href="https://anulum.github.io/scpn-fusion-core" rel="noopener noreferrer"&gt;anulum.github.io/scpn-fusion-core&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Contact:&lt;/strong&gt; &lt;a href="mailto:protoscience@anulum.li"&gt;protoscience@anulum.li&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;We are looking for contributors in Rust real-time systems, JAX differentiable physics, formal verification, and tokamak experimental physics. If you believe that control software for fusion should be open, inspectable, and evidence-bounded, we would like to hear from you.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;The project is currently at version 3.9.9. It is not viral. It is not a startup. It is a software laboratory. We are building it because someone has to.&lt;/em&gt; We appreciate sharing, Likes, Contributions, Sponsoring / Donations to keep us going, we are open for collaboration.&lt;/p&gt;

&lt;p&gt;Kindest Regards, Miroslav Šotek, lead researcher.&lt;/p&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

</description>
      <category>rust</category>
      <category>python</category>
      <category>formalverification</category>
      <category>fusionenergy</category>
    </item>
    <item>
      <title>System Architecture: Deterministic Claim-Level Halting for LLM Hallucinations using Rust and Dual-Entropy Scoring</title>
      <dc:creator>Miroslav Šotek</dc:creator>
      <pubDate>Mon, 08 Jun 2026 10:43:08 +0000</pubDate>
      <link>https://dev.to/anulum/system-architecture-deterministic-token-level-halting-for-llm-hallucinations-using-rust-and-2bc4</link>
      <guid>https://dev.to/anulum/system-architecture-deterministic-token-level-halting-for-llm-hallucinations-using-rust-and-2bc4</guid>
      <description>&lt;p&gt;The current standard for LLM hallucination detection is a structural liability. In production enterprise environments, evaluating an output for factual coherence after the entire payload has been generated and transmitted is mathematically and operationally insufficient. In strictly regulated domains—such as financial analytics, compliance frameworks, or clinical data parsing—a single fabricated integer or hallucinated citation invalidates the entire downstream pipeline.&lt;/p&gt;

&lt;p&gt;Auditing the error post-hoc is a failure state. The system must possess the capability to sever the generation in real-time.&lt;/p&gt;

&lt;p&gt;To resolve this, I architected Director-AI (currently at stable release v3.14). It functions as a drop-in middleware circuit breaker that executes deterministic, token-level streaming halts using a dual-entropy scoring engine, powered by Rust-accelerated compute paths.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The Flaw in Post-Hoc Verification&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Most "AI Safety" wrappers operate as parallel or sequential API calls. They wait for the primary LLM to complete its generation, pass the output to an evaluation model, and return a pass/fail boolean. This introduces three critical bottlenecks:&lt;/p&gt;

&lt;p&gt;Massive Latency Overhead: Doubling the time-to-first-token (TTFT) and total generation time.&lt;/p&gt;

&lt;p&gt;Compute Waste: Processing thousands of tokens in a sequence that was already corrupted at token 15.&lt;/p&gt;

&lt;p&gt;Data Exposure: Allowing unverified, potentially non-compliant data to exist in memory or enter logging pipelines.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The Director-AI Solution: Real-Time Interception&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Director-AI sits between the client and the LLM provider as an asynchronous streaming proxy. As tokens are generated, they are buffered in micro-batches and evaluated against a dual-entropy scoring algorithm before being forwarded to the client.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Dual-Entropy Scoring Mechanism&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;The core evaluation logic relies on two distinct axes of verification, combined to calculate a total system entropy state:&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;NLI (Natural Language Inference) Contradiction Detection:&lt;/strong&gt; Evaluates if the current token sequence logically contradicts the established premise or prompt constraints using the 0.4B FactCG-DeBERTa model.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;RAG (Retrieval-Augmented Generation) Fact-Checking:&lt;/strong&gt; Cross-references the emerging semantic claim against a validated vector-database context.&lt;/p&gt;

&lt;p&gt;If the combined entropy exceeds the defined safety threshold, Director-AI immediately terminates the TCP connection to the LLM and injects a standard  exception to the client.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Rust-Accelerated Compute Paths&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;To execute this evaluation without degrading the user experience, the middleware overhead must remain negligible.&lt;/p&gt;

&lt;p&gt;Director-AI shifts intensive operations away from the Python network layer. The v3.14 architecture implements 12 core compute paths natively written in Rust, delivering a 9.4× geometric mean speedup over equivalent Python code blocks. By avoiding garbage-collection pauses and parallelizing tensor evaluations directly on the incoming token stream, it enforces real-time validation. The codebase is backed by over 4,310+ passing tests, guaranteeing strict memory safety and predictable execution under peak API loads.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Cryptographic Auditability for Zero-Tolerance Domains&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;For banking infrastructure and financial analytics systems, simply halting an invalid output is not enough; the security event must be auditable without violating global data privacy laws.&lt;/p&gt;

&lt;p&gt;Director-AI is explicitly architected to align with the EU AI Act, GDPR, and Swiss revDSG frameworks. It achieves this through a zero-knowledge audit pipeline.&lt;/p&gt;

&lt;p&gt;Instead of writing plaintext queries to log files, the AuditLogger processes all telemetry into structured JSONL files, utilising one-way SHA-256 query hashing.&lt;/p&gt;

&lt;p&gt;Operational Impact: System administrators can mathematically prove that a specific guardrail was active and triggered at a precise Unix timestamp, without ever storing, exposing, or caching the user's proprietary, high-sensitivity prompt data.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Deployment Mechanics&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Director-AI operates as a framework-agnostic drop-in. It does not require modifying frontend applications or fine-tuning underlying models. You route your existing OpenAI, Anthropic, or local LLM API base URLs through the Director-AI port, and the middleware handles the token interception autonomously.&lt;/p&gt;

&lt;p&gt;The system is deployed under a dual-licensing model (Apache-2.0 AND BUSL-1.1, v3.14→v3.16. open-core, with proprietary enterprise extensions).&lt;/p&gt;

&lt;p&gt;Examine the open-core capability manifest, architecture diagrams, and deployment instructions on GitHub:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/anulum/director-ai" rel="noopener noreferrer"&gt;https://github.com/anulum/director-ai&lt;/a&gt;&lt;/p&gt;

</description>
      <category>llminfrastructure</category>
      <category>opensource</category>
      <category>aisafety</category>
      <category>rust</category>
    </item>
    <item>
      <title>I built an open-source real-time LLM hallucination guardrail — here are the benchmarks</title>
      <dc:creator>Miroslav Šotek</dc:creator>
      <pubDate>Sun, 29 Mar 2026 01:17:47 +0000</pubDate>
      <link>https://dev.to/anulum/i-built-an-open-source-real-time-llm-hallucination-guardrail-here-are-the-benchmarks-22em</link>
      <guid>https://dev.to/anulum/i-built-an-open-source-real-time-llm-hallucination-guardrail-here-are-the-benchmarks-22em</guid>
      <description>&lt;h2&gt;
  
  
  What is Director-Class AI?
&lt;/h2&gt;

&lt;p&gt;An open-source Python library that guards LLM output in real time. It watches tokens as they stream and halts generation the moment it detects a hallucination.&lt;/p&gt;

&lt;p&gt;It uses &lt;strong&gt;NLI&lt;/strong&gt; (Natural Language Inference via DeBERTa/FactCG) and optional &lt;strong&gt;RAG knowledge grounding&lt;/strong&gt; to score each claim against source documents.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pip &lt;span class="nb"&gt;install &lt;/span&gt;director-ai
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Two-line integration:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;director_ai&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;guard&lt;/span&gt;
&lt;span class="n"&gt;client&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;guard&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;openai&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;OpenAI&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt;  &lt;span class="c1"&gt;# wraps any OpenAI/Anthropic client
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Benchmarks (measured, not aspirational)
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Metric&lt;/th&gt;
&lt;th&gt;Value&lt;/th&gt;
&lt;th&gt;Conditions&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Balanced accuracy&lt;/td&gt;
&lt;td&gt;75.8%&lt;/td&gt;
&lt;td&gt;FactCG on LLM-AggreFact (29,320 samples)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;GPU latency&lt;/td&gt;
&lt;td&gt;14.6ms/pair&lt;/td&gt;
&lt;td&gt;GTX 1060, ONNX, batch=16&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;L40S latency&lt;/td&gt;
&lt;td&gt;0.5ms/pair&lt;/td&gt;
&lt;td&gt;FP16, batch=32&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;E2E catch rate&lt;/td&gt;
&lt;td&gt;90.7%&lt;/td&gt;
&lt;td&gt;Hybrid mode, 600 HaluEval traces&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Rust BM25 speedup&lt;/td&gt;
&lt;td&gt;10.2x&lt;/td&gt;
&lt;td&gt;Over pure Python implementation&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  Framework Integrations
&lt;/h2&gt;

&lt;p&gt;LangChain, LlamaIndex, LangGraph, CrewAI, Haystack, DSPy, Semantic Kernel, and SDK Guard (wraps OpenAI/Anthropic/Bedrock/Gemini/Cohere clients).&lt;/p&gt;

&lt;h2&gt;
  
  
  Honest Limitations
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;NLI-only scoring needs KB grounding for domain use (medical FPR=100% without KB)&lt;/li&gt;
&lt;li&gt;ONNX CPU is slow (383ms/pair) — GPU recommended&lt;/li&gt;
&lt;li&gt;Long documents need &amp;gt;=16GB VRAM&lt;/li&gt;
&lt;li&gt;Summarisation accuracy weakest (AggreFact-CNN 68.8%)&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Quality
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;3,545 tests, 91% coverage&lt;/li&gt;
&lt;li&gt;Sigstore-signed releases, SLSA provenance&lt;/li&gt;
&lt;li&gt;OpenSSF Best Practices: 100%&lt;/li&gt;
&lt;li&gt;19 badges of CI/security health&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Links
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;GitHub&lt;/strong&gt;: &lt;a href="https://github.com/anulum/director-ai" rel="noopener noreferrer"&gt;github.com/anulum/director-ai&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Docs&lt;/strong&gt;: &lt;a href="https://anulum.github.io/director-ai" rel="noopener noreferrer"&gt;anulum.github.io/director-ai&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;PyPI&lt;/strong&gt;: &lt;a href="https://pypi.org/project/director-ai/" rel="noopener noreferrer"&gt;pypi.org/project/director-ai&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;AGPL-3.0 with commercial licensing available.&lt;/p&gt;

&lt;p&gt;Would love feedback from anyone working on LLM reliability, RAG pipelines, or AI safety!&lt;/p&gt;

</description>
      <category>machinelearning</category>
    </item>
  </channel>
</rss>
