A valid DLSS_SDK must not block the Vulkan header auto-download, and vice
versa; assert that only the missing component is fetched.
Co-Authored-By: Kimi Code <noreply@moonshot.ai>
Scanning .horizon-cache/dlss-sdk is best-effort: a permissions error or a
missing directory now means "nothing cached" and the normal install path
runs, instead of an exception escaping before the mods fallback.
Co-Authored-By: Kimi Code <noreply@moonshot.ai>
`airdef.py game` no longer needs manual SDK setup. On Windows with an RTX
adapter, when neither DLSS_SDK nor VULKAN_SDK is set, it downloads only the
files dlss_wgpu reads:
- NVIDIA/DLSS at the newest stable v310.9.x tag (GitHub API; pinned v310.9.1
when the API fails): include/*.h, both x64 static libs and the runtime
rel/nvngx_dlss.dll (~67 MB once), laid out under
.horizon-cache/dlss-sdk/<tag>/ exactly as valid_dlss_sdk expects.
- KhronosGroup/Vulkan-Headers include/ under
.horizon-cache/vulkan-headers/<tag>/Include/, since build.rs uses headers
only and links no Vulkan library.
The resolved roots are passed to cargo as DLSS_SDK/VULKAN_SDK, and after a
successful dlss build the fresh nvngx_dlss.dll is copied beside the built
horizon-client.exe. Explicit DLSS_SDK/VULKAN_SDK (and the sdk argument)
keep priority and disable auto-download for that component. Any network or
layout failure warns and falls back to --features mods/native TAAU instead
of failing the build; non-Windows and non-RTX take the old mods path with
no network access.
valid_dlss_sdk now looks for the real nvsdk_ngx*.h names instead of the
nonexistent nvngx*.h glob, so a genuine SDK (and the downloaded cache) is
recognised at all.
Tests cover tag selection and fallback, selective layout + marker cache
hit, damaged/partial caches, streamed download and truncation, Vulkan
Include layout, plan env wiring, explicit-env precedence, failure to mods,
and DLL placement beside the client.
Co-Authored-By: Kimi Code <noreply@moonshot.ai>
The build auto-detect hint still said HORIZON_DLSS=1 enables the backend;
the player-facing control is now the mod settings toggle (default on),
with HORIZON_DLSS=1|0 as an override.
Co-Authored-By: Kimi Code <noreply@moonshot.ai>
tools/airdef.py game always built with --features mods, so an RTX user had
to run the manual cargo line from docs/DLSS-TESTING.md. The feature string
now comes from dlss_build_features(): dlss is added only when the OS is
Windows, a Win32_VideoController name has both NVIDIA and RTX, the DLSS SDK
has include/nvngx*.h and lib/Windows_x86_64/x64 (DLSS_SDK, a repo DLSS/ dir
or %ProgramFiles%\NVIDIA\DLSS), and VULKAN_SDK has Include/vulkan/vulkan.h
(dlss_wgpu's build script needs both SDKs). Otherwise the build stays
mods-only; on Windows + RTX without the SDK it prints how to get v310.9.1
instead of failing. GPU/SDK probe errors mean "no DLSS" and never abort the
build; the HORIZON_DLSS runtime switch is untouched.
Tests: tools/test_airdef_build.py covers non-Windows, no RTX, missing DLSS
SDK, missing Vulkan SDK, the full toolchain, a failed GPU probe, the SDK
layout check and the feature string reaching cargo. python3 tools/airdef.py
game still builds mods-only on macOS (fresh target dir: 3m11s, exit 0).
Co-Authored-By: Kimi Code <noreply@moonshot.ai>
Mod side: Sim::step times plan_step, adapt, step_drones, step_moves,
update_sight, step_sams and record, plus the whole step and its untimed
remainder, through sim::profile. The simulation stays SDK-independent (also
built as airdef-core): the adapter installs the host monotonic clock
(game.monotonic-nanos) in init, native tests use std::time::Instant. The
counters are fixed-size, per-thread, read no randomness and change no
decision; /airdef stats reports them as PROFILE chat lines, reset per world.
Driver: raid_bench gains --scheduler in-frame|server-thread (the two
single-player paths, measured separately), HORIZON_MOD_CPU_PROFILE=1, the
per-tick mod-path spans joined to the frame trace (per-frame totals, >25/33 ms
counts, what the worst CPU frames carry), and the mod phase profile read at
idle and battle end with the battle delta. report.json carries mod_cpu,
mod_cpu_ticks, mod_phases_* and the derived correlation. Tests for the new
helpers.
Engine gitlink: mod-path CPU spans + game.monotonic-nanos (API level 32).
Co-Authored-By: Kimi Code <noreply@moonshot.ai>
tools/raid_bench.py (+ tests): the #147 step-0 driver replaces the #126
scratch script. One battle at fixed ticks (waves inside resident terrain —
far waves stall at the unknown-chunk edge and no fight happens), fingerprint
chat lines at control ticks, then the raid's own recording replayed. Both
render paths are benched on the SAME recording in ONE process via the
engine's diagnostic `model-instancing off|on` toggle (cross-process battles
diverge in event timing: 16 vs 32 kills at one control tick), pairs in
alternating order; idle cold/warm, mid-battle window, reload (F3+T), replay
seek, away-camera checks, and static off/on stills for pixel parity
(hd_bench motion-mask methodology). report.json carries gitlinks, device,
mod_models counters, CPU/GPU p50/p95/p99/max, raw frame times, >25/33 ms
frame counts, guest fuel and streaming queues.
Engine gitlink: one mass mod-model group GPU-instanced (retained mesh per
pack generation, current/previous pose/id/light instance stream shared by
main, motion and shadow passes, per-vertex fallback to parity, runtime
diagnostic toggle, stats raw + guest fuel reporting).
Measurements: docs/measurements/issue-147-instancing/ (M5/Metal, 2560x1440;
RTX 3060 pending). docs/REPO-MAP.md and docs/ENGINE.md pin updated.
Co-Authored-By: Kimi Code <noreply@moonshot.ai>
The heavy WASM scenario (wasm_flat_budget, 64 integrated complexes vs two
`airdef wave oreshnik 40 2600`) lost intercepts at the tick-2102 checkpoint:
522 (main) -> 302 (#133) -> 243 (#134). Decomposed by A/B on one fixture, one
host (2bcce64), one SDK, each slice built from its own commit:
- 522 -> 302 (#133): Track.vel became an estimate from noisy measured places
(it was the target's true velocity); the forecast, the aim lead and the
interceptor's launch Fix all read it. Forcing the class estimate to Unknown
leaves the count unchanged (native 296 ~= 294), so class/roles is not the
cause. The pre-#133 522 used the target's true velocity, which the #133
contract "class and speed only from measurements" forbids; this portion is
the intentional cost of honest measurement-only tracks and is kept.
- 302 -> 243 (#134): the network cue was extended from the separate engagement
radar to every fire-quality radar, including each weapon's embedded radar.
Cueing every relayed contact each tick flooded the embedded fire control with
one-tick plots whose noisy velocity degraded guidance. Restricting the cue
back to separate radars recovers the whole drop: 243 -> 325.
- own_fire_within / FIRE_QUALITY / channels are NOT causes here: relaxing the
own-fire gate or the channel limit each changed nothing (243 -> 243). Embedded
radars always measure Fire plots of quality >= 64 and have no channel limit.
- #140 does not affect this loadout, by fact: the fixture deploys no separate
radar, so every profile is embedded with channels = 0; the channel-age bug
binds only where a profile has channels, and the channels-off A/B was flat.
Fix: the cue looks only through a separate fire-quality radar
(sam.kind == SamKind::Radar); the embedded radar keeps its beam/revisit/lock
acquisition as before #134. All radar profiles, channel limits, own-fire
authority and the measurement-only class/speed contract are preserved; no
target truth is injected.
Measured after the fix (WASM, fuel budget 300M/tick): checkpoint 325 intercepts
/ 2011 hits, fuel max 118M; final (tick 3302, two late Smart raids) 385 / 2472,
fuel max 176M; zero fuel failures. The first late raid reports the #135 recon
flight ("Разведка противника: впереди налёта высланы разведчики"); the second
is silent (recon budget spent) — the fixture now expects exactly that instead
of the stale empty chat that stopped the scenario.
Tests:
- airdef-mod/tests/saturation.rs: deterministic native replica of the checkpoint
(same sim, host block tracer) asserting the restored count and a regression
threshold, plus the #140 loadout fact (no separate radar, channels = 0).
- Sim::launch_audit (why.rs): on-demand tolerance diagnostic counting why each
(system, drone) pair holds fire — no track / stale / no authority / role /
doctrine / reach / claimed / not ready / not aimed / terrain / ready.
- sensor_tests: a network plot cues a separate fire radar but not the embedded one.
- wasm_flat_budget baselines re-measured with provenance comments; the asserted
fixture SHA in tools/airdef.py updated.
Verification: `python3 tools/airdef.py test-budgets` passes both stages and the
two late raids (283 steps, fuel failures = 0). airdef-core 292 + 8, mod lib 104,
mod scenarios 5, saturation 2 — all green. A/B record:
docs/measurements/issue-145-intercept-regression.json.
Co-Authored-By: Kimi Code <noreply@moonshot.ai>
Integration note (shipped engine 8e711f969): the tick-2102 checkpoint baseline is
unchanged and passes on the shipped engine (325 intercepts / 2011 hits). The final
stats baseline was re-measured on the shipped engine with #146 integrated (one
knowledge snapshot per Smart order changes the two late raids): 414 / 2463, world
8885 sections / 420671 rays / 3442845 cells. The asserted fixture SHA in
tools/airdef.py was updated to match. python3 tools/airdef.py test-budgets passes
all 283 steps with zero fuel failures (tick max 184608537 / 300000000).
- a radar's fresh track reaches a post as a cue only: it points the head
but never enters the post's tracks, seen or own set
- a searching post's sector follows the turning head, not the fixed base
heading; switching contacts drops the old contact's picture
- dead and blinded posts spend no probe budget and never observe
- the icon alias is part of the generator, so the placeholder item uses
the radar texture without a duplicate PNG or a hand-written asset
- part diagnostics read "Опт" for a passive post's sensor
- tests: cue wiring, turning sector, contact switch, dead post, graphics
preset; generator alias
Cherry-picked from 3697a1764aec7a7bdc6311918453dd51e26ecabf onto the
#132/#133/#134 base: the cue-wiring test's track literal now carries the
shared class/source/product/quality contract instead of a DroneKind.
Co-Authored-By: Kimi Code <noreply@moonshot.ai>
- new Optical unit kind with its own catalog row and deploy item
- bounded one-contact line-of-sight checks against land and blocks
- day/night reach and hold timing; obstacle and unknown geometry block sight
- independent class observation with source, time and uncertainty, never DroneKind
- map/monitor/panel statuses and a line to the selected contact
- tests: day/night, wall/unknown, ageing, no kind leak, bounded work, passivity
Cherry-picked from 3ae21123964a9d3234bb2b3efc9ff926d64fc77d onto the
#132/#133/#134 base: the cue test's track literal now carries the shared
class/source/product/quality contract instead of a DroneKind.
Co-Authored-By: Kimi Code <noreply@moonshot.ai>
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>
Stage 1 of #125: prove or disprove real hardware ray-tracing support without
touching the client renderer. The probe pins the same wgpu 30.0.1 stack as the
engine, including its vendored third_party/wgpu-hal patch, builds one BLAS/TLAS
and traces a 16x16 ray-query compute frame, checking every ray against a CPU
point-in-triangle expectation.
Verified on macOS aarch64, Apple M5 / Metal: BLAS/TLAS and the ray-query
pipeline build, 32 hits and 224 misses all match, exit 0. RT_PROBE_BACKEND=gl
reports no RT adapter and exits 2; RT_PROBE_NO_OPTIN=1 shows request_device
rejects EXPERIMENTAL_RAY_QUERY without the experimental opt-in and exits 2.
tools/rt-probe/target/ is ignored; the probe is a standalone workspace and is
not wired into the game build.
Co-Authored-By: Kimi Code <noreply@moonshot.ai>
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>
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>
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>
The armed/support check in load_specs named the ten armed kinds, so a new
unit type would still have required a code edit and repeated the coupling
#91 is removing. Drop it: optional missile/gun rows are still validated
generically, and the existing kind-coverage check against content.json
already ties specs to the catalog.
validate_specs now takes the document, content identities and sound
events, and a test shows a hypothetical unit kind is accepted from a
specs row plus its content entry alone. No data or balance changes.
Verified: gen_catalog --check fresh, test_gen_assets 10 tests, core
release 195 passed + 8 scenarios (7 ignored), adapter 64 unit +
1 boundary + 5 scenarios, WASM contract 27 steps.
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.
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.
Reproduce stale upstream configuration with real local Git repositories, including the already-matching pin fast path.
Co-authored-by: Codex <codex@openai.com>
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>
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>
Keep authored JSON separate from generated output. Export rotated model bounds for SDK-free navigation and check grazing voxel corners. Include unretouched in-game before/after captures and explicit art/performance limits; pilots are an intermediate pass, not completion of the full asset set.
Co-Authored-By: Codex <noreply@openai.com>
Keep runtime compilation in an opt-in CI tier; run asset consistency on regular builds. Sandbox checks do not substitute for GPU, capture or maximum-scenario budgets.
Co-Authored-By: Codex <noreply@openai.com>
Replace patch-stack reconstruction with safe pinned initialization and legacy checkout migration; use an engine-local packer and write artifact identities.
Co-Authored-By: Codex <noreply@openai.com>
#101: radars locate sites from launches, /airdef sites, /airdef strike; sites launch slower (15/25/50 ticks) so a strike can come in time. #48: M opens the map on the network's picture, with an editor. #47: guard, sector, reserve and salvo per system. #94: vehicles route round slopes and water and say when they cannot get through. #96: reverb, and a menu switch for the acoustics. #92: generated files are validated before the swap, repo map.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Smoke: one rule by engine, no heat on trails, no trail on P1-SUN. Searchlights: two lamps a target, off with an empty sky. Halos fade before their reach and their sum is limited. Launch sites load chunks through the server thread, go off-map as a last resort, and reach 4000 blocks. Air defence: ranges x1.5, shots grow with urgency, claims released, /airdef lastchance, long shots on a big radar's tracks. Build: rust-toolchain.toml, airdef.py check, generator manifest and --check.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>