When a project contains ensemble contour maps, the statistics are recomputed from scratch on every project load, since the computed results are never persisted. #14408 reduces the cost to a single sweep over the realizations for all sibling maps, but the sweep still opens every realization grid once per project load.
Proposal: persist the computed statistics to a project-adjacent cache directory, following the lifecycle pattern of RimReservoirCellResultsStorage (write in setupBeforeSave(), restore in ensureResultsComputed()), so that reloading a project with unchanged settings skips the ensemble sweep entirely.
Suggested design, prototyped in #14416:
- One GRI (binary IRAP) surface file per statistics type (P10/P50/P90/MEAN/MIN/MAX) per selected time step in a
<project>_cache directory, written and read with the existing RifSurfio. Surface nodes are placed at the contour map cell centers, so every cached statistics map can also be imported directly as a regular surface in ResInsight, xtgeo or RMS. Undefined cells round-trip as NaN.
- A validity key (hash of all settings affecting the result: result definition, aggregation, flooding settings, resolution, bounding box expansion, selected time steps, formations, polygon geometry and realization file paths) stored together with the contour map grid definition in PDM fields on the contour map. The key is captured at compute time, so results computed under outdated settings are never cached, and any setting change invalidates the cache and triggers recomputation.
- Missing, corrupt or mismatching cache files fall back to recomputation.
Notes from prototyping: storing the metadata in a footer inside the GRI files was evaluated and rejected, since xtgeo reads IRAP value blocks to end-of-file and fails on trailing bytes; and the cache file name must be stored in a plain string field, since caf::FilePath fields are rewritten by the global path list macros on save.
Related: #14319, #14408. Implementation: #14416.
When a project contains ensemble contour maps, the statistics are recomputed from scratch on every project load, since the computed results are never persisted. #14408 reduces the cost to a single sweep over the realizations for all sibling maps, but the sweep still opens every realization grid once per project load.
Proposal: persist the computed statistics to a project-adjacent cache directory, following the lifecycle pattern of
RimReservoirCellResultsStorage(write insetupBeforeSave(), restore inensureResultsComputed()), so that reloading a project with unchanged settings skips the ensemble sweep entirely.Suggested design, prototyped in #14416:
<project>_cachedirectory, written and read with the existingRifSurfio. Surface nodes are placed at the contour map cell centers, so every cached statistics map can also be imported directly as a regular surface in ResInsight, xtgeo or RMS. Undefined cells round-trip as NaN.Notes from prototyping: storing the metadata in a footer inside the GRI files was evaluated and rejected, since xtgeo reads IRAP value blocks to end-of-file and fails on trailing bytes; and the cache file name must be stored in a plain string field, since
caf::FilePathfields are rewritten by the global path list macros on save.Related: #14319, #14408. Implementation: #14416.