gograph

package module
v0.16.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 9, 2026 License: MIT Imports: 0 Imported by: 0

README

GoGraph

A Go module for graph persistence, manipulation, and fast search, designed to scale from in-memory graphs to graphs that exceed RAM.

Status

Current release: v0.16.0. This is the project's twenty-first release, published at a pre-1.0 baseline: under Semantic Versioning a 0.y.z version signals that the public API is not yet stable and may change without a major bump while the module matures toward 1.0.0. v0.16.0 is a pre-1.0 MINOR release of 167 commits from three sprints: 363 (Performance and Efficiency Laboratory), 364 (Correctness and Security Laboratory) and 365 (Observe, Correct and Optimize MVCC, Store and LPG Exercise).

It breaks the exported API and changes the on-disk format. Parsing every non-test Go file outside internal/, examples/, cmd/ and any gen/, tck/ or testdata/ directory at both tags and diffing the rendered declarations gives 4 822 exported declarations before and 5 160 after: 342 added, 74 re-signed (71 incompatibly) and 4 removed. Most mutators of graph/lpg, graph/adjlist and cypher/exec.GraphMutator now return their refusal as an error, because every write path — direct, raw and store commit — is now atomic and isolated, and every token is bounded at 65 535 bytes.

WAL v2 is a one-way migration. The write-ahead log is now segmented, each frame carries its position, a link to its predecessor and the store id, every commit records the node ids it created, and node ids are reserved ahead of use, so id() and elementId() survive a reopen exactly. The first writable, clean open of an older store migrates it, after which v0.15.0 and earlier builds refuse the directory. Back up a store before its first open with v0.16.0 if you need a downgrade path. store.Open composes recovery and the store in one fail-safe call, and txn.Store.Close records the exact node-id marks at a clean close.

The two compliance invariants remain in force: the module is 100 % openCypher TCK-compliant at the execution level (3 897/3 897 scenarios; tckExecutionBaseline is unchanged) and 100 % ACID-compliant. go.mod and go.sum are unchanged from v0.15.0.

The module uses the conventional Go path github.com/FlavioCFOliveira/GoGraph and is fetchable with go get github.com/FlavioCFOliveira/GoGraph@v0.16.0. See CHANGELOG.md and release-notes/v0.16.0.md for the full release narrative, the behaviour changes a caller must know about, and what the release does not establish.

Core graph (graph/)
  • github.com/FlavioCFOliveira/GoGraph/graph — generic node identifiers and the Graph[N, W] contract.
  • github.com/FlavioCFOliveira/GoGraph/graph/adjlist — mutable, sharded adjacency-list backend with copy-on-write snapshots and lock-free reads. Every edge slot carries a stable identity, and adjacency is versioned inside the immutable entry so a snapshot resolves it at one instant.
  • github.com/FlavioCFOliveira/GoGraph/graph/mvcc — the concurrency-control substrate: a transaction clock and shared commit records, a contiguous commit frontier, the reclamation horizon and watermark, Gate (a weak/strong admission gate), and ErrSerializationConflict. New in v0.11.0; MVCC is the module's only concurrency-control mechanism and is armed by lpg.New.
  • github.com/FlavioCFOliveira/GoGraph/graph/csr — immutable Compressed Sparse Row view for read-mostly analytics.
  • github.com/FlavioCFOliveira/GoGraph/graph/generation — atomic pointer swap for snapshot rotation across readers/writers.
  • github.com/FlavioCFOliveira/GoGraph/graph/lpg — Labelled Property Graph model (vertex and edge labels, typed properties; PropertyValue covers string, int64, float64, bool, time.Time, []byte, and list ([]PropertyValue)).
  • github.com/FlavioCFOliveira/GoGraph/graph/lpg/schema — optional type schema with Validate.
  • github.com/FlavioCFOliveira/GoGraph/graph/index — Manager coordinating named indexes and fanning out Change events to subscribers.
  • github.com/FlavioCFOliveira/GoGraph/graph/index/label — Roaring-bitmap inverted label index.
  • github.com/FlavioCFOliveira/GoGraph/graph/index/hash — sharded hash exact-match property index.
  • github.com/FlavioCFOliveira/GoGraph/graph/index/btree — order-preserving B+ tree range property index (backs the Cypher range-predicate index seek).
  • github.com/FlavioCFOliveira/GoGraph/graph/query — fluent MATCH-style pattern engine.
  • github.com/FlavioCFOliveira/GoGraph/graph/io/csv · graph/io/graphml · graph/io/dot · graph/io/jsonl — interchange formats for CSV, GraphML, DOT, and JSON Lines.
  • github.com/FlavioCFOliveira/GoGraph/ds — disjoint-set (union-find) primitive.
  • github.com/FlavioCFOliveira/GoGraph/metrics — the observability seam: SetBackend plus counters, gauges, latency histograms and Time. Every cache, pool and bounded queue publishes utilisation through it, as does the MVCC substrate (writers in flight, outcomes, conflicts by store, version-chain depth, vacuum latency, horizon utilisation). Wire-up in docs/metrics.md.
  • github.com/FlavioCFOliveira/GoGraph/search — traversal and path-finding algorithms (BFS, iterative DFS, Dijkstra, Bellman-Ford, A*, bidirectional BFS, Yen k-shortest, topological sort (Kahn), Tarjan SCC, biconnected components, Eulerian path, APSP).
  • github.com/FlavioCFOliveira/GoGraph/search/centrality — Brandes betweenness, PageRank (parallel pull-formulation over a reverse-CSR on large graphs, bit-identical to the serial path), personalised PageRank.
  • github.com/FlavioCFOliveira/GoGraph/search/community — Leiden, label propagation.
  • github.com/FlavioCFOliveira/GoGraph/search/flow — Dinic, Edmonds-Karp, push-relabel, Stoer-Wagner, min-cost max-flow.
  • github.com/FlavioCFOliveira/GoGraph/search/extern — semi-external BFS and PageRank over Tier 2 csrfile readers.
Storage and persistence (store/)
  • github.com/FlavioCFOliveira/GoGraph/store/wal — Write-Ahead Log with CRC32C framing.
  • github.com/FlavioCFOliveira/GoGraph/store/snapshot — atomic on-disk snapshot directories.
  • github.com/FlavioCFOliveira/GoGraph/store/txn — transactional API (Begin/Commit/Rollback). Independent write transactions run concurrently: the single-writer semaphore was retired in v0.11.0, so a write-write collision is detected by MVCC first-updater-wins and returned as a retriable error wrapping mvcc.ErrSerializationConflict, rather than prevented by exclusion.
  • github.com/FlavioCFOliveira/GoGraph/store/checkpoint — background WAL → snapshot folder.
  • github.com/FlavioCFOliveira/GoGraph/store/recovery — snapshot + WAL replay on open.
  • github.com/FlavioCFOliveira/GoGraph/store/csrfile — mmap-backed Tier 2 CSR file format, writer, reader, Reinterpret zero-copy helper, deterministic fixture generator.
  • github.com/FlavioCFOliveira/GoGraph/store/bulk — high-throughput bulk loader bypassing the WAL. Adjacency only: no labels, no properties, and its output is a Tier 2 csrfile rather than a store.
  • github.com/FlavioCFOliveira/GoGraph/store/bulkimport — offline bulk import: builds a labelled property graph and publishes it as a store snapshot, so recovery.Open reads it back with no WAL. Loads 20 000 nodes and 200 000 edges in 0.28 s of process wall clock (a 233 ms import phase, 0.86 M edges/s) — see docs/benchmarks/bulk-import-2026-07-26.md and docs/design-bulk-import.md. For scale, the Cypher write path loads comparable data (20 000 nodes / 199 941 edges in UNWIND batches of 5 000) in 2.056 s, measured in docs/benchmarks/threeway-durability-2026-07-27.md — down from 35 m 10 s before #2228 admitted the hash join for writing statements. Those are two different harnesses, so treat them as two figures rather than one ratio. The whole import is atomic; it is not a transaction, it cannot be rolled back, and it requires an empty target directory.
Cypher engine (cypher/)
  • github.com/FlavioCFOliveira/GoGraph/cypher — openCypher-compatible parser, planner, and execution engine; WAL-durable writes via NewEngineWithStore. An explicit read transaction (BeginReadTx) is snapshot isolated across all of its statements; an explicit write transaction (BeginTx) holds no lock, so two clients can hold open write transactions and both make progress. Engine.NewSession returns a Session giving read-your-own-writes across transactions.
  • github.com/FlavioCFOliveira/GoGraph/cypher/parser · cypher/ast · cypher/sema · cypher/ir · cypher/exec — parser-to-execution pipeline with plan-cache, EXPLAIN of the physical plan, PROFILE with per-operator rows, time, db-hits, rows-removed-by-filter and the planner's estimate beside the measurement — an uncounted db-hits figure renders ?, never 0 — and per-statement write-effect counters (Result.Counters).
  • github.com/FlavioCFOliveira/GoGraph/cypher/funcs · cypher/procs — built-in functions and procedures.
  • github.com/FlavioCFOliveira/GoGraph/cypher/tck — openCypher TCK harness (parser 100 %, execution 100 % — 3 897/3 897 scenarios; see docs/tck/DIVERGENCES.md).
