style(simulation): cargo fmt — gate bounce on T-1162 files

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
2026-07-22 23:09:48 +02:00
co-authored by Claude Fable 5
parent d33256a8ba
commit a5b9c28e74
3 changed files with 57 additions and 11 deletions
+31 -6
View File
@@ -2071,7 +2071,9 @@ mod tests {
let mut n = 0;
for dx in 0..8 {
let prof = derive_district(test_seed(), "test_body", &p, &ta, (dx, dy), &climate);
sum += prof.temperature_c.expect("breathable body must have a temperature");
sum += prof
.temperature_c
.expect("breathable body must have a temperature");
n += 1;
}
sum / n as f32
@@ -2394,8 +2396,10 @@ mod tests {
for i in 0..20 {
let wx = (150 + i * 47) as f64 * dm;
let wy = (150 + i * 31) as f64 * dm;
let district = derive_at_metres(test_seed(), "test_body", &p, &ta, wx, wy, &climate, 4_096.0);
let quarter = derive_at_metres(test_seed(), "test_body", &p, &ta, wx, wy, &climate, 1_024.0);
let district =
derive_at_metres(test_seed(), "test_body", &p, &ta, wx, wy, &climate, 4_096.0);
let quarter =
derive_at_metres(test_seed(), "test_body", &p, &ta, wx, wy, &climate, 1_024.0);
if district.elev_q != quarter.elev_q
|| district.slope_q != quarter.slope_q
|| district.moisture_q != quarter.moisture_q
@@ -2429,12 +2433,26 @@ mod tests {
// Above the coastal warp's own coarsest octave (262,144 m) — every
// octave in every band (coast, terrain, voxel relief) is excluded.
let far_above = derive_at_metres(
test_seed(), "test_body", &p, &ta, wx, wy, &climate, 300_000.0,
test_seed(),
"test_body",
&p,
&ta,
wx,
wy,
&climate,
300_000.0,
);
// An even more extreme cutoff must produce the SAME result — once
// every octave is truncated, going coarser still changes nothing.
let even_further = derive_at_metres(
test_seed(), "test_body", &p, &ta, wx, wy, &climate, 10_000_000.0,
test_seed(),
"test_body",
&p,
&ta,
wx,
wy,
&climate,
10_000_000.0,
);
assert_district_profiles_eq(&far_above, &even_further);
}
@@ -2468,7 +2486,14 @@ mod tests {
let base_wy = 15.0 * dm;
let district_class = derive_at_metres(
test_seed(), "test_body", &p, &ta, base_wx, base_wy, &climate, 2_048.0,
test_seed(),
"test_body",
&p,
&ta,
base_wx,
base_wy,
&climate,
2_048.0,
)
.vegetation_class;
+4 -1
View File
@@ -198,7 +198,10 @@ fn texture_field(seed: u64, wx: f64, wy: f64, min_wavelength_m: f64) -> f64 {
let mut amp = 1.0;
let mut norm = 0.0;
let mut idx: u64 = 0;
for &wl in OCTAVE_WAVELENGTHS_M.iter().chain(VOXEL_OCTAVE_WAVELENGTHS_M.iter()) {
for &wl in OCTAVE_WAVELENGTHS_M
.iter()
.chain(VOXEL_OCTAVE_WAVELENGTHS_M.iter())
{
if wl < min_wavelength_m {
amp *= 0.5;
idx += 1;
+22 -4
View File
@@ -180,12 +180,30 @@ fn golden_samples() -> Vec<GoldenSample> {
let mut out = Vec::new();
for (label, wx, wy) in sweep_positions() {
out.push(derive_golden_sample(
label, "district", seed, body_id, &params, &ta, &climate, wx, wy,
DISTRICT_MIN_WL_M, false,
label,
"district",
seed,
body_id,
&params,
&ta,
&climate,
wx,
wy,
DISTRICT_MIN_WL_M,
false,
));
out.push(derive_golden_sample(
label, "quarter", seed, body_id, &params, &ta, &climate, wx, wy,
QUARTER_MIN_WL_M, false,
label,
"quarter",
seed,
body_id,
&params,
&ta,
&climate,
wx,
wy,
QUARTER_MIN_WL_M,
false,
));
out.push(derive_golden_sample(
label, "region", seed, body_id, &params, &ta, &climate, wx, wy, 0.0, true,