Repository navigation
fix(core): create the layers a model needs in its own domain, even when added late (#236) - #237
Merged
Merged
Conversation
…en added late (forefireAPI#236) The domain creates the altitude and wind layers its models need when it is built. Two cases slipped through: - A model registered afterwards (addLayer, or the fuel table layer from Python) never had its needs checked, so Farsite without a wind layer dereferenced a null windU layer in getNormalWind. Pending needs are now checked before the first propagation or flux data request. - The check read the static shortcuts, so while another domain was alive a new domain got no altitude or wind layer of its own (forefireAPI#236). It now checks the broker's own layers. Also register the "domain ownership" suite with CTest, which never ran it.
…layers are created The late check processed every pending need, so a model asking for frontDepth (Balbi2015) switched front depth computation on for the whole process, overriding frontDepthComputation=0 and slowing Balbi2015 tenfold (moisture invariants CI). The late check now only creates missing layers; front depth and curvature stay as their parameters set them.
filippi
approved these changes
Oct 30, 2026
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.
Fixes #236, and a Farsite segfault from Python when no wind layer is given.
addLayer, or the fueltablelayer from Python) was never checked, so Farsite without wind dereferenced a nullwindUingetNormalWind. Pending needs are now checked before the firstgetPropagationData/getFluxData, so a missing wind becomes a calm one, as it already did for models known at build time. This late check only creates layers: front depth and curvature stay asfrontDepthComputation/curvatureComputationset them (the first version switched front depth on for Balbi2015 and broke the moisture invariants).hasLayer. The getters still read the static shortcuts, so two domains running at once still share them; this only stops the crash.domain ownershipsuite, which was missing from the list.Tested: three new
data brokercases (two segfault ondev, one guards the front depth switch),ctest11/11, the whole unit binary in one process 47/47 (it crashed infire frontondev), moisture invariants hold (Balbi2015 identical todev), Python tests pass. Not run:runff, its reference files are missing from my LFS checkout.Drafted with Claude Opus 5.5.