Skip to content

EIR VM: assert-eq uses structural equality, not handle identity#84

Merged
ecto merged 1 commit into
mainfrom
claude/actegories-loon-d56e54
Jul 14, 2026
Merged

EIR VM: assert-eq uses structural equality, not handle identity#84
ecto merged 1 commit into
mainfrom
claude/actegories-loon-d56e54

Conversation

@ecto

@ecto ecto commented Jul 14, 2026

Copy link
Copy Markdown
Owner

What

Built::AssertEq in the EIR VM compared raw Val handles, so [assert-eq {:a 1} {:a 1}] failed on two separately-allocated but structurally equal values (maps, vecs, non-interned strings). It now routes through the same val_eq the = builtin already uses.

Why

Found while writing law-checking tests for a monoid-action sketch: assert-eq on two identical map literals reported {:log "a" :val "b"} != {:log "a" :val "b"}. Any loon test asserting on collections was silently un-passable on the EIR VM.

Notes for review

  • One-line fix in vm.rs plus a backend-parity regression test (assert-eq-structural, order-independent map keys).
  • cargo test --workspace is green.
  • A related but separate checker bug (E0200 unifying a record with () on map destructures) was spun off into its own task.

🤖 Generated with Claude Code

[assert-eq {:a 1} {:a 1}] failed on the EIR VM because Built::AssertEq
compared raw Val handles; two separately-allocated but structurally
equal heap values (maps, vecs, non-interned strings) never matched.
Route it through the same val_eq that = already uses, and add a
backend-parity regression test.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@vercel

vercel Bot commented Jul 14, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
loon Ready Ready Preview, Comment Jul 14, 2026 1:54pm

Request Review

@chojiai

chojiai Bot commented Jul 14, 2026

Copy link
Copy Markdown

Choji live review — Looks good — no findings

Choji review — Looks good

Correct one-line fix: routing Built::AssertEq through val_eq makes it consistent with the = builtin, and the regression test covers the exact failure mode (separately-allocated, order-independent maps with a string value). No defects found.

No findings — looks good.


Verified by Choji

Choji ran your change live — checks passed.

1 check.

Claim Result Evidence
cargo check Verified exit 0 · 643s

The ticket asked for assert-eq in the EIR VM to use structural equality instead of raw handle identity; the one-line fix in vm.rs routes the comparison through val_eq, and the new assert-eq-structural backend-parity test exercises exactly that case (two separately-allocated but equal maps with order-independent keys). No live preview was run since this is a compiler/VM backend change, but cargo check passed (exit 0). No issues observed.

No issues found in the running app.


Reviewed 94aa5c9 · Rate findings · Choji updates this comment as you push

@ecto
ecto merged commit cd28213 into main Jul 14, 2026
7 checks passed
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