Skip to content

Config-driven profiler startup (#332) + Workbench evolutions - #359

Merged
nockawa merged 4 commits into
mainfrom
feature/small-evols-fixes
May 18, 2026
Merged

nockawa merged 4 commits into
mainfrom
feature/small-evols-fixes

Conversation

@nockawa

@nockawa nockawa commented May 18, 2026

Copy link
Copy Markdown
Collaborator

Batch of small evolutions & fixes (feature/small-evols-fixes).

#332 — Implicit, config-driven profiler startup

Closes #332. Profiler integration becomes zero host code — the runtime self-wires it from configuration.

  • ProfilerSessionMetadataBuilder (engine-internal) replaces the host glue ProfilerSetup.BuildSessionMetadata (deleted). Session metadata — systems, worker count, tick rate, ring capacity, static-structure tables, resource graph — is derived entirely from TyphonRuntime + runtime.Options. RuntimeConfigRecord is fully populated (no hardcoded 16/60f, no 0 stubs).
  • ProfilerBootstrap self-wires the profiler at TyphonRuntime.Create; a [ModuleInitializer] bakes the JIT producer gate before hot paths compile.
  • Config-driven: TelemetryConfig resolves the launch config from typhon.telemetry.json + TYPHON__PROFILER__* env vars. A host that wants a CLI override (--trace/--live) parses its own args and injects via the new services.AddTyphonProfiler(...) DI hook — the engine never reads the command line implicitly.
  • Trace finalization is driven by ManagedPagedMMF.DisposingEvent — deterministic on every host (incl. Godot) and after the engine's shutdown teardown, so those events land in the trace and the file is always properly closed.
  • TyphonProfiler.Start(parent, metadata) is now internal (kept for IOProfileRunner + exporter integration tests, which have no TyphonRuntime).
  • Hosts migrated: ProfilerSetup.cs deleted; AntHill.Demo/Main.cs + AntHill.Harness/Program.cs reduced to plain bridge.Initialize(...).
  • New tests: ProfilerSessionMetadataBuilderTests, rewritten ProfilerLaunchConfigTests. Full engine suite green (3733 passed).

Deviations from the issue spec (no public Start(runtime, options) overload — superseded by self-wiring; old Start made internal not removed; CPU-sampling QPC handled internally) are detailed in the issue's completion comment.

Workbench evolutions

  • Profiler header / TimeArea — display-options popover (span-colour lens, off-CPU overlay toggle, dynamic track height), slimmed section-filter popover (visibility only), a ? how-to-use dialog, and adaptive relative-age formatting in the Recent pane.
  • Profiler overview bar — displays the selected tick range.
  • SSE keepalive fix — re-issuing WaitForNextTickAsync per loop iteration threw InvalidOperationException; disconnect log spam suppressed; Logs tab unseen-activity badge.
  • wb-dev.ps1 — watch-kestrel / watch-vite foreground modes with -LogLevel override.

Follow-ups (minor, not blocking)

Code-review items carried forward: ProfilerBootstrap.cs namespace cased Typhon.Engine.internals vs the convention Internals; dead TelemetryConfig.Configuration field; orphaned ProfilerLauncher.EnableTelemetryGateIfActive/PrintDiagnostics.

🤖 Generated with Claude Code

nockawa added 4 commits May 18, 2026 09:18
 - Fix SSE keepalive PeriodicTimer crash (re-issuing WaitForNextTickAsync per loop threw InvalidOperationException)
 - Suppress disconnect log spam
 - Logs tab unseen-activity badge

wb-dev.ps1 watch-kestrel/watch-vite foreground modes with -LogLevel override.
Profiler header
- TimeArea — Display options popover: new settings icon holding span-colour lens, off-CPU overlay toggle, and dynamic track height (split out of the filter funnel).
- TimeArea — section filter popover: stripped down to pure section visibility (color/off-CPU moved out).
- TimeArea — help button: new ? icon (shown only when legends are on) opening a full how-to-use dialog modelled on the Critical Path one.
- Recent pane — relative age: adaptive scale (just now / minutes / hours / days / months) instead of days-only.
@nockawa
nockawa merged commit dbd6340 into main May 18, 2026
6 checks passed
@nockawa
nockawa deleted the feature/small-evols-fixes branch May 18, 2026 14:11
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.

Make profiler session metadata implicit — TyphonProfiler.Start(runtime)

1 participant