COOLJAPAN
← All posts

TensorLogic 0.1.2 Released — A Pure-Rust SQLite Backend, a GPU Bounds-Check Fix, and OxiXML-Powered RDF

TensorLogic 0.1.2 replaces rusqlite's bundled C SQLite with the pure-Rust OxiSQL backend, closes an out-of-bounds risk in GPU sparse SpMV/SpMM with upfront shape validation, and moves the RDF/Turtle stack from upstream Oxigraph to COOLJAPAN's own OxiXML.

release tensorlogic neurosymbolic pure-rust sqlite rdf gpu

A GPU kernel that trusts a caller-supplied buffer length is one undersized allocation away from reading past the end of device memory. TensorLogic 0.1.2 closes that gap — and drops the last C dependency out of its SQLite backend while it’s at it.

Today we released TensorLogic 0.1.2 — a hardening-and-sovereignty release. The headline: tensorlogic-oxicuda-sparse’s SpMV/SpMM now validate buffer shapes before they ever reach the GPU. Alongside it, tensorlogic-adapters replaces rusqlite’s bundled C SQLite with the pure-Rust OxiSQL backend, and tensorlogic-oxirs-bridge moves its RDF/Turtle stack off upstream Oxigraph onto COOLJAPAN’s own OxiXML. It builds on 0.1.1 (released 2026-06-09); if you’re already running TensorLogic, this post is about what changed under the hood.

No C. No Fortran. No FFI shims. TensorLogic 0.1.2 is Pure Rust end to end: the SciRS2 backend (now 0.6.5) executes the einsum graphs, the OxiCUDA backend (0.5.5) runs the GPU path, OxiXML (oxixml-model / oxixml-turtle, 0.1.2) parses RDF/Turtle, and OxiSQL (oxisql-core / oxisql-sqlite-compat, 0.4.1) is the new SQLite-compatible storage layer. It ships as a single static binary, with Python bindings (pytensorlogic) via PyO3. Rust 1.90+, Apache-2.0.

Why 0.1.2 matters

0.1.2 isn’t a features release — it’s a hardening and sovereignty release. Three things changed that matter regardless of which TensorLogic crate you touch:

TensorLogic’s suite stands at 7,178 tests, 100% pass rate, across ~325K lines of Rust (1,108 source files).

Technical Deep Dive

The GPU bounds check. tensorlogic-oxicuda-sparse::spmv computes y = alpha * A * x + beta * y for a sparse CSR matrix A; spmm does the dense-matrix equivalent. Both now open with a validation call — check_spmv_shapes(a, x.len(), y.len()) and check_spmm_shapes(a, b.len(), b_cols, c.len()) — before the GPU path is even considered. The fix’s own doc comment states the reasoning plainly: “the GPU kernel receives bare device pointers and would happily read past the end of an undersized x.” Get the shapes wrong now and you get SparseError::ShapeMismatch, not memory corruption.

The SQLite migration. tensorlogic-adapters’ SQLite-backed schema store is rebuilt on oxisql_core::Connection and oxisql_sqlite_compat::SqliteConnection. Parameter binding changes with it — OxiSQL uses positional $1, $2, … placeholders instead of rusqlite’s ? — and reads/writes now run through a dedicated Tokio runtime, with a new map_oxi helper mapping OxiSQL errors into AdapterError. initialize_schema also drops its &mut self requirement. A new count_for_schema(&self, table: &str, schema_id: i64) -> Result<usize, AdapterError> helper backs the schema store’s domain/predicate/variable counts.

The RDF migration. In tensorlogic-oxirs-bridge’s Cargo.toml, oxrdf and oxttl are no longer the upstream crates — they’re workspace aliases (package = "oxixml-model" / package = "oxixml-turtle") pointing at COOLJAPAN’s own OxiXML project. Call sites across schema/inference.rs, schema/metadata.rs, schema/nquads.rs, schema/ntriples.rs, and shacl/mod.rs were updated for OxiXML’s borrowed-reference iterator API.

Getting Started

cargo add tensorlogic-oxicuda-sparse

The shape guard runs automatically on every call — no new API to learn, just a safer failure mode when buffers don’t line up:

use tensorlogic_oxicuda_sparse::{spmv, SparseError};

// `a` is a 4x4 sparse CSR matrix; deliberately pass a 3-element `x`
// instead of the 4 elements `spmv` requires.
let x = vec![1.0_f32; 3];
let mut y = vec![0.0_f32; 4];

match spmv(&a, &x, 1.0, 0.0, &mut y) {
    Err(SparseError::ShapeMismatch(msg)) => {
        println!("caught before it reached the device: {msg}");
    }
    Ok(()) => unreachable!("a shape mismatch should never dispatch"),
    Err(e) => panic!("unexpected error: {e}"),
}

What’s New in 0.1.2

Added

Changed

Fixed

Tips

The neurosymbolic foundation

0.1.2 keeps TensorLogic’s role as the neurosymbolic glue of the COOLJAPAN stack while quietly tightening its foundations. Logic still compiles down to SciRS2 tensors (now 0.6.5). The OxiCUDA backend (0.5.5) runs the GPU path — with its sparse kernels now shape-checked before every dispatch. OxiXML (0.1.2) is the pure-Rust RDF/Turtle engine behind the OxiRS bridge. OxiSQL (0.4.1) is the new SQLite-compatible storage layer for adapters. And the wider stack — ToRSh (0.2.0), SkleaRS (0.2.0), QuantRS2 (0.2.1), OxiRS (0.4.1) — moves forward alongside it. All Pure Rust. All in one tensor graph.

Repository: https://github.com/cool-japan/tensorlogic

Star the repo if you want a neurosymbolic runtime that treats an undersized GPU buffer as a bug to catch, not a risk to ship.

The era of a “pure Rust” crate quietly bundling a C library is over, one dependency at a time. TensorLogic 0.1.2 is sovereign a little further down the stack.

KitaSan at COOLJAPAN OÜ August 31, 2026

↑ Back to all posts