Semantic Fractal Topology
A content-versioned, language-addressable spatial intermediate representation with deterministic proof semantics
Abstract
Semantic Fractal Topology is a content-versioned spatial intermediate representation designed to be operated through language without assigning geometric or physical authority to a language model. It combines a typed semantic scene graph, recursive sparse spatial index, local metric frames, deterministic solver registry, immutable revision ledger, bounded interchange adapters, and an observation surface that exposes why a result was produced.
Version 2 advances the work from a specified architecture and compact teaching deck to an implemented browser-local reference runtime. The implementation can normalize five bounded scene projections, validate graph and frame structure, compile approved language patterns into typed commands, dispatch eight solver classes, maintain content-addressed branches, create non-accepted two-parent merge candidates, and exercise twelve authored application cases.
The implementation does not establish production geometric accuracy, native interchange completeness, building-code compliance, structural behavior, robot safety, or performance advantage. It establishes a concrete architecture and deterministic fixture behavior that can now be benchmarked.
1. Canonical definition
Semantic Fractal Topology is a content-versioned, multiresolution spatial representation in which language addresses typed world state through recursive regions and relations while deterministic kernels retain authority over metric and physical claims.
“Fractal” refers to recursive resolution, sparse refinement, and self-similar addressing. It does not require a literal Sierpinski construction and does not imply magical compression. The implemented index is an adaptive octree because it provides a complete, understandable partition for bounded three-dimensional fixtures.
2. Responsibility planes
The runtime separates five responsibilities.
Language control plane
Language is compiled into a closed typed-command union. The compiler may nominate an entity, opening, route, assembly, service object, or spatial scope. It cannot declare a collision, a fit, a safe route, or an accepted revision.
The reference compiler is deliberately deterministic and rule-based. A future language model may produce the same command schema, but its output must pass the same entity-resolution and command-validation gates.
Spatial memory plane
The typed scene graph stores:
- persistent entity identity;
- semantic kind;
- recursive containment;
- connectivity and adjacency;
- support and attachment;
- assembly dependency;
- service and access-zone relations;
- robot or game traversal edges;
- local metric frame;
- exact or bounded volume;
- attributes;
- and source lineage.
This plane answers “what exists and how it is related.” It does not independently answer questions that require metric or physical calculation.
Locality plane
The adaptive recursive index stores world-space bounded entities in occupied octree branches. It supports stable spatial keys, point queries, bounded-range queries, and broad-phase candidate reduction.
The index is derived state. It may be rebuilt from the graph and frames. It does not become canonical truth merely because it is efficient to query.
Deterministic execution plane
Typed commands are routed to named kernels. Each kernel declares its scope, precision, trace, warning boundary, and structured result.
The current runtime includes:
- bounded box-through-opening fit;
- adaptive-octree AABB broad-phase collision;
- graph and frame constraint validation;
- clearance-aware typed reachability;
- assembly topological order;
- authored architectural project-policy checks;
- authored service-access-zone obstruction checks;
- and containment-change proposals.
History and authority plane
Canonical serialization produces SHA-256 content identities. A scene revision includes exact content, parent revision IDs, deterministic logical time, actor, event, and optional typed command. Branch names point to revisions but are not revisions themselves.
MAIN represents the accepted line in the public fixture. Agents and users work on separate branches. A clean deterministic merge may create a two-parent MERGE_CANDIDATE, but the candidate does not alter MAIN and does not award itself acceptance.
3. Typed semantic scene graph
The public graph schema is sft.scene.v1.
SceneGraph
├── metadata
├── MetricFrame[]
├── SceneEntity[]
└── SceneRelation[]
Entity identity
Entity_ID is persistent identity. It does not change merely because an entity moves, receives new bounds, enters another container, or appears in another projection.
Implemented entity kinds cover the initial product cases:
world, site, building, level, space, opening,
object, assembly, part, service, access-zone,
robot, robot-link, path-node, obstacle,
game-actor, game-item
Typed relations
The relation ledger currently supports:
contains, adjacent_to, connected_to, opens_into,
supported_by, attached_to, requires_before, blocks,
reachable_from, services, mounted_on, joint_to, occupies
Every relation has an ID, endpoints, direction, attributes, and source pointer. Relations can carry bounded facts such as minimum clearance, blocked state, joint type, or authored policy labels.
Validation
The graph validator checks:
- schema root presence;
- unique frame, entity, and relation IDs;
- root entity existence;
- known frame references;
- known relation endpoints;
- nonnegative tolerance;
- non-inverted bounds;
- metric-frame cycles;
- containment cycles;
- assembly-order cycles;
- and unusual self-relations or contained roots.
An entity without bounds is a legal semantic object. The validator warns rather than inventing a volume.
4. Exact and bounded local metric frames
A metric frame contains:
{
id,
origin: [x, y, z],
basis: [[...], [...], [...]],
unit,
precision,
tolerance,
parentFrameId?
}
Frames may compose through a parent chain. The runtime converts local points and bounded volumes into a world frame with explicit unit conversion. It detects cycles before or during transformation.
A bounded volume contains minimum and maximum coordinates, unit, tolerance, source, precision, and frame ID. Interval arithmetic propagates tolerance into signed clearance.
This supports an important distinction:
semantic relation metric evidence decision
object --near--> opening absent UNKNOWN
object --fit?--> opening exact dimensions PASS or FAIL
object --fit?--> opening overlapping tolerance UNKNOWN
The implementation uses boxes and intervals because they are inspectable and deterministic. Arbitrary mesh geometry remains an external authority for queries that require it.
5. Adaptive recursive spatial index
The implemented locality structure is an adaptive octree.
Insertion
- Convert each bounded entity to world millimeters.
- Compute one enclosing cubic root cell.
- Insert each entity into the deepest single child that fully contains it.
- Retain entities spanning multiple children at the parent.
- Subdivide only when occupancy exceeds the bucket threshold and the cell remains above the minimum size.
Query
A range query visits only intersecting branches and tests retained entities. A point query is a zero-volume range query followed by exact bounded containment. A spatial key follows the child containing the queried centroid or point.
oct/3/6/2/0
The key identifies a recursively bounded region at the current index configuration. It is not permanent entity identity and is not a complete geometric description.
Rebuildability
The index snapshot is observable but derived. The authoritative graph, frames, and bounds can regenerate it. This aligns the runtime with the Glyphd distinction between canonical state and disposable projections.
6. Content-addressed revisions
Four identifiers remain separate:
Entity_ID persistent object identity
Spatial_Key derived current locality address
Content_ID hash of exact canonical scene content
Revision_ID hash of content, parents, and event
Canonicalization
Objects are recursively key-sorted. Undefined, function, and symbol values are excluded. Non-finite numbers are refused. Negative zero normalizes to zero. Arrays preserve order. The canonical string is hashed with a pure synchronous SHA-256 implementation so the browser and test runtime share one deterministic path.
Branching
A branch operation copies only the pointer to the source revision. It does not duplicate or mutate the revision.
MAIN ── R0
├── AGENT_A ── R1
└── AGENT_B ── R2
Conflict assessment
The runtime finds a common ancestor and compares:
- graph envelope;
- frames;
- entities;
- relations.
Overlapping changed IDs create a conflict. Disjoint changes are eligible for a merge candidate.
Multi-parent candidate
A clean merge applies both diffs to the common ancestor and validates the resulting graph. It then materializes a revision whose parents are the two branch heads.
AGENT_A R1 ─┐
├── R3 MERGE_CANDIDATE
AGENT_B R2 ─┘
MAIN remains R0
This is shared spatial state without silent consensus. The candidate still requires a separate authority decision.
7. Language-to-command compilation
The command schema is a discriminated union:
QUERY_FIT
QUERY_COLLISION
VALIDATE_CONSTRAINTS
QUERY_REACHABILITY
AUDIT_ASSEMBLY
AUDIT_ARCHITECTURAL_CLEARANCE
AUDIT_SERVICE_ACCESS
MOVE_ENTITY
The reference compiler normalizes punctuation and whitespace, matches an approved grammatical pattern, resolves entity references, and returns one of four states:
COMPILED;AMBIGUOUS;INVALID;UNSUPPORTED.
A language model can later sit in front of this interface, but it must produce the same typed object and remain subject to the same deterministic gates. The language model is not the solver and cannot bypass missing evidence.
8. Solver registry
Fit
The fit solver compares the two-dimensional projections of a bounded box with the two largest opening dimensions. It can test three axis-aligned orientations. It returns the worst-axis signed clearance interval.
It does not prove that an object can be maneuvered along a path, rotated continuously, deformed, or passed through an irregular mesh.
Collision
The collision path uses the adaptive index to reduce pairs and then checks bounded AABB intersection. Every overlap is labeled a narrow-phase candidate.
The implemented result is useful for coarse audit and candidate generation. It is not exact mesh collision or continuous time-of-impact.
Constraints
The constraint solver exposes graph-validation issues as a structured solver result. It checks structural consistency, not material or mechanical behavior.
Reachability
The reachability solver traverses connected_to, opens_into, and reachable_from edges. It respects blocked edges, blocked nodes, direction, and optional minimum-clearance attributes. It returns a deterministic entity and relation path.
It is not a robot motion planner, inverse-kinematics solver, or dynamic navigation controller.
Assembly order
The assembly solver performs a topological sort over requires_before. It returns an exact dependency order or fails on a cycle.
It does not infer tool access, torque, human ergonomics, adhesive cure, or manufacturing tolerance unless those are explicitly modeled by another kernel.
Architectural project policy
The initial policy kernel checks authored opening width, route width, headroom, and service depth against a named fixture policy. Every output says that it is project policy, not jurisdictional code certification.
This distinction makes the mechanism immediately useful without falsely presenting a browser fixture as a licensed code review.
Service access
A service object may link to an authored access-zone volume. The solver checks bounded solid entities for overlap with that zone and reports obstruction candidates.
Move proposal
A move command proposes replacing the current containment edge. The user may commit it to a non-main branch. The solver cannot directly rewrite accepted state.
9. Bounded import adapters
glTF 2.0 JSON
The adapter reads node hierarchy, translation, quaternion rotation, scale, names, semantic extras, and authored bounds in node or mesh extras. It does not decode binary accessors into exact geometry.
OpenUSD ASCII subset
The parser recognizes a bounded public USDA subset: def Xform, Scope, Mesh, and Cube, plus translation, extent, and cube size. It exposes ignored composition, variant, material, and time features.
CAD manifest v1
The CAD path is an explicit projection manifest. It carries assemblies, parts, metric frames, bounds, dependencies, and source pointers. It is not native STEP/IGES parsing and does not reconstruct B-rep or NURBS geometry.
BIM/IFC projection v1
The BIM path carries spaces, openings, services, containment, connectivity, and bounds from an upstream IFC-aware exporter. It is not an IFC parser and cannot certify code compliance.
Robot scene graph v1
The robot path carries robot links, joints, world objects, obstacles, path nodes, blocked state, and clearance attributes. It is not native URDF/SDF parsing, IK, SLAM, collision geometry, or controller execution.
10. Implemented application fixtures
The runtime currently exercises six near-term application families plus import normalization.
Auditable clearance
A sofa/opening query exposes the typed command, dimensions, tested projections, signed clearance interval, solver trace, and bounded warning.
Architectural clearance audit
A deliberately noncompliant authored fixture proves that the policy kernel can return failure without hiding the exact checks. It does not prove code-review accuracy.
Service-access validation
An authored air-handler access zone overlaps a stored crate. The runtime reports the obstruction candidate and access-zone source.
Assembly sequencing
A cabinet fixture yields a deterministic six-step sequence from base through door. A cycle would fail rather than produce a plausible order.
Robot environment memory
A mobile robot reaches a charging dock through a wide aisle while a narrow aisle remains blocked. The scene preserves identities, frames, route edges, and obstruction state.
Deterministic game state
A player cannot reach an exit while the hall-to-exit edge remains locked. Separate agent branches may propose unlocking the door and moving a key, then produce a non-accepted clean merge candidate.
11. Public interface
The native workbench has five surfaces:
- Command + solve — compile and dispatch requests;
- Scene + index — inspect entities, relations, frames, spatial keys, and recursive nodes;
- Import adapters — normalize five bounded source projections and expose ignored features;
- Revisions + agents — fork branches, compare addressed changes, and create non-accepted candidates;
- Application fixtures — inspect all deterministic conformance rows.
The active scene and operation receipt are downloadable. The page also exposes machine-readable scene, command, and revision schemas, a runtime manifest, an authored architecture fixture, and the application fixture receipt.
12. Evidence state and next work
The reference architecture and browser runtime are IMPLEMENTED. The twelve authored application rows satisfy DETERMINISTIC_FIXTURE_CONFORMANCE.
The following remain AWAITING_LOCAL_RUN or unimplemented:
- independent analytic and geometry-engine comparison corpus;
- native glTF accessor geometry;
- complete OpenUSD and IFC import;
- native STEP/IGES or CAD-kernel bridge;
- mesh and continuous collision;
- robust motion planning;
- real architectural project imports;
- code-authority integration;
- large sparse-scene scaling measurements;
- language-model command compilation evaluation;
- cross-device or server-backed shared revision stores;
- and external reproduction.
The benchmark contract now has a real runtime to measure. No unrun hypothesis is promoted by the implementation itself.