Bolt server (bolt/)
  • github.com/FlavioCFOliveira/GoGraph/bolt/proto · bolt/packstream — Bolt v5 protocol and PackStream encoding (v5.0–v5.6 preferred; v4.4 fallback).
  • github.com/FlavioCFOliveira/GoGraph/bolt/server — TCP server compatible with neo4j-go-driver v5 and cypher-shell, with TLS certificate hot-reload and graceful shutdown. Nodes, relationships and paths are sent as Bolt structures (so the official driver materialises them as dbtype.Node/Relationship/Path), each connection owns a cypher.Session for read-your-own-writes, and open transactions are operable — bounded by idle time and per-principal count, and listable and terminable through an operator API. Engine-wide memory ceilings are bounded by default and derived from a container's cap where one exists.

Subsystem references: docs/persistence.md (WAL, snapshots, recovery) · docs/tier2.md (csrfile) · docs/io.md (interchange formats) · docs/algorithms.md (algorithms catalogue) · docs/cypher.md (Cypher engine) · docs/bolt.md (Bolt server).

Examples

The examples/ directory contains 37 runnable demonstrations, numbered 01–37. They are not part of the module — nothing in GoGraph imports them — they are exercise harnesses and usage simulators: each drives real features under realistic conditions and emits telemetry, and every one can produce a pprof profile. See examples/README.md for the full categorized index with per-example links and run commands.

Basics
  • 01_basic — Dijkstra on a small European routing graph.
  • 02_property_graph — labels + typed properties + indexed query.
  • 03_advanced_algorithms — BFS, Dijkstra, Brandes betweenness, and PageRank composed over one CSR snapshot.
Persistence and out-of-core
  • 04_persistence — WAL transactions + recovery.
  • 05_out_of_core — Tier 2 csrfile + mmap + semi-external PageRank.
  • 17_transactional_log — WAL + background checkpointer + crash-recovery walk-through.
  • 18_oocore_pipeline — CSV → CSR → csrfile → mmap → semi-external BFS + PageRank.
  • 21_typed_recovery — generic recovery.Open[N, W] over an (int64, float64) graph with typed properties; round-trips through a v2 snapshot.
Cypher and Bolt
  • 22_cypher — Cypher execution engine social-graph demo: label scan with ORDER BY, WHERE filter, relationship pattern, and CREATE — values printed in human-readable form.
  • 23_bolt_server — Bolt v5 server round-trip: a real neo4j-go-driver v5 client runs a Cypher query over the wire, then the server shuts down cleanly with no goroutine leak.
  • 24_social_network_cli — interactive CLI over a persistent LPG social network (WAL + recovery + Cypher queries).
  • 25_software_house_api — multi-layer LPG REST API over a software-house domain (Code/Work/People entities).
Interchange
  • 06_csv_import — CSV read / write + JSON Lines.
  • 07_graphml_roundtrip — GraphML read / write + DOT.
Algorithms
  • 08_pagerank — PageRank on a directed authority web, ranking pages from most to least important with distinct ranks.
  • 09_leiden — community detection on two cliques + bridge.
  • 10_dimacs9_routing — DIMACS 9 synthetic road network + a concrete Dijkstra SSSP query with a reconstructed shortest path.
  • 14_routing_alternatives — Dijkstra, Yen k-shortest, and A* with a coordinate-based Euclidean heuristic that expands fewer nodes for the same optimal cost.
  • 15_task_assignment — Hungarian (cost-minimising) + Hopcroft-Karp (cardinality).
  • 16_centrality_analytics — Brandes betweenness + label propagation.
Real-world recipes
  • 11_social_network — labels + PageRank + Leiden + friend-of-friend recommendations.
  • 12_build_dependency — topological sort + Tarjan SCC for circular-dependency detection.
  • 13_network_reliability — Hopcroft-Tarjan SPOF analysis + max-flow with the limiting min-cut bottleneck, both over the same network.
  • 19_pattern_query — multi-hop MATCH-style queries combining labels and property predicates.
  • 20_concurrent_reads — multiple algorithms run concurrently over a shared immutable CSR.
  • 28_negative_weights — negative-weight routing.
  • 29_all_pairs — all-pairs shortest paths.
  • 30_min_spanning_tree — minimum spanning tree as a least-cost backbone.
  • 32_euler — Eulerian circuits for route inspection.
Concurrency, MVCC and isolation
  • 27_concurrent_txn — concurrent transaction isolation, with a conserved-total oracle.
  • 33_generation_swap — generation snapshot-swap on a read-mostly workload.
  • 35_mvcc_mixed_workload — reader latency under a mixed OLTP-and-analytics workload.
  • 36_mvcc_snapshot_topology — snapshot isolation on the topology dimension.
  • 37_mvcc_write_contention — MVCC under concurrent writers.
Scale, observability and operations
  • 26_social_scale_bench — social-network scale benchmark; the reference harness for planner and execution work.
  • 31_metrics_observability — the metrics seam exported in Prometheus format.
  • 34_bolt_transactions — Bolt transactions, writes, auth and TLS.

Run any example with go run ./examples/<NAME>/, and -h to see its flags. Every example binds one identical profiling contract from examples/internal/exprof: -profile-dir writes cpu.pprof and heap.pprof, and -trace writes a runtime/trace. Both are inert by default — with neither flag set no profiler runs and not one byte reaches the example's output, which is what lets each example's regression test pin its deterministic output unedited. Flags beyond those two vary per example.

Getting Started

package main

import (
	"fmt"

	"github.com/FlavioCFOliveira/GoGraph/graph/adjlist"
	"github.com/FlavioCFOliveira/GoGraph/graph/csr"
	"github.com/FlavioCFOliveira/GoGraph/search"
)

func main() {
	a := adjlist.New[string, int64](adjlist.Config{Directed: true})
	a.AddEdge("Lisbon", "Madrid", 624)
	a.AddEdge("Lisbon", "Paris", 1737)
	a.AddEdge("Madrid", "Paris", 1274)
	a.AddEdge("Madrid", "Rome", 1969)
	a.AddEdge("Paris", "Rome", 1422)

	c := csr.BuildFromAdjList(a)
	src, _ := a.Mapper().Lookup("Lisbon")

	d, err := search.Dijkstra(c, src)
	if err != nil {
		panic(err)
	}
	for _, city := range []string{"Madrid", "Paris", "Rome"} {
		id, _ := a.Mapper().Lookup(city)
		dist, _ := d.Distance(id)
		fmt.Printf("Lisbon -> %s : %d km\n", city, dist)
	}
}

Workflow

Development runs as repeated iterations of Analyse -> write all the code in bulk -> test those changes, until the objectives are met. The work is specified before the first iteration and documented once the objectives are met, and it stays focused on what is required without reaching beyond it. Sprint planning lives in the local rmp CLI roadmap.

Each iteration tests the changes just made: the packages under change and any component whose stability those changes can foreseeably affect. The full pipeline is reserved for the close of a sprint and for every push, and runs from the Makefile ci target:

make ci

The pipeline runs, in this order, go mod tidy, gofmt, go vet, go build, the knowledge-graph fidelity gate, govulncheck, golangci-lint run, and then the three test phases — the uninstrumented phase, the serial timing phase, and the short test layer under the race detector (go test -race ./...). The order is deliberate: every check that concludes in seconds runs before any test phase, so a lint or vet failure costs seconds rather than the whole suite, and the module suite runs exactly once. It must be green before a sprint is closed and before anything is pushed.

Coverage is measured, not gated automatically. The coverage gate (cover-gate) enforces ≥ 85 % aggregate and ≥ 75 % per-package statement coverage, unchanged, but it is no longer a member of make ci — run make cover-gate when coverage is the question. It ran the whole module suite a second time, and a release is gated on correctness, never on a quality metric.

Performance

The authoritative, per-release record for this release is docs/benchmarks/v0.14.1.md — the arms, the two noise floors, the adjudication rule, the load conditions, every rejected row, and reproduce commands. This section is a summary, not a second source.

v0.14.1 was measured against v0.14.0 first-hand, on three arms. A is tag v0.14.0 (7c59a02c), B is the release tree (efd32fb9), and B2 is a second, independent compilation of that same v0.14.1 tree — byte-identical to B by sha256 on all eighteen packages, so B vs B2 is one binary measured against itself in the same rounds, at the same concurrency levels, under the same load as the signal it calibrates. All three were compiled once each by the same go1.27.1, then run interleaved with the arm order rotated every round, -race off, n=6, load-gated per round: 192 invocations, 192 exiting 0, across 150.9 minutes on 2026-09-08/09. go.mod and go.sum are byte-identical between the trees.

