Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
calculate max failure index
  • Loading branch information
iritkatriel committed Apr 4, 2025
commit d7052e4650b3939f5cff779967beb1bf3cf6c1d2
14 changes: 11 additions & 3 deletions Tools/scripts/summarize_stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -298,12 +298,20 @@ def kind_to_text(kind: int, opcode: str):
return "kind " + str(kind)

family_stats = self._get_stats_for_opcode(opcode)
failure_kinds = [0] * 40

def key_to_index(key):
return int(key[:-1].split("[")[1])

max_index = 0
for key in family_stats:
if key.startswith("specialization.failure_kind"):
max_index = max(max_index, key_to_index(key))

failure_kinds = [0] * (max_index + 1)
for key in family_stats:
if not key.startswith("specialization.failure_kind"):
continue
index = int(key[:-1].split("[")[1])
failure_kinds[index] = family_stats[key]
failure_kinds[key_to_index(key)] = family_stats[key]
return {
kind_to_text(index, opcode): value
for (index, value) in enumerate(failure_kinds)
Expand Down