Skip to content

Diagnostics and Performance

aeddddd edited this page Sep 29, 2026 · 1 revision

Diagnostics and Performance

AE2Enhanced ships a command-driven analysis toolkit for system health checks, performance profiling, crafting-plan verification and performance anomaly alerts.

Main command: /ae2enhanced, alias /ae2e.

Permissions

  • /ae2e perf and /ae2e plan are available to everyone by default (permission level 0). Adjust with Diagnostics.analysisPermissionLevel in the config file (2 = OP only); tab completion follows the same rule.
  • /ae2e diag, /ae2e debug and the other maintenance subcommands require OP (permission level 2).

1. Diagnostic Switches (/ae2e debug)

All diagnostic logging and data collection is switch-controlled. Changes take effect immediately at runtime, are not written back to the config file, and reset to their built-in defaults on restart.

/ae2e debug list                    # list all switches with their current state
/ae2e debug <switch> on|off         # enable/disable (runtime override)
/ae2e debug <switch> reset          # restore the built-in default
/ae2e debug <switch> status         # show one switch
Switch Default Purpose
specialcrafting off Verbose logs for special-recipe routing, the LP planner and gate execution
virtualbatch off Failure reasons for virtual batch crafting in the Central ME Interface
batchaggregate off Crafting CPU batch-aggregation decisions (throttled to once per 5 s)
perf on Master switch for performance collection (TPS sampling + instrumented timers). When off, /ae2e perf shows only previously collected snapshots
planverify on Crafting-plan conservation check (runs automatically on every completed plan)
centralfluid off Per-node fluid lifecycle diagnostics for the Central ME Interface (extraction → fluid-channel injection → fallbacks)

2. System Health Checks (/ae2e diag)

/ae2e diag check [system]

Runs read-only health checks for the given system (default all), with results color-coded OK / WARN / ERROR in chat:

System What it checks
storage Hyperdimensional storage: controller formed / safe mode (corrupted storage sections) / network active and powered; on-disk save header integrity (magic + version)
channels Storage channel registration: Energy / Mana / Starlight channels against their registration conditions; gas (mekeng) and essentia (thaumicenergistics) channel presence
recipes Recipe registries: Black Hole / Singularity Ritual recipe counts, Singularity Chamber index size and per-type distribution
grid AE2 grids: empty grids, controller conflicts, suspected power loss (power draw with zero stored energy), crafting CPU statistics
personaldim Personal dimensions: orphan entries (dimension not registered), dimension ID conflicts
/ae2e diag check            # all systems
/ae2e diag check grid       # AE2 grids only

/ae2e diag report

Runs all checks and writes a full report to logs/ae2enhanced/diag-<timestamp>.txt, containing:

  • Environment info (mod version, relevant mod presence, switch states)
  • All check results with OK / WARN / ERROR totals
  • Server TPS across three windows
  • Metrics registry snapshot
  • Recent anomaly events (up to 50, newest first)

When reporting an issue, run this command first and attach the generated file.


3. Performance Analysis (/ae2e perf)

3.1 Server TPS

/ae2e perf tps

TPS and tick-time statistics (avg / min / max / p95) over 5 s / 1 min / 2 min windows. Color-coded: green ≥ 19.5 TPS, yellow ≥ 15, red otherwise.

3.2 Top Consumers

/ae2e perf top machine [n]     # Top-N machine classes by avg tick time across all grids (default 10)
/ae2e perf top grid [n]        # Top-N grids by avg tick time
/ae2e perf grid <rank>         # drill into the grid at the given rank (nodes / power / storage / CPUs / controller state)

Data source: per-node tick time (nanoseconds) held in this mod's own timing registry. AE2-UEL removed the native timing field (getAvgNanoTime() always returns 0), so the mod takes over collection with a Mixin wrapping TickManager's tickingRequest calls (/ae2e debug perf off to stop it).

The average is a time-weighted EMA with a 2-second time constant, so it converges within seconds after a machine is unloaded or slowed down — a per-call EMA would barely move for machines that tick once every few seconds. Nodes that have not ticked for 30 s are treated as having no data, preventing stale values from polluting the rankings. The scan's own cost is printed at the end of each listing (overhead self-check).

3.3 Slow Node Location

/ae2e perf slow [thresholdMs] [n]    # nodes whose avg tick time exceeds the threshold (default 1.0 ms, top 10)

Each line shows the machine class, average time, and coordinates + dimension so you can walk or teleport to the offender.

3.4 Metrics Snapshot

/ae2e perf metrics

