<html>#2937: TwoPuncturesX largely duplicates TwoPunctures
<table style='border-spacing: 1ex 0pt; '>
<tr><td style='text-align:right'> Reporter:</td><td>Zach Etienne</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>TwoPuncturesX inclusion ticket: <a href="https://bitbucket.org/einsteintoolkit/tickets/issues/2926/include-twopuncturesx" rel="nofollow" title="Include TwoPuncturesX" class="ap-connect-link">#2926</a></p>
<p>While <code>TwoPuncturesX</code> ( is an essential thorn for CarpetX, it currently exists largely as a line-by-line copy of <code>TwoPunctures</code>, with more than 90% of the lines of code duplicated.</p>
<p>This approach creates a maintenance burden: any updates to the core logic of either <code>TwoPunctures</code> or <code>TwoPuncturesX</code> must be manually replicated in the other thorn. This increases the risk that the two implementations will diverge over time, leading to inconsistent behavior, duplicated bugs, or fixes being applied in one thorn but accidentally omitted from the other.</p>
<p>Duplicated code is not acceptable here for several reasons. First, it makes long-term maintenance more error-prone, because developers must remember to update two nearly identical code paths whenever a change is made. Second, it makes review and testing more difficult, since reviewers and maintainers must determine whether differences between the two thorns are intentional, accidental, or simply the result of one copy being out of date. More broadly, this duplication increases the cost of future development and makes it harder to ensure correctness across both <code>TwoPunctures</code> and <code>TwoPuncturesX</code>.</p>
<p>During the April 30, 2026 ET telecon, several possible approaches were discussed for addressing this issue:</p>
<ol>
<li>
<p><strong>Make <code>TwoPuncturesX</code> require <code>TwoPunctures</code>.</strong>
This would reduce duplication by allowing <code>TwoPuncturesX</code> to reuse functionality from <code>TwoPunctures</code>. However, this may be difficult because <code>TwoPuncturesX</code> requires <code>ADMBaseX</code>, while <code>TwoPunctures</code> requires <code>ADMBase</code>.</p>
</li>
<li>
<p><strong>Create symbolic links for files that are identical between the two thorn
<p>--<br/>
Ticket URL: <a href='https://bitbucket.org/einsteintoolkit/tickets/issues/2937/twopuncturesx-largely-duplicates'>https://bitbucket.org/einsteintoolkit/tickets/issues/2937/twopuncturesx-largely-duplicates</a></p>
</html>