sprite ai
Keep a failing sprite comparison from rewriting its approved reference
A visual comparison can return a correct difference count on its first run and contaminate the second run. Pixelmatch writes visualization bytes into its output buffer. If that output shares the same memory as the approved sprite, generating the report overwrites some of the input. Different typed view objects can still overlap one underlying byte range.
In a CI art review, decode approved images into read-only-by-convention inputs and allocate a separate diff buffer. When a job only needs counts, use the comparison without a visualization output. If a report is rendered on failure, save it under a diagnostic path and publish it separately from the review baseline. Keep approval as a distinct action that writes a new reference through the normal review process.
Add an intentionally failing animation cel to a test fixture. Compare it twice using the same approved bytes, once requesting a visualization and once requesting a count only. Both counts should agree, and a checksum of the approved pixels should remain stable before and after every run. technical guide and test fixture shows how aliasing can produce a plausible first result while replacing the reference. The repeated comparison catches the state change that a single count can miss.
Prepared by the FrameSprite Workflow Team with AI assistance. Examples are illustrative unless attributed to a linked fixture.