Fix dependency-stall detection that aborted geometry/material builds on progress#156
Merged
maureeungaro merged 1 commit intoJun 13, 2026
Merged
Conversation
Both the volume and material build loops aborted with ERR_G4DEPENDENCIESNOTSOLVED exactly when the build was making progress. Two defects: (1) the remaining-count tracker was updated only in the else branch, so after iteration 1 it froze; (2) the comparison `previous >= current` fires whenever the count stays the same OR decreases — i.e. on progress, not on a stall. Any geometry/material set needing more than one resolution pass (a child built after its mother, the normal multi-pass case) leaves fewer remaining items on the next iteration — the success path — and aborted. Track the previous iteration's count in a dedicated variable updated every iteration, and error only when the count fails to strictly decrease (`current >= previous`) while the previous count was nonzero. Applied identically to both loops. Verified: b1 (sqlite) and cherenkov (optical) examples build all volumes and materials and run to completion with no spurious dependency error (Geant4 11.4.1 dev container). Fixes gemc#108 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
Both the volume and material build loops in
g4world.ccaborted withERR_G4DEPENDENCIESNOTSOLVEDexactly when the build was making progress. Two defects: (1) the remaining-count tracker was updated only in theelsebranch, so after iteration 1 it froze; (2) the comparisonprevious >= currentis true whenever the count stays the same or decreases — i.e. it fires on progress, not on a stall.Any geometry/material set needing more than one resolution pass (a child built after its mother — the normal multi-pass case) leaves fewer remaining items on the next iteration, which is the success path, and aborted.
Track the previous iteration's count in a dedicated variable updated every iteration, and error only when the count fails to strictly decrease (
current >= previous) while the previous count was nonzero. Applied identically to both loops.Validation: rebuilt
gemcand ran the b1 (sqlite) and cherenkov (optical) examples in the Geant4 11.4.1 dev container — both build all volumes and materials and run to completion with no spurious dependency error.Fixes #108