#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 thorn

    --
    Ticket URL: https://bitbucket.org/einsteintoolkit/tickets/issues/2937/twopuncturesx-largely-duplicates