Repository navigation
Conversation
This results in a reduction of up to 50% in regeneration duration since it only prunes sequentially. Pruning should be further optimised so that it avoid traversing the full request and constraint list for every group again.
93215ea to
bc2bca8
Compare
|
@phkahler I have not looked at this PR closely - sorry. I'll try to do it next week. |
Good Idea since I was not very impressed by double regeneration (but it was me who did it). |
|
@iscgar Could you resolve the conflicts with this PR? I'd like to merge it now that v3.3 is done. |
|
@copilot resolve the merge conflicts in this pull request. |
|
Since copilot sucks, I asked Claude (the free one on the web) to resolve this conflict. I said to take the PR options in all 3 cases and drop the code from master. It then said to add the two cleartags calls: ` ` When I asked if he's sure, further analysis suggests this may cause a regression of PR #1744 which is probably what caused there to be a conflict in this area. Here is the conversation after fixing the conflict and adding those two lines: Yes, it’s a real bug without them, but looking at this more closely, those two lines alone don’t fully fix the merged code. I was too quick to call it done. Why master added them. A failed solve leaves tags behind. In System::Solve, the didnt_converge: branch calls SK.constraint.ClearTags() and then sets c->tag = 1 on every constraint it couldn’t satisfy, so they can be reported to the user. Nothing clears those tags afterward. Before master’s fix (#1744, as far as I can tell from a fork’s PR snippet), the next prune pass hit RemoveTagged() and silently deleted those constraints. That is the data loss the ClearTags() calls prevent. This comes from the system.cpp source and a search snippet, not from master’s commit history, which GitHub blocks me from reading. Why my placement isn’t enough. Your PR keeps prune tags alive for the whole GenerateAll loop and deletes everything tagged at the end. But SolveGroupAndReport runs inside that loop. If a group fails to solve: The two lines I gave you still fix stale tags carried in from before GenerateAll, so keep them. They don’t cover tags set during the loop. What I’d do: Sources: solvespace system.cpp (master), BoykoNeov fork PR #7 (mentions the tag-clearing fix) |
|
And with the merge commit added to this PR it's failing the regression test for #1744 hahaha.... I'm gonna cry. |
This is tough... I tried a few variants quickly. Did not work. Will try again tomorrow. And by the way no merge commits. |
|
Reapplied in #1798 |
This results in a reduction of up to 50% in regeneration duration since it only prunes sequentially. Pruning should be further optimised so that it avoid traversing the full request and constraint list for every group again.
I had this change sitting in my fork for a few months alreay and just forgot to submit it. Sorry for the delay.