For contributors — how XLOG’s GPU execution works internally.
The host executor walks the RIR plan and dispatches one kernel family per operator; relations stay in the device-resident store, which feeds the next operator or fixpoint round (one iteration of the recursive loop, repeated until no new rows appear).
Host Control, Device Data
The split is deliberate: the CPU decides what to run, the GPU holds the data and does the work.xlog-runtime::Executor runs on the host and manages:
- relation names, relation IDs, generations, and schemas;
- a
RelationStorebacked byCudaBuffervalues; - runtime statistics and join-selectivity observations;
- persistent build-side join indexes;
- dispatch counters for optimized routes (per-route counters that record when a specialized kernel actually ran — see What To Verify);
- recursive SCC state for seed, delta, and merge phases. A SCC (strongly connected component) is a group of rules that depend on each other recursively; the runtime evaluates each such group in seed, delta, and merge phases.
xlog-cuda::CudaKernelProvider owns the device-facing operations. It loads CUDA
artifacts, allocates tracked slices, launches kernels, and records transfer
telemetry where a path needs a no-host-transfer assertion.
So the executor itself is not GPU-resident. The relation state and the kernel
workspaces are.
RIR Evaluation
The executor turns each RIR plan operator into GPU work that writes a relation buffer:
“Semi-naive” here means each recursive round processes only the rows newly
derived in the previous round, not the whole relation again.
The correctness rule is row-set parity: an optimized path must return exactly
the same rows as the ordinary route. An optimized path is allowed to decline —
fall back to the ordinary route — when a shape, width, budget, or gate does not
match.
Predicate And Arithmetic Masks
A filter does not delete rows in place. It lowers into a mask pipeline that marks which rows survive, then compacts them:- Arithmetic expression kernels produce temporary columns.
- Typed comparison kernels produce boolean masks (one bit per row: keep or drop).
- Boolean mask kernels combine predicates with
and,or, andnot. - Stream compaction writes the filtered output buffer.
Joins And Recursion
The ordinary join is always the baseline path. For certain rule shapes the runtime can route to a faster specialized kernel instead:- hash joins for normal binary joins;
- nested-loop joins for small eligible products;
- WCOJ for recognized triangle, 4-cycle, and clique shapes;
- Free Join for broader multiway bodies;
- factorized recursive-delta routing for recursive rules (a compressed representation of the per-round delta).
Ingestion And Diagnostics
Two runtime surfaces sit next to the core evaluation loop rather than inside it: bulk graph loading and delta diagnostics.xlog_gpu::biokg::StreamingGraphRelationLoaderstreams JSONL, CSV, and N-Triples graph rows into typed edge records, with bounded-memory telemetry.DeltaPlannerTelemetryreports cache reuse, fallback decisions, affected SCCs, recomputed SCCs, and estimated versus measured delta behavior.pyxlogexposes planner telemetry through diagnostic result payloads.
What To Verify
A matching final result does not prove that an optimized GPU route ran — the fallback route returns the same rows. To prove a workload used the intended GPU path, check:- the route counter for the optimized dispatch (was it greater than zero?);
- kill-switch parity: disable the optimized route and confirm the fallback returns the same rows;
- transfer telemetry, for any no-host-transfer claim;
- CUDA-required validation, when the claim depends on actual GPU execution.