Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
444a545
Pure-Java conformance tests
snazy Jul 17, 2026
8c61801
Align CEL-Spec conformance behavior
snazy Jul 17, 2026
cf52e65
Prune nulls from protobuf repeated and map fields
snazy Jul 17, 2026
474adf7
Remove stale map Any null-retention skips
snazy Jul 17, 2026
070b39d
Return CEL errors for invalid protobuf field values
snazy Jul 17, 2026
4c0bd72
Add type deduction conformance coverage
snazy Jul 17, 2026
6dc4c54
Enable passing float range conformance cases
snazy Jul 17, 2026
d213be7
Enable passing legacy enum range conformance cases
snazy Jul 17, 2026
9d23c2a
Check 32-bit protobuf wrapper ranges
snazy Jul 17, 2026
f014df4
Convert large uint values to JSON strings
snazy Jul 17, 2026
f517719
Support protobuf well-known JSON values
snazy Jul 17, 2026
4c721df
Reject float keys in map literals
snazy Jul 17, 2026
a1c3eab
Honor protobuf NaN equality semantics
snazy Jul 17, 2026
f990ff9
Preserve nested Any conformance values
snazy Jul 17, 2026
b236881
Reject non-string keys for protobuf Struct conversion
snazy Jul 17, 2026
3899369
Enable proto3 negative-zero float conformance case
snazy Jul 17, 2026
d675474
Prefer wrapper types when unifying list elements
snazy Jul 17, 2026
1e96352
Preserve nullable types when unifying with null
snazy Jul 17, 2026
d9c2afb
Improve checker type parameter inference
snazy Jul 17, 2026
9395328
Preserve comprehension variable shadowing
snazy Jul 17, 2026
4c7564f
Support proto2 extension field access
snazy Jul 17, 2026
8ad60d1
Add proto extension helper library
snazy Jul 17, 2026
33bdc95
Add supported string extension conformance
snazy Jul 17, 2026
f58a4db
Complete string extension conformance
snazy Jul 17, 2026
e557fee
Add optional type-check declarations
snazy Jul 17, 2026
99b0e0e
Narrow strong enum conformance skips
snazy Jul 17, 2026
7201164
Re-enable deep message literal conformance
snazy Jul 17, 2026
9f415cd
Add encoder extension conformance
snazy Jul 17, 2026
033bd10
Add binding macro conformance
snazy Jul 17, 2026
4d65b82
Add math extension conformance
snazy Jul 17, 2026
e8e3fa3
Add network extension conformance
snazy Jul 17, 2026
455a1e6
Add block extension conformance
snazy Jul 17, 2026
32ffde1
Add comprehension v2 conformance
snazy Jul 17, 2026
a58dd6e
Note about CEL strong-enums
snazy Jul 17, 2026
680ca0f
Replace ANTLR parser with CongoCC
snazy Jul 17, 2026
d6a52e9
Implement CEL optional conformance support
snazy Jul 17, 2026
be0dc8e
END OT CEL-SPEC 0.25.2 WORK
snazy Jul 17, 2026
9cfb24b
Replace `Arrays.asList()` with single element with `List.of()`
snazy Jul 17, 2026
87ec9ce
[style] Replace with enhanced switch expression
snazy Jul 17, 2026
a0e725d
[style] replace with pattern variable
snazy Jul 17, 2026
6c53830
Use String.repeat()
snazy Jul 17, 2026
fc7278b
Use `.isEmpty()`
snazy Jul 17, 2026
54e7dab
Fix AstPruner / struct-pruning
snazy Jul 17, 2026
60bcc05
Remove unused `ParseError`
snazy Jul 17, 2026
a44f6c6
Remove unused function in TypeErrors
snazy Jul 17, 2026
9fa4a8b
Remove duplicate `if`
snazy Jul 21, 2026
5b1afc7
Optimize protobuf map construction
snazy Jul 21, 2026
77d7b89
Optimize Jackson 2 field access
snazy Jul 21, 2026
1357f5c
Optimize Jackson 3 field access
snazy Jul 21, 2026
dcd1b51
Optimize generated protobuf field access
snazy Jul 21, 2026
6559a7b
Centralize native value conversion
snazy Jul 21, 2026
2adecc3
Specialize ternary/quaternary/quinary overload evaluation
snazy Jul 21, 2026
d71ff2b
Optimize generated protobuf field access
snazy Jul 21, 2026
4a3c126
Optimize CEL collection and map operations
snazy Jul 21, 2026
455cfc3
Optimize native collection traversal
snazy Jul 21, 2026
c4f0f16
Cache common CEL scalar values
snazy Jul 21, 2026
0a4370d
Minor optimizations & style fixes
snazy Jul 21, 2026
b20da39
Allocation-free activation lookup
snazy Jul 22, 2026
abbdf2c
Benchmark evaluator boundaries and centralize numeric semantics
snazy Jul 22, 2026
6e56161
Add native-value planned evaluation
snazy Jul 22, 2026
cba645d
baseline
snazy Jul 24, 2026
e22db96
list-concat
snazy Jul 24, 2026
2ec6cc2
exact protobuf fields and dynamic string-map lookup
snazy Jul 24, 2026
c9fc754
Optimize exact aggregate map and list consumers
snazy Jul 24, 2026
5f851f0
Compose OptOptimize with native evaluation
snazy Jul 25, 2026
7e38a5a
Extend native list-concat consumer optimizations
snazy Jul 25, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 0 additions & 13 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,19 +68,6 @@ jobs:
- name: Microbenchmarks
run: ./gradlew jmh

