Loom: Languages, Algebra, Optimizer, Execution (Bet B3)
3,719 words8 subsectionsA design document: it describes the 1.0 target, not what runs today.
On this page8
8.1 Language surface
- Native: GQL (ISO/IEC 39075:2024) — graph pattern matching including quantified path patterns, path modes (WALK/TRAIL/ACYCLIC/SIMPLE), the edition's registered shortest/count selectors, label expressions,
LET/FILTER/FOR, composite queries, catalog/DDL, and transactions/sessions. The exact minimum closure and optional ISO feature IDs are frozen inLanguageContract; an in-flight edition/corrigendum is a different contract and never “lands” silently. - openCypher compatibility layer: the pragmatic on-ramp. GQL and Cypher have separate lexer/parser/profile adapters but converge only after binding and semantic normalization; documented divergences and the openCypher TCK prevent a parser shortcut from changing meaning.
- Versioned FQL dialect extensions: temporal, branch, Prism, retrieval, materialized-view, subscription, certificate, branch-admin, and
CHEAPEST/cost-selector syntax beyond the pinned 2024 ISO feature map is enabled only by an explicitFQL <major.minor>declaration orFQL-prefixed production. The plan does not call unprefixed future-standard-looking keywords “namespaced.”DIFF <graph_ref_a> … <graph_ref_b>— each endpoint an ordinary graph reference carrying the fullgraph@branch AS OF <time|seq>selector surface — is registered under this same dialect discipline as reserved 1.0 syntax producing canonical delta tables (insertions/retractions with element identity, slice, and period columns), composable with views and §9.5 subscriptions like any other typed stream; its evaluation, coverage, authorization, and answer-contract semantics are owned entirely by Appendix C'sDiffoperator-family row, and the syntax reservation makes the operator available only after that row's conformance tests exist. - Datalog surface:
fgdb-datalogcompiles the validated finite/stratified subset in §9.3 to the same typed algebra. Recursion, negation, and aggregates are accepted only when their termination and incrementalization contracts are registered.
LanguageContract is a canonically encoded, content-addressed tagged union with common { grammar_oid, lexer_profile_oid, normalizer_oid, semantic_profile_oid, scalar_profile_oid, unicode_conformance_bundle_ref } fields and one surface payload. A UnicodeConformanceBundle is { unicode_version, unicode_data_oid, uts10_collation_version, uts10_data_oid, uax15_normalization_version, uax15_data_oid, uax31_identifier_version, uax31_data_oid, synchronous_release_set_id, ucs_basic_profile }; its validator requires Unicode ≥13.0.0 and proves that the UTS #10, UAX #15, and UAX #31 versions/data are the synchronous set claimed for that Unicode release. Gql carries { edition, corrected_printing, corrigenda[], conformance_profile, mandatory_feature_closure[], graph_type_conformance, selected_minimum_feature_ids[], optional_feature_ids[] }; graph_type_conformance is exactly Open{feature:GG01} or Closed{feature:GG02, element_type_feature:GG20|GG21|GG22|GG23}. OpenCypher carries the exact language/specification revision, grammar and TCK commit, supported scenario manifest, and documented-divergence ObjectId; Fql carries its declared major/minor grammar, extension-feature closure, and GQL-base contract; Datalog carries the accepted finite/stratified grammar subset plus recursion, negation, aggregate, and operator-registry ObjectIds. The GQL 2024 contract includes the ISO minimum-conformance closure and every prerequisite of its selected feature IDs, supplies the required character-string, Boolean, signed-integer, and floating property types, and pins the common validated Unicode bundle plus mandated UCS_BASIC behavior; optional IDs are separate. Draft Edition 2 syntax can exist only under a visibly draft contract and cannot satisfy the 2024 claim. No loose dialect string or server default can change accepted syntax or semantics after binding.
Parsing never produces executable plans directly, and preparation never mistakes @now for a permanent head. fgdb-bind first constructs PreparedQueryTemplate { language_contract_oid, catalog_contract, graph_reference_specs[{ binding_role_id, graph_id, branch_selector, system_selector_spec, valid_selector_spec, required_schema_contract }], parameter_types, non_widenable_authority_ceiling, typed_logical_template, output_schema_contract }. It owns name/scope and correlated-reference resolution, deterministic role assignment, group variables, parameter inference/coercion, null and duplicate semantics, graph/table shape checking, path legality/termination, capability-domain injection, and incrementalizability classification. PREPARE therefore cannot freeze an execution option that it never received. At each execution the caller supplies an AnswerRequirement (default Exact); any query-language approximation clause narrows it, and an empty intersection is rejected. After parameters and both temporal selectors are known, snapshot acquisition resolves every spec into a concrete GraphReferenceBinding; binding then produces BoundQuery<Role> {prepared_template_ref:StrongRef<PreparedQueryTemplate>,logical_state_root_identity:WeakStateIdentity,graph_reference_bindings[],normalized_valid_time_bindings[],topology_epoch,authority_binding:AuthorityBindingFor<Role>,authority_binding_body_digest,purpose_class,answer_requirement,instantiated_logical_plan,output_schema}. Prepared handles pin the template and may be reused only while its catalog/schema compatibility predicates hold under same-or-narrower authority. Physical/logical plan-cache entries, certificates, and replay pin the concrete BoundQuery; their key includes the binding body digest, purpose, role, and service epoch. A cross-authority, cross-graph, historical, or valid-time self-join plan cannot substitute one reference's authority/head/schema/period for another. Optimizers consume only this bound typed IR.
Preparation is itself an authorized, idempotent child operation because even parameter/output schemas can reveal protected catalog facts. SessionAuthorityBinding is the Ready-bound closed union Local{header:AuthorityBoundHeader<Local>,presentation_binding:SessionBound{session_binding,auth_generation}}|Meta{header:AuthorityBoundHeader<Meta>,presentation_binding:SessionBound{session_binding,auth_generation}}; the role must match the selected database posture and Ready generation. PrepareRequestRecord is the session-scoped immutable {ready_binding,session_binding,prepare_request_idempotency_key,canonical_prepare_request_digest,language_contract_oid,requested_parameter_contract?,session_authority_binding:SessionAuthorityBinding,catalog_contract_basis,resource_reservation_ref}. It has no fictitious AuthorityBindingRef<Session> and no duplicate raw SecurityStateBinding. PreparedStatementRecord is {request_ref:StrongRef<PrepareRequestRecord>,template_ref:StrongRef<PreparedQueryTemplate>,public_statement_handle:PublicHandle<PreparedStatement>,public_state_token:PublicStateToken<PreparedStatement>,authorized_public_parameter_schema,authorized_public_output_contract_commitment,compatibility_contracts,prepare_authorization_projection,response_commitment}. The scoped idempotency index maps one key to exactly one request/record; byte-identical retry reproduces the same PREPARED bytes, while text, language, requested contract, Ready, or authority drift conflicts before protected catalog observation. Before PREPARED, a PublicFrameSendGuard::PreparedMetadata arm revalidates the complete current binding, the record's non-widenable ceiling, catalog compatibility, and exact frozen response digest. EXECUTE must present both public handle and state token, resolve them through the session index, reauthorize same-or-narrower, and then construct the concrete BoundQuery; prepared metadata never grants execution authority. Session drain fences unsent PREPARED, retires unescaped records after their send obligations join, and never turns socket success into durable semantic state.
Clients declare ceilings and expectations, never the semantic class. TxnOperationCeiling is exactly ReadOnlyOnly|ReadWriteAllowed. CanonicalMutationPotential is ProvenReadOnly|MayMutateGraph|MayMutateSchema|MayInvokeReplicatedProcedure; CanonicalOutputClass is NoRows|Rows. The derived CanonicalStatementClass is ReadOnly{output} only for ProvenReadOnly, WriteReturning for any mutation potential plus Rows, and WriteNoResult for any mutation potential plus NoRows. A write-capable semantic no-op remains write-classified because admission, authorization, witnesses, and retry semantics cannot be inferred from the final zero effect.
CanonicalStatementClassification is the immutable binder object {classification_version,prepared_template_ref:StrongRef<PreparedQueryTemplate>,bound_query_ref:StrongRef<BoundQuery>,prepared_template_digest,canonical_bound_query_digest,parameter_digest,language_contract_oid,binder_and_normalizer_semantics_oid,exact_graph_reference_bindings,exact_write_coordinate_set,sorted_procedure_udf_module_effect_contract_refs[StrongRef<ExecutableEffectContract>],mutation_potential,output_class,derived_statement_class,required_txn_operation_ceiling,required_warden_operation_classes,determinism_and_external_effect_profile,classification_digest:BodyDigest<CanonicalStatementClassification>}. It is constructed after parameters, graph roles, schemas, modules/procedures, and temporal selectors resolve and before statement registration. Every executable artifact has one immutable bounded effect contract; parameters cannot choose an undeclared class. The generated statement-kind matrix maps every bound-IR tag and effect-contract arm to exactly one mutation/output row. Unknown tags, wildcard fallback, or an unclassified procedure fail binding.
Attempt registration stores only the client ceiling. Statement registration specs remove client statement_class and instead strongly name the classification plus repeated digest projections that must byte-match it. Statement registrations, intent batches, statement audit bases, authorization decisions, owner/result/no-result selection, workspace generations, and idempotent request digests all name the same classification. Workspace generation zero starts cumulative_mutation_potential=ProvenReadOnly; successful statement publication takes the monotone join, so a mutation-capable statement can never be reclassified away. A class exceeding the attempt ceiling rejects before storage observation. Read-close is legal only from cumulative ProvenReadOnly; otherwise the write terminal path applies even if all effects normalize to no-op. Rebase regenerates effects/results but cannot reinterpret the stored classification; missing or incompatible semantics requires a fresh bind/request. Exact retry returns the stored classification across ambient schema/policy/module drift, while a newly bound different class conflicts under the old idempotency key. Generated malicious-underclassification tests cover every GQL/openCypher tag, subquery, DDL, mutating CALL/UDF/module, output/no-output form, dynamic graph role, adapter, and PREPARE-versus-EXECUTE_TEXT path.
8.2 Semantics discipline
GQL's formal-semantics literature is tracked; where the standard leaves latitude (result ordering, path enumeration order, duplicate semantics under morphism modes), FrankenGraphDB pins behavior via CGSE tie-break policies (§8.6) and documents each pin. Temporal clauses get algebraic semantics (snapshot-relativized pattern matching; BETWEEN yields per-binding validity intervals with interval-algebra predicates).
Each pin set is a versioned SemanticProfile referenced from LanguageContract—not an ambiguous name such as bare gql-2024-strict—fixing null/UNKNOWN handling, duplicate semantics per morphism mode, ordering defaults, coercion rules, and tie-break bindings. Two results are comparable only under the same language+semantic+scalar contracts, and corrigendum/dialect drift becomes a new content-addressed artifact.
CanonicalScalarProfile defines equality, hashing, total ordering, collation, coercion, and durable/result encoding for every value, with property tests enforcing equal ⇒ same_hash, comparator totality/transitivity, and encode/decode/order coherence. STRICT_PORTABLE canonicalizes NaNs and signed zero; fixes decimal scale/rounding/overflow; stores timestamp instant, zone/offset semantics, and a content-addressed tzdb version; pins Unicode data/normalization/segmentation and each non-binary collation by ObjectId; fixes map-key order over canonical bytes; and rejects unavailable profile artifacts rather than consulting host locale/tzdb. Floating execution uses fixed logical reduction trees independent of SIMD width, fixes denormal/rounding behavior, forbids target-dependent contraction, and uses pinned math kernels. A scalar/SIMD fast path ships in strict mode only after bit-identity testing on every supported target; otherwise it is RELAXED and the certificate names target/build behavior.
Path expressions carry a rewrite-protected PathSemantics { mode, selector, hops, cost, temporal, enumeration, tie_break }. All + WALK requires a finite hop bound. Every potentially infinite enumeration requires a finite selector or explicit MaxResults/resource budget; truncation is visible result status and certificate state, never silent success. NaN/infinite weights, arithmetic overflow, and a reachable negative cycle that makes the requested WALK optimum unbounded have defined errors. Negative finite weights are legal only for mode/selector combinations with a registered exact algorithm and termination contract. Dijkstra/bidirectional kernels require nonnegative costs; the matrix below governs other cases.
Executor state is PathStateKey { automaton_state, vertex, mode_state, capture_state_id, feasible_valid_time, cost_state }, where CaptureStateId is a full content digest whose lookup verifies canonical capture bytes on collision; TRAIL carries persistent used-edge state and SIMPLE/ACYCLIC carry persistent visited-vertex state. Coalescing is allowed only through a mode-specific proved dominance relation. The same abstraction defines §7.3 path witnesses. The physical registry names valid combinations: bounded RPQ WALK uses NFA-product BFS/DFS; nonnegative shortest uses BFS/Dijkstra/bidirectional variants; hop-bounded negative WALK uses dynamic programming over hops; unbounded WALK may use Bellman–Ford-class logic only to prove a finite optimum or report a reachable negative cycle. Negative TRAIL/SIMPLE/ACYCLIC uses exact finite history-aware search with an exponential complexity/resource contract or is unavailable. Yen/Eppstein is used only where its preconditions match; temporal paths include the feasible interval in product state.
8.3 One algebra ("GLA" — Graph-Logical Algebra)
Typed logical operators over binding tables include ScanVertices, ScanEdges, Values, IndexProbe, HybridSearch, Expand, VarLengthExpand, PathFind, FreeJoin, HashJoin, LeftOuterJoin, SemiJoin, AntiJoin, correlated Apply, Select, Project, Unnest, NullExtend, Aggregate, Distinct, full OrderBy, Limit{offset,count}, SetOp{Union|Intersect|Except, All|Distinct}, Fixpoint, TemporalSlice, TemporalJoin, ProcedureCall, GraphConstruct, SemiringMxV, Mutate, ViewDelta, and CertEmit. FreeJoin is the conjunctive inner-join core; it does not impersonate optional, negative, correlated, or set-operation semantics. Relational and pattern operators share a cost model, while Appendix C normatively defines each operator's memory, factorization, cancellation, witness, incrementalization, path-preservation, authorization, answer-contract transfer, and replanning contracts.
Approximation has three deliberately different phase types. AnswerRequirement = Exact | AllowApproximate { permitted_kinds[], population_constraint?, minimum_quality?, evidence_floor, on_unmet:ExactFallback|Fail } is an execution-time demand and contains no chosen generation. An AnswerRequirement may additionally carry an optional orthogonal freshness_constraint:FreshnessConstraint { maximum_source_lag:WatermarkLagBound, on_unmet:ExactFallback|Fail }, bounding how far any consumed advancing derived source generation (view, index, or maintainer output) may lag the executing snapshot's pinned read frontier; the bound is expressed in source-generation/watermark (commit-sequence) units, never as a wall-clock quantity, so no time-authority observation joins the hot read path. An unmet freshness bound behaves exactly like an unmet approximation demand — ExactFallback evaluates through the pinned exact path against the read frontier and Fail rejects with a typed error — and the realized AnswerContract already pins source_generation_identities[], from which the realized lag is derived and reported in the result certificate without any new contract field. ApproximationProfile { approximation_kind, population_contract, algorithm_profile_oid, semantic_build_and_search_parameter_schema, quality_evidence_schema, deterministic_exact_fallback_oid? } is definition-time policy and likewise contains no generation identity. Only after access paths and parameters are bound does execution realize AnswerContract = Exact | Approximate { approximation_kind, population_contract, error_or_recall_contract, source_generation_identities[], source_generation_digests[], algorithm_profile_oid, candidate_and_search_profile, evidence_identity, deterministic_fallback_oid? }. A contract never strongly references the generation that carries it; the surrounding bound plan, generation registry, result/certificate envelope, and replay closure own concrete roots explicitly, avoiding definition/generation identity cycles.
Every realized logical stream is typed with an AnswerContract; this is a semantic type, not a certificate footnote. Each operator registers a total transfer rule that produces a contract satisfying the AnswerRequirement, proves exact completion, invokes the pinned exact fallback, or rejects the composition. In particular, absence-sensitive, non-monotone, recursive, aggregate, distinct, and top-k operations cannot turn missing candidates into an exact result; they accept approximate inputs only under a registered sound calculus and otherwise fall back or fail. Mutate and every Exact requirement consume exact inputs only. All approximation-affecting generation topology, candidate/search depth, fusion, stopping, sampling, and evidence identities are pinned in the bound query/plan/certificate/replay closure and are never classified as result-neutral physical tuning. An approximate result remains byte-replayable under its pinned closure, but it is not thereby promoted to exact semantics.
8.4 Factorization as a type
Factorization is a recursive value algebra, not a one-parent flag: FNode = Flat(ColumnVector) | RunSlice(RunSliceRef) | Values(ColumnVector) | Product(Vec<FNodeId>) | Union(Vec<FNodeId>) | Filter{input,mask} | PathDag(PathDagRef). FactorizedBatch carries roots, multiplicities, logical-order metadata, projection generation, and ownership/lifetime. Run slices are borrowed only while their generation is pinned; transport uses canonical logical values and never exposes physical run references.
Every operator registers a factorization law. Selection preserves shape only when expressible as masks; projection preserves it unless correlated dimensions merge; distributive/algebraic aggregates may push down under named laws; holistic or order-sensitive aggregates may require flattening; global DISTINCT retains multiplicity-aware state. Flattening is explicit, spillable, and differential-tested to produce identical rows, multiplicity, and logical order. No blanket claim says all aggregates or DISTINCT push through at an optimal cost.
8.5 Optimizer
- Statistics are versioned
StatsSegments with a branch/schema/policy watermark: label/type counts, authorized degree histograms, property sketches, zone maps, and sampled path correlations. Plans may use only statistics whose security domain cannot reveal hidden population information; otherwise they use capability-specific projections or conservative public bounds. Shrinkage, unseen-mass floors, robust estimators, influence caps, and targeted synopsis refresh are candidate estimators evaluated on named workloads. Their risk properties are conditional on their model/population and never promoted into semantic invariants. Per-branch coverage is base+delta: a fork does not copy statistics but pins a shared ancestor-base segment at the branch manifest'sfork_boundary_logical_command_seq, and branch-delta segments are derived from exactly the branch's post-fork divergence; the delta layer rides Ripple's existing Z-set consumption (§9.6), and per-branch delta maintainers are instantiated lazily on first planner demand, never eagerly at fork. The staleness/fallback lattice is explicit and ordered — exact per-branch segment, then base+delta composition, then the ancestor watermark with a typed staleness annotation, then the conservative public bounds above — and a plan records which rung it consumed. Security composition fails closed: a branch-delta segment inherits the most restrictive security domain of any contributing segment or degrades to the public bounds, because a branch-delta correction must never reveal a hidden population that the base segment lawfully concealed. Statistics remain non-semantic on every rung — ancestor fallback degrades plan quality, never correctness — and per-branch segment/maintainer cost is a declared parameter of §5.6's 10k-branch gate. - Enumeration and access orders: DP over connected subpatterns produces hybrid binary/FreeJoin plans. Every atom advertises available trie attribute orders and cursor complexity; forward/reverse Strata runs satisfy only their declared endpoint orders, while unavailable key/property orders require COLT construction or a Beacon view. Tier-D merge, tombstones, generation count, buffer I/O, and preprocessing enter physical cost. AGM/fractional-cover bounds are worst-case guardrails recorded separately; they are not compared numerically as if they were expected binary-plan costs.
- Cost intervals are assumption-bearing evidence. Split/Mondrian conformal intervals may report finite-sample marginal coverage within a frozen stratum only under the named exchangeability or online-validity conditions. Continuously selected, refreshed workload data does not inherit that guarantee automatically. Calibration artifacts record population, window, stratum construction, selection policy, alpha, and nonexchangeability penalty. Drift monitors can trigger fallback/recalibration; they do not retroactively preserve coverage. Plan choice uses intervals and tail-risk penalties as performance evidence (
FG-CAL-02), while correctness remains independent of estimator quality. - Adaptivity uses registered safe points. Every operator declares
ReplanClass = None | BeforeOutput | PartitionBoundary | StateTransfer. AReplanCheckpointcommits input frontier, emitted-output frontier, optional state object, and logical-order floor. Global joins, distinct, aggregates, sort, fixpoints, and paths may switch only at proved materialization/iteration barriers or through verified state transfer; a generic morsel boundary is insufficient. Strict hedges buffer output until a complete winner is selected by deterministic policy, or both candidates independently produce the same canonical stream—wall-clock race order never chooses logical output. Triggers and latency envelopes are assumption-bearing decision evidence, not correctness certificates. - Logical identity is orbit-canonical; physical identity is not. Law-certified normalization assigns
LogicalOrbitIdmodulo valid logical commutativity/associativity symmetries, allowing semantic proofs and logical cache entries to transfer. Every concrete access order, algorithm, materialization, index generation, and safe-replan policy has a distinctPhysicalPlanId, cost evidence, performance baseline, and replay record. A physical member never inherits another member's measurements merely because their outputs are equivalent. - Views: Ripple-maintained materialized views register as rewrite targets (view matching over the algebra).
8.6 Determinism contracts (CGSE at query level)
Every query declares a tie-break policy; strict default is storage-independent LexMin over canonical scalar/element encodings. ORDER BY wins. InsertionOrder is defined as immutable element-origin order and is available only when elements carry durable OriginBirthOrder { commit_seq, intent_ordinal, merge_ordinal, element_id }; BranchAdmissionOrder is a separately named policy. Compaction/run order never defines either. fnx-parity is an explicit projection profile with its own adjacency-order metadata. Parallelism, spilling, factorization, and safe replanning must preserve the canonical logical row sequence or require RELAXED posture.
The replay artifact is a ReplayManifest, not (certificate, seq, seed). It pins database/security namespace/incarnation, logical-command and commit sequences, topology/policy/revocation epochs, the execution AnswerRequirement, realized result AnswerContract, LogicalOrbitId/PhysicalPlanId, result-encoding version, and canonical result digest. Every evidence slot is an explicit ReplayEvidenceRef<T> = Present { object: ReplayObjectRef<T> } | Unavailable { class, expected_logical_object_id?, expected_canonical_digest?, reason_code } | Redacted { class, commitment?, redaction_policy_oid }. A present ReplayObjectRef is either a typed local strong edge or an explicitly nonlocal archive identity verified through the active registry; the latter is never a local GC edge. Slots cover logical state, role-bearing binding set, language/semantic/scalar/numeric profiles, bound and normalized query, typed parameters, replay-authority snapshot, UDF/module set, mediated external inputs/nondeterminism, exact derived generation snapshots, decision cards/policies, evidence, ExecutableArtifactSet, and a typed StructuralReplayProjection. No archivable edge relies on a bare _root, _ref, optional field, or digest whose default could silently become local reachability or conceal missing evidence.
Digests alone are not executable input. A versioned ReplaySlotSchema derives—not trusts—a manifest's immutable structural completeness from the slot states and the recorded execution's actual semantic dependencies. Replayable requires every semantically required slot to be Present and must identify the exact engine binary or a complete reproducible-build closure, Rust toolchain and target, CPU-feature contract, runtime/allocator configuration, VM/JIT/compiler artifacts if used, kernel/profile registry, and platform ABI. StructuralReplay requires a present typed StructuralReplayProjection plus every slot its declared reproduced control/data-shape classes require; every omitted class is explicitly unavailable or redacted. VerifiableIfArtifactsSupplied requires every missing slot to carry an expected identity/digest sufficient to validate later supplied bytes. AuditOnly permits explicit unavailable/redacted slots and makes no byte-replay claim. An encoded structural grade that disagrees with the generated slot matrix is invalid. At access time, the verifier separately derives effective_completeness by combining that maximum with live local/archive availability, lease, trust, resolver, and authorization state; it can only stay equal or become weaker without mutating the manifest. Reading or resolving any item requires explicit Replay authority scoped to the complete evidence/artifact closure. Replay compares canonical logical-result encoding before transport framing; fetch size, wire factorization, and frames are irrelevant.
FG-INV-19 guarantees byte replay only while the full required evidence closure and matching executable artifacts remain retained locally or through a verified ReplayArchiveRecord under a lease whose expiry and trust domain are visible in the manifest. Canonical ReplayRegistry is itself in LogicalStatePayload and strongly roots each active manifest plus the latest active archive record; archive records carry only nonlocal archive identities and weak closure commitments, never accidental local ObjectId edges. Renewal is an authenticated logical-command-sequenced extension. Revocation, expiry, resolver failure, or closure-verification failure causes the slot verifier to derive a weaker advertised grade and prevents a new Replayable claim. Expiry never deletes bytes directly: a consensus GC command first removes the relevant manifest/archive registry edge and then accounts for every other root. KEEP NONE does not preserve replay unless the query acquires a local or archive lease. Certificate modes Compact, Budgeted, Full, and Forensic may vary diagnostic detail, but a mode advertised as replayable may never truncate an identity field or referenced closure object. Strict floating results use §8.2's portable profile; RELAXED results are reproducible only within their recorded target/build scope.
8.7 Execution engine
- Push-based, vectorized, morsel-parallel execution uses partition-aligned tasks in the query region. Every kernel declares a maximum time/bytes/work between cancellation checkpoints; a morsel boundary is the outer bound, not permission for one unbounded decode or UDF call.
- FreeJoin access uses a
TrieCursorcontract advertising attribute order,open/next/seek, multiplicity, generation, and complexity. Forward/reverse Strata runs are tries only for declared endpoint orders; properties/keys and other orders require COLT or Beacon access paths. Hash/binary and radix-partitioned paths remain part of the same physical family. The executor accounts for all active runs, Tier-D overlays, tombstones, decoding, and I/O. - Path and recursion operators implement the legality/algorithm matrix in §8.2 and the validated fixpoint subset in §9.3. Mode-aware history, captures, temporal intervals, and cost state are spillable.
RETURN PATHmay use a canonical shared-prefix/path DAG with multiplicity and order metadata; flattening remains reference-equivalent. - SIMD and memory-level parallelism use separately ledgered unsafe-island crates with scalar fallbacks. STRICT kernels are fixed by the portable numeric/scalar profile and must be bit-identical across supported dispatch paths. AMAC/prefetch policy is physical-only only if result and logical order remain identical.
- Larger-than-memory contracts are per operator. Full
ORDER BYuses external merge sort; joins, aggregate, and distinct use radix/grace partitioning; WCOJ/COLT build is partitioned; factorization/path frontiers spill as canonical DAG/state blocks; Ripple arrangements use an LSM-backed state store; Prism materialization streams or spills. Appendix C declares minimum resident set, stable merge order, I/O complexity, cleanup, andResourceExhaustedbehavior for every operator.
8.8 Result delivery
Streaming begins only at an operator's declared safe emission point. Two-phase channel obligations provide bounded backpressure, while output-row/byte, egress, idle-time, and snapshot-age reservations prevent a slow client from holding unbounded resources. The canonical result digest covers schema, canonical values, multiplicity, and logical order before framing. Factorized frames encode a canonical logical factorization DAG—not Strata run references—and clients may request flat frames without changing result identity.
CanonicalResultChunk is the exact logical plaintext target {format_version=1,canonical_encoding_version,chunk_ordinal,canonical_offset,canonical_len,frame_boundary_policy_oid,canonical_bytes:BoundedBytes<1_MiB>,body_digest}. canonical_len equals the byte length, chunks are contiguous from offset zero, and every boundary is between complete canonical value/row/factorization frames; an individual value above the v1 value bound is rejected before materialization rather than split into an ambiguous encoding. CanonicalResultChunkDescriptor is the only outer owner of ciphertext identity and public chunk digest; its ordinal/offset/length/encoding fields must byte-match the decrypted target. The target has one logical_object_kinds.toml row, a registered BodyDigest transcript, exact 1 MiB plaintext and decoder-allocation bounds, golden vectors for flat/factorized/null/graph/scalar/extreme-value cases, mutation and truncation corpora, and a generated fuzz target. Decrypted protected-result buffers use the ordinary authority/send guard and are wiped on cancel, error, or final frame ownership transfer; no plaintext chunk, keyed ObjectId, or placement detail enters logs or crashpacks.