{"record":{"id":"3d9cb574fb119060","repo":"JuliusBrussee/caveman","slug":"cachebench-replay-population-d-exceeds-request-l","errorCode":null,"errorMessage":"cachebench: replay population %d exceeds request limit %d","messagePattern":"cachebench: replay population (.+?) exceeds request limit (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cacheengine/cachebench/replay.go","lineNumber":363,"sourceCode":"\tLimits    ReplayLimits\n\t// Target enables a post-engine eligible-population gate before any provider\n\t// call. Nil leaves target evaluation to caller.\n\tTarget    *Target\n\tTimeScale float64\n\tNow       func() time.Time\n\tSleep     func(context.Context, time.Duration) error\n}\n\n// ValidateReplay performs zero-network trace, schedule, and budget preflight.\nfunc ValidateReplay(records []TraceRecord, limits ReplayLimits, timeScale float64) (ReplayPreflight, error) {\n\tif len(records) == 0 {\n\t\treturn ReplayPreflight{}, errors.New(\"cachebench: replay trace is empty\")\n\t}\n\tif limits.MaxRequests <= 0 || limits.MaxDeclaredBilledTokens <= 0 || limits.MaxGap <= 0 || limits.MaxScheduleDrift <= 0 || limits.MaxConcurrency <= 0 || limits.MaxConcurrency > 1024 {\n\t\treturn ReplayPreflight{}, errors.New(\"cachebench: positive replay request, token, gap, schedule-drift, and concurrency limits required; concurrency cannot exceed 1024\")\n\t}\n\tif len(records) > limits.MaxRequests {\n\t\treturn ReplayPreflight{}, fmt.Errorf(\"cachebench: replay population %d exceeds request limit %d\", len(records), limits.MaxRequests)\n\t}\n\tif timeScale <= 0 || math.IsNaN(timeScale) || math.IsInf(timeScale, 0) || timeScale > 1000 {\n\t\treturn ReplayPreflight{}, errors.New(\"cachebench: time scale must be greater than zero and at most 1000\")\n\t}\n\tseen := make(map[string]bool, len(records))\n\ttiming := map[string]bool{}\n\ttokens := map[string]bool{}\n\tvar previous time.Time\n\tvar declaredInput, declaredOutput, worstCase, scheduled int64\n\tfor index, record := range records {\n\t\tif seen[record.RequestID] {\n\t\t\treturn ReplayPreflight{}, fmt.Errorf(\"cachebench: duplicate replay request %q\", record.RequestID)\n\t\t}\n\t\tseen[record.RequestID] = true\n\t\tif record.Schema != TraceSchema {\n\t\t\treturn ReplayPreflight{}, fmt.Errorf(\"cachebench: replay request %q needs %s billed-token metadata\", record.RequestID, TraceSchema)\n\t\t}\n\t\tif _, err := record.NativeRequest(); err != nil {","sourceCodeStart":345,"sourceCodeEnd":381,"githubUrl":"https://github.com/JuliusBrussee/caveman/blob/27d5a3981a347890211bb1bf2439e5c821a63bc9/cacheengine/cachebench/replay.go#L345-L381","documentation":"Error \"cachebench: replay population %d exceeds request limit %d\" thrown in JuliusBrussee/caveman.","triggerScenarios":"Thrown at cacheengine/cachebench/replay.go:363 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Reduce the replay population below the request limit."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"27d5a3981a347890211bb1bf2439e5c821a63bc9","analyzedAt":"2026-08-15T09:26:11.751Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}