Skip to content

Fix/minimal space owned eval 20260827 - #219

Open
zariuq wants to merge 2 commits into
trueagi-io:mainfrom
zariuq:fix/minimal-space-owned-eval-20260827
Open

zariuq wants to merge 2 commits into
trueagi-io:mainfrom
zariuq:fix/minimal-space-owned-eval-20260827

Conversation

@zariuq

@zariuq zariuq commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Two weird behaviors detected:

  1. Types adedd after a function may not apply to it
  2. Space ownership of duplicate terms led to odd behavior (duplicates, seeming removal from space, etc).

See this program:

; Store the same equation under two independent owners.
!(bind! &foo (new-space))
!(add-atom &self (= (f) 1))
!(add-atom &foo (= (f) 1))

; Only &self contributes to default-context execution.
!(collapse (f))

; Remove only the copy owned by &foo.
!(remove-atom &foo (= (f) 1))

; Both &self's data and executable behavior remain intact.
!(match &self (= (f) $result) $result)
!(collapse (f))

PeTTa's old behavior:

true
true
(1 1)
true
1
((f))

PeTTa's new behavior:

true
true
(1)
true
1
(1)

Codex and Claaude's solution is tog ive each space ownership of its compiled program, adding eval/2 for explicit context denotation (e.g., (eval $expr $space)), etc.

As to the actual PR, the edits are pretty extensive, so I might suggest using them as a reference for your own fix (if you agree with these semantics).

I think the coherent options are:
A) Something like this.
B) Something like MORK with one universal space.

The current version seems 'incoherent' (in weird cases).

zariuq added 2 commits August 27, 2026 04:36
Predeclare source-buffer arrow types and transactionally recompile dependent callers after live type revisions.
Compile equations and call guards for their owning space while preserving the unchanged &self hot path.

Use injective internal predicate names and owner-exact compilation provenance.
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