Implement M5.5 atomic terrain excavation and debris accounting

This commit is contained in:
dingo
2026-09-26 14:56:44 -04:00
parent 25ac646f93
commit 8b5bf48795
19 changed files with 770 additions and 30 deletions
+7 -7
View File
@@ -14,7 +14,7 @@ The owning unique_ptr may move, but the store itself cannot move or copy.
| Operation | Success | Refusal / invariant |
|---|---|---|
| minimum_bytes(slots) | Store object + fixed directory + 17 KiB scratch reservation | Invalid slot count rejected before multiplication |
| minimum_bytes(slots) | Store object + fixed directory + replay records + 32 KiB scratch reservation | Invalid slot count rejected before multiplication |
| create | Empty store with validated descriptor | Invalid config/version/budget before directory allocation |
| load(address) | Return current token or regenerate and publish one base chunk | Invalid address, slot or byte exhaustion, revision exhaustion; no existing state changes |
| view(address) | Token for loaded address | Missing is explicit; no implicit load |
@@ -29,7 +29,7 @@ an object later allocated at the same address. They cannot authorize persistence
cross-process operations. Epoch exhaustion is checked before increment; no wraparound.
Dirty marking currently changes only lifecycle metadata, not geometry. There is no
clear-dirty or cell-edit API. M5.5 must introduce accounted edit transactions; M5.6/5.7
clear-dirty API. M5.5 now adds [accounted excavation](TERRAIN_EDITS.md); M5.6/5.7
must establish durable revision coverage before permitting cleanup. Destruction at
host shutdown frees memory and is not a save operation. No production host should
use this in-memory store as its sole durable copy of changes.
@@ -62,8 +62,8 @@ not a wire format. M5.6 must specify canonical serialization independently.
Fixed directory bytes include optional payload objects and lifecycle metadata for
all configured slots, occupied or not. Accounted bytes add exact allocated payload
array element sizes plus a permanent 17 KiB allowance for load construction scratch:
4096 logical words and 256 palette keys. Load generates through point queries to avoid
array element sizes plus a permanent 32 KiB conservative scratch allowance and fixed replay records
under ADR-0046. Loads use 4096 logical words and 256 palette keys. Load generates through point queries to avoid
an extra dense vector, computes required payload before allocation, then publishes
without throwing. On allocator failure existing state is unchanged; allocation
exceptions propagate to the host. Clean eviction subtracts payload only.
@@ -84,6 +84,6 @@ tokens, conservative dirty pinning and rejection without changing resident state
Existing generator goldens remain active. Counter exhaustion is guarded in code but
not forced via a public test-only state injection API.
M5.5 adds transaction IDs, payload identity, expected revisions, material destinations
and atomic edits. No transactional edit, snapshot, crash recovery, threading, automatic
LRU, renderer or Kubernetes integration is provided by M5.4.
M5.5 now adds transaction IDs, full request identity, expected revisions, a finite debris
destination and atomic excavation; see TERRAIN_EDITS.md. Snapshot/crash recovery,
threading, automatic LRU, renderer and Kubernetes integration remain later work.