{"record":{"id":"ebc847dcabc30710","repo":"JuliusBrussee/caveman","slug":"cachebench-request-q-failed-model-visible-equiva","errorCode":null,"errorMessage":"cachebench: request %q failed model-visible equivalence","messagePattern":"cachebench: request %q failed model-visible equivalence","errorType":"exception","errorClass":"ReplayRunError","httpStatus":null,"severity":"error","filePath":"cacheengine/cachebench/replay.go","lineNumber":522,"sourceCode":"\t\tif err := ctx.Err(); err != nil {\n\t\t\treturn nil, fmt.Errorf(\"cachebench: replay preparation interrupted: %w\", err)\n\t\t}\n\t\tnative, err := record.NativeRequest()\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\toptimized, err := runner.Engine.Optimize(ctx, native)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"cachebench: optimize request %q: %w\", record.RequestID, err)\n\t\t}\n\t\tequivalent := bytes.Equal(native.Body, optimized.Body)\n\t\tif optimized.Applied {\n\t\t\tequivalent = ModelVisibleEquivalent(native.Body, optimized.Body)\n\t\t}\n\t\tif !equivalent {\n\t\t\treturn nil, &ReplayRunError{\n\t\t\t\tRequestID: record.RequestID, FailureCode: \"model_visible_mismatch\",\n\t\t\t\tErr: fmt.Errorf(\"cachebench: request %q failed model-visible equivalence\", record.RequestID),\n\t\t\t}\n\t\t}\n\t\tif optimized.Decision != cacheengine.DecisionApply && optimized.Decision != cacheengine.DecisionObserveOnly && optimized.Reason != cacheengine.ReasonBelowMinimum {\n\t\t\treturn nil, &ReplayRunError{\n\t\t\t\tRequestID: record.RequestID, FailureCode: \"engine_not_cacheable\",\n\t\t\t\tErr: fmt.Errorf(\"cachebench: request %q is not cacheable: %s\", record.RequestID, optimized.Reason),\n\t\t\t}\n\t\t}\n\t\tprepared = append(prepared, preparedReplay{record: record, optimized: optimized})\n\t}\n\treturn prepared, nil\n}\n\nfunc validatePreparedReplayTarget(prepared []preparedReplay, target Target) error {\n\tif err := validateTarget(target); err != nil {\n\t\treturn err\n\t}\n\tproviders := map[string]bool{}","sourceCodeStart":504,"sourceCodeEnd":540,"githubUrl":"https://github.com/JuliusBrussee/caveman/blob/766dce6b1394ebb56a3090748d5a0240a5aefb36/cacheengine/cachebench/replay.go#L504-L540","documentation":"Preparation verified that the optimised request body is not model-visible equivalent to the original — the optimisation changed bytes the model would see (a correctness violation), so the run fails closed with failure code model_visible_mismatch.","triggerScenarios":"Thrown at cacheengine/cachebench/replay.go:522 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Report the equivalence break to the engine maintainers with the offending request","Disable or fix the optimizer that altered model-visible content"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"766dce6b1394ebb56a3090748d5a0240a5aefb36","analyzedAt":"2026-08-18T03:14:35.516Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}