MysticIR Federation v0.8.5

Different Surface, Same Underground Pipeline

A verification demo confirming that two different surface languages (ScatLang / SeaIR) reach the same Core AST, the same CEK trace, and the same error signature on representative cases.

What is MysticIR Federation v0.8.5 Overview

MysticIR Federation v0.8.5 verifies that two languages with different surface appearances are designed to normalize to the same Core AST, and that in these representative failure cases — confirmed by ast_equal — they reach the same CEK trace and error signature.

This is not a complete proof — it is a prototype verification demo. Even when surface symbols differ, once converted to the Core AST they become indistinguishable, run through the same CEK machine, and produce the same error at the same point.

MysticIR Federation v0.8.5 confirms, on representative cases via ast_equal, that the surface languages normalize to the same Core AST — and from there follow the same CEK trace and reach the same error signature.

Surface Differences Surface

The two programs below have the same meaning. One uses 💩 symbols (ScatLang), the other uses 🌊 symbols (SeaIR).

💩 ScatLang
x ← 💩×3 ⊛ 💩₀ 🚽⇐ missing ⟳ 💩₀ ≠ 💩⁺(💩₀) { x ← 💩₀ }
💩₀ = zero, 💩×N = N, ⊛ = mod, ← = assign
🌊 SeaIR
x ⚓ 🌊×3 ⚫ 🌊 🏝️ missing 🌀 🌊 ≠ 〰️🌊 { x ⚓ 🌊 }
🌊 = zero, 🌊×N = N, ⚫ = mod, ⚓ = assign

Although the symbols differ, they are normalized at the parser layer and produce the same Core AST in these representative cases. In subsequent comparison, the trace and error match once surface labels are excluded.

Underground Pipeline Structure Pipeline

Surface symbols of ScatLang and SeaIR are normalized to the same Core AST by the shared parser layer. In these representative cases, execution follows the same path thereafter.

💩 ScatLang
surface parser
🌊 SeaIR
surface parser
Core AST
both normalize to the same tree structure
CEK Machine / Trace
same step sequence, same continuation
Error Federation
same error signature (excluding frontend label)

The frontend labels (💩ScatLang / 🌊SeaIR) remain in the trace, so surface differences are preserved as evidence while the underlying execution is identical.

Results for Three Failure Cases Results

The following are actual results from running the Python script. For all three representative cases, ast_equal, trace_equal, and error_equal = true and surface_diff = true were confirmed.

Case error type ast_equal trace_equal error_equal surface_diff steps (both)
mod by zero
3 ⊛ 0 → division by zero
ScatError ✓ true ✓ true ✓ true ✓ true 12 == 12
unbound variable
reference to undefined variable "missing"
ScatError ✓ true ✓ true ✓ true ✓ true 2 == 2
step limit / infinite loop
0≠1 is always true → halted at step 40
StepLimitError ✓ true ✓ true ✓ true ✓ true 40 == 40

* Steps match because both surface symbols normalize to the same Core AST in these representative cases, causing the CEK machine to advance by the same number of steps.

Meaning of the Four Metrics Glossary

✓ ast_equal

After parsing, the Core AST produced from the ScatLang source and the SeaIR source are compared directly via structural equality (parse(scat_src) == parse(sea_src)). True means both surface notations normalize to the identical internal tree before execution begins.

✓ trace_equal

When the "step sequence record" produced by the CEK machine is compared with frontend labels removed, this is true if ScatLang and SeaIR match in the representative case.
Indicates the same execution path was followed.

✓ error_equal

When the "state fingerprint" at the moment of the error is compared with frontend labels removed, this is true if both match.
Evidence of failing at the same point.
Note: the current signature includes error_message text. A future version should separate a stable error_code from the human-readable message to avoid fragility from wording changes.

✓ surface_diff

When compared with frontend labels included, the difference between 💩ScatLang and 🌊SeaIR remains, causing a mismatch = true.
Evidence that surface differences are preserved in the record.

When all four are true, the Federation's claim of "different surface, same underground pipeline" has been confirmed for that case.

Why 💩 and not A? Symbol Arbitrariness

💩 and 🌊 are surface markers, not semantic primitives. What matters in MysticIR is not which symbol is used, but whether that symbol projects to the same Core AST node.

Therefore A, B, or any other symbol would work equally well. If A carries the same Core projection as 💩, it will travel through the same CEK trace and reach the same error signature.

The choice of 💩 and 🌊 is intentionally arbitrary — it demonstrates that the IR is indifferent to surface notation. The underground pipeline does not care what the symbols look like.

A corollary: the current implementation uses a shared normalizing parser that accepts both ScatLang-style and SeaIR-style tokens and maps them to the same Core AST nodes. This is the correct description — "two independent frontends converging" would be an overstatement for v0.8.5.

Note on Underflow Design Decision

pred(💩₀) does not raise an error in MysticIR. It returns an Underflow value (💩∅), propagating silently as a value rather than halting execution.

Underflow is intentionally excluded from the Error Federation cases in v0.8.5. It is treated as a value, not an error event — and therefore has no error signature to federate. Future versions may introduce a dedicated Underflow federation check if needed.

Summary Summary

MysticIR Federation v0.8.5 is a prototype aimed not at expansion, but at producing a stable version suitable for presentation.

For all three representative failure cases (division by zero, unbound variable, infinite loop), it was confirmed that ScatLang and SeaIR reach the same CEK trace and the same error signature.

🔧 Run command: python mysticir_federation_v085.py — outputs mysticir_v085_error_federation_report.json in the same folder.