feat(simulation): D-232 three-phase trait draw + deviation/swerve system (T-994, T-1003)
T-994 — three-phase draw replacing the flat splitmix64 flavor pick: - Phase 1 body K-draw (trait_draw.rs): hard gates -> soft weights (two-part geographic_sector join, PR #148) -> SeedChain::for_body-seeded weighted draw of K (5/3/1/0 by ComplexityTier), pins count toward K, coverage-aware over a new body-level district-type-mix aggregate threaded into CityGenerationContext at L3->L4 dispatch. - Phase 2 district-dominant pick keyed by the D-243 2048m District cell — settlements sharing a cell independently derive the identical template. Resolved at dispatch, never in FillChunk (T-987 stays pure). - trait_catalog_reader.rs: systems.db reader for trait_templates + atlas_body_trait_bias (D-225 resource pattern), registered in main.rs with graceful degradation. - BlockSkeleton carries district_type; assign_block_tags is a pure lookup. T-1003 — deviation/swerve system (trait_swerve.rs): - ArchitectureFlavorRef is now InVocabulary(u8) | Swerve(tag). - Rare per-building wildcard: foreign-import pool (other corridors + cross_corridor) driven by Epicenter/Passage tier, mixed faction, road-graph degree; heritage-callback pool (own-corridor heritage) driven by isolation, remote tier, founding_age_years. Integer bps, base 100, cap 300 per driver — placeholder constants pending calibration. - Sparsity escape hatch = same mechanism, necessity-triggered at the phase-2 pick (deterministic max-weight over the hard-gate-eligible pool). - New SeedDomains: TraitVocabulary(13) / TraitDistrict(14) / TraitSwerve(15). Governance: D-232 amended (district pinned to the D-243 2048m tier — the D-222/D-243 redefinition was never captured; swerve driver mappings + placeholder rates recorded), D-229 flavor_ref field updated to the enum shape, D-235 amended (T-995 vocabulary ratification note; rides here due to single-file entanglement). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -120,6 +120,22 @@ pub enum SeedDomain {
|
||||
/// keyed by a single constant id). Distinct domain so the mosaic-selection lattice
|
||||
/// can never correlate with the relief, cover, or per-voxel terrain streams.
|
||||
VoxelMosaic = 12,
|
||||
/// Architecture-flavor body-vocabulary K-draw (D-232 phase 1, T-994). Keyed by
|
||||
/// a constant id (one draw per body — `SeedChain::for_body` already isolates
|
||||
/// bodies). Distinct domain so the vocabulary draw can never correlate with
|
||||
/// any other body-scoped stream.
|
||||
TraitVocabulary = 13,
|
||||
/// Architecture-flavor district-dominant template pick (D-232 phase 2, T-994).
|
||||
/// Keyed by a packed `(DistrictPos, DistrictType)` id so every settlement whose
|
||||
/// quarter falls in the same D-243 2 048 m district independently derives the
|
||||
/// *identical* dominant template for a given district type — same body seed +
|
||||
/// same key, no cross-quarter coordination required.
|
||||
TraitDistrict = 14,
|
||||
/// Per-building deviation/swerve roll (D-232 deviation system, T-1003).
|
||||
/// Derived off the footprint's own chain, keyed by footprint index. Distinct
|
||||
/// domain so the rare-wildcard roll can never correlate with the zone/era/
|
||||
/// extent draws sharing that chain.
|
||||
TraitSwerve = 15,
|
||||
}
|
||||
|
||||
/// A position in the deterministic seed tree (D-224).
|
||||
@@ -281,6 +297,9 @@ mod tests {
|
||||
assert_eq!(SeedDomain::Cover as u64, 10);
|
||||
assert_eq!(SeedDomain::VoxelRelief as u64, 11);
|
||||
assert_eq!(SeedDomain::VoxelMosaic as u64, 12);
|
||||
assert_eq!(SeedDomain::TraitVocabulary as u64, 13);
|
||||
assert_eq!(SeedDomain::TraitDistrict as u64, 14);
|
||||
assert_eq!(SeedDomain::TraitSwerve as u64, 15);
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
||||
Reference in New Issue
Block a user