Skip to content
View natemacfadden's full-sized avatar
🤖
🤖

Block or report natemacfadden

Block user

Prevent this user from interacting with your repositories and sending you notifications. Learn more about blocking users.

You must be logged in to block users.

Maximum 250 characters. Please don’t include any personal information such as legal names or email addresses. Markdown is supported. This note will only be visible to you.
Report abuse

Contact GitHub support about this user’s behavior. Learn more about reporting abuse.

Report abuse
natemacfadden/README.md

Nate MacFadden

See my first bonsai 'Paco' (named after one of my
favorite mathematicians). I've grown quite fond of
these trees - I now have a small forest of them,
including a Japanese maple, redwood, and spruce.

I build high-performance systems and algorithms for hard problems in geometry and combinatorics (from multithreaded C/OpenMP kernels to symmetry-aware neural networks), leaving a trail of production-quality tools that others depend on. I lead development of and am the sole active maintainer of CYTools, the standard toolkit in my field (computational string theory).

A few things I've built: dualGNN, a symmetry-aware GNN that outperforms the prior SOTA (CYTransformer, a ~120M-parameter transformer from Yip, Arnal, Charton, and Shiu) on sampling uniformity and zero-shot generalization with ~1300x fewer parameters; latticepts, a lattice-point enumeration kernel that materializes ~17M points/s in parallel and is integrated into both CYTools and Macaulay2; and an agent harness that gets small open-weight LLMs to do correct work driving CYTools. These projects all grow out of my string-theory Ph.D. at Cornell (McAllister group), a steady source of hard geometry and combinatorics problems.

Looking for research engineer / research scientist roles at AI labs. Email

Stack: Python (PyTorch, NumPy, Numba), Cython, C (OpenMP), C++

Performance & Systems

  • Speculative decoding on consumer hardware (code private for now — happy to discuss or you can look at the blog) - Two-seed ablation of DFlash speculative-decoding drafter objectives against a 35B-A3B MoE target, isolating which training choices affect draft acceptance length. Includes a lossless decode loop for hybrid linear-attention targets, implemented by patching the transformers cache path (recurrent state can't be cropped like a KV cache, so state writes freeze during block verify and only the accepted prefix advances), an integrated drop-in fused-MoE grouped-GEMM kernel (~3x faster expert matmuls, ~1.65x decode, verified token-identical), and a crash-resumable two-box feature pipeline (training features stored in fp8, quantization noise measured: per-token cosine ~0.9997 vs bf16; draft vocabulary locked at 32k by a coverage census — 97% measured, smaller vocabularies fell short) spanning my homelab's heterogeneous CUDA and ROCm machines: the 35B serves on a ROCm box while the drafter trains on a CUDA box, joined by a direct local link.
  • latticepts - Enumerates the lattice points of convex polyhedra via Kannan's algorithm (C/Cython); faster than Normaliz and OR-Tools CP-SAT in all benchmarked cases. For an example of the performance: latticepts generates ~108M lattice points in a polyhedron of interest (the strict interior of a certain 7D cone used in Candidate de Sitter Vacua) in ~13s single-threaded, or ~6.3s on 12 threads (~8M points/s, ~17M/s in parallel), materializing the full point set. Integrated into CYTools and Macaulay2.
  • unitri - Counts the unimodular (i.e., fine) triangulations of convex lattice polygons without enumerating them (C/Cython), using exact big-integer arithmetic (or primes + CRT for parallelization). Built on Stepan Orevkov's counting code (which itself generalizes Kaibel and Ziegler's code), reworked and generalized; applied to string theory in Further Bounding the Kreuzer-Skarke Landscape. Can count, e.g., all $736,983,568$ unimodular triangulations of a 4x4 grid in $\sim0.33$ ms, or a height-84 triangle's $\sim 7.6 \times 10^{65}$ triangulations in $\sim 1.26$ s.
  • pfvs (paper in preparation) - Solves certain diophantine problems orders of magnitude faster than previous methods (C/Cython, with some Python prep), with time and memory scaling that reach searches an order of magnitude beyond their reach. Benchmarked head-to-head with verified-identical outputs; where the prior method's memory is too large to measure, it is computed directly from the box dimensions. Converted a many core-year computation into a handful of core-weeks. Relevant for string theory, where these solutions can be interpreted as perturbatively flat vacua (PFVs).
  • fanroots - Optimization over $\sim200$-dimensional piecewise-smooth functions whose analytic form changes across the cones of a fan (hence the name) — a setting where off-the-shelf optimizers struggle. Built for 'Kähler moduli space' in string theory, where it locates special points that realize desired physics, as in Candidate de Sitter Vacua. 20-70x faster than the prior methods used there (advantage grows with dimension), and converges on geometries where they fail.
  • FastAerosol (code, paper) - C++ 'advanced example' contributed to GEANT4: memory- and time-efficient stochastic simulation of particle transport through aerosol geometries.

