Skip to content

Fix: resolve AICPU View overlapping bars and misbound flow arrows in swimlane#557

Merged
poursoul merged 1 commit intohw-native-sys:mainfrom
indigo1973:prof_0414_v2
Apr 15, 2026
Merged

Fix: resolve AICPU View overlapping bars and misbound flow arrows in swimlane#557
poursoul merged 1 commit intohw-native-sys:mainfrom
indigo1973:prof_0414_v2

Conversation

@indigo1973
Copy link
Copy Markdown
Contributor

Perfetto silently drops partially overlapping slices on the same tid and binds flow-finish events to the wrong enclosing slice when bars overlap.

  • Assign per-core AICPU tids as 10000 + core_id * 10, with greedy lane assignment placing overlapping tasks on base_tid + 1 (dual-slot overflow)
  • Add bind_id to AICPU dependency and scheduler→task flow events so arrows attach to the correct slice regardless of overlap
  • Generate AICPU View thread metadata independently (not inside AICore loop) since overflow lanes need separate entries

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request updates the swimlane_converter.py tool to support overlapping tasks on the same core within the AICPU View. It introduces a greedy lane assignment algorithm that maps concurrent tasks to distinct thread IDs (TIDs), ensuring Perfetto renders them on separate rows. Additionally, the PR updates dependency and dispatch flow events to use these specific TIDs and includes bind_id metadata for better event linking. Feedback was provided regarding the efficiency of the metadata generation loop and the need for more robust handling of multiple sub-lanes beyond the hardcoded dual-slot assumption.

…swimlane

Perfetto silently drops partially overlapping slices on the same tid and
binds flow-finish events to the wrong enclosing slice when bars overlap.

- Assign per-core AICPU tids as 10000 + core_id * 10, with greedy lane
  assignment placing overlapping tasks on base_tid + 1 (dual-slot overflow)
- Add bind_id to AICPU dependency and scheduler→task flow events so
  arrows attach to the correct slice regardless of overlap
- Generate AICPU View thread metadata independently (not inside AICore
  loop) since overflow lanes need separate entries
@poursoul poursoul merged commit 019c2be into hw-native-sys:main Apr 15, 2026
15 checks passed
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