Skip to content

Qualify SampleProfiler CPU evidence and preserve loss warnings - #166

Merged
JeremyKuhne merged 3 commits into
mainfrom
fix-sampleprofiler-cpu-provenance
Sep 30, 2026
Merged

JeremyKuhne merged 3 commits into
mainfrom
fix-sampleprofiler-cpu-provenance

Conversation

@JeremyKuhne

Copy link
Copy Markdown
Owner

Summary

  • Identify SampleProfiler thread-stack counts and mixed ETW sampling without presenting them as on-core CPU milliseconds or blocked time.
  • Carry provider warnings and qualified hints through CLI/MCP CPU results, including process inventory and timeline.
  • Preserve lost-event and provider warnings within four-warning manifest batch/diff cases; add regression tests and workflow guidance.

Validation

  • Release build; 1,927 tests passed, one expected elevation-dependent skip.
  • CLI help, MCP schema/round-trip, docs/frozen protocol, agent skills, analysis replay, and 31/31 no-model eval tasks passed.

Mixed-provider weighting has synthetic coverage; actual ETW and EventPipe fixtures were checked separately. No machine-wide capture is included.

Distinguish SampleProfiler thread-stack counts from established ETW CPU time,
qualify CPU-facing guidance, and retain capture-loss warnings when manifest
case outputs are bounded.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🔵 Needs a closer look

The warning budget can hide case-specific failures, and changed cross-provider CPU semantics warrant human review.

Review effort: Balanced
Findings: 1 Medium severity

Open (1)
What changed in this PR

This PR makes CPU results distinguish SampleProfiler thread-stack counts from on-core CPU time across the analyzer, CLI, and MCP server.

Changes:

  • Track ETW and SampleProfiler evidence and qualify CPU warnings and follow-up hints.
  • Preserve lost-event and provider warnings in bounded manifest batch and diff results.
  • Add regression tests and update workflow guidance.
File Description
tests/​Filtrace.Mcp.Tests/​TraceToolsTests.cs Tests MCP warnings and hints.
tests/​Filtrace.Core.Tests/​TraceLoaderTests.cs Tests loaded sample provenance.
tests/​Filtrace.Core.Tests/​TimelineProviderTests.cs Tests timeline provider warnings.
tests/​Filtrace.Core.Tests/​SteeringHintsTests.cs Tests qualified follow-up hints.
tests/​Filtrace.Core.Tests/​ProcessInventoryProviderTests.cs Tests process inventory provenance.
tests/​Filtrace.Core.Tests/​CpuSampleEvidenceTests.cs Tests provider-specific weighting.
tests/​Filtrace.Core.Tests/​CaptureManifestReaderTests.cs Tests bounded manifest warnings.
tests/​Filtrace.Core.Tests/​ActivityScopeTests.cs Tests warnings after activity filtering.
tests/​Filtrace.Cli.Tests/​RankingExecutorTests.cs Tests ranking output.
tests/​Filtrace.Cli.Tests/​DiffExecutorTests.cs Tests diff warning labels.
tests/​Filtrace.Cli.Tests/​CliAppTests.cs Tests CLI JSON results.
src/​Filtrace/​Cli/​TimelineExecutor.cs Emits timeline CPU warnings.
src/​Filtrace/​Cli/​RankingExecutor.cs Passes provenance to ranking hints.
src/​Filtrace.Mcp/​TraceTools.cs Carries provenance and timeline warnings through MCP.
src/​Filtrace.Core/​Tracing/​TraceLoader.cs Retains lost-event counts.
src/​Filtrace.Core/​Tracing/​TraceInfo.cs Stores lost-event counts.
src/​Filtrace.Core/​Tracing/​Readers/​TraceReadResult.cs Carries reader loss counts.
src/​Filtrace.Core/​Tracing/​Readers/​TraceLogReader.cs Classifies and weights CPU samples.
src/​Filtrace.Core/​Tracing/​Readers/​CpuSampleEvidence.cs Defines sample evidence and warnings.
src/​Filtrace.Core/​Tracing/​Providers/​TimelineResult.cs Holds timeline CPU warnings.
src/​Filtrace.Core/​Tracing/​Providers/​TimelineProvider.Snapshot.cs Detects snapshot sample providers.
src/​Filtrace.Core/​Tracing/​Providers/​TimelineProvider.EventLanes.cs Carries event-lane warnings.
src/​Filtrace.Core/​Tracing/​Providers/​TimelineProvider.cs Detects CPU-lane sample providers.
src/​Filtrace.Core/​Tracing/​Providers/​ProcessInventoryProvider.cs Applies sample provenance to inventory.
src/​Filtrace.Core/​Tracing/​CpuSampleProvenance.cs Clarifies provenance documentation.
src/​Filtrace.Core/​Tracing/​CaptureManifestOutput.cs Prioritizes bounded warnings.
src/​Filtrace.Core/​Tracing/​CaptureManifestDiffAnalyzer.cs Reserves diff-arm warnings.
src/​Filtrace.Core/​Tracing/​CaptureManifestBatchAnalyzer.cs Reserves batch warnings.
src/​Filtrace.Core/​Output/​SteeringHints.cs Qualifies CPU follow-up language.
docs/​workflow.md Documents sample-count interpretation.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/Filtrace.Core/Tracing/CaptureManifestDiffAnalyzer.cs Outdated
Accept schema 18 SampleProfiler and mixed sample-count evidence in the
Track D validator without admitting false time or malformed interval claims.
Keep capture loss and sample provenance while reserving bounded manifest
case warnings for root and per-operation diagnostics.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🔵 Needs a closer look

Mixed-provider CPU interpretation changes several analysis paths, but combined real-capture behavior has only synthetic coverage.

Review effort: Balanced
Findings: 1 Low severity

Open (1)
Resolved since last review (1)

Comment thread benchmarks/Invoke-TrackDInvestigation.ps1
Pass the schema version through count conversion and provenance validation
so malformed schema 18 results no longer report schema 17. Preserve accepted
inputs and pin missing, malformed, and legacy errors in the Track D contract.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@JeremyKuhne
JeremyKuhne enabled auto-merge (squash) September 30, 2026 01:30
@JeremyKuhne
JeremyKuhne merged commit ae608a0 into main Sep 30, 2026
4 checks passed
@JeremyKuhne
JeremyKuhne deleted the fix-sampleprofiler-cpu-provenance branch September 30, 2026 01:38
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.

2 participants