This is an automated email from the ASF dual-hosted git repository.
spmallette pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tinkerpop.git
The following commit(s) were added to refs/heads/master by this push:
new 226fb9e740 Clarify local() side-effect state semantics with a runnable
example
226fb9e740 is described below
commit 226fb9e74078b98d5344b326b00c50c7a6f97815
Author: Stephen Mallette <[email protected]>
AuthorDate: Fri Sep 11 21:00:19 2026 +0000
Clarify local() side-effect state semantics with a runnable example
Add an executable example to the local() step in the Gremlin semantics
specification and expand its Considerations to distinguish the local
computational state that is reset between executions from global
side-effects such as aggregate() and store(), which accumulate across
every traverser and are not reset per incoming object.
Assisted-by: Kiro:claude-opus-4.8
---
docs/src/dev/provider/gremlin-semantics.asciidoc | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
diff --git a/docs/src/dev/provider/gremlin-semantics.asciidoc
b/docs/src/dev/provider/gremlin-semantics.asciidoc
index a9ee0cb291..c8f6c7a381 100644
--- a/docs/src/dev/provider/gremlin-semantics.asciidoc
+++ b/docs/src/dev/provider/gremlin-semantics.asciidoc
@@ -2331,7 +2331,18 @@ None
The `local()` step enforces object-local execution. As a branching step with
local children, it implements strict lazy
evaluation by passing a single traverser at a time to the local traversal
(bulk of exactly one, if bulking is supported)
-and resetting the traversal to clean state between executions.
+and resetting the traversal to clean state between executions. Each incoming
object is therefore processed independently,
+as illustrated by counting the outgoing edges of every vertex in isolation.
+
+[gremlin-groovy,modern]
+----
+g.V().local(outE().count())
+----
+
+The clean state that is reset between executions is the local computational
state of the local traversal, such as its
+per-object barriers, ordering, and path history. It does not extend to global
side effects. A side-effect step such as
+`aggregate()` or `store()` writes to a side-effect that is shared across the
whole traversal, so its contents are not
+reset for each incoming object and instead accumulate across every traverser
that passes through `local()`.
*Exceptions:*