Skip to content
DenseChip
Learn
PracticeCode labInterview

DenseChip

Navigate

Menu

LearnPracticeCode labInterview

Tools

All toolsSV editorCode repoResume
DenseChip

Practice, courses, and chip-design tools in one focused workspace.

LearnPracticeCode labInterviewToolsLearning paths

© 2026 DenseChip

AboutContactPrivacyTerms
Skip to lesson

Course contents

  • Getting Started with AI for VLSI Engineers5
  • Just Enough AI: Models and Context15
  • Prompting13
  • Trust and Verification14
  • Using AI for Engineering Work17
    • RTL and Testbench Assistance
    • Debugging with AI
      • Log Slices That Help
      • Ranked Hypotheses with Evidence
      • Summarising and Clustering Logs
      • The Engineer Runs the Experiment
    • Scripts and Automation
    • Data, Privacy and IP
  • Engineering Walkthroughs7
  • Practical Foundations for AI Workflows4
  • Engineering Data5
  • Retrieval-Augmented Generation6
  • Agents and Tool Use18
  • Agent Design8
  • MCP and Skills6
  • Multi-Agent Design6
  • Practical Capstone6
  • Tokens, Cost and Latency12
  • Agentic Workflows for Chip Teams18
  • Interview and Judgment10
  • AI Skills: Full Course Index
  • Working with AI Glossary
  • Working with AI Cheatsheet
Loading lesson

‹Debugging with AI
  1. Topics
  2. AI Skills for VLSI Engineers
  3. Using AI for Engineering Work
  4. Debugging with AI
  5. Summarising and Clustering Logs

Everyday Engineering Assistance · Beginner to Intermediate

Summarising and Clustering Logs

Normalise and cluster log lines so repeated failures form countable groups.

On this page

    Normalise before counting

    Raw log lines differ on every run: timestamps, ids, addresses and counts change while the failure stays the same. Counting raw lines therefore reports every line as unique.

    Normalisation replaces selected varying fields with placeholders so similar messages can be counted. A message group is not necessarily one root cause. Preserve raw lines and identifiers: addresses, lanes, and durations may distinguish failures that a broad normalisation merges.

    A runnable clusterer

    The program below clusters a synthetic log by message pattern. Its broad number replacement demonstrates grouping mechanics, not a production parser. If run, its self-checks would report the expected counts; no execution is claimed here.

    example.py
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    import re
    import sys
    
    LOGS = [
        "12:01:03 TIMEOUT req id 4821 addr 0x7f3a after 500 ms",
        "12:01:04 TIMEOUT req id 4822 addr 0x7f40 after 500 ms",
        "12:01:05 TIMEOUT req id 4823 addr 0x7f46 after 512 ms",
        "12:01:09 TIMEOUT req id 4829 addr 0x8001 after 500 ms",
        "12:01:11 TIMEOUT req id 4835 addr 0x8012 after 500 ms",
        "12:01:14 TIMEOUT req id 4840 addr 0x8023 after 501 ms",
        "12:01:19 TIMEOUT req id 4851 addr 0x8034 after 500 ms",
        "12:02:01 PARITY lane 0 pkt 99182",
        "12:02:02 PARITY lane 2 pkt 99183",
        "12:02:07 PARITY lane 0 pkt 99210",
        "12:03:10 LINK down port 3",
        "12:03:11 LINK down port 5",
    ]
    
    
    def normalize(line):
        line = re.sub(r"0x[0-9a-fA-F]+", "0xADDR", line)
        line = re.sub(r"[0-9]+", "N", line)
        return line
    
    
    def main():
        groups = {}
        for line in LOGS:
            key = normalize(line)
            groups[key] = groups.get(key, 0) + 1
        if len(LOGS) != 12:
            print("FAIL: line total is %d" % len(LOGS))
            sys.exit(1)
        if len(groups) != 3:
            print("FAIL: group total is %d" % len(groups))
            sys.exit(1)
        counts = sorted(groups.values())
        if counts != [2, 3, 7]:
            print("FAIL: counts are %s" % (counts,))
            sys.exit(1)
        top = max(groups, key=groups.get)
        if "TIMEOUT" not in top:
            print("FAIL: top group is %s" % top)
            sys.exit(1)
        print("PASS: 12 lines form 3 groups with counts 7, 3 and 2")
    
    
    main()

    Reading the summary

    Twelve lines become three groups with counts 7, 3 and 2. The table below reads each group, following the program above line for line.

    Group

    Lines

    What to check next

    TIMEOUT normalised message

    7

    Slice the first TIMEOUT and rank hypotheses for the req path.

    PARITY normalised message

    3

    Check whether the lane events overlap the TIMEOUT window.

    LINK down normalised message

    2

    Confirm the two ports, then decide if this is separate or fallout.

    plaintext
    1
    2
    3
    4
    5
    6
    cluster counts: 7, 3 and 2
    total = 7 + 3 + 2 = 12
    shares, rounded to two decimals: 7 / 12 = 58.33%, 3 / 12 = 25.00%, 2 / 12 = 16.67%
    check: 58.33 + 25.00 + 16.67 = 100.00
    the top group holds over half the lines; frequency alone does not establish
    severity, root cause, or investigation priority

    Exercise: inspect the original PARITY lines after grouping. Lane 0 appears twice and lane 2 once, but the normalized key removes that distinction. Keep lane as a structured field if the investigation asks whether one lane dominates. Likewise, retain request IDs for cross-log matching and durations for timeout-boundary analysis.

    Common mistakes

    Common pitfall

    Raw lines can split similar messages into many groups; over-normalisation can merge distinct faults. Keep original lines with each group and review which fields were replaced. Choose investigation order by severity, chronology, and dependencies as well as frequency.

    Interview

    Likely probes: what normalisation replaces, and what the counts decide.

    • Hex, numbers and times become placeholders so repeats match.

    • Counts summarize messages; severity and causal dependencies help decide priority.

    • Small groups are checked for overlap before being called separate bugs.

    Check yourself Raw clustering gives 12 groups for 12 lines. What step is missing?

    Normalisation. Ids, addresses and timestamps differ on every line, so raw lines never repeat. Replacing them with placeholders reveals the 3 repeated messages.

    Check yourself The summary shows counts 7, 3 and 2. Must TIMEOUT be investigated first?

    No. It is the largest message group, but the original LINK-down events or a severe parity event may explain other symptoms. Inspect chronology, severity, and dependencies before deciding; counts do not identify a cause.

    Related topics

    • Log slices that help

    • Scripts and automation

    Previous

    55 / 173

    Next: The Engineer Runs the Experiment

    Up next

    Up nextThe Engineer Runs the Experiment

    Sign in to save progress

    Practice this lessonReport an error

    See also

    • Log Slices That Help