fix(simulation): address PR #161 review (VoxelColumn skeleton)
Hoshe REQUEST_CHANGES + Tyre APPROVE: - Cache key omitted world_seed → a cache reused across worlds could return another seed's column. CacheKey is now (world_seed, body_id_hash, voxel_pos). (Hoshe #1) - Sub-chunk voxel seed reused SeedDomain::ChunkContext (tier-collision risk vs the region meander seed). Add SeedDomain::Voxel = 9 (append-only, pin test updated) and use it. (Hoshe #2, Tyre #1) - get_or_derive forced callers to pre-compute body_id_hash while fnv1a_64 is pub(crate). Drop the param; compute the hash internally. (Tyre #2) - Fix two inaccurate comments (micro-relief range [-4,+3] not ±2; scatter mask is 4-bit [0,15] not bits [4:6]). (Hoshe #3/#4) - Strengthen the LRU eviction test: add a test-only contains_voxel() helper and assert WHICH entry was evicted (refreshed pos survives, LRU pos evicted). (Hoshe #5) - LRU O(capacity)-scan perf flagged on T-1031 (Tyre #3, deferred to the budget harness). cargo test passes, clippy -D warnings clean, fmt clean. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -100,6 +100,11 @@ pub enum SeedDomain {
|
||||
/// ChunkContext derivation (64 m carrier, D-239 §1, T-1028).
|
||||
/// Keyed by region-scale position id (see `atlas::chunk_context::pos_to_id`).
|
||||
ChunkContext = 8,
|
||||
/// Per-voxel sub-chunk derivation (1 m, D-239 §10, T-1028). Keyed by the
|
||||
/// post-warp integer voxel-position id. Distinct from `ChunkContext` so the
|
||||
/// voxel stream can never collide with the region-scale meander seed (D-224
|
||||
/// domain separation).
|
||||
Voxel = 9,
|
||||
}
|
||||
|
||||
/// A position in the deterministic seed tree (D-224).
|
||||
@@ -257,6 +262,7 @@ mod tests {
|
||||
assert_eq!(SeedDomain::Npc as u64, 6);
|
||||
assert_eq!(SeedDomain::DomainWarp as u64, 7);
|
||||
assert_eq!(SeedDomain::ChunkContext as u64, 8);
|
||||
assert_eq!(SeedDomain::Voxel as u64, 9);
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
||||
Reference in New Issue
Block a user