Skip to content

Multi-plants#186

Draft
VEZY wants to merge 19 commits into
mainfrom
multi-plants
Draft

Multi-plants#186
VEZY wants to merge 19 commits into
mainfrom
multi-plants

Conversation

@VEZY

@VEZY VEZY commented Mar 18, 2026

Copy link
Copy Markdown
Member

No description provided.

@github-actions

github-actions Bot commented May 3, 2026

Copy link
Copy Markdown
Contributor

Benchmark Results (Julia v1)

Time benchmarks
main 07e958a... main / 07e958a...
bench_linux/PBP 18.4 ± 2.6 ms 28.2 ± 4.8 ms 0.654 ± 0.15
bench_linux/PBP_multiple_timesteps_MT 0.266 ± 0.066 s 0.277 ± 0.041 s 0.962 ± 0.28
bench_linux/PBP_multiple_timesteps_ST 0.269 ± 0.023 s 0.248 ± 0.022 s 1.08 ± 0.13
bench_linux/PSE 5.4 s 0.0605 h 0.0248
bench_linux/PSE_multirate_output_request_run 8.41 s 6.04 s 1.39
bench_linux/PSE_multirate_status_tracked_run 4.66 ± 0.49 s 4.2 ± 0.46 s 1.11 ± 0.17
bench_linux/XPalm_convert_outputs 1.3 ± 0.17 s 1.28 ± 0.17 s 1.01 ± 0.19
bench_linux/XPalm_run 12.5 s 18.3 s 0.682
bench_linux/XPalm_setup 1.04 ± 0.12 s 0.997 ± 0.13 s 1.04 ± 0.18
time_to_load 2.54 ± 0.05 s 2.49 ± 0.0034 s 1.02 ± 0.02
Memory benchmarks
main 07e958a... main / 07e958a...
bench_linux/PBP 0.131 M allocs: 8.11 MB 0.196 M allocs: 12.5 MB 0.65
bench_linux/PBP_multiple_timesteps_MT 3.73 M allocs: 0.237 GB 3.75 M allocs: 0.238 GB 0.995
bench_linux/PBP_multiple_timesteps_ST 3.58 M allocs: 0.213 GB 3.6 M allocs: 0.214 GB 0.994
bench_linux/PSE 0.0499 G allocs: 3.7 GB 3.06 G allocs: 64.9 GB 0.0569
bench_linux/PSE_multirate_output_request_run 0.0851 G allocs: 3.5 GB 0.0741 G allocs: 2.45 GB 1.43
bench_linux/PSE_multirate_status_tracked_run 0.0607 G allocs: 1.93 GB 0.0617 G allocs: 1.94 GB 0.991
bench_linux/XPalm_convert_outputs 6.62 M allocs: 0.436 GB 6.62 M allocs: 0.436 GB 1
bench_linux/XPalm_run 0.104 G allocs: 6.71 GB 0.143 G allocs: 8.4 GB 0.798
bench_linux/XPalm_setup 1.26 M allocs: 0.0375 GB 1.4 M allocs: 0.044 GB 0.854
time_to_load 0.145 k allocs: 11 kB 0.145 k allocs: 11 kB 1

@VEZY VEZY marked this pull request as draft May 4, 2026 12:59
VEZY added 17 commits June 3, 2026 17:25
- 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.
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant