Skip to content

plan: metta-polyfill-v1 — Hyperon/MeTTa as a front end over the masking-algebra polyfill (D-MTP-0, D-MTP-6) - #1555

Merged
AdaWorldAPI merged 14 commits into
mainfrom
ccr-9f3b8075-74u47l-metta
Oct 14, 2026
Merged

AdaWorldAPI merged 14 commits into
mainfrom
ccr-9f3b8075-74u47l-metta

Conversation

@AdaWorldAPI

Copy link
Copy Markdown
Owner

Adds .claude/plans/metta-polyfill-v1.md and its board entries. Plan only, no code.

What it decides

  • MeTTa works as a declaration IR, not an execution IR. Its Datalog subset lowers through lance-graph-relalg → R2IL FoldDialect → mask-risc. Term construction, bags, grounded ops, types and state stay in Hyperon's unchanged interpreter.
  • The seam is a named LanceSpace implementing hyperon_space::Space.
    • match passes the whole (, …) pattern to it (stdlib/core.rs:163).
    • ModuleSpace splits conjunctions and panics on non-ModuleSpace dependencies (space/module.rs:33-48). So the adapter is not &self, and recursive rules are declared into the named space.
  • Crate name: lance-graph-metta, not -cog.

Measured (v4 host)

program PeTTa (SWI-Prolog) Hyperon (both trie fixes) datafrog (fork)
join, 10⁴ rows 1.47 s > 600 s 0.5 ms
join, 10⁶ rows — — 65 ns/pair
ancestors from n0, 800 0.42 s 417 s 0.15 ms
  • PeTTa and Hyperon are single whole-run timings, so they rank engines rather than measure primitives.
  • datafrog figures are best of 5, with the tier printed by the program.
  • datafrog is consumed from AdaWorldAPI/datafrog as an oracle only.

Also recorded

A second Hyperon trie panic: an expression with ≥ 1,024 children aborts in TrieKey::start_expr. It is separate from the id-decoding fix (upstream #1107). The fix is on the fork branch ccr-9f3b8075-74u47l-trie-expr-width.

Board

  • STATUS rows D-MTP-0..6.
  • Entry 2026-10-14-metta-polyfill-map.md.
  • INTEGRATION_PLANS and AGENT_LOG: six substrate-mapper runs, one miss logged.
  • entries_index.py --check and the supersession index were regenerated.

🤖 Generated with Claude Code

https://claude.ai/code/session_011BMJnDBAfzcuQh5HeT39Rh


Generated by Claude Code

…ng-algebra polyfill (D-MTP-0)

Adoption map for hyperon-experimental: MeTTa is a declaration IR, its
Datalog subset lowers through lance-graph-relalg -> R2IL -> mask-risc,
and everything else stays in Hyperon's unchanged interpreter. The seam is
a named LanceSpace implementing hyperon_space::Space; ModuleSpace splits
conjunctions and requires ModuleSpace dependencies, so &self is not the
seam, and recursive rules are declared into the named space.

Measured on generated Datalog programs: PeTTa (SWI-Prolog) near-linear,
Hyperon superlinear (anc_800 0.42 s vs 417 s). Records a second trie
panic (expressions with >= 1,024 children). Recommends the crate name
lance-graph-metta. D-MTP-1..5 queued, not authorized.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011BMJnDBAfzcuQh5HeT39Rh
…e id-decoding fix 1ffdbd6

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011BMJnDBAfzcuQh5HeT39Rh
@coderabbitai

coderabbitai Bot commented Oct 14, 2026 •

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: c36f73b4-c93a-4bf5-bc8a-f1ff95f0df98
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Warning

Billing warning: we have not been able to collect payment for this subscription for more than 72 hours. Please update the payment method or pay any pending invoices in Billing to avoid service interruption.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

…in, datafrog oracle)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011BMJnDBAfzcuQh5HeT39Rh
…Semijoin, datafrog oracle

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011BMJnDBAfzcuQh5HeT39Rh
…afrog per pair at 1e6

Pairs equal datafrog at every n on a total and a partial relation; counts
equal Hyperon and PeTTa. Two disable runs red as pre-registered. The folded
count is 1.2-1.8 ns/row, not sub-nanosecond as expected: the random gather
read sets the cost.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011BMJnDBAfzcuQh5HeT39Rh
@AdaWorldAPI
AdaWorldAPI marked this pull request as ready for review October 14, 2026 21:49
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 14, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-14T21:52:47.534413Z a6c3d7f Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a6c3d7fc83

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread .claude/plans/metta-polyfill-v1.md Outdated
Comment thread .claude/board/INTEGRATION_PLANS.md Outdated
…ts D-MTP-1 and D-MTP-6

F2 ingests 666,666 facts for 476,190 pairs, so its ingest cost counts 1.4x
per pair: 8.6-9.2 ns/pair with ingest charged, not 6.5-8 (codex review).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011BMJnDBAfzcuQh5HeT39Rh
entries/README.md conflicted (generated index): took main's version and
regenerated with entries_index.py --write; supersession index regenerated.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011BMJnDBAfzcuQh5HeT39Rh
…notone dst)

Arms G-scattered, G-clustered, R-scan, R-declared; datafrog oracle; refusal
of a non-monotone lane; fixture guard that both halves of the intersection
matter on F4.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011BMJnDBAfzcuQh5HeT39Rh
…he gather count at 1e6

The order witness is checked once at ingest (a first version recomputed it
per query, which made the range count O(n)). Plan §6d, board row and entry.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011BMJnDBAfzcuQh5HeT39Rh
@AdaWorldAPI
AdaWorldAPI merged commit 5366a5a into main Oct 14, 2026
12 checks passed
AdaWorldAPI pushed a commit that referenced this pull request Oct 15, 2026
…tate

The soak stopped at 27.5 min / 1,649 cycles when the container
restarted. MemWAL commit p50 stayed flat at 2.0-2.8 ms while
LanceCycleWriter's grew from 5.8 to about 10.5 ms over 1,649 versions.
MemWAL keeps its WAL after each flush (1.57x the disk). Both scans
grow linearly in rows; LanceCycleWriter's RSS grew 95 -> 762 MiB, not
yet explained.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011BMJnDBAfzcuQh5HeT39Rh
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.

2 participants