[ET Trac] #2937: TwoPuncturesX largely duplicates TwoPunctures

Zach Etienne trac-noreply at einsteintoolkit.org
Thu Apr 30 09:51:05 CDT 2026


#2937: TwoPuncturesX largely duplicates TwoPunctures

 Reporter: Zach Etienne
   Status: new
Milestone: 
  Version: 
     Type: bug
 Priority: major
Component: 

TwoPuncturesX inclusion ticket: #2926

While `TwoPuncturesX` ( is an essential thorn for CarpetX, it currently exists largely as a line-by-line copy of `TwoPunctures`, with more than 90% of the lines of code duplicated.

This approach creates a maintenance burden: any updates to the core logic of either `TwoPunctures` or `TwoPuncturesX` 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.

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 `TwoPunctures` and `TwoPuncturesX`.

During the April 30, 2026 ET telecon, several possible approaches were discussed for addressing this issue:

1. **Make `TwoPuncturesX` require `TwoPunctures`.**
   This would reduce duplication by allowing `TwoPuncturesX` to reuse functionality from `TwoPunctures`. However, this may be difficult because `TwoPuncturesX` requires `ADMBaseX`, while `TwoPunctures` requires `ADMBase`.

2. **Create symbolic links for files that are identical between the two thorns.**
   For files that are exactly the same in both thorns, symbolic links could ensure that updates to one file are automatically reflected in the other. This would reduce the risk of the two copies drifting apart, though care would be needed to ensure this works reliably across development environments and version-control workflows.

3. **Create a shared `TwoPuncturesGuts` thorn.**
   A new thorn, tentatively named `TwoPuncturesGuts`, could contain header files or shared source components comprising the core utilities used by both `TwoPunctures` and `TwoPuncturesX`. This would provide a cleaner long-term solution by centralizing the common implementation while allowing the two thorns to retain their separate interfaces and dependencies where necessary.

The goal of this ticket is to identify and implement a maintainable structure that avoids unnecessary code duplication while preserving the functionality required by both `TwoPunctures` and `TwoPuncturesX`.

--
Ticket URL: https://bitbucket.org/einsteintoolkit/tickets/issues/2937/twopuncturesx-largely-duplicates
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.einsteintoolkit.org/pipermail/trac/attachments/20260430/98abefc9/attachment.htm>


More information about the Trac mailing list