feat: integrate synTagma CoordSpace — structural enumeration replaces Vec-based expansion (#40) - #41
Merged
Merged
Conversation
…n enumeration (#40) - Add tagma-core as git dependency (Coord, CoordPath types) - Add coords_to_path() conversion utility - Add EnumerateIter: lazy Iterator<Item=Combination>, zero Vec allocation - Integrates enable_mask/enable_set processing in iterator - Existing expand_all() preserved for downstream compatibility - All 77 tests pass, 0 failed
…40) - Add validate_into_space() to evaluate.rs: builds DynCoordSpace<()> containing only valid combinations using EnumerateIter - Invalid combinations are structurally absent (vacant slot) - Add coords_to_coord_vec() for dynamic-depth Coord path conversion - Add validate_into_space_matches_evaluate_all unit test - All 78 tests pass, 0 failed - Existing evaluate_all() preserved for reporter compatibility
) - Raise MAX_COMBINATIONS from 34M to 1B (CoordSpace removes Vec allocation) - Add benches/bench.rs with criterion benchmarks: - expand vs enumerate: small(27), medium(32K), ibex(524K), cva6_r4(2M) - evaluate vs validate: same four fixture sizes - coordspace lookup: valid vs invalid - constraint check: single combo - Add criterion dev-dependency and [[bench]] target to Cargo.toml - All 78 tests pass, 0 failed
…ombos (#40) - Add StructuralEnum: generates only structurally valid combinations by encoding cross, oneof, range, bitmask constraints into the enumeration space. Invalid combinations are never generated. - Add structural_filters(): parses constraints into per-field allowed values + cross mapping for dependent iteration. - Rewrite validate_into_space() to use StructuralEnum + runtime-only checks (eq, neq, lt, gt, le, ge, even) — structural constraints require zero runtime evaluation. - Add build_runtime_checks() to separate structural from runtime. - Update benchmarks with struct_enum/* variants. Performance: ibex 524K space evaluate: 3.67s (524K combos, all constraint checks) struct_enum: 50ms (92K combos, zero structural checks) = 73x faster
- Add cargo bench to code_checks in run.sh (struct_enum/ibex) - Add structural enumeration bench to verify_large_fixtures - CI now tracks structural enumeration performance on every run - Bench results printed as CI output (not assertion, informational)
- Remove redundant FieldSpec.allows() check in structural_filters() (field domain already filtered by def.expand()) - Document total_combinations() upper bound limitation (cross constraints not reflected in per-field value counts) - Increase bench sample_size from 10 to 30 for better precision - Rewrite build_runtime_checks() to filter constraints before building, avoiding unnecessary check construction for structural constraints - All 78 tests pass, 0 failed
- coordspace (ns scale): sample_size=1000 for tight confidence intervals - expand (ms scale): sample_size=100 - eval_light (µs-ms scale): sample_size=100 - eval_heavy (seconds scale): sample_size=10 (ibex eval 36s, cva6 eval 14s) - Total bench suite: ~3 minutes, practical for CI
… pass - Update verify_cva6_xif_ref_r4 ignore comment (2M, medium) - Update verify_cva6_xif_ref ignore comment (33M, CLI pending struct_enum) - tests remain ignored because CLI ev verify still uses old pipeline - struct_enum handles both scales in ms — pending CLI integration
…s, StructuralEnum, build_runtime_checks - coords_to_coord_vec: basic, out-of-range, empty (3 tests) - structural_filters: oneof, bitmask, cross mapping (3 tests) - StructuralEnum: without cross (matches expand_all), with oneof (2 tests) - build_runtime_checks: excludes structural types (1 test) - Total: 87 tests (73 lib + 14 CLI), 0 failed
metasmile
added a commit
that referenced
this pull request
Jul 20, 2026
…vs evaluate) - Add cva6_full_spec() to benches/bench.rs - Add bench_structural_enum_cva6_full to eval_heavy group - Result: struct_enum/cva6_full_33M = 28.8ms (vs ~32s evaluate = ~1100x) - Previous estimate of ~32ms was conservative; actual is 28.8ms - Branch rebased onto latest main (PR #41 merged)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Replace ev's
Vec<Combination>-based domain expansion and evaluation pipeline with synTagma's structural coordinate space.StructuralEnumgenerates only structurally valid combinations by encoding constraints into the enumeration space itself, eliminating all runtime constraint evaluation for cross, oneof, range, and bitmask constraints.Closes #40.
Performance
Changes
Core: structural enumeration
structural_filters(): Parse constraints (cross, oneof, range, bitmask) into per-field allowed values + cross-value mapping. Structural constraints are encoded into the enumeration space, requiring zero runtime evaluation.StructuralEnum: Iterator that generates only structurally valid combinations. Cross-constrained fields skip invalid values via an inner loop. ImplementsIterator<Item = Combination>.coords_to_coord_vec(): Convert coordinate slice toVec<Coord>for DynCoordSpace indexing.validate_into_space(): Uses StructuralEnum + runtime-only checks (eq, neq, lt, gt, le, ge, even) to build aDynCoordSpace<()>containing only valid combinations.build_runtime_checks(): Filters constraints to runtime-only types before building checks, avoiding unnecessary check construction.New constraint types (from PR #39, already merged)
bitmask:field & mask == value— bit-level field conditionsenable_set: Likeenable_maskbut sets fields to specified valuesBenchmark infrastructure
benches/bench.rs: 24 benchmark functions across 4 fixture sizes, organized by speed class (coordspace ns-scale: sample_size=1000, expand ms-scale: 100, eval_light µs-ms: 100, eval_heavy seconds-scale: 10)Cargo.toml:tagma-coregit dependency +criteriondev-dependencyrun.sh: structural enum benchmark integrated into CI pipelineDependencies
Apache 2.0, no_std compatible, identical license to ev.
Test coverage: 87 tests (73 lib + 14 CLI), 0 failed
coords_to_coord_vecstructural_filtersStructuralEnumbuild_runtime_checksvalidate_into_space