Measure the #120 balance grid across batteries, ranges and target classes

Wider same-seed sampling of the finite-burn/coast change: baseline 2689d93
(pre-#120) against the current tree, 6 variants x 8 seeds of a 46-drone raid
(batt10/20/50, near200, far1500, hills20). Harness-only: Result carries the
tally's fuse/expired/orphaned/energy_lost counts and a new ignored
sim::balance::issue_120_grid test; no simulation parameters changed.

Findings: kills are equal or up and leaks equal or down in every variant;
fuse misses drop (far1500 70 -> 38 over 8 seeds); hills terrain losses fall
(scrubbed 6 -> 2). MotorEnergyLost never fires in the 48 scenarios and
expired stays <= 1: coast ends before drag reaches the 25% guidance
threshold. Leaks stay concentrated in the ballistic/fast classes
(Iskander/Kinzhal/Kh22/Zircon). No confirmed defect, so no tuning.

Full airdef-core suite: 193 + 8 passed, 0 failed (baseline side 169 + 4).

Co-Authored-By: Kimi Code <noreply@moonshot.cn>
This commit is contained in:
2026-11-04 21:00:47 +03:00
parent 325119b726
commit 46d2274c8d
4 changed files with 163 additions and 2 deletions
+39
View File
@@ -54,6 +54,12 @@ pub(super) struct Result {
pub missed: u32,
/// Missiles fired by the heavy systems (S-400, S-500, Patriot).
pub heavy: u32,
/// Interceptors whose fuse ran without a kill; whose life ran out; that lost their target on the way;
/// and that fell below their guidance speed after motor burnout (#120's coast/energy tally).
pub fuse_missed: u32,
pub expired: u32,
pub orphaned: u32,
pub energy_lost: u32,
pub by_kind: Vec<(DroneKind, u32, u32)>,
pub tally: String,
/// Drones that vanished short of their aim without being shot down: kind, where, how far from the aim.
@@ -322,6 +328,10 @@ pub(super) fn fly(s: &Setup) -> Result {
result.crashes = sim.crashes;
result.blocked = sim.tally.blocked;
result.scrubbed = sim.tally.scrubbed;
result.fuse_missed = sim.tally.missed;
result.expired = sim.tally.expired;
result.orphaned = sim.tally.orphaned;
result.energy_lost = sim.tally.energy_lost;
result.leaked = sim.hits;
let mut kinds: HashMap<DroneKind, (u32, u32)> = HashMap::new();
for h in &gone_unkilled {
@@ -514,6 +524,35 @@ fn one_raid() {
}
}
/// Issue #120's wider sampling: battery sizes, launch-range bounds and the target classes of a raid
/// of 36, on the same seeds against the same cluster mix as `one_raid`. Prints CSV rows:
/// `variant,seed,sams,dist,sent,kills,leaked,missiles,heavy,ticks,blocked,scrubbed,crashes,fuse_miss,expired,orphaned,energy_lost,leaks_by_kind`.
/// `SEEDS=1-8 cargo test --release issue_120_grid -- --ignored --nocapture` (SEEDS overrides the seed range).
#[test]
#[ignore]
fn issue_120_grid() {
let seeds = match std::env::var("SEEDS") {
Ok(v) => {
let (a, b) = v.split_once('-').expect("SEEDS is a range like 1-8");
let a: u64 = a.parse().expect("SEEDS start");
let b: u64 = b.parse().expect("SEEDS end");
a..=b
}
Err(_) => 1..=8,
};
for (variant, sams, dist) in [("batt10", 10usize, 500.0), ("batt20", 20, 500.0), ("batt50", 50, 500.0), ("near200", 20, 200.0), ("far1500", 20, 1500.0), ("hills20", 20, 500.0)] {
for seed in seeds.clone() {
let mut s = Setup::new(sams, false, seed);
s.size = 36;
s.dist = dist;
s.hilly = variant == "hills20";
let r = fly(&s);
let kinds = r.by_kind.iter().map(|k| format!("{:?}:{}", k.0, k.1)).collect::<Vec<_>>().join(";");
eprintln!("{variant},{seed},{sams},{dist},{},{},{},{},{},{},{},{},{},{},{},{},{},{}", r.launched, r.kills, r.leaked, r.missiles, r.heavy, r.ticks, r.blocked, r.scrubbed, r.crashes, r.fuse_missed, r.expired, r.orphaned, r.energy_lost, kinds);
}
}
}
/// Far launches over mountains where only a disc round the player is known: who crashes, where and how often.
/// `cargo test --release far_table -- --ignored --nocapture` (DISC=300 sets the radius, 0 for all known).
#[test]