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

Fix multi thread emerge bug #15637

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

cosin15
Copy link
Contributor

@cosin15 cosin15 commented Jan 5, 2025

This is my attempt to fix #9357

Please note that this PR is just a proof of concept at the moment. Expect BUGs!!!

This is how it works:
#9357 (comment)

@Zughy Zughy added Bugfix 🐛 PRs that fix a bug @ Mapgen labels Jan 5, 2025
@Zughy Zughy marked this pull request as draft January 5, 2025 13:35
@kromka-chleba
Copy link
Contributor

Tested this with mapgen_test and Exile (4 emerge threads).
I've seen no glitches. Appears to work fine with our custom volcano lua mapgen too.

@kromka-chleba
Copy link
Contributor

kromka-chleba commented Jan 5, 2025

Found a bug: after entering settings and changing the value of num_emerge_threads and starting new world I get a segfault.

@cosin15
Copy link
Contributor Author

cosin15 commented Jan 5, 2025

Found a bug: after entering settings and changing the value of num_emerge_threads and starting new world I get a segfault.

I know, its not just that, there are other segfaults. As I said, it's just a proof of concept right now.

@BluebirdGreycoat
Copy link
Contributor

How does this, or will it, affect Lua mapgens that do hairy stuff in the 16 node overgenerated region on the mapgen threads? I think I have a few that do that ...

@kromka-chleba
Copy link
Contributor

How does this, or will it, affect Lua mapgens that do hairy stuff in the 16 node overgenerated region on the mapgen threads? I think I have a few that do that ...

The fix shouldn't cause any problems because schematics are placed correctly. Well, unless your code relies on the race condition (doubt).

@cosin15
Copy link
Contributor Author

cosin15 commented Jan 11, 2025

How does this, or will it, affect Lua mapgens that do hairy stuff in the 16 node overgenerated region on the mapgen threads? I think I have a few that do that ...

The order in which chunks are generated matters. But that has always been random.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bugfix 🐛 PRs that fix a bug @ Mapgen
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Mapgen: "Unfinished" y-slices with num_emerge_threads > 1
4 participants