
Given a list of event records, implement a function that computes per-user summary metrics efficiently. Each record is a dictionary with keys user_id (string), duration (integer), score (integer), and valid (boolean). Return a list of dictionaries sorted by user_id, where each output item contains user_id, total_duration (sum of valid durations), avg_score (average score over valid rows, rounded to 2 decimals), and event_count (number of valid rows). The goal is to avoid slow row-by-row processing and use vectorized Pandas/NumPy operations.
0 <= len(records) <= 2 * 10^5user_id is a non-empty string0 <= duration <= 10^60 <= score <= 10^3