JuliusBrussee/caveman · error

cachebench: Hugging Face row exceeds

Error message

cachebench: Hugging Face row exceeds %d bytes

What it means

A single row inside the Hugging Face rows array, once decoded as raw JSON, is larger than CorpusLimits.MaxRowBytes. Oversized rows are rejected outright to bound memory during corpus ingestion.

Solutions

  1. Raise MaxRowBytes in CorpusLimits if the rows are legitimately large
  2. Trim oversized conversations out of the corpus
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at cacheengine/cachebench/corpus.go:269 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of JuliusBrussee/caveman@766dce6b13 (2026-08-18). Data as JSON: /api/errors/a54a2d7ffb6a8eb1. Report an issue: GitHub.

Appendix: source

Thrown at cacheengine/cachebench/corpus.go:269

		if key != "rows" {
			var ignored json.RawMessage
			if err := decoder.Decode(&ignored); err != nil {
				return nil, fmt.Errorf("cachebench: skip Hugging Face field %q: %w", key, err)
			}
			continue
		}
		foundRows = true
		start, err := decoder.Token()
		if err != nil || start != json.Delim('[') {
			return nil, errors.New("cachebench: Hugging Face rows field must be array")
		}
		for decoder.More() {
			var raw json.RawMessage
			if err := decoder.Decode(&raw); err != nil {
				return nil, fmt.Errorf("cachebench: decode Hugging Face row: %w", err)
			}
			if len(raw) > limits.MaxRowBytes {
				return nil, fmt.Errorf("cachebench: Hugging Face row exceeds %d bytes", limits.MaxRowBytes)
			}
			var wire hfRowWire
			if err := decodeOneJSON(raw, &wire); err != nil {
				return nil, fmt.Errorf("cachebench: decode Hugging Face row: %w", err)
			}
			row, err := validateCorpusWire(wire.Row, wire.RowIndex, limits)
			if err != nil {
				return nil, fmt.Errorf("cachebench: Hugging Face row %d: %w", wire.RowIndex, err)
			}
			if err := appendCorpusRow(&rows, sessions, &retainedBytes, row, limits); err != nil {
				return nil, fmt.Errorf("cachebench: Hugging Face row %d: %w", wire.RowIndex, err)
			}
		}
		if end, err := decoder.Token(); err != nil || end != json.Delim(']') {
			return nil, errors.New("cachebench: malformed Hugging Face rows array")
		}
	}
	if end, err := decoder.Token(); err != nil || end != json.Delim('}') {

View on GitHub (pinned to 766dce6b13)