style(simulation): cargo fmt on the fix round + governance amendment typo (Hoshe nit)
This commit is contained in:
@@ -329,7 +329,10 @@ mod tests {
|
||||
// (32_768.0) must skip every octave and fall back to 0.0 (the
|
||||
// norm==0.0 empty-sum guard), same as the flat_envelope_invents_nothing
|
||||
// envelope==0 case but reached via the cutoff instead.
|
||||
assert_eq!(terrain_detail(5, 1_000.0, 2_000.0, 0.6, 0.5, 100_000.0), 0.0);
|
||||
assert_eq!(
|
||||
terrain_detail(5, 1_000.0, 2_000.0, 0.6, 0.5, 100_000.0),
|
||||
0.0
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
||||
@@ -2044,8 +2044,7 @@ mod tests {
|
||||
for i in 0..20 {
|
||||
let wx = (100 + i * 37) as f64 * dm;
|
||||
let wy = (100 + i * 53) as f64 * dm;
|
||||
let uncut =
|
||||
derive_at_metres(test_seed(), "test_body", &p, &ta, wx, wy, &climate, 0.0);
|
||||
let uncut = derive_at_metres(test_seed(), "test_body", &p, &ta, wx, wy, &climate, 0.0);
|
||||
let cut = derive_at_metres(
|
||||
test_seed(),
|
||||
"test_body",
|
||||
|
||||
@@ -606,7 +606,9 @@ fn derive_window_cell(
|
||||
morphology: prof.morphology_zone as u8,
|
||||
elev_q: prof.elev_q.clamp(0, 100) as u8,
|
||||
temp_dc: match prof.temperature_c {
|
||||
Some(t) => ((t * 10.0).round() as i32).clamp(i16::MIN as i32 + 1, i16::MAX as i32) as i16,
|
||||
Some(t) => {
|
||||
((t * 10.0).round() as i32).clamp(i16::MIN as i32 + 1, i16::MAX as i32) as i16
|
||||
}
|
||||
None => REGION_TEMP_NONE_DC,
|
||||
},
|
||||
moisture_q: prof.moisture_q.clamp(0, 100) as u8,
|
||||
@@ -2301,7 +2303,13 @@ mod tests {
|
||||
if let GenCompletion::WindowDerived { body_id, layer } = c {
|
||||
if body_id == "BandBody" {
|
||||
window_cache.insert(
|
||||
(body_id, layer.center, layer.n, layer.granularity, layer.min_wl_m),
|
||||
(
|
||||
body_id,
|
||||
layer.center,
|
||||
layer.n,
|
||||
layer.granularity,
|
||||
layer.min_wl_m,
|
||||
),
|
||||
*layer,
|
||||
);
|
||||
}
|
||||
@@ -2345,7 +2353,10 @@ mod tests {
|
||||
let layer_b = resp_b.district_window.expect("req_b must hit the cache");
|
||||
assert_eq!(layer_a.min_wl_m, 4_096, "echo must be the QUANTIZED band");
|
||||
assert_eq!(layer_b.min_wl_m, 4_096, "echo must be the QUANTIZED band");
|
||||
assert_eq!(layer_a, layer_b, "both requests must resolve to the identical cached layer");
|
||||
assert_eq!(
|
||||
layer_a, layer_b,
|
||||
"both requests must resolve to the identical cached layer"
|
||||
);
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------
|
||||
@@ -2502,7 +2513,13 @@ mod tests {
|
||||
if let GenCompletion::WindowDerived { body_id, layer } = c {
|
||||
if body_id == "SmallMoon" {
|
||||
window_cache.insert(
|
||||
(body_id, layer.center, layer.n, layer.granularity, layer.min_wl_m),
|
||||
(
|
||||
body_id,
|
||||
layer.center,
|
||||
layer.n,
|
||||
layer.granularity,
|
||||
layer.min_wl_m,
|
||||
),
|
||||
*layer,
|
||||
);
|
||||
}
|
||||
@@ -2650,7 +2667,13 @@ mod tests {
|
||||
if let GenCompletion::WindowDerived { body_id, layer } = c {
|
||||
if body_id == "AliasBody" {
|
||||
window_cache.insert(
|
||||
(body_id, layer.center, layer.n, layer.granularity, layer.min_wl_m),
|
||||
(
|
||||
body_id,
|
||||
layer.center,
|
||||
layer.n,
|
||||
layer.granularity,
|
||||
layer.min_wl_m,
|
||||
),
|
||||
*layer,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -414,7 +414,13 @@ fn drain_generation_completions(
|
||||
// `handle_atlas_request`'s window branch, which finds this
|
||||
// entry via `DistrictWindowCache::get` and serves it.
|
||||
window_cache.insert(
|
||||
(body_id, layer.center, layer.n, layer.granularity, layer.min_wl_m),
|
||||
(
|
||||
body_id,
|
||||
layer.center,
|
||||
layer.n,
|
||||
layer.granularity,
|
||||
layer.min_wl_m,
|
||||
),
|
||||
*layer,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -80,16 +80,8 @@ fn time_derive_sweep(
|
||||
for col in 0..grid_side {
|
||||
let wx = col as f64 * step_m;
|
||||
let wy = row as f64 * step_m;
|
||||
let prof = derive_at_metres(
|
||||
seed,
|
||||
body_id,
|
||||
params,
|
||||
ta,
|
||||
wx,
|
||||
wy,
|
||||
climate,
|
||||
min_wavelength_m,
|
||||
);
|
||||
let prof =
|
||||
derive_at_metres(seed, body_id, params, ta, wx, wy, climate, min_wavelength_m);
|
||||
// Prevent the optimizer from hoisting the call out of the loop.
|
||||
std::hint::black_box(prof.elev_q);
|
||||
}
|
||||
@@ -136,14 +128,7 @@ fn bench_derive_at_metres_district_and_quarter_spacing() {
|
||||
// of them; recorded for the design doc's requested (district, cutoff
|
||||
// 2048) combination regardless).
|
||||
let (elapsed, per_cell_ns) = time_derive_sweep(
|
||||
seed,
|
||||
"bench",
|
||||
¶ms,
|
||||
&ta,
|
||||
&climate,
|
||||
grid_side,
|
||||
district_m,
|
||||
2_048.0,
|
||||
seed, "bench", ¶ms, &ta, &climate, grid_side, district_m, 2_048.0,
|
||||
);
|
||||
println!(
|
||||
"district spacing, cutoff=2048m: {:>8.2} ms total, {:>7.1} ns/cell ({:.3} µs/cell)",
|
||||
@@ -155,14 +140,7 @@ fn bench_derive_at_metres_district_and_quarter_spacing() {
|
||||
// Quarter spacing (512 m), cutoff 512 m — the T-1150 Option B rung: full
|
||||
// reclassification at quarter spacing with the matching octave cutoff.
|
||||
let (elapsed, per_cell_ns) = time_derive_sweep(
|
||||
seed,
|
||||
"bench",
|
||||
¶ms,
|
||||
&ta,
|
||||
&climate,
|
||||
grid_side,
|
||||
quarter_m,
|
||||
512.0,
|
||||
seed, "bench", ¶ms, &ta, &climate, grid_side, quarter_m, 512.0,
|
||||
);
|
||||
println!(
|
||||
"quarter spacing, cutoff=512m: {:>8.2} ms total, {:>7.1} ns/cell ({:.3} µs/cell)",
|
||||
|
||||
Reference in New Issue
Block a user