Multi-plants - #186
Conversation
Benchmark Results (Julia v1)Time benchmarks
Memory benchmarks
|
- Added `Domain`, `SimulationMapping`, and `DomainSimulation` for composing plant, soil, scene, and future environment domains. - Added cross-domain stream/value dependencies with `AllDomains(...)` and explicit `Route(...)` materialization. - Added hard-domain dependencies with `HardDomains(...)`, `dependency_targets(...)`, `model_target(...)`, and `run_target!(...)` so scene models can manually run plant/soil targets, including iterative workflows. - Added MTG-backed domain support with selectors, multi-plant domains, graph-domain output publication, dynamic topology registration, organ removal, and reparenting. - Added `Updates(:var; after=...)` for intentional same-scale variable updates by later models. - Added environment/microclimate backend protocol with `AbstractEnvironmentBackend`, `GlobalConstant`, `meteo_inputs_`, `meteo_outputs_`, sampling, scattering, and validation. - Extended multirate support with `Dates`-based timesteps, inferred/explicit bindings, temporal output policies, scoped streams, meteo aggregation, and requested output export. - Added MAESPA-style example in [examples/maespa_domain_example.jl](/Users/rvezy/Documents/dev/PlantSimEngine/examples/maespa_domain_example.jl) with two plant species, shared soil, scene-scale iterative energy balance, and hard-domain targets. - Added docs for domain simulation, model traits, hard-domain target design, and implementation plan/handoff notes. - Added focused tests for domains, environment backends, meteo traits, updates, and the MAESPA example. Verification already run: - `julia --project=test test/runtests.jl` passed: `1844 / 1844` - `julia --project=docs docs/make.jl` passed - `git diff --check` passed Files to remember are untracked too, especially: - `src/domains/domain_simulation.jl` - `src/time/runtime/environment_backends.jl` - `src/dependencies/update_dependencies.jl` - `examples/maespa_domain_example.jl` - new docs under `docs/src/dev/` - new tests under `test/test-domain-simulation.jl`, `test/test-environment-backends.jl`, `test/test-maespa-domain-example.jl`, `test/test-meteo-traits.jl`, `test/test-updates.jl`
- remove ModelList compatibility
- replace Symbol("") mapping sentinels
- refactor repeated multirate input-resolution flow
- split the large domain runner into scheduler/routes/environment/graph/publication pieces
- replace assertions by more standard errors
Shared Status / StatusView interface helpers. Extracted repeated test graph comparison runner. Extracted toy tutorial MTG helpers. Typed export plans, reverse mappings, temporal stream aliases. Preserved renamed producer source variables in binding inference. Added explicit domain DAG run ordering. Added topology reindexing for RefVectors after add/remove/reparent. Split MAESPA scene solver math from side effects and added validation tests.
…r status anymore)
Fix recursive call leading to stack overflow
compile_scene (line 638) now validates required inputs_(model) variables. A required input is valid if it has a compiled Inputs(...)/inferred binding or already exists on the target object Status. Missing inputs now error with application id, object id, and input name. Added tests for missing inputs, ambiguous same-object producers, and status-provided inputs.
…cies. Unscoped Inputs(...) / Calls(...) dependency selectors now infer scope from the consumer object: scene consumers default to SceneScope() non-scene consumers default to Self() Direct public resolve_object_ids(scene, Many(...)) remains scene-wide unless within=... is explicit. Shared cross-scope dependencies from organs now need explicit within=SceneScope(), as in the updated shared-soil test. Added tests showing plant-level unscoped leaf inputs are plant-local, while scene-level unscoped leaf inputs are scene-wide.
Exceptional-organ Override(...). Instance and object-level model replacement validation. Concrete dispatch preserved for same-type parameter overrides. explain_instances(scene) and instance membership in explain_objects. New organs inherit instance kind and species. Hard-called overridden models use the correct per-object implementation.
… their helpers, runtime, tests, and documentation. This API was a failed tentative
- Overlap-weighted temporal windows, including pre-window held samples and output resampling. - timestep_hint/meteo_hint delegation for object overrides. - Atomic rejection of instance-root or ancestor removal/reparenting.
Dynamic organ creation repeatedly rebuilt scene bindings, selector matches, MTG IDs, and attribute/output structures—effectively rescanning the whole plant per organ. XPalm also had an ambiguous fruit-count producer binding. Incremental updates, caching, and explicit binding fixed it.
up MTG and PlantMeteo to latest releases (needed for this version, we previously had to use them as dev versions)
|
Can we get back to release performance before merging? |
…rmance [codex] Optimize dynamic organ lifecycle refresh
Proposed v0.15.0 changelog and migration scopeThe detailed v0.15 changelog prepared for this PR is organized around one central change: PlantSimEngine now uses a single compiled Why this redesignThe same scenario representation can now cover one object, multiscale plants, several plants or species, shared resources, dynamic topology, multirate execution, global or spatial environments, and retained output streams. Coupling, schedules, environment bindings, writers, and lifecycle changes are compiled and can be inspected through structured diagnostics. Main breaking changes
Main additionsThe release adds the unified object registry; Scientific equations can usually remain unchanged, but both model interfaces and scenario assembly must be migrated. Concrete translations for scenario structure, cross-object inputs, hard calls, multiple plants, multirate coupling, environments, dynamic organs, and output collection are documented in the CompositeModel/Object migration guide, including its compact migration table. Historical benchmark figures are intentionally not presented as validation of the current PR head; final performance evidence should be reported separately against the eventual merge SHA. |
|
Can't make the benchmark pass because there is so much difference in the API between release and this PR. I did some benchmarking locally instead:
So overall PSE is now faster, except for XPalm where we observe a bit of a slowdown, but this is the price of hardening the computation -> better handling of new and deleted organs, and most importantly new API for multi-plants, which adds a lot more to handle because it's done with genericity in mind. So not a bad result at all! |
Snapshot published outputs, temporal inputs, and final state so in-place updates cannot corrupt historical values or producer state. Support fixed subsecond periods, reject incompatible cadence grids and nonfinite durations, and tolerate equivalent floating representations. Preserve explicitly declared or remapped environment duration fields. Validation: output, timing, environment, previous-step, multirate, and lifecycle regressions passed, including existing scalar allocation checks.
Check whether run! methods accept the five-argument kernel contract, including valid variadic implementations. Compare named output policies independently of declaration order, matching runtime interface semantics. Remove unused helpers from the retired status-vector execution path and correct hard-dependency syntax in the generated model tutorial. Validation: 141 authoring assertions and 35 Status/process tutorial assertions passed.
Show the canonical model source in the first authoring tutorial. Correct rate-integration examples with duration-aware reducers and explain cadence grids, independent snapshots, and exact scientific contract matching. Make the packaged AI skill and evaluation harness portable across Julia hosts while respecting repository execution requirements. Remove the requirement to implement an additional hypothesis for every authoring task. Record the release corrections in the changelog. Validation: documentation build and rendered examples passed; the corrected packaged skill suite passed 112 assertions with all 15 oracles passing.
No description provided.