Version: 1.0
Status: Draft (Post-Atomic Breakthrough)
License: CC-BY-4.0 (Documentation), Apache 2.0 (Implementation)
Date: November 2025
The Reality Enabler extends K3D from static spatial knowledge representation to procedural reality understanding. Instead of wrapping external simulators (physics, chemistry, biology, and other domains), K3D transmutes their behavior into sovereign PTX kernels and dual-program stars. Each reality node stores:
visual_rpn: how the object appears in 3D (form)behavior_rpn/meaning_rpn: how it behaves under domain laws (meaning)- Matryoshka embeddings + PD04 programs: compressed state for search and LOD
This specification defines how Reality Enabler galaxies, nodes, and procedures integrate with:
- The Three-Brain System (Cranium / Galaxy / House),
- The Dual-Client Contract (human vs AI perception),
- The Spatial UI Architecture (rooms, Galaxy Universe),
- The Adaptive Procedural Compression stack (PD04 + ternary codecs).
Traditional plans treated K3D as a wrapper around external simulators (e.g., Bullet, OpenFOAM, GROMACS). Reality Enabler adopts a stricter sovereign position:
- External engines and datasets are used offline to inspire and train domain-specialist kernels and RPN programs.
- At runtime, only sovereign PTX kernels and procedural programs execute.
Scope of this spec:
- Physics (rigid/soft bodies, simple fluids)
- Chemistry (atoms, molecules, materials, basic reactions)
- Biology (growth patterns, networks)
- Extensible to any computable domain (weather, astro, economics) using the same fabric.
- Procedural-First: Laws and behaviors are programs (
meaning_rpn), not tables. - Stacked Galaxies: Higher-level realities are compositions (symlinks) of lower-level atoms.
- Matryoshka Simulation: Same embedding tiers (64–2048D) serve as simulation LOD.
- Dual-Client Compliance: Humans and AI see/execute the same stars.
- Sovereign Execution: All runtime computation uses PTX kernels; external engines never run in hot paths.
Reality Enabler extends the Galaxy Universe (see SPATIAL_UI_ARCHITECTURE_SPECIFICATION §4) with domain/specialist galaxies whose stars are procedural simulations.
-
Physics Galaxy:
- Stars: forces, constraints, integrators, simple bodies, fields.
- Behavior:
behavior_rpnexecuted viaModularRPNEngine,VectorResonator,GraphCrystallizer, andWorldModelBridge(dynamic meshes, temporal coherence). - Visuals:
visual_rpn+ drawing kernels (rpn_executor.ptx,FractalEmitter) render orbits, trajectories, fields. - Current seeds (local demo layer):
- 1D constant acceleration and 1D harmonic oscillator (
ConstantAcceleration1D,HarmonicOscillator1Dinknowledge3d/cranium/physics_demo.py). - 2D central-force orbit (
Orbital2Dinphysics_demo.py). - 1D and 2D heat diffusion (
Heat1D,Heat2Dinphysics_demo.py). - Procedural storage via
PhysicsGalaxy(knowledge3d/cranium/physics_galaxy.py) using PD0x/ProceduralGalaxy as a physics‑specific galaxy root.
- 1D constant acceleration and 1D harmonic oscillator (
-
Chemistry Galaxy:
- Stars:
reality_atom(H, O, C, …),reality_molecule,reality_material. - Composition:
component_refssymlink to lower-tier nodes (atoms/bonds); no duplication of embeddings. - Behavior: valence rules, simple reactions, property predictors in
behavior_rpn, trained from tools like RDKit/OpenMM/GROMACS but distilled into sovereign programs.
- Stars:
-
Biology / Growth Galaxies:
- Stars: growth rules (L-systems, cellular automata), tissues, organs, networks.
- Behavior:
meaning_rpnexpresses growth and interaction with environment (resources, signals). - Execution:
FractalEmitterandGraphCrystallizerimplement spatial/graph evolution;TemporalReasoninghandles time-series effects.
-
Other Domain Galaxies (optional):
- Weather, astrophysics, economics, etc., follow the same pattern: define reality atoms, stacks, and behavior programs.
Reality Enabler galaxies mirror the existing text stack (letters → words → phrases):
-
Atoms → Molecules → Materials → Scenes:
- Atoms:
reality_atomnodes (physics/chem/bio). - Molecules/parts:
reality_moleculenodes withcomponent_refsto atoms/bonds. - Materials/organs/subsystems:
reality_material/reality_systemnodes withcomponent_refsto molecules/parts. - Scenes/experiments/worlds: top-level stars referencing many subsystems and a
law_rpnthat orchestrates them.
- Atoms:
-
Symlink-Style Composition:
- Higher tiers MUST refer to lower tiers via references (
component_refs,letter_refs,word_refs) instead of copying embeddings or programs. - Updating an atomic star (e.g., mass of Hydrogen, a stroke primitive) automatically improves all dependent composites.
- Higher tiers MUST refer to lower tiers via references (
Reality Enabler reuses the Adaptive Procedural Compression spec:
- PD04 programs + Matryoshka tiers
{64, 128, 512, 2048}encode:- 64D: coarse plausibility (is this stable/valid?).
- 128/512D: structural/Newtonian behavior (rigid bodies, basic reactions, coarse growth).
- 2048D: high fidelity (fluids, soft bodies, detailed pathways).
- These embeddings are regenerable from procedures and serve as:
- Search keys (find “similar” behaviors or states),
- LOD selectors for simulation (ternary/Matryoshka router chooses tier based on focus/budget).
The ternary codec and Matryoshka logic (see ADAPTIVE_PROCEDURAL_COMPRESSION_SPECIFICATION) underlie PD04 programs and ensure lightning-fast encode/decode of simulation states and laws on GPU.
Reality Enabler extends the K3D Node archetypes (see K3D_NODE_SPECIFICATION §1.3) with:
reality_atom— indivisible domain primitives (e.g., H, gravitational point mass, cell type)reality_molecule— structured composites (molecules, mechanisms, small subsystems)reality_material— bulk/continuum-level entities (materials, tissues, fields)reality_system— full systems (experiments, scenes, organisms, weather cells, orbital systems)
Every reality node MUST provide:
-
Semantic Identity:
- Domain invariants (mass, charge, valence, phase, lattice type, organism class, etc.).
- Units and reference frames made explicit in metadata.
-
Procedural Programs:
visual_rpn: how to draw/render at each LOD (atoms as spheres/clouds, bonds as cylinders, fields as volumes/lines).behavior_rpn/meaning_rpn: how the object behaves under domain laws:- physics: force accumulation, simple integrators, constraints;
- chemistry: reaction templates, bond changes, phase changes;
- biology: growth/decay, specialization, signaling.
- Optional
law_rpn: localized constraints (e.g., conservation, stability bounds) used during SleepTime/House materialization.
-
Compositional References:
component_refs: pointers to lower-tier nodes (atoms, molecules, parts).- For mixed scenes, nodes MAY also reference text/diagram nodes (e.g., formula diagrams; see drawing grammars galaxy).
-
Embeddings & Compression:
- Matryoshka tiers
{64, 128, 512, 2048}regenerated from procedures and encoded as PD04 programs. - PD04 programs themselves MAY be stored in
extras.k3dalongside RPN code; ternary kernels handle on-GPU decode.
- Matryoshka tiers
At runtime:
-
Human clients:
- Render
visual_rpnresults as geometry via the spatial UI (Library, Workshop, Bathtub). - Perceive simulations as evolving 3D scenes (or diagrams).
- Render
-
AI clients:
- Execute
behavior_rpn/meaning_rpnvia:ModularRPNEngine(core RPN VM),VectorResonator(vector blending, similarity, field composition),GraphCrystallizer(constraint and neighborhood aggregation),TemporalReasoningandWorldModelBridge(time evolution, dynamic mesh updates),GalaxyResonanceEngineandGalaxyMemoryUpdater(state writing to Galaxy).
- Use PD04 programs + ternary codecs to load/store simulation states at appropriate LOD.
- Execute
Dual-client contract: both clients operate on the same node data; the only difference is how they view/execute it.
- Hosts the PTX kernel suite that executes reality RPN programs:
- RPN execution (
ModularRPNEngine), - vector/field blending (
VectorResonator), - graph aggregation (
GraphCrystallizer), - temporal/world modeling (
WorldModelBridge,TemporalReasoning).
- RPN execution (
- Uses ternary/Matryoshka logic to select simulation fidelity given:
- user focus (e.g., avatar gaze, room context),
- GPU budget,
- Error tolerances from
law_rpn.
- Stores reality stars in their respective galaxies (physics, chemistry, biology, etc.).
- Maintains:
- current simulation states (embeddings + PD04 programs),
- structural graphs (who interacts with whom),
- spatial positions (where in the Galaxy Universe reality nodes live).
- Cross-galaxy queries (see SPATIAL_UI_ARCHITECTURE_SPECIFICATION §4.4) can mix reality galaxies with text/visual/audio/reasoning galaxies (e.g., “find molecules similar to this and scenes where they appear”).
- SleepTime consolidation (see SLEEPTIME_PROTOCOL_SPECIFICATION) MUST:
- validate candidate scenes with Reality Enabler specialists using
law_rpn(basic physics/chem/bio plausibility checks), - crystallize validated scenes as House GLBs (rooms, objects, Knowledge Gardens artifacts),
- optionally archive rejected or experimental artifacts to Museum.
- validate candidate scenes with Reality Enabler specialists using
- Reality artifacts are standard House objects:
- a “Lab” room with running experiments,
- a “Material Library” shelf with stable materials,
- a “Cell Garden” representing growth experiments.
Reality Enabler reinforces the Dual-Client Contract:
- Every simulation visualized in the House or Galaxy MUST:
- correspond to a reality node with executable
behavior_rpn, - allow AI to re-run or approximate the same behavior on demand.
- correspond to a reality node with executable
- Action buffers (288-byte contract) MAY include simulation intents:
- “start/stop simulation in this region,”
- “increase LOD around this node,”
- “materialize stable snapshot into House.”
- Human-visible anomalies (e.g., impossible geometry) SHOULD be traceable back to:
- a specific set of reality nodes and
law_rpnprograms, - enabling debugging and refinement of domain specialists.
- a specific set of reality nodes and
An implementation conforms to the Reality Enabler Specification if it:
- Implements at least one Reality Enabler galaxy (physics, chemistry, or biology) with dual-program stars and Matryoshka+PD04 embeddings.
- Represents reality objects as compositional
reality_*nodes with:visual_rpn,behavior_rpn/meaning_rpn,component_refsto lower-tier nodes (symlink-style),- regenerated Matryoshka embeddings encoded via PD04 programs.
- Executes reality programs using sovereign PTX kernels (no external engine calls in hot paths).
- Exposes simulations through the Dual-Client Contract:
- humans see evolving geometry in House/Galaxy,
- AI executes the same programs via Cranium kernels.
- Integrates with SleepTime consolidation so that:
- physically/chemically/biologically plausible scenes are crystallized to House,
- invalid scenes are either corrected or archived.
This specification is intentionally storage- and semantics-first:
- Normative:
- Node shapes (
reality_*types,visual_rpn,behavior_rpn/law_rpn,component_refs). - Galaxy structure (specialist galaxies, stacked composition, Matryoshka+PD04 usage).
- Dual-client contract (same stars for humans and AI).
- Node shapes (
- Non-normative:
- The current CUDA/PTX implementation of math cores and bridges.
Other engines and backends (e.g., Vulkan compute, WebGPU, Metal, CPU SIMD, or even transformer-based modules that implement the same behavior_rpn semantics) MAY be used, as long as they:
- respect the RPN and opcode semantics defined by the Math Core and RPN foundation docs,
- preserve determinism guarantees for laws and PD04 decompression where required,
- continue to honour the dual-client and Three-Brain contracts.
K3D’s PTX+RPN stack is therefore a reference implementation, not a constraint on the standard. The standards live in the glTF+extras.k3d schemas, Matryoshka/PD04 programs, and RPN law semantics; multiple heterogeneous engines can coexist above that substrate, just as multiple LLM architectures coexist above common data formats today.
docs/vocabulary/SPATIAL_UI_ARCHITECTURE_SPECIFICATION.mddocs/vocabulary/K3D_NODE_SPECIFICATION.mddocs/vocabulary/DUAL_CLIENT_CONTRACT_SPECIFICATION.mddocs/vocabulary/THREE_BRAIN_SYSTEM_SPECIFICATION.mddocs/vocabulary/ADAPTIVE_PROCEDURAL_COMPRESSION_SPECIFICATION.mddocs/vocabulary/MATH_CORE_SPECIFICATION.mddocs/Reality_Enabler.md