Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Putative fix for mutable special placement #51574

Merged

Conversation

jbytheway
Copy link
Contributor

Summary

None

Purpose of change

I think I figured out why mutable special placement was sometimes failing. Some joins could be postponed but others could appear pointing at the same tile and be satisfied in the absence of the postponed joins. Then, when the postponed joins are restored they cannot be satisfied.

Describe the solution

Avoid this by keeping track of the tiles with postponed joins and ensuring that they new joins pointing at the same tiles are added directly to the postponed list rather than the unresolved list.

Describe alternatives you've considered

When these new joins appear we could re-insert the postponed joins for that tile back into the unresolved list, since there's now some hope that they could be resolved. But that would be more complicated.

Testing

I was never able to reliably reproduce the problem, and it happens with very low probability, so it's hard to test. We'll just have to see whether the problem recurs in CI sometime.

I did spawn a few anthills to verify that it's not obviously broken.

Additional context

Thanks to @eltank for providing the test failure log that helped track down the issue.

@jbytheway jbytheway changed the title Putative fox for mutable special placement Putative fix for mutable special placement Sep 13, 2021
I think I figured out why mutable special placement was sometimes
failing.  Some joins could be postponed but others could appear
pointing at the same tile and be satisfied in the absence of the
postponed joins.  Then, when the postponed joins are restored they
cannot be satisfied.

Avoid this by keeping track of the tiles with postponed joins and
ensuring that they new joins pointing at the same tiles are added
directly to the postponed list rather than the unresolved list.
@jbytheway jbytheway force-pushed the fix_mutable_special_placement_error branch from f091506 to 68553b5 Compare September 13, 2021 01:13
@actual-nh actual-nh added <Bugfix> This is a fix for a bug (or closes open issue) [C++] Changes (can be) made in C++. Previously named `Code` Map / Mapgen Overmap, Mapgen, Map extras, Map display labels Sep 13, 2021
@kevingranade kevingranade merged commit 5b018b4 into CleverRaven:master Sep 13, 2021
@jbytheway jbytheway deleted the fix_mutable_special_placement_error branch September 14, 2021 00:39
Venera3 pushed a commit to Venera3/Cataclysm-DDA that referenced this pull request Sep 21, 2021
I think I figured out why mutable special placement was sometimes
failing.  Some joins could be postponed but others could appear
pointing at the same tile and be satisfied in the absence of the
postponed joins.  Then, when the postponed joins are restored they
cannot be satisfied.

Avoid this by keeping track of the tiles with postponed joins and
ensuring that they new joins pointing at the same tiles are added
directly to the postponed list rather than the unresolved list.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
<Bugfix> This is a fix for a bug (or closes open issue) [C++] Changes (can be) made in C++. Previously named `Code` Map / Mapgen Overmap, Mapgen, Map extras, Map display
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants