Fix: Steves get stuck idle after finishing their build quadrant - #56
Open
BlockException wants to merge 1 commit into
Open
BlockException wants to merge 1 commit into
BlockException wants to merge 1 commit into
Conversation
…d of being reassigned
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Bug
In
CollaborativeBuildManager.getNextBlock(), once a Steve's assignedsection (quadrant) was fully built, the fallback logic re-queried the
same already-completed section instead of reassigning the Steve to a
different, still-incomplete section:
Since
sectionIndexnever changed,section.getNextBlock()alwaysreturned
nullagain, so the Steve had no more blocks to place andsimply went idle — even while other quadrants of the structure were
still unfinished. This is the root cause of the "dynamic rebalancing"
described in the README not actually working:
assignSteveToSection()already contains a second pass that lets Steves help with other
incomplete sections, but it was never called again after the initial
assignment.
Fix
When a Steve's current section is exhausted,
assignSteveToSection()is called again to reassign them to another section that still needs
work, and a block is fetched from that new section:
Impact
Steves now correctly move on to help finish other quadrants once
their own section is done, instead of standing idle while the
collaborative build is still incomplete.
Testing
uneven block distribution across quadrants; confirmed a Steve
that finishes its quadrant early is reassigned and continues
placing blocks in another quadrant instead of stalling.
CollaborativeBuild.isComplete()still correctly reportscompletion once all quadrants are finished.