Skip to content

fix(core): create the layers a model needs in its own domain, even when added late (#236) - #237

Merged
filippi merged 2 commits into
forefireAPI:devfrom
HugoFara:fix/per-domain-layers
Oct 30, 2026
Merged

filippi merged 2 commits into
forefireAPI:devfrom
HugoFara:fix/per-domain-layers

Conversation

@HugoFara

@HugoFara HugoFara commented Oct 29, 2026 •

Copy link
Copy Markdown
Collaborator

Fixes #236, and a Farsite segfault from Python when no wind layer is given.

  • Late models: the domain checks the layers its models need when it is built. A model registered afterwards (addLayer, or the fuel table layer from Python) was never checked, so Farsite without wind dereferenced a null windU in getNormalWind. Pending needs are now checked before the first getPropagationData/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 as frontDepthComputation/curvatureComputation set them (the first version switched front depth on for Balbi2015 and broke the moisture invariants).
  • Second live domain (A second live domain gets no altitude layer (unit tests crash when run in one process) #236): the check read the static shortcuts, so a domain built while another was alive got no altitude or wind layer of its own. It now checks the broker's own layers with hasLayer. The getters still read the static shortcuts, so two domains running at once still share them; this only stops the crash.
  • CTest now runs the domain ownership suite, which was missing from the list.

Tested: three new data broker cases (two segfault on dev, one guards the front depth switch), ctest 11/11, the whole unit binary in one process 47/47 (it crashed in fire front on dev), moisture invariants hold (Balbi2015 identical to dev), Python tests pass. Not run: runff, its reference files are missing from my LFS checkout.

Drafted with Claude Opus 5.5.

…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
filippi merged commit c996049 into forefireAPI:dev Oct 30, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants