Aetheria/Assets/Scripts
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Meta Vens b15cbbe5de Cut 10: the hot path stops looking like, and costing like, a diagnostic
The diagnostics refactor (72c0109c) kept the debug HUD and the simulation on one
fire-control model by routing HitProbability THROUGH Inspect. That was the right
invariant implemented at the wrong level: every AI and turret evaluation, per
weapon per tick, built the full diagnostic struct and ran IsRevealed's sort, the
aim-point cell walk and HullKernel's allocations and per-cell exp -- and only
then checked whether the target was even in range. A Soul pass measured 9.87 us
and 448 B per call on paths that used to bail in nanoseconds. Operator: it made
the hot path look like a diagnostic one.

One model is now shared at the level of its factors. HitProbability runs its
cheap gates first and bails, exactly as it did before the refactor, and computes
PSensor, PSpread and POnHull only for a shot that is actually possible. Inspect
calls the same four factor functions and fills the struct unconditionally,
because a HUD wants to see why a shot is impossible. The HUD panel and its one
test consumer are unchanged.

Two tests make the design enforced rather than conventional:
- HitProbabilityMatchesInspect: exact equality across 21 configurations covering
  every gate the hot path bails on plus Precision and info sweeps. Dies when a
  factor changes in only one caller.
- GatedOutHitProbabilityAllocatesNothing: 1000 out-of-range calls allocate zero
  bytes. Dies when HitProbability is routed back through Inspect.

Both mutations verified RED and distinguished from a compile failure, with
restores checked against a hash taken before mutating.

231 tests pass.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-22 15:18:12 +02:00
..
CultCache Pin AetheriaStores routing with tests; make PlayerSettings readable 2026-09-14 19:12:54 +02:00
Editor Shield panel: gate reuse and Hit on the panel's own radius 2026-09-18 21:02:18 +02:00
Gameplay Add live fire control diagnostics 2026-09-20 21:58:44 +02:00
ServerShared Cut 10: the hot path stops looking like, and costing like, a diagnostic 2026-09-22 15:18:12 +02:00
Tests Swap Unity.Mathematics usings for CultMath 2026-09-14 17:39:12 +02:00
UI Wire subsystem selection and reveal into player input and the HUD 2026-09-19 13:02:54 +02:00
Zone Display Switch engine asset references from Resources paths to Addressables GUIDs 2026-09-18 05:04:50 +02:00
AetheriaInput.cs Let the player target and mark neutrals, and fix the HUD lock direction 2026-09-17 14:01:15 +02:00
AetheriaInput.cs.meta Minimap + Input System 2020-12-02 16:42:09 +00:00
CultCache.meta Restore the stable legacy Unity project 2026-08-10 14:57:50 +01:00
Editor.meta Old Aetheria Code 2020-03-09 01:28:55 +00:00
EngineAssets.cs Switch engine asset references from Resources paths to Addressables GUIDs 2026-09-18 05:04:50 +02:00
EngineAssets.cs.meta Switch engine asset references from Resources paths to Addressables GUIDs 2026-09-18 05:04:50 +02:00
EventLog.cs Trade Menu Spreadsheet 2021-01-14 03:20:27 +00:00
EventLog.cs.meta Trade Menu Spreadsheet 2021-01-14 03:20:27 +00:00
FilterTest.cs Hit Detection 2021-01-08 12:44:10 +00:00
FilterTest.cs.meta Hit Detection 2021-01-08 12:44:10 +00:00
Gameplay.meta Weapon Scripting Overhaul 2021-01-25 05:53:36 +00:00
Prototype.cs Hit Detection 2021-01-08 12:44:10 +00:00
Prototype.cs.meta Copy Aetheria Code 2020-02-27 18:51:07 +00:00
PrototypeParticleReturn.cs Trade Menu Spreadsheet 2021-01-14 03:20:27 +00:00
PrototypeParticleReturn.cs.meta Trade Menu Spreadsheet 2021-01-14 03:20:27 +00:00
Rotate.cs Hit Detection 2021-01-08 12:44:10 +00:00
Rotate.cs.meta Hit Detection 2021-01-08 12:44:10 +00:00
ServerShared.meta Initial Client/Server Communication 2020-02-26 17:48:40 +00:00
Tests.meta Sector & Loadout Generation Fixes 2021-03-18 22:48:33 +00:00
UI.meta Generating and Displaying Zones 2020-03-29 04:19:24 +01:00
UnityExtensions.cs Swap Unity.Mathematics usings for CultMath 2026-09-14 17:39:12 +02:00
UnityExtensions.cs.meta Database Support 2020-03-22 19:05:26 +00:00
Zone Display.meta Trailer Stuff & More 2021-03-27 10:03:24 +00:00