Skip to content

PRealm Updates#413

Open
lightsighter wants to merge 4 commits intomainfrom
mbauer-prealm-update
Open

PRealm Updates#413
lightsighter wants to merge 4 commits intomainfrom
mbauer-prealm-update

Conversation

@lightsighter
Copy link
Copy Markdown
Contributor


Summary

Mirrors the profiler improvements from Legion commit c428454d916064e69f598ebd4012407d6ab459d8 to PRealm. These changes improve both correctness and performance of the profiling infrastructure, and add support for new log entry types.

Async dump task architecture

  • Replaced the synchronous quadratic-scaling dump approach in update_footprint with an asynchronous swap-and-dump model. When a ThreadProfiler's memory footprint exceeds the threshold, its data is swapped into a clone and enqueued on a lock-free list. A new DUMP_TASK_ID task drains the list and writes to disk without blocking the recording thread. Continuations chain through the same user event to ensure finalize can wait for all dumps to complete.

Lock-free backtrace recording

  • find_backtrace_id now uses AutoTryLock instead of blocking AutoLock, with a lock-free pending backtrace list as fallback. This prevents hangs when called from within event wait code. Added AutoTryLock class and drain_pending_backtraces to support this.

Buffered descriptor writes

  • record_task, record_variant, record_processor, record_memory, record_affinities, and find_provenance_id now buffer descriptors (ProcDesc, MemDesc, ProcMemDesc, TaskKind, TaskVariant, Backtrace, Provenance) into deques instead of writing directly to the gzFile. Descriptors are flushed during dump tasks or finalize, ensuring correct ordering (descriptors before instance data).

Simplified dump_inter

  • Changed signature from size_t dump_inter(long long) to bool dump_inter(long long t_stop). Removed per-entry diff tracking — the caller passes an absolute time deadline, and the function returns whether all entries were drained.

MakeValid and FetchMetadata logging

  • Added MakeValidInfo and FetchMetadataInfo structs for tracking IndexSpace::make_valid() and RegionInstance::fetch_metadata() events on the critical path.
  • Added EffectKind enum to dispatch between ASYNC_EFFECT, MAKE_VALID_EFFECT, and FETCH_METADATA_EFFECT in the external event profiling callback.
  • Implemented the IndexSpace::make_valid() PRealm overload (was declared but missing) and added profiling to
    RegionInstance::fetch_metadata().
  • Added preamble entries and serialization for both new info types.

Other improvements

  • Profiler version updated from 1011 to 1012.
  • Mandatory profiling measurements now abort on failure instead of silently continuing.

@lightsighter lightsighter self-assigned this Mar 24, 2026
@codecov
Copy link
Copy Markdown

codecov bot commented Mar 24, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 29.07%. Comparing base (87ec0ad) to head (af410b0).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff            @@
##             main     #413    +/-   ##
========================================
  Coverage   29.07%   29.07%            
========================================
  Files         194      194            
  Lines       40229    40229            
  Branches    14464    14591   +127     
========================================
  Hits        11697    11697            
- Misses      27723    28115   +392     
+ Partials      809      417   -392     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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