github ↗

A geometry-driven execution substrate where autonomous agents — Flatlanders — move and interact inside a curved manifold, and the geometry itself constrains what they can do. THEVM treats a manifold as the computer. Instead of instructions running on a flat memory model, processes flow along geodesics through a space that can be flat, toroidal, cylindrical, curved, or a discrete graph. Curvature bends motion, topology creates wraparound and holonomy, and region policy shapes which operations are permitted where. The system measures the emergent behavior that results.

It ships in two halves: the Manifold VM core — a backend-agnostic Java library of geometry, agents, an execution runner, and a metrics layer, built around a deliberately strict interface contract; and the Workbench — a Spring Boot web app with a Three.js + OpenCV.js frontend for authoring manifold seeds from drawn curves or optimization output, compiling them into live manifolds, and visualizing their curvature in 3D.

virtual machine manifolds differential geometry emergence Java 21
active · v1

This is an architecture project first. Four design decisions the code takes seriously:

Structural capability vs. runtime policy are kept separate
RegionCapabilities answers what the geometry permits — can an agent spawn, merge, jump layers, wrap around here? RegionPolicy answers how the runtime should weight or correct behavior right now. Capabilities never encode policy, and policy never claims a structurally-impossible operation. The split keeps "the shape of the world" independent from "the rules of the game."
Convention registries instead of magic strings
Every key that enters an attribute map — every event type, operation name, topology name, and constraint key — must come from a constant in the conventions package (AttributeConventions, CommonEventTypes, CommonTopologyTypes…). No new key is allowed without a named constant first. The flexible Map<String,Object> surfaces stay auditable instead of becoming a free-for-all.
Holonomy is observable, not silently erased
On curved or topologically non-trivial manifolds, parallel-transporting a vector around a closed loop can return it rotated. Implementations must document their holonomy policy (PRESERVE / APPROXIMATE / FLATTEN) and must not quietly remove the effect — because that holonomy is exactly the kind of emergent geometric behavior the VM exists to study.
Flatlanders are first-class actors
The runner only advances time. Each agent senses its neighborhood, consults capabilities and policy, and decides its own move during executeStep(...). The simulation is agent-driven, not orchestrator-driven.

The layers stack bottom-up: geometry primitives are backend-agnostic; the manifold binds them into a space with capabilities and policy; Flatlanders act inside that space; the runner advances time and emits immutable snapshots; and the metrics layer measures what emerges.

Spatial / Geometry Position · MotionVector · CurvatureField · Transition · Neighborhood Manifold ManifoldSpace · ManifoldDescriptor · RegionCapabilities · RegionPolicy Flatlander (agents) Flatlander · FlatlanderState · Lineage · SimilaritySignature Execution ManifoldRunner · ExecutionContext · StoppingCondition · SystemSnapshot Events & Metrics Emergence · Performance · Lineage · Topology · Event // the Workbench (Spring Boot + Three.js) drives the Manifold layer Workbench ─► Manifold

Module map:

packageresponsibility
machineCore interfaces + convention registries — the contract everyone implements.
manifolds.continuousContinuous-manifold contracts; implementations: FlatPlane, ToroidalManifold, CylindricalManifold, CurveManifold.
manifolds.discreteGraph-based manifold contracts + a layered discrete-graph implementation.
executionRunner, intersection handling, geodesic flow engine, SOM vector sink / observer.
metricsEmergence and performance metrics implementations.
workbenchSpring Boot REST app: seed ingestion → validation → manifold compilation → curvature sampling → visualization.

Manifolds implemented:

manifoldbackendcurvaturenotable behavior
FlatPlanecontinuousK = 0Euclidean baseline.
ToroidalManifoldcontinuousK = 0Periodic wraparound in both dimensions; multiple geodesics; non-trivial winding on non-contractible loops.
CylindricalManifoldcontinuousK = 0Wraparound in one dimension.
CurveManifoldcontinuousvariesBuilt from sampled curve points — the manifold the Workbench currently compiles seeds into.
SimpleDiscreteGraphManifolddiscreten/aLayered graph topology with layer-jump transitions.

The Workbench turns a 2D input — a drawn curve or an optimization / solver output — into a compiled manifold and renders its curvature field in 3D. Pipeline: validate → parse & normalize → build ManifoldSpace → sample curvature → interpret gates → store → assemble response.

method & pathpurpose
POST /seedSubmit a manifold seed; returns the compiled descriptor, normalized curve, curvature samples, and gate descriptors.
GET /{id}Fetch the compiled descriptor for a stored manifold.
GET /{id}/curvatureSample the curvature field across the manifold (?resolution=N).
GET /{id}/gatesGate descriptors — hotspot-derived regions.
POST /{id}/simulate/dry-runProbe simulation (roadmap).
GET /workbenchServes the interactive Three.js workbench UI.

Requirements: Java 21, Maven 3.8+. The first build downloads Spring Boot 3.2 dependencies, so it needs network access once; subsequent builds work offline.

# from the machine/ module mvn clean compile mvn spring-boot:run # serves on http://localhost:8081 # then open the workbench UI, or drive the API directly: curl -X POST http://localhost:8081/api/v1/manifold/seed \ -H "Content-Type: application/json" \ --data @opimization_output_valid.json

An actively-developed v1. The architecture and the geometry layer are the mature parts; some higher layers are intentionally scoped as clean-boundaried stubs rather than half-finished features.

  • doneCore interface contract, convention registries, capability / policy split.
  • doneContinuous manifolds (flat, torus, cylinder, curve) with geodesics, parallel transport, and curvature.
  • doneDiscrete layered-graph manifold.
  • doneWorkbench: curve & optimization-output seeds → compiled CurveManifold → curvature sampling → 3D visualization.
  • wipWorkbench dry-run simulation — endpoint is wired; the probe-actor simulation behind it is the next layer.
  • wipSOM-output seeds — the som_output builder is not yet implemented.
  • wipEmergence metrics — snapshot plumbing exists; clustering / similarity scoring currently returns conservative placeholders.
  • wipWiring torus / cylinder / discrete manifolds into the Workbench authoring path — they exist in the core library today.