StructureID separate from chunk 'anchor'

This commit is contained in:
2026-11-09 11:44:13 +01:00
parent e855ccd904
commit b6f4a9c432
19 changed files with 944 additions and 136 deletions
+9
View File
@@ -84,6 +84,14 @@ Do not change these casually; they are contracts between Rust, WGSL, and Slang.
10. **Eviction order:** timestamp-major (least recently used first), depth-minor
(deepest first). The depth pass runs descending and the timestamp pass runs
stable so equal timestamps keep the deepest-first order.
11. **Identity is not placement.** `StructureId` is stable tree identity
(monotonic per producer, never reused for another anchor). `StructureAnchor`
is the opaque, table-defined content identity (toroidal table: world
position + version). `TableSlot` is table-private placement and may change
freely. Root identity is `(ProducerId, StructureId, StructureAnchor)`; the
slot travels only as attachment metadata. Request keys, `LocationPage`,
`RequestInformation`, and `InsertionParent` must not treat the slot as
identity.
## Where to look for common tasks
@@ -95,6 +103,7 @@ Do not change these casually; they are contracts between Rust, WGSL, and Slang.
| Change eviction | `src/voxel_cache/eviction.rs`, `src/voxel_cache/shaders/eviction.wgsl`, `src/voxel_cache/shaders/insertion.wgsl` |
| Change insertion semantics | `src/voxel_cache.rs` (`insert`), `src/voxel_cache/pipelines.rs`, `src/voxel_cache/shaders/insertion.wgsl`, `write_pointers.wgsl` |
| Change world/chunk lookup | `src/voxel_cache/tables.rs`, `src/terrain.rs`, `shaders/toroidal_structure_table.slang` |
| Change structure identity / anchors | `src/voxel_cache/schema.rs` (`StructureAnchor`, wire structs), `src/production/request_queue.rs`, `src/voxel_cache/tables.rs`, `src/voxel_cache/shaders/common.wgsl`, fixed-table shaders |
| Change ray marching/LOD | `shaders/voxel.slang`, `shaders/voxel_cache.slang`, `shaders/lod_policies.slang` |
| Add a producer | `src/producers.rs` (interface), `src/main.rs` (`fullfill_request`), [`docs/pipeline-and-producers.md`](./docs/pipeline-and-producers.md) |