Given a stream of log lines, implement a function that parses each line and returns rolling performance metrics over the last window_seconds. Each valid log line has the format "<timestamp> <service> <latency_ms> <status>", where timestamp is a non-decreasing integer. Ignore malformed lines. For each processed line, output the current metrics for that line's service: total requests in the window, error count (status >= 500), and average latency rounded down.
def aggregate_log_metrics(logs, window_seconds):