Repository navigation
Adapt subtree selectors to query candidate size - #223
Merged
Merged
Conversation
VEZY
marked this pull request as ready for review
October 8, 2026 21:32
Contributor
Benchmark Results (Julia v1.12.1)Time benchmarks
Memory benchmarks
|
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.
Plant-local selectors spanning more than 32 objects previously copied global label candidate sets before checking ancestry. With common leaf labels, repeating that work for every plant and input caused compilation time and allocations to grow roughly quadratically with scene density.
The resolver now borrows the smallest usable registry candidate bucket and uses its estimated size as the budget for an iterative subtree walk. A completed walk is filtered locally; otherwise resolution filters the bucket by every label and topology criterion. Candidates already supplied by the relation resolver skip repeated membership checks while retaining label/ID filtering and explicit scope intersections. This preserves collection matching, explicit IDs, singular cardinality, named/relative scopes, relations, and deterministic ordering without copying scene-wide sets.
Repeated
Manyqueries within one consumer's compilation share an owned, unfiltered ID snapshot. Each binding owns a separate result vector before producer filtering. The cache is discarded after consumer assembly; existing lifecycle refresh paths remain responsible for topology and label changes.Generic benchmark comparison against
7f3293644c408a1197131a57ab5301c700ed3140, using Julia 1.13.1 through Kaimon:The largest case uses one timed sample after warming the same signatures on smaller fixtures. Smaller and sparse cases use three samples. Exact ordered binding IDs, producers, variables and live references are checked, including all 5504 bindings in the largest four-input case. Construction and ordinary execution are measured separately; no timestep speedup is claimed. Query sharing reduces candidate-only query-work allocations from 37.47 MB to 10.06 MB at 304 plants/four inputs; this is not a full compiler ablation. The benchmark notes, standalone driver and paired JSON include all eight comparisons, source fingerprints and measurement limitations. These generic fixtures do not establish scientific AgriPV validity or downstream full-scene performance.
Initial implementation validation (
a20b970f, 2026-10-08): the full Kaimon-controlled regression suite passed on the exact repository source: 6371 passed, 0 failed, 0 errored, Julia 1.13.1 (2113.1 s). The focused adaptive selector/binding/lifecycle suite also passed 516 assertions separately. The test project now selects the local package source, and the runner fails immediately if it loads another checkout. XPalm and PlantGeom integrations, documentation, the documentation preview and graph-editor E2E checks have passed remotely; all six Julia 1.10/latest CI jobs subsequently passed for that commit.Initial-commit remote validation had an independent blocker: PlantBiophysics multi-timestep setup fails with
UndefVarError: leaf_scene not definedatbenchmark/test-plantbiophysics.jl:51, before running benchmarks. That file and its test runner are identical to base commit7f329364; the job clones PlantBiophysics master70963fb0f60414026773e0361155d8729a79e418, which has removed that API. This selector PR leaves the separate downstream benchmark migration for follow-up.The initial-commit PlantBiophysics integration job also fails in downstream
test/evaluation/scenarios.jl:205: CSV 1.1.0 supplies a text time column, andDates.formatraises aMethodErroronDataStrings.DataStringvalues. The log reports 559 passes, zero failures and one error after its scenario simulations complete. Relevant PlantSimEngine time/environment/runtime files and the integration workflow are unchanged from the base; that base was not rerun for this downstream error.Current-head validation (
41de32f2, 2026-10-14): the resolved-relation path retains label/ID filters and explicit scope intersections while skipping redundant membership scans. Deep-chain tests at depths 64 and 256 enforce a linear comparison bound and verify exact ordering, scope intersections, singular selection and descendant root exclusion. At depth 256, forcing the previous full-check path made 33152 ID comparisons; the fixed query made zero with identical IDs, so the regression gate rejects the previous behavior without timing thresholds.Fresh Kaimon-controlled checks on Julia 1.13.1 passed 2800 assertions, zero failures or errors: adaptive selectors 540; unified model/object API 751; API stabilization 760; binding inference 16; identity-aware inputs 82; hard calls 279; initializers 157; distributed output targets 215. Logging-sensitive suites used Kaimon's normal-stdio test subprocess. The original full-suite and benchmark results above remain attributed to
a20b970f; this follow-up ran the listed focused contract suites. CI for the new head has been triggered by the push.