Skip to content
Back to search

DarwinCode

🧬 Ultra-Fast Neuro-Symbolic Evolutionary Engine (>300,000 evals/s) for Mathematical Discovery, Symbolic Regression, and Algorithmic Pruning in pure Rust

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/miguelguerra200022-sudo--darwincode/badge.svg)](/listings/miguelguerra200022-sudo--darwincode)

HTML

<a href="/listings/miguelguerra200022-sudo--darwincode"><img src="/api/listings/miguelguerra200022-sudo--darwincode/badge.svg" alt="findsafeskills safety rating" /></a>

Install

i

Install instructions from the README

As written by the repo's author. findsafeskills has not verified these steps.

Prerequisites

- [Rust 1.75+](https://rustup.rs/) (Cargo & rustc)

1. Installation & Build

git clone https://github.com/miguelguerra200022-sudo/DarwinCode.git
cd DarwinCode
cargo build --release

2. Launch the Engine & Web Cockpit

./target/release/darwin_cli

Open **`http://localhost:8080`** in any web browser to observe the live evolutionary stream, topology graphs, and Hall of Fame!

3. Run MCP Server for AI Coding Agents

./target/release/darwin_cli --mcp

4. Direct CLI Synthesis

./target/release/darwin_cli synthesize --inputs x --output float --dataset "[-2, 5], [-1, 2], [0, 1], [1, 2], [2, 5]"

---

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

README.md Β· README Β· 274 lines
  1. <p align="center">
  2. <img src="assets/banner.jpg" alt="DarwinCode Banner" width="100%">
  3. </p>
  4. <p align="center">
  5. <img src="assets/logo.jpg" alt="DarwinCode Logo" width="180px">
  6. </p>
  7. <h1 align="center">🧬 DarwinCode</h1>
  8. <p align="center">
  9. <strong>Ultra-Fast Neuro-Symbolic Evolutionary Engine (>300,000 evals/s) for Symbolic Regression, Algorithmic Pruning, and Mathematical Discovery</strong>
  10. </p>
  11. <p align="center">
  12. <a href="https://www.rust-lang.org"><img src="https://img.shields.io/badge/Language-Rust%202021-orange.svg?style=for-the-badge&logo=rust" alt="Rust 2021"></a>
  13. <a href="LICENSE"><img src="https://img.shields.io/badge/License-Dual%20(PolyForm%20%2B%20Commercial)-blue.svg?style=for-the-badge" alt="License"></a>
  14. <a href="#benchmarks"><img src="https://img.shields.io/badge/Speed-%3E300%2C000%20evals%2Fs-brightgreen.svg?style=for-the-badge" alt="Evaluations"></a>
  15. <a href="#mcp-co-processor"><img src="https://img.shields.io/badge/MCP-12%20Native%20Tools-purple.svg?style=for-the-badge" alt="MCP Compatible"></a>
  16. <a href="#tests"><img src="https://img.shields.io/badge/Tests-66%2F66%20Passing-success.svg?style=for-the-badge" alt="Tests Passing"></a>
  17. </p>
  18. ---
  19. ## 🌌 What is DarwinCode?
  20. **DarwinCode** is a state-of-the-art open-ended neuro-symbolic evolutionary computation engine engineered in pure Rust. It autonomously synthesizes mathematical formulas, algorithms, and computational graphs from empirical datasets using typed grammar-guided genetic programming (GGGP), formal invariant verification, and Occam's razor parsimony pressure.
  21. Unlike deep learning models that hallucinate or require high-end GPU clusters, DarwinCode operates with **zero hallucination**, **deterministic gas-metered execution**, and an **$O(1)$ memory footprint**. Thousands of candidate programs compete in a continuous digital ecosystem, mutating safe Abstract Syntax Tree (AST) subtrees, calibrating constants, and eliminating bloat without ever leaking memory or stalling.
  22. ```
  23. DARWINCODE ARCHITECTURE
  24. [ TARGET DATASET / ENIGMA ] (e.g. Physics law, elliptic curve, fluid dynamics)
  25. β”‚
  26. β–Ό
  27. β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
  28. β”‚ 1. TYPED COMPUTATION DAGs (Genotype Space) β”‚
  29. β”‚ Strict type-safety: Float, Int, Boolean, Vec3D ports β”‚
  30. β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
  31. β”‚
  32. β–Ό
  33. β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
  34. β”‚ 2. SMT-LITE FORMAL VERIFIER β”‚
  35. β”‚ Mathematical guarantees: Zero syntax errors, cycle-free DAGs β”‚
  36. β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
  37. β”‚
  38. β–Ό
  39. β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
  40. β”‚ 3. DETERMINISTIC GAS-METERED VIRTUAL MACHINE β”‚
  41. β”‚ Halting guarantees: Gas-exhaustion bounds, safe math (no NaNs) β”‚
  42. β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
  43. β”‚
  44. β–Ό
  45. β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
  46. β”‚ 4. NATURAL SELECTION & O(1) DOUBLE-BUFFERED ARENA POOL β”‚
  47. β”‚ Continuous evolution over 1,000,000+ generations with flat memory β”‚
  48. β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
  49. β”‚
  50. β–Ό
  51. [ 60 FPS REAL-TIME WEB COCKPIT ] (SSE Live Stream at http://localhost:8080)
  52. ```
  53. ---
  54. ## ⚑ Key Highlights
  55. - **⚑ Blazing Native Performance:** Evaluates over **300,000 candidate formulas per second** on standard multi-core hardware.
  56. - **πŸ›‘οΈ Formally Verified Execution:** Zero division-by-zero panics, zero negative square roots, and gas-metered execution that mathematically prevents infinite loops.
  57. - **βœ‚οΈ Occam's Razor Parsimony Pressure:** Automatically identifies and prunes dead nodes (introns), favoring the shortest, most elegant closed-form expressions.
  58. - **πŸ”„ Autonomous Continuous Learning:** Dynamically adapts to local plateaus, automatically cycling through challenges once laws reach $>99.5\%$ precision or after evolutionary timeouts.
  59. - **πŸ€– Universal MCP Co-Processor:** Exposes 15 high-throughput tools for AI Agents (**Google Antigravity**, **Claude Code**, **OpenAI Codex**, **Cursor**, **LibreChat**).
  60. - **🌐 Embedded Cyberpunk 3D Cockpit:** Built-in zero-dependency HTTP/SSE dashboard rendering DAG graphs, real-time Pareto frontiers, and 3D voxel representations at 60 FPS.
  61. ---
  62. ## πŸ† Proven Discovery Benchmarks (Hall of Fame)
  63. DarwinCode has autonomously recovered canonical physics and mathematical laws with **100.0% precision**:
  64. | Domain | Target Law | Discovered Closed-Form Expression | Accuracy | Status |
  65. | :--- | :--- | :--- | :---: | :---: |
  66. | **Quadratic Parabola** | $f(x) = x^2 + 1$ | `(abs((x * x)) + 1.00)` | **100.0%** | Conquered |
  67. | **Galilean Free Fall** | $y = 5 \cdot t^2$ | `((Max(Modulo(2.31, t), 5.00) * t) * t)` | **100.0%** | Conquered |
  68. | **Harmonic Wave** | $f(x) = 3\sin(x)$ | `((sin(x) + sin(x)) + sin(x))` | **100.0%** | Conquered |
  69. | **3D Paraboloid** | $f(x, y) = x^2 + y^2$ | `((y * y) + (x * x))` | **100.0%** | Conquered |
  70. | **Conditional Switch** | $\text{if } a > b \Rightarrow a - b \text{ else } a + b$ | `Max((a - b), ((b - (a - b)) - 1.00))` | **100.0%** | Conquered |
  71. ---
  72. ## πŸ”¬ Advanced Research Engines
  73. ### 1. Elliptic Curves & Birch-Swinnerton-Dyer (BSD) Invariants
  74. Located in `core/src/elliptic_bsd.rs`:
  75. - High-performance arithmetic point counting on $\mathbb{F}_p$ for curves $y^2 = x^3 + Ax + B$.
  76. - Fourier trace computation $a_p = p + 1 - |E(\mathbb{F}_p)|$ with Hasse bounds $|a_p| \le 2\sqrt{p}$.
  77. - Sato-Tate angle distribution mapping: $\theta_p = \arccos\left(\frac{a_p}{2\sqrt{p}}\right)$.
  78. - Goldfeld-Mestre logarithmic heuristics for analytic root number $W(E)$ parity prediction.
  79. - Benchmarked against verified LMFDB (*L-functions and Modular Forms Database*) curves.
  80. ### 2. Fluid Dynamics & Navier-Stokes Blow-Up Simulation
  81. Located in `core/src/navier_stokes.rs`:
  82. - Hou-Luo / De Gregorio 1D vorticity model with solid boundary effects.
  83. - Periodic discrete Hilbert transform via exact cotangent kernel.
  84. - Beale-Kato-Majda (BKM) singularity detection: $\int_0^T \|\omega\|_{L^\infty} dt$.
  85. - Genetic evolution of self-similar blow-up profiles:
  86. $$\Omega(\xi) = \frac{c_0 \xi}{(1+\xi^2)^\gamma}$$
  87. ### 3. Ramanujan Continued Fraction Engine & OEIS Miner
  88. Located in `core/src/ramanujan.rs` & `core/src/oeis.rs`:
  89. - Generates generalized continued fractions:
  90. $$a_0 + \frac{b_1}{a_1 + \frac{b_2}{a_2 + \dots}}$$
  91. converging to fundamental constants ($\pi$, $e$, Catalan's $G$, Apery's $\zeta(3)$).
  92. - Automated sequence synthesis against OEIS integer sequences.
  93. ### 4. The Unprecedented Pi Discovery Triad
  94. Located in `core/src/pi_continued_fractions.rs`, `core/src/pi_galperin_billiards.rs`, and `core/src/pi_bbp_spigot.rs`:
  95. - **Recurrent Non-Polynomial Continued Fractions:** Stabilized Euler-Wallis forward recurrence scaling convergent fractions to eliminate floating-point overflow across arbitrary search depths.
  96. - **Galperin Chaotic Billiards Symplectic Engine:** Exact 1D elastic collision dynamics between two blocks ($M/m = 100^N$) and a wall, yielding exactly $\lfloor \pi \cdot 10^N \rfloor$ collisions ($N=1 \to 31$, $N=2 \to 314$, $N=3 \to 3141$, etc.) with machine-epsilon symplectic energy conservation ($|\Delta E / E_0| < 10^{-10}$).
  97. - **Modular BBP Spigot Extractor:** High-performance discrete modular extraction engine $d_n = \Phi(n) \pmod{10}$ providing canonical verification datasets for discrete evolutionary circuits.
  98. ---
  99. ## πŸš€ Quick Start
  100. ### Prerequisites
  101. - [Rust 1.75+](https://rustup.rs/) (Cargo & rustc)
  102. ### 1. Installation & Build
  103. ```bash
  104. git clone https://github.com/miguelguerra200022-sudo/DarwinCode.git
  105. cd DarwinCode
  106. cargo build --release
  107. ```
  108. ### 2. Launch the Engine & Web Cockpit
  109. ```bash
  110. ./target/release/darwin_cli
  111. ```
  112. Open **`http://localhost:8080`** in any web browser to observe the live evolutionary stream, topology graphs, and Hall of Fame!
  113. ### 3. Run MCP Server for AI Coding Agents
  114. ```bash
  115. ./target/release/darwin_cli --mcp
  116. ```
  117. ### 4. Direct CLI Synthesis
  118. ```bash
  119. ./target/release/darwin_cli synthesize --inputs x --output float --dataset "[-2, 5], [-1, 2], [0, 1], [1, 2], [2, 5]"
  120. ```
  121. ---
  122. ## πŸ§ͺ Testing & Verification
  123. Run the entire suite of 76 comprehensive unit, integration, and property tests:
  124. ```bash
  125. cargo test --all
  126. ```
  127. Result:
  128. ```
  129. test result: ok. 54 passed (darwin_core); 22 passed (darwin_cli); 0 failed; 0 ignored
  130. ```
  131. ---
  132. ## πŸ€– Model Context Protocol (MCP) Integration
  133. DarwinCode implements the official **Model Context Protocol (stdio)**. Add it to your AI agent configuration:
  134. ### Claude Desktop (`claude_desktop_config.json`)
  135. ```json
  136. {
  137. "mcpServers": {
  138. "darwin-code": {
  139. "command": "/absolute/path/to/DarwinCode/target/release/darwin_cli",
  140. "args": ["--mcp"]
  141. }
  142. }
  143. }
  144. ```
  145. ### Cursor / Codex / Antigravity (`~/.gemini/antigravity-cli/mcp/darwin-code.json`)
  146. ```json
  147. {
  148. "command": "darwin_cli",
  149. "args": ["--mcp"]
  150. }
  151. ```
  152. ### Available MCP Tools:
  153. 1. `darwin_synthesize`: Symbolic regression and law discovery from dataset points.
  154. 2. `darwin_optimize_code`: Prunes dead AST branches and bloat using parsimony.
  155. 3. `darwin_evolve_voxels`: Evolves verified 3D structural voxel matrices.
  156. 4. `darwin_evolve_cppn`: Continuous compositional pattern producing networks for 3D topologies.
  157. 5. `darwin_generate_city`: Generates procedural cyberpunk architectural districts.
  158. 6. `darwin_ramanujan_solve`: Discovers continued fraction representations for mathematical constants.
  159. 7. `darwin_srsd_hard_solve`: High-dimensional symbolic discovery for physics laws.
  160. 8. `darwin_oeis_discover`: Reverse-engineers integer sequences from OEIS with holonomic checks.
  161. 9. `darwin_bsd_analysis`: Analyzes elliptic curves, Frobenius traces, and BSD rank parity.
  162. 10. `darwin_navier_stokes_blowup`: Simulates Hou-Luo fluid vorticity and self-similar singularities.
  163. 11. `darwin_safe_eval`: Deterministic gas-metered evaluation sandbox.
  164. 12. `darwin_get_status`: Returns engine telemetry, generation count, and Hall of Fame records.
  165. 13. `darwin_pi_continued_fraction`: Evaluates generalized non-polynomial Pi continued fractions via Euler-Wallis.
  166. 14. `darwin_pi_billiards_simulate`: Simulates Galperin chaotic billiards collision dynamics for Pi.
  167. 15. `darwin_pi_spigot_extract`: Canonical discrete decimal Pi digit extractor for evolutionary circuits.
  168. ---
  169. ## πŸ“ Repository Structure
  170. ```
  171. DarwinCode/
  172. β”œβ”€β”€ assets/ # High-res logos and banners
  173. β”‚ β”œβ”€β”€ logo.jpg # Emblem logo
  174. β”‚ └── banner.jpg # Hero banner
  175. β”‚
  176. β”œβ”€β”€ core/ # Core Evolutionary Engine (darwin_core)
  177. β”‚ β”œβ”€β”€ src/
  178. β”‚ β”‚ β”œβ”€β”€ types.rs # Type system, safe math, OpCodes
  179. β”‚ β”‚ β”œβ”€β”€ genome/ # Computation DAGs, topological sorting
  180. β”‚ β”‚ β”œβ”€β”€ vm/ # Gas-metered deterministic virtual machine
  181. β”‚ β”‚ β”œβ”€β”€ mutation/ # Grammar-guided mutation, crossover
  182. β”‚ β”‚ β”œβ”€β”€ verifier/ # SMT-lite cycle detection and type checking
  183. β”‚ β”‚ β”œβ”€β”€ engine.rs # Evolutionary engine with double buffering
  184. β”‚ β”‚ β”œβ”€β”€ elliptic_bsd.rs# Elliptic curves & BSD invariant engine
  185. β”‚ β”‚ β”œβ”€β”€ navier_stokes.rs # Hou-Luo vorticity & fluid blowup solver
  186. β”‚ β”‚ β”œβ”€β”€ ramanujan.rs # Continued fraction discovery
  187. β”‚ β”‚ β”œβ”€β”€ oeis.rs # Integer sequence synthesis
  188. β”‚ β”‚ β”œβ”€β”€ pi_continued_fractions.rs # Euler-Wallis recurrence for Pi
  189. β”‚ β”‚ β”œβ”€β”€ pi_galperin_billiards.rs # Galperin elastic collision dynamics
  190. β”‚ β”‚ └── pi_bbp_spigot.rs # Decimal digit table and extractor
  191. β”‚ └── tests/ # Unit and integration test suites
  192. β”‚
  193. β”œβ”€β”€ cli/ # Runner, MCP Server & Embedded Web (darwin_cli)
  194. β”‚ └── src/
  195. β”‚ β”œβ”€β”€ main.rs # Evolution coordinator and CLI entrypoint
  196. β”‚ β”œβ”€β”€ mcp.rs # Model Context Protocol stdio server
  197. β”‚ β”œβ”€β”€ mcp_tools.rs # MCP tool definitions and executors
  198. β”‚ └── server.rs # Embedded HTTP/SSE live streaming server
  199. β”‚
  200. β”œβ”€β”€ skills/ # Agent Skills
  201. β”‚ └── darwin-code/ # Antigravity & Claude Code skill definitions
  202. β”‚
  203. β”œβ”€β”€ web/ # Embedded Web Cockpit (http://localhost:8080)
  204. β”‚ β”œβ”€β”€ index.html # Cyberpunk dashboard interface
  205. β”‚ β”œβ”€β”€ style.css # Visual styling
  206. β”‚ └── app.js # Real-time SSE client and 3D visualizer
  207. β”‚
  208. β”œβ”€β”€ OEIS_SUBMISSIONS.md # Formal OEIS submissions guide (A161330 / A006459)
  209. β”œβ”€β”€ LICENSE # Dual License (PolyForm Noncommercial + Commercial)
  210. └── README.md # Project documentation
  211. ```
  212. ---
  213. ## πŸ“œ License
  214. DarwinCode is dual-licensed:
  215. - **Free for Individuals, Independents & Academic Research:** Licensed under the [PolyForm Noncommercial License 1.0.0](LICENSE). You are free to study, experiment, publish papers, and build non-commercial tools.
  216. - **Commercial Enterprise License:** Required for commercial companies, proprietary hedge funds, and institutions with over **$1,000,000 USD** in cumulative capital, funding, or annual revenue.
  217. For commercial licensing and enterprise support:
  218. - Author: **Miguel Guerra** ([@miguelguerra200022-sudo](https://github.com/miguelguerra200022-sudo))
  219. - Inquiries: Open a confidential inquiry via repository issues or GitHub profile.
  220. ---
  221. <p align="center">
  222. <sub>Built with mathematical passion and pure Rust. Engineered for open-ended discovery.</sub>
  223. </p>

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.