Repository navigation
This release introduces non-blocking asynchronous evaluation, an opt-in hand-written Pratt parser, Protobuf wire evaluation without generated descriptors via SelectOptimizer, standard extension support in the Lite Runtime, and official deprecation of the legacy CEL runtime builders.
Warning
Deprecation Notice: The legacy runtime builders (CelFactory.standardCelBuilder(), CelFactory.legacyCelBuilder(), CelRuntimeFactory.standardCelRuntimeBuilder(), and CelRuntimeFactory.legacyCelRuntimeBuilder()) are officially deprecated and will be removed in a future release (#1301, #1311). Callers must migrate to the Program Planner (CelFactory.plannerCelBuilder() and CelRuntimeFactory.plannerRuntimeBuilder())—see the Planner Migration Guide for details.
🚀 Highlights & New Features
- Asynchronous Evaluation (
Program.evalAsync): Custom functions backed by slow I/O (RPCs, database queries, remote lookups) no longer need to block threads or run sequentially in the Program Planner. ReturningListenableFutureviaCelAsyncFunctionBindinglets the runtime automatically dispatch independent async calls in parallel across expression branches, deduplicate identical in-flight calls, and short-circuit as soon as a logical branch resolves (#1191, #1234, #1235). - Pratt Parser (
enablePrattParser): Added an opt-in, hand-written Pratt parser (CelOptions.enablePrattParser(true)) that parses CEL expressions ~6–13x faster with ~5–7x fewer memory allocations in benchmarks than the default ANTLR parser, with zero dependency on the ANTLR runtime (#1197, #1245). - Descriptorless Protobuf Evaluation (
SelectOptimizer): Evaluating Protobuf messages in constrained environments (like Android /CelLiteRuntime) no longer requires generatingCelLiteDescriptorcode or deserializing fullMessageLiteobjects.SelectOptimizerembeds field numbers and wire types into the AST at build time to evaluate directly over rawWireMessageLitebytes orMessageLiteinstances. Because lookups resolve by wire tag rather than field name, Protobuf field renames are safe and additive schema changes between compile time and runtime are naturally tolerated (#1196, #1198, #1304). - Standard Extensions in Lite Runtime:
math,strings,sets,encoders,lists,regex, andcomprehensionsare now available inCelLiteRuntimewithout pulling in full Protobuf dependencies (#1298, #1312). - Ergonomics & Tooling:
- Simplified Functions: Define compile-time declarations and runtime bindings in a single call via
CelFunctionandCelBuilder.addFunctionswith automatic overload ID generation (#1359, #1361), plus human-readable YAML signatures like(string, int) -> bool(#1364). - String Formatting: Added
strings.formatinCelStringExtensions(#1165). - Bazel Rules: Added
compile_cel_policyto compile YAML policies intoCheckedExprbinary protos at build time (#1321, #1328) andcel_verifier_testfor declarative formal verification (#1209).
- Simplified Functions: Define compile-time declarations and runtime bindings in a single call via
⚡ Performance, Runtime & Optimizer Improvements
- Subexpression Optimizer (CSE): Significantly sped up producing optimized ASTs during the CSE pass on large expressions by eliminating quadratic subtree copies and repeated ID renumbering (#1340), added deduplication for equivalent commutative (a + b vs b + a) and flipped relational (a > b vs b < a) subexpressions (#1384), and sped up plan-time
cel.@blockvalidation (~3.5x faster) (#1339). - Program Planner:
- Replaced map lookups with indexed slot arrays for comprehension variables (up to 42% faster, 90% fewer allocations) (#1354) and eliminated
O(N²)list accumulator copies (#1335). - Added precompiled constant regexes (#1338), plan-time constant list/map folding (#1407), extension version validation (#1325), and
advanceEvaluationfor partial evaluation with unknown tracking (reaching feature parity with the legacy runtime) (#1285).
- Replaced map lookups with indexed slot arrays for comprehension variables (up to 42% faster, 90% fewer allocations) (#1354) and eliminated
- Protobuf & Lite Runtime: Direct
MessageLitegetter reads (50–95% faster), zero intermediate wrapper allocations or byte copies on chained field traversals, and ~23–51% smaller generatedCelLiteDescriptorcode and DEX footprint (#1341, #1344, #1358). - Optimizer Pipeline: Added
CelOptimizerListenerto inspect intermediate ASTs (#1194) and skipped redundant AST renumbering/re-checking on no-op passes (#1205).
🛡️ Formal Verification (CelVerifier)
- Well-Known Types: Registered Protobuf WKT descriptors (
Value,Struct,ListValue, wrappers, and nanosecond-preciseTimestamp/Duration) by default acrossCelVerifier, the CLI, and the REPL (#1369, #1374). - Usability & Soundness: Formatted counterexamples as valid CEL literals instead of raw Z3 expressions (#1399); fixed soundness gaps for comprehensions exceeding loop unroll limits (#1259),
dynvalues in truncated containers (#1279), and custom/type-conversion functions (#1385, #1388).
🐛 Bug Fixes & API Changes
- Clearer Diagnostics: Non-
booloperands in logical (&&,||) and ternary (_?_:_) expressions now report explicit type mismatches instead of "no matching overload", improving errors forall,exists,filter, andmappredicates (#1382, #1383). - Type Checker & AST: Fixed parameterized type unification (#1211),
Duration/Timestamptype normalization (#1283), Protobuf type provider priority (#1305),sortByelement type preservation (#1203),AstMutatorcomprehension variable scoping (#1280, #1408), and two-variablecel.@mapInsertoverload IDs (#1356). - Runtime Correctness: Fixed nested optional flattening and equality (#1416), planner error propagation (#1248), constant-index unknown matching (#1372), Java
nullrejection in list/map adaptation (#1242),FIXED32/FIXED64unsigned decoding (#1302), and unset wrapper map defaults (#1323). - API Cleanup: Deprecated
setStandardEnvironmentEnabledin favor of environment subsetting (#1190); removedenableHiddenAccumulatorVar(@resultis now always enabled) (#1224),resolveTypeDependencies(always enabled) (#1316), andsubexpressionMaxRecursionDepth(#1397).
Full Changelog: v0.14.0...v0.15.0