Skip to content

Commit 5afb64c

Browse files
tae898claude
andcommitted
e2 + page: each engine declares what its timed transaction holds, and the table says it (DECISIONS #118)
The user took the recommendation on BUGS F131's open question: the cross-model operation is defined by its atomic update, the reads that choose it may run outside, and each engine's scope is stated rather than equalised (ArcadeDB keeps its reads inside, the setting that does not flatter it). Each adapter now declares TXN_SCOPE (whole / update / none), audited against its code; MongoDB's rows keep recording what its server answers, which is that $vectorSearch is refused inside a multi-document transaction. The e2 table gains one generated sentence naming the engines on each side. land_stage e2 dry run: every gate passes. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01M8NdUMbUoCLwNJEWPir4YL
1 parent a04212e commit 5afb64c

2 files changed

Lines changed: 85 additions & 0 deletions

File tree

‎benchmarks/experiments/e2_hybrid.py‎

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,9 @@ def gen_data():
197197

198198
class ArcadeE2:
199199
name = "arcadedb_e2"
200+
# WHAT THE TIMED TRANSACTION HOLDS (DECISIONS #118): the vector search, the
201+
# hop, and the update, all inside one transaction.
202+
TXN_SCOPE = "whole"
200203

201204
def __init__(self):
202205
import arcadedb_embedded as arcadedb
@@ -378,6 +381,9 @@ class ArcadeE2Server(ArcadeE2):
378381
positional binding.
379382
"""
380383
name = "arcadedb_e2_server"
384+
# WHAT THE TIMED TRANSACTION HOLDS (DECISIONS #118): the vector search, the
385+
# hop, and the update, all inside one transaction.
386+
TXN_SCOPE = "whole"
381387

382388
def __init__(self):
383389
self.durability = (bench_common.at_class(bench_common.DURABILITY_ARCADEDB)
@@ -514,6 +520,9 @@ class SurrealE2:
514520
table was allowed). The SDK bundles core 2.3.10 behind an SDK version of 2.0.0; the served twin below
515521
runs the 3.2.4 server on RocksDB."""
516522
name = "surrealdb_e2"
523+
# WHAT THE TIMED TRANSACTION HOLDS (DECISIONS #118): the two reads run first
524+
# and only the update is wrapped in a transaction.
525+
TXN_SCOPE = "update"
517526
URL = "surrealkv:///tmp/e2_surrealkv"
518527
INDEX_DDL = f"DEFINE INDEX pe ON product FIELDS embedding HNSW DIMENSION {DIM} DIST EUCLIDEAN"
519528
# The embedded core (2.3.10) maintains the index during the insert, so the
@@ -672,6 +681,9 @@ class ArangoE2:
672681
document updates inside one stream transaction that the crash trial
673682
aborts before commit."""
674683
name = "arangodb_e2"
684+
# WHAT THE TIMED TRANSACTION HOLDS (DECISIONS #118): the two reads run first
685+
# and only the update is wrapped in a transaction.
686+
TXN_SCOPE = "update"
675687

676688
def __init__(self):
677689
self.cl, self.db, self.version = arango_common.connect()
@@ -796,6 +808,9 @@ class MongoE2:
796808
even in principle.
797809
"""
798810
name = "mongodb_e2"
811+
# WHAT THE TIMED TRANSACTION HOLDS (DECISIONS #118): the two reads run first
812+
# and only the update is wrapped in a transaction.
813+
TXN_SCOPE = "update"
799814

800815
def __init__(self):
801816
self.cl, self.db, mongod = mongo_common.connect(auth=True)
@@ -923,6 +938,9 @@ class PgAgeE2:
923938
transaction. The strongest "one engine" rival to the claim this lane
924939
tests (2026-09-11)."""
925940
name = "pg_age_e2"
941+
# WHAT THE TIMED TRANSACTION HOLDS (DECISIONS #118): the vector search, the
942+
# hop, and the update, all inside one transaction.
943+
TXN_SCOPE = "whole"
926944

927945
def __init__(self):
928946
import psycopg
@@ -1060,6 +1078,9 @@ class Neo4jE2:
10601078
vector index, RELATED edges, the views counter on the node; the hit, the
10611079
hop and the update run in one explicit transaction (2026-09-11)."""
10621080
name = "neo4j_e2"
1081+
# WHAT THE TIMED TRANSACTION HOLDS (DECISIONS #118): the vector search, the
1082+
# hop, and the update, all inside one transaction.
1083+
TXN_SCOPE = "whole"
10631084

10641085
def __init__(self):
10651086
from neo4j import GraphDatabase
@@ -1167,6 +1188,9 @@ class ComposedE2:
11671188
injects a failure between the two writes.
11681189
"""
11691190
name = "composed_qdrant_neo4j"
1191+
# WHAT THE TIMED TRANSACTION HOLDS (DECISIONS #118): nothing spans the two
1192+
# systems, which is what this arm exists to show.
1193+
TXN_SCOPE = "none"
11701194

11711195
def __init__(self):
11721196
from qdrant_client import QdrantClient

‎benchmarks/experiments/export_web.py‎

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4830,6 +4830,64 @@ def _filter_strategy_note(table):
48304830
*pre, *post)
48314831

48324832

4833+
def _txn_scope_note(table):
4834+
"""What the timed transaction holds, per engine (DECISIONS #118).
4835+
4836+
The cross-model operation is a vector search, a one-hop expansion, and an
4837+
update of the touched products. Every engine commits the update
4838+
atomically; they differ in whether the two READS run inside the same
4839+
transaction. The user decided on 2026-09-26 that the operation is defined
4840+
by the atomic update, with the reads allowed outside, since that is what
4841+
every engine here can do (MongoDB refuses $vectorSearch inside a
4842+
multi-document transaction, and says so on its own rows), and that each
4843+
engine's scope is stated rather than equalised. ArcadeDB keeps its reads
4844+
inside, the setting that does not flatter it.
4845+
4846+
Read from the rows where they recorded it (MongoDB asks its server) and
4847+
from each adapter's declaration otherwise, so the sentence names what ran.
4848+
"""
4849+
if table.get("id") != "e2":
4850+
return None
4851+
try:
4852+
import e2_hybrid as _e2
4853+
except Exception: # noqa: BLE001 - the page must still build without it
4854+
return None
4855+
groups = {"whole": set(), "update": set(), "none": set()}
4856+
refuses = set()
4857+
for e in table.get("entries", []):
4858+
bk = str(e.get("backend_key"))
4859+
scope = getattr(_e2.BACKENDS.get(bk), "TXN_SCOPE", None)
4860+
recorded = next((str(r.get("txn_scope")) for r in _FROZEN_ROWS
4861+
if r.get("lane") == "e2" and r.get("backend") == bk
4862+
and str(r.get("txn_scope") or "") not in ("", "None", "not declared")), None)
4863+
if recorded in groups:
4864+
scope = recorded
4865+
elif recorded and "CANNOT" in recorded:
4866+
scope = "update"
4867+
refuses.add(display_name(bk))
4868+
if scope in groups:
4869+
groups[scope].add(display_name(bk))
4870+
if not groups["whole"] or not groups["update"]:
4871+
return None
4872+
whole, upd = sorted(groups["whole"]), sorted(groups["update"])
4873+
none_ = sorted(groups["none"])
4874+
tail = (f" {_join_and(none_)} {'has' if len(none_) == 1 else 'have'} no transaction spanning "
4875+
f"{'its' if len(none_) == 1 else 'their'} two systems, which is what "
4876+
f"{'that row' if len(none_) == 1 else 'those rows'} exist{'s' if len(none_) == 1 else ''} to show.") if none_ else ""
4877+
why = ""
4878+
if refuses:
4879+
r = _join_and(sorted(refuses))
4880+
why = (f" ({r} cannot do otherwise: {'it refuses' if len(refuses) == 1 else 'they refuse'} "
4881+
f"a vector search inside a multi-document transaction, and {'its' if len(refuses) == 1 else 'their'} "
4882+
f"rows record the refusal)")
4883+
return _gen(
4884+
f"The transaction is the update, and every engine here commits it all or nothing. "
4885+
f"{_join_and(whole)} also run the vector search and the hop inside it; "
4886+
f"{_join_and(upd)} run those two reads first and wrap only the update{why}. "
4887+
f"One client runs at a time, so the answers are the same either way.{tail}",
4888+
*whole, *upd, *none_, *sorted(refuses))
4889+
4890+
48334891
def _filtered_modes():
48344892
"""backend display name -> the `filtered_mode` its rows recorded."""
48354893
out = {}
@@ -4857,6 +4915,9 @@ def _oct_conditions(table):
48574915
f = _filter_strategy_note(table)
48584916
if f:
48594917
head.append(f)
4918+
ts = _txn_scope_note(table)
4919+
if ts:
4920+
head.append(ts)
48604921
if tid == "l3d":
48614922
split = _ingest_split_note(table)
48624923
if split:

0 commit comments

Comments
 (0)