Repository navigation
paramSets: cheap raster key, no copy on a surface hit; clearer errors - #42
Merged
Merged
Conversation
…licate ELF ids and on a ledger-rows file without the ELF Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014G18Mik3fH4z5M5CyMSUS6
eliotmcintire
added a commit
that referenced
this pull request
Nov 15, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014G18Mik3fH4z5M5CyMSUS6
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.
A follow-up to the change that lets a spread prediction use parameter sets from a file: reusing a set's result now costs less than half the time on large maps, and two bad inputs now give clear errors.
Affects: speed of replicates that reuse a set's result (0.9 s to 0.35 s on a 20-million-cell map); two new error messages; no change to results.
Reuses: paramSetsForRep(), the
mod$surfacecache,surfaceOutputsfrom the previous PR; new: rasterSample() and rasterVersion() (nothing existing detects a changed raster without reading all of it).Technical details
flammableRTMandrasterToMatchLargeELFevery rep, and a hit unwrapped each stored raster (fireSense_spreadPredict.R, key inspreadPredictRun()). NowrasterVersion()gives a number that changes with a new raster object or a change at up to 1000 sampled cells (rasterSample());mod$rasterStampkeeps the last object so its address cannot be reused. Stored surfaces are aterra::deepcopymade on a miss and handed out as they are on a hit, after checking that the stored raster still has its sampled values (a changed one is recomputed).terra::set.values()on a raster input at a cell outside the 1000 sampled cells is not seen; terra's[<-andvalues<-make a new object and are seen.paramSetsForRep(): stops ifstudyAreaWithSpreadParamshas the simulated ELF in more than one row, and if a file of ledger rows has no row for it (before:paramSetIndex(0, ...)error).repsPerSet6; seconds perspades()call): base 4.71 first rep, then 1.05 0.93 0.86 0.89 0.88; branch 1.65 first rep, then 0.48 0.37 0.35 0.35 0.35. A profile of the branch hits shows the rest is SpaDES and gc, not the module.test-paramSets.R): duplicate ELF ids stop; ledger-rows file without the ELF stops (and with it works);rasterVersion()same object same number, new object and in-place edit a new number; a changedflammableRTMrecomputes a set's surface; the reuse marker test now plants its marker consistently. On base the new tests give 2 failures and 2 errors.convertToPackage()+test_local(), fireSenseUtils 0.2.3.9165): branch 350 pass, 0 fail, 0 skip; base 340 pass, 0 fail, 0 skip.🤖 Generated with Claude Code
https://claude.ai/code/session_014G18Mik3fH4z5M5CyMSUS6