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's YIQ color space algorithm for perceptual color difference detection. The focus is on proper usage of pixelmatch's core comparison function with appropriate options to leverage its human-perception-accurate color comparison capabilities.",
"type": "weighted_checklist",
"checklist": [
{
"name": "pixelmatch import",
"description": "Correctly imports the pixelmatch function from the pixelmatch package (e.g., `const pixelmatch = require('pixelmatch')` or `import pixelmatch from 'pixelmatch'`)",
"max_score": 10
},
{
"name": "pixelmatch invocation",
"description": "Calls pixelmatch with the correct signature: pixelmatch(img1, img2, output, width, height, options). The function should be invoked with both input images, image dimensions, and an options object.",
"max_score": 25
},
{
"name": "threshold option",
"description": "Uses the threshold option in the pixelmatch options object to control sensitivity. The threshold should be configurable via the sensitivity parameter (e.g., `{ threshold: options.sensitivity || 0.1 }`), allowing users to tune how strict the comparison is.",
"max_score": 20
},
{
"name": "output buffer handling",
"description": "Correctly handles the output parameter in pixelmatch by either passing null (when no diff image is needed) or a properly allocated buffer. For this use case, null is appropriate since only the mismatch count is needed.",
"max_score": 15
},
{
"name": "mismatch count usage",
"description": "Uses the return value from pixelmatch (the number of mismatched pixels) to populate the changedPixels field in the result object",
"max_score": 15
},
{
"name": "result calculations",
"description": "Correctly calculates totalPixels (width * height), changePercentage ((changedPixels / totalPixels) * 100), and isSignificant (changePercentage > 1) based on pixelmatch's return value",
"max_score": 15
}
]
}