-
Notifications
You must be signed in to change notification settings - Fork 32
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
Find more intuitive orderings when there are multiple possible toposorts #180
base: main
Are you sure you want to change the base?
Conversation
Last commit published: 3454345fcdb5eedbf1e70b3142bb9c96b4427961. PR PublishingThe artifacts published by this PR:
Repository DeclarationIn order to use the artifacts published by the PR, add the following repository to your buildscript: repositories {
maven {
name 'Maven for PR #180' // https://github.com/neoforged/FancyModLoader/pull/180
url 'https://prmaven.neoforged.net/FancyModLoader/pr180'
content {
includeModule('net.neoforged.fancymodloader', 'junit-fml')
includeModule('net.neoforged.fancymodloader', 'earlydisplay')
includeModule('net.neoforged.fancymodloader', 'loader')
}
}
} |
How does the new topo-sort algorithm affect this? Do we have a before/after comparison chart? |
I did not think of that. It would probably be interesting to do. |
I did a quick try using All The Mods 10, version 0.12, with I uses PrismLauncher to override the default FancyModLoader jar with the jar from this PR. My
then game crashes with
without generate a proper crash report. Restore the FancyModLoader version will let game startup advance a bit further, then crash with an error related to Night Config, with a proper crash report. Was there a breaking change related to config? |
The toposort will now try to get the "smallest" element as early into the output as possible. (The previous behavior was finding the lexicographically smallest toposort, which is not the same).
Here is an example. For the following graph:
The previous toposort would yield
3 5 0 1 2 4
. The new toposort yields5 0 1 2 3 4
. Intuitively, we try to get the0
as early as possible into the result.This does change the complexity of the toposort from linear to quadratic. For our use cases (mod sorting, creative tab sorting, resource reload listener sorting), that should still be fast enough.
This PR also adds basic tests.