Fix raid gameplay, finite ammunition and truck routing

Check launch terrain, reserve ballistic targets for marked objectives, tune in-game reach and fallback fire, and support bounded terrain work on supply routes.

Co-Authored-By: Codex <noreply@openai.com>
This commit is contained in:
2026-11-25 18:53:17 +03:00
parent 61c4fa5cee
commit aa842d8a1f
18 changed files with 606 additions and 257 deletions
+6 -14
View File
@@ -1016,11 +1016,9 @@ frames = 10
[[step]]
command = "airdef stats"
# Baseline re-measured after the #145 fix (engine 2bcce64): the embedded-cue flood of #134 is
# removed, restoring the intercepts. The pre-#133 522 used the target's true velocity, which the
# measurement-only contract (#133) forbids; ~325 is the restored range. See
# docs/measurements/issue-145-intercept-regression.json for the A/B decomposition.
expect.feedback = "В воздухе: 184, ракет: 4, ПВО: 64, сбито: 325, поражений: 2011, разбились о препятствия: 0; удары по ПУ: пущено 0, уничтожено 0, подавлено 0, промахов 0, сбито ПВО 0; мир: 4672 секций (219 КБ), запросов 13570, неизвестно 0, лучей 335118 (ударов 8088, неизв. 158), клеток 2162018; взрывы в блоках: 2041 (подтверждено 0, без перемен 148, нет чанка 1754), чужих ответов 0"
# Finite-ammunition checkpoint after extending the game ranges. With no depot,
# the two waves exhaust the initial stock. The previous baseline used free reloads.
expect.feedback = "В воздухе: 184, ракет: 0, ПВО: 64, сбито: 135, поражений: 2161, разбились о препятствия: 0; удары по ПУ: пущено 0, уничтожено 0, подавлено 0, промахов 0, сбито ПВО 0; мир: 4881 секций (228 КБ), запросов 12163, неизвестно 0, лучей 303646 (ударов 1226, неизв. 135), клеток 1944815; взрывы в блоках: 2176 (подтверждено 0, без перемен 88, нет чанка 1946), чужих ответов 0"
# The Windows #122 path: a Smart order through the UI launch function (`airdef raid`
# is the wave screen's ПУСК button handler) with a fat intel log and EW up — twice.
@@ -1067,12 +1065,6 @@ frames = 100
[[step]]
command = "airdef stats"
# Re-measured on the shipped engine 8e711f969 with #146 (one knowledge snapshot per Smart order)
# integrated: the two late Smart raids plan over the versioned picture, so their outcome and world
# queries differ from the #145 agent's pre-#146 measurement (385/2472 on engine 2bcce64). The
# tick-2102 checkpoint above is unaffected by #146 and matches on both engines.
# Re-measured again on engine acfb379aa (the DLSS temporal-stability pin): the late Smart raids'
# outcome shifted with the engine's host answers (417/2463, 7 in the air); the tick-2102 checkpoint
# is unchanged. The ground-oom memory bounds (agent/ground-oom) produce this exact same string —
# they do not move this fight.
expect.feedback = "В воздухе: 7, ракет: 0, ПВО: 68, сбито: 417, поражений: 2463, разбились о препятствия: 0; удары по ПУ: пущено 0, уничтожено 0, подавлено 0, промахов 0, сбито ПВО 0; мир: 8527 секций (399 КБ), запросов 19444, неизвестно 0, лучей 413900 (ударов 11127, неизв. 1084), клеток 3197805; взрывы в блоках: 2501 (подтверждено 0, без перемен 194, нет чанка 2305), чужих ответов 0"
# The two late Smart raids also run with finite stock. At this point the
# launchers still have no supply depot.
expect.feedback = "В воздухе: 24, ракет: 0, ПВО: 68, сбито: 143, поражений: 2688, разбились о препятствия: 0; удары по ПУ: пущено 0, уничтожено 0, подавлено 0, промахов 0, сбито ПВО 0; мир: 7307 секций (342 КБ), запросов 16768, неизвестно 0, лучей 400901 (ударов 2567, неизв. 971), клеток 3894960; взрывы в блоках: 2783 (подтверждено 0, без перемен 145, нет чанка 2638), чужих ответов 0"
+10 -3
View File
@@ -96,17 +96,17 @@ struct Run {
fn run() -> Run {
// Six raids 1500 ticks apart: the sky clears between them, so recordings close and the
// kept replays pile up (the journal's and the poses' budgets are per recording).
run_with(&[(3, 12, Aim::Objects), (1503, 12, Aim::Objects), (3003, 12, Aim::Objects), (4503, 12, Aim::Objects), (6003, 12, Aim::Objects), (7503, 12, Aim::Objects), (1203, 10, Aim::Smart)], TICKS)
run_with(&[(3, 12, Aim::Objects), (1503, 12, Aim::Objects), (3003, 12, Aim::Objects), (4503, 12, Aim::Objects), (6003, 12, Aim::Objects), (7503, 12, Aim::Objects), (1203, 10, Aim::Smart)], TICKS, false)
}
/// The extreme continuous load: waves overlap, the sky never clears, one recording runs long
/// and the flight tracks reach their points budget (the thinning), with over a thousand objects
/// airborne at once — well past the crash's >200.
fn run_extreme() -> Run {
run_with(&[(3, 40, Aim::Objects), (103, 40, Aim::Objects), (203, 40, Aim::Objects), (1003, 40, Aim::Objects), (2003, 40, Aim::Objects), (3003, 40, Aim::Objects), (4003, 40, Aim::Objects), (5003, 40, Aim::Objects)], 8000)
run_with(&[(3, 40, Aim::Objects), (103, 40, Aim::Objects), (203, 40, Aim::Objects), (1003, 40, Aim::Objects), (2003, 40, Aim::Objects), (3003, 40, Aim::Objects), (4003, 40, Aim::Objects), (5003, 40, Aim::Objects)], 8000, true)
}
fn run_with(waves: &[(u64, u32, Aim)], ticks: u64) -> Run {
fn run_with(waves: &[(u64, u32, Aim)], ticks: u64, sustained_supply: bool) -> Run {
let mut sim = Sim::new(SEED);
let mut ground = Ground::default();
let mut out = Out::default();
@@ -118,6 +118,13 @@ fn run_with(waves: &[(u64, u32, Aim)], ticks: u64) -> Run {
for now in 1..=ticks {
if now == 3 {
deploy(&mut sim);
if sustained_supply {
// Sustained fire needs physical stock under finite ammunition rules.
for _ in 0..3 {
let id = sim.id();
sim.sams.push(Sam::new(id, SamKind::Depot, DEPLOY_AT, 0.0));
}
}
}
for &(at, count, aim) in waves {
if now == at {
+11 -12
View File
@@ -124,35 +124,34 @@ fn run_to(ticks: u64) -> Sim {
sim
}
/// The restored checkpoint, measured on this native replica with the #145 fix in place. The WASM
/// budget fixture measures 325 intercepts / 2011 hits at the same tick on the same fix; the replica
/// replays the same fight but answers render rays with the host tracer one tick later, and the
/// combat is chaotic, so its counters sit a few apart (314 / 2022). Both are deterministic; the
/// WASM run is the authoritative fuel/perf measurement, this one the fast fight-and-audit guard.
const REPLICA_KILLS: u32 = 314;
const REPLICA_HITS: u32 = 2022;
/// No depot is deployed in this fixture. Both waves spend the initial ammunition;
/// the checkpoint records the combat outcome with finite magazines and the extended ranges.
const REPLICA_KILLS: u32 = 144;
const REPLICA_HITS: u32 = 2152;
const REPLICA_AIRBORNE: usize = 184;
const REPLICA_FIRED: u32 = 355;
#[test]
fn checkpoint_replica_holds_the_restored_intercept_count() {
fn checkpoint_replica_matches_the_finite_ammunition_baseline() {
let sim = run_to(CHECKPOINT);
let airborne = sim.drones.iter().filter(|d| d.alive()).count();
let fired: u32 = sim.sams.iter().map(|s| s.fired).sum();
eprintln!(
"checkpoint tick {}: airborne {airborne}, missiles {}, kills {}, hits {}, fired {}",
sim.tick,
sim.missiles.len(),
sim.kills,
sim.hits,
sim.sams.iter().map(|s| s.fired).sum::<u32>()
fired
);
eprintln!("tally: {}", sim.tally.text());
eprintln!("audit: {}", sim.launch_audit().text());
assert_eq!(airborne, REPLICA_AIRBORNE, "the sky at the checkpoint");
assert_eq!(sim.kills, REPLICA_KILLS, "intercepts at the checkpoint (deterministic replica baseline)");
assert_eq!(sim.hits, REPLICA_HITS, "hits at the checkpoint");
// The regression guard: the #134 embedded-cue flood dropped this replica to 247 intercepts
// (the WASM run to 243). Restored, it must stay well above that broken count.
assert!(sim.kills >= 300, "the intercept count fell back toward the #145 regression: {}", sim.kills);
assert_eq!(fired, REPLICA_FIRED, "launches at the checkpoint");
assert!(sim.sams.iter().all(|s| s.fired <= s.kind.missile_magazine().unwrap_or(0)),
"a battery fired more than its initial load with no depot");
}
#[test]