{"paper":{"title":"Bonsai: Compiling Queries to Pruned Tree Traversals","license":"http://creativecommons.org/licenses/by/4.0/","headline":"A compiler derives pruning conditions for tree queries via symbolic interval analysis to generate traversals matching expert code and outperforming linear scans for complex predicates.","cross_cats":["cs.DB"],"primary_cat":"cs.PL","authors_text":"Alexander J Root, Andrew Adams, Christophe Gyurgyik, Fredrik Kjolstad, Jonathan Ragan-Kelley, Kayvon Fatahalian, Purvi Goel","submitted_at":"2025-11-19T00:50:20Z","abstract_excerpt":"Trees can accelerate queries that search or aggregate values over large collections. They achieve this by storing metadata that enables quick pruning (or inclusion) of subtrees when predicates on that metadata can prove that none (or all) of the data in a subtree affect the query result. Existing systems implement this pruning logic manually for each query predicate and data structure. We generalize and mechanize this class of optimization. Our method derives conditions for when subtrees can be pruned (or included wholesale), expressed in terms of the metadata available at each node. We effici"},"claims":{"count":4,"items":[{"kind":"strongest_claim","text":"The generated traversals match the behavior of expert-written code that implements query-specific traversals, and can asymptotically outperform the linear scans and nested-loop joins that existing systems fall back to when hand-written cases do not apply.","source":"verdict.strongest_claim","status":"machine_extracted","claim_id":"C1","attestation":"unclaimed"},{"kind":"weakest_assumption","text":"That symbolic interval analysis extended with new rules for geometric predicates (intersection, containment) can derive correct and complete pruning conditions for the supported class of queries without missing cases or introducing unsound simplifications.","source":"verdict.weakest_assumption","status":"machine_extracted","claim_id":"C2","attestation":"unclaimed"},{"kind":"one_line_summary","text":"Bonsai compiles queries to pruned tree traversals by deriving pruning conditions with extended symbolic interval analysis and fusing compound queries into single traversals.","source":"verdict.one_line_summary","status":"machine_extracted","claim_id":"C3","attestation":"unclaimed"},{"kind":"headline","text":"A compiler derives pruning conditions for tree queries via symbolic interval analysis to generate traversals matching expert code and outperforming linear scans for complex predicates.","source":"verdict.pith_extraction.headline","status":"machine_extracted","claim_id":"C4","attestation":"unclaimed"}],"snapshot_sha256":"daa632bfb9c859863ae1c3ebbc07781117a02c1d7f25a6219630e3354e3fcbf1"},"source":{"id":"2511.15000","kind":"arxiv","version":3},"verdict":{"id":"73361fbf-59c3-4465-b654-4111b3807809","model_set":{"reader":"grok-4.3"},"created_at":"2026-05-17T21:24:04.700100Z","strongest_claim":"The generated traversals match the behavior of expert-written code that implements query-specific traversals, and can asymptotically outperform the linear scans and nested-loop joins that existing systems fall back to when hand-written cases do not apply.","one_line_summary":"Bonsai compiles queries to pruned tree traversals by deriving pruning conditions with extended symbolic interval analysis and fusing compound queries into single traversals.","pipeline_version":"pith-pipeline@v0.9.0","weakest_assumption":"That symbolic interval analysis extended with new rules for geometric predicates (intersection, containment) can derive correct and complete pruning conditions for the supported class of queries without missing cases or introducing unsound simplifications.","pith_extraction_headline":"A compiler derives pruning conditions for tree queries via symbolic interval analysis to generate traversals matching expert code and outperforming linear scans for complex predicates."},"integrity":{"clean":true,"summary":{"advisory":0,"critical":0,"by_detector":{},"informational":0},"endpoint":"/pith/2511.15000/integrity.json","findings":[],"available":true,"detectors_run":[],"snapshot_sha256":"c28c3603d3b5d939e8dc4c7e95fa8dfce3d595e45f758748cecf8e644a296938"},"references":{"count":0,"sample":[],"resolved_work":0,"snapshot_sha256":"258153158e38e3291e3d48162225fcdb2d5a3ed65a07baac614ab91432fd4f57","internal_anchors":0},"formal_canon":{"evidence_count":1,"snapshot_sha256":"142aa5fa8627c5bc9ee57d4477411ba43c3d3f20e17c64dbdcb20d845f0d6dbd"},"author_claims":{"count":0,"strong_count":0,"snapshot_sha256":"258153158e38e3291e3d48162225fcdb2d5a3ed65a07baac614ab91432fd4f57"},"builder_version":"pith-number-builder-2026-05-17-v1"}