Skip to content

[AIPROFVIS-493] Zero-initialize trace parameters so load decisions don't read garbage - #1227

Open
dhingora-amd wants to merge 1 commit into
mainfrom
dhingora/init-trace-params
Open

dhingora-amd wants to merge 1 commit into
mainfrom
dhingora/init-trace-params

Conversation

@dhingora-amd

Copy link
Copy Markdown
Contributor

Motivation

The Trace constructor set only trace_duration and metadata_loaded, leaving the other numeric fields of rocprofvis_dm_trace_params_t uninitialized (events_count[], histogram_bucket_size/count, num_db_instances, tracks_info_restored). RPD and Perfetto reset only the Launch and Dispatch counters, so CalculateParallelProcessSplitCount summed indeterminate values for the other operations. That is undefined behaviour, and the split count for large tracks could vary between runs.

Technical Details

  • Added default member initializers to every scalar in rocprofvis_dm_trace_params_t (events_count is {}), and removed the now-redundant assignments in Trace::Trace().
  • QueryManager::IsEmptyRange divides by histogram_bucket_size, which is now 0 rather than garbage before the histogram is built. It now returns "not empty" in that case, so the query runs instead of dividing by zero.
  • Testing:
    • Built linux-release, then opened trace_70b_1024_32.rpd and rocpd-transpose.db. Tracks render and tables fill as before.
    • Reopened the RPD trace several times with identical results.

@github-actions

Copy link
Copy Markdown
Security scan found no critical or high findings on lines changed by this pull request

View the security scan run for complete reports.

“New” means the finding is located in a changed file on an added or modified line; it is not a base-versus-head findings delta.

This branch was previously deployed

1 inactive deployment
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