Changelog
All crates of the workspace share one version.
Unreleased
- A count over a match without a table of the matches (kleene-plan's run rewrite, kleene-gql): a run without proof lets an aggregate that reads a counted relation made by one counting rule, weighed by its count, read that rule's body itself (weighed by its counted atoms' counts), and derives no internal relation that nothing reads. GQL's
RETURN count(*),count(e),sum(x),min(x).. over a match in bag mode were three strata (the match as a set, the counted matches, the aggregate) and are now one: the aggregate over the pattern's atoms. The same rewrite takes a Datalog aggregateAggregate::many(..).times([n])over a counted relation of onecount_rule. Same answers (a sum or mean of f64 values stays as written: its order of adding would change);MATCH (a)-[:link]->(b) RETURN count(*)on rmat22 (33 M edges): 11.6 s and 4.6 GB before, 0.73 s and 1.7 GB after; on rmat24 (133 M edges) 61 s and 18.6 GB before, 3.2 s and 6.6 GB after (oden, a shared host, old and new run in turn, medians of 5). - Changed call:
mxm_by_dotstakes the device:mxm_by_dots(a, b, mask, device)(kleene-sparseCpuBackend). The masked product by dot products now runs on skewed graphs: a row and a column where one is at least eight times longer (CpuBackend::MXM_GALLOP_RATIO) are intersected by galloping the short one through the long one, not merged (the common indices still rising, so the same sums in the same order: the answers are bit for bit the same).CpuBackend::dot_stepsgives a pair's steps (x + ymerged,short * (1 + 2 log2(long / short))galloped);CpuBackend::mxm_dots_plan'sflopsis now the sum of those steps over the mask's places, the cost of the method taken. The choice against Gustavson now uses Gustavson's true multiply-adds (CpuBackend::mxm_flops, counted on the workers, only when the dots beat its bound ofa's entries timesb's longest row): the old estimate (entries times the mean row) hid the hubs (rmat22: 264 M estimated, 40.9 G true), so Gustavson was taken there.kleene benchmark'smxm-a2-maskedchecks its limit (MXM_MASKED_MAX_FLOPS, now 2^36) against the steps of the method taken (a2_masked_steps), and its plain reference intersects a row with a column a place: rmat22 (30.9 G steps of dots) runs, where it was refused at 40.9 G multiply-adds. - Maximum flow builds its residual graph in order (kleene-graph
max_flow,max_flow_f64; no public item changed): the reverse arcs of each vertex come from the device's bucket transpose of the entry numbers (u32while they fit), and one pass on the workers writes every vertex's arcs in place, in order. Before, a counting pass and a fill pass wrote each reverse arc at a random place after an atomic count on its head, which every worker contended for at a hub. Self-loops and zero capacities are now arcs with nothing left (their flow stays 0). The value and the cut are unchanged; the reverse arcs' order no longer depends on the workers. On oden (Threadripper PRO 3975WX, shared host), 8 threads, medians of 5 runs, old against new: rmat22 1.107 s to 0.865 s, rmat24 5.28 s to 4.12 s. - A full-operand
mxvreads a large operand ahead (kleene-sparsemxv_into/mxv, every semiring): while a row folds, the operand's place of the entry 64 entries on (across rows) is asked for withprefetch_read, once the operand holds at least four mebibytes (a smaller one is near in cache, where the hint is only extra work). The operand's random reads then overlap instead of each waiting on memory in turn; before, the core kept only as many in flight as its window held entries, so min-plus (u32: a saturating add and a min, two instructions more per entry) was behind SuiteSparse:GraphBLAS on rmat22. Each row folds in the same order as before, so every answer is the same bit for bit. No public item changed.
0.5.0 (tagged 2026-12-02, not published)
-
The state machine of a graph with labels in GQL and Datalog (kleene-gql
CALL machine.steps / machine.states / machine.starts; kleene-datalogProgram::state_machine,Machine):CALL machine.steps(Edge, labelKey, Eps, Start) YIELD state, label, next,machine.states(..) YIELD state, nodeandmachine.starts(..) YIELD node, stategive the subset construction over theEdgeedges named by theirlabelKeyproperty, with the closure through theEpsedges (NULLfor none), from the nodes of labelStart. Optional afterStart: a start key property (equal values one start set;startsthen yieldskey, state) and the limit of states (over it:SetLimit). All three lower onto the core'sPlan::state_machine, so the numbers agree with each other and with the same rules in Datalog;nodebinds a node later patterns match. Refused by name: an unknown label or key, a missing argument (the usage), edges over two node labels.NULLis now read as an argument of aCALL(other procedures refuse it as before refused any literal).Program::state_machineis the helper for a Datalog program, onRel<N>handles. -
A state machine from a graph with labels (kleene-plan
Plan::state_machine,MachineGraph,Machine): the subset construction ofedge(from, label, to), edges without a labeleps(from, to)(or none) and start nodes by keystart(key, node), as relations and rules added to the plan, no code of its own:{name}.member(state, node)(a table of sets),{name}.step(state, label, next),{name}.start(key, state),{name}.state(state)and the closure{name}.closure, set numbers in a group of rounds, so every row has its proof and the numbers are those ofAggregate::set_number(start sets first, then level by level, each level's new sets by their sorted nodes). The graph may be of any relation kind, also made by the caller's own rules; labels and keys of any type, nodes of one type (a wrong width or node type refused by relation and column, and nothing added). Two names give two machines side by side. New API. -
A number for each distinct set (kleene-plan
Plan::sets,Plan::sets_typed,Plan::set_limit,DEFAULT_SET_LIMIT,Aggregate::set_number,Agg::SetNumber,Stratum::Sets,PlanError::SetLimit,How::Numbered,How::Set): a table of setsstate(n, element..)gives each distinct set one number from 0, and the aggregateN = set (X) by (K) in stategives each key the number of its set of distinctX. Equal sets share a number, also across rules and heads numbering into one table; a key with no binding gives no fact. The sets new at a moment are numbered in rising order of their sorted members, so the same facts give the same numbers on every run and at every thread count. Plain use runs as one stratum; recursion through the table (a numbering rule that reads it) runs as a group of rounds that lists the table (rounds first: keep, step: keep, state: keep; without it the plan is refused and the message names the line), where a kept numbered head computes only the groups whose key gained a row: the subset construction of an automaton, 32768 states in 17 rounds, each round's work following the rows it gained. Over the table's limit (default one million) the run stops withSetLimit(setsstate: more than 1000 sets). Proofs: a numbered fact shows its key's member rows and the set's number; a table row the fact that first gave its set. A split run refuses a table; a continued run computes a stratum with a table again when a read changed (the numbers of a run from scratch) and keeps it, with its proofs, when none did. New API; amatchonAgg,HoworStratumoutside the crate already has a wildcard. -
A number for each distinct set, in the rule text and the builder (kleene-datalog
Program::sets/sets_typed,DEFAULT_SET_LIMIT; thedatalog!text):sets state/2 limit 1000.declares a table of sets (the relationstate(N, element); ARITY = 1 + the element's columns, at least 2; default limit 1000000), andN = set(X) by (K) in state:numbers each key's set in it, asAggregate::set_number(step(P, A, N) :- N = set(Y) by (P, A) in state: state(P, X), edge(X, A, Z), clo(Z, Y).). The table is read as a plain relation and stands in aroundsline (rounds first: keep, step: keep, state: keep.). Build errors by name: a set number into a relation that is not a table of sets (dis not a table of sets: declare it withsets d/2.),sets x/1,limit 0,set(..)withoutin NAME, a table of sets as a rule's head. The reference has a section "A number for each distinct set" with the state machine of a labelled graph as its example. New API, no change to what exists.
0.4.0 (tagged 2026-12-02, not published)
-
Fix: a rule whose late check leaves no row no longer panics the head pass (kleene-plan): since the join learnt to take an atom whose own variables only the head reads for its shared columns first and whole at the end (2026-11-30), a rule that also had an external asked after the atoms, or a condition or negation on what that external answers, panicked with
a head variable is boundwhenever that check left no row: the join stopped before the atom was taken whole, and the empty table it handed the head lacked that atom's head variable. Such a join now gives the empty bindings with every variable of the rule, as an atom that matches nothing always did. Plain and recursive rules, a continued run, with the why kept and without. No API change. -
GQL
INis the core's list test (kleene-gql):value IN (v, ...)/IN [v, ...]of a node or a node's property against constants and parameters lowers to oneCond::OneOf(the literaldatalog!'sK in (..)makes), one rule however long the list, instead of an OR of equalities (a rule per member). On an indexed property it is still one lookup per value (--explain:index lookup L.key at a, b; the name index per string). ANULLin the list, refused before (a comparison with NULL is never true), is now read as GQL's three-valuedIN: dropped from the list, soINis true or unknown andNOT ... INnever true. A constant on the left, a member that is not a constant, or another value (an edge property, a path length, a computed value) keeps the OR. No API change. -
A value is one of a list, one literal in the core (kleene-plan
Cond::OneOf,Test::OneOf,Plan::list/list_named,ListId,ListMember,List; kleene-datalogProgram::list/list_named,one_of,not_one_of; thedatalog!text):K in (1, 2, 3),N in ("memcpy", "memmove"), Rust values in braces as members (K in ({VIRTUAL}, {FN_POINTER}, 0)), a whole Rust list (N in {named::CODEGEN_CALLEES}, a slice, array or Vec), the negated form!(K in (1, 2)), any expression on the left (T & {0xF} in (1, 2)). Members are coded for the left side's type, as constants are; a member of the wrong type is refused by name (list member 2: a string compared with a u64 value). A run tests sorted codes (a scan of 16 or fewer, else a binary search); strings are dictionary ids looked up once per run, so a string no column holds never matches. A null holds neither form; an empty list holds for no value. The proof shows the value and the list (a named list by its Rust path and its first values). A list test (not negated) on a property with an index is one lookup per member, as an OR of equalities is. A range afterinreads as before: a group followed by..or an operator is its first end. Before, a rule wrote one rule per value. API: added items only. -
A signed property read as unsigned by name,
L.k@u64andE.k@u64(kleene-planCatalog::relation): a set's row-number columns are signed (int32, int64); read by this name, every column isu64and a row whose value is negative or null is left out. AnInt32orInt64column with neither is shared in place; otherwise the kept rows are copied when the name is bound. An unsigned property reads as it is. Datalog:p.input_from::<2>(&cat, "site.iid@u64"). -
Dates and timestamps read as numbers (kleene-plan
time_value, kleene-gar):Date32andDate64arei64days since 1970-01-01 (aDate64that is not a whole day is refused when read).Timestampof any unit and time zone isi64nanoseconds since 1970-01-01T00:00Z (a value outside ani64of nanoseconds, before 1677 or after 2262, is refused when read). They are compared and returned as signed numbers (GQLWHERE n.day >= 19000), and the range index codes them the same way. -
Dictionary-encoded string columns read as strings (kleene-gar
column_type): aDictionaryof strings or bytes is typedstrand read through its keys (kleene-plan already coded dictionary chunks). No name index is built over such a column. -
An unsigned column with nulls is read (kleene-plan, kleene-gar, kleene-index): a row whose value is null has no value and is left out of the relation, as a node with no row is. This holds for every
u64column of an input given as Arrow columns (Source::Columns,ColumnsAt, a table, a typed input; hand-built inputs too, which were refused before), for a set's vertex column, edge property and edge property by row (E@row.p), and for list columns: a null element of an unsigned list is left out and the other elements keep their positions ([7, null, 9]gives positions 0 and 2). Before, that column was refused. The range index leaves such rows out. This differs from the GQL standard, where the row stays with a NULL. -
Fix: one graph-ar commit for kleene and for a user that names
grapharitself: kleene pinned graph-ar 3cd2f70 (graphar 0.3.0, arrow 60), while users build graphar 0.4.0 (arrow 59) from graph-ar'skleene-releaseline; patching both to one checkout failed either way (graphar = "^0.4.0"found 0.3.0, or two arrows and kleene-gar not compiling). kleene now pins graph-ar 6cacaa6 (branchkleene-release-0.5, graphar 0.5.0: both lines joined, arrow 60), and znippy-zoomies 53d082d (rotaryengine 0.1.16, the version that line names; no code change). A user namesgraphar = "0.5"and patches crates.io andssh://git@git.gunnar.rs:2222/nordisk/graph-arto one checkout at the rev kleene's root names. -
Fix: a count into an i64 column is the count (kleene-plan):
Aggregate::countand the counts ofAggregate::many(Reduce::count, a count of values, of distinct values) into a head column declared i64 wrote the raw count, which read back as an i64 neari64::MIN; they now write it as an i64, the same number as in a u64 column. A count over nothing in an i64 column is 0. GQL's counts are u64 columns and were not affected. -
rank(x BY g, ..)in a GQLRETURN(kleene-gql): per row, the number of distinct values ofxbefore its own among the rows equal on thegs (from 0), every row kept (a row per match with its count):MATCH (p:Person) RETURN p.dept, p.age, rank(p.age BY p.dept) AS n ORDER BY n. Lowered onto the core'sAggregate::rank, the oneN = rank(K) by (G)reaches from Datalog. Refused beside an aggregate in oneRETURN, with OPTIONAL MATCH, besidenodes(p). -
Fix: kleene resolves as a git dependency again (kleene-graph,
shims/zstd-014): after 0.3.0 a crate taking kleene from git stopped atcargo updatewithcyclic package dependency: package zstd v0.14.99 ... depends on itself. In a git source cargo finds a path dependency by name among all the repository's packages, and two are namedzstd(the shim's 0.13 and 0.14 faces): kleene-graph'szstdbecame the 0.14 face, whose ownzstdwas then itself. kleene-graph now calls mzstd directly (the same calls, level and limits as through the shim: the frontier bytes are unchanged, a test holds the bytes the shim wrote) and names nozstdpackage, so it no longer brings the C zstd to a user without the patch; the 0.14 face asks for its 0.13 face by exact version (=0.13.99). No API change. A git user who wants no C patcheszstdwith both faces from the git repository (README, "From crates.io"). -
Columns side by side read in one scan (kleene-plan
Engine::side_by_side, on by default;Report::side_by_side): in a rule body, positive atoms over input relations of two columns each over one and the same id column (a catalog's properties of one vertex type) that share the id's variable run as one atom over the columns side by side, instead of a join per column: rules written one column at a time (t.a(I, A), t.b(I, B)) and GQL's property reads get it with no change of text. Applied before the index choice; rules keep their numbers and the run keeps the plan as written, so proofs show each atom by its own name, as without it. With no proof kept it runs after the next-row rewrite (Engine::next_rows), so the columns also merge inside a fused aggregate and the rules the rewrite splits off; with proofs kept a merged body of two atoms can itself take the next-row shape. Stays a join: an atom with an index, a counted input, another source, another id array, a value variable two atoms read, a relation read twice, an unsigned column with nulls. A run that read such a scan keeps nothing forcontinue_from(continuing from it runs from scratch). kleene-datalog'sEnginehas the same switch. -
GQL strings made by a query (kleene-gql):
a || b(ISO GQL concatenation, looser than+ -),char_length(s)andcharacter_length(s)(characters, ani64),substring(s, start [, len])(from 0, past the end shorter) in RETURN, WHERE and ORDER BY, lowered to the core's computed values (Expr::Callof aFunc, the same code as Datalog'sconcat,len,substr); null where an argument is null or a place or length is negative. A made string equal to a string read joins it. New:Operand::Call,Tok::Concat. -
Strings made by a rule (kleene-plan, kleene-datalog,
datalog!):S = concat(A, "-", B),P = substr(S, I, N),P = substr(S, I),L = len(S), also inside an expression or a comparison (len(S) > 3); one more kind of [Expr],Expr::Callof a [Func], on the computed values' one literal. Lengths and places count characters, from 0; a cut past the end gives the shorter piece, a negative place or length no value, a null string none. A string the run's dictionary lacks is added after its sorted strings (Dict::sorted_len), the step's new strings sorted by their bytes, so ids are one at any thread count, and a made string equal to a string read has that string's id and joins its column. Ordered comparisons,inand text tests of a value that may hold a made string, and the output order of a string key, go by the bytes (the run addscmp(A, B)computes for them); a plan with noconcatorsubstrruns as before. Refused:concatinside a recursion (its strings could grow for ever), a least or greatest by a made string, a number where a string goes; a stratum that makes strings runs on one machine. A quoted literal in a string place of a call (concat(A, "-", B),len("xyz")) or beside aconcatorsubstrin a comparison is a string constant. Proofs print the made value with its operands:S = concat(A, "-", B) = concat("ab", "-", "c") = "ab-c" [computed]. -
GQL arithmetic runs on the core's computed values; bit functions and unary minus (kleene-gql, kleene-plan):
+ - * / %lower to aComputeof the rule (one per operator,Compute::typedsets itsi64orf64type) in place of anArithexternal, with the same results (null for a null side, a division by zero, an overflow). New:bitand(a, b),bitor,bitxor,bitnot(a),shiftleft(a, n),shiftright(a, n)over integers (refused on a float; a shift outside0..64is null) and-xof a value.ArithandArithOpare gone from kleene-plan (kleene-gql'sOperand::Arithtakes aBinOp, andOperand::Unaryis new);!xof a computed value is-x - 1unless the value and every operand areu64. -
Text for value reductions, null tests and the bag count (the
datalog!macro):S = sum(X),A = avg(X),L = least(X),H = greatest(X)and several reductions in one rule (N = count(), C = count(X), S = sum(X) by (W):) are the builder'sAggregate::manywithReduce, the path GQL'sRETURN count(..), sum(..)takes;X is nullandX is not nullareis_nullandis_not_null;counted two/3.declares a counted relation andtwo(A, C, N) :- N = count() by (A, C): ...isProgram::count_rule. What existing text means is unchanged:N = count(X)is the distinct count,min(W)andmax(W)the binding with the least or greatest key;L = min(X)is refused at build time and namesleast. -
Computed values in a rule body (kleene-plan, kleene-datalog,
datalog!):O = LO + I,T = INFO & 0xF,ID = IID + {base}bind a variable to an expression ([Compute], [Expr]:+ - * / % & | ^ << >>and unary-!, Rust's precedence); an expression may stand on either side of a comparison or inin(F & {MASK} != 0, [Test]). The value takes the type of the column its variable is bound to (else its operands'); integers are computed exactly over signed and unsigned operands, and a value that does not fit an unsigned variable (below 0, over 64 bits, a division by 0, a shift of 64 or more) or a null operand gives no row, a signed one null. A compute runs as a join step once its operands are bound, soline(R, A), R1 = R + 1, line(R1, A1)is a hash join. Proofs print each computed value with its operands;Plan::show_ruleprints the literal as written. API:Literal::Compute,Literal::Test,Rule::computes; kleene-datalog'scompute, andcompare/eq/.../withintake anExprbeside a term. -
Fix:
Catalog::lacksanswers for every name formCatalog::relationreads (kleene-plan): both read one parse of the name (label, key,@form), so an input ofinput_or_empty(and the text'sor empty) is bound EMPTY only where the set lacks its label or column, forL,E,L.k,E.k,L@id,L@(k1, k2),E@row,E@row.k,T.c@hexand the list columnsT.c,E.c,E@row.c(before,L@(..),E@row..,..@hexand list columns read as lacking even where the set had them); a name whose label and columns are there but that the catalog cannot give in its form stays refused by name. A list column is inschema.columnwith typelistand its element type's name (list u64,list str), no longer inschema.refused. -
Several columns of a node type as one relation by name,
L@(k1, k2, ..)(kleene-planCatalog::columns):(id, k1, .., kn)over the properties' columns side by side (each a two-column source over one and the same id column, as kleene-gar's vertex columns are), read withinput t_ab/3 from cat "t@(a, b)".and bound byInputs::bind. One scan of it reads what one relation per column gives by a join per column (P1, 10M rows, 8 columns: 5.3 s by name against 0.48 s, 1 thread; with a constant filter on one column 1.39 s against 3 ms). Refused by name: no column, a column twice, a missing label or property, a refused property, properties not side by side. -
or emptyin thedatalog!text (kleene-datalog-macros):input inst_mir/2 from cat or empty.andinput x/2 (u64, i64) from cat {NAME} or empty.declare the input withProgram::input_or_empty: empty where the set lacks the name, read by name where it has it; the types given, allu64when none are. -
Many searches allocate nothing on a warm call, whichever searcher takes which source (kleene-graph): a searcher's buffers are made with it and its step log holds the deepest search of any searcher, so a searcher that searched nothing in the first call (all sources taken by the others, as on a loaded host) no longer allocates its buffers in the next.
-
A catalog name in the
datalog!text as a Rust expression (kleene-datalog-macros): beside the quoted form,input site_iid/2 from cat {names::SITE_IID}.takes the catalog's name from any expression in braces that gives a&str(a constant, a path, a local), so a name kept as a builder's constant is checked by the compiler. The handle andRelsfield stay the local name; a dotted name with a given name is refused, as with a quoted one. -
Inputs by name in the
datalog!text (kleene-datalog-macros):input sym.info/2 from cat.declares the input asProgram::input_fromdoes (the catalog's name, width and types;Inputs::bindgives its source); the rules writesym.info(S, T), the handle and theRelsfield aresym_info. A catalog name that is no dotted path is quoted after the catalog with a local name before it (input pet_id/2 from cat "pet@id".); column types in the text ((u64, str)) are checked against the catalog's; the catalog is a local or{expr}. No more one Rust line per relation of a set. -
The set's schema in GQL (kleene-gql):
CALL schema.labels() YIELD label,CALL schema.edges() YIELD edge,CALL schema.columns() YIELD label, column, typeandCALL schema.refused() YIELD label, column, whyread the core's schema relations (Plan::schema, filled byInputs::bind_schema), the same relations a Datalog program's rules read; the columns are strings, aWHEREandRETURNread them as any yielded value. A node label the set lacks in a pattern (MATCH (n:Missing)) stays refused by name (no node label). -
Optional inputs and the set's schema as relations (kleene-plan, kleene-datalog): rules, not Rust, decide what a set lacks.
Plan::input_or_empty(&catalog, name, types)(DatalogProgram::input_or_empty::<N>) declares an input thatInputs::bindbinds from the catalog where it has the name (its types must be the declared ones) and EMPTY where it lacks it (Catalog::lacks;L@idwhere node labelLis lacking); a column the catalog refuses stays an error by name, with why, at the declaration and at the bind. An absent input reads as no rows in joins, negation and aggregates.Plan::schema(&catalog)(DatalogProgram::schema, typedSchemahandles) gives four string input relations,schema.label(L)(every node label, one with no nodes too),schema.edge(E)(table names and unique bare edge names),schema.column(T, C, TY)(every column read,TYone ofu64i64f64boolstr) andschema.refused(T, C, WHY), filled byInputs::bind(orInputs::bind_schemaalone) fromCatalog::schema_rows:no_inst(S) :- site(S, _), !s.label(inst).withinsta string constant builds, runs and has a proof. -
String tests in Datalog (kleene-datalog, the macro): the builder functions
starts_with,ends_with,containsandtext(x, TextOp, pat)(TextOpre-exported) give the core'sCond::Text, the one GQL'sSTARTS WITH,ENDS WITH,CONTAINSgive; the text writes them as GQL does,N starts with "parse",N ends with {suffix},N contains "ex". The tested value is a string variable, the pattern a string literal or a stringTerm; a null is not true. -
datalog!codes a literal for the place it meets: MEANING CHANGE (kleene-planConstant,Plan::constant; kleene-datalogProgram::constant, the macro). Before, an integer literal in the text was its raw value, so against an i64 or f64 column it was a code that matched nothing or the wrong rows (A < 18on a signed age). Now a literal is the number in the type of the place it meets: in an atom or head, the column's; beside a variable in a comparison orin, the type of the column that binds the variable. A u64 place reads as before. New literals: negative integers (-1), floats (1.5,-0.5), strings ("ann"). A pair that does not fit is refused when the rule is added, by name (a float compared with an i64 value,a negative integer compared with a u64 value, an unsigned integer for a str or bool place). A Rust value ({..}, a local, a path, a call,true) stays raw as before, as in the builder;Program::constantis the builder's twin. GQL's coding of its literals moved intoPlan::constant(same results). -
Bytes columns read by name,
T.candT.c@hex(kleene-planCatalog::relationand its string reading, kleene-garcolumn_type, kleene-index, kleene-gql): aBinary,LargeBinaryorBinaryViewcolumn whose values are not all UTF-8 is no longer refused.T.cis its text: a value that is not UTF-8 has no text and is null, as a null slot is.T.c@hex(alsoE.k@hex) is every row as the lowercase hex of its bytes, astrvalue (hex compares as the bytes do). AFixedSizeBinarycolumn (a hash) is never text, so itsT.cis its hex. GQL:hex(n.c)andhex(e.c)read the same relation, andn.ckeeps the text. Datalog:p.input_from::<2>(&cat, "str.bytes@hex"). The name index covers only a column read as text. -
A label's rows and ids by name,
L@id(kleene-planCatalog::row_ids, kleene-datalog, kleene-gql): every node label of a catalog with row numbers (a vertex table, an id block, an id base) is also the relationL@id,(row, id)withid = base + row, answered by arithmetic (IdShift, no table), read withinput_fromand bound byInputs::bind. A column holding a row number of another table joins that table's ids with no base from Rust:owner(P, X) :- person.pet_row(P, R), pet@id(R, X).@is no part of a column name as read, soL@idnever meets a property. GQL'sid(n)of a vertex table's node reads the sameCatalog::row_ids. -
The position of a row in an order (kleene-plan
Agg::Rank,Aggregate::rank; kleene-datalog textN = rank(K) by (G)): per group of an aggregate rule's body bindings, each binding's key tuple gets the number of distinct key tuples of its group before it in rising order (from 0; equal keys share it; each type in its own order; a null key skipped).pos(G, K, N) :- N = rank(K) by (G): item(G, K).One sort on the device's workers, the same rows at every thread count. A fact's proof is one member, its own (first) binding, and its group's number of distinct keys as the size: linear in all. N goes in a u64 or i64 column; any body variable may stand in the head. -
GQL
UNWIND n.key AS xof a list property (kleene-gql): each row before once per element of noden's list property (Catalog::list_property), or of edgee's (UNWIND e.key AS x,ean edge of theMATCHjust before, with a direction;Catalog::list_edge_property), through the same list relation Datalog reads by name, the position kept in the rule so equal elements are rows of their own. A read of one value of a list property (RETURN n.key) is refused by name, the refusal namingUNWIND. -
List columns read by name as rows (kleene-plan, kleene-gar): a
List,LargeListorFixedSizeListcolumn of numbers, booleans or strings on a vertex is relationT.cof (id, position, value) rows, on an edgeE.cof (source, destination, position, value) rows, and by the edge's rowE@row.cof (row, position, value) rows (Catalog::list_property,list_edge_property,list_edge_row_property,list_prop,list_edge_prop,list_edge_row_prop; kleene-garlist_rows,ListRows). The position counts from 0, the value is typed as a plain column of the element type would be; an empty or null list gives no row, a null element is null. Unsigned elements with a null and lists of lists stay refused by name. A read of one value per node or edge of a list property is refused by name. Datalog:p.input_from::<3>(&cat, "T.c"),p.input_from::<4>(&cat, "E.c"),p.input_from::<3>(&cat, "E@row.c"). -
Fix: a set's repeated edges are counted (kleene-gar): an X.gar edge type with two edges or more between the same two nodes gives the catalog its edge counts (
Catalog::edge_counts, the core's one place for how many edges a pair stands for), so GQL'sMATCH (a)-[:call]->(b) RETURN count(*)counts edges (5, not the 3 pairs) and a grouped count each node's edges. Whether a pair repeats is found when the catalog is made (a pass over the type's by-source neighbours that stops at the first repeat); the counts are made the first time a run reads them and kept (12 bytes a pair), so a run that reads no count (BFS, PageRank, a property) pays nothing for them. An edge type with one edge per pair gets no counts, its plans and answers as before. -
Fix: an edge variable's properties come per edge (kleene-gql):
MATCH (a)-[r:E]->(b) RETURN r.p, r.qread each property as (from, to, value) apart, so two edges between the same two nodes gave every value ofpwith every value ofq(4 rows, wrongly paired) and counted once. Where the catalog hasE@rowfor each of the edge's labels (kleene-gar's sets do), the edge is now read by its row: each edge a match of its own with its own values, for one label, label alternatives (rows told apart by label) and either way (a self loop once). A quantified edge and an edge with no property read are as before. -
Every edge type also readable by its row (kleene-plan, kleene-gar):
E@rowis (row, from, to), one row per edge, andE@row.pis (row, value) for each propertypofE, by name from the catalog (Catalog::relation,Program::input_from; coreCatalog::edge_rows,Catalog::edge_row_property). Two edges of one type between the same two nodes are two rows, and a rule joins one edge's values on its row:site(F, G, A, K) :- call@row(R, F, G), call@row.addr(R, A), call@row.kind(R, K).The row is the edge's place in its type's by-source order, a number of that type's own (not a node id). kleene-gar fills both from the mapped files (no new file on disk); kleene-iceberg does not fill them yet. -
Relations of no column (flags) (kleene-plan, kleene-datalog, kleene-datalog-macros): a relation may have no column: it holds its one empty row or nothing ("the table is missing", "the set has debug info").
Plan::input/derived(and the typed forms with no types) take arity 0;Facts::flag(bool),Inputs::flag(rel, bool),Output::holds(rel). Datalog:input open/0.,derived has/0., a headhas() :- t(X)., body atomshas()and!has(); builderp.derived::<0>("has"),has.atom([]),Inputs::flag(&rel, bool),Output::holds(&rel). Joins, negation, strata, rounds,continue_fromand proofs take it (a proof's tuple is[], renderedhas()). Refused: an aggregate or fold that gives one, an external, counted, walk or procedure relation of no column. GQL: no form (a GQL query always returns columns); kleene-gql unchanged. -
The next row by a key runs as a sort and one search per row (kleene-plan;
Engine::next_rows, on by default, also in kleene-datalog;StratumReport::next_rowscounts the rules;Plan::internal): an aggregate rule of two atoms whose one condition holds the reduced value past a value of the other atom (next(A, B) :- min(B) by (A): bound(A), bound(B), A < B.;maxwith>the greatest before;<=/>=; more keys inby (...)shared by the atoms) sorts the reduced atom by (key, value) and finds each row's winners by binary search; the reduction reads those alone, its group sizes from a hidden count, so the facts and the proofs (the winner and the size) are today's. With no proof kept, a run first rewrites its plan: an aggregate over a relation its client marked internal and derived by one rule reads that rule's body (GQL marks its matches when an aggregate reads them), and a side of several atoms becomes a relation of its own; soMATCH (a:N), (b:N) WHERE a.x < b.x RETURN a, min(b.x)(andmaxwith<) takes the run too. GQL'sminwith proofs kept runs as before (its proof lists every match of the group). oden, 8 threads, release,nextover 10000 random values: 1.839 to 0.003 s (9999 rows either way); 1000000 values: 0.135 s. -
A value between two ends from the other side of a join runs as a sort and a search (kleene-plan;
Engine::range_joins, on by default, also in kleene-datalog;StratumReport::range_joinscounts the steps): a lower and an upper comparison of one value (LO <= A, A < HI, either strictness, either side written first; GQL'sWHERE k.a >= p.lo AND k.a < p.hi), and a rangeA in LO..HIbeside equal keys, sort the side that holds the value by (key, value) and find each other row's stretch by binary search: n log n plus the pairs found, overlapping and nested ranges alike. The pairs come in the order of the hash join and the cross product (so each fact keeps its first derivation: the same proofs). Parts of a rule linked by such conditions alone (two unlinked GQL nodes) start with the part that holds the ends. A range with no key beside it ran so already (since 14e72f1). oden, 8 threads, release, 100000 points against 100000 intervals (each point in about 4): 5.874 to 0.024 s, 400036 rows either way. -
A large product's rows are joined on the workers (kleene-sparse): from 2097152 entries the result's arrays are cut at the pieces' bounds and each worker copies its pieces in, so the copy and the first touch of the result's pages leave the calling thread. loki, 8 threads, road2048
A²: 163 to 105 ms (SuiteSparse 101 ms). The maskedA²timed after it in the same process went from 24 to 33 ms: it had been reusing pages the old join left in the allocator (66 k fewer page faults); timed in a run of its own it is level, 41 ms in both. -
PageRank's setup on the workers (kleene-graph): the falling-degree places are counted per piece on the workers (a histogram of the degrees, the high ones sorted apart) and a large graph's first shares are written there, not on the calling thread. loki, 8 threads: rmat22 238 to 204 ms, road2048 197 to 186, rmat24 1332 to 1131, rmat26 7233 to 6747; zox-M and rmat12 level. An
f32out-degree table beside it was slower (rmat22 204 to 233 ms) and is not kept. -
A counted relation's row has a proof (kleene-plan, kleene-gql):
Output::whyon a row of a relation ofderived_counted(the row, then its count) givesHow::Counted { parts }, one part per counting rule that gave the row (rule order), each aHow::Aggregateproof of the row with that rule's count, its members the rule's distinct bindings (a binding weighs the product of its counted premises' counts; a counted premise is proven as counted); the parts' counts add up to the row's. Kept only by an explaining engine: the derivations of the rows before they are added up, as an aggregate's are; a run without explain does as before. An explained continued run counts a counted stratum again (its proofs keep each rule's rows). GQL:Lowered::matches()names the counted matches, whose rows are proven so.walk_countedrows have no proof yet. -
A search's pull pass counts its edges in locals (kleene-graph): the edges looked at and the reached vertices' edges are added to the thread's lane once a piece, not written to it per edge (the field write kept the counter in memory and the slice reloaded each step). loki, rmat26 full search, 8 threads: 202 to 182 ms built
--profile measuredwithtarget-cpu=native, 214 to 184 ms built--releasewithout it. -
The first-of-kind table is kept from one call to the next within a run (kleene-plan): its first slots cleared on the workers instead of fresh zeroed memory each call, let go at the end of the run (bench
projecting, loki, 8 threads, on b31e8b5: walk 1.043 to 0.933 s, walk1 0.628 to 0.581 s; loose, chain, fail, place and enters no worse). -
An index writes no tail until it is extended, and its chains are first touched by the workers (kleene-plan): each slot's last row is found in one pass the first time an index is extended, not written on every build; an index's chain tables are filled on the workers before linking. On 82d32c5 (loki, 8 threads): fail 0.084 to 0.060 s, place 0.007 to 0.006 s, loose, chain and enters no worse. The first-of-kind table stays zeroed memory (filling it on the workers trades walk against loose).
-
Weak components fetch the parents ahead (kleene-sparse
prefetch_read, kleene-graphFETCH_AHEAD):prefetch_read(data, index)asks the CPU for the cache line ofdata[index](x86_64 T0 prefetch, nothing on other targets, nothing for an index at or past the end; safe code, it reads no memory). Afforest's two sampling link passes, its final link pass and its first two compress passes ask for the parent entry they will read 32 vertices (or edges) ahead, so the random reads overlap; the last compress does not. The same labels at every thread count. Scratch measurement on the P1 before the change: total 17 to 28 % less at rmat-like 24 and 26 (4 threads and 1). -
A join's probes go through the index 32 at a time, their memory asked for ahead (kleene-plan, on kleene-sparse's
prefetch_read; benchprojectingshapechain0.632 to 0.600 s on loki, 8 threads): each batch's slots are fetched first, then each chain's first entry and the key columns of its row, so the cache misses of a batch overlap; hash joins, semi joins,new_rowsand the probe of an external's listing. The same rows in the same order at every thread count (tests against the one-at-a-time probe). -
The first-of-kind pass fetches its slots ahead (kleene-plan; bench
projectingshapeswalk1.185 to 1.034 s,walk10.691 to 0.632 s,enterswith proofs 1.307 to 1.208 s on loki, 8 threads): both passes ask for the slot of the row 32 on and for the hash of the row held in the slot of the row 16 on, so the random slot reads overlap. The same rows kept at every thread count. -
Conditions against one atom column pick their rows by the SIMD range selection (kleene-plan, on kleene-sparse's
Simd::select_range; benchprojectingshapefscope0.094 to 0.043 s on Tiger Lake, 4 threads): a cross join whose condition compares an atom column with a table column or a constant (==,!=,<,<=,>,>=, a range) picks each table row's atom rows by one range selection over that column, then checks the other conditions on them; a selection by a constant (or a condition against one) picks its candidate rows the same way. The same pairs and rows in the same order at every level and thread count (tests against the plain loop). -
The
kleenereport splits a cold run (kleeneLine::cold_split): beside the cold total, each cold run's parts (the set opened, the graph built, the first query answered) in a table of their own and ascold_open_ms,cold_build_ms,cold_query_msin the JSON; the existing lines are unchanged. -
A set opened with its checks on the workers (kleene-gar
GarGraph::adjacency_on; kleeneopen_set_on,reach::shared_graph_on; graphar on branchkleene/check-in-pieces,MappedGraph::edges_unchecked): graph-ar checks every offset, neighbour andbackrow of both orders when a set is opened, on one thread (about 13 GB read at rmat26). The checks now come from graph-ar in pieces and run on the device's parked workers, so each mapped page is first touched there; the same adjacency, shared from the mapping, and the same refusal of a bad set. Thekleenereport's sets open this way. -
Weak components on one machine: no pass on one thread (kleene-graph
Components::count_on; the CPU backend'scomponents_of=afforest): the parents start as zeroed memory first touched by the workers' setting (before: written on one thread first), the labels are moved out with no copy (before: collected on one thread), and the count runs on the device's threads (count_on, used by thekleenereport's wcc row). -
Many searches run side by side (kleene-graph
BfsMany,MANY_BUDGET,MANY_BYTES_PER_VERTEX; kleene-ballista's many-search mode): a machine's share of the searches no longer runs one at a time on all its threads, where a small k-hop search kept one thread busy and left the rest waiting. The threads are shared out among searchers, each with a kept state and a device of its own, taking the next source from a shared counter; as many searchers as the state budget holds (8 GiB by default; one at a time on all threads when not even two fit). Each answer is the one the search alone gives. -
Sliced searches at the same time keep apart (kleene-ballista, a fix): each running search has its own side per machine, keyed by its query id, taken out of the map while its level runs (no lock held during a step); a finished search's side goes back to the kept ones of its slicing for the next search (warm buffers). Before, the side was keyed by the slicing only, so two searches on one graph at once shared one
ReachSlice. -
A sliced search's answers read no round again; its rows point at one buffer (kleene-ballista
EndExec): the answers stage waits for the last round throughEndExec, which never reads its input, so the rounds' finds are not fetched and shuffled once more; the round rows are a binary view column whose rows to every machine point at the one encoded buffer (moved in, no copy per machine), and the received rows are read in place. Route values are found once per executor, weak components run on kept buffers (afforest_with), and the sides encode and join through their kept coders. -
A sliced search's bytes made and read on kept buffers (kleene-graph
FoundCoder,Found::{to_bytes_with, read_into},ReachSlice::{encode, take_bytes}; the zstd shim'sbulk::Compressor::compress_append,bulk::Decompressor::decompress_append): the same bytes asFound::to_bytes, but each worker writes its pieces straight from the set into its own scratch and compresses them with a kept compressor, and the frames are joined once into the output (before: the whole set copied before compression, a compressor made per piece, the frames joined twice). Read back, each worker decompresses its pieces with a kept decompressor and writes the vertices straight into the kept buffers of the set it fills (before: the pieces joined, then copied into a new set). -
A sliced search's levels end on the workers and keep their buffers (kleene-graph
ReachSlice::start_on): a push marks its new vertices in a kept bit map (onefetch_oreach, each thread noting the words it touched) instead of appending them to lists joined on one thread; a pull writes its new words into the same kept map instead of a fresh vector; both are then counted, trimmed and listed on the device's workers (the same list or bit map as before). A list frontier is turned into bits on the workers, the frontier buffers of both forms are kept between levels and searches, andstart_onfills the open set on the workers. -
A second caller of a busy pool waits for the workers (kleene-sparse): a parallel step called from another thread while the device's parked workers run a job now waits for that job to end and then runs on every worker, instead of running all its shares alone on its own thread (two searches at once on one executor's device each got one thread). A job that calls back into its own device still runs the inner call on its thread.
-
Loading builds the transpose on the device's workers (kleene-index
Loads, newEdgeSource::by_source_onwith a default): a loaded part's transpose andTransposed's edges by target come from the CPU backend's parallel transpose instead of one thread (the same matrix; rmat-like scale 22 on the P1: 0.52 s against 1.52 s). -
Weak components on kept buffers (kleene-graph
AfforestState,afforest_with): a warm run allocates nothing (the parents and the sample kept), sets every vertex up on the device's workers instead of one thread, andAfforestState::countcounts the components on the workers.afforestis unchanged (a fresh state per call). -
Row kernels in kleene-sparse's SIMD module, chosen at run time (kleene-sparse
Simd::{hash_rows, compact_bools, bits_to_places, select_range},RowHash,KeyCol; benchkernels): a batch hash of key columns (the same hash as one row throughRowHash), aboolmask and the set bits of words to the row numbers they keep, and the rows whoseu64oru32value lies in a range (every compare with a constant) to their row numbers; AVX2 and AVX-512 code where the compiler gives none from a plain loop, the same rows at every level (tests against scalar on every level the host has, AVX-512 run on Tiger Lake and Zen 4). Row gathers stay plain code (hardware gathers measured slower). The AVX-512 level ofpopcountandfold(and every level in a-C target-cpubuild on an AVX-512 host) no longer compiles to strided gathers: on Zen 4 popcount 0.015 to 0.003 ms, fold min over 33M values 22.8 to 4.5 ms. Wired: the push step's level list from its marks, kleene-graph'sNodeSetcount and list, kleene-index'sReverseReach::countandKinds::count. -
Builds in the repository are for the CPU they are built on (
.cargo/config.toml, also incrates/kleene-ballista):-C target-cpu=nativeas acfgtarget entry, so it joins a host-wide[target.<triple>] rustflags(a linker flag) instead of being ignored beside it. A binary copied to an older CPU stops with an illegal instruction;RUSTFLAGS="-C target-cpu=x86-64-v3"builds one for every AVX2 machine. New profilemeasured(release, fat LTO, one codegen unit) for binaries that are timed. -
Rows move on the workers and are copied less (kleene-plan; review of how rows move, findings 1 to 14): pieces joined, sorted, gathered and deduplicated on the workers; a batch of new facts known distinct is added without a second pass and moved into an empty set; a small batch goes in without growing the set row by row; an index is built on the workers and extended at its chains' tails without walking them; a relation read whole as it grows is indexed once per stratum, not every round (
StratumReport::indexed_rows); negation and externals probe per piece on the workers, an external's listing through a kept index; slots start as zeroed memory; with the why kept, a changed join order is carried as a permutation of the rows and gathered once, at the head. The same facts and the same kept derivation at every thread count. -
A rule's join order cuts the rows before they multiply (kleene-plan; bench
projectingshapesplace,fail,loose,fscope,bench/projecting.md): where the next atom shares no bound variable, an external that answers from the bound columns and binds a variable a later atom reads is asked first (no cross join before the external that ties the atoms); an atom whose own variables only the head reads is joined at its place for its shared columns alone and whole at the end, so its head variables multiply no row before; a negated atom cuts a join step's pairs as soon as its variables are bound; an atom tied to the others by conditions alone does not start the order. Facts unchanged at every thread count; aggregating rules untouched; with the why kept, each atom's row numbers ride along where the order changed and the rows go back to today's order before the heads, so every fact keeps the same derivation. -
A join that projects a variable away carries and proves each fact once (kleene-plan
StratumReport::{peak_rows, proof_rows}; benchprojecting,bench/projecting.md): once a variable is no longer needed by the head, later atoms, externals, conditions or negated atoms, the bindings that differ only in such variables are made one after the step (on the join's pairs, before the table is gathered; the first of each kind kept, in order, on the device's workers; skipped when an estimate finds few repeats), so a rule's table grows with its distinct needed tuples, not with its bindings. With the why kept the dropped variables ride along as the derivation's witnesses. The heads go in by batch: the new facts are found on the workers, and the derivations of exactly those are appended as one chunk (moved in when every row is new; head variables not stored again), never one per binding, and no store grows by doubling. A stratum that reads none of its relations keeps a set when explained, and a bag that makes itself distinct as it doubles when not. Facts and each fact's derivation are as before (checked against the old row-by-row path at 1, 3 and 8 threads); aggregates, folds and counts are untouched. -
The split mode's rounds read nothing per task; the weak components load their part alone (kleene-ballista
state::split_key,state::part_t_alone; kleene-indexTransposed): an executor reads a computed split's saved list once and keeps the key, and keeps each part's handle, so a round withcomputed:Kcosts what one withhash:Kcosts. The weak components no longer build the whole split and its transpose on every executor: each loads its part and its part of the transpose (Transposed, the source's matrix by target, throughLoadslike any part, the same ids by the same key).state::{Loaded, loaded, transposed, split_t_of}are removed. -
Shortest paths and the closure over machines; the central index from the executors (kleene-ballista
Query::Sssp,Query::Closure,Cluster::{prepare, sssp, closure},ClosureRun; kleene-graphSplitIds::of):SsspPartandClosurePartrun in the split mode's rounds (min and or at the sender), the closure 64 starts a job, one bit each. In the split mode the client no longer splits the graph: a load job brings each part's summary from its executor, the client builds the central index from them and the ids from the node count and the key (SplitIds::of).kleene-ballista benchruns the plan's path rows throughssspand, with--closure N, a closure row per graph. -
The cluster reads a computed split (kleene-ballista
Key::Computed,--split computed:K,GraphSpec::split_key): the part list lane kz'skleene split-report --savemade once (CPU or GPU) and kleene-indexsave_computed_splitkept beside the set is read by the client and by every executor (load_computed_split, snapshot 0, checked against the set's node count) and goes into the split asSplitKey::Property; nothing computes it here. No saved list: the spec is refused with the command that makes it. A set without a root file is read from<set>.kixunder the key the store holds. -
The sender's combine and coding on the device's threads (kleene-graph
Sends::combine(add, device),Sends::to_compact_on,COMBINE_DENSE_RATIO,COMBINE_BUCKET_MIN,COMBINE_SERIAL_BELOW; kleene-ballistarows_of/rows_compacttake the executor's device): no sort over every border edge's send. The sends are counted into buckets of node ranges per target part, a piece of the sends per worker, and each bucket folds into an array over its range (at least one send per 4 nodes) or sorts alone; the result is the same on every thread count.to_compact_oncodes the mzstd pieces on the same workers and skips its sort when the entries are in order. oden, 32 threads, 16.8M sends to three parts of 5.6M nodes: 144 ms against 3881 ms for the one-thread sort before; coding 76 ms against 114 ms on one thread. -
The computed split's round on the GPU (kleene-cubecl
GraphBackend::split_votesforGpuBackend;CpuBelow::split,GpuDevice::split_bytes,GpuDevice::split_on_gpu): one CubeCL kernel gives each node of up to 512 out- and in-edges one unit with its K counters in a local array (compiled per power of two up to 64), another gives each longer node a cube of 256 units counting into 64 shared counters; the pick is the CPU kernel's (votes times room in 64 bits, ties to the own part, then the lowest; self-loops not counted). The patterns are the cached ones; per round the part per node goes up and the wanted part comes down. The list equals the CPU kernel's bit for bit (rmat16, road256, a grouped graph, one with isolated nodes, a hub; K 2, 4, 7, 64; on an RTX 5080 and a Radeon 660M), and so does the wholecomputed_split. Below 131072 out-edges, on an integrated GPU, past 64 parts, for a bad list, or when the round does not fit three quarters of the card's memory, the CPU kernel answers.examples/split_timetimes both. -
A computed split kept beside its set (kleene-index
save_computed_split,load_computed_split): computed once (one machine, CPU or GPU), then read by every executor and the client. One index of the set'sStore(<set>.kix, keyed by the root hash orStore::keyed),split.<edge>.k<parts>: the part per node as one byte, the part sizes, the capacities when given, and the snapshot, node count, rounds asked, slack, seed, rounds run and crossing edges. Loaded by set, edge type, snapshot and parts;Nonewhen absent, an error for another snapshot or node count. -
A split computed from the graph (kleene-graph
computed_split,SplitCompute,ComputedSplit,MAX_COMPUTED_PARTS,crossing_edges,parts_of_key,GraphBackend::split_votes): balanced label spreading (the Spinner rule) cuts a graph into up to 64 parts so that few edges cross, all in integers so every device and thread count gives the same list. A hash start within each part's limit (equal shares raised by a slack, or given capacities); each round one pass over the edges on the backend (each node wants the part most of its neighbours are in, weighted by the part's room; the CPU backend's kernel on the device's parked workers, the trait's default for any backend that keeps the host pattern), then each part lets in only as many as it has room for by a hash of (node, round), and only the nodes of an even hash may move in a round (no pairs swapping for ever). The round of fewest crossing edges is kept, so the result never crosses more than its start; it stops when the crossing edges fall under 0.1 % over 3 rounds, or at 100 rounds by default (8 groups of 2000 nodes need 47; R-MAT stops by the 0.1 % rule at 17 to 20). The result goes into a split asSplitKey::Property(part). Tested against a plain one-thread reference (K 2, 4, 7, 64; 1 to 8 threads), groups joined by a few edges (cut at exactly those), and the rounds' answers over the result. -
kleene split-report(kleenebenchmark::split): what a split is worth, in one process. Each graph (zox-M, road2048, road2048 with its ids shuffled by a fixed seed, rmat24) cut into K = 4 and 8 parts by a hash of the id, by equal id blocks and by a given part per node (measure_parts, for the computed split): the crossing edges (the coreSplit's border edges), the smallest and largest part, and the split mode's cost through the core's rounds (khop_roundsfor ten hops,reach_rounds,components_rounds): rounds, entries handed over, bytes before compaction and wall time, each answer checked equal to the unsplit graph's. Writesbench/split.md. The computed column runscomputed_spliton the CPU (its rounds and time beside it); all three splits are counted alike bycrossing_edgesoverparts_of_key.--max-rounds R(5000 by default) stops a search or the components there and marks the cell capped (a hash split of a road grid takes thousands of rounds). -
kleene split-report --save <X.gar> [--edge E] [--parts 4] [--gpu](kleenebenchmark::split::compute_on,split_store,split_key): the computed split made once, on the CPU or with--gpuon the GPU backend, and kept beside the set by kleene-index'ssave_computed_splitassplit.<edge>.k<K>for the cluster's workers to read; prints parts, rounds, crossing edges and the time. The store is<set>.kixkeyed by the set's root hash, or for a set without a root file (the suite's generated sets) byfingerprint:<hex>of its edges;--store DIRkeeps it elsewhere,--snapshot N(0 by default) is the snapshot written and checked. -
Rounds stopped at a limit (kleene-graph
reach_rounds_upto,components_rounds_upto): at most that many exchanges, the answer found so far;reach_roundsandcomponents_roundsare these without a limit. -
The split mode sends one entry per border node (kleene-graph
Sends::combine; kleene-ballistarows_of,rows_compact,round_entries, round rowsroute,part,sends): a part's sends are folded at the sender with the query's own add (or for reach, the sweep and the closure, min for k hops, components and shortest paths), so a node crosses once however many border edges reach it, and each round sends one row per target part holding its entries in the core's compact form (Sends::to_compact: sorted ids or a bit map, mzstd when smaller). Before, a part sent one Arrow row per border edge. -
Docs (kleene-datalog, kleene-plan, kleene-gql READMEs): the examples build the device with every core (
CpuDevice::default()) and a multi-thread tokio runtime, and say which threads do what: joins and graph kernels run on the device's workers, only table reads through DataFusion run on the caller's runtime. The old examples (2 threads, a current-thread runtime) were being copied into real callers. -
The PuppyGraph page's ten-hop table names each run's machines (kleene
Run::nodes, from the run'skleene-ballista over A + B + Cnote) and lists the several-machines run (--cluster) beside the others. -
A full-operand
mxvthat reads less (kleene-sparseCpuBackend::iso_product,CpuBackend::FULL_MXV_SERIAL_BELOW): a structural matrix times a full operand of one value whose product folds to itself (or-and over all true, min-plus over one weight) gives every row with an entry that product, so only the offsets are read; other full operands fold each row over slices, with the terminal's test only where the semiring has one, and the result's words of places are built 64 rows at a time in a register. A fullmxvnow goes to the workers from 65536 rows and entries counted together (it was 65536 entries). dwarf, 12 threads, against SuiteSparse:GraphBLASGrB_mxvin the same windows: or-and rmat24 35.6 -> 13.1 ms (SuiteSparse 21.8), rmat22 10.3 -> 3.7 (5.8), zox-M 0.39 -> 0.06 (0.21); zox-M plus-times 0.49 -> 0.13 (0.40) and min-plus 0.49 -> 0.16 (0.35). Min-plus on rmat22 stays at 40 ms against 27. -
Distributed v1.1 over machines (kleene-ballista
whole,WholeGraph,Cluster::{sliced, many, components, load, sweep},Query::Sweep): every machine holds the whole graph, loaded once and kept (loadloads it ahead of any query). One search is cut in slices weighted by the machines' cores (ReachSlice): a round of the fork's loop is one level that is cut, each machine expands its slice and sends only its new vertices (Found, compact bytes) to every machine; the small levels run whole on every machine. Many searches go out whole (Slices::portion, one task per machine, no exchange); weak components go whole to the first machine. A split graph reaches in part order (Central::order): a round runs one level of the part graph's strong components, only its parts step, later parts' sends wait for them.kleene-ballista bench --split whole:W1,W2,..and--sweep, andthroughput(many k-hop searches on the first machine against all). Tested on an in-process cluster: the one-machine answers on 1 to 4 machines (every level cut, and small levels whole) and over 1, 3 and 8 parts. -
Parts loaded alone, and ahead (kleene-ballista
Cluster::load_parts,Query::Load,bench --load): in the split mode each executor loads only its parts through the core'sLoads(Split::part_only), kept for every later query, and a load job loads them before any query; the whole graph comes from the same store (LoadKey::whole). The weak components over parts still build the whole split (they need its transpose). -
One part alone (kleene-graph
Split::part_only,Split::part_of_edges,Split::into_parts;SplitKeyisHash): a machine builds only its part, reading only the rows of the part's nodes from a matrix by source (a mapped GraphAr table reads only those rows' pages: one run for a key of id blocks, the part's rows wherever they lie for another key), or scanning every edge once and keeping the part's where the source has no order. The part and its summary areSplit::new's; every machine keeps the ids beside its part (a base per part for id blocks, 8 bytes a node for another key).Split::newand both share one part builder. -
Load ahead (kleene-index
Loads,LoadKey,LoadedPart,EdgeSource,GarEdges): a part (or the whole graph, one part sharing the source's matrix) is built from a source at a snapshot before any query, with its graph in both directions and its reach index, kept, and its summary given back forCentral::build. A later query finds it (Loads::get_or_load) and builds nothing; a part not loaded is loaded by the query.LoadedPart::searchsearches the part on kept buffers;Loads::buildscounts builds. -
Whole values read in the core (kleene-plan
Engine::read_entities,NodeAsk,EdgeAsk,Entities): every property of some nodes and edges and which labels hold them, by one plan over the ids asked alone (an edge property of several edges between one pair the least). kleene-gql's whole values (RETURN n,RETURN r,properties(x)) ask it and only assemble the entities. kleene-datalog:Engine::read_entities. -
Edge tests of a walk in the core (kleene-plan
Plan::edge_filter,EdgeTest,Cmp::negated): the edges passing every test (an AND of property comparisons held, or false) as a derived relation a walk takes; kleene-gql'sall/none(x IN r WHERE ...)map onto it. kleene-datalog:Program::edge_filter. -
Null marks, UNION and WITH stages in the core (kleene-plan
NullMark,Marked(pick,append,distinct,is_null),OrderKey::null_by,Inputs::datums): OPTIONAL MATCH's null cells,UNION ALL/UNIONover rows with null marks (a null apart from every value) and another run's typed rows as an input (counted or not) are core operators; kleene-gql maps onto them (its WITH refusal now names the columns of the stage). kleene-gql no longer depends on arrow-array (a dev-dependency only). kleene-datalog:Inputs::datums, re-exportsNullMark,Marked. -
Id relations in the core (kleene-plan
IdShift,IdRanges::rows,NameHits): a vertex table's(row, id)by arithmetic, the rows (not ids) of a table whose ids lie in a range, and the ids a name index gives for some strings are public external relations of kleene-plan; kleene-gql's ownShiftandIdHitsare gone (it mapsid(n)onto them). kleene-datalog re-exportsIdShift,IdRanges,NameHits,NameIndex. -
sssp's weight key through the core's catalog (kleene-gql):
CALL sssp(E, s, key)readsE.keyasPlan::input_fromandCatalog::relationgive it (its column types too), one path with the other procedures' weights and capacities. -
The index relations and a set's indexed catalog in kleene-index (
kleene_index::relations:AddrRel,ReachRel,ReverseReachRel,NestRel,IntervalRel,GroupRel,ParentRel,LazyReachRel,RangeRel,NameRowsRel,KindsRel,AddrMode;kleene_index::catalog,kleene_index::indexed): moved from thekleenecrate (kleene::relations,kleene::gql_set, both gone;kleene::indexre-exports kleene-index). kleene-index depends on kleene-plan now. -
One search over machines that hold the same whole graph (kleene-graph
Slices,ReachSlice,slice_rounds,search_slices,Found,NodeSet; reach and the PuppyGraphkhop-Kcounts): each level of the direction-optimizing search is cut by edge count into slices weighted by the machines' cores (a push by the frontier's out-edges, a pull by the open vertices); every machine computes its own slice, so no slice is sent, and only the new vertices travel, as a sorted list or a bit map, whichever is smaller, compressed with mzstd in pieces on the machine's threads. Levels expected to look at fewer thanLOCAL_BELOW(2^18) edges run whole on every machine with nothing sent (ReachSlice::with_local_below). The steps are the one-machine search's; one slice is one call of today's kernel.Slices::portionhands many searches out whole by the same weights (no exchange). Border sends travel compact too (Sends::to_compact,from_compact). kleene-graph now depends on the in-tree zstd shim. -
One sweep in part order (kleene-graph
PartOrder,reach_sweep; kleene-indexCentral::order): the strong components of the part graph, feeders first, in levels; a part outside a circle runs once, after its feeders, and only a circle's parts loop among themselves. The answer isreach_rounds's, with fewer runs; the exchanges are the levels that send (fewer than the rounds' where parts are reached again along longer ways, more where far parts are reached in one hop). -
Signed weights for spanning forests through the plan and GQL (kleene-plan
Procedure::SpanningForestover aType::I64weight column; GQLCALL msf(E, signedProperty)): the forest's weights come back signed, negative ones kept. Signed capacities for maximum flow stay refused. -
Removed rows in the engine: delete and derive again per stratum (kleene-plan
Engine::continue_with, kleene-datalogEngine::continue_with): a stratum of joins (a recursion of joins too) reading a relation that lost rows no longer runs again: (1) every fact of the run before with a derivation through a lost row is deleted (semi-naive over the old facts, seeded by the lost rows); (2) each deleted fact with a derivation from what is left and the inputs as they now are is found again (each rule once, its atoms narrowed to the deleted facts' values); (3) the engine's own rounds go on from those and from the rows the reads gained. A count takes off the counts of the bindings lost (the atoms before the changed one as they now are, those after as they were; a count at 0 drops its fact). A negation over a relation that lost rows, an aggregate, a reach or a closure reading one still run again. The facts kept keep the proofs of the run before (none goes through a deleted fact); those found again are proven by their rules in this run. Checked against runs from scratch on joins, linear and non-linear recursion, negation, counts and the index choice, with many random changes, proofs checked against the new inputs. kleene-iceberg matches removed rows to the rows they take out by their encoded values (arrow-row, one hash look-up per row), not row by row. -
Float capacities for maximum flow (kleene-graph
max_flow_f64,MaxFlowF64; kleene-planProcedure::MaxFlowover aType::F64capacity column; GQLCALL maxflow(E, s, t, floatProperty)): the same push-relabel rounds and Dinic's phases on the bits of floats (atomic adds by compare-and-swap); an arc or excess of at mostlargest capacity * vertices * f64::EPSILONcounts as empty; negative, infinite and NaN capacities refused. The flow is a float column. -
The PuppyGraph page sets one machine beside several (kleene
puppygraph report --cluster TITLE=FILE [--puppy-cluster TITLE=FILE],PuppyReport::cluster,puppy_cluster,PUPPY_CLUSTER_CLAIM,MACHINES_HEAD): a section per query with (1) kleene on one machine, (2) kleene on several (an answer file in the driver's format, its notes saying where the time goes), (3) PuppyGraph on several, which is their published claim (ten hops in 2.26 s on four nodes), marked so, until a measured file replaces it, and (4) PuppyGraph on one node as measured; each cluster answer checked against kleene's. Public API change:PuppyReporthas two more fields. -
A query over several machines through Ballista (new crate
kleene-ballista, its own workspace,publish = false; O5 transport):StepExec(one round of one part: what arrived for the part in, its border sends out) andCollectExec(each part's answer in original ids) as Ballista operators with a codec (KleeneCodec) and scheduler rules (KleeneRules: a part's tasks run where its state is, the placement fromCentral). Each executor builds a graph's split once and keeps it for every later job; a query's part sides are job state. One query is one job: the rounds are the fork's recursive loop (a stage per round, border sends as Arrow batches through the Flight shuffle), ending at the first round that sends nothing. The client holds only the central index: it places the sources by the id ranges and wakes only the parts they can reach (one task per woken part and stage). Binaries:kleene-ballista-scheduler,kleene-ballista-executor,kleene-ballista(client:reach, andbench, which runskleene puppygraph plan's rows over the cluster with where the time went). Queries: reach, weak components (ComponentsPart), k hops (KhopPart). Tested: an in-process cluster of three executors gives the one-machine answers at 1, 2, 3 and 8 parts (blocks and hash, first and warm runs), and a query from an unreachable part wakes that part alone. Forknordisk/kleenegainsAdaptiveRules::preferred_executorand placement for stages that collapse their input. -
Maximum flow on the workers (kleene-graph
max_flow,MaxFlow::rounds): push-relabel rounds (Hong's lock-free rule: each vertex with excess pushes to its lowest neighbours or lifts itself, capacities and excesses as atomics, a stamp so a vertex is queued once a round; exact heights again by a backward search on the workers after a pass of work) run before Dinic's phases, which then normally make one level search that proves the flow maximum and names the cut; rounds that do not settle fall back to Dinic alone. The residual graph and the flow per entry are built on the workers. The value and the cut are the same at every thread count; the flow on each arc may differ. On loki (12 threads,bench/loki.md) rmat22 0.60 s (Dinic before 2.00 s, LAGraph 1.97 s), rmat24 2.55 s (8.71 s; LAGraph 6.70 s), road2048 0.71 s (2.45 s; LAGraph past 5 minutes).MaxFlow::phasesnow counts Dinic's phases after the rounds. -
Graph procedures over far-apart ids (kleene-plan
Plan::procedure): ids too far apart to index directly (pastu32, or spread wide) are numbered by rank for the run, as the graph strata number them, and every vertex of the answer comes back in the caller's ids (before: refused); sources, targets, weights and capacities are read in those ids; the stratum's report saysrenumbered. A spanning forest's second end is now mapped from a base too, and a maximum flow's value is no longer shifted by one (vertex_columns). kleene-datalog:Program::procedure, re-exportsProcedure. -
K hops level by level over the parts (kleene-graph
KhopPart,khop_rounds; the PuppyGraphkhop-Kquestion over machines): one hop a round everywhere, the targets inside a part sent to the part itself and the border targets to theirs, at depth + 1, and nothing hopped from depthk; the run ends when nothing is sent. Tested: equal to a queue for k 1, 2, 3, 6, 10, on one part and split, and over three machines faked in one process. -
A part kept between rounds and queries for the local-fixpoint operator, and plain data for a codec (kleene-datafusion
KeptPart,HopSpec,LocalFixpointSpec; kleene-indexCentralTables):LocalFixpointExec::new(input, column, kept, device)runs one round of the part kept in aKeptPart(itsReachPart), so a second round gives only what is new and the client loop needs no sets of its own;KeptPart::restartstarts a new query on the kept graph and buffers. The operators' specs (spec,from_spec,to_bytes,from_bytes) and the central index's tables (Central::tables,Central::from_tables,CentralTables::to_bytes/from_bytes) are what a codec sends to rebuild them elsewhere. API change:LocalFixpointExec::newtakes theKeptPartin place of the part, graph and ids. -
The dots of a masked
mxmcut by merge steps (kleene-sparseCpuBackend::mxm_dots_plan): each row's merge steps (its length times the mask's places in it, plus the columns' lengths those places name) are counted on the workers, and the rows are cut into pieces of about equal steps, eight a worker, from a shared counter; a row of many long merges no longer holds back a piece of equal rows (rmat12's maskedA Aby dots 16.4 -> 2.7 ms).MXM_DOT_STEP0.5 andMXM_TRANSPOSE_STEP3.5 measured again with the transpose on the workers: Gustavson stays the choice on zox-M, rmat12 and road2048 (road2048 by dots 185 ms, of which 100 the transpose, against 110). -
The transpose on the workers (kleene-sparse
CpuBackend::transpose_plan,TransposePlan,CpuBackend::TRANSPOSE_SERIAL_BELOW):SparseBackend::transposeon the CPU, the kept transpose ofvxm_intoand the dots of a maskedmxmrun a bucket sort in two passes: each worker moves its rows' entries into the buckets of blocks of columns (a run of its own in each), then sorts whole blocks by column in a counting sort that stays in cache; the rows of the result rise as before. Below 65536 entries, or on one thread, the one-thread counting sort. dwarf, 12 threads: road2048 (10.1 million entries) 172 -> 97 ms, rmat22 (33.0 million) 1397 -> 352 ms. -
Rows removed from Iceberg tables, read between two snapshots (kleene-iceberg
Delta::removed; kleene-sparseCsr::with_changes; kleene-planEngine::continue_with,Engine::continue_with_traced; kleene-datalogEngine::continue_with):advancereads a table's window through bifröst's changelog (IcebergSource::ingest_changes, Knutarrow6047e3335): the data files added, and the rows equality deletes, position deletes, deletion vectors and copy-on-write rewrites removed, applied in commit order (a whole row takes out one equal row, an equality delete's key every row it names). Each graph is the old one with the new edges added and the pairs no row holds now taken out; the facts lost come as a catalog of their own beside the added rows, forEngine::continue_with(itsremoved: the rows each input lost). A snapshot with removals in its history is read as that history applied in order (or, when skade cannot read it as rows, as its live rows,IcebergSource::read_at), so a snapshot pinned before or after a delete reads what is live there. A removal the mapping cannot name (an equality delete on another column) reads the table whole (Delta::reread). The engine computes again a stratum that reads a relation that lost rows. -
One part's side of the components, shortest-path and closure rounds, kept (kleene-graph
ComponentsPart,SsspPart,ClosurePart): the same shape asReachPart(a part's kept state,stepon what arrived givingSends);components_rounds,sssp_roundsandclosure_roundsare the loops over them inside one process (one part: one call of today's kernel, as before). Tested over three machines faked by threads and channels: the answers and exchange counts equal the in-process rounds and one machine. -
Deep searches leave the GPU (kleene-cubecl
GpuBackend::bfs_place,CpuBelow::bfs,bfs_frontier,bfs_depth): a breadth-first search (and Datalog reach) on the GPU moves its levels to the CPU once it is past 16 levels on a frontier under 16384 vertices, and back when the frontier reaches four times that; a graph under 4194304 edges, or any graph on an integrated GPU, searches on the CPU from the first level.KLEENE_GPU_BFS_FRONTIERandKLEENE_GPU_BFS_DEPTHset the two when the device is made. Answers equal the CPU's. -
One part's side of the reach rounds, kept (kleene-graph
ReachPart,Sends; O5's core seam):ReachPartkeeps a part's graph, search buffers and reached nodes between rounds;steptakes what arrived (any order, repeats allowed) and gives the border sends.Sendsholds them as plain columns (target part, target local node, value) and moves as one Arrow batch (to_batch,from_batch), so a runner over machines keeps the sides where the parts sit and moves only the batches.reach_roundsis that loop inside one process; it now lends its graphs and buffers to the sides (&mut Vec) and gets them back. Tested: three machines faked by threads and channels give the one-machine answers and exchange counts. -
Arrow 60.2, DataFusion 56, Rust 1.95 (was Arrow 59.2, DataFusion 55, Rust 1.94). Arrow's major version changes for callers: every crate that takes or gives Arrow arrays, schemas, record batches or DataFusion plans (kleene-sparse's buffers, kleene-graph, kleene-plan, kleene-gar, kleene-index's store, kleene-iceberg, kleene-datafusion) now speaks Arrow 60 and DataFusion 56; a caller on Arrow 59 must move with it. graph-ar was first pinned at its
arrow60branch (105b128), and the release pins 6cacaa6 (the graph-ar fix above); kleene-iceberg takes Knut's bifröst and skade by git from theirarrow60branches and ispublish = falseuntil their releases. The zstd shim gains a 0.14 face (shims/zstd-014) for arrow 60's codecs, so the build still compiles no C.
0.3.0 (2026-11-29)
What landed after the tag v0.2.0, the last release on arrow 59.2 and DataFusion 55 (tag v0.3.0 on 7c63079 + its release commits). 0.2.0 was never published; 0.3.0 can be published alone.
-
The coordinator's central index of a split graph (kleene-index
Central,CENTRAL; kleene-garIdSpace::position; distributed engine v1.0, item 5): built from the indexes that exist: the id ranges are anIdSpacewith one row per part (which part holds node X from the numbers, a binary search), the part graph (one pass over the parts' summaries) is a small graph whoseReachprunes a search to the parts it can reach, the placement is a table part -> machine, the names areNames; kept in aStore. It never holds the graph. One machine is one part: one row, a part graph of one node. -
The hop and a part's local fixpoint as DataFusion operators (new crate kleene-datafusion:
HopExec,LocalFixpointExec; distributed engine v1.0, item 3): Arrow batches of node ids in, reached ids out, on kleene-sparse'svxmand kleene-graph'spart_search; the operators hold a shared reference to their matrix. A plan can put the hop after a Parquet scan (tested). Not pulled in by the umbrella crate. -
Local-first rounds over a split, one code for one part and many (kleene-graph
reach_rounds,part_search,closure_rounds,components_rounds,sssp_rounds,Exchanges,Split::whole,Part::border_targets; kleene-planEngine::split,Stratum::splittable,PlanError::NotSplittable; distributed engine v1.0, items 4 and 7): each part runs the engine's own kernel on its part (a breadth-first search, weak components, shortest paths, a set propagation) until it finds nothing new, then the parts hand each other only their new border nodes; it ends when no part receives anything new. Exchanges, border entries sent and runs per part are counted. One part (Split::whole: the matrix shared, no border) is one call of today's kernel and no exchange: the engine's reach, weak components and shortest paths now run through these functions with one part.Engine::split(key)runs the graph strata split; a stratum that does not split (recursion over joins, rounds, labelled reach, walks, the other procedures) is refused and runs on one machine. -
Iceberg tables read as they are (new crate
kleene-iceberg, umbrella featureiceberg, off by default): kleene is an in-memory sink of Knut's bifröst (knut-bifrost0.4.0, source-only); bifröst's mapping (MappingSpec, RON or YAML) names the node and edge tables, andIcebergSet::snapshotfills the sameCatalogan X.gar set fills, each table at its current snapshot or at a given snapshot id, so Datalog and GQL run on it unchanged (answers checked equal to the same graph as an X.gar set).kleene gql "<query>" --iceberg <mapping> <warehouse> [--snapshot TABLE=ID]. kleene-gar:column_type, the one typing of a property column, shared by both readers. kleene:gql_set::indexedbuilds the range, name, kind and reach indexes from a catalog alone (an X.gar set's and an Iceberg set's alike). The zstd shim has the stream and*_to_bufferforms parquet, Avro and Iceberg call. -
Kept per snapshot (kleene-iceberg
IcebergSet::keep_in,IcebergSet::files_read): what a table gave at a snapshot is kept per (table, snapshot id) in memory, and on disk in kleene-index'sStore(new:Store::keyed, a directory keyed by a given key whereatkeys it by a set's root hash;Stored::array, a saved column of any type); asked again, no data file is read. -
A run continued from the rows its inputs gained (kleene-plan
Engine::continue_from,Engine::continue_traced,StratumReport::continued; kleene-datalogEngine::continue_from): a stratum nothing of whose reads changed is kept; joins and recursion continue as the engine's semi-naive rounds started from the gained rows; a count adds the counts of its new bindings; a reach searches on from its new frontier; a closure grows by rounds; a stratum that negates or aggregates over a relation that changed, or reads one that lost rows, runs again. Facts and proofs equal a run from scratch (with and without the index choice). Reach proofs now walk back to any lower level (the same proofs for one search). kleene-icebergIcebergSet::advancereads a later version as the data files added since, its graphs grown from the old ones (kleene-sparseCsr::with_entries), the added rows as a catalog (Delta). -
A masked
mxmby dot products where the mask is the cheaper side (kleene-sparseCpuBackend::mxm_by_dots,MXM_DOT_STEP,MXM_TRANSPOSE_STEP): each place the mask allows is a row of A merged with a column of B (B transposed for it), chosen when the transpose and the merge steps (A's side counted over the rows' lengths, B's side again over the columns' own lengths once transposed) cost less than Gustavson's estimated multiply-adds; never under a complement. Measured on dwarf: road2048 maskedA Aby dots 24 ms against Gustavson's 100, but its transpose on one thread costs 176 ms, so on zox-M, rmat12 and road2048 Gustavson stays the choice (their rows unchanged). -
vxm_intowith a full operand pulls over a kept transpose (kleene-sparseCpuWorkspace::kept_transposes): the workspace remembers the matrix the last such call read; a second call on the same matrix (the same buffers) makes its transpose once and every later one folds its columns as rows, densely in place, no atomics; a matrix read once pays no transpose. dwarf, 12 threads, median of three windows, fullvxm: rmat24 or-and 333 -> 57 ms, f64 571 -> 227, min-plus 530 -> 230 (SuiteSparse:GraphBLAS 459, 557, 368); rmat22 or-and 71.7 -> 10.2; road2048 or-and 32.0 -> 6.5 (10.8). -
mxv_intoandvxm_intowith a full operand write the result densely in place (kleene-sparse):mxv_intofolds each row straight into the result's dense values and words of places, blocks cut by entries on 64-row boundaries;vxm_intotakes the result's own dense storage as its accumulator, so nothing is copied out. dwarf, 12 threads, median of three windows: road2048 fullmxvor-and 21.2 -> 5.9 ms, f64 25.1 -> 8.0, min-plus 23.6 -> 12.0 (SuiteSparse:GraphBLAS 4.8, 13.2, 5.6); rmat22 or-and 13.5 -> 6.8 (4.1). -
A graph split into parts by a declared key (kleene-graph
Split,SplitKey,SplitIds,Part,Border,PartSummary; distributed engine v1.0, item 4): a node property (a crate, a region), blocks of ids (vertex types in an id space, regions as id blocks) or a hash as the fallback; made when the graph is loaded, nothing written back. Each part is the sub-matrix of its internal edges in local ids plus its border (the edges out, each with the target's part and id); the ids are one space, a base and a count per part, the part of an id answered from the numbers; every edge lies in exactly one part. -
A proof names the rule as written under the index choice (kleene-plan
Output::why): withEngine::index_choiceon, a fact's proof is built from the run of the rewritten plan and given back in the author's rules and atoms (a label atom or a hand-written index atom the choice replaced by its lookup is again its input or external fact);whyandrendergive the same proof with the choice on and off (before, a proof named the lookup's relations, and rendering it against the plan as written panicked). -
Several aggregates per rule head (kleene-plan
Aggregate::many,Agg::Many,Reduce,ReduceOp,Aggregate::times): count, sum, mean, least and greatest value of one group in one pass, each into its head variable. Each reduction skips its nulls (no implicit IS NOT NULL drops a binding the others need) and the bindings where one of itswhenflags is not 1; a group with no value gets count 0 and null for the others (ahasflag 0); a count with no variable takes each binding whole; of distinct values or weighed by the counts of a counted body (times). kleene-gql lowers a grouped RETURN to one such rule (its rule per aggregate,counted_rows,null_filledand the joining rule are gone). kleene-datalog:Program::aggregatewithAggregate::many; re-exportsReduce,ReduceOp. -
ORDER BY, SKIP, LIMIT as an engine output operator (kleene-plan
Order,OrderKey,Nulls,Output::ordered,Order::apply): keys rising or falling, nulls first, last or by default (last rising, first falling), null also where a flag column is 0; an offset and a limit; ties broken by the whole row. A counted relation's bag is cut after its rows are expanded (a limit counts matches); with no key the reading stops once the offset and the limit are taken (a bag is expanded no further); with keys and a limit only the first rows are sorted. kleene-gql maps ORDER BY / OFFSET / SKIP / LIMIT onto it (its own sort inLowered::shapeis gone; whole values are still read after the cut). kleene-datalog:Output::ordered(&program, &rel, &order)gives typed rows. -
Index choice as a planner pass (kleene-plan
Index,Lookup,Choice,choose_indexes,Inputs::index,Engine::index_choice): an input relation may carry an index (a property's range or name index, a label's id block;Inputs::bindgives each input the catalog's); for one variable,Lookup::choosepicks an id range of blocks, a name lookup, a range lookup (an equality preferred) or a lookup per value of an OR of equalities, andChoice::buildmakes the relation of the ids found, which leads the joins. The engine applies it to every rule (on by default): a Datalog rule that filters an indexed input by constants (young(N) :- person(N), person.age(N, A), A < 30) finds its ids by the index with no index atom written, the label atom dropped; an external atom of constants written by hand (idx(10, 49, N)beside other atoms) is asked once in a relation of its own, so the hand-written rule and the plain one run the same plan at the same cost. kleene-gql maps each node onto aLookupand uses the core's choice (its ownname_lookup,or_lookup,range_index,block_lookupandNameHitsare gone); an OR of equalities on a node with no label is now one lookup per value per holding label too. kleene-datalog:Inputs::index,Engine::index_choice, re-exportIndex. -
The catalog of a set in the core (kleene-plan
Catalog,NameIndex; kleene-garGarGraph::catalog): a set's schema (node labels, edge labels, node and edge properties with their types, id blocks of the one id space, edge aliases, refused columns by name, the indexes that exist) is a core value, read by kleene-gar where a set is opened or filled by hand. Inputs by name:Catalog::relationgives a name's source and column types (L,E,L.k,E.k),Plan::input_fromdeclares an input by name andInputs::bindgives every input the catalog names its source; kleene-datalogProgram::input_from::<N>andInputs::bind, so a Datalog program binds a set's relations and properties by name with no hand binding. kleene-gql's own catalog is gone (kleene_gql::Catalogis the core's, re-exported); kleene'sgql_setkeeps only the indexes it builds over the set (range, name, kinds, reach). kleene-gar exportsvalue_codeandunsigned_value(a column value as the plan's code). -
The pilot's
pilot-macro-tiecheck (kleene::pilot::tie_verdict) compares what its rules decide: every tie of the rules must be the merge's, and a row of the merge's they lack passes only on a node the tree pass leaves with two or more candidates, the merge's pick among them (the merge's ordinal stages go past the tree). On zox-hh the one such row (a nested use treea::{*, b::*}'sb::*) made the row DIFFERENT on every binary.
0.2.0 (tagged 2026-11-29, not published)
What landed after the tag v0.1.0. It was never published to crates.io.
-
Maximum flow (kleene-graph
max_flow,MaxFlow): Dinic's algorithm, each level search's frontiers on the CPU device's workers, blocking flows by depth-first paths with current arcs on one thread; unsigned capacities (no values: 1 each), parallel arcs their own, self-loops and zero capacities carry nothing; the value (u128), the flow on every entry and the source's side of a minimum cut. kleene-planProcedure::MaxFlow; GQLCALL maxflow(EdgeLabel, source, target [, capacityKey]) YIELD flow(alsomaxFlow,maximumFlow);kleene benchmarkrowmaxflow(a plain one-thread Dinic as the reference; LAGraph'smaxflow_demo, push-relabel, in its column). The arguments ofmsfandmaxfloware read and checked in kleene-plan (Procedure::from_args;Procedure::property_argnames the argument a client maps to an edge property's relation,ProcArg::Values), their types byPlan::procedure(weights unsigned or float, capacities unsigned, the source not the target) and the yielded columns' types byPlan::procedure_types; kleene-gql maps the names and the property (typed byCatalog::edge_property_type, so float weights reach the spanning forest). -
CPU thresholds by GPU kind (kleene-cubecl):
CpuBelow's default follows the adapter's kind (CpuBelow::for_kind): an integrated GPU runs every whole algorithm on the CPU but the source sets, those from 2000000 edges (CpuBelow::INTEGRATED, measured on a Radeon 660M and an Intel UHD); every other kind keeps the crossovers measured on one RTX 5080.set_cpu_belowandKLEENE_GPU_CPU_BELOW_EDGESstill override.kind()andcpu_below()look the adapter up without opening it. -
GPU PageRank on AMD (kleene-cubecl): on RADV (AMD's Vulkan driver) PageRank on a skewed graph stopped after one round with wrong scores (each row's old score read back as its new one, so the change was 0); the old score is now read before the row is summed. The GPU tests now include graphs skewed both ways (the renumbered path).
-
GPU adapter kind (kleene-cubecl, kleene):
GpuKind(discrete, integrated, virtual, other, software) andGpuDevice::kind;GpuDevice::with_cpu_onopens the first adapter of a kind (Nonewhen the machine has none). The device is asked for by kind (CubeCL's properties say only whether a device is a card),CUBECL_WGPU_DEFAULT_DEVICEstill names one. The GPU tests print the adapter and its kind and fail on a software device (Vulkan on the CPU, such as llvmpipe) unlessKLEENE_GPU_SOFTWARE=1;kleene benchmarkkeeps the kind beside the GPU's name (host line,gpu_kindin the JSON) and writes no GPU column on a software device unless--gpu-software(kleene gpulikewise refuses it). -
PageRank on the GPU (kleene-cubecl, kleene-graph):
GraphBackend::pagerank_ofandkleene_graph::pagerank_ofrun PageRank through a backend (the default: the CPU kernel on the backend's CPU device); the GPU backend keeps GAP's rounds on the GPU (f32scores, short rows a unit each, long rows 32 or 256 units, shares renumbered by falling degree on skewed graphs, the change summed inf64where the GPU has it, one number read a round), same rounds as the CPU, scores withinPAGERANK_L1(1e-4, L1) of it; belowCpuBelow.pagerank(131072 edges) it runs on the CPU. The benchmark's pagerank row gets its GPU column.GpuDevice::namenow names the adapter too. -
Minimum spanning forest (kleene-graph
spanning_forest,SpanningForest,ForestWeight): Borůvka's rounds on the CPU device's workers (lightest edge out of each component by atomic minima of weight then entry place, so one forest whatever the workers; pairs broken by the lower root; hooks followed with path halving), edges taken both ways, unsigned, signed and float weights (NaN refused), the edges, their total and the trees. kleene-planProcedure::SpanningForest(Procedure::weights); GQLCALL msf(EdgeLabel [, weightKey]) YIELD source, target, weight(alsomst,spanningForest,minimumSpanningTree;sourceandtargetbind nodes, sosum(weight)is the total);kleene benchmarkrowmsf(Kruskal as the plain reference; LAGraph'smsf_demoin its column).GraphError::WeightsandGraphError::Floware new. -
Benchmark (kleene): raw matrix operations against SuiteSparse:GraphBLAS alone (no LAGraph): rows
mxv-*/vxm-*(or-and, plus-timesf64, min-plusu32; dense and sparse operands) andmxm-a2/mxm-a2-masked, run when--kernelsnames them (ops: all), checked by a checksum against plain loops;--graphblas PROGRAMruns an external GraphBLAS driver for their column on a.kxcsrfile of the graph. Every cell keeps its trials (Cell::trials,Cell::best;trials_msandbest_msin the JSON). -
Sparse products (kleene-sparse):
Semiring::terminal(default none; or-and's true, a full bitset):mxvstops a row's fold there, and with a full operand reads no places;mxmcuts its rows into pieces of equal multiply-adds (also below the row grain) and keeps one accumulator per worker instead of one per piece. Measured on dwarf (12 threads): rmat12A²45.2 -> 6.6 ms, road2048 maskedA²327 -> 148 ms, rmat22 or-andmxv31.0 -> 15.1 ms, min-plusmxv90.6 -> 40.3 ms.CpuBackend::mxm_plan(MxmPlan) says how a product is split: belowCpuBackend::MXM_SERIAL_BELOWestimated multiply-adds (4096, measured) it stays on the calling thread; above, eight pieces a worker of about equal entries of A, with no pass over the rows to plan (the exact count of multiply-adds had cost a serial pass: zox-M maskedA²0.45 -> 0.97 ms afterd6c1763). Skip reasons of many lines are one cell on the page (benchmark::one_line). -
Edge-property ends shifted at read (kleene-plan, kleene):
Source::ColumnsAtadds each column's base when a run reads the relation;kleene gqlno longer copies a typed edge property's destination column at open when the destination type's base is not 0 (on a 20000000-edge set: open 17 % slower and 70 MB more peak memory before, now equal to base 0). -
id(n)lookups with no scan in one id space (kleene-plan, kleene-gql, kleene; a regression of the one id space):IdRanges(kleene-plan) lists the ids of an id space's types in some intervals from the numbers alone;Catalog::id_blocknames a label's ids as a block (kleene gqlgives each vertex type's), andMATCH (n) WHERE id(n) = $id, a range or an OR of ids reads no label. -
Set order and union counts (kleene-gar, kleene-gql, kleene; fix): a set's vertex types (and so its id space) are in the order its
<name>.graph.ymllists them, not by name (the rmat sets numberedentrybeforev); an edge either way or of label alternatives is a match per label and per way (count(*)read each pair once), in a step and in a bounded walk;Catalog::edge_alias(kleene gqlnames an edge type by its edge and its table name) keeps-->from reading one edge type twice. -
Kind labels and unlabelled nodes (kleene-gql, kleene):
Catalog::sub_label(a label of some of another label's nodes;kleene gqldeclares each kind label of its type): its nodes have the type's properties (MATCH (f:func_kind_1) RETURN f.namewas refused),labels(n)of a node found by its table lists its kind labels, and a node of any label scans no kind label. A node with no label in a catalog of one id space is found by the range or name index of every label holding the key; at an edge's end it reads a property two labels hold (it was refused there). -
Whole values in more places (kleene-gql): a node passed on by a
WITHor yielded by a procedure comes back whole (kleene gqlprints a procedure's nodes whole); whole edges in aUNION(one row per edge, not per from node), as group keys with aggregates,count(DISTINCT r), and with OPTIONAL MATCH (null where it finds none;count(r)of an OPTIONAL MATCH edge is 0 there, it counted the row before);relationships(p)of a shortest path.labels(n),type(r)andproperties(x)with aggregates are now refused by name (they grouped by the node or edge, one row per node, not per value). -
One id space over a set's vertex types (kleene-gar, kleene-plan; fix): rows of two vertex types share their numbers, and
kleene gqlmatched them as one node where two types met (an edge either way between two types, a union of edge labels with other ends, a walk or shortest path through two types, label alternatives, two nodes compared, aUNION).IdSpace(GarGraph::id_space,GarGraph::vertex_ids) numbers a set's types one after the other;Source::GraphAt/Inputs::graph_atread an edge type's shared adjacency in that space by its ends' bases (a walk over one type numbers its vertices from the base, a procedure hands ids);Shiftedputs an external over a type's rows into it.kleene gqlnow reads a set in one id space: a node's value is itsid(n)(procedures' nodes too). kleene-gql refuses those shapes by name in a catalog of vertex tables (Catalog::vertex_table), where a node is its row. -
GQL (kleene-gql): Cypher read queries in more shapes.
- One row per match, the standard's default (was: each distinct row once): every node and edge of a pattern, anonymous ones too, so middle nodes, parallel edges (
Catalog::edge_counts) and the walks of a bounded length (*5..5,*1..3: counted byPlan::walk_counted, never listed) each make a row;count(*)/count(x)count matches,sum/avgweigh by them; WITH, UNWIND and OPTIONAL MATCH carry the counts. The matches are a counted relation, expanded only at the output.RETURN DISTINCT,count(DISTINCT x)andlower_rows(.., Rows::Distinct)/kleene gql --distinct-rowsgive the distinct rows. Unbounded lengths stay one row per pair of ends; an edge may be used twice in one match (Cypher: never), stated in the lib.rs table. Three tests changed for it (two givenDISTINCT, one now expecting a repeated UNWIND item twice). WITHbetween parts: names, aliased values,DISTINCT, aggregates,ORDER BY/SKIP/LIMITand aWHEREafter it;shortestPath(...) AS pas an item.CALL { [WITH a] MATCH ... RETURN ... }subqueries per outer row; a subquery of aggregates alone gives a row for every outer row (a count of none is 0).UNWIND [v, ...] AS x/UNWIND $list AS x(--param name=[a, b],Param::List), and arithmetic+ - * / %inWHERE,RETURNandUNWIND(integers asi64, a float side asf64; null for a null side, a division by zero or an overflow).- An OR of equalities on an indexed property is one index lookup per value, no scan;
all(x IN list WHERE ...)and the other list predicates are refused by name. id(n)inWHERE,RETURNandORDER BY: a node's row plus its vertex table's base (Catalog::vertex_table,Catalog::id_base;kleene gqlnumbers a set's vertex types one after the other), so ids of two tables never collide; an equality or range onid(n)lists the rows from the numbers (no scan).MATCH (n)andMATCH (n {key: v})with no label: any row of any vertex table (or any node of any label in a catalog of one id space), a property read from the tables that have it. A node with no label at an edge end takes the table the edge label names (Catalog::edge_ends).id(r)of an edge is refused by name (an edge is a pair of nodes, with no id).- Typed edge properties (
Catalog::typed_edge_property,Catalog::edge_property_type): signed, float, boolean and string values with nulls inWHERE,RETURN,ORDER BYand aggregates; a set's edge properties read by their Arrow type (kleene-gar reads a property the mapped reader does not take from its IPC chunk), others refused by name. Aggregates skip a null value (count(x)0 for a group with none, the others null). - Counts over matches that differ only in a value that may be null (two values, or a value and a null) count each match: the counted rows carry each such value with a null flag, so a null stays apart from every value.
count(r)of an edge counts its matches. - Whole values in
RETURN:RETURN nis the node (Entity::Node:id(n), labels, every property typed, nulls null),RETURN rthe edge (Entity::Edge: label, both ends' ids, properties);labels(n),type(r),properties(x),relationships(p);nodes(p)gives the nodes' ids. InTable::entities/TypedTable::entities(Table::entity) and printed bykleene gql; read afterLIMITby a second plan over the returned values only. - Predicates over the edges of a variable-length path:
all(x IN r WHERE c), the short formr.w >= $minandnone(...)filter the edges before the walk;any(...)andsingle(...)over*/+as a pattern with one passing edge in the middle.
- One row per match, the standard's default (was: each distinct row once): every node and edge of a pattern, anonymous ones too, so middle nodes, parallel edges (
-
Plan (kleene-plan):
Arith, arithmetic(a, b, a op b)as an external relation; a variable read only by external atoms keeps its nulls. -
Counts (kleene-plan, kleene-graph, kleene-datalog): counted relations (
Plan::derived_counted,Plan::input_counted,Plan::is_counted): a count per row as the last column.Plan::count_rule: a row's count is the number of the body's distinct bindings that give it, times the counts of the counted body atoms; rules of one relation add up (FoldOp::Count,Fold::times).Plan::walk_counted: the number of walks of a bounded length per (start, end) or per end, over two-column edges or counted (parallel) edges, one plus-times step per edge (kleene_graph::walk_counts,GraphError::Counts); unbounded lengths refused.Output::expandgives the bag. Datalog:Program::derived_counted,input_counted,count_rule(a count of derivations in the head),Output::expand. Plans without counted relations are unchanged. -
Harmonic centrality (kleene-graph
harmonic): exact, for every vertex the sum of 1 / hops over the vertices it reaches (along in-edges: the matrix and its transpose swapped), a breadth-first search from every vertex, 64 at once (a bit a source in each vertex's frontier and seen words; small levels pushed, large ones pulled), bit for bit a plain search from each vertex at any worker count;CALL harmonic(E)in GQL (Procedure::Harmonic; node, score);kleene benchmarkrowharmonicon graphs up toConfig::harmonic_max_vertices(65536; LAGraph has no harmonic centrality). -
k-truss (kleene-graph
ktruss,truss_numbers): on the undirected graph, the largest subgraph whose every edge sits in at leastk - 2of its triangles, each kept edge valued by its support there; the supports from every triangle found once (bit sets per worker), then rounds peeling the edges belowk - 2(a triangle broken by two edges of one round counted down once);truss_numbersgoes on peeling with k one higher until no edge is left.CALL ktruss(E, k)in GQL (Procedure::KTruss; source, target, support, both nodes);kleene benchmarkrowktruss(k 4; LAGraph'skt_demotimes no trial, so no LAGraph cell). -
Maximal independent set (kleene-graph
mis,mis_priority): on the undirected graph, fixed priorities from a seed (splitmix64, ties by vertex), rounds in which every undecided vertex above all its undecided neighbours joins and its neighbours leave (Blelloch, Fineman and Shun's deterministic Luby): the greedy set by falling priority, the same at any worker count and for the same seed.CALL mis(E [, seed])in GQL (Procedure::Mis; node);kleene benchmarkrowmis(seed 1) beside LAGraph'smis_demo(its own Luby rounds, each trial checked byLG_check_mis). -
Enums that grow are
#[non_exhaustive], so a new variant is not a breaking change: kleene-planProcedure,Stratum,Datum,Cond,TextOp,Agg,FoldOp,Literal,ArithOp,How,Source,Column; kleene-graphShortest; kleene-gql's ASTCallArg,Condition,Selector,Operand,ReturnValue,AggFn,UnwindListandParam; kleene-sparseSimdLevel. A match on them outside their crate needs a_arm. Left exhaustive: kleene-planType(kleene-gql matches every kind to build its columns, so a new kind must stop the build there), and the closed ones (Term,Cmp,RelKind,Way,Part, kleene-graphSide,Direction,Place,Relabel, kleene-gqlDir,CmpOp). -
Harmonic centrality estimated (kleene-graph
harmonic_estimate,HyperBallOptions,HarmonicEstimate): HyperBall, a HyperLogLog counter per vertex (2^b registers, b 4 to 16, default 7; fixed seed), each round the register-wise maximum over the out-neighbours' counters that changed, each score adding the growth of its ball's estimate over the distance; the same answer at any worker count; tested within two standard errors of a counter (2 * 1.04 / sqrt(2^b)) of the exact scores. On oden: rmat22 (4194304 vertices) in 0.65 s and 2.2 GB peak, rmat16 in 13 ms against 7.6 s exact (mean relative error 0.7 %).Procedure::Harmonic { mode: HarmonicMode }(Auto: exact up toHARMONIC_EXACT_MAX= 65536 vertices, estimated above;Exact;Estimate { log2_registers }); GQLharmonic(E [, auto | exact | estimate [, log2Registers]]);kleene benchmarkrowharmonic-hb, checked against exact up to the exact limit. -
Exact harmonic centrality runs its batches side by side (each worker its own three words a vertex while they fit in 1 GiB; above, one batch at a time with its levels split as before): no worker waits on another inside a search. On oden at 32 threads: rmat12 54 ms to 5 ms, rmat14 678 ms to 40 ms, rmat16 7.6 s to 0.43 s.
-
Truss numbers in GQL (kleene-plan
Procedure::TrussNumbers, kindtrussnumbersofProcedure::from_args):CALL trussNumbers(E)(trussNumber,truss_numbers,trussDecomposition) yields (source, target, truss), every edge once, source below target, the largest k whose k-truss holds it (kleene-graphtruss_numbers).
0.1.0 (tagged 2026-11-28, not published)
What the tag v0.1.0 held. It was never published to crates.io.
-
Errors:
SparseError,GraphError,PlanError(DatalogError),IndexErrorandGqlErrorare#[non_exhaustive], so a new variant is not a breaking change. -
Engine (kleene-sparse): CSR/CSC matrices, vectors and masks over semirings (
BoolOrAnd,MinPlus,PlusTimes,BitsetUnion) on Arrow buffers with no copy, behind theSparseBackendtrait; the CPU backend runs on parked workers with in-place products, SIMD word kernels and no allocation per step, and takes an outside executor (gatling). -
Graph kernels (kleene-graph): direction-optimizing BFS with masks, propagation, delta-stepping shortest paths (bucket fusion on the CPU), source sets and labelled-edge reach, closure, weak components (FastSV; Afforest on the CPU), strong components (Multistep on the CPU), PageRank, betweenness (Brandes) and triangle counting, all written against the backend trait;
GraphBackendlets a backend run a whole algorithm.- PageRank in one pass a round over pieces cut by edges (shares kept by falling degree on skewed graphs, bit for bit the same); betweenness four sources at a time (depths a byte per source, Beamer pull on big levels, one source at a time on deep graphs; a level bitmap ahead of the depth reads, (1 + δ) / σ kept in the path count's place and the dependencies added to the scores in the backward pass, 32 bytes a vertex); triangles with a bit set per worker and vertices taken in chunks from a shared counter.
- Graphalytics' label propagation (
cdlp: the smallest of the most frequent labels, synchronous rounds up to a limit, stopping when a round changes nothing) and local clustering coefficient (lcc, directed: each triangle found once and its edge counts given to its three vertices), withkleene benchmarkrowscdlpandlccbeside LAGraph'scdlp_demoandlcc_demo.
-
Plan and Datalog (kleene-plan, kleene-datalog): relations and rules as values, stratified planning (reach as BFS, closure as masked products, labelled reach as one bitmask walk, the rest as column kernels), semi-naive evaluation, stratified negation, aggregates, 64-bit values and comparisons, external relations, count and negation inside recursion as inflationary rounds, and the why of every fact; typed Datalog rules in Rust on top, written with the builder or as text with the
datalog!macro (kleene-datalog-macros), turned into the builder's calls at build time.- Typed values: strings, signed integers, floats, booleans and nulls per relation column (
Plan::input_typed,Program::input_typed,Type), as order-preservingu64codes (strings as ids of a per-run dictionary sorted by their bytes), so every kernel stays au64kernel; Arrow string, integer, float and boolean columns in,Output::arrowout; rules typed when added (mixed types refused); a comparison or join with null is not true;IS NULL/IS NOT NULL; typed proofs. - Folds
sumandavg(Plan::fold,Program::fold,Fold) over u64, i64 and f64, stratified like the aggregates; integer sums that leave their type refused. - String tests
STARTS WITH(one range of dictionary ids),ENDS WITH,CONTAINS(a set of ids found once over the dictionary),Cond::Text. - Graph strata (reach, closure, walks, labelled reach) number their vertices by the ids that occur when the ids are far apart (one past the largest above four per id read plus 65536, or past
u32): a root sentinel atu32::MAXor typed codes pastu32no longer size a matrix by the largest id; answers and proofs keep the original ids.StratumReport::renumberedsays when. A procedure (one row per vertex below the largest id) on ids that far apart is refused by name. - The column kernels (probes, joins, distinct rows, sorts, the typed dictionary) run on the parked workers of the engine's CPU device: a call starts no thread (gatling's fork-join and sort started up to one a core on every call); a one-thread device runs one piece.
- Typed values: strings, signed integers, floats, booleans and nulls per relation column (
-
X.gar tables (kleene-gar): graphar integer graphs as DataFusion tables and adjacency buffers, read in place from their mapped Arrow files.
-
Index (kleene-index): static indexes kept beside a set by its root hash: address lookups on a static search tree, reachability (condensation and 2-hop labels), reverse reach, groups, why chains, nesting and intervals; name to id as a minimal perfect hash over a string column (after PtrHash, each hit checked against the string; a lookup is one folded-multiply hash, one pilot and one 16-byte slot holding the row and where its bytes lie, faster than a std hash map over the same column), and a bitmap per node kind.
-
GQL (kleene-gql): ISO GQL read queries (
MATCH,WHERE, quantified edges as graph walks,RETURN DISTINCT,LIMIT) lowered onto the plan.kleene gql "<query>" <X.gar> [--param name=value]: a query on a set from the command line, its vertex and edge types as labels, the rows as a table;$nameparameters.- Bounded path lengths
{m,n},{n},{m,},{,n}, Cypher*m..n,*n(GQL's WALK mode, one match per pair of ends), run as frontier steps on the graph core (Plan::walk,kleene_graph::walk_ends/walk_pairs). WHEREwithOR,NOT,XOR,IN (...)/IN [...]and brackets, in GQL's three-valued logic; lowered as a few rules per sub-condition, never a disjunctive form.- Typed literals and properties: strings (GQL's escapes), negative and float numbers,
TRUE/FALSE/NULL,IS [NOT] NULL,STARTS WITH/ENDS WITH/CONTAINS(decided once per distinct string);Catalog::typed_property,Lowered::run_typed. ORDER BY ... [ASC | DESC],OFFSET/SKIPandLIMIT.- Edges either way (
-[:T]-), with no label (-[]->,->,-->), label alternatives:A|Bon nodes and edges, edge properties inWHERE,RETURNandORDER BY(Catalog::edge_property;kleene gqlreads a set's unsigned edge properties). - Aggregates in
RETURN:count(*),count(x),count(DISTINCT x),min,max, grouped by the other items;sum/avg(alsoDISTINCT) on kleene-plan's folds, an average or a float sum as a float column. - Path variables:
p = ...withnodes(p)/length(p);ANY SHORTEST,ALL SHORTEST(CyphershortestPath,allShortestPaths) on the newkleene_plan::Plan::shortestandkleene_graph::shortest_paths(BFS levels, parents read back);Tablegains list columns. CALLprocedures on kleene-graph kernels:pagerank,wcc,scc,sssp/bfs,betweenness,triangleCount(GDS andalgo.spellings),YIELD ... [WHERE ...], thenMATCHon the yielded node; newkleene_plan::Plan::procedure(Procedure,Call,Stratum::Procedure) andkleene_graph::GraphBackend::cpu; float columns inTable.- Index lookups chosen by the plan:
Catalog::property_index(constant bounds on a node of one label: one range lookup, not a label scan) andCatalog::reach_index(*/+between pinned ends, no search);Lowered::explain,kleene gql --explain. The umbrella crate'srelations::RangeRelandLazyReachRel(kleene-index'sReach) back them inkleene gql, built at the first lookup. - The common lookups through indexes: node property maps
(f:Fn {name: "main"});Catalog::name_index(NameIndex) for string equalities andINlists, signed and float bounds through the range index on their codes,Catalog::kinds_index/kind_labelfor labels andA|B(a lookup per kind).kleene gqlgives each string column (a set'sBinarystring table as UTF-8) a string property with aNameRowsRel(kleene-index'sNames, then each name's rows) and eachkindcolumn labelsT_kind_kover aKindsRel(kleene-index'sKinds). OPTIONAL MATCH(after the MATCH clauses; nulls inTable::nullsandDatum::Null,count(x)of its values) andUNION/UNION ALL.- Typed columns of a set:
kleene gqlreads signed integer (Int8..Int64), float (Float32,Float64),Booleanand string columns by their Arrow type, a null slot as null (IS NULLtrue, in no range), signed and float bounds through the range index on their codes, the returned values printed by type (Lowered::returns_typed,run_typed); a column of another type, an unsigned column with nulls and an edge property that is not unsigned are refused by name and type where a query reads them (Catalog::refused_property,refused_edge_property). kleene-gar'sGarGraph::vertex_columnreads a chunk the mapped reader refuses (nulls, other types) from its Arrow IPC file (arrow-ipc, already in the tree). - Several
OPTIONAL MATCHclauses in one query (each extends the rows so far; a clause on a null value of an earlier one does not match), andmin/max/sum/avgof their values (nulls skipped; null for a group with none).
-
GPU backend (kleene-cubecl): the sparse backend and whole algorithms (components, strong components, shortest paths, source sets) on CubeCL's wgpu runtime, Vulkan elsewhere and Metal on macOS.
- The device's matrix cache puts out only parts nothing else holds, so a graph over its budget is uploaded once while a search holds it, and narrowed weights are looked up before they are scanned (rmat26 on an RTX 5080: CC, SCC, weighted SSSP and Datalog reach no longer upload the graph again each call);
GpuDevice::uploaded_bytes,cache_budget,set_cache_budget. - Whole algorithms on graphs below a measured edge count run on the CPU backend's own (weak components 131072, strong components 1048576, shortest paths 2000000, source sets 262144: the RTX 5080 crossovers), where a GPU launch costs more than the CPU's answer;
CpuBelow,GpuDevice::cpu_below,set_cpu_below,KLEENE_GPU_CPU_BELOW_EDGES.
- The device's matrix cache puts out only parts nothing else holds, so a graph over its budget is uploaded once while a search holds it, and narrowed weights are looked up before they are scanned (rmat26 on an RTX 5080: CC, SCC, weighted SSSP and Datalog reach no longer upload the graph again each call);
-
Benchmark (kleene):
kleene benchmark, a fixed suite against SuiteSparse:GraphBLAS + LAGraph and PuppyGraph's plans on R-MAT and road graphs; results in BENCH.md.--lagraph-limit MINUTESgives a LAGraph program more wall time than 10 minutes.