ESCHER-GPU#

ESCHER-GPU is the code of ESCHER and ESCHER+ (IPDPS 2026, TKDE 2026; dyng.citation("triad_count"), keys escher2026 and escherplus2026): a GPU data structure for dynamic hypergraphs built from Complete Binary Search Trees (CBSTs) for the hyperedge-to-vertex (H2V), vertex-to-hyperedge (V2H) and hyperedge-to-hyperedge (H2H, the line graph) relations, updated in place under batches of hyperedge deletions and insertions, and the h-motif triad counts that run on it. dynG’s ESCHER store (hypergraph_storage::escher, the hypergraph container) and triad_count are ports of it.

Repository

SMShovan/ESCHER-GPU

Pinned commit

abcf9b2bd42f896ec3103a6835edf713ed5e416c (2026-09-24)

Paper snapshot

tag baseline-2026-09 = 6a44c1c

History

80 commits, 2024-06 to 2026-09, all by S M Shovan (66 under his identities, 14 under the placeholder CUDA <user@example.com>, Provenance and copyright holders); 34 AI-assisted (the 2026 fixes)

Ported in

M8a (the CBST store, a reproducible transplant), M8b (the hypergraph container on it, the line graph’s sorted delta merge), M9a (triad_count: the wedge engine, the 30-bin h-motif counts, StatHyper’s types 1-3), M9b (experimental::count_local_patterns, Python, the command line)

Parity

the store’s operation traces replay exactly against both of its originals (M8a); the container’s ids and rows (M8b); the triad counts exact on the 300-case golden set on cuda and on the coverage table of the host backends, by key and by content (M9a, M9b)

Gates

the paper-timed update per batch 0.85-1.03x of ESCHER-GPU’s, the full count 1.00x, end to end 0.92-0.99x, the device memory 1.00x (store accounting) and 1.002x (the peak of live allocations), on M9a’s and again on M9b’s library, against ESCHER-GPU re-measured in the same session (triad_count: hypergraph h-motif triad counts, section 5)

The code was a CUDA research prototype with a hand-written Makefile, five executables (main for the 30-bin h-motif counts, type1-type3 for StatHyper’s triad statistics, coarseTriangle) and one hard-coded batch. Its 2026 fixes (the branch fix/correctness-perf) gave it a shared driver, a dataset loader, multi-batch runs, stage timers, a CPU reference counter, a CBST integrity checker and make test, which dynG’s parity harness builds on.

What was ported, from which files#

ESCHER-GPU@abcf9b2

dynG

kernel/build_tree.cu, kernel/insert_reuse.cu, kernel/payload.cu, kernel/unfill.cu, kernel/delete_avail.cu, kernel/find.cu, structure/operations.cu (CBSTOperations, constructCBST, insertCBST, unfillCBST)

the internal cbst_store behind hypergraph_storage::escher (cpp/src/hypergraph/escher; construct, insert, erase, append = fill, remove_values = unfill), a transplant regenerated by parity/escher_port/transplant.py (ADR 0038)

structure/dynamic_hypergraph.cu (DynamicHypergraph, update, deviceBytes())

hypergraph::apply, storage_stats::device_bytes (the same scope)

structure/graph_maintenance.cu, kernel/delta_merge.cu (the H2H sorted delta merge)

line_graph_policy::sorted_merge (ADR 0042)

kernel/locator.cu (the key-indexed row views)

the store’s internal row views (cpp/src/hypergraph/row_views.hpp)

kernel/wedge.cuh, kernel/count_ops.cuh, kernel/motif_utils.cuh, include/motif_table.hpp (countTriangles<Op>, MotifOp, Choose3Op), src/type2.cu, src/type3.cu

triad_count’s wedge engine (dyng/experimental/detail/local_patterns_kernels.cuh, cpp/src/algorithms/triad_count/engine/), the built-in Ops of pattern::h_motif, stathyper_type1..3, and experimental::count_local_patterns<op_t> (ADRs 0053, 0058)