The noise floor is scale- and kind-dependent, and that governs every verdict below. A byte-identical binary measured against itself drifted 0.49 % at the median and 1.95 % at the p95 over 243 comparisons — but produced a statistically significant −26.13 % on one 1024-goroutine cell. Serial millisecond-scale benchmarks are where this host is trustworthy (same-code maximum 1.68 % over 84 comparisons); oversubscribed cells below 10 µs are where it is not. A delta is a finding only when it is significant and exceeds its own population's same-code envelope. 25 rows reached p<0.05; 11 are findings, 5 inconclusive, 9 rejected as noise. allocs/op behaves oppositely — 0.00 % at the median and the p95 — so every allocation delta below is real.

What a consumer actually feels: the Cypher read path is unchanged, and that is the result.

Goroutines 1 8 64 256 1024
ReadTx_LockFree v0.14.0 → v0.14.1 3.053 → 3.040 µs 1.653 → 1.653 µs 2.149 → 2.236 µs 2.719 → 2.823 µs 4.619 → 4.798 µs
ReadTx_WriterLock v0.14.0 → v0.14.1 101.0 → 101.6 µs 24.78 → 24.75 µs 23.75 → 23.99 µs 24.84 → 25.10 µs 28.35 → 29.49 µs

Not one cell is significant (smallest p = 0.066), and the block's same-binary floor geomean of −4.57 % is larger than its effect geomean of +1.78 % — the floor exceeds the signal. The 64/256/1024 cells carry a same-code drift of up to −26.13 % in this very campaign, so the apparent +3.8 % there is not reported as a result. Note ns/op under RunParallel is inverse aggregate throughput, not per-goroutine latency.

The ORDER BY key hoist is the release's clearest gain, and the whole family moves together. #2662 hoists a non-projected sort key into its own hidden column so the projection stops materialising the whole node per row:

Benchmark v0.14.0 v0.14.1 Δ p
BoundedOrder/n=000110/Top 1.442 ms 1.402 ms −2.75 % 0.020
BoundedOrder/n=000010/Top 1.410 ms 1.374 ms −2.56 % 0.005
BoundedOrder/n=010010/Top 4.858 ms 4.756 ms −2.10 % 0.005
BoundedOrder/n=000110/Sort 8.487 ms 8.373 ms −1.34 % 0.045

Nine of the ten BoundedOrder rows move the same way; the four above clear their band's 1.28 % bar. A coherent family is stronger evidence than any single row.

v0.14.1 gives back the largest regression v0.14.0 published. AllNodesScan_PerNodeAllocCost — named in v0.14.0's own report as that release's biggest cost at +7.11 %, when per-node db-hits counting was added to exactly this path — measures 11.60 µs → 10.98 µs (−5.39 %, p=0.005). Across six rounds B and B2 agree to 0.4 % while A sits 5.4 % above both, every time. Separately, ExpandDir_InVsOut_Baseline/OUT_deg1_sources, v0.14.0's +3.46 % regression, is back to parity at +0.10 %.

And the costs, because a README that lists only wins is not a faithful one.

Benchmark v0.14.0 → v0.14.1 Δ p
cypher/exec ExpandOut_PerEdge_SingleSource/K=4096 78.10 → 83.21 µs +6.54 % 0.005
cypher/exec ExpandDir_InVsOut_Baseline/IN_deg1_sources 93.27 → 98.69 µs +5.81 % 0.005
cypher/exec ExpandOut_PerEdge_SingleSource/K=65536 1.271 → 1.327 ms +4.37 % 0.005
bolt/server MsgObserve_RealBackend 68.17 → 69.63 ns +2.13 % 0.031

They are not systemic. Eleven of the fourteen Expand* rows are flat, including all four ExpandIn_PerEdge_* (−0.53 % to +0.42 %) and all four ExpandIn_TypeFiltered_* (−0.57 % to +0.30 %). The cost is confined to the OUT single-source per-edge path and the IN deg1-sources baseline. cypher/exec/expand.go changed in this window, which is the obvious candidate — but attribution is a hypothesis, not established: no arm was built with the destination- label admission disabled.

Allocations moved, and every figure here is real because the floor is exactly zero. CountAllNodes goes 27 → 28 allocs/op and 3 296 → 3 488 B/op with every sample equal in both arms — #2777's "one integer add per Init" showing up exactly where it should — and the count-pushdown paths take +16 B/op. ReadTx_WriterLock takes +2 allocs/op and +352 B/op identically at all five concurrency levels, plausibly #2814's plan footprint. No allocation count fell, and none rose by more than two.

Durable write throughput, at the concurrency levels the module publishes (store/txn BenchmarkCommitConcurrent, median of 6, re-measured at both trees):

Writers 1 8 64 256 1024
v0.14.0 3.732 ms 866.4 µs 121.5 µs 31.31 µs not measured
v0.14.1 3.713 ms 897.2 µs 120.3 µs 31.22 µs not measured
scaling vs own level 1 (v0.14.1) 1.00× 4.14× 30.87× 118.93× —

The durable commit path scales 119× from 1 to 256 concurrent writers and is unchanged. Three of four cells are non-significant; goroutines=8 at +3.56 % is reported inconclusive rather than as a result. This instrument stops at 256, so the published 1024 level remains unmeasured for durable commits.

The controls confirm the harness rather than the code. No file under search/ changed in this window, and all five headline benchmarks are non-significant:

Operation v0.14.1 vs v0.14.0
search.Dijkstra (post-warmup, reusable state) 8.081 ms, 0 B, 0 allocs ~ (p=0.471)
search.Dijkstra (large) 8.123 ms ~ (p=0.471)
search.BFS direction-optimising (power law) 28.50 ms, 0 B, 0 allocs ~ (p=0.066), the largest — unresolved, not flat
search.Yen k=100 14.49 ms ~ (p=0.471)
centrality.Brandes (random graph) 7.776 ms ~ (p=0.173)

The zero-allocation hot-path mandate holds, verified rather than asserted: allocs/op is identical on Dijkstra_PostWarmup and BFSDirectionOpt_PowerLaw with every sample equal in both arms.

The durability fix is priced, and it has no baseline because it is new. The five store/checkpoint benchmarks do not exist at v0.14.0, so nothing is compared and nothing is carried over. Measured within this release: reading the snapshot back costs 14.73 ms against a 150.3 ms checkpoint — 9.8 % — and #2780's decode pass adds 0.46 ms on top, 0.31 % of a checkpoint, with MapperDecodeOnly at 235.6 µs carrying no filesystem call at all.

bolt/server closes a gap v0.14.0 named as its own. That report recorded the whole TxBookkeeping_* family as unmeasured; all 24 bolt/server benchmarks were run here, including its eleven, and none is significant.

What this release does not establish. cypher is sampled, not covered — 60 of 149 benchmark functions, the full sweep costing 454 s per arm against 204 s for the targeted set, which is disproportionate for a patch release. graph/index{,/btree,/hash}, graph/lpg, store/snapshot, store/wal and six further concurrency ladders were sized and dropped, each with its reason recorded. Latency percentiles at the published concurrency levels are unmeasured for an eighth consecutive cycle; 1 024 concurrent writers on the durable path is unmeasured; on-disk footprint growth is unmeasured; bench/mtaudit's engine-under-writer ladder remains the highest-value measurement not made, now for three releases. The soak and nightly layers were not run, no -race figures and no profiles were captured, attribution is established for nothing, and everything here is one host, one architecture: Apple M4, 10 cores, darwin/arm64, macOS 26.6.2. The floors above are properties of that host and the adjudication bars derived from them do not transfer.

Reproduce: the exact commands — the three-arm interleaved harness, the load gate, the whole-campaign load sampler and the noise-floor procedure — are in docs/benchmarks/v0.14.1.md §7 and were used verbatim from docs/benchmarks/v0.14.1-raw/; the general workflow is make bench BENCH_PATTERN=. BENCH_COUNT=5 and docs/profiling.md. Hardware deltas should be reported in CHANGELOG.md alongside any number that regresses beyond the local benchstat regression gate (scripts/bench_gate.sh), which is run locally to compare a candidate against its baseline before the change lands.

Figures from earlier releases, kept and labelled rather than relabelled. The following are not v0.14.1 measurements and were not re-measured by this campaign: the conditional join-reorder result (ZZReorderSkewed/reorder=on, 267.155 ms → 2.723 ms, −98.98 %) is a v0.13.0 → v0.14.0 figure from the v0.14.0 campaign, and fires only when RefreshStatistics has run on a qualifying disjoint two-component shape; Mapper.Intern (hot key, uncontended) at 8.67 ns/op, 0 B, 0 allocs is carried forward from v0.11.0; and the 1 024-level durable write rate of 111,483 ops/s (store API) / 115,301 ops/s (Cypher engine) at 422.05 commits per fsync is v0.11.0's and has not been re-measured since.

Per-release reports live in docs/benchmarks/, one per tag; per-change tracking is in docs/benchmarks/history/ with the narrative ledger at history/LEDGER.md. The allocation-only comparison of these same two trees, taken on a host that was not quiet and which therefore makes no timing claim, is v0130-vs-v0140-2026-09-06.md. The end-to-end comparison of v0.10.0 against the tree as it stood on 2026-08-10 — five sprints before the v0.11.0 tag, and including the regressions — is release-delta-v0.10.0-to-head-2026-08-10.md.

