test+docs(simulation): address PR #164 review (both APPROVE)

- Band-invariant test now sweeps high altitude (6 km) as well as sea level, so
  the lapse term + cold-end clamp are exercised jointly, not lat alone. (Hoshe #1, Tyre #3)
- Clarify the temp() helper comment: seed 0 is deterministic but still applies a
  constant non-zero nudge. (Hoshe #2)
- (Hoshe #3: confirmed tectonic_activity is genuinely absent from systems-schema.sql;
  the reader's 'not in schema' comment is accurate — no change.)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-06-08 18:36:41 +02:00
co-authored by Claude Opus 4.8
parent b6be9f5758
commit 54609eab1a
+21 -16
View File
@@ -1171,7 +1171,8 @@ mod tests {
// T-1024 / D-240 climate derivation tests — planet_class envelope model
// -----------------------------------------------------------------------
/// Convenience: derive temperature with seed=0 for deterministic tests.
/// Convenience: derive temperature with a fixed seed (0) — deterministic, but
/// note seed 0 still applies its (constant, non-zero) nudge like any other seed.
fn temp(planet_class: &str, atmosphere: &str, lat: f64, elev_km: f64) -> Option<f32> {
let params = BodyParams {
planet_class: Some(planet_class.into()),
@@ -1313,21 +1314,25 @@ mod tests {
let (cold, warm) = climate.envelope(class);
for atmo in &atmospheres {
for &lat in &latitudes {
for seed in seeds {
let params = BodyParams {
planet_class: Some((*class).into()),
atmosphere: Some((*atmo).into()),
region_latitude_deg: lat,
elevation_km: 0.0,
..Default::default()
};
let t = derive_temperature_c(&params, &climate, seed)
.expect("non-airless body must have temperature");
assert!(
t >= cold && t <= warm,
"class={class} atmo={atmo} lat={lat} seed={seed}: \
temperature {t}°C outside band [{cold}, {warm}]"
);
// Sweep sea level AND high altitude so the lapse term + clamp
// are exercised jointly against the cold end, not just lat alone.
for elev in [0.0_f64, 6.0] {
for seed in seeds {
let params = BodyParams {
planet_class: Some((*class).into()),
atmosphere: Some((*atmo).into()),
region_latitude_deg: lat,
elevation_km: elev,
..Default::default()
};
let t = derive_temperature_c(&params, &climate, seed)
.expect("non-airless body must have temperature");
assert!(
t >= cold && t <= warm,
"class={class} atmo={atmo} lat={lat} elev={elev} seed={seed}: \
temperature {t}°C outside band [{cold}, {warm}]"
);
}
}
}
}