Skip to content

Releases: google/cel-cpp

Release v0.11.0

03 Apr 22:26
Compare
Choose a tag to compare

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.

  • #1042: Add interfaces and initial implementation for cel::Compiler.
  • [#1057](htt...
Read more

v0.10.0

25 Oct 16:55
Compare
Choose a tag to compare

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 in ProtoStructValueBuilder 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 and ConvertToJson for list and map 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 include ValueFactory& 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, and NativeTypeId 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 and DoubleTypeView by @copybara-service in #390
  • DurationType and DurationTypeView by @copybara-service in #392
  • Add benchmark tag to sets_functions_benchmark_test by @copybara-service in #406
  • IntValue and IntValueView by @copybara-service in #419
  • Use absl::Span for returns in attributes by @copybara-service in #426
  • TimestampValue and TimestampValueView by @copybara-service in #421
  • Delete unused base/type_registry.h by @copybara-service in #429
  • UnknownValue and UnknownValueView 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 and OpaqueTypeView 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 and MapValueView 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 to ProcessLocalTypeCache by @copybara-service in #458
  • Prevent binding to temporaries in TypeView and friends by @copybara-service in #461
  • OpaqueValue, OpaqueValueView, OptionalValue, and OptionalValueView 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, and Unqiue 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, and ValueCache by @copybara-service in #477
  • Rename memory_manager() to GetMemoryManager() 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...
Read more

Release v0.9.0

24 May 05:18
Compare
Choose a tag to compare

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

08 Jun 05:02
1e0fd3d
Compare
Choose a tag to compare

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
    • antlr: drop rules_antlr for custom rules [#153]
    • antlr: patch rule for external consumption [#154]

New Contributors

Full Changelog: v0.7.0...v0.8.0

Release v0.7.0

12 Oct 04:40
89d81b2
Compare
Choose a tag to compare

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

28 Jun 16:18
128f215
Compare
Choose a tag to compare

Patch release with the following fixes:

Fixes

  • ensure compatibility with non-aliased absl and std types;
  • fix harmless undefined behavior on empty string_view access.

Release v0.6.0

25 Jun 23:30
ebcffc2
Compare
Choose a tag to compare

This is a minor release with the following changes:

Fixes

  • [61aeb51] Fix literal integer constant suffix.
  • [d20e1ef] Lower the size of the input expression to 100k codepoints.
  • [6faa5a0] Update CreateContainerBackedMap to use absl::StatusOr and fix ValueToCelValue.

Changes

  • [30af72e] Default enable .size() to return the number of unicode codepoints instead of the number of bytes.
  • [4f3bddf] Delete debug_string library. Prefer the CelValue.DebugString() method.
  • [e972c4b] Introduce new Has method for presence testing on CelMap values.

Release v0.5.0

31 Mar 20:30
3b7f706
Compare
Choose a tag to compare

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

30 Jan 00:09
bb03a5f
Compare
Choose a tag to compare

Fixes

  • e53c05c Enforce utf-8 validity in string() conversion of bytes.
  • bca699e Introduce TypeRegistry with support for the type() 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.

Release v0.3.1

18 Dec 03:43
9841e3e
Compare
Choose a tag to compare

This release fixes bugs and implements functions and features which are supported by the core CEL specification.

Fixes

  • [Parser] Hex integer notation support.
  • [Conformance] Pipe protocol for evaluation, removing gRPC dependency.
  • [Interpreter] Ensure the lifecycle of rewritten expressions is preserved in CelExpression values.
  • [Interpreter] Division by zero support for doubles, per IEEE754.

Features

  • [Parser] Stable ordering of error messages.
  • [Interpreter] Type conversion support for uint(), double(), bytes(), and dyn() types.