Commit Graph

87 Commits

Author SHA1 Message Date
chexit 53fbeced22 Cover radar profiles over a ridge (#134)
build / mod (push) Failing after 28s
Co-Authored-By: Kimi Code <noreply@moonshot.ai>
2026-11-20 23:13:38 +03:00
chexit 858735a4c6 Implement the first full radar-profile slice (#134)
Give the separate radar three real profiles over SamKind::Radar and the
typed catalog variants:

- radar_search: coarse, slow, long-range search plots; no fire authority.
- radar_height: raised mast, local refinement of low plots; no fire authority.
- radar_track: local search, fast revisit, two refined/fire channels.
- radar_multi remains the compatible universal profile, not best everywhere.

Tracks now carry the measuring station, product (search/refine/fire), and
quality (separate from identification), and keep the station's own plot when a
fresher network relay replaces the published position. A relay never refreshes
the measurement or authorizes a launch. Ordinary launches need the battery's
own confirmed fire plot; launcher-only batteries use a supporting radar's own
plot, and the existing heavy far shot keeps its cue-radar exception.

Per-tick refinement/fire work is bounded by profile channels and local search
radius. Off, damage, network and save/replay behavior are preserved: new saves
write the stable profile ID, old role-only lines migrate, and embedded SAM
radars keep their own fire authority. The deploy menu, status lines, map,
monitor, radar scope and /airdef why explain the profile, source, age, quality,
channels and refusal reason.

Models/textures are untouched: all profiles reuse the existing radar
silhouette (the separate art zone remains for its owner).

Tests: profile single/pair/full scenarios and duplicate station, channels,
relay source/age/quality, Off/damage, save migration, replay, embedded and
Multifunction radars, catalog/generator checks, airdef-mod suites, core lib
(non-balance on one thread; the four active balance tests in release) and core
scenarios.

Co-Authored-By: Kimi Code <noreply@moonshot.ai>
2026-11-20 23:11:12 +03:00
chexit ac7521936d Estimate a track's class from its measurements, not from the target (#133)
build / mod (push) Failing after 1m18s
A radar track is what the network measured, and it never carried the
target's own answers: the tactical Track loses `kind: DroneKind` and the
true velocity, and gains what the measurements say instead.

- Track now holds a ClassEst (unknown / probable / firm) plus an observed
  velocity: none from the first blip, then the change of the measured
  places between real measurements, smoothed so one noisy pair does not
  flap the class. The classifier's bands sit between the game's speed
  clusters (Class::of_speed); a new contrary measurement replaces the
  hypothesis, an agreeing one firms it.
- The class estimate is separate from track confirmation (Track::ident):
  a track can be confirmed with its type still unknown. The estimate
  grows only on real measurements — a forecast and a relayed copy add
  nothing — and it travels with the measurement it grew from, ageing
  with the track and gone when the track drops.
- Roles, last chance, the reserve and the interceptor count read the
  estimate, never the target's class. Explicit policy for the unknown:
  an unidentified track stays a candidate under the general rules (and
  the system with no roles holds its fire at everything); the map, the
  monitor, the summary panel and /airdef why read the same estimate and
  name the reason — «Трек подтверждён · тип не определён», «вероятно
  крылатая ракета». The exact model stays in the sandbox's truth mode.
- A gun or a launcher lets go of a target that classified out of the
  roles since it was taken; a first blip no longer rules a contact out
  as a threat to guarded objects (it has no measured course yet).

Old saves and replays are untouched (tracks are derived, not persisted);
the simulation stays deterministic (the classifier is pure arithmetic on
the measurement noise). The doctrine/first-blip/last-chance tests gained
classified tracks where the contract provably changed; new tests cover
the classifier's steps, kind-independent estimates, first-blip blindness,
and relays and forecasts adding no confidence.

Co-Authored-By: Kimi Code <noreply@moonshot.ai>
2026-11-20 22:55:36 +03:00
chexit d302204649 Make map and radar targets legible with an honest hover (#132)
- mini radar: class-shaped blips that merge into one with a count
- map: larger track markers and trails, hover card with distance, type,
  status, target and interception
- explicit network vs sandbox truth: true drones, routes and aims drawn
  apart from the network tracks, with their own trails

Co-Authored-By: Kimi Code <noreply@kimi.com>
2026-11-20 22:08:46 +03:00
chexit c59bfe9e54 Catalog typed battery variants (#91)
The battery deploy pieces (s400_launcher, s500_launcher, radar_search/
track/height) were described three times: the menu table and the
configuration match in lib.rs, and a chained id list in commands.rs. One
catalog decision instead: catalog/content.json gains a variants section
(mode/role reuse the existing SamMode/RadarRole save keys), gen_catalog.py
generates catalog::UnitVariant rows, and the loader rejects duplicates,
unknown kinds/modes and id collisions with kinds or items. The battery
menu, its click handler and the deploy completion read the generated
table; the historical row order and labels are unchanged.

No variant carries its own balance: per-variant ammo profiles stay open
pending a confirmed profile and an explicitly labelled game abstraction
(PAC-3 note on #91), so no new specs, no new matches and no save/replay
change - a variant is only a deploy key over the same kind.

Checks: gen_catalog.py --check and gen_models.py --check clean, the
python catalog/asset and sound tests pass, airdef-core 234 unit + 8
scenarios, airdef-mod 69 unit + 1 boundary + 5 scenarios (save/load and
state round trips included), zero failures.

Co-Authored-By: Kimi Code <noreply@moonshot.ai>
2026-11-20 21:34:07 +03:00
chexit 306af49744 Move battery status text to the presentation adapter
Sam::status, Comps::describe/worst and Sam::parts_text formatted
player-facing Russian in the simulation. The adapter now owns that
text: battery_view::sam_status for the panel and map, why_view::parts
and why_view::worst for the monitor and the status line. The core keeps
the data and gains only the accessors the adapter needs
(preparing_cell, public cells/reload_time/magazine/gun facts).

Texts are unchanged; the adapter tests pin the existing strings.

Co-Authored-By: Kimi Code <noreply@moonshot.ai>
2026-11-20 21:34:07 +03:00
chexit 367c7f4ac3 Bound recorded SAM poses under the WASM memory cap (#122)
Thin old SAM keyframes in place, reduce allocation capacity and adapt later sampling when a recording exceeds its fixed pose budget. Preserve recent poses and cover the full ten-minute window in native and real WASM stress tests.

Co-Authored-By: Kimi Code <noreply@moonshot.ai>
2026-11-14 17:21:48 +03:00
chexit e7934a1ebb Give the enemy a structured intent and a durable route queue (#127)
build / mod (push) Failing after 22s
release / windows (push) Failing after 2s
Stage 2 of #127. A smart drone now carries why it is aimed where it is
(Intent: plan, sead, react, replace) apart from the aim bookkeeping
(unit, since, switches, confidence). Assignments are throttled per
adaptive tick and per contact, a fresh disclosure replaces an aim only
after a hold, within a switch cap and when the change is worth a new
route, and a killed aim is replaced as a separate, lower-priority
decision. The queue is bounded and taken by priority (plan > sead >
react > replace); unknown land is no longer free in a replanned route.

The autosave now carries the air state: the drones in flight, the launch
queue, every pending job with its id, aim, unit, version, priority,
intent and relief version, the contacts the jobs were chosen from and
the relief snapshots they plan over. The format is a versioned `air 1`
section; older saves read as before, scenarios do not carry the sky,
stale, ghost and duplicate jobs are cancelled on load, and the section is
bounded (512 drones, 512 route points, 4096 contacts, 8 reliefs, 900 KB).
A periodic save waits while a raid is only being planned.

enemy_picture() now explains targets and pending jobs (aims, aimed_by,
pending_jobs, reason, work_per_tick) in English, and intel_bench records
the queue and intent evidence next to completion, losses and failures.
2026-11-06 18:36:20 +03:00
chexit 8fc10c07a1 Give the enemy a last-observation picture and observed-capability pricing (#127) 2026-11-06 18:00:08 +03:00
chexit 1261c30724 Stage the cold launch and spool every interceptor's motor (#129)
The interceptor's launch is one sequence: the cap opens, the round is
thrown out unlit and slows under linear gas drag (`cold` ticks), the motor
lights where it has reached, it turns with a growing rate while thrust
spools up (`boost` ticks), and full guidance starts only at `cold + boost`.
A rail launch lights at once but spools over the same `boost` ticks; the
electric P1-SUN has no rocket spool or plume.

S-400/500 now hold the unlit ejection for 20/24 ticks (1.00/1.20 s at
20 Hz); IRIS-T/Tor keep shorter 8-tick throws. Ignition, its sound, flame
and recorded MotorIgnition event all use the missile's current position.
The RM48U strike follows the same 20-tick choreography, counts the throw
in its flight time and starts its recorded smoke at ignition.

Maximum speed, turn, accel, pk and every collision rule are unchanged.

Co-Authored-By: Kimi Code <noreply@kimi.com>
2026-11-06 13:35:35 +03:00
chexit a592ece6e3 fixup! Keep unfinished retarget routes in a bounded job queue (#127)
build / mod (push) Failing after 22s
The planner caches were keyed by (kind, relief Arc pointer, start, aim): two jobs with the same relief but different known-units snapshots could reuse each other's price grid and route. Key relief sampling by its Arc pointer but key prices and routes by the whole knowledge version: adaptive tick plus the known-units and relief Arc pointers. Regression creates two same-start, same-aim jobs on one relief with different known snapshots and checks their routes differ, while a third job of one version still reuses the route cache. Core release, adapter and WASM contract pass.
2026-11-06 12:57:36 +03:00
chexit a47812aadd fixup! Keep unfinished retarget routes in a bounded job queue (#127)
The relief snapshot was still global: a smart plan finishing while a retarget job waited could replace Sim::known_relief, so the pending route was planned on the newer map. RouteJob now carries Arc<KnownRelief> for its knowledge version; Sim::known_relief keeps the same Arc only to seed new jobs. retarget_relief reads the job's snapshot, and relief sampling, price grids and route caches are keyed by that version. The new regression makes a job wait, swaps the global relief for another grid with a wall, and checks the pending route and sample stay those of the original version; outside its grid is Unknown. Core release, adapter and WASM contract pass.
2026-11-06 12:57:36 +03:00
chexit 6f7b041c8b Keep unfinished retarget routes in a bounded job queue (#127)
A mass retarget used to clear every selected drone's route before the planner's per-tick work ran out: the rest flew straight for ever. Route jobs now carry the drone id, new aim, target unit, knowledge version and the intel snapshot, stay in a FIFO across ticks and are drained under the same WORK_PER_TICK. An old safe route is kept until its replacement is ready; a cancelled job falls back to a straight run. Jobs are replaced in place per drone, cancelled when the drone or unit is gone, and retarget routes reuse the original plan's known relief. An in-flight drone no longer turns to a unit behind its turning circle. Core release tests, adapter tests and the real WASM contract pass.
2026-11-06 12:57:36 +03:00
chexit dc36d67eb7 Unblock supply trucks from an impossible RM48U return (#128)
build / mod (push) Failing after 21s
step_supply sent every free truck into the return branch whenever any
S-400 had a pending ground_return, even when that return could not
proceed (the system moving, damaged, reloading or preparing, its round
already claimed by another truck, the route marked unreachable, or no
depot with room). The branch then found no target, cleared the job and
stopped the truck, so independent typed supply requests starved.

The return now keeps its priority only while it is executable: a
carrier holding a reserved round looks for a depot with room in reach,
an empty one for a system ready to hand a round over. Otherwise the
claim stays untouched and only real RM48U demand (a requesting system
with depot stock, or ground rounds aboard for one) pulls the truck
into the typed supply branch; without such demand it holds its watch
exactly as before. Redirecting a reserved round to a waiting request
clears return_cargo once the last one leaves the truck, and a stale
return_cargo with an empty hold no longer sends the truck to a depot
handover it cannot complete.

Regressions: three sim tests (moving claimant, pickup claimed by
another truck with damaged/save-restore phases, unreachable route) and
one full-drive lib test with a mid-flight state round trip; the rounds
are conserved in every phase and the actual return completes once the
claimant is back. All three sim tests fail on the old code.

Checks: core release 200 passed/8 ignored + 8 scenarios; adapter
67 unit + 1 boundary + 5 scenarios; real WASM test-wasm 30 steps.
2026-11-06 11:11:59 +03:00
chexit d45629ae29 Fix the UI-event fuel trap on a second large raid order
build / mod (push) Failing after 22s
The Windows log for #122 showed the mod stopping in the UI event
(fuel budget 1e9, remaining 0) with known_units <- order_raid <-
launch_wave <- ui_select: order_raid recomputed the planner snapshot
known_units() for every drone, and the snapshot itself rescanned the
whole force and the dedup list per intel entry. A second big Smart
order cost drones x intel-log x force-size inside one event.

Reproduced in actual WASM with measured per-callback fuel through the
exact ui_select(BTN_LAUNCH) handler (diagnostic guest, trigger.patch):
before, a 111-drone second order at revealed=13172/known=144 exhausted
exactly 1e9 and stopped the mod (an 11-drone order at the same state:
247805865); after, the same scenario passes with max command fuel
32946177/1e9, failures=0, and /stats at tick 2602 byte-identical.
A stacked single-point layout dies to one warhead (known=0, cheap
order), so the scenario deploys spread clusters with a moved player.

Fix: one known_units snapshot per order_raid passed to radar_strikes
and choose_target; known_units is a single O(log + force) set pass;
price_grid_on reuses its snapshot. Emitter/network targeting and
carrier choice semantics are unchanged (native equivalence test
against the former predicate; WASM checkpoint counters equal).
Limits unchanged; HD/recording untouched; wave size unrestricted.

Committed regressions: native snapshot-equivalence and
second-smart-order tests; the heavy WASM fixture now orders two Smart
raids through the wave screen's launch function (airdef preset +
airdef raid) with EW and a combat intel log, four accepted orders
asserted; the light contract covers preset and the empty-wave refusal.

Core release 195 + 8 scenarios; adapter 65 + 1 boundary + 5 scenarios;
light WASM 30 steps; heavy WASM 283 steps (tick max 182413686/300M,
command max 6939810/1e9, failures 0). Windows GUI acceptance remains
external and is not claimed.

Co-Authored-By: Kimi Code (Moonshot AI) <noreply@moonshot.cn>
2026-11-06 10:29:36 +03:00
chexit 46d2274c8d 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>
2026-11-04 21:03:01 +03:00
chexit 0937ac9e05 fix: keep the P1-SUN motor voice at its played 1.6 pitch
The old engine_voice returned early for flame == 0 with
(DRONE_LANCET, 0.8, 1.6), so the later `P1sun => 1.7` match arm was
unreachable. The catalog migration mistook that arm for the played value
and stored 1.7, which changed the interceptor drone's flight sound.
specs.json is back to 1.6 and specs_generated.rs is regenerated.

Adds missile_engine_voices_keep_their_played_values, pinning P1-SUN to
(DRONE_LANCET, 0.8, 1.6) and M48N6 to (MISSILE_FLIGHT, 1.0, 0.88).

The continuation and handoff text now describe the early return instead
of the dead arm, and tools/airdef_assets/catalog.py gets its final
newline back.

Verified: gen_catalog --check and test_gen_assets, core release
195 passed + 8 scenarios (7 ignored), adapter 64 unit + 1 boundary +
5 scenarios, WASM contract 27 steps.
2026-11-04 21:00:35 +03:00
chexit ead87343d2 feat: generate simulation numeric profiles from catalog/specs.json
catalog/specs.json is now the single copy of the numeric rows for
DroneSpec, MissileSpec and SamSpec: speed, guidance, warheads, models'
parts, RCS, seekers, launch and motor sounds, mount drives, gravity,
the Oreshnik split height and logistics limits, plus the named part
sets. tools/gen_catalog.py generates airdef-mod/src/sim/specs_generated.rs
(included by mod.rs, so the mod and airdef-core compile the same rows)
and unit_specs_generated.rs (included by units.rs). The hand-written
spec matches are gone; DroneKind::spec, MissileKind::spec and
SamKind::spec read the generated constants.

load_specs validates the schema, sound references, kind coverage against
content.json, named-part references and unused rows. gen_catalog.py
--check already runs in the CI generated-assets step, so a JSON/Rust
drift fails the build.

Every value was compared with the literals at 632061d field by field.
The only mismatch was the P1-SUN motor voice pitch in JSON (1.6 instead
of the actual 1.7, the flame == 0 branch in voices.rs); the JSON was
corrected and behaviour is unchanged. Save keys, raid order, RNG and
gameplay traces are untouched.

Verified: core release 194 passed + 8 scenarios (7 ignored), adapter
64 unit + 1 boundary + 5 scenarios, WASM contract 27 steps, catalog and
model generators fresh, asset/sound/model-bound/report tests pass.
2026-11-04 21:00:35 +03:00
chexit daa9ed7cbc Use catalog sound identifiers throughout runtime
build / mod (push) Failing after 19s
Co-Authored-By: Codex <noreply@openai.com>
2026-11-04 16:01:19 +03:00
chexit 1553976484 Share sound identifiers and metadata with resource generation
build / mod (push) Failing after 18s
Co-Authored-By: Codex <noreply@openai.com>
2026-11-04 15:59:18 +03:00
chexit 0c870c10d5 Represent damage diagnostics as typed reasons
Co-Authored-By: Codex <noreply@openai.com>
2026-11-04 15:59:18 +03:00
chexit eea1b3692e Share aircraft and item catalog with asset generation
build / mod (push) Failing after 20s
Co-Authored-By: Codex <noreply@openai.com>
2026-11-04 15:55:45 +03:00
chexit cb73cb7ccc Move world cache report to presentation adapter
Co-Authored-By: Codex <noreply@openai.com>
2026-11-04 15:55:45 +03:00
chexit 375fdf2d80 Separate battery status from player-facing text
Co-Authored-By: Codex <noreply@openai.com>
2026-11-04 15:55:45 +03:00
chexit cbd6067e8f fix: explain empty strike stock and ground attack prerequisites
build / mod (push) Failing after 19s
Show typed depot cargo separately, identify an empty nearby depot, and document loading, reconnaissance, two ID namespaces and reverse pickup.

Co-authored-by: Codex <codex@openai.com>
2026-11-03 11:26:52 +03:00
chexit 1f28f8361f Bound height cache invalidation per explosion
Co-authored-by: Codex <codex@openai.com>
2026-11-03 11:23:47 +03:00
chexit 910f02ca92 feat: consume scoped engine capabilities and preserve safe fallbacks
build / mod (push) Failing after 19s
Pin API27, diagnose prepared states, gate capture ownership and keep far-sound fallback until acoustics is prepared. Retain engine changes in build provenance and cancel invalid return reservations after cell loss.

Co-authored-by: Codex <codex@openai.com>
2026-11-03 00:24:46 +03:00
chexit b0085cb3e8 Test interrupted return pickup
Co-authored-by: Codex <codex@openai.com>
2026-11-03 00:18:44 +03:00
chexit e9fbaba1d6 Preserve pending delivery and command completion behavior
Co-authored-by: Codex <codex@openai.com>
2026-11-03 00:18:44 +03:00
chexit bb931ab95c Return loaded RM48U to depot by truck
Co-authored-by: Codex <codex@openai.com>
2026-11-03 00:18:44 +03:00
chexit a7b8cb980a Apply coast drag after interceptor burnout
Co-authored-by: Codex <codex@openai.com>
2026-11-03 00:02:50 +03:00
chexit ce76f20074 Target SEAD strikes at observed radar contacts
Co-authored-by: Codex <codex@openai.com>
2026-11-02 23:59:11 +03:00
chexit e38ca0d9ab Match impact speed to swept segment
Co-authored-by: Codex <codex@openai.com>
2026-11-02 23:59:11 +03:00
chexit e3ca3fbd8c Release interceptor engine source at burnout
Co-authored-by: Codex <codex@openai.com>
2026-11-02 23:59:11 +03:00
chexit 44a023006d Use interceptor energy for residual fuse chance
Co-authored-by: Codex <codex@openai.com>
2026-11-02 23:59:11 +03:00
chexit f3985d5363 Record energy loss and exercise meeting geometry
Co-authored-by: Codex <codex@openai.com>
2026-11-02 23:59:11 +03:00
chexit 6b6293f353 Cover lead for crossing target
Co-authored-by: Codex <codex@openai.com>
2026-11-02 23:59:11 +03:00
chexit 932a8b7761 Use swept meeting point for interceptor impact
Co-authored-by: Codex <codex@openai.com>
2026-11-02 23:59:11 +03:00
chexit 143d9b2858 Prototype finite interceptor motor and coast
Co-authored-by: Codex <codex@openai.com>
2026-11-02 23:58:54 +03:00
chexit 9e1e0f5543 Update network risk fixture for observed radar
Co-authored-by: Codex <codex@openai.com>
2026-11-02 23:56:52 +03:00
chexit 88f940546b Test radar silence and replay seeking
Co-authored-by: Codex <codex@openai.com>
2026-11-02 23:56:52 +03:00
chexit 0df225a2de Observe emitting radars and expose emission control
Co-authored-by: Codex <codex@openai.com>
2026-11-02 23:56:52 +03:00
chexit 26b258f00f Add persisted radar emission switch
Co-authored-by: Codex <codex@openai.com>
2026-11-02 23:56:52 +03:00
chexit 952a10f360 Exercise strike delivery across movement and save restore
build / mod (push) Failing after 18s
Co-authored-by: Codex <codex@openai.com>
2026-11-02 23:55:56 +03:00
chexit c775f31544 Deliver typed strike rounds by transport loader
Co-authored-by: Codex <codex@openai.com>
2026-11-02 23:55:56 +03:00
chexit c96676f3e5 feat: attenuate indirect blast damage behind known cover
build / mod (push) Failing after 18s
Use a bounded read-only pre-destruction occupancy sample; preserve conservative damage for unresolved geometry and do not defer or repeat damage on replies.

Co-authored-by: Codex <codex@openai.com>
2026-11-02 23:55:38 +03:00
chexit 966b52f9fc feat: add shared radar batteries and animated cold launch
build / mod (push) Failing after 18s
Separate search and engagement roles, support launcher-only SAMs, animate individual tube lids and delay ground strike spending until ejection. Preserve battery configuration and launch poses in saves and replay.

Co-authored-by: Codex <codex@openai.com>
2026-11-02 23:40:40 +03:00
chexit d4adbb1e47 Launch typed ground strikes from carriers and isolate presentation state (#118 #88 #89)
build / mod (push) Failing after 18s
Share read-only scene data for smoke and displayed blasts; preserve cold ejection and flight-relative recording samples. Keep finite typed depot inventory, expose per-world smoke readiness through the pinned API26 engine, and invalidate presentation resources on world changes.

Validation: core suite 156 unit tests plus 4 scenarios and the new targeted recording regression; adapter 50 unit tests, boundary check and 4 scenarios; real WASM contract 16 steps; asset pipeline and bounds checks; macOS Metal client build and HD frame.

Co-Authored-By: Codex <noreply@openai.com>
2026-11-02 22:23:09 +03:00
chexit e84a5e9fa7 Refine ground vehicle silhouettes and publish in-game model checks (#115)
Preserve launcher grids and authored materials; fix the Buk radar intersection and regenerate geometry bounds. Register the separate RM48U game visual for the upcoming carrier path.

Co-Authored-By: Codex <noreply@openai.com>
2026-11-02 22:22:54 +03:00
chexit c4b72da3ff Clarify gun burst counters and record the verified realism follow-up (#91)
Co-Authored-By: Codex <noreply@openai.com>
2026-11-02 21:48:47 +03:00