Skip to content

Compile VarRef-free query patterns#64

Open
MesTTo wants to merge 1 commit into
trueagi-io:mainfrom
MesTTo:pr/mork-compiled-matcher-stage1
Open

Compile VarRef-free query patterns#64
MesTTo wants to merge 1 commit into
trueagi-io:mainfrom
MesTTo:pr/mork-compiled-matcher-stage1

Conversation

@MesTTo

@MesTTo MesTTo commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds a compiled matcher path for query patterns that contain no VarRef.

The compiler lowers each pattern factor into preorder MatchOps and query_multi_raw executes that program directly. Patterns with query-side VarRef still use the existing coreferential_transition interpreter.

This branch also adds focused tests for the compiler boundary and a public query_multi smoke test over real inserted atoms.

Reviewer Note

This is the small stage-1 matcher precompile. Later local compiled-matcher commits for query-side VarRef and compound captures are not included because they depend on broader matcher changes.

Local notes measured process_calculus at 26.1s to 25.6s. This branch should be reviewed as a narrow matcher slice, not the larger set-at-a-time emit work.

Validation

  • RUSTFLAGS='-C target-cpu=native' cargo +nightly-2026-06-01 test -p mork --lib compile_match_program -- --nocapture
  • RUSTFLAGS='-C target-cpu=native' cargo +nightly-2026-06-01 test -p mork --lib query_multi_matches_varref_free_pattern_with_compiled_program -- --nocapture
  • RUSTFLAGS='-C target-cpu=native' cargo +nightly-2026-06-01 test -p mork --lib
  • jscpd --reporters console --format rust --min-lines 8 --min-tokens 80 kernel/src/space.rs
  • git diff --check

@MesTTo MesTTo marked this pull request as ready for review June 23, 2026 10:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant