vendor/cozo-rayonfree/Cargo.toml
# cozo-rayonfree — CozoDB 0.7.6 with rayon REMOVED. Not disabled, not gated. Gone.
#
# Vendored, patched fork of upstream `cozo` 0.7.6 (crates.io checksum
# 3a0e07500b27e8f77ebcb6eac4c9a76a173f960da42e843fd13cd8f74178e3f8). This manifest
# began as the cargo-normalized Cargo.toml from that published tarball;
# `Cargo.toml.orig` is upstream's hand-written original, kept for provenance.
#
# WHY THIS FORK EXISTS
#
# ROOT LAW #0: the constellation carries no rayon; `gatling` is the one sanctioned
# parallel engine. Upstream cozo 0.7.6 cannot be built rayon-free, because it
# declares `rayon` OPTIONAL but uses it UNCONDITIONALLY:
#
# error[E0433]: cannot find module or crate `rayon`
# --> src/lib.rs:511:9 rayon::spawn(move || db.run_multi_transaction(..))
# error[E0599]: no method named `par_iter` found for reference
# `&BTreeMap<MagicSymbol, CompiledRuleSet>`
# --> src/query/eval.rs:200:26 (and :275:26)
#
# So `default-features = false` does not compile, and the only configuration that
# DOES (`graph-algo`) is precisely the one that turns rayon on. That mismatch is an
# upstream bug, and the answer is to fix it at the source rather than route around it.
#
# WHAT CHANGED (complete; every source site carries a `FORK (cozo-rayonfree)` comment)
#
# 1. src/query/eval.rs x2 — `prog.par_iter()` -> `prog.iter()`. Upstream already
# ships this exact serial loop behind `cfg(target_arch = "wasm32")`.
# MEASURED, not assumed (2026-08-01, oden): serial p50 ~63.4 ms vs upstream's
# rayon ~66.2 ms vs gatling ~76.0 ms, on a 15,000-node / 44,850-edge graph with
# a 300-deep recursive min-hop query, 31 reps x 3 interleaved rounds, identical
# result fingerprints verified first. The fan-out width is N=1 in 15,764 of
# 16,065 calls, so rayon was paying pool overhead to parallelise a single item.
# Full note in that file.
# 2. src/lib.rs — `rayon::spawn` -> `std::thread::spawn`. One fire-and-forget
# blocking task, not a fan-out; upstream already does this on wasm32.
# 3. `graph-algo`, `src/fixed_rule/algos/` and the `graph` + `rayon` dependencies
# DELETED, along with the unused optional storage backends. See the note above
# the features table for what that costs and why it was unavoidable.
# 4. `benches/` deleted (rayon-soaked, and not part of the library).
#
# ACCEPTANCE: `cargo tree -p nornir-graph --all-features -i rayon` finds nothing.
# `crates/nornir-graph/tests/rayon_free_law.rs` re-takes that measurement.
#
# HOW THIS FORK GETS RETIRED
#
# The day upstream fixes the optional/unconditional mismatch — gating `rayon::spawn`
# and the two `par_iter` sites behind `#[cfg(feature = "rayon")]` with the serial
# fallback they already have for wasm — delete this directory, drop it from the
# workspace members, and nornir-graph's dependency becomes a plain
# `cozo = { version = "0.7", optional = true, default-features = false }`.
# Upstream: https://github.com/cozodb/cozo — 0.7.6 declares
# `rayon = { version = "1.5.3", optional = true }` and then uses it regardless.
#
# NAMING follows the house precedent of `skade/vendor/iceberg-arrow59`: the PACKAGE
# is renamed so it can hold a unique crates.io identity, while the LIB name stays
# `cozo` so consumers keep writing `use cozo::..` and there is no `[patch.crates-io]`
# block for crates.io to strip on publish.
#
# LICENSE: MPL-2.0, unchanged. Modified files keep upstream's MPL header; the
# modifications are released under the same licence.
[package]
edition = "2021"
name = "cozo-rayonfree"
version = "0.7.6"
authors = ["Ziyang Hu"]
exclude = [
"tests/*",
"Cargo.toml.orig",
".cargo_vcs_info.json",
]
description = "CozoDB 0.7.6 with rayon removed at the source: a transactional Datalog database with a rayon-free evaluator (measured faster than upstream's rayon fan-out, which runs at N=1). Drop-in `cozo` library; a stopgap until upstream gates its own unconditional rayon use."
homepage = "https://www.cozodb.org"
documentation = "https://docs.cozodb.org"
readme = "README.md"
license = "MPL-2.0"
repository = "https://git.gunnar.rs/nordisk/edda"
[lints.rust]
# The deleted backend features leave their `#[cfg(feature = "..")]` gates behind as
# permanently-false cfgs. That is deliberate — it keeps the diff against upstream
# small and the code trivially restorable — so silence the lint rather than edit
# ~40 call sites in vendored source.
unexpected_cfgs = "allow"
# The library is still named `cozo`, so downstreams `use cozo::..` unchanged and every
# `crate::` path inside the vendored source keeps working.
[lib]
name = "cozo"
path = "src/lib.rs"
[dependencies.aho-corasick]
version = "1.0.1"
[dependencies.approx]
version = "0.5.1"
[dependencies.base64]
version = "0.21.0"
[dependencies.byteorder]
version = "1.4.3"
[dependencies.casey]
version = "0.4.0"
[dependencies.chrono]
version = "0.4.19"
[dependencies.chrono-tz]
version = "0.8.0"
[dependencies.crossbeam]
version = "0.8.2"
[dependencies.csv]
version = "1.1.6"
[dependencies.document-features]
version = "0.2.6"
[dependencies.either]
version = "1.7.0"
[dependencies.env_logger]
version = "0.10.0"
[dependencies.fast2s]
version = "0.3.1"
[dependencies.itertools]
version = "0.12.0"
[dependencies.jieba-rs]
version = "0.6.7"
[dependencies.lazy_static]
version = "1.4.0"
[dependencies.log]
version = "0.4.17"
[dependencies.miette]
version = "5.5.0"
features = ["fancy"]
[dependencies.ndarray]
version = "0.15.6"
features = ["serde"]
[dependencies.num-traits]
version = "0.2.15"
[dependencies.ordered-float]
version = "4.1.1"
[dependencies.pest]
version = "2.2.1"
[dependencies.pest_derive]
version = "2.2.1"
[dependencies.priority-queue]
version = "1.2.3"
[dependencies.quadrature]
version = "0.1.2"
[dependencies.rand]
version = "0.8.5"
[dependencies.regex]
version = "1.6.0"
[dependencies.rmp]
version = "0.8.11"
[dependencies.rmp-serde]
version = "1.1.0"
[dependencies.rmpv]
version = "1.0.0"
[dependencies.rust-stemmers]
version = "1.2.0"
[dependencies.rustc-hash]
version = "1.1.0"
[dependencies.serde]
version = "1.0.137"
[dependencies.serde_bytes]
version = "0.11.7"
[dependencies.serde_derive]
version = "1.0.137"
[dependencies.serde_json]
version = "1.0.81"
[dependencies.sha2]
version = "0.10.6"
[dependencies.smallvec]
version = "1.8.1"
features = [
"serde",
"write",
"union",
"const_generics",
"const_new",
]
[dependencies.smartstring]
version = "1.0.1"
features = ["serde"]
[dependencies.swapvec]
version = "0.3.0"
[dependencies.thiserror]
version = "1.0.34"
[dependencies.twox-hash]
version = "1.6.3"
[dependencies.unicode-normalization]
version = "0.1.21"
[dependencies.uuid]
version = "1.1.2"
features = [
"v1",
"v4",
"serde",
]
[features]
# FORK (cozo-rayonfree): `graph-algo` is deleted, and so is every optional-BACKEND
# feature — `compact`, `minimal`, `requests`, `storage-sqlite{,-src}`,
# `storage-rocksdb`, `storage-sled`, `storage-tikv`, `jemalloc`, `io-uring`, `wasm`.
#
# Two reasons, and the first is the one that matters:
#
# 1. `graph-algo` HAD to go. It existed to enable the `graph` crate and `rayon`,
# and `graph` 0.3 / `graph_builder` declare rayon as a HARD, non-optional
# dependency. There was no "keep the feature, drop rayon" available. Gone with
# it: cozo's ~22 built-in graph fixed rules (PageRank, ShortestPathDijkstra,
# ShortestPathBFS, ShortestPathAStar, KShortestPathYen,
# CommunityDetectionLouvain, LabelPropagation, SCC/ConnectedComponents, BFS/DFS,
# TopSort, MinimumSpanningTree{Prim,Kruskal}, Betweenness/Closeness/Degree
# centrality, ClusteringCoefficients, RandomWalk) and `src/fixed_rule/algos/`.
# `nornir-graph` — the only consumer — never used one of them: its
# `CozoGraph::shortest_path` is written out in Datalog precisely so it does not
# need `ShortestPathBFS`.
#
# 2. The storage backends went for a plainer reason: this fork is a WORKSPACE
# MEMBER, so cargo locks every optional dependency it could ever activate. Left
# in, they added 66 packages to edda's Cargo.lock (tikv-client, tonic, axum,
# clap, sqlite3-src, jemalloc, ..) that nothing here will ever build — dead
# weight in the lockfile and in any airgap pack. Worse, `storage-rocksdb` pulls
# `cozorocks`, whose build script needs a C++ toolchain and RocksDB sources, so
# `cargo check --workspace --all-features` could not even run.
#
# What is LEFT is exactly what `nornir-graph` uses and all it ever used: the Datalog
# core, the built-in `mem` engine, stored relations, time travel, FTS and the utility
# fixed rules. The `#[cfg(feature = "storage-sqlite")]`-style gates stay in the source
# permanently inactive — which is precisely the configuration this crate was already
# built in, so their `cfg(not(..))` fallback arms are the ones that were compiling
# before and still are.
default = []