geographdb-core
3D spatial indexing and graph-storage primitives for CFG and graph analysis.
This crate provides octree indexing, Morton ordering, sectioned storage, CFG block storage, and graph algorithms for tools that model control-flow and graph structure geometrically.
Features
- Octree spatial indexing for 3D points and bounding boxes
- Morton code ordering for cache-friendly spatial locality
- Sectioned storage for graph, symbol, and CFG records
- CFG-oriented storage and query helpers
- Graph algorithms including A*, SCC, dominance, loops, slicing, and topological ordering
- 4D traversal primitives that combine graph topology, 3D spatial filters, and temporal validity windows
- Small Cypher-like 4D query layer for pattern, routing, and impact queries
Code-Intelligence Use Case
Magellan stores control-flow blocks in 3D space:
- X = structural or dominance depth
- Y = loop nesting level
- Z = function or path grouping dimension
Tools can then query control-flow structure using geometric locality.
use geographdb_core::spatial::{BoundingBox, Octree};
use geographdb_core::storage::NodePoint;
use glam::Vec3;
let bounds = BoundingBox::new(
Vec3::new(0.0, 0.0, 0.0),
Vec3::new(100.0, 100.0, 100.0),
);
let mut octree = Octree::new(bounds);
octree.insert(NodePoint { id: 1, x: 0.0, y: 0.0, z: 42.0 });
octree.insert(NodePoint { id: 2, x: 1.0, y: 0.0, z: 42.0 });
octree.insert(NodePoint { id: 3, x: 2.0, y: 1.0, z: 42.0 });
let nearby = octree.query_sphere(Vec3::new(1.0, 0.0, 42.0), 2.0);
assert_eq!(nearby.len(), 3);
4D Graph Traversal
Use the 4D algorithm API when a graph edge or node should only participate in a query inside a spatial region and temporal window.
use geographdb_core::{
astar_find_path_4d, GraphNode4D, TemporalEdge, TemporalWindow, TraversalContext4D,
};
let nodes = vec![
GraphNode4D {
id: 1,
x: 0.0,
y: 0.0,
z: 42.0,
begin_ts: 0,
end_ts: 100,
properties: Default::default(),
successors: vec![TemporalEdge {
dst: 2,
weight: 1.0,
begin_ts: 0,
end_ts: 100,
}],
},
GraphNode4D {
id: 2,
x: 1.0,
y: 0.0,
z: 42.0,
begin_ts: 0,
end_ts: 100,
properties: Default::default(),
successors: vec![],
},
];
let ctx = TraversalContext4D {
time_window: Some(TemporalWindow { start: 10, end: 20 }),
spatial_region: None,
graph_weight: 1.0,
spatial_weight: 0.5,
temporal_weight: 0.0,
};
let path = astar_find_path_4d(&nodes, 1, 2, &ctx).unwrap();
assert_eq!(path.node_ids, vec![1, 2]);
GraphNode4D::properties is a JSON metadata map. The 4D Cypher-like layer can
project those values directly with queries such as
MATCH (a)-[:CONNECTS]->(b) RETURN a.name, b.name.
Persistence
save_graph4d and load_graph4d round-trip a full 4D graph through the
GraphStorageManager, persisting nodes, edges, the dual octree spatial index,
and typed node properties to a .geo archive.
use geographdb_core::{save_graph4d, load_graph4d};
let file = std::fs::File::create("graph.geo")?;
save_graph4d(file, &nodes)?;
let file = std::fs::File::open("graph.geo")?;
let loaded = load_graph4d(file)?;
Installation
[dependencies]
geographdb-core = "0.3"
For local development with Magellan:
geographdb-core = { path = "../geographdb-core" }
Runnable 4D Demos
The crate includes runnable 4D graph demos: temporal dependencies, constrained impact analysis, route adaptation, time-respecting delivery, signal propagation, dynamic bottleneck resilience, orbit constellation, metamaterial design, and protein conformation.
Together they show standard graph questions upgraded with temporal validity and 3D spatial context:
cargo run --example demo_4d_dependency_timeline
cargo run --example demo_4d_cypher_bottlenecks
cargo run --example demo_4d_cypher_impact_radius
cargo run --example demo_4d_cypher_match_filters
cargo run --example demo_4d_cypher_queries
cargo run --example demo_4d_cypher_disaster_response
cargo run --example demo_4d_cypher_signal_propagation
cargo run --example demo_4d_cypher_temporal_route
cargo run --example demo_4d_impact_radius
cargo run --example demo_4d_route_planning
cargo run --example demo_4d_signal_propagation
cargo run --example demo_4d_temporal_bottlenecks
cargo run --example demo_4d_temporal_delivery
cargo run --example demo_4d_orbit_constellation
cargo run --example demo_4d_metamaterial_design
cargo run --example demo_4d_protein_conformation
Each demo can also export a JSON result for repeatable checks or reports:
cargo run --quiet --example demo_4d_dependency_timeline -- --json > dependency-timeline.json
cargo run --quiet --example demo_4d_cypher_bottlenecks -- --json > cypher-bottlenecks.json
cargo run --quiet --example demo_4d_cypher_impact_radius -- --json > cypher-impact-radius.json
cargo run --quiet --example demo_4d_cypher_match_filters -- --json > cypher-match-filters.json
cargo run --quiet --example demo_4d_cypher_queries -- --json > cypher-queries.json
cargo run --quiet --example demo_4d_cypher_disaster_response -- --json > cypher-disaster-response.json
cargo run --quiet --example demo_4d_cypher_signal_propagation -- --json > cypher-signal-propagation.json
cargo run --quiet --example demo_4d_cypher_temporal_route -- --json > cypher-temporal-route.json
cargo run --quiet --example demo_4d_impact_radius -- --json > impact-radius.json
cargo run --quiet --example demo_4d_route_planning -- --json > route-planning.json
cargo run --quiet --example demo_4d_signal_propagation -- --json > signal-propagation.json
cargo run --quiet --example demo_4d_temporal_bottlenecks -- --json > temporal-bottlenecks.json
cargo run --quiet --example demo_4d_temporal_delivery -- --json > temporal-delivery.json
cargo run --quiet --example demo_4d_orbit_constellation -- --json > orbit-constellation.json
cargo run --quiet --example demo_4d_metamaterial_design -- --json > metamaterial-design.json
cargo run --quiet --example demo_4d_protein_conformation -- --json > protein-conformation.json
Sample outputs are stored under examples/results/.
demo_4d_cypher_queriesshows a small Cypher-like layer forMATCH, property projections,WHERE time_window(...),WHERE spatial_sphere(...), andCALL db.*procedure queries.demo_4d_cypher_match_filters,demo_4d_cypher_temporal_route,demo_4d_cypher_impact_radius,demo_4d_cypher_bottlenecks, anddemo_4d_cypher_signal_propagationsplit that query layer into focused, copyable scenarios.demo_4d_dependency_timelinecompares reachability, path search, and SCCs before and after a dependency graph changes over time.demo_4d_impact_radiuscompares topology-only impact analysis with the same query constrained to a local 3D region and a current time window.demo_4d_route_planningshows A* selecting a different route when the direct corridor is no longer valid in the requested time window.demo_4d_signal_propagationshows a time-dependent Dijkstra arrival wave from one source across scheduled links.demo_4d_temporal_bottlenecksshows critical relays and links disappearing after a temporary relay creates redundancy.demo_4d_temporal_deliveryshows causal temporal routing where edge schedules determine whether the next hop is possible after arrival.
Scope
This crate contains the Rust core used for spatial CFG and graph storage. Language bindings and larger application crates are separate packages.
Public API Areas
spatial:Octree,BoundingBox, Morton encoding, and SIMD distance filtering.storage: sectioned.geostorage, sidecar path helpers, graph/CFG/symbol section adapters, WAL records, dual octree spatial indexing,GraphStorageManager, and theprop_storebinary typed-property format.cfg_store: high-level CFG block storage backed by spatial indexing.algorithms: graph algorithms for CFG analysis and path reasoning.- Persistence via
save_graph4dandload_graph4dfor full 4D graph round-trips.
Feature Flags
telemetry: enables tracing and dashmap-backed instrumentation helpers.debug-prints: enables debug instrumentation points used during local investigation.
Documentation
- API.md describes the public modules and common types.
- MANUAL.md covers local development, verification, and publishing.
- CHANGELOG.md records release changes.
Verification
cargo check
cargo test
cargo publish --dry-run
cargo package --list
License
GPL-3.0-only. See LICENSE.
Metadata
Release files for geographdb 0.5.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| geographdb-0.5.0.tar.gz | 263.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| geographdb-0.5.0-cp310-abi3-manylinux_2_34_x86_64.whl | CPython 3.10 | abi3 | Linux glibc 2.34+ x86-64 | Details |
Total release size: 977.3 kB
Release files / geographdb-0.5.0.tar.gz
| Download URL | geographdb-0.5.0.tar.gz |
|---|---|
| Size | 263.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4012b9dab06fa22315a35ff3f80329e2f2131c56125c13ada9f2d7686bd707fb
|
|
BLAKE2b-256 checksum How to use checksums |
4c49e903f96a3e4c3b6740df52dc86ebc26bf6fb6a9c85806cd3db8ced5d0344
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on May 30, 2026.
Transparency logRelease files / geographdb-0.5.0-cp310-abi3-manylinux_2_34_x86_64.whl
| Download URL | geographdb-0.5.0-cp310-abi3-manylinux_2_34_x86_64.whl |
|---|---|
| Size | 714.0 kB |
| Tags | CPython 3.10 Linux glibc 2.34+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
ffe96d82fedd2a1571df3217325403377e08f01468aba42abe20ab9ed0b5f1ee
|
|
BLAKE2b-256 checksum How to use checksums |
210c8163e92dd5e253630bdf74c3cb827018e1a65507fccf9a467976430996d7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on May 30, 2026.
Transparency log