Skip to content

feat(diagnostics): developer diagnostics and runtime inspection (DEBUG-1) - #152

Merged
NastMz merged 6 commits into
mainfrom
feat/debug-1
Nov 13, 2026
Merged

NastMz merged 6 commits into
mainfrom
feat/debug-1

Conversation

@NastMz

@NastMz NastMz commented Nov 12, 2026

Copy link
Copy Markdown
Owner

Closes #119.

Evaluation: docs/evaluations/debug-1.md. Record: odd/tasks/debug-1.md.

What an external developer can now do

  • Live measurements: Game.Diagnostics reports the last frame's events, update, render and present times, steps, allocations, collections per generation, draw calls and audio voices, plus the time of every frame system (FrameSchedule.MeasureTime / Times(phase)). Off by default, free while off.
  • .NET metrics: meter "MicroEngine" (dotnet-counters monitor --counters MicroEngine); a listener turns measuring on.
  • Debug drawing: Game.DebugDraw (lines, rects, circles, points, text; world or screen space; one frame or N seconds) and DebugDraw.Physics(world).
  • Physics read-back: IPhysicsWorld2D.ShapesOf / DescriptionOf (default members, new PhysicsCapabilities.ShapeInspection, declared by both backends), TilePhysicsWorld2D.GridOf.
  • Input routing: InputSystem.Trace / Routed, the layer that took each event.
  • Backend messages through ILog: PlatformRequest.Log; SDL and raylib messages are replayed into the game's log at start (same console text by default).
  • Crash reports: the desktop launcher writes crash-<time>.txt to the save folder and names it (CrashReport, HostEnvironment.CrashDirectory).
  • No casts: IGraphicsDevice.Counters, AudioMixer.Statistics.

Docs: new manual page "Diagnosing a game", a Diagnostics example in samples/Examples (F3), release notes, regenerated API pages.

Checks

  • dotnet test MicroEngine.slnx -c Release: all pass except MicroEngine.Desktop.Tests clipboard check, which also fails intermittently on main on the same machine (2 of 3 runs).
  • Snippets, api-reference --check, site tests 71/71, SITE_DEMOS=none npm run build with check-dist.
  • Headless capture of the example: overlay, tile outlines, one-way tops and player box drawn.

Not verified: desktop windows (SDL/raylib), browser and mobile runs of the overlay; dotnet-counters against a live process.

Risk: item 3. The shared frame loop takes the measured path while diagnostics are active, and backend messages reach the console when the game starts instead of when the platform is created (same text). Additive contract members only, with defaults.

@github-actions

github-actions Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

Preview of 4320fe2 (candidates demos): https://micro-engine-3jyftqe8w-nastmzs-projects.vercel.app

@NastMz
NastMz merged commit 7f0f8b7 into main Nov 13, 2026
43 checks passed
@NastMz
NastMz deleted the feat/debug-1 branch November 13, 2026 03:21

This branch was successfully deployed

1 active deployment
preview — 4320fe2e Deployed Nov 13, 2026 by NastMz via Site / Deploy preview #411
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

DEBUG-1 — Investigate developer diagnostics and runtime inspection tools

1 participant