Prism: In-Database Analytics via franken_networkx
471 words5 subsectionsA design document: it describes the 1.0 target, not what runs today.
On this page5
11.1 Surface
CALL fnx.<algorithm>(...) [YIELD …] exposes only registered, semantically compatible fnx signatures. Versioned FnxSignatureRegistry describes per algorithm: zero/one/multiple graph inputs; typed parameters/defaults/coercions; output schema; attribute roles (weight, capacity, demand, partition, label, etc.); callback/matcher module type/effects; RNG policy/seed; directed/multigraph/self-loop laws; numeric/determinism profile; complexity witness; and larger-than-memory implementation class. Each graph argument becomes an AuthorizedProjection<Role> { authority_binding:AuthorityBindingFor<Role>, graph_reference_binding, logical_state_root_identity:WeakStateIdentity, directedness, labels/types, parallel-edge law, attribute bindings with missing/coercion laws, node order, descriptor_visibility_projection_ref, disclosure_and_answer_contract }. Two-graph algorithms bind two independently authorized role/head/schema projections; generators bind no hidden graph; callbacks are pinned deterministic module OIDs or explicitly non-replayable native effects. An authority digest or security-only shard projection cannot substitute for the complete binding. Opaque params cannot smuggle an unscoped graph, attribute, callback, or entropy source. Only complete signature rows are callable, and all input projections/implementation paths ride in the certificate.
11.2 The bridge and its honest copy boundary
The current fnx trait borrows &[usize]; Strata's compressed u32/u64 rows cannot safely implement that contract zero-copy. W8 therefore upstreams a borrowed neighbor-cursor/GAT interface with an associated node-index type. Algorithms generic over that interface traverse decoded/merged authorized cursors without whole-graph materialization. Until then, compatibility uses explicit epoch-shared Vec<usize> caches and is labeled DECODED_CACHE, not zero-copy. Typed directed multigraphs are reduced only through an AuthorizedProjection bound by the registered FnxCallSpec; parallel-edge aggregation is never implicit.
11.3 Determinism & witnesses flow through
CGSE policy semantics and the ComplexityWitness schema are preserved, but each in-database witness binds the authorized projection digest, projection-specific n/m, adapter/materialization path, numeric profile, and fnx implementation hash. Differential tests require the same projected input and policy to match standalone fnx; they do not compare a raw graph with a capability-filtered projection or pretend adapter work is free. The resulting ledger is folded into the query's plan certificate.
11.4 Coverage strategy
Algorithms not cursor-generic take a MATERIALIZED path that streams/spills an authorized projection into a generation-scoped representation. An algorithm is exposed as a database operator only after it has either a bounded cursor path or a declared external-memory/spill implementation with cleanup and I/O bounds; otherwise it remains in the source catalog rather than violating the larger-than-memory product contract. ResourceExhausted remains legal when even the registered minimum resident set or scratch quota is unavailable, not as a substitute for designing the operator. W8 extends coverage by family and adds native kernels only after differential semantics tests. Residual artifacts record norm, numeric profile, iteration trace, stopping rule, and the mathematical assumptions behind any convergence bound; deterministic iteration count alone does not create cross-machine floating identity.
11.5 Scheduling
Analytics run in dedicated regions on a bulkhead-isolated lane (combinator: bulkhead) so a Louvain over 10⁹ edges cannot starve p99 OLTP; budgets + cancellation apply; long runs checkpoint progress as obligations (a cancelled community detection cleans up its scratch deterministically).