Module Layout

graph/                    — core types: NodeID, Graph[N,W] contract, sharded Mapper
graph/adjlist             — mutable copy-on-write adjacency list, version-chained per slot
graph/csr                 — immutable Compressed Sparse Row snapshot (reader-side)
graph/generation          — refcount-protected Publisher for atomic snapshot rotation
graph/mvcc                — transaction clock, commit records, commit frontier, reclamation
                            horizon/watermark, Gate, ErrSerializationConflict
graph/lpg                 — labelled property graph (labels + typed properties)
graph/lpg/schema          — declarative type schema with Validate
graph/index               — Manager fanning out Change events to subscribers
graph/index/label         — Roaring-bitmap inverted label index
graph/index/hash          — sharded hash exact-match property index
graph/index/btree         — order-preserving range property index
graph/query               — fluent MATCH-style pattern engine
graph/io/csv              — edge-list CSV reader and writer
graph/io/graphml          — GraphML XML reader and writer
graph/io/dot              — Graphviz DOT writer
graph/io/jsonl            — JSON Lines reader and writer

search/                   — traversal and path-finding over CSR (BFS, DFS, Dijkstra,
                            Bellman-Ford, A*, BiBFS, Yen, APSP, BCC, Eulerian, ...)
search/centrality         — Brandes betweenness, PageRank, personalised PageRank
search/community          — Leiden, label propagation
search/extern             — semi-external BFS/PageRank over a Tier 2 reader
search/flow               — Dinic, Edmonds-Karp, push-relabel, Stoer-Wagner, MCMF

store/wal                 — versioned, CRC32C-checksummed Write-Ahead Log
store/snapshot            — atomic snapshot directories with manifest and per-file CRC
store/txn                 — transactions (Begin/Commit/Rollback); writers run CONCURRENTLY,
                            collisions detected by MVCC rather than prevented
store/checkpoint          — background WAL → snapshot folder goroutine
store/recovery            — snapshot + WAL replay on open
store/csrfile             — mmap'd Tier 2 CSR file format (versioned, 64-byte aligned)
store/bulk                — high-throughput bulk ingestion bypassing the WAL (adjacency only)
store/bulkimport          — offline import: labelled property graph → published store snapshot

cypher/                   — openCypher parser, planner and execution engine; snapshot-isolated
                            read transactions, lock-free write transactions, Session (RYOW)
cypher/parser · ast · sema · ir · exec
                          — parser-to-execution pipeline: plan cache, physical-plan EXPLAIN,
                            PROFILE with per-operator rows/time/db-hits/removed/estimate,
                            write counters
cypher/funcs · procs      — built-in functions and procedures
cypher/tck                — openCypher TCK harness (execution 100 %, 3 897/3 897)

bolt/proto · packstream   — Bolt v5 protocol and PackStream encoding
bolt/server               — TCP server for neo4j-go-driver v5 / cypher-shell; TLS hot-reload,
                            per-connection Session, operable + bounded transactions

ds/                       — supporting data structures (Union-Find, ...)
metrics/                  — public observability seam (SetBackend, counters, gauges, latency)

cmd/gograph-import        — offline CSV → store importer (see store/bulkimport)

bench/ldbc                — LDBC SNB SF1 / SF10 benchmark harness
bench/dimacs9             — DIMACS 9 USA-road SSSP benchmark
bench/rmat                — RMAT power-law graph generator
bench/soak                — 4-hour mixed-workload reliability soak harness
bench/comparison          — head-to-head harnesses: three-way vs Neo4j and Memgraph over Bolt
                            (throughput, CPU via cgroup counters, memory, concurrency), plus
                            NetworkX and SuiteSparse:GraphBLAS/LAGraph baselines

internal/metrics          — observability implementation behind the public metrics/ facade;
                            external consumers import metrics/, not this
internal/stress           — concurrency stress test suite (CI under -race)
internal/shapegen         — graph shape generators (trivial, classic, random models, adversarial)
internal/invariants       — graph invariant checkers (connected, DAG, bipartite, distance bound)
internal/testfs           — FS fault-injection wrapper (ENOSPC, partial write, fsync delay)
internal/crashinject      — subprocess crash-injection harness (SIGKILL breakpoints)
internal/subproc          — cross-process test helper (re-exec, mode dispatch)
internal/goldens          — golden-file assertion helper with -update and atomic write

See [docs/test-battery.md](docs/test-battery.md) for the production-readiness
test battery guide and the add-new-shape recipe.

examples/                 — 37 runnable example programs, each pprof-able (see "Examples")

Labelled Property Graph + Query Example

g := lpg.New[string, int64](adjlist.Config{Directed: true})
g.SetNodeLabel("alice", "Person")
g.SetNodeLabel("alice", "Admin")
g.SetNodeProperty("alice", "age", lpg.Int64Value(30))
g.AddEdge("alice", "bob", 1)

c := csr.BuildFromAdjList(g.AdjList())
e := query.New(g, c)

for _, n := range e.Match().Vertex(
    query.WithLabel[string, int64]("Admin"),
    query.WithProperty[string, int64]("age", lpg.Int64Value(30)),
).Collect() {
    fmt.Println(n)
}

Security

Vulnerability reports follow the process documented in SECURITY.md. Report privately through GitHub Security Advisories — https://github.com/FlavioCFOliveira/GoGraph/security/advisories/new. Please do not open a public issue for a suspected vulnerability; if you cannot use Security Advisories, open an issue containing no vulnerability details, only a request for a maintainer to open a private advisory. SECURITY.md states the response targets (48 h acknowledgement, 5 business days to triage, 30 days to a fix under embargo, 90-day coordinated disclosure) and the scope.

License

GoGraph is distributed under the MIT License.

Documentation

Overview

Package gograph is a Go module for graph persistence, manipulation, and fast search.

The library scales from small in-memory graphs to graphs too large to fit in RAM, while remaining idiomatic, allocation-conscious, and safe under high load and high concurrency.

