This directory contains the conformance test suite for Eclexia implementations.
conformance/
├── valid/ # Programs that MUST succeed
└── invalid/ # Programs that MUST fail with deterministic errors
Programs in valid/ must:
- Parse without errors
- Type check successfully
- Execute without constraint violations
- Produce expected output
| Test | Resources Tested | Description |
|---|---|---|
resource_typed_hello.ecl |
energy | Basic resource annotation |
energy_constraint_satisfied.ecl |
energy | Function calls within budget |
time_constraint_satisfied.ecl |
time | Latency constraints |
adaptive_solution_selection.ecl |
energy, time | Optimal solution selection |
energy_and_time_combined.ecl |
energy, time | Multi-resource tracking |
Programs in invalid/ must:
- Fail with a
ResourceViolationerror - Produce deterministic, reproducible failures
- Include the violated constraint in the error message
| Test | Violation Type | Description |
|---|---|---|
energy_constraint_violation.ecl |
energy | Exceeds energy budget |
time_constraint_violation.ecl |
time | Exceeds latency budget |
no_valid_solution.ecl |
selection | No solution satisfies all constraints |
budget_exhaustion.ecl |
energy | Cumulative usage exceeds budget |
carbon_constraint_violation.ecl |
carbon | Exceeds carbon budget |
# Run valid tests (should all succeed)
for f in tests/conformance/valid/*.ecl; do
cargo run -- run "$f"
done
# Run invalid tests (should all fail with ResourceViolation)
for f in tests/conformance/invalid/*.ecl; do
cargo run -- run "$f" && echo "ERROR: $f should have failed"
donePer SPEC.core.scm, a conforming implementation must:
- Track resources: At minimum, time and energy
- Reject violations:
@requiresviolations produce deterministic errors - Dimensional analysis: Reject dimension mismatches at type-check time
- Adaptive selection: Select solution by minimizing weighted cost
- Deterministic errors: Same input → same error, always
New tests should:
- Include SPDX license header
- Document expected behavior in comments
- Test a single conformance requirement
- Be minimal (smallest possible example)