fix(simulation): wire region baseline into production district temp + rename latitude field (T-1078)
Addresses PR #167 review (Tyre T1, T3). T1 — the region climate tier was built but no live path consulted it: both derive_district_profile (cascade) and derive_district (on-demand) passed region_baseline_c: None, so the D-243 §4 edge-fuzz blend was dead in production and district temperature was still derived from scratch. Now both paths compute region_baseline_at_district(...) and pass it through build_district_profile so the two-phase modulation (D-243 §3) actually runs. The cascade path (derive_all_districts) builds a BTreeMap<RegionPos, RegionProfile> covering all district positions + their +/-1 neighbours once per body and looks up from it; the on-demand path derives the four surrounding region baselines on the fly. No production path passes None except genuinely airless bodies (no planet_class). T3 — renamed BodyParams.district_latitude_deg -> latitude_deg (it is the region centre latitude in the region fns, a call-site trap under the old name); dual-scale doc; propagated to body_params_reader.rs and all literal sites. Golden fixtures are unaffected (they construct districts directly via make_region, bypassing build_district_profile) — derivation_harness 37/37 green, no re-pin. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -258,8 +258,15 @@ pub fn run_cascade_from_heightmap(
|
||||
// ~8 cells per district on a 128×64 working grid → ~80×32 = ~2 560 districts;
|
||||
// at full working resolution the budget is ~6 000/body (D-203).
|
||||
const CELLS_PER_REGION: usize = 8;
|
||||
let districts =
|
||||
district_profile::derive_all_districts(body_seed, params, &ta, CELLS_PER_REGION);
|
||||
// body_id is required for the D-243 §4 climate edge-fuzz warp domain
|
||||
// separation — derive_all_districts builds the region cache internally.
|
||||
let districts = district_profile::derive_all_districts(
|
||||
body_seed,
|
||||
params,
|
||||
&ta,
|
||||
CELLS_PER_REGION,
|
||||
&snapshot.body_id,
|
||||
);
|
||||
snapshot.layer_district = Some(LayerDistrictOutput { districts });
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user