Subpackages provide the building blocks:

  • graph — core types, generic node identifiers, and graph interfaces.
  • graph/adjlist — mutable adjacency-list backend.
  • graph/csr — immutable compressed sparse row view for analytics.
  • graph/lpg — labelled property graph model (labels, typed properties).
  • graph/index — secondary indexes (label bitmap, hash, B+ tree).
  • graph/io — importers and exporters (CSV, GraphML, DOT, JSON Lines).
  • search — traversal and path-finding algorithms.
  • search/centrality, search/community, search/flow — analytics suites.
  • store — durable persistence (WAL, snapshots, mmap'd CSR).

Subpackages are added incrementally per the project roadmap; the present package documents the top-level module only.

Common tasks and their entrypoints

The following map points each common task at the function or type that starts it. Every link resolves to an exported symbol; follow it for the full signature and contract.

Build a labelled property graph:

  • [lpg.New] constructs a Graph[N, W]; add nodes, labels, typed properties, and edges through its methods.

Run a Cypher query:

  • [cypher.NewEngine] wraps an in-memory lpg.Graph[string, float64].
  • [cypher.Engine.Run] executes a query string with typed parameters.

Run durable, WAL-backed Cypher queries:

  • [cypher.NewEngineWithStore] binds the engine to a [txn.Store], so writes are journalled and survive a crash.

Pass parameters to a query:

  • [cypher.Engine.RunAny] accepts plain Go values as parameters.
  • [cypher.BindParams] converts a map of Go values into the typed parameter map that [cypher.Engine.Run] expects.

Find a shortest path (weighted):

  • [search.Dijkstra] for non-negative edge weights.
  • [search.AStar] when an admissible heuristic is available.

Traverse without weights:

  • [search.BFS] for breadth-first order and unweighted distances.
  • [search.DFS] for depth-first order.

Compute analytics:

  • [centrality.PageRank] for influence ranking.
  • [community.Leiden] (or [community.LabelPropagation]) for community detection; pair with [community.DefaultLeidenOptions].
  • [flow.MaxFlow] / [flow.MinCostMaxFlow] for network-flow problems.

Import and export graphs:

  • CSV: [csv.ReadInto] and [csv.Write].
  • GraphML: [graphml.ReadInto] / [graphml.ReadWithProps] and [graphml.Write] / [graphml.WriteWithProps].
  • JSON Lines: [jsonl.ReadInto] / [jsonl.ReadWithProps] and [jsonl.Write] / [jsonl.WriteWithProps].
  • DOT (export only): [dot.Write].

Persist and recover:

  • [wal.Open] opens a write-ahead log for appending frames.
  • [snapshot.WriteSnapshotFull] writes a full CSR-plus-labels snapshot to a directory.
  • [recovery.Open] reconstructs a graph from a snapshot and its WAL.
  • [store.Open] reopens a store directory for writing in one call: recovery, the clean gate, the WAL open, and the transactional store built from the recovery result.

Serve the Bolt protocol:

  • [server.NewServer] starts a Bolt v5 server backed by a [cypher.Engine].

NodeID space, MaxNodeID, and live nodes

The graph.Mapper interns user keys into compact NodeIDs using a 256-way sharded layout; the shard index occupies the top byte of each NodeID. As a result MaxNodeID() typically rounds up well above the number of distinct keys, and analytical algorithms that allocate per-NodeID buffers (rank vectors, community-ID slices) produce slices of length MaxNodeID() with sentinel values in the "ghost" slots. Use graph/csr.CSR.LiveMask, LiveNodes, or LiveCount to iterate only the meaningful results.

See docs/maxnodeid.md for a worked example and recipes for translating live NodeIDs back to user keys via Mapper.Resolve.

Directories

Path Synopsis
bench
comparison/ggserver command
Command ggserver runs GoGraph behind its own Bolt server as a standalone process, so that a comparative benchmark can drive it exactly as it drives Neo4j and Memgraph: over a socket, from a client that lives in a different process.
Command ggserver runs GoGraph behind its own Bolt server as a standalone process, so that a comparative benchmark can drive it exactly as it drives Neo4j and Memgraph: over a socket, from a client that lives in a different process.
contention
Package contention is the committed contention observatory for the GoGraph Optimization Laboratory (rmp sprint 353, task #2678).
Package contention is the committed contention observatory for the GoGraph Optimization Laboratory (rmp sprint 353, task #2678).
csrorder
Package csrorder holds the permanent fixtures and measurement helpers behind the destination-ordered CSR neighbour runs delivered in sprint 313 (rmp #2141, #2142, #2143) and benchmarked under rmp #2145.
Package csrorder holds the permanent fixtures and measurement helpers behind the destination-ordered CSR neighbour runs delivered in sprint 313 (rmp #2141, #2142, #2143) and benchmarked under rmp #2145.
cyclicjoin
Package cyclicjoin holds the permanent benchmarks for the fused cyclic expand (rmp #2157, measured under #2159).
Package cyclicjoin holds the permanent benchmarks for the fused cyclic expand (rmp #2157, measured under #2159).
dimacs9
Package dimacs9 implements the harness that drives GoGraph against the DIMACS 9th Implementation Challenge shortest-paths workload.
Package dimacs9 implements the harness that drives GoGraph against the DIMACS 9th Implementation Challenge shortest-paths workload.
entryheap
Package entryheap is the committed heap-and-GC instrument for the per-key payload of the B+ tree property index (rmp sprint 353, task #2684).
Package entryheap is the committed heap-and-GC instrument for the per-key payload of the B+ tree property index (rmp sprint 353, task #2684).
expandinto
Package expandinto holds the permanent benchmarks for the bound-destination expand seek (rmp #2149) and the symmetric anchor swap (#2150), measured under #2152.
Package expandinto holds the permanent benchmarks for the bound-destination expand seek (rmp #2149) and the symmetric anchor swap (#2150), measured under #2152.
ldbc
Package ldbc implements the harness GoGraph uses against the LDBC Social Network Benchmark workloads.
Package ldbc implements the harness GoGraph uses against the LDBC Social Network Benchmark workloads.
rmat
Package rmat implements the RMAT (Recursive MATrix) generator of Chakrabarti, Zhan & Faloutsos (SDM 2004), used to produce power-law-shaped synthetic graphs that match the degree distributions observed in real-world social / web networks.
Package rmat implements the RMAT (Recursive MATrix) generator of Chakrabarti, Zhan & Faloutsos (SDM 2004), used to produce power-law-shaped synthetic graphs that match the degree distributions observed in real-world social / web networks.
soak command
cypher_rw.go — Cypher RW mixed-workload harness for the soak binary.
cypher_rw.go — Cypher RW mixed-workload harness for the soak binary.
bolt
packstream
Package packstream implements the PackStream binary serialisation format used by the Bolt protocol.
Package packstream implements the PackStream binary serialisation format used by the Bolt protocol.
proto
Package proto implements the Bolt v5 wire protocol message types, handshake negotiation, and chunked framing.
Package proto implements the Bolt v5 wire protocol message types, handshake negotiation, and chunked framing.
server
Package server implements the Bolt v5 TCP server for the GoGraph Cypher engine.
Package server implements the Bolt v5 TCP server for the GoGraph Cypher engine.
cmd
crashinject-helper command
Command crashinject-helper is the child process spawned by the crashinject harness during crash-injection tests.
Command crashinject-helper is the child process spawned by the crashinject harness during crash-injection tests.
fmtfixture command
Command fmtfixture regenerates the frozen on-disk fixtures used by the rolling-upgrade compatibility tests in store/wal, store/snapshot, and store/csrfile.
Command fmtfixture regenerates the frozen on-disk fixtures used by the rolling-upgrade compatibility tests in store/wal, store/snapshot, and store/csrfile.
gograph-import command
Command gograph-import builds a GoGraph store from CSV files, offline, at bulk-loader speed.
Command gograph-import builds a GoGraph store from CSV files, offline, at bulk-loader speed.
kgverify command
Command kgverify is the knowledge graph's fidelity gate.
Command kgverify is the knowledge graph's fidelity gate.
sim command
Command sim runs the GoGraph deterministic simulation testing (DST) harness.
Command sim runs the GoGraph deterministic simulation testing (DST) harness.
sim-xrelease-helper command
checkpoint.go is the REMOVABLE half of the cross-release helper (rmp #2477, reworked by rmp #2531).
checkpoint.go is the REMOVABLE half of the cross-release helper (rmp #2477, reworked by rmp #2531).
Package cypher provides the public query engine API for the GoGraph Cypher executor.
Package cypher provides the public query engine API for the GoGraph Cypher executor.
ast
Package ast defines the Abstract Syntax Tree (AST) for openCypher 9.
Package ast defines the Abstract Syntax Tree (AST) for openCypher 9.
exec
Package exec implements the Volcano-style executor for the Cypher query engine.
Package exec implements the Volcano-style executor for the Cypher query engine.
explain
Package explain renders Cypher execution plans as human-readable text (EXPLAIN mode) and instruments them with per-operator execution statistics (PROFILE mode).
Package explain renders Cypher execution plans as human-readable text (EXPLAIN mode) and instruments them with per-operator execution statistics (PROFILE mode).
expr
Package expr defines the runtime value model for the Cypher executor.
Package expr defines the runtime value model for the Cypher executor.
funcs
Package funcs implements the built-in Cypher function registry.
Package funcs implements the built-in Cypher function registry.
ir
Package ir defines the logical plan intermediate representation (IR) for the Cypher query compiler.
Package ir defines the logical plan intermediate representation (IR) for the Cypher query compiler.
parser
Package parser translates the ANTLR4-generated Cypher parse tree into the typed AST defined in github.com/FlavioCFOliveira/GoGraph/cypher/ast.
Package parser translates the ANTLR4-generated Cypher parse tree into the typed AST defined in github.com/FlavioCFOliveira/GoGraph/cypher/ast.
parser/gen
Package gen contains the ANTLR4-generated lexer and parser for openCypher 9.
Package gen contains the ANTLR4-generated lexer and parser for openCypher 9.
procs
Package procs defines the procedure registry for the Cypher executor.
Package procs defines the procedure registry for the Cypher executor.
sema
Package sema implements the scope-analysis pass for openCypher queries.
Package sema implements the scope-analysis pass for openCypher queries.
tck
Package tck records the conformance evolution of the GoGraph Cypher engine against the openCypher Technology Compatibility Kit.
Package tck records the conformance evolution of the GoGraph Cypher engine against the openCypher Technology Compatibility Kit.
Package ds provides small generic data-structure primitives that support gograph's algorithms but do not themselves model a graph.
Package ds provides small generic data-structure primitives that support gograph's algorithms but do not themselves model a graph.
examples
01_basic command
Example 01_basic — build a weighted directed transport network, freeze it to an immutable CSR snapshot, and run a single-source Dijkstra shortest-paths query with route reconstruction.
Example 01_basic — build a weighted directed transport network, freeze it to an immutable CSR snapshot, and run a single-source Dijkstra shortest-paths query with route reconstruction.
02_property_graph command
Example 02_property_graph — build a labelled property graph (LPG) with an optional type schema, then run label- and property-indexed MATCH-style queries and read the typed properties back out.
Example 02_property_graph — build a labelled property graph (LPG) with an optional type schema, then run label- and property-indexed MATCH-style queries and read the typed properties back out.
03_advanced_algorithms command
Example 03_advanced_algorithms — runs four algorithms over one shared, immutable CSR snapshot: BFS, Dijkstra, exact Brandes betweenness centrality, and PageRank — and reports per-algorithm evidence.
Example 03_advanced_algorithms — runs four algorithms over one shared, immutable CSR snapshot: BFS, Dijkstra, exact Brandes betweenness centrality, and PageRank — and reports per-algorithm evidence.
04_persistence command
Example 04_persistence — the full GoGraph durability path on a real directory, driven at a configurable, reproducible scale.
Example 04_persistence — the full GoGraph durability path on a real directory, driven at a configurable, reproducible scale.
05_out_of_core command
Example 05_out_of_core — Tier 2 external memory: build a scale-free web graph, persist its CSR adjacency as an on-disk csrfile, re-open it by mmap, and run semi-external PageRank directly over the mapped region.
Example 05_out_of_core — Tier 2 external memory: build a scale-free web graph, persist its CSR adjacency as an on-disk csrfile, re-open it by mmap, and run semi-external PageRank directly over the mapped region.
06_csv_import command
Example 06_csv_import — an interchange round-trip benchmark for the edge-list serialisers: generate a seeded follower graph as CSV in memory, parse it back with csv.ReadIntoCtx, then re-serialise the resulting graph as CSV with csv.WriteCtx and as newline-delimited JSON (JSON Lines) with jsonl.WriteCtx, measuring each leg.
Example 06_csv_import — an interchange round-trip benchmark for the edge-list serialisers: generate a seeded follower graph as CSV in memory, parse it back with csv.ReadIntoCtx, then re-serialise the resulting graph as CSV with csv.WriteCtx and as newline-delimited JSON (JSON Lines) with jsonl.WriteCtx, measuring each leg.
07_graphml_roundtrip command
Example 07_graphml_roundtrip — a GraphML interchange round-trip over a realistic, seeded link graph.
Example 07_graphml_roundtrip — a GraphML interchange round-trip over a realistic, seeded link graph.
08_pagerank command
Example 08_pagerank — runs PageRank over a seeded, scale-free directed web and reports the most authoritative pages, most to least important.
Example 08_pagerank — runs PageRank over a seeded, scale-free directed web and reports the most authoritative pages, most to least important.
09_leiden command
Example 09_leiden — modularity-optimising community detection with community.Leiden over a realistic, seeded planted-partition graph.
Example 09_leiden — modularity-optimising community detection with community.Leiden over a realistic, seeded planted-partition graph.
10_dimacs9_routing command
Example 10_dimacs9_routing — build a deterministic synthetic road network with the DIMACS 9 harness, freeze it into an immutable CSR snapshot, run a concrete single-source shortest-paths query (search.Dijkstra) that reconstructs a route, and measure search performance with a distribution of random probe queries.
Example 10_dimacs9_routing — build a deterministic synthetic road network with the DIMACS 9 harness, freeze it into an immutable CSR snapshot, run a concrete single-source shortest-paths query (search.Dijkstra) that reconstructs a route, and measure search performance with a distribution of random probe queries.
11_social_network command
Example 11_social_network — an end-to-end social-network workload over a labelled property graph (LPG): PageRank influence ranking, Leiden community detection, a manual friend-of-friend recommendation walk, and a structural-analytics pass (k-core, triangles, diameter, reachability), all over ONE seeded, scale-parametrised social graph.
Example 11_social_network — an end-to-end social-network workload over a labelled property graph (LPG): PageRank influence ranking, Leiden community detection, a manual friend-of-friend recommendation walk, and a structural-analytics pass (k-core, triangles, diameter, reachability), all over ONE seeded, scale-parametrised social graph.
12_build_dependency command
Example 12_build_dependency — model a software build-dependency graph, derive a valid build order with search.TopologicalSort (Kahn's algorithm), and detect a circular dependency with search.TarjanSCC.
Example 12_build_dependency — model a software build-dependency graph, derive a valid build order with search.TopologicalSort (Kahn's algorithm), and detect a circular dependency with search.TarjanSCC.
13_network_reliability command
Example 13_network_reliability — a suite of resilience analyses over ONE synthetic communication backbone, derived from a single capacitated edge list:
Example 13_network_reliability — a suite of resilience analyses over ONE synthetic communication backbone, derived from a single capacitated edge list:
14_routing_alternatives command
Example 14_routing_alternatives — compare three flavours of shortest-path computation on ONE seeded coordinate routing graph: classical single-source Dijkstra, Yen's k-shortest loopless paths for ranked alternatives, and A* driven by a coordinate-based Euclidean heuristic that expands fewer nodes than Dijkstra for the same optimal cost.
Example 14_routing_alternatives — compare three flavours of shortest-path computation on ONE seeded coordinate routing graph: classical single-source Dijkstra, Yen's k-shortest loopless paths for ranked alternatives, and A* driven by a coordinate-based Euclidean heuristic that expands fewer nodes than Dijkstra for the same optimal cost.
15_task_assignment command
Example 15_task_assignment — two bipartite assignment algorithms side by side over one seeded, scale-parametrised worker/task instance: search.Hungarian computes the globally cheapest one-to-one assignment over the full cost matrix, and search.HopcroftKarp computes the largest matching once a feasibility rule prunes the edges.
Example 15_task_assignment — two bipartite assignment algorithms side by side over one seeded, scale-parametrised worker/task instance: search.Hungarian computes the globally cheapest one-to-one assignment over the full cost matrix, and search.HopcroftKarp computes the largest matching once a feasibility rule prunes the edges.
16_centrality_analytics command
Example 16_centrality_analytics — runs a suite of analytics over one shared, immutable CSR snapshot: exact Brandes betweenness centrality, four complementary whole-graph centralities (closeness and harmonic, distance-based; eigenvector and Katz, spectral/walk-based), and label-propagation community detection — with deterministic tie-breaking, and reports per-analysis evidence.
Example 16_centrality_analytics — runs a suite of analytics over one shared, immutable CSR snapshot: exact Brandes betweenness centrality, four complementary whole-graph centralities (closeness and harmonic, distance-based; eigenvector and Katz, spectral/walk-based), and label-propagation community detection — with deterministic tie-breaking, and reports per-analysis evidence.
17_transactional_log command
Example 17_transactional_log — a durable financial ledger: a WAL-backed store with a background checkpointer that folds the log into a self-sufficient on-disk snapshot, plus recovery after a simulated crash.
Example 17_transactional_log — a durable financial ledger: a WAL-backed store with a background checkpointer that folds the log into a self-sufficient on-disk snapshot, plus recovery after a simulated crash.
18_oocore_pipeline command
Example 18_oocore_pipeline — the full out-of-core (Tier 2) pipeline: generate a directed web-link graph as a CSV edge list, ingest it through the CSV reader, freeze it into a CSR snapshot, persist that snapshot as an on-disk csrfile, re-open the file by mmap, and run semi-external BFS plus PageRank directly over the mapped region.
Example 18_oocore_pipeline — the full out-of-core (Tier 2) pipeline: generate a directed web-link graph as a CSV edge list, ingest it through the CSV reader, freeze it into a CSR snapshot, persist that snapshot as an on-disk csrfile, re-open the file by mmap, and run semi-external BFS plus PageRank directly over the mapped region.
19_pattern_query command
Example 19_pattern_query — the fluent graph/query pattern API at scale.
Example 19_pattern_query — the fluent graph/query pattern API at scale.
20_concurrent_reads command
Example 20_concurrent_reads — the lock-free read contract of a frozen CSR snapshot, exercised by many concurrent readers.
Example 20_concurrent_reads — the lock-free read contract of a frozen CSR snapshot, exercised by many concurrent readers.
21_typed_recovery command
Example 21_typed_recovery — durable recovery of a typed (int64, float64) graph through the canonical recovery.Open[N, W] path.
Example 21_typed_recovery — durable recovery of a typed (int64, float64) graph through the canonical recovery.Open[N, W] path.
22_cypher command
Example 22_cypher — the GoGraph Cypher engine, the module's flagship (100% openCypher TCK compliant at the execution level), driven over a realistic, seeded social graph.
Example 22_cypher — the GoGraph Cypher engine, the module's flagship (100% openCypher TCK compliant at the execution level), driven over a realistic, seeded social graph.
23_bolt_server command
Example 23_bolt_server is the Bolt v5 extreme-concurrency laboratory: it starts the embedded bolt/server over an in-memory labelled property graph, connects the official neo4j-go-driver/v5 as a real client, drives the wire path at a chosen number of CONCURRENT CONNECTIONS, and writes out every artefact needed to attribute what that cost.
Example 23_bolt_server is the Bolt v5 extreme-concurrency laboratory: it starts the embedded bolt/server over an in-memory labelled property graph, connects the official neo4j-go-driver/v5 as a real client, drives the wire path at a chosen number of CONCURRENT CONNECTIONS, and writes out every artefact needed to attribute what that cost.
24_social_network_cli command
Package main implements `24_social_network_cli`, an example one-shot CLI that demonstrates how to build, persist and query a labelled property graph for a social-network domain using GoGraph.
Package main implements `24_social_network_cli`, an example one-shot CLI that demonstrates how to build, persist and query a labelled property graph for a social-network domain using GoGraph.
25_software_house_api command
Command 25_software_house_api is a persistent REST WebAPI that demonstrates how to build, query and mutate a multi-layer Labeled Property Graph (LPG) with GoGraph in a production-shaped service.
Command 25_software_house_api is a persistent REST WebAPI that demonstrates how to build, query and mutate a multi-layer Labeled Property Graph (LPG) with GoGraph in a production-shaped service.
26_social_scale_bench command
Example 26_social_scale_bench — a large-scale social-network benchmark for query performance and resource consumption.
Example 26_social_scale_bench — a large-scale social-network benchmark for query performance and resource consumption.
27_concurrent_txn command
Example 27_concurrent_txn — transactional ISOLATION and ATOMICITY of the WAL-backed Cypher engine, certified under concurrency and the race detector.
Example 27_concurrent_txn — transactional ISOLATION and ATOMICITY of the WAL-backed Cypher engine, certified under concurrency and the race detector.
28_negative_weights command
Example 28_negative_weights — single-source shortest paths over a graph with NEGATIVE edge weights, using Bellman-Ford where Dijkstra cannot, and cross-checking the result against Johnson's all-pairs reweighting.
Example 28_negative_weights — single-source shortest paths over a graph with NEGATIVE edge weights, using Bellman-Ford where Dijkstra cannot, and cross-checking the result against Johnson's all-pairs reweighting.
29_all_pairs command
Example 29_all_pairs — compute all-pairs shortest paths (APSP) over one shared, immutable CSR snapshot with all three APSP algorithms the module ships — search.DijkstraAPSP, search.FloydWarshall, and search.JohnsonAPSP — cross-check that the three distance matrices are bit-identical, and derive the classical graph metrics (radius, diameter, per-node eccentricity) from the result.
Example 29_all_pairs — compute all-pairs shortest paths (APSP) over one shared, immutable CSR snapshot with all three APSP algorithms the module ships — search.DijkstraAPSP, search.FloydWarshall, and search.JohnsonAPSP — cross-check that the three distance matrices are bit-identical, and derive the classical graph metrics (radius, diameter, per-node eccentricity) from the result.
30_min_spanning_tree command
Example 30_min_spanning_tree — minimum-cost backbone design over one shared, immutable CSR snapshot: it builds a seeded, scale-parametrised geographic site network, then computes its minimum spanning tree with BOTH of GoGraph's MST algorithms — Prim (search.PrimMST) and Kruskal (search.KruskalMST) — and cross-checks them against each other as a correctness oracle.
Example 30_min_spanning_tree — minimum-cost backbone design over one shared, immutable CSR snapshot: it builds a seeded, scale-parametrised geographic site network, then computes its minimum spanning tree with BOTH of GoGraph's MST algorithms — Prim (search.PrimMST) and Kruskal (search.KruskalMST) — and cross-checks them against each other as a correctness oracle.
31_metrics_observability command
Example 31_metrics_observability — GoGraph's observability surface, driven end-to-end over a realistic, seeded service-mesh call graph.
Example 31_metrics_observability — GoGraph's observability surface, driven end-to-end over a realistic, seeded service-mesh call graph.
32_euler command
Example 32_euler — Eulerian circuits over a route-inspection network, using Hierholzer's algorithm on both an undirected and a directed graph.
Example 32_euler — Eulerian circuits over a route-inspection network, using Hierholzer's algorithm on both an undirected and a directed graph.
33_generation_swap command
Example 33_generation_swap — the read-mostly MVCC snapshot-swap pattern of graph/generation, under concurrent readers.
Example 33_generation_swap — the read-mostly MVCC snapshot-swap pattern of graph/generation, under concurrent readers.
34_bolt_transactions command
Example 34_bolt_transactions — the Bolt v5 write and transaction surface, driven end to end with the official neo4j-go-driver against GoGraph's embedded Bolt server.
Example 34_bolt_transactions — the Bolt v5 write and transaction surface, driven end to end with the official neo4j-go-driver against GoGraph's embedded Bolt server.
35_mvcc_mixed_workload command
Example 35 — reader latency under a mixed OLTP-and-analytics workload.
Example 35 — reader latency under a mixed OLTP-and-analytics workload.
36_mvcc_snapshot_topology command
Example 36 — snapshot isolation on the TOPOLOGY dimension.
Example 36 — snapshot isolation on the TOPOLOGY dimension.
37_mvcc_write_contention command
Command 37_mvcc_write_contention exercises and MEASURES the write side of GoGraph's MVCC under concurrent writers.
Command 37_mvcc_write_contention exercises and MEASURES the write side of GoGraph's MVCC under concurrent writers.
internal/exprof
Package exprof gives every program under examples/ one identical profiling contract: a -profile-dir flag that writes cpu.pprof and heap.pprof, a -trace flag that writes a runtime/trace, and a -contention flag that adds mutex.pprof, block.pprof and goroutine.pprof.
Package exprof gives every program under examples/ one identical profiling contract: a -profile-dir flag that writes cpu.pprof and heap.pprof, a -trace flag that writes a runtime/trace, and a -contention flag that adds mutex.pprof, block.pprof and goroutine.pprof.
Package graph defines the core types and interfaces shared by every backend in the gograph module.
Package graph defines the core types and interfaces shared by every backend in the gograph module.
adjlist
Package adjlist provides a mutable, sharded adjacency-list backend for the gograph module.
Package adjlist provides a mutable, sharded adjacency-list backend for the gograph module.
csr
Package csr provides an immutable Compressed Sparse Row (CSR) view of a graph for read-mostly analytical workloads.
Package csr provides an immutable Compressed Sparse Row (CSR) view of a graph for read-mostly analytical workloads.
generation
Package generation publishes immutable graph snapshots (typically csr.CSR views) under a refcount-protected pointer so readers can observe a consistent generation while a new one is being prepared in the background.
Package generation publishes immutable graph snapshots (typically csr.CSR views) under a refcount-protected pointer so readers can observe a consistent generation while a new one is being prepared in the background.
index
Package index coordinates the secondary indexes attached to a labelled property graph.
Package index coordinates the secondary indexes attached to a labelled property graph.
index/btree
Package btree provides an order-preserving property index over a constraints.Ordered value type, answering range predicates against the NodeIDs that carry each value.
Package btree provides an order-preserving property index over a constraints.Ordered value type, answering range predicates against the NodeIDs that carry each value.
index/count
Package count holds the derived, non-durable relationship count-store that backs exact cardinality estimates for the Cypher planner (design docs/count-store-design.md, task #2082).
Package count holds the derived, non-durable relationship count-store that backs exact cardinality estimates for the Cypher planner (design docs/count-store-design.md, task #2082).
index/hash
Package hash provides a sharded hash index from arbitrary comparable property values to the set of NodeIDs that carry them, represented as a 64-bit Roaring bitmap.
Package hash provides a sharded hash index from arbitrary comparable property values to the set of NodeIDs that carry them, represented as a 64-bit Roaring bitmap.
index/label
Package label provides a Roaring-bitmap-backed inverted index from label identifiers to the NodeIDs that carry them.
Package label provides a Roaring-bitmap-backed inverted index from label identifiers to the NodeIDs that carry them.
index/stats
Package stats holds the best-effort, approximate planner statistics that back the Cypher optimiser's cardinality estimates for single-column predicates (design docs/statistics-design.md, tasks #2097 / #2098).
Package stats holds the best-effort, approximate planner statistics that back the Cypher optimiser's cardinality estimates for single-column predicates (design docs/statistics-design.md, tasks #2097 / #2098).
io/csv
Package csv reads and writes graphs as edge lists in CSV format.
Package csv reads and writes graphs as edge lists in CSV format.
io/dot
Package dot writes graphs in the Graphviz DOT format (https://graphviz.org/doc/info/lang.html).
Package dot writes graphs in the Graphviz DOT format (https://graphviz.org/doc/info/lang.html).
io/graphml
Package graphml reads and writes graphs in the GraphML XML dialect (http://graphml.graphdrawing.org/).
Package graphml reads and writes graphs in the GraphML XML dialect (http://graphml.graphdrawing.org/).
io/jsonl
Package jsonl reads and writes graphs in newline-delimited JSON (NDJSON / JSON Lines) format.
Package jsonl reads and writes graphs in newline-delimited JSON (NDJSON / JSON Lines) format.
lpg
Package lpg implements the Labelled Property Graph model on top of the github.com/FlavioCFOliveira/GoGraph/graph/adjlist mutable adjacency-list backend.
Package lpg implements the Labelled Property Graph model on top of the github.com/FlavioCFOliveira/GoGraph/graph/adjlist mutable adjacency-list backend.
lpg/schema
Package schema declares the optional type schema for a labelled property graph: which labels exist, which property keys exist, which lpg.PropertyKind each property carries, and which properties each label requires.
Package schema declares the optional type schema for a labelled property graph: which labels exist, which property keys exist, which lpg.PropertyKind each property carries, and which properties each label requires.
mvcc
Package mvcc holds the timestamp and visibility primitives the versioned stores share.
Package mvcc holds the timestamp and visibility primitives the versioned stores share.
query
Package query provides a fluent, type-safe programmatic API for expressing MATCH-style pattern queries against a labelled property graph snapshot.
Package query provides a fluent, type-safe programmatic API for expressing MATCH-style pattern queries against a labelled property graph snapshot.
internal
anomaly
Package anomaly classifies an observed transaction history against the standard isolation phenomena, so a sighting names a MECHANISM instead of starting a search.
Package anomaly classifies an observed transaction history against the standard isolation phenomena, so a sighting names a MECHANISM instead of starting a search.
clock
Package clock provides a minimal, injectable wall-clock abstraction so that time-dependent code paths — the checkpoint cadence (store/checkpoint) and the Bolt session/connection deadlines (bolt/server) — can be driven by a deterministic fake clock under test (notably the deterministic simulation testing harness in internal/sim) instead of reading real wall time.
Package clock provides a minimal, injectable wall-clock abstraction so that time-dependent code paths — the checkpoint cadence (store/checkpoint) and the Bolt session/connection deadlines (bolt/server) — can be driven by a deterministic fake clock under test (notably the deterministic simulation testing harness in internal/sim) instead of reading real wall time.
concurrencydoc
Package concurrencydoc holds the CI doc-scan gate that enforces the CLAUDE.md mandate: "Every exported type carries a godoc clause stating whether it is safe for concurrent use; ambiguity is a defect."
Package concurrencydoc holds the CI doc-scan gate that enforces the CLAUDE.md mandate: "Every exported type carries a godoc clause stating whether it is safe for concurrent use; ambiguity is a defect."
crashinject
Package crashinject provides a subprocess-based crash-injection harness for deterministic crash-safety testing of WAL, snapshot, and checkpoint write paths.
Package crashinject provides a subprocess-based crash-injection harness for deterministic crash-safety testing of WAL, snapshot, and checkpoint write paths.
crashpoint
Package crashpoint holds the production-callable half of the crash-injection machinery: the Breakpoint hook and the environment variables that drive it.
Package crashpoint holds the production-callable half of the crash-injection machinery: the Breakpoint hook and the environment variables that drive it.
goldens
Package goldens provides a uniform golden-file assertion helper for tests that compare byte-for-byte output against stored fixtures.
Package goldens provides a uniform golden-file assertion helper for tests that compare byte-for-byte output against stored fixtures.
invariants
Package invariants provides hardened assertion helpers for graph property-based tests.
Package invariants provides hardened assertion helpers for graph property-based tests.
isolationtest
Package isolationtest is a declarative, exhaustive, deterministic harness for concurrent isolation scenarios — GoGraph's analogue of PostgreSQL's src/test/isolation ("isolationtester").
Package isolationtest is a declarative, exhaustive, deterministic harness for concurrent isolation scenarios — GoGraph's analogue of PostgreSQL's src/test/isolation ("isolationtester").
memlimit
Package memlimit resolves the memory this process may actually use, so the module's engine-wide ceilings can be derived from the smallest bound that is observable rather than from a constant chosen without knowledge of the host.
Package memlimit resolves the memory this process may actually use, so the module's engine-wide ceilings can be derived from the smallest bound that is observable rather than from a constant chosen without knowledge of the host.
metrics
Package metrics is GoGraph's optional observability surface.
Package metrics is GoGraph's optional observability surface.
metrics/prometheus
Package prometheus provides a [metrics.Backend] implementation that produces Prometheus-compatible text exposition output — with no dependency on github.com/prometheus/client_golang.
Package prometheus provides a [metrics.Backend] implementation that produces Prometheus-compatible text exposition output — with no dependency on github.com/prometheus/client_golang.
planseam
Package planseam carries the Cypher planner's diagnostic build counters — the seams a test reads to prove that the physical operator it means to measure is the one the engine actually built.
Package planseam carries the Cypher planner's diagnostic build counters — the seams a test reads to prove that the physical operator it means to measure is the one the engine actually built.
shapegen
Package shapegen defines a uniform contract for graph-shape generators used across property-based tests, golden corpora, and benchmarks in GoGraph.
Package shapegen defines a uniform contract for graph-shape generators used across property-based tests, golden corpora, and benchmarks in GoGraph.
sim
Package sim implements a deterministic simulation testing (DST) harness for the GoGraph engine, modelled on TigerBeetle's VOPR.
Package sim implements a deterministic simulation testing (DST) harness for the GoGraph engine, modelled on TigerBeetle's VOPR.
sortseam
Package sortseam carries the one diagnostic control that forces the Cypher sort operators back onto their LEGACY per-comparison sort-key evaluation path.
Package sortseam carries the one diagnostic control that forces the Cypher sort operators back onto their LEGACY per-comparison sort-key evaluation path.
subproc
Package subproc provides a deterministic subprocess helper for cross-process tests.
Package subproc provides a deterministic subprocess helper for cross-process tests.
synclatency
Package synclatency hands a test a seeded wal.SyncLatency, so a test that runs on a RAM drive still sees the fsync window of a real device (rmp #3022).
Package synclatency hands a test a seeded wal.SyncLatency, so a test that runs on a RAM drive still sees the fsync window of a real device (rmp #3022).
testbin
Package testbin builds the executables that test harnesses run as child processes, and keeps every such executable and every `go` build temporary on disk, outside the test process's TMPDIR and GOTMPDIR.
Package testbin builds the executables that test harnesses run as child processes, and keeps every such executable and every `go` build temporary on disk, outside the test process's TMPDIR and GOTMPDIR.
testfs
Package testfs provides a fault-injection wrapper around *os.File for use in crash-safety and durability tests of WAL, snapshot, and checkpoint paths.
Package testfs provides a fault-injection wrapper around *os.File for use in crash-safety and durability tests of WAL, snapshot, and checkpoint paths.
testlayers
Package testlayers gates tests by execution layer.
Package testlayers gates tests by execution layer.
waltest
Package waltest locates the files of a segmented write-ahead log for tests and examples that inspect or damage WAL bytes directly.
Package waltest locates the files of a segmented write-ahead log for tests and examples that inspect or damage WAL bytes directly.
Package metrics is the public observability facade for GoGraph.
Package metrics is the public observability facade for GoGraph.
Package search provides graph traversal and path-finding algorithms over the immutable github.com/FlavioCFOliveira/GoGraph/graph/csr.CSR read-only view.
Package search provides graph traversal and path-finding algorithms over the immutable github.com/FlavioCFOliveira/GoGraph/graph/csr.CSR read-only view.
centrality
Package centrality implements vertex importance metrics.
Package centrality implements vertex importance metrics.
community
Package community implements community detection algorithms for undirected graphs.
Package community implements community detection algorithms for undirected graphs.
extern
Package extern provides graph algorithms that operate directly on a Tier 2 (mmap-backed) csrfile.Reader without first materialising the CSR in memory.
Package extern provides graph algorithms that operate directly on a Tier 2 (mmap-backed) csrfile.Reader without first materialising the CSR in memory.
flow
Package flow implements network-flow algorithms over directed capacitated graphs.
Package flow implements network-flow algorithms over directed capacitated graphs.
Package store provides the composed open and teardown of a WAL-backed store.
Package store provides the composed open and teardown of a WAL-backed store.
bulk
Package bulk implements the bulk-loading path that bypasses the transactional WAL stack and writes a Tier 2 csrfile directly from a stream of edges.
Package bulk implements the bulk-loading path that bypasses the transactional WAL stack and writes a Tier 2 csrfile directly from a stream of edges.
bulkimport
Package bulkimport builds a labelled property graph from a stream of node and edge records, at bulk-loader speed, so that the result can be published as a store snapshot.
Package bulkimport builds a labelled property graph from a stream of node and edge records, at bulk-loader speed, so that the result can be published as a store snapshot.
checkpoint
Package checkpoint runs a background goroutine that periodically folds the WAL tail into a fresh snapshot and truncates the WAL.
Package checkpoint runs a background goroutine that periodically folds the WAL tail into a fresh snapshot and truncates the WAL.
csrfile
Package csrfile defines the on-disk binary format used by GoGraph's Tier 2 (out-of-core, mmap-backed) CSR storage.
Package csrfile defines the on-disk binary format used by GoGraph's Tier 2 (out-of-core, mmap-backed) CSR storage.
recovery
Package recovery rebuilds the in-memory graph state from a snapshot (when present) plus the WAL tail, and exposes the harness used to fuzz crash semantics in tests.
Package recovery rebuilds the in-memory graph state from a snapshot (when present) plus the WAL tail, and exposes the harness used to fuzz crash semantics in tests.
snapshot
Package snapshot serialises the durable on-disk representation of a gograph snapshot (CSR + LPG + schema) and reads it back into a fresh process.
Package snapshot serialises the durable on-disk representation of a gograph snapshot (CSR + LPG + schema) and reads it back into a fresh process.
txn
Package txn provides the transactional surface (Begin / Commit / Rollback) layered over an lpg.Graph and a wal.Writer.
Package txn provides the transactional surface (Begin / Commit / Rollback) layered over an lpg.Graph and a wal.Writer.
wal
Package wal implements a versioned, length-prefixed, CRC32C-checksummed Write-Ahead Log for the gograph durability stack.
Package wal implements a versioned, length-prefixed, CRC32C-checksummed Write-Ahead Log for the gograph durability stack.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL