跳到正文
研踪PaperTrail
← 研踪 PaperTrail

arXiv:2604.18585 · v2

RECURSUM: Automated Code Generation for Recurrence Relations Exceeds Expert Optimization via LayeredCodegen

首次提交 2026-01-22 12:44
版本更新 2026-11-10 21:28
雷达观测 2026-11-11 13:08
arXiv ↗PDF ↗

摘要

Automated code generation can systematically exceed expert hand-optimization for recurrence relations--computational primitives ubiquitous in orthogonal polynomials, special functions, numerical integration, and molecular integral evaluation. We present RECURSUM, a Python DSL generating optimized C++ for arbitrary recurrence relations via three backends--template metaprogramming, a novel LayeredCodegen backend, and runtime loop-based evaluation--specifying recurrences in 10--30 lines of Python that generate 650+ lines of production C++. LayeredCodegen achieves 9.8$\times$ speedup over expert hand-written code and 1.9$\times$ over template metaprogramming for McMurchie-Davidson Hermite coefficients, through zero-copy output parameters, guaranteed inlining, and exact-sized stack buffers. A DAG-topological generalization of this architecture--built to express the four-center electron-repulsion integral that LayeredCodegen's tower model cannot--beats libint2, a mature, two-decade-refined production library, on 12 of 14 Cartesian integral classes, with $\sim$2$\times$ faster contracted Coulomb/exchange (J/K) matrix construction (alkanes and 3-D DNA fragments alike) and 1.1--2.7$\times$ faster one-electron integrals, completing the full Hartree-Fock integral set from one DAG framework. We validate 24 recurrence types spanning pure mathematics, numerical analysis, and quantum chemistry; production benchmarks confirm these speedups propagate to complete algorithms, matching expert baselines within 3.3\%. By eliminating the dual expertise barrier of domain knowledge and C++ metaprogramming, RECURSUM establishes systematic code generation--not hand-tuning--as the performance ceiling for recurrence algorithms.

作者备注:84 pages, 9 figures

AI 论文解读

基于摘要 · 非全文审阅

此版本尚未生成 AI 解读。解读由后台任务生成并按论文版本保存,登录后共享已有结果。

版本差异

目前只观测到一个版本,无法比较变化。之后收录新版本时,会在这里对照标题、作者、分类和摘要。

观测到的版本

相邻记录可能跳过中间版本;首次发现 v2 及以上也会标为版本更新。

v2 · 2026-11-10 21:28 · 最新观测版本

RECURSUM: Automated Code Generation for Recurrence Relations Exceeds Expert Optimization via LayeredCodegen

Automated code generation can systematically exceed expert hand-optimization for recurrence relations--computational primitives ubiquitous in orthogonal polynomials, special functions, numerical integration, and molecular integral evaluation. We present RECURSUM, a Python DSL generating optimized C++ for arbitrary recurrence relations via three backends--template metaprogramming, a novel LayeredCodegen backend, and runtime loop-based evaluation--specifying recurrences in 10--30 lines of Python that generate 650+ lines of production C++. LayeredCodegen achieves 9.8$\times$ speedup over expert hand-written code and 1.9$\times$ over template metaprogramming for McMurchie-Davidson Hermite coefficients, through zero-copy output parameters, guaranteed inlining, and exact-sized stack buffers. A DAG-topological generalization of this architecture--built to express the four-center electron-repulsion integral that LayeredCodegen's tower model cannot--beats libint2, a mature, two-decade-refined production library, on 12 of 14 Cartesian integral classes, with $\sim$2$\times$ faster contracted Coulomb/exchange (J/K) matrix construction (alkanes and 3-D DNA fragments alike) and 1.1--2.7$\times$ faster one-electron integrals, completing the full Hartree-Fock integral set from one DAG framework. We validate 24 recurrence types spanning pure mathematics, numerical analysis, and quantum chemistry; production benchmarks confirm these speedups propagate to complete algorithms, matching expert baselines within 3.3\%. By eliminating the dual expertise barrier of domain knowledge and C++ metaprogramming, RECURSUM establishes systematic code generation--not hand-tuning--as the performance ceiling for recurrence algorithms.

查看此版本解读 →查看此版本原文 ↗