HomeJavaModsQuilt Bisect
Quilt Bisect
ModsJava

Quilt Bisect

by anonymous123-code · on Modrinth

A Quilt mod & loader plugin for finding mods responsible for issues using a search algorithm derived from binary search. This includes n-way mod…

⬇ Download on Modrinth
Quilt Bisect — screenshot 1Quilt Bisect — screenshot 2Quilt Bisect — screenshot 3Quilt Bisect — screenshot 4Quilt Bisect — screenshot 5

Quilt Bisect

A Quilt mod & loader plugin for finding mods responsible for issues using a search algorithm derived from binary search. This includes n-way mod incompatibilities in the form of crashes or user-detected issues.

A word of warning

Quilt Bisect is still experimental. However, I consider it ready for most use cases. Some functions are untested (Realms support), and it depends on an experimental API in quilt loader. Please test all issues (especially with Quilt Loader) without Quilt Bisect before reporting them to other projects. Alternatively, join my discord and get support there.

Usage

Configuring

The file <config>/quilt_bisect/main.json contains most things a user may want to configure, see MainConfig.java for now.

The file <config>/quilt_bisect/active_bisect.json contains information about the active bisect, including the settings, all tried mod sets and their respective log, and issue information.

The files <config>/quilt_bisect/modSet.txt, <config>/quilt_bisect/sections.txt, and <config>/quilt_bisect/lastActiveJoin.txt contain internal information and shouldn't be modified.

How does it work

Bisecting multiple issues at once

While bisecting multiple issues works, there are a few assumptions bisect makes that are essential when multiple issues are present:

Automatically mark things as working

When starting a new bisect, you can configure bisect to

Handling crashes

Being a loader plugin, bisect hooks into the Quilt's loader process at an incredibly early stage. There, it can create a new process that is actually running the game, and wait for that process to end. After that bisect checks if minecraft crashed by searching for a new crash log, copies the latest.log, and updates config/quilt_bisect/active_bisect.json. (if no bisect is active and it crashed it asks if a new one should be started) If minecraft didn't quit normally (either through a crash or through the bisect menu) and a bisect is active, the parent process will restart the game. Behind the scenes there is a lot more stuff going on making sure that for example killing the parent or child process makes them behave as expected.

Detecting issues

Bisect will

Selecting the next mod set to test

Bisect works using an extended version of binary search:

Loading the right mod set

One of the main problems such a bisect algorithm faces are dependencies. Ideally, a bisect method would be aware of dependencies and bisect based on those. However, this would immensely inflate the complexity of the algorithm, and this project is complex enough right now.

Instead, Quilt Bisect simply ignores dependency in its search algorithm and provides all mods to quilt loader. However, it only force-loads mods in the mod set (this is what happens to mods in your mods folder) and provides the other mods as optional mods which are only loaded when a dependency requires it. While solving the dependency issue, it has a few implications:

Development

For testing, I also recommend Quilt Crasher, which I developed to enable testing of this kind of mod.

Licensing

While the code is ARR, this is only to prevent ports to other mod loaders or low-effort copies. Feel free to copy parts of the code for your mod. If your mod does similar things to this mod, credit me. You can also ask for me for permission. If it's not a port to another mod loader, I'll likely agree.

Credit

PluginLogger, MinecraftServerMixin and GracefulTerminator were mostly taken from https://github.com/comp500/ModVote. BisectPluginProcessManager also contains large parts of ModvotePlugin from that repo. All of these are under the MIT license (by comp500)

IconStore contains code from https://github.com/TerraformersMC/ModMenu, specifically from FabricIconHandler and FabricMod#getIcon. java_icon.png, minecraft_icon.png and unknown_icon.png were also taken from there. Mod Menu is also licensed under the MIT license (by Prospector)

Quick facts

Install steps are the general flow for this file type — How to install Minecraft Java mods & modpacks walks through it step by step.

Verified by MCModsHub

These come from our own check of the pack file, not from the source page.

Explore more