Releases: google/cel-cpp
v0.12.0
Features
- Added support for subsetting standard library definitions in
TypeChecker
andCompiler
.
Optimizations
- Value stack was rewritten to reduce value churn cost during evaluation.
Bug Fixes
Type Checking
- stdlib definitions that didn't match CEL Spec were removed
- Type inference was updated to correctly handle comprehension results and list(enum)
Runtime
- Added additional checks for malformed ASTs that could lead to undefined behavior.
Other
- Misc portability and compiler warning fixes
- Cleanups / renames
Commit Log
- Optimize
EvaluatorStack
by @copybara-service in #1413 - Check for unexpected target (function call receiver) expressions in builtin operator handlers. by @copybara-service in #1414
- Optimize
EvaluatorStack
by @copybara-service in #1415 - Temporarily allow receiver call structured index calls. by @copybara-service in #1416
- Upgrade
ArenaStringPool
to handlestd::string
andabsl::Cord
by @copybara-service in #1412 - No public description by @copybara-service in #1402
- No public description by @copybara-service in #1401
- No public description by @copybara-service in #1404
- No public description by @copybara-service in #1403
- Scrub internal issue reference. by @copybara-service in #1420
- Update doc for constant folding to describe behavior when no constant arena is provided. by @copybara-service in #1419
- Move conformance testing matchers into separate file to facilitate reuse by @copybara-service in #1394
- Rename
NativeTypeId
toTypeInfo
by @copybara-service in #1418 - Remove
TypeManager
forward declarations by @copybara-service in #1425 - Fix conformance runner post refactor by @copybara-service in #1427
- Add support for converting cel::Type to proto. by @copybara-service in #1426
- Make TypeCheckerBuilder::Build() non-destructive. by @copybara-service in #1421
- Fix EnumType handling in cel::TypeToProto. by @copybara-service in #1435
- Make CompilerBuilder::Build() non-destructive. by @copybara-service in #1423
- Make ParserLibrary behave more consistently with CheckerLibrary. by @copybara-service in #1424
- Support for declaring a subset to filter definitions from a checker library. by @copybara-service in #1422
- Add support for subsetting libraries in CompilerBuilder. by @copybara-service in #1438
- Fix a bug where type checker would treat the type assignment for the result of a comprehension as flexible / possible to widen. by @copybara-service in #1440
- Add AddUnknownPattern() and AddMissingPattern(). by @copybara-service in #1442
- Remove declarations for 'timestamp' and 'duration' as type identifiers. by @copybara-service in #1445
- Fix handling for repeated enum fields by @copybara-service in #1441
- remove default move constructor declaration for type_registry to fix compiler warning. Intended to be managed as part of a runtime environment managed by a smart pointer. by @copybara-service in #1461
- Export exercise4 for codelab. by @copybara-service in #1457
- Misc codelab cleanup: by @copybara-service in #1458
- Add debug checks for containers unexpectedly returning unknown values by @copybara-service in #1462
- Update to setup instructions for codelab. Add a Dockerfile as a reference for setup. by @copybara-service in #1465
- Implement C++ utility for CEL field extraction. by @copybara-service in #1460
- Migrate the regex_functions extension to the new cel::Value type. by @copybara-service in #1459
- No public description by @copybara-service in #1463
- Automated Code Change by @copybara-service in #1467
- Introduce math.sqrt to CEL C++ math extension by @copybara-service in #1464
- copybara script updates to better support import. no functional changes. by @copybara-service in #1474
- internal by @copybara-service in #1480
- Function for conversion of string to bool by @copybara-service in #1477
- cel_cc_embed: Open in file in binary mode by @jchadwick-buf in #1443
- Dependency fixes for exporting. no functional changes. by @copybara-service in #1476
- Avoid nesting status macros by @jchadwick-buf in #1450
- Prefer ptrdiff_t over ssize_t by @jchadwick-buf in #1448
- Update exercise2 to use the type checker and demonstrate configuring variables. by @copybara-service in #1466
- Automated Code Change by @copybara-service in #1483
ByteString
: Adjust bitfields for MSVC by @jchadwick-buf in #1446- Add utility for formatting type names for display in error messages. by @copybara-service in #1486
- Avoid including time_util in time.h by @jchadwick-buf in #1485
- internal by @copybara-service in #1498
- Check that jump steps were included into the program plan before trying to by @copybara-service in #1506
- Add option for using protobuf WKTs as context decl in type checking. by @copybara-service in #1449
- Add support for updating variable declaration on cel::TypeCheckerBuilder by @copybara-service in #1539
- Add support for injecting a custom attribute matcher. by @copybara-service in #1536
- Update type checker decls for extension packages. by @copybara-service in #1540
- Fix parts of CEL C++ to be more compatible with Windows-based toolchains by @copybara-service in #1553
- Fix typo: "AddConatainerOps" to "AddContainerOps". by @copybara-service in #1578
- Add RegexCheckerLibrary for regex functions by @copybara-service in #1555
- Suppress gcc warning for direct memory write in value_variant.h. by @copybara-service in #1583
- Add ListsCheckerLibrary for list functions by @copybara-service in #1565
- Fix a typo in the description of IsDone() method. by @copybara-service in #1590
- Add CompilerLibraries for lists and strings extensions. by @copybara-service in #1579
- Suppress clang warning for direct memory write in value_variant.h. by @copybara-service in #1594
Full Changelog: v0.11.0...v0.12.0
Release v0.11.0
Release v0.11.0
Breaking Changes
This release includes significant breaking changes, notably switching the underlying protobuf definitions from google.api.expr to the canonical dev.cel protos. Additionally, the Reserve() method has been removed from MutableRepeatedFieldRef in the reflection utilities.
- #1019: Breaking change: Use dev.cel (canonical) protos instead of google.api.expr
- #1112: Breaking change: Remove MutableRepeatedFieldRef::Reserve() in reflection
Core Value System, Memory Management, and Internals Refactoring
A major focus was on refactoring the core value types, memory management, and internal representations. This involved removing the ValueManager, consolidating type providers, overhauling arena and message factory propagation, removing legacy type reflectors and builders, introducing hand-rolled variants for cel::Value, ListValue, MapValue, and StructValue for better performance and control, refining the ByteString implementation, adding ZeroCopyInputStream/OutputStream, devirtualizing cel::Data, finalizing parts of the Value API, and cleaning up legacy value handling. Dispatch tables were added for custom value types to improve extensibility.
- #1014: Remove dependency on getting list/map value builders from factory/managers
- #1023: Overhaul propagation of arenas and message factories
- #1025: Remove TypeFactory from TypeIntrospector
- #1027: Consolidate type providers into two: one for legacy and one for modern
- #1028: Remove the usage of type reflectors for optional types
- #1065: Reject legacy runtime type values with empty typenames when converting to
- #1076: Improve error messages for Value type casting errors.
- #1157: Remove references to now unused option use_legacy_container_builders.
- #1174: Remove usages of native JSON and Any representations
- #1177: Rename Parsed{List,Map,Struct}Value to Custom{List,Map,Struct}Value
- #1186: Migrate includes from base/kind.h to common/kind.h
- #1196: Remove now unused native JSON types
- #1236: Remove ValueManager& from NewIterator()
- #1251: Remove ValueManager 1
- #1254: Remove ValueManager from Activation
- #1255: Remove ValueManager from TraceableProgram::Trace.
- #1258: Remove ValueManager
- #1263: Delete cel::common_internal::DataInterface
- #1269: Add ZeroCopyInputStream and ZeroCopyOutputStream for BytesValue
- #1274: Update common_internal::ByteString
- #1275: Add debug checks for valid duration and timestamp
- #1280: Add missing common_internal::ByteString::Clone
- #1281: Migrate from common_internal::SharedByteString to common_internal::ByteString
- #1295: Do not clear the constant folding arena
- #1296: Finalize more parts of the Value API
- #1297: Cleanup Legacy values
- #1298: Cleanup Legacy values
- #1299: Cleanup Legacy values
- #1302: Finalize TypeValue
- #1303: absl::Cord& -> absl::Nonnull<absl::Cord*>
- #1306: Drop cel::Value back down to 32 bytes
- #1307: Devirtualize cel::Data
- #1308: cel::Value::Clone(Allocator<>) -> cel::Value::Clone(absl::Nonnull<google::protobuf::Arena*>)
- #1311: Switch from cel::Shared<T> to cel::Owned<T>
- #1312: Delete Shared and SharedView
- #1323: Fix handling of invalid values with optional elements/entries/fields
- #1325: Fix error value handling in create map/struct
- #1327: Add dispatch table support for CustomStructValue
- #1334: Add dispatch table support for CustomListValue
- #1335: Add dispatch table support for OpaqueValue
- #1340: Add dispatch table support for CustomMapValue
- #1349: Drop reference counting support from protobuf related values
- #1350: Remove assignment operators
- #1352: Implement hand-rolled variant for cel::Value
- #1354: Implement hand-rolled variant for cel::ListValue
- #1355: Implement hand-rolled variant for cel::MapValue
- #1356: Implement hand-rolled variant for cel::StructValue
- #1364: Remove manual construction workaround from TypeValue
- #1375: Redo ArenaString
- #1376: Remove common_internal::ByteStringView
- #1377: Value::SerializeTo(..., absl::Cord*) -> Value::SerializeTo(..., ZeroCopyOutputStream*)
- #1382: Lock down custom value interfaces
- #1400: Check for in-range timestamp and duration values in Value conversion.
Type Checker Enhancements & Fixes
The type checker received several updates, including support for declaring an overall expected expression type, improved type widening logic to align with Go/Java, better handling of function declarations in conformance tests, support for iter_var2 in comprehensions, options for input size limits, filtering of bad line information, improved error reporting for type deduction failures, support for declaring context messages, and integration with an optional protobuf Arena instance. The builder pattern was also refined.
- #1009: Add support for declaring an overall expected type to the type checker.
- #1020: Fix forwarding checker options from CreateTypeCheckerBuilder overload.
- #1031: Update type assignment widening behavior to more closely follow the 'MoreGeneral' check in the Go and Java implementations.
- #1032: Update conformance to correctly handle applying function declarations from the test file to the TypeCheckerBuilder.
- #1046: Update type checker to handle iter_var2
- #1069: Add option to set input expression size limit in type checker.
- #1072: TypeChecker updates to filter bad line information.
- #1073: Refactor factory functions for TypeCheckerBuilders.
- #1074: Make TypeCheckerBuilder class abstract.
- #1075: Update type checker to fail (return a status) if it fails to deduce the type of subexpression.
- #1077: Checker support for declaring context messages.
- #1081: Add support for type checker type deduction conformance tests.
- #1309: Add an optional protobuf Arena tied to TypeCheckerBuilder instances.
Compiler, Planner & Execution Optimizations
New cel::Compiler interfaces were introduced, along with initial implementations and support for optionals. Performance was improved through specialized implementations for common operators (!_, @not_strictly_false, ==, !=, @in), optimized string/bytes operations (concatenation, startsWith, endsWith, contains), optimized evaluator stack access, memoized enum lookups, reduced temporary allocations in the planner, optimized program builder bookkeeping, and direct visitor calls instead of std::invoke. Fixes were made for slot calculations and error handling in the planner.
v0.10.0
Release covering updates over the last year including recent refactors for the updated Value type and initial implementation of type checker.
Note: Upcoming changes after this release will migrate many references to protobuf Message types to the canonical versions in CEL spec and will likely require client updates.
What's Changed
- Add support for managing modern type providers in the CEL type registry. by @copybara-service in #183
- Add accessors for extracting legacy type from cel::LegacyStructType. by @copybara-service in #186
- Patch of #188 to support BUILD environment customization. by @copybara-service in #193
- Remove unused functions from evaluator core. by @copybara-service in #203
- Split flat expression evaluator implementation from implementation of the legacy CelExpression interface. by @copybara-service in #204
- IWYU fixes for attribute trail. by @copybara-service in #215
- Update CEL C++ grammar to recognize but reject optional by @copybara-service in #221
- Remove direct interop usages from flat_expr_builder. by @copybara-service in #222
- Fix internal comment scrubbing using wrong tags. by @copybara-service in #233
- Fixed the reference to CelExpression::Trace in the documentation for CelEvaluationListener. by @copybara-service in #234
- Implement partial support for setting repeated and map value
google.protobuf.Any
fields inProtoStructValueBuilder
by @copybara-service in #236 - Partially migrate create_list_step. by @copybara-service in #249
- Add modern value implementation of mutable list for map/filter list builder optimization. by @copybara-service in #250
- Add utilities for creating
google.protobuf.Any.type_url
by @copybara-service in #259 - Move arithmetic operators to runtime/standard. by @copybara-service in #267
- Add protocol buffer message encoding utility class by @copybara-service in #268
- Add optimized program plan step for the select optimization. by @copybara-service in #247
- Add generic implementation of
ConvertToAny
andConvertToJson
forlist
andmap
by @copybara-service in #278 - Refactor comprehension planning in flat expr builder to use comprehension specific visitor callbacks. by @copybara-service in #293
- Simplify value stack operations for comprehensions. by @copybara-service in #295
- Migrate in functions to use Handles. by @copybara-service in #303
- Move error factories from eval/internal to runtime/internal by @copybara-service in #304
- Prepare to migrate
create_struct_step.cc
for map by @copybara-service in #316 -
- Add support for checked downcast on runtime to support extensions. by @copybara-service in #287
- Update signature of
MapValue::Has
to includeValueFactory&
by @copybara-service in #325 - Add end to end tests for modern protobuf type provider impl. by @copybara-service in #327
- Fully implement optional syntax for parser by @copybara-service in #338
- Add cel::Value and cel::Activation equivalent of the bind context to activation helper. by @copybara-service in #341
- More
cel::Macro
cleanup by @copybara-service in #348 - Export kPayloadUrlMissingAttributePath to public header. by @copybara-service in #350
- Introduce Issue and IssueCollector types for collecting issues encountered during expression planning. by @copybara-service in #356
- Update
Kind
,TypeKind
, andNativeTypeId
by @copybara-service in #367 - Add exception macros by @copybara-service in #374
- Add to proto function for cel::Ast. by @copybara-service in #368
- No public description by @copybara-service in #378
- Internal change by @copybara-service in #380
DoubleType
andDoubleTypeView
by @copybara-service in #390DurationType
andDurationTypeView
by @copybara-service in #392- Add
benchmark
tag tosets_functions_benchmark_test
by @copybara-service in #406 IntValue
andIntValueView
by @copybara-service in #419- Use
absl::Span
for returns in attributes by @copybara-service in #426 TimestampValue
andTimestampValueView
by @copybara-service in #421- Delete unused
base/type_registry.h
by @copybara-service in #429 UnknownValue
andUnknownValueView
by @copybara-service in #428- Remove ability to modify
EnumType
equality and hashing by @copybara-service in #432 - Add least and greatest macros for Math extension library by @copybara-service in #431
- Rework
OpaqueType
andOpaqueTypeView
by @copybara-service in #434 - Allow
Type
to be default constructible by @copybara-service in #436 - Allow
Value
to be default constructible by @copybara-service in #437 - Add
TypeFactory
by @copybara-service in #439 - Update Qualify interface to optionally return the number of qualifiers applied. by @copybara-service in #405
MapValue
andMapValueView
by @copybara-service in #454- Allow
OptionalType
to be default constructed by @copybara-service in #456 - Improve hashing of
Type
,TypeView
, and friends by @copybara-service in #460 - Refactor
CommonTypes
toProcessLocalTypeCache
by @copybara-service in #458 - Prevent binding to temporaries in
TypeView
and friends by @copybara-service in #461 OpaqueValue
,OpaqueValueView
,OptionalValue
, andOptionalValueView
by @copybara-service in #457- Attach modern runtime to conformance tests with noisy test failures. Update skip list for failing tests. by @copybara-service in #464
- Add navigable_ast utility for AST analysis. by @copybara-service in #462
- Update type cache to return views by @copybara-service in #466
- Store cached optionals separate from opaques for efficiency by @copybara-service in #467
- Move default optional value to
ProcessLocalValueCache
by @copybara-service in #468 - Update protobuf type adapter to support select optimization through map and repeated fields. by @copybara-service in #438
- Update
ValueView
and friends to avoid binding to temporaries by @copybara-service in #469 - Add support for pre/post order traversals on NavigableExpr. by @copybara-service in #465
- Add stringifiers for Navigable AST enums. by @copybara-service in #473
- Allow
Shared
,SharedView
, andUnqiue
to be default constructed by @copybara-service in #472 - Refactor value deserialization to be handle agnostic by @copybara-service in #474
- Refactor value serialization to be handle agnostic by @copybara-service in #475
- Default enable unique numbering in C++ CEL parser for built-in macro accumulator vars. Previously, all Expr nodes representing the internal accu_var 'result' shared the same ID in a given comprehension. by @copybara-service in #453
- Refactor
TypeFactory
,TypeCache
, andValueCache
by @copybara-service in #477 - Rename
memory_manager()
toGetMemoryManager()
by @copybara-service in #478 - Introduce
ValueFactory
by @copybara-service in #479 - Add benchmarks for bind expressions. by @copybara-service in #483
- No public description by @copybara-service in #459
- Update slot indexing to use a manager rather than assuming 2 slots per comprehension. by @copybara-service in https://github.com/google/cel-cpp...
Release v0.9.0
Release v0.9.0
This release represents roughly one year plus of refactors aimed at improving performance and removing
protobuf as a core link time dependency of CEL. There are still many more changes in flight, but this release
represents a significant update in how CEL is designed and implemented within C++.
New Contributors
Full Changelog: v0.8.0...v0.9.0
Release v0.8.0
Changes
- Removed UTF-8 library dependencies
- Optimized performance of list append in tight loops
- Introduced support for heterogeneous equality and cross-type numeric comparison
- Update to the latest version of ANTLR
New Contributors
Full Changelog: v0.7.0...v0.8.0
Release v0.7.0
This release is primarily focused on security hardening and dead code elimination.
Fixes
- Limit the number of characters that may be read when attempting error recovery (635951c)
- Set the default comprehension iteration limit to 10000 (83fb851)
- Check all arithmetic operations and type conversions for overflow (99ebd43)
- Reject Timestamp values outside the string-expressible range
- Reject Duration values which cannot be expressed within an
int64
value - Heap buffer overrun for specialized binary and ternary operators (dfe31a4)
- Ensure only valid map keys are supported in
CreateStruct
(3261a58)
Cleanups
This release also removes dependencies on the v1beta1
protos and deletes a lot of
related code which was otherwise used within CEL.
Release v0.6.1
Patch release with the following fixes:
Fixes
- ensure compatibility with non-aliased
absl
andstd
types; - fix harmless undefined behavior on empty string_view access.
Release v0.6.0
Release v0.5.0
Latest release of cel-cpp which raises cel-spec conformance from 78% to 94.2%. The major boost in coverage is support for serializing CelValue
objects to the appropriate protobuf type, including to google.protobuf.Struct
values.
Additionally, there are a number of hardening fixes for the parser and evaluator to address issues found by public and private fuzzers.
Fixes
- [#85] The macro exists_one should not short-circuit false.
- [#86] Map macro may produce empty values instead of erroring.
- [#94] Missing
string()
conversion for timestamps and durations. - [#96] Proto2/3 well-known type conversion support to CEL values
- [#104] duration() allows inf / -inf values
- [663c2d8] Use unicode code point count for
<string>.size()
Features
- [8ad13052] Introduce an error recovery limit for the CEL Parser.
Release v0.4.0
Fixes
- e53c05c Enforce utf-8 validity in
string()
conversion ofbytes
. - bca699e Introduce
TypeRegistry
with support for thetype()
function and message creation within a container. - f347557 Apply clang-tidy suggestions.
The introduction of a TypeRegistry
makes it possible to register the type names of protobuf messages, or other types, as identifiers that can be used within CEL expressions. This is the primary motivation for the creation of a new release, rather than a point release.