ML & Algorithms

  • dualGNN - Autoregressive GNN for combinatorial sampling (triangulations) under local (validity, fineness) and global (regularity) constraints out of a large population. We use signed-circuit edge features from oriented matroid theory which we show are provably necessary and empirically sufficient for determining regularity, and invariant under the problem's symmetries. Pointer-Network-style decoding, trained with cross-entropy then REINFORCE-tuned for uniformity. Has ~92k parameters and trains in ~7.5h on a single RTX 5060 Ti. The compute is small enough that the forward pass is dominated by memory traffic in the edge aggregation, so inference uses a fused kernel computing sum/min/max in a single pass over senders (~4x less traffic than gather-then-reduce) and folds per-polygon constants across autoregressive steps. It is the only sampler consistent with uniform sampling across all diagnostics (divergence from uniformity, collision counts, sample autocorrelation); transfers zero-shot to unseen instances. Applied to Calabi-Yau enumeration up to $h^{1,1}=128$ (uniformity validated to $h^{1,1}=86$).
  • NTFE algorithm (code in CYTools) - Simple algorithm for generating regular triangulations of reflexive polytopes with distinct 2-face restrictions, exponentially faster than previous methods (this is the current SOTA). Such triangulations lead to potentially-inequivalent Calabi-Yau manifolds via Batyrev's construction. This algorithm is used in most CYTools workflows. Bounds on NTFE counts established in this work.
  • pfvscorer - Learned richness classifier for certain classes of Diophantine problems (i.e., 'PFVs' in string theory). Enumerating the solutions (my pfvs kernel) is fast but eventually hits a fundamental wall; pfvscorer instead predicts how many solutions a class is likely to have, before enumeration, so searches can be steered toward rich classes. Three encoders, each tailored to the symmetry of one geometric input, feed a shared trunk with sigmoid heads that predict P(#solutions > threshold) (e.g. >0 and >50).
  • The DNA of Calabi-Yau Hypersurfaces (Fortschritte der Physik, 2025; code) - Custom genetic algorithm with hyperparameters tuned by Bayesian optimization; combinatorial optimization over Calabi-Yau search spaces up to ~ $10^{36}$ candidates, substantially outperforming MCMC, simulated annealing, and best-first search on both maximization and inverse problems. Built on the NTFE encoding, which eliminates the search space's exponential redundancy.

LLM Agents & Reliability

  • cytools-agent - Gets small open-weight models (e.g. qwen3:14b) to usefully answer research-level questions with CYTools. The unique tools and terminology require careful RAG (SentenceTransformer and regex, the latter for niche terms) and carefully crafted tools. These tools are also exposed over MCP.
  • repo-review - LLM plugin/workflow that reviews a GitHub repo by spawning five lens-specialized sub-agents (performance, correctness, engineering, taste & positioning, documentation) that clone, build, run, test, and profile it. Exposed as a Claude Code plugin (invoke with /repo-review:review <repo>) and an opencode driver.

CYTools

I'm the lead developer and sole active maintainer (BDFL) of CYTools, the standard toolkit for studying Calabi-Yau compactifications in string theory (invited talks at multiple conferences). Recent contributions: a faster intersection-number kernel, and regfans, a standalone package I wrote for regular triangulations of vector configurations, which extends CYTools to vex triangulations.

Selected papers

  • Sampling Triangulations and Calabi-Yau Threefolds with Autoregressive GNNs (2026) - Nate MacFadden. arXiv:2605.27770. [code]
  • The DNA of Calabi-Yau Hypersurfaces: A Genetic Algorithm for Polytope Triangulations (2025) - Nate MacFadden, Andreas Schachner, Elijah Sheridan. Fortschritte der Physik 73 (2025). doi:10.1002/prop.70060, arXiv:2405.08871
  • Further Bounding the Kreuzer-Skarke Landscape (2026) - Nate MacFadden, Stepan Yu. Orevkov, Michael Stepniczka. arXiv:2602.16909

For fun

Pinned Loading

  1. dualGNN dualGNN Public

    Demo code from the dualGNN paper. Includes inference and training, as well as grow2d and pushing

    Python 1

  2. cytools-agent cytools-agent Public

    Tools for using CYTools with AI models

    Python

  3. latticepts latticepts Public

    For finding lattice points in convex polyhedra

    Python

  4. LiamMcAllisterGroup/cytools LiamMcAllisterGroup/cytools Public

    A software package for analyzing Calabi-Yau manifolds.

    Python 45 18