
Automatic repair of PDE solvers now runs on a discrete diffusion language model: instead of rewriting the whole file left to right, it re-masks only the faulty code span and infills it with both left and right context visible. On five PDEBench families, with the same checkpoint, localized infilling raised average Pass@32 from 0.4938 to 0.5063 and cut per-attempt repair latency from 64.85 s to 0.748 s; from-scratch generation remains slower than same-scale autoregressive models, and worst-case end-to-end cost averages 55.5 s.
Automatic debugging of PDE solvers now rewrites only the small span of code that failed, not the whole program. Prior practice relied mainly on autoregressive models, which must read all preceding context and regenerate subsequent tokens one by one even when an execution error sits in a single code span. With the same DiffPDE checkpoint, identical initial candidates, execution feedback and debugging budget, localized infilling matched or exceeded full regeneration on every PDE family, raising average Pass@32 from 0.4938 to 0.5063.
During repair the model sees only the masked span, while correct code on both sides stays as conditioning context. The procedure is localized re-masking and infilling: trace the execution error back to the failing line, expand to natural code boundaries, replace that span with mask tokens, and let the diffusion model fill it in parallel. Evaluation covers five PDEBench families, Advection, Burgers, 1D reaction-diffusion, 1D compressible Navier-Stokes and Darcy flow, with 32 candidates per family and at most 3 debugging attempts.
Training runs in two stages, supervised fine-tuning followed by reinforcement learning with intermediate rewards for coupled bugs that need several rounds. ID-GRPO turns successful solvers into randomly masked infilling tasks and failed outputs into error-driven repair tasks, rewarding a strict shrinkage of the error signature set from execution feedback. In the ablation, supervised fine-tuning alone lowered average nRMSE from 0.80 to 0.28 and raised average executable rate from 0.24 to 0.35; the full design versus the variant without intermediate rewards lowered nRMSE from 0.24 to 0.23 and raised Pass@32 from 0.37 to 0.52.
The demonstrated setting is solver generation and localized debugging on five PDEBench families, where execution feedback can locate and revise a specific code span; the authors list extension to global program revision, larger diffusion backbones and more diverse PDE regimes as future directions.
The authors note that a limited subset of failures needs global structural revision across multiple code regions, beyond the current localized infilling framework; 2D Darcy flow reaches a Pass@32 of 0.09, which the authors attribute to elliptic global coupling and limited elliptic-PDE priors; from-scratch generation remains slower than same-scale autoregressive baselines, so the efficiency gain comes from the repair stage.