Hi, Sergey!

thanks for the patch! LGTM with a minor below.

Sergey

On 12/26/25 12:17, Sergey Kaplun wrote:


<snipped>

+
+    assert(energy(bodies, nbody) == -0.16907516382852447179,
+             "Correct start energy")
seems broken indentation
+    for _ = 1, N do advance(bodies, nbody, 0.01) end
+  end,
+  checker = function()
+    if N == DEFAULT_N then
+      assert(energy(bodies, nbody) == -0.16908313397890917251,
+             "Correct result energy")
+    end
+    return true
+  end,
+  items = N,
+})
 
-offsetMomentum(bodies, nbody)
-io.write( string.format("%0.9f",energy(bodies, nbody)), "\n")
-for i=1,N do advance(bodies, nbody, 0.01) end
-io.write( string.format("%0.9f",energy(bodies, nbody)), "\n")
+bench:run_and_report()