Repository navigation
Fire wind and spotting: single-precision literals, periodic and face edges, fine-region ghosts, script CTests - #40
Merged
Merged
Conversation
The Albini trajectory step was the fall to the lowest ground in the domain over n_traj_steps. A brand from high ground took a few large steps and landed too far (+74 % for a 30 m loft 500 m above the lowest ground). The brand also landed at the end of the step that went below the ground. The step is now H_z / n_traj_steps. Over lower ground the brand steps on, up to its fall to the lowest ground (n_fall steps; 10 n_fall with frozen_uvw). It lands where its height above the ground, taken as linear over the last step, reaches zero. A brand that would need more than 1e6 steps, or a step below the round-off of its height, stops the run with a message naming n_traj_steps and I_B_min. Flat-ground answers agree to round-off. Spotting over terrain changes; no gold file changes (FireFrozenWind_spot3d is a replay check). Tests: EmberDrift plateau and slope tests, FrozenDrift slope closed form and plateau aloft cap, the frozen vertical-wind closed form, and FireFrozenWind_spot_steps_abort. Each fails on a one-line mutant. The spot3d replay and the canonical Python reference follow the new scheme. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
GCC 11 inlined make_columns with wh = nullptr in the new slope test and flagged the w write (component 4) against a 4-component buffer with -Warray-bounds, which fails the GNU@9.3 C++17 warning report. The write was not reached. The buffer now always holds 5 components; the view still exposes nc (4 without wh), so the vertical-drift assertion on nComp() is unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ghosts, script CTests AW-PORT of the fire-wind audit after #35. - Spotting: brands fly up to the faces (the stencil is clamped in the outer half cell), wrap across periodic faces (distance unwrapped, landing cell wrapped, with a round-off guard), and a landing past a non-periodic face is dropped. The spot disc uses the nearest image across a periodic seam. The gather asserts that nx*ny fits an int. - Open fraction and roof height: ghost columns at the edge of a partial fine fire region take the nearest column of the region (fire_fill_region_ghosts, one direction at a time, so the result does not depend on the box layout). Ghost cells are marked with -1, a value neither field takes, before the exchange; no NaN guard is needed. - Real(...) literals in the spotting, FBP and WAF kernels; double precision bit-identical. - FireFbp and FireWindSampling run the folders' check scripts (POSIX sh, max_step=40, 2 ranks, MPI non-WIN32 builds) in place of the plotfile-only FireFbp_c2 and FireWindSampling_sample20; a missing log line fails. - check_spot3d.py mirrors the wrap, clamp, guard and face drop. - New gtests, each proven against a mutant. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
GCC -Wunused-variable flagged it in CI (build-warnings check). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
hgopalan
force-pushed
the
flare-wind-port
branch
from
November 24, 2026 20:12
87102f6 to
ef7bec6
Compare
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.
Related to the fire-wind audit after #35 (tracker row AW-PORT). Stacked on #38 (AW-TRAJ); the first two commits here are #38's and drop out when it merges.
Summary
The audit found six portability and edge items in the fire wind and spotting code. This PR resolves them.
doubleliterals withReal, so a single-precision build computed parts of them in double. The literals are nowReal(...). Double precision is bit-identical: the stripped expressions are the same text.nx * nycells with anint. A grid with more thanINT_MAXcells now stops with a message instead of overflowing.erf.fire.structures.wind_open_columnsanderf.fire.heat_open_fractionread these columns.FireFbp_c2andFireWindSampling_sample20only checked that a plotfile was written. They are replaced byFireFbpandFireWindSampling, which run the folders' check scripts. Each check is proven to fail on a one-line mutant.Answers that change:
P_catch < 1, one more surviving brand shifts the random draws of every later brand.Interior flights are bit-identical. No gold file changes: these tests check only that their plotfiles are written. As for other fixes, there is no option to keep the old behaviour.
The pre-PR review lenses (user-facing, implementation, numerics and physics) found the seam-disc and face-landing items. Both are fixed here.
Theory
Periodic wrap. A brand keeps its unwrapped position$(p_x, p_y)$ , so its landing distance is that of the flight. The fields are read at the wrapped position
Why a round-off guard: in single precision,$q$ can come out equal to $x_{lo} + L$ . It is pulled back into $[x_{lo}, x_{lo} + L)$ , so the landing cell exists.
Stencil. The bilinear stencil uses cell indices$i_0 = \lfloor (q - x_{lo})/\Delta x - \tfrac12 \rfloor$ and $i_0 + 1$ . In a periodic direction they wrap modulo $n$ . Otherwise they are clamped to $[0, n-1]$ , so in the outer half of an edge cell the field is that of the edge cell.
Spot disc. A cell at$c$ is inside the disc of a landing at $\ell$ when $\lvert d \rvert \le r$ . In a periodic direction $d$ is the nearest image:
erf.fire.spotting.spot_radius.What the ghost fill does: each direction in turn, a ghost still unset takes the cell clamped to its own box's range in that direction. The result is the one a single box over the whole region would get, whatever the box layout.
Changes
FireEngine/ERF_AlbiniSpotting.Halbini_stencil_indexandalbini_wrap(with the round-off guard). The interpolators take the periodicity.nx * nyfits anint.Real(...)literals.FireEngine/ERF_FireRegionGhostFill.H(new):fire_fill_region_ghosts.FireEngine/ERF_FireLayer.cppcalls it for the open fraction and roof height, instead offire_fill_boundary.FireEngine/ERF_FbpModel.H,ERF_FireWindAdjust.H,ERF_FireWindAdjust.cpp:Real(...)literals only.Tests/CTestList.cmakeadd_test_fire_scripttakesARGSand setsSKIP_RUN=0.FireFbpandFireWindSamplingreplaceFireFbp_c2andFireWindSampling_sample20. Each runs on 2 ranks withmax_step=40, in MPI builds that are not Windows.Exec/RegTests/FireFbp/run_fbp.sh,Exec/RegTests/FireWindSampling/run_wind.shsh, since CTest runs them withdashon Ubuntu.Exec/RegTests/FireFrozenWind/check_spot3d.py: mirrors the wrap, the clamp, the round-off guard and the face drop.theory/fire_spotting_crown.rst: edges, the periodic wrap, the disc and the frozen-wind seam.theory/fire_coupling.rst: the region edge.## CTestsections of both READMEs.No input is added or changed:
Results
The branch is rebased on development after #39, which fixed the
CascadeStripes_DamageStatesandshuffle_repeatfailures on development.Script CTests at
max_step=40(2 ranks, Debug):Mutants, each run against the test named:
EmberDrift.ABrandInTheOuterHalfCellLandsEmberDrift.ABrandInTheOuterHalfCellLandsEmberDrift.ABrandInTheOuterHalfCellLandsEmberDrift.APeriodicSeamWrapsTheBrandEmberDrift.ABrandThatLandsPastAFaceIsLostEmberDrift.TheSpotDiscReachesAcrossASeamfire_fill_boundaryonlyFireRegionGhostFilltestsFireRegionGhostFill.TheEdgeOfAPartialRegionTakesItsEdgeColumnFireFbpscale = 1FireWindSamplingThe single-precision build with
-Wdouble-promotionhas no warnings in the changed source files.Test(s)
EmberDrift.ABrandInTheOuterHalfCellLands,APeriodicSeamWrapsTheBrand,ABrandThatLandsPastAFaceIsLost,TheSpotDiscReachesAcrossASeam.FireRegionGhostFill.TheEdgeOfAPartialRegionTakesItsEdgeColumn,AnUncoveredPeriodicImageTakesTheEdgeColumn(also in the FPE suite).EmberDrift.LoftingHeightIsAlbinisEquationTwonow uses the precision-dependent tolerance. It failed before in single precision.EmberDrift.*,FrozenDrift.*,FireRegionGhostFill.*.FireFbpandFireWindSampling._spot3d), the fiveFireSpot*_abort,FireStructureIgnition_on,FireExposure_*,FireRestart_coupled,FireRestart_levelset_straight,FireHeatPlacement_*,FireNearWall_*andFireAnchorLevel.FireFrozenWind_spot3d: the C++ landings match the Python replay to 2.6e-13 m (frozen drift) and 4.7e-13 m (profile drift), with no replay leaving the domain.FireFbp_c2andFireWindSampling_sample20are removed. Non-MPI and Windows builds no longer run these two decks.intgather assertion) has no test: it would need more than 2^31 fire cells.Not in this PR
frozen_point_wind,ERF_FrozenWind.H) uses the edge column at a periodic seam rather than wrapping. This is documented.fire_column_z0_range_error) does up to three reductions. Folding them into one needs an ERF PR.-Wdouble-promotionwarnings outside the files changed here.🤖 Generated with Claude Code