OverviewFilesCommitsIssuesDocsReleasesPeers

opencog-atomese-simd commits / 115d647

execution ideas
115d647259a7ac6d80cc90b2c138c699367611dd
by Linas Vepštas <linasvepstas@gmail.com> · 2025-09-19T19:40:11.000Z

Changed files (1) +41 -1

Design-G.md +41 -1
……@@ -21,5 +21,45 @@ need to run locally before getting pushed off to the GPU, and the rules
2121for these could be very arcane and detailed and prone to bugs.
2222
2323Another possibility is to have an `(ExecOnGPULink AST)`, similar to
24`(PureExec AST)`
24`(PureExec AST)`. In fact, it could be PureExec, given extensions.
25Lets review.
2526
27`PureExec` was originally invented to allow "pure execution" i.e.
28side-effect free execution of some AST by grabbing a temp AtomSpace,
29child of the current AtomSpace, and running the AST there. Any changes
30to the AtomSpace are thus made only to this temp space, and are thus
31discarded when execution completes. Thus, the execution is "pure".
32
33Next `PureExec` got used to define tail-recursive loops. The structure
34here is
35```
36 (DefineLink (DefinedProcedutre "foo")
37 (PureExec AST (DefinedProcedutre "foo")))
38```
39so the AST performs a single-step of the loop, and the
40`DefinedProcedure` recurses. The `CondLink` can be used to limit
41recursion. This is more or less just like tail recursion on scheme.
42
43Note that an earlier realization of this idea was with the behavior
44trees infrastructure, with `SequentialAndLink`. This used evaluation,
45not execution, and the `SequentialAnd` had a built-in "keep going or
46stop" character in it, that avoided the need for an explicit `CondLink`.
47It's inappropriate for execution, because the returned Value is
48generally not interpretable as a bool flag "keep going".
49
50Until `PureExec` was introduced, there wasn't anything analogous for
51execution. The `ParallelLink` and cousins run threads, but there was no
52`SerialLink` mostly because step-wise execution was not needed.
53
54The whole Threaded/Serial Atomese toolset needs to be revised to be
55cleaner. ThreadJoinLink should be marked obsolete. PureExec needs to
56be redesigned as described below.
57
58Since the initial idea of `PureExec` was purity, it could not be used
59for tail-recursive, serialized execution in the current AtomSpace: so an
60argument is added: which AtomSpace the execution
61
62TODO List
63---------
64Writiing the above, the TODO list expands:
65*