src/HMotifCount.cu, src/HMotifCountUpdate.cu, src/main.cu, src/type1-3.cu, src/driver.cu (DynamicCounter, MotifCounter)

triad_count::compute / update on the problem local_pattern_problem (ADR 0052); dyng-compat-escher run (the drop-in driver of the gates, ADR 0051)

include/frontier.hpp, include/device_bins.hpp

the workspace of cpp/src/algorithms/triad_count/cuda.cu

utils/reference.cpp (the CPU reference)

the algorithm (the sequential and OpenMP backends are incremental, ADR 0054) and, independently, the oracle testing::triad_reference (ADR 0049)

utils/utils.cpp (generateHypergraph, loadHypergraph), include/batch.hpp and utils/batch.cpp (Batch, BatchGenerator)

generators::legacy::escher_hypergraph, escher_batch_generator, escher_host_model; io::read_hypergraph (hypergraph_read_options::escher_gpu())

Not ported: coarseTriangle (inner, outer, hybrid and hyperedge triangles over the vertex graph V2V; planned for a later release, 0.5 in the roadmap), the --verbose dumps, and the GPU monitor scripts of bench/.

What was fixed in the original before the port#

Recorded in the original’s CHANGES.md (E-C: correctness, EP: GPU performance, H-E: host performance), on coauth-DBLP (2,467,389 hyperedges, a line graph of 251.5M entries) and the synthetic 1M / 2M hypergraphs, against baseline-2026-09:

  • E-C1 the CBST position formula overflowed int32 above 65,535 keys, so searches failed and the counting kernels skipped almost everything (1,430 triangles on coauth instead of 8,354,454,505); E-C2 a missing row terminator; E-C4 32-bit bins that overflowed on coauth.

  • E-C3 the papers’ anchored delta was inexact (coauth, 50K batch: delta sum -88,969,857 against the true +1,771,385); replaced by the exact frontier-incident delta (EP1), the delta dynG ports.

  • E-C5, E-C6, E-C9 the best-fit reuse insert truncated rows, V2H used shifted keys and stale occupancy, and unfill across chained segments corrupted later fills; E-C7 the type-2 and type-3 deltas counted only part of the changed pairs (and the open h-motifs are out of scope by design); E-C8 a time-seeded RNG per call; E-C10 debug output in the timed path.

  • EP2-EP5, H-E1 the wedge-parallel counting kernels with row views, the GPU sorted delta merge of H2H, per-tree payload capacities and device-side tree operations, the parallel host build: coauth 50K per batch 136.7 s -> 0.546 s and the full count 78.7 s -> 5.2 s against the correctness-equivalent baseline (results/README.md).

The wording of the three items the papers’ figures depend on (E-C1, E-C3, E-C7) is “Paper vs fixed code” on the triad_count: hypergraph h-motif triad counts page.

What differs in dynG#

  • One container, two originals. ESCHER-GPU’s store and MOSP_ESCHER’s are merged into one store with presets (capacity_policy::escher_gpu(), mosp_escher(), dyng_default(); ADRs 0039, 0040), and the hypergraph container keeps the store, the line graph and the row views per version with fewer host synchronizations (19-22 per batch against ESCHER-GPU’s 90-96).

  • Exact on every backend. The sequential and OpenMP backends run the same engine as loops (incremental, not a recount); the counts are exact up to 2^64 - 1 everywhere and refused past it (ADR 0057), where ESCHER-GPU’s StatHyper arithmetic wraps from 2,097,152 members per hyperedge.

  • The engine is an extension point. experimental::count_local_patterns<op_t> runs a user’s pattern (an Op) on the same engine with the same exact updates (Count a new hypergraph pattern (an Op)).

  • Ids. Bins and hyperedge ids are 0-based (ESCHER-GPU’s h-motif k is bin k - 1, its CBST key k + 1 is hyperedge k); no key, +1 shift or sentinel appears in the API.

The mapping of every name is section 9 of triad_count: hypergraph h-motif triad counts.