Skip to content

Conversation

@pouryafard75
Copy link
Contributor

@pouryafard75 pouryafard75 commented Aug 9, 2025

This PR fixes a bug in the ThetaE optimization logic where adding a new mapping could leave srcToDst and dstToSrc inconsistent.

In certain cases, a new mapping is added without first removing existing conflicting entries. This can cause one of the maps to still hold the old mapping, leading to lost mappings in the final result.

Example commit demonstrating the issue:
pouryafard75/TestCases@fb4498b

Before optimization:
Before optimization

After optimization:
After optimization

My proposed fix:
Before adding a new mapping, clear any existing entries in both srcToDst and dstToSrc that conflict with it. This ensures the maps remain consistent.

@pouryafard75
Copy link
Contributor Author

Before fix:
image

After fix:
Screenshot 2025-08-09 at 2 11 53 AM

@pouryafard75
Copy link
Contributor Author

@jrfaller This one is ready.

@jrfaller
Copy link
Member

Thanks for the fix!!!

Merging this.

@jrfaller jrfaller merged commit ae6295d into GumTreeDiff:main Aug 28, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants