Spatial memory under environmental change
A small, CPU-only benchmark comparing three ways for an embodied agent to remember where things are while the world changes underneath it.
Code and tests Two-page report Raw metrics
The question
As an environment changes and the mission gets longer, which memory representation stays correct at an acceptable memory and update cost?
What was compared
An object graph, a dense 16 x 16 x 8 voxel grid, and a 32-unit coordinate MLP trained online in numpy. All three share one interface. Objects move, appear and are removed. Queries are drawn from ground truth: current position, past position, region change, and stale objects.
Results
| Memory | Current success@2 | Past success@2 | Persistent size | Peak memory | Update |
|---|---|---|---|---|---|
| Object graph | 0.880 | 0.867 | 15.4 KB, growing | 63 KB | 0.016 ms |
| Dense grid | 0.880 | 0.693 | 24.6 KB, flat | 31 KB | 0.142 ms |
| Coordinate MLP | 0.027 | 0.013 | 12.2 KB | 1.36 MB | 40.7 ms |
The graph keeps identity and history but grows. The dense grid is flat but loses history and ids to voxel collisions. The small MLP is compact on disk and expensive in RAM, and this configuration has no usable operating point. That is a result about one 32-unit, 50-step model, not about implicit representations as a class.
alpha = peak memory / persistent size: 4.12 for the graph, 1.27 for the dense grid, and 111.9 for the MLP. The MLP is the smallest map on disk and the largest consumer of runtime memory.
Figure
Extensions
Three follow-ups answer the obvious questions about the original benchmark: whether the MLP failure is just capacity, whether the memories can answer relations, and whether graph growth matters over a longer run.
Capacity
| Configuration | Objects | Current@2 | Past@2 | Update | Peak |
|---|---|---|---|---|---|
| w32 d1 | 3 | 0.104 | 0.168 | 37.8 ms | 1.25 MB |
| w128 d2 | 3 | 0.184 | 0.216 | 72.8 ms | 6.47 MB |
| w32 d1 | 30 | 0.016 | 0.024 | 39.6 ms | 1.28 MB |
| w128 d2 | 30 | 0.016 | 0.032 | 74.0 ms | 6.50 MB |
| graph reference | 3 | 0.896 | 0.848 | 0.005 ms | 0.01 MB |
| graph reference | 30 | 0.904 | 0.856 | 0.028 ms | 0.06 MB |
Wider and deeper does not rescue the MLP at 30 objects. At 3 objects the best setting reaches 0.184, still far below the graph. Capacity alone is not the explanation.
Relational queries
| Memory | Left of | Right of | Near | Nearest of class |
|---|---|---|---|---|
| Object graph | 0.848 | 0.872 | 0.824 | 0.936 |
| Dense grid | 0.832 | 0.856 | 0.792 | 0.864 |
| Coordinate MLP | 0.432 | 0.432 | 0.416 | 0.200 |
| Chance | 0.500 | 0.500 | 0.500 | 0.217 |
The explicit stores answer simple relations. The MLP is at or below chance. The class channel is ground truth, so this is not a test of semantic labelling.
Maintenance and horizon
| Configuration | Past@2 | Stale precision | Size |
|---|---|---|---|
| Dense, no eviction | 0.672 | 0.993 | 24,576 B |
| Dense, evict age 10 | 0.112 | undefined | 24,576 B |
| Dense, evict age 20 | 0.520 | 0.989 | 24,576 B |
Eviction does not reduce the array size. It trades history for freshness. Over 300 steps the graph grows from 16,848 B to 88,365 B, with query latency from 0.158 to 0.228 ms. Accuracy stays flat, so the cost is real but not yet a failure at this scale.
Full extension report Capacity CSV Relational CSV
Scope
Synthetic world, CPU only, no downloaded data, no GPU. The numbers describe the representations, not a deployment. Persistent size is an estimate of serialized state, not live Python object overhead.