Skip to content

Fixes to --generateTrace to make analyze-trace work#3703

Open
jakebailey wants to merge 4 commits intomainfrom
jabaile/trace-fixing
Open

Fixes to --generateTrace to make analyze-trace work#3703
jakebailey wants to merge 4 commits intomainfrom
jabaile/trace-fixing

Conversation

@jakebailey
Copy link
Copy Markdown
Member

Copilot AI review requested due to automatic review settings May 4, 2026 18:46
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Updates --generateTrace output to be compatible with analyze-trace by adding a checkerId dimension and emitting concurrent duration events on separate synthetic thread IDs.

Changes:

  • Add checkerId to trace legend records and propagate it through checker tracing calls.
  • Assign synthetic thread IDs based on event args so concurrent file/check events don’t overlap on the same thread.
  • Update trace baselines and add a Go test ensuring per-thread nesting and separation invariants.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
testdata/baselines/reference/tsc/generateTrace/generateTrace-with-multiple-files-and-complex-types.js Updates expected trace output (checkerId + synthetic tids) for multi-file scenario.
testdata/baselines/reference/tsc/generateTrace/generateTrace-generates-types-file.js Updates expected trace output (checkerId + synthetic tids) for types-file generation scenario.
internal/tracing/tracing_test.go Adds test asserting concurrent duration events use separate TIDs and are well-nested per thread.
internal/tracing/tracing.go Implements synthetic thread ID assignment + adds checkerId to trace legend records.
internal/checker/tracer.go Propagates checkerId into trace event args from checker tracer.

Comment thread internal/checker/tracer.go Outdated
Comment thread internal/tracing/tracing.go
Comment thread internal/tracing/tracing.go Outdated
Comment thread internal/tracing/tracing.go Outdated
@jakebailey jakebailey requested a review from Copilot May 4, 2026 20:17
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

Comment on lines +30 to +42
if !separateBeginAndEnd {
return t.tracing.Push(phase, name, t.copyWithCheckerIndex(args), separateBeginAndEnd)
}

args, restore := t.temporarilyAddCheckerIndex(args)
pop := t.tracing.Push(phase, name, args, separateBeginAndEnd)
restore()

return func() {
_, restoreEndArgs := t.temporarilyAddCheckerIndex(args)
defer restoreEndArgs()
pop()
}
Comment on lines +335 to +343
tid := key.defaultThreadID()
for {
if existingKey, ok := tr.threadKeys[tid]; !ok || existingKey == key {
break
}
tid++
}
tr.threadIDs[key] = tid
tr.threadKeys[tid] = key
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.

3 participants