Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
23 changes: 23 additions & 0 deletions test/support/circle/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Circle value-test support

This directory contains test-only infrastructure for checking numerical equivalence of
Circle-to-Circle rewrites without `circle-interpreter` or `onert`.

## Components

- `builder.py` creates small, serializable `circle.ModelT` fixtures.
- `evaluator.py` evaluates a deliberately limited operator subset with NumPy and records
every intermediate tensor value.
- `value_test.py` provides reusable assertions for serialization round trips, pass
equivalence, graph-interface preservation, and extraction-boundary equivalence.

The reference evaluator currently supports `ADD`, `SUB`, `MUL`, `RESHAPE`, and
`TRANSPOSE`. Unsupported operators, fused activations, optional inputs, external
buffers, and unsupported tensor types fail explicitly. The evaluator is not a
production Circle runtime.

Run the value tests with:

```bash
./ccex test -k circle.value
```
45 changes: 45 additions & 0 deletions test/support/circle/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Copyright (c) 2026 Samsung Electronics Co., Ltd. All Rights Reserved
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

"""Support utilities for execution-based Circle value tests."""

from test.support.circle.builder import CircleModelBuilder
from test.support.circle.evaluator import (
circle_tensor_type_from_numpy_dtype,
CircleEvaluationResult,
CircleReferenceEvaluator,
numpy_dtype_from_circle_tensor_type,
)
from test.support.circle.value_test import (
CircleExtractionValueTestResult,
CirclePassValueTestResult,
CircleValueTestCase,
GraphInterfaceContract,
SignatureContract,
TensorContract,
)

__all__ = [
"CircleEvaluationResult",
"CircleExtractionValueTestResult",
"CircleModelBuilder",
"CirclePassValueTestResult",
"CircleReferenceEvaluator",
"CircleValueTestCase",
"GraphInterfaceContract",
"SignatureContract",
"TensorContract",
"circle_tensor_type_from_numpy_dtype",
"numpy_dtype_from_circle_tensor_type",
]
Loading
Loading