- name: Cache Bazel stuff
if: ${{ matrix.java-version == '21' }}
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6
with:
path: |
~/.cache/bazel
key: bazel-${{ hashFiles('**/.gitmodules') }}
restore-keys: bazel-

- name: Conformance tests
if: ${{ matrix.java-version == '21' }}
run: conformance/run-conformance-tests.sh

- name: Capture test results
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
if: failure()
Expand Down
44 changes: 34 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ The CEL specification can be found [here](https://github.com/google/cel-spec).
- [Motivation](#motivation)
- [Arbitrary Java classes](#arbitrary-java-classes)
- [Unsigned 64-bit `uint`](#unsigned-64-bit-uint)
- [Protobuf enum semantics](#protobuf-enum-semantics)
- [Native image and package verification](#native-image-and-package-verification)
- [Not yet implemented](#not-yet-implemented)
- [Unclear double-to-int rounding behavior](#unclear-double-to-int-rounding-behavior)
Expand Down Expand Up @@ -394,14 +395,32 @@ but `123u == 123u` and `123 == 123` are.
If you have a `uint32` or `uint64` in protobuf objects, or use `uint`s in CEL expressions, wrap those
values with `org.projectnessie.cel.common.ULong`.

### Protobuf enum semantics

CEL-Java follows the CEL-Spec v0.25.2 language definition for protobuf enum values: protobuf enum
constants and enum fields are represented as CEL `int` values.

The upstream CEL-Spec conformance testdata also contains strong-enum cases where enum values
preserve their enum type. CEL-Java does not currently enable those strong-enum conformance cases.
They are not part of the v0.25.2 language-definition baseline and are mutually incompatible with the
legacy enum-as-int conformance sections in a single-mode runtime.

Use numeric enum values directly, or use `int(...)` when writing expressions that should remain clear
if strong enum support is added in the future:

```cel
TestAllTypes.NestedEnum.BAR == 1
int(TestAllTypes.NestedEnum.BAR) == 1
```

### Native image and package verification

Native-image and package behavior must be verified in the consuming application's exact build.
`cel-standalone` can reduce dependency conflicts by relocating protobuf dependencies, but it does not
prove Quarkus native-image or package compatibility for every application.

Before using CEL conditions in release-critical authorization paths, run JVM condition tests, the
consuming project's normal build, dependency tree review for protobuf/ANTLR/Jackson conflicts, and
consuming project's normal build, dependency tree review for protobuf/Jackson conflicts, and
package/native-image verification if native execution is part of the release path.

### Not yet implemented
Expand Down Expand Up @@ -433,17 +452,17 @@ The CEL-Go implementation does not pass these CEL-spec conformance tests:

```text
--- FAIL: TestSimpleFile/conversions/int/double_truncate (0.01s)
simple_test.go:219: double_truncate: Eval got [int64_value:2], want [int64_value:1]
double_truncate: Eval got [int64_value:2], want [int64_value:1]
--- FAIL: TestSimpleFile/conversions/int/double_truncate_neg (0.01s)
simple_test.go:219: double_truncate_neg: Eval got [int64_value:-8], want [int64_value:-7]
double_truncate_neg: Eval got [int64_value:-8], want [int64_value:-7]
--- FAIL: TestSimpleFile/conversions/int/double_half_pos (0.01s)
simple_test.go:219: double_half_pos: Eval got [int64_value:12], want [int64_value:11]
double_half_pos: Eval got [int64_value:12], want [int64_value:11]
--- FAIL: TestSimpleFile/conversions/int/double_half_neg (0.01s)
simple_test.go:219: double_half_neg: Eval got [int64_value:-4], want [int64_value:-3]
double_half_neg: Eval got [int64_value:-4], want [int64_value:-3]
--- FAIL: TestSimpleFile/conversions/uint/double_truncate (0.01s)
simple_test.go:219: double_truncate: Eval got [uint64_value:2], want [uint64_value:1]
double_truncate: Eval got [uint64_value:2], want [uint64_value:1]
--- FAIL: TestSimpleFile/conversions/uint/double_half (0.01s)
simple_test.go:219: double_half: Eval got [uint64_value:26], want [uint64_value:25]
double_half: Eval got [uint64_value:26], want [uint64_value:25]
```

## Building and testing CEL-Java
Expand All @@ -470,6 +489,11 @@ repository, in case you want to use CEL-Java snapshot artifacts from another pro
The project uses Google Java style and the Spotless plugin. Run `./gradlew spotlessApply` to fix
formatting issues.

To run the CEL-spec conformance tests, Go, Bazel, and their toolchains are required. From the
CEL-Java repo, run `conformance/run-conformance-tests.sh`. That script performs the necessary Gradle
and Bazel builds.
To run the CEL-Spec conformance tests, use the JUnit-based conformance suite:

```shell
./gradlew :cel-conformance:test
```

The conformance suite reads upstream CEL-Spec textproto testdata from the `submodules/cel-spec`
submodule. It does not require Bazel, Go, or a separate conformance server.
1 change: 0 additions & 1 deletion bom/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ plugins {
dependencies {
constraints {
api(project(":cel-core"))
api(project(":cel-generated-antlr"))
api(project(":cel-generated-pb"))
api(project(":cel-generated-pb3"))
api(project(":cel-conformance"))
Expand Down
3 changes: 1 addition & 2 deletions build-logic/src/main/kotlin/cel-conventions.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ nessieConfigureJava()

val nonPublishedProjects =
setOf(
"conformance",
"jacoco",
"cel-conformance",
"cel-quarkus-smoke-standalone",
"cel-quarkus-smoke-core-pb3-jackson3",
)
Expand Down
1 change: 0 additions & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@ idea.project.settings {
afterSync(
":cel-generated-pb:jar",
":cel-generated-pb:testJar",
":cel-generated-antlr:shadowJar",
)
}
}
Expand Down
67 changes: 25 additions & 42 deletions conformance/README.md
Original file line number Diff line number Diff line change
@@ -1,57 +1,40 @@
# Running CEL-spec conformance tests against CEL-Java
# Running CEL-Spec conformance tests against CEL-Java

If your environment is already setup, just run the shell script
```shell
./run-conformance-tests.sh
```

## Requirements & Setup
The CEL-Java conformance suite is a JUnit test suite that reads upstream CEL-Spec
simple testdata from the `submodules/cel-spec` Git submodule.

The CEL-spec conformance test suite is written in Go and uses the bazel build tool.
Run it with:

Required tools:
* [Bazel build tool](https://bazel.build/) (see [bazelisk](https://github.com/bazelbuild/bazelisk?tab=readme-ov-file#installation))

See [Bazel web site](https://bazel.build/install) for installation instructions.
Do **not** use the `bazel-bootstrap` package on Ubuntu, because it comes with
pre-compiled classes that are built with Java 17 or newer, preventing it from
running bazel using older Java versions.
* gcc

On Ubuntu run `apt-get install gcc`
```shell
./gradlew :cel-conformance:test
```

Other required dependencies like "Go" will be managed by bazel.
The suite does not require Bazel, Go, a separate conformance server, or the old
upstream `simple_test` binary.

## FAQ
## Test selection

### Bazel build hangs
The curated conformance file list and skip list live in:

If the bazel build does not start, i.e. it gets stuck with messages like
```
Starting local Bazel server and connecting to it...
... still trying to connect to local Bazel server after 10 seconds ...
... still trying to connect to local Bazel server after 20 seconds ...
... still trying to connect to local Bazel server after 30 seconds ...
```text
conformance/src/test/java/org/projectnessie/cel/conformance/SimpleConformanceTest.java
```
then kill all bazel processes make sure that Java 11 is the current one. It seems, that the
above *may* happen when with Java 8.

### Bazel build fails from `./run-conformance-tests.sh`
Each skip uses the upstream conformance path:

If the bazel build fails with an error like this (note the `Failed to create temporary file`),
run the bazel build once from the console:

```shell
cd submodules/cel-spec

bazel build ...
```text
file/section/test
```

If the build still fails, try the following options:
or a whole-section path:

```shell
bazel build ... --sandbox_writable_path="${HOME}/.ccache" --strategy=CppCompile=standalone
```text
file/section
```

After the build succeeds once from that directory, you can use the `./run-conformance-tests.sh`
script.
Unmatched skips fail the test suite, so stale skips are visible when upstream
testdata changes.

Optional CEL-Spec files such as extension libraries, optionals, and type
deduction are intentionally not enabled by default. Add those separately with
explicit skip reasoning.
27 changes: 2 additions & 25 deletions conformance/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import org.gradle.api.tasks.compile.JavaCompile

plugins {
`java-library`
id("com.gradleup.shadow")
id("cel-conventions")
}

Expand All @@ -33,10 +32,6 @@ val mainProtoResourcesDir = layout.buildDirectory.dir("generated/proto-resources
val syncMainProtoSources =
tasks.register<Sync>("syncMainProtoSources") {
into(syncedMainProtoDir)
from(layout.settingsDirectory.dir("submodules/googleapis/google/rpc")) { into("google/rpc") }
from(layout.settingsDirectory.dir("submodules/googleapis/google/api/expr/conformance")) {
into("google/api/expr/conformance")
}
from(layout.settingsDirectory.dir("submodules/cel-spec/proto/cel/expr")) {
include("checked.proto", "eval.proto", "syntax.proto", "value.proto")
into("cel/expr")
Expand All @@ -50,13 +45,7 @@ val syncMainProtoSources =
val emptyTestProtoDir = layout.buildDirectory.dir("pb-src/test/proto")

sourceSets.main {
java.setSrcDirs(
listOf(
layout.projectDirectory.dir("src/main/java"),
layout.buildDirectory.dir("generated/sources/proto/main/java"),
layout.buildDirectory.dir("generated/sources/proto/main/grpc"),
)
)
java.setSrcDirs(listOf(layout.buildDirectory.dir("generated/sources/proto/main/java")))
resources.setSrcDirs(listOf(mainProtoResourcesDir))
extensions.configure<SourceDirectorySet>("proto") {
setSrcDirs(listOf(syncedMainProtoDir))
Expand All @@ -76,37 +65,25 @@ configurations.all { exclude(group = "org.projectnessie.cel", module = "cel-gene
dependencies {
implementation(project(":cel-core"))
implementation(project(":cel-generated-pb3"))
implementation(testFixtures(project(":cel-core")))
implementation(testFixtures(project(":cel-generated-pb3")))

implementation(libs.protobuf.java) { version { strictly(libs.versions.protobuf3.get()) } }

implementation(libs.grpc.protobuf)
implementation(libs.grpc.stub)
runtimeOnly(libs.grpc.netty.shaded)
compileOnly(libs.tomcat.annotations.api)
testImplementation(testFixtures(project(":cel-core")))

testImplementation(platform(libs.junit.bom))
testImplementation(libs.bundles.junit.testing)
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine")
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
}

tasks.named<Jar>("shadowJar") {
manifest { attributes("Main-Class" to "org.projectnessie.cel.server.ConformanceServer") }
}

// *.proto files taken from https://github.com/google/cel-spec/ repo, available as a git submodule
configure<ProtobufExtension> {
// Configure the protoc executable
protoc {
// Download from repositories
artifact = "com.google.protobuf:protoc:${libs.versions.protobuf3.get()}"
}
plugins {
this.create("grpc") { artifact = "io.grpc:protoc-gen-grpc-java:${libs.versions.grpc.get()}" }
}
generateProtoTasks { all().configureEach { this.plugins.create("grpc") {} } }
}

tasks.named("generateProto") { dependsOn(syncMainProtoSources) }
Expand Down
33 changes: 0 additions & 33 deletions conformance/conformance-server.sh

This file was deleted.

Loading