Dumps the internal metrics registry: counters, timers (p50/p95/p99) and gauges. Examples:

  • Counters — crafting.nativeCalcAbort (native calculation aborted over budget), plan.path.<path> (executions per planner path), plan.verify.violation, plan.lp.degradedUnit
  • Timers — storage.hdc.update, ae2.craftingcpu.executeCrafting, plan.computeMs.<path>, plan.computeMs.lpPhase, perf.analyzer.scan

3.5 Baseline and Anomaly Alerts

/ae2e perf baseline set         # capture the current state as the baseline (server must have been up ≥ 1 minute)
/ae2e perf baseline show        # show the baseline
/ae2e perf baseline clear       # delete the baseline (disables alerts)
/ae2e perf alert [multiplier]   # show/set the alert multiplier (default 1.5)

Once a baseline exists, the system compares every minute: average tick time, total grid tick time, and the baseline's Top-10 machine classes. If any exceeds baseline × multiplier, an alert is broadcast to online OPs (5-minute cooldown) and recorded in the anomaly event stream (visible in diag report). The baseline persists per save (<save>/ae2enhanced/perf/baseline.json); re-run baseline set when your world enters a new stage.

3.6 Data Export

/ae2e perf export

Exports TPS windows, grid/machine scans and the full metrics registry to logs/ae2enhanced/perf-<timestamp>.json for trend analysis in Excel, Grafana or any JSON-capable tool. Periodic exports form a historical trend dataset.


4. Crafting Plan Analysis (/ae2e plan)

/ae2e plan stats

Effectiveness evaluation of the plan optimization strategies:

  • Per-path execution counts and compute-time distribution (avg / max / p95): special, dag, dagFallback, native
  • Conservation check totals: passed / violated / skipped (simulated plans)

/ae2e plan running

Execution status tracking: lists all busy crafting CPUs — final output, progress percentage, co-processors and elapsed time.

Conservation check (automatic)

Runs on every completed crafting plan (planverify switch): a non-simulated plan tree must contain zero missing materials. A violation means the planner produced an inconsistent tree; it is logged and recorded in the anomaly event stream immediately. During normal play the violation count should always be 0.

See LP Crafting Planner for how the planner itself works.


5. Storage Checks and Stress Test

/ae2e diag check storage

Verifies the Hyperdimensional Storage Nexus:

  • Every loaded controller: structure formed, not in safe mode, network active and powered.
  • Every on-disk storage entry: file header integrity — the AE2E magic and a valid version number. An entry whose header cannot be read is reported as an error.
  • Entries present on disk with no loaded controller are reported as informational, since the chunk is probably just unloaded.

Safe mode is the storage system's permanent-error state (corrupted frames, serialization failure or corruption found while loading). A section that enters safe mode becomes read-only; transient I/O faults (disk hiccups, antivirus file locks) are retried with backoff and do not trigger it.

/ae2e diag check personaldim

Verifies personal dimension bookkeeping:

  • An entry whose dimension ID is assigned but not registered → ERROR (orphan entry).
  • An entry whose dimension ID is registered but is not a personal dimension type → ERROR (ID conflict).
  • An unassigned, empty entry (rules edited ahead of time) is normal and does not warn.

/ae2e testhd <uuid> <count>

A storage stress test: inject count randomly generated enchanted gear types (swords, tools, armor, bows with 0–5 random enchantments and random large stack sizes) into the storage of the formed Hyperdimensional Controller with the given UUID. count accepts 1 to 100,000.

This is how the storage system is exercised against the "tens of thousands of distinct item types" scenario. Use /ae2e recoverhd list to find a UUID, then run the test against it.


6. Anomaly Event Stream

The following events are recorded automatically (256-entry ring buffer, newest first):

  • Native crafting calculation aborted over budget (default 30 s budget)
  • Special-recipe detector analysis over budget (conservative miss)
  • Plan conservation violations
  • Performance anomaly alerts

View them in the "recent anomaly events" section of a /ae2e diag report.


7. Overhead Notes

Collection Mechanism Cost
TPS One nanoTime diff per tick Negligible
Grid / machine times Mixin-wrapped tickingRequest timing with a time-weighted EMA (AE2-UEL removed native timing) Two nanoTime calls per node tick, same as original AE2 behavior
L2/L3 instrumentation (HDC update, executeCrafting) 1-in-20 sampling + nanoTime Negligible
Plan verification One tree walk per completed plan Proportional to crafting request rate, very low
Alert comparison One full grid scan per minute Same as a single /ae2e perf top

Stop all collection at once: /ae2e debug perf off.


Related Pages

Clone this wiki locally