fix(simulation): address PR #163 review (freeze/snow model)

Hoshe found a CRITICAL coherence defect (Tyre APPROVE):

- CRITICAL: cluster_scatter received the per-voxel sub_chunk_seed as its cluster
  seed, so voxels in the same 6m cell got different scatter -> salt-and-pepper,
  not the §3-mandated clustered patches. Re-key on (world, body, cluster-cell):
  add SeedDomain::Cover=10 (pinned); cluster_scatter(world_seed, body_id, x, y)
  derives for_body(world_seed,body_id).derive(Cover, cluster_pair_id). derive_cover
  now takes (world_seed, body_id, ...). (Hoshe #1)
- The coherence test was tautological (constant seed bypassed the broken path).
  Rewritten to the production derive_cover signature in a cold-lake scatter band;
  it FAILED at 20% on the old code, passes 100% now. (Hoshe #2)
- Zigzag-encode cluster (cx,cy) before Cantor pairing (negatives were cast as u64
  directly); fix the misleading 'no collision' comment. (Hoshe #3, Tyre)
- Sea-ice band was inverted (~85% ice at the -2 onset). Now monotonic: ice grows
  ~8% (onset) -> ~92% (cold edge); leads (open gaps) layered only in the cold half
  via a 3x super-cell, passing the super-cell index directly. Dead depth==0 guard
  removed. (Hoshe #4, Tyre #1/#3)

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:
2026-06-08 17:30:48 +02:00
co-authored by Claude Opus 4.8
parent ed7380245d
commit 88b4323585
2 changed files with 185 additions and 108 deletions
+6
View File
@@ -105,6 +105,11 @@ pub enum SeedDomain {
/// voxel stream can never collide with the region-scale meander seed (D-224
/// domain separation).
Voxel = 9,
/// Seasonal cover cluster scatter (D-239 §3, T-1030). Keyed by the coarse
/// cluster-cell id (zigzag-encoded and Cantor-paired). Distinct from `Voxel`
/// so the per-cluster cover hash can never collide with the per-voxel terrain
/// stream — domain separation guarantees no freeze-to-terrain correlation.
Cover = 10,
}
/// A position in the deterministic seed tree (D-224).
@@ -263,6 +268,7 @@ mod tests {
assert_eq!(SeedDomain::DomainWarp as u64, 7);
assert_eq!(SeedDomain::ChunkContext as u64, 8);
assert_eq!(SeedDomain::Voxel as u64, 9);
assert_eq!(SeedDomain::Cover as u64, 10);
}
#[test]