Skip to content

[AIPROFVIS-890] Treat empty track areas as success instead of kRocProfVisResultOutOfRange - #1217

Merged
tomk-amd merged 2 commits into
dhingora/fix-job-exceptionsfrom
tkarczew/fix-outofrange-err
Nov 23, 2026
Merged

tomk-amd merged 2 commits into
dhingora/fix-job-exceptionsfrom
tkarczew/fix-outofrange-err

Conversation

@tomk-amd

@tomk-amd tomk-amd commented Nov 23, 2026 •

Copy link
Copy Markdown
Collaborator

Motivation

This is a patch for PR #1150 (dhingora/fix-job-exceptions). kRocProfVisResultOutOfRange "errors" being handled can cause segments to get dropped, see table below in details.

Fetching a range of a track or graph with no events in it returned kRocProfVisResultOutOfRange. That isn't an error: the range is just an empty area of the track. Because the code returned it anyway, every caller had to special-case it:

  • DataProvider hid the warning for OutOfRange in three places.
  • TrackItem::HandleTrackDataChanged treated OutOfRange as success.
  • The Python track_events binding, the Timeline::AsyncFetch assert and the controller tests all accepted it as a valid result.

So a real OutOfRange failure looked the same as an empty range.

Separately, a range with 1M or more events is split into two model read requests. If only one of them started, the fetch still returned success and the range was cached as valid with some of its events missing.

Technical Details

Controller

  • Track::FetchSegments, SegmentTimeline::FetchSegments, Segment::Fetch and WaitForAndProcessTraceReadRequests now default to kRocProfVisResultSuccess. A range with no segments or no events is a successful, empty fetch.
  • ProcessEventRecords resets the result to success after skipping an event that is out of range. Before, if the last record was skipped, the whole fetch returned OutOfRange.
  • Graph::GenerateLOD returns kRocProfVisResultInvalidArgument for an LOD that doesn't exist, and succeeds when the requested range doesn't overlap the graph.
  • Removed the OutOfRange cases from the Timeline::AsyncFetch assert and from the SegmentTimeline::FetchSegments walk.
  • FetchFromDataModel fails with kRocProfVisResultUnknownError when fewer read requests start than were asked for, unless the fetch was cancelled. The requests that did start are still waited for, so their slices and futures are released.

View / Python

  • DataProvider always logs a warning when a graph, event or sample request fails.
  • TrackItem extracts points only when the response is kRocProfVisResultSuccess.
  • The Python track_events binding treats only kRocProfVisResultSuccess as success.

Tests

A Test has been added to capture the case of "Graph Range With Empty LOD Segment". Below are the results comparing this fix with PR 1150.

Trace Layout found PR #1150: all segments This branch: all segments Data segment alone (both)
trace_70b_1024_32.rpd Graph 0, LOD 4: empty segment 36, data segment 41 kRocProfVisResultOutOfRange (10), 0 entries kRocProfVisResultSuccess, 1 entry kRocProfVisResultSuccess, 1 entry
rocpd-transpose.db Graph 0, LOD 3: empty segment 488, data segment 504 kRocProfVisResultOutOfRange (10), 0 entries kRocProfVisResultSuccess, 4 entries kRocProfVisResultSuccess, 4 entries

Clean up all of the downstream code that did special handling for kRocProfVisResultOutOfRange.
A range with 1M or more events is split into two read requests. If one failed to start, the fetch still reported success and the range was marked valid with part of its events missing. The fetch now fails with kRocProfVisResultUnknownError when fewer requests start than were asked for, unless it was cancelled. The requests that did start are still processed so their slices and futures are released.
@tomk-amd
tomk-amd changed the base branch from main to dhingora/fix-job-exceptions November 23, 2026 16:34
@tomk-amd
tomk-amd marked this pull request as ready for review November 23, 2026 16:35
@trangvu-amd trangvu-amd changed the title Treat empty track areas as success instead of kRocProfVisResultOutOfRange [AIPROFVIS-890] Treat empty track areas as success instead of kRocProfVisResultOutOfRange Nov 23, 2026
@tomk-amd
tomk-amd merged commit f65c950 into dhingora/fix-job-exceptions Nov 23, 2026
1 check 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.

1 participant