docs
evals
scenario-1
scenario-10
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
{
"context": "This criteria evaluates how well the engineer uses pixelmatch to implement dual-mode comparison functionality, specifically focusing on the ability to call the library with and without diff output generation, and properly handling the output buffer parameter.",
"type": "weighted_checklist",
"checklist": [
{
"name": "Import pixelmatch",
"description": "Code imports the pixelmatch function from the pixelmatch package using require() or import statement.",
"max_score": 10
},
{
"name": "Conditional buffer allocation",
"description": "Code allocates a diff output buffer (using Uint8Array or Buffer) of size width * height * 4 only when generateDiff is true, and passes null when generateDiff is false.",
"max_score": 25
},
{
"name": "Call pixelmatch correctly",
"description": "Code calls pixelmatch() with correct parameters: img1, img2, output buffer (or null), width, height, and passes any additional options as needed.",
"max_score": 25
},
{
"name": "Capture mismatch count",
"description": "Code captures and returns the numeric return value from pixelmatch() as the mismatchCount, understanding that pixelmatch returns the number of mismatched pixels.",
"max_score": 20
},
{
"name": "Return correct structure",
"description": "Code returns an object with both mismatchCount (number) and diffBuffer (Buffer/Uint8Array or null) properties, matching the expected output format.",
"max_score": 15
},
{
"name": "Performance optimization awareness",
"description": "Implementation demonstrates understanding that passing null as the output buffer to pixelmatch improves performance by skipping diff generation when not needed.",
"max_score": 5
}
]
}