Kept in beam Pruned Greedy (k=1) path Brute-force optimum

Program Synthesis Beam Search (2D)

This 2D companion runs the same beam-search mechanics as the 3D version — expand every candidate in the beam, score all children with a verifier, keep only the top-k — on a small, fully enumerable token tree so the pruning is countable and the outcome is checkable. A parallel greedy (beam width 1) run on the identical scored tree is shown next to it, and a brute-force search over every possible program confirms, level by level, whether the beam actually reached the true optimum and whether greedy really did get stuck.