nodejs/node · error · Exception

unknown compiler: %s

Error message

unknown compiler: %s

What it means

process-wasm-compilation-times.py parses V8 log lines shaped like 'Compiled function #N using <compiler>, took ...'. words[4] must be either 'TurboFan,' or 'Liftoff,'; any other token is treated as an unknown compiler (or as evidence the line shape/format has drifted).

Source

Thrown at deps/v8/tools/process-wasm-compilation-times.py:68

    self.has_tf = False
    self.time_lo = -1
    self.time_tf = -1
    self.mem_lo = -1
    self.mem_tf_max = -1
    self.mem_tf_total = -1
    self.name = ""
    self.size_wasm = -1
    self.size_lo = -1
    self.size_tf = -1

  def AddLine(self, words):
    assert self.index == words[2], "wrong function"
    if words[4] == "TurboFan,":
      self.AddTFLine(words)
    elif words[4] == "Liftoff,":
      self.AddLiftoffLine(words)
    else:
      raise Exception("unknown compiler: %s" % words[4])

  def AddTFLine(self, words):
    assert not self.has_tf, "duplicate TF line for %s" % self.index
    self.has_tf = True
    # 0        1        2  3     4         5    6 7  8   9     10 11
    # Compiled function #6 using TurboFan, took 0 ms and 14440 / 44656
    # 12        13     14       15 16       17 18   19
    # max/total bytes; bodysize 12 codesize 24 name wasm-function#6
    time_factor = 1
    if words[7] == "ms":
      time_factor = 1000
    elif words[7] == "μs":
      pass  # Default.
    else:
      assert False, "Time must be in 'ms' or 'μs'."
    self.time_tf = int(words[6]) * time_factor
    self.mem_tf_max = int(words[9])
    self.mem_tf_total = int(words[11])

View on GitHub (pinned to 1b2de5e052)

Solutions

  1. Use the script revision that matches the d8 that produced the log.
  2. Extend AddLine to handle the new compiler token (add an AddMaglevLine branch, etc.).
  3. Pre-filter the log so only TurboFan/Liftoff lines reach the parser.

Example fix

// before
if words[4] == "TurboFan,": self.AddTFLine(words)
elif words[4] == "Liftoff,": self.AddLiftoffLine(words)
else: raise Exception("unknown compiler: %s" % words[4])
// after
if words[4] == "TurboFan,": self.AddTFLine(words)
elif words[4] == "Liftoff,": self.AddLiftoffLine(words)
elif words[4] == "Maglev,": self.AddMaglevLine(words)
else: raise Exception("unknown compiler: %s" % words[4])
Defensive patterns

Strategy: validation

Validate before calling

KNOWN_COMPILERS = {"TurboFan,", "Liftoff,"}
if words[4] not in KNOWN_COMPILERS:
    # skip or warn instead of raising on unrecognized lines
    log.warning('skipping line with unknown compiler %r', words[4])
    return

Prevention

When it happens

Trigger: Feeding a log that contains a compiler name the script doesn't know about (e.g. Maglev, or a future pipeline), or a log whose token offsets are shifted by a format change.

Common situations: Version skew between the d8 that produced the log and this script revision; experimental/new compiler pipeline enabled; trailing-comma or spacing change in the log format.

Related errors


AI-assisted analysis of nodejs/node@1b2de5e052 (2026-08-13). Data as JSON: /api/errors/07abbb2df3a7fc9b. Report an issue: GitHub.