<html>#2931: Claude AI edits to TwoPuncturesX
<table style='border-spacing: 1ex 0pt; '>
<tr><td style='text-align:right'> Reporter:</td><td>Steven R. Brandt</td></tr>
<tr><td style='text-align:right'>   Status:</td><td>new</td></tr>
<tr><td style='text-align:right'>Milestone:</td><td></td></tr>
<tr><td style='text-align:right'>  Version:</td><td></td></tr>
<tr><td style='text-align:right'>     Type:</td><td>bug</td></tr>
<tr><td style='text-align:right'> Priority:</td><td>major</td></tr>
<tr><td style='text-align:right'>Component:</td><td></td></tr>
</table>

<p>Comment (by Zach Etienne):</p>
<p>Here is the report from Codex. It did not have access to Steve's review:</p>
<ul>
<li>Issue 1</li>
<li>Severity critical</li>
<li>Description of the error
   The code advertises a 4-variable momentum-constraint solve via <code>solve_momentum_constraint=yes</code>, but the equation kernels still only populate <code>values[0]</code>. The extra three variables therefore have no equations, and the resulting nonlinear system is mathematically ill-posed.</li>
<li>Filename + line number(s)
   <code>TwoPuncturesX/src/TwoPunctures.cc:40-41, 302-306</code>
   <code>TwoPuncturesX/src/Equations.cc:158-181</code></li>
<li>Original code snippet
   if (solve_momentum_constraint)
     nvar = 4;</li>
</ul>
<p>values[0] = U.d11[0] + U.d22[0] + U.d33[0] +
               0.125 * BY_KKofxyz(x, y, z) / psi7 +
               2.0 * Pi / psi2 / psi * rho_adm;</p>
<p>values[0] = dU.d11[0] + dU.d22[0] + dU.d33[0] -
               0.875 * BY_KKofxyz(x, y, z) / psi8 * dU.d0[0];</p>
<p>SpecCoef(n1, n2, n3, 0, v.d0, cf_v.d0);
 - Fixed code snippet.
   if (solve_momentum_constraint) {
     CCTK_ERROR("solve_momentum_constraint=yes is not implemented in TwoPuncturesX");
   }</p>
<p>/<em> Longer-term fix: implement and fill values[0..3] consistently, and
      generate/store spectral coefficients for all solved variables. </em>/
 - Confidence
   99%</p>
<ul>
<li>Issue 2</li>
<li>Severity critical</li>
<li>Description of the error
   Turning on sources while leaving the default <code>rescale_sources=yes</code> triggers an unconditional <code>assert(0)</code>, so the source-enabled branch cannot run successfully.</li>
<li>Filename + line number(s)
   <code>TwoPuncturesX/src/TwoPunctures.cc:626-630</code>
   <code>TwoPuncturesX/param.ccl:162-164</code></li>
<li>Original code snippet
   if (use_sources && rescale_sources) {
     assert(0); // TODO: Implement via critical region
   #pragma omp single
     Rescale_Sources(cctkGH, np, vcoordx, vcoordy, vcoordz, NULL, gxx, gyy, gzz,
                     gxy, gxz, gyz);
   }</li>
<li>Fixed code
<p>--<br/>
Ticket URL: <a href='https://bitbucket.org/einsteintoolkit/tickets/issues/2931/claude-ai-edits-to-twopuncturesx'>https://bitbucket.org/einsteintoolkit/tickets/issues/2931/claude-ai-edits-to-twopuncturesx</a></p>
</html>