GraphDDB Rust Runtime
A Rust (edition 2021) runtime that interprets the language-neutral GraphDDB IR
(manifest.json + operations.json, SPEC_VERSION 1.1) and executes the
validated access patterns against DynamoDB via
aws-sdk-dynamodb. It is a faithful
port of the Python reference runtime (python/graphddb_runtime) and is proven, by
the conformance harness (conformance/), to produce results identical to the
TypeScript live executor and the Python / PHP runtimes for every golden case.
TypeScript remains the single source of truth: this runtime never re-implements
the GraphDDB DSL — it is a pure interpreter of the IR the TS generator emits, so
src/ is never touched (issue #214, epic #211).
Layout
graphddb_runtime/— the library crate (the runtime).conformance_runner/— therust_runnerbinary the conformance harness drives (the structural counterpart ofconformance/py_runner.py/php_runner.php).
Usage
use Arc;
use Client;
use ;
use json;
# async
The consumer API mirrors the Python surface: execute_query, execute_command,
execute_transaction, execute_query_method, execute_command_method, and
explain (all async). Typed bindings (the Python types.py / repositories.py
layer) are out of scope for this crate — the runtime works directly on the IR.
Development
Number / cursor parity
Pagination cursors and DynamoDB number encoding are byte-identical to the Python reference (the parity SSoT):
- a cursor
Ntoken is an exact full-precision integer when the value is integral, elsefloat(Decimal(x))rendered by CPython'sjson.dumps(float)formatter (deliberately lossy — seeddb_number.rs); - float → string reproduces CPython's
repr(float)exactly, including its fixed-vs-scientific threshold, signed zero-padded exponents, and the round-half-to-even shortest-digit tie-break (pyfloat.rs).
Every numeric test vector is regenerated from python3 at test time (a fuzz over
thousands of doubles / decimal strings) — never pinned to Rust's own output.
Conformance
The Rust dimension is wired into conformance/run.ts (tag rust:). Bring up
DynamoDB Local (npm run docker:up) and run:
The Rust results are deep-compared against the TS live executor for every case,
alongside the Python and PHP dimensions. CI (.github/workflows/rust.yml) runs
build/test/clippy/fmt, the conformance harness, a rust-* mutation non-vacuity
probe, and the git diff -- src/ guard.