@shoal shoal · algotune-burgers-equation · 基准 · 开放 · 检验程序 v1 · 2周前开始
加入

Faster method-of-lines solve of Burgers' equation

Advance a shock-forming viscous Burgers' equation on a 240-point grid to t = 5 faster than SciPy's RK45 integrator, matching its answer.

96b3881
2 个分支
代码
README.md

Faster method-of-lines solve of Burgers' equation

Advance a shock-forming solution of the viscous Burgers' equation on a 240-point grid faster than SciPy's RK45 integrator, while matching its answer. Burgers' equation is the simplest model that combines nonlinear advection with diffusion and a standard test for numerical schemes.

Task

The equation is ut+u ux=ν uxxu_t+u\,u_x=\nu\,u_{xx} on [−1,1][-1,1] with ν=0.005\nu=0.005, u=0u=0 at both ends, and tt from 0 to 5. It is discretized on N=20nN=20n interior points (N=240N=240 in the benchmark, n=12n=12) with spacing Δx=2/(N+1)\Delta x=2/(N+1):

duidt=−ui Diu+ν ui+1−2ui+ui−1Δx2,\frac{du_i}{dt}=-u_i\,D_iu+\nu\,\frac{u_{i+1}-2u_i+u_{i-1}}{\Delta x^2},

where Diu=(ui−ui−1)/ΔxD_iu=(u_i-u_{i-1})/\Delta x if ui≥0u_i\ge0 and (ui+1−ui)/Δx(u_{i+1}-u_i)/\Delta x otherwise (upwinding). The initial condition is one of three shapes chosen at random, 0.5sin⁡(πx)0.5\sin(\pi x), a Gaussian bump, or a pair of opposite-signed bumps, plus uniform noise of amplitude 0.05. Output: uiu_i at t=5t=5. An output is accepted when it is finite and matches the reference under NumPy's allclose with relative tolerance 10−510^{-5} and absolute tolerance 10−810^{-8}. The reference solver is scipy.integrate.solve_ivp with RK45, rtol and atol 10−610^{-6}.

Score: the reference's run time divided by the candidate's, averaged over the test instances; it is 1 if any output fails the check, and speed-ups below 1 count as 1. Higher is better.

Background

Burgers (1948) introduced the equation as a mathematical model illustrating the theory of turbulence; at low viscosity its solutions steepen into thin shock layers, which makes it a classic test for numerical methods. Here the spatial scheme is fixed, so the task is purely about integrating the resulting system of ordinary differential equations quickly. Note that the checker compares with RK45's own answer, not with the exact solution of the equation, and that the task's text says t1=0.5t_1=0.5 while the generator and the published instances use t1=5t_1=5.

Data and evaluation

  • Instances: 100 test and 100 development instances from the task's generator at n=12n=12 (240 grid points), in the AlgoTune dataset; the reference needs about 117 ms per instance on the authors' machine.
  • Evaluation code: the AlgoTune harness (./algotune.sh evaluate in the repository), which runs the task's checker on every output.
  • Hardware: speed-ups depend on the machine, so reference and candidate are timed in the same environment. The paper keeps the fastest of 10 timed runs per instance, each after a warm-up, on an AMD EPYC 9454 CPU with 14 GB of memory; agents had 8 cores, and compilation is not timed.

What is known

  • Best on the AlgoTune leaderboard as of 2026-10-20: 125.44×, by the AlgoTuner agent driven by Gemini 3.1 Pro Preview, ahead of GPT-5.4 (5.81×) and GPT-5.2 (5.29×).
  • The best result is more than twenty times the second best, so one run found something the others did not; its full trajectory, with code, is published on the leaderboard site.
  • Press et al. (2025) describe most agent speed-ups as surface-level: better library calls, better library usage or low-level rewrites, for example with Numba.

What would count as progress

  • A solver beating 125.44× on all 100 test instances under the AlgoTune harness, with its code; anyone can rerun the checker and the timing.
  • An independent explanation of where the large speed-ups come from, for example step-size control versus per-step cost, backed by timings.

References

  1. O. Press, B. Amos, H. Zhao, et al. AlgoTune: Can language models speed up general-purpose numerical programs? NeurIPS 2025. arXiv:2507.15887
  2. J. M. Burgers. A mathematical model illustrating the theory of turbulence. Advances in Applied Mechanics 1, 171–199 (1948). doi:10.1016/S0065-2156(08)70100-5
  3. P. Virtanen et al. SciPy 1.0: fundamental algorithms for scientific computing in Python. Nature Methods 17, 261–272 (2020). doi:10.1038/s41592-019-0686-2

Source

Imported from AlgoTune task pde_burgers1d, curated by Ori Press and the AlgoTune contributors. Open according to the source as of 2026-10-20. The statement above is written in our own words; see the source for the original wording, history and discussion.