#14632 Guard against out-of-range time step index when loading results - #14633
Merged
Conversation
kriben
approved these changes
Aug 27, 2026
magnesj
force-pushed
the
soil-statistics-timestep-bounds-14632
branch
from
August 28, 2026 05:10
a6efe4b to
a614829
Compare
A case in an ensemble can have fewer time steps than the case defining the time step axis of a statistics case. The time step index was used to index m_cellScalarResults directly, reading past the end of the vector in Release where CAF_ASSERT is a no-op.
magnesj
force-pushed
the
soil-statistics-timestep-bounds-14632
branch
from
August 28, 2026 05:12
a614829 to
aef6e18
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.
Fixes #14632
A case in an ensemble can have fewer time steps than the case defining the time step axis of a statistics case.
findOrLoadKnownScalarResultForTimeStepused the requested time step index to indexm_cellScalarResultsdirectly, reading past the end of the vector in Release whereCAF_ASSERTis a no-op. Returncvf::UNDEFINED_SIZE_Tinstead, the existing "result not available" return, so every caller is protected and not only the statistics evaluator.Guards added to the SOIL and SGAS branches and to the generic dynamic native branch.
RigSoilResultCalculatorreturns early when the source saturation is empty for the time step, avoiding aresize( 0 )that discarded SOIL already computed for other time steps, and checks the result index likeRigSgasResultCalculatoralready does.