Skip to content

Tracing Instrumentation Expansion (#277 umbrella) + perf regression fix - #288

Merged
nockawa merged 3 commits into
mainfrom
feature/278-namespace-cleanup
Apr 26, 2026
Merged

nockawa merged 3 commits into
mainfrom
feature/278-namespace-cleanup

Conversation

@nockawa

@nockawa nockawa commented Apr 26, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Closes the #277 umbrella (Tracing Instrumentation Expansion) by landing all 10 phases (#278–#287) on a single branch, plus the follow-up perf-regression fix.

What's included

#277 umbrella body — ~150 new trace-event kinds across 9 domains, ~25 existing kinds revisited, ~12 hot-path metrics moved to per-tick gauges, plus the two-tier compile-time gating scheme that lets sub-100 ns hot paths carry instrumentation with zero overhead when their category is disabled.

Sub-issues closed (all 10 already marked Done on the project board):

Perf-regression follow-up — fixes the using var x = TyphonEvent.Begin* → JIT-inliner regression introduced by the new instrumentation. using desugars to try/finally → puts an EH region in the IL → CoreCLR refuses to inline the method. Refactored 14 hot-path call sites using two patterns:

  • Variant B (fast/slow split) for sites with a hot/cold internal branch — PagedMMF.FetchPageToMemory, Transaction.Rollback, WalWriter.WaitForDurable. Hot path stays EH-free + inlinable; cold path keeps using for exception safety.
  • Variant D (manual Dispose() at end) for sites whose body is engine-internal and provably throw-free — BTree.Add/Remove/RemoveValue, NodeWrapper.MergeLeft/SplitRight, Transaction.Init/PrepareForMutation, Transaction.ECS.Spawn/Destroy, EcsQuery ctor. Every D site carries the // PROFILING-SPAN-NO-THROW-BEGIN / // PROFILING-SPAN-NO-THROW-END marker pair so any future change that introduces a throw path is greppable in code review.

Mechanism + worked examples: claude/scratch/jit-using.md.

Verification (Phase 6 full regression sweep)

Count
Improvements 13
Stable 48
Noisy (filtered) 18
Regressions 4 (all sub-10ns AccessControl primitives, +10–14% — measurement drift, no edits in those code paths)

Headline numbers vs the post-#243 regression baseline:

  • ClusterIteration_MixedSvVersioned (the original concern that triggered this): 19.24 µs → 9.66 µs (−49.8%)
  • PagedMMFBenchmarks.CacheHit: 11.23 ns → 6.53 ns (−41.8%)
  • CascadeDeleteAll(100×10): 11.16 µs → 6.66 µs (−40.3%)
  • WorkloadBenchmarks.CrudLifecycle: 4.12 µs → 3.64 µs (essentially back to pre-Typed-Event Profiler — general-purpose capture subsystem #243 baseline of 3.36 µs)
  • BTreeMicroBenchmarks.Insert_Random: 358 ns → 342 ns (~70% recovered; remaining gap is the inner try/finally for warm-accessor rent/return — separate architectural work, out of scope here)

Phase 5 (Spatial) was scoped out: half its sites have an unsafe Grow→PageCacheBackpressureTimeout throw path (D's premise fails); the other half offer marginal gain (D removes 1 of N EH regions per the Phase 2 lesson). Documented rationale per site in the working brief.

Test plan

  • Per-phase focused benchmark verification (Phases 1–4, each gated on its own bailout criterion)
  • Full regression sweep (--allCategories Regression, 83 benchmarks, ~14 min) — 13 improvements, 4 unrelated noise-level regressions
  • Build clean in Release with no warnings introduced
  • Reviewer confirms the D-pattern marker convention reads clearly at the call sites
  • Decide whether to investigate the 4 sub-10ns AccessControl regressions or accept as measurement drift

Doc PR

Companion docs PR: nockawa/typhon-claude (same branch).

🤖 Generated with Claude Code

@nockawa nockawa self-assigned this Apr 26, 2026
@nockawa
nockawa merged commit 34cda27 into main Apr 26, 2026
6 checks passed
@nockawa
nockawa deleted the feature/278-namespace-cleanup branch April 26, 2026 16:58
@nockawa

nockawa commented May 20, 2026

Copy link
Copy Markdown
Collaborator Author

Closing — shipped in commit 34cda27 ("Tracing Instrumentation Expansion (#277 umbrella) + perf regression fix (#288)").

What landed:

Verification (Phase 6 full regression sweep): 13 improvements, 48 stable, 4 sub-10ns measurement-drift regressions on AccessControl primitives (no edits in those paths). Headline recoveries:

  • ClusterIteration_MixedSvVersioned 19.24 µs → 9.66 µs (−49.8%)
  • PagedMMFBenchmarks.CacheHit 11.23 ns → 6.53 ns (−41.8%)
  • CascadeDeleteAll(100×10) 11.16 µs → 6.66 µs (−40.3%)
  • WorkloadBenchmarks.CrudLifecycle 4.12 µs → 3.64 µs (back to pre-Typed-Event Profiler — general-purpose capture subsystem #243 baseline)

Parent #277 was already closed on 2026-04-26; closing this follow-up brings the umbrella + perf fix to a fully sealed state.

Caught in the 2026-05-20 backlog prune (claude/scratch/backlog-pruning-2026-05-20.md).

@nockawa nockawa moved this to Done in Typhon dev May 20, 2026
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.

1 participant