render-reftest

Guidance for designing and reviewing visual rendering tests, which compare rendered pixels with a trusted reference, a saved image, or specific pixel conditions. It covers reftests, golden tests, probe tests, SVG tests, and Figma-based test suites.

In plain words
What is it for?
Use it when adding or reviewing pixel comparisons, golden images, SVG rendering tests, visual regression tests, or tests for platform-dependent rendering.
Why use it?
It helps choose an honest comparison method and avoid flaky or misleading image-difference tests caused by unsuitable references or tolerance settings.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/gridaco/nothing/render-reftest
Any agent
npx skills add gridaco/nothing --skill render-reftest
Clone the repo
git clone --depth 1 https://github.com/gridaco/nothing

Made for: Claude Code, Codex.

Per session 71 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 13,054 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00071 $0.13054
Opus 5 $0.00036 $0.06527
Sonnet 5 $0.00014 $0.02611
Haiku 4.5 $0.00007 $0.01305

Measured 2d ago against content hash c3b489858d4e, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

render-reftest scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

The scan reads SKILL.md. This mod also ships 1 executable file (scripts/refbrowser_render.ts), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.agents/skills/render-reftest/SKILL.md · 1,141 lines

How it starts

The opening of the file, as written. The whole thing — 1,141 lines — stays where its author put it; the contents beside it link to each section on GitHub.

CG Rendering Tests — Reftests & Golden Tests

How to design, name, and review visual rendering tests in this repo.

When to Use This Skill

  • Adding a new pixel-comparison test to crates/grida/
  • Reviewing a PR that adds or updates golden images
  • Deciding whether a test should be a reftest, golden test, or probe test
  • Designing a fixture that can be verified without vision input
  • Investigating a flaky or platform-dependent visual test
  • Setting up tolerance thresholds for image diff
  • Writing honest PR descriptions for rendering changes

Terminology

Use these terms precisely. Misusing them erodes trust in test results.

Term Definition
Reftest A test that compares renderer output against an independent reference (oracle) whose correctness is established outside this project — e.g. a W3C-provided PNG for an SVG test case. The oracle is the source of truth; a mismatch means our renderer is wrong.
Independent reference / oracle A rendering produced by a separate, trusted implementation or defined by a specification. We do not control its content.
Golden test A test that compares renderer output against a previously accepted snapshot produced by our own renderer. There is no external truth — the golden file is the expected output because a human reviewed and approved it. Also called a snapshot test.
Snapshot test Synonym for golden test. The snapshot is a frozen output that we assert has not changed.
Render regression test Any test whose purpose is to detect unintended changes in rendering output. Golden tests are regression tests. Reftests are correctness tests.
Pixel diff Byte-level comparison of two raster images. A single differing channel value is a failure (at zero tolerance).
Perceptual diff Comparison in a perceptual color space (e.g. YIQ via the dify crate). Weights differences by human visual sensitivity. More forgiving than raw pixel diff but still quantifiable.
rendiff Rust crate (rendiff v0.2) for histogram-based pixel diffing. Computes a per-channel difference histogram; thresholds are expressed as [(max_diff, max_count), ...] pairs. Used in flatten_rendiff.rs for equivalence tests. Dep in crates/grida/.
dify Rust crate for perceptual image comparison in YIQ color space. Used by grida_dev reftest for SVG reftests. Supports --threshold and --aa (anti-aliasing detection) flags.
pixelmatch Pure-JS perceptual image comparison library. YIQ-based, AA-aware. Used by @grida/reftest. Zero native deps; same conceptual model as dify, slightly different threshold semantics — see parity notes below.
@grida/reftest General-purpose, language-agnostic TS reftest CLI + library at packages/grida-reftest/. Takes two directories of PNGs, diffs, scores, writes the same bucket layout and JSON report as the Rust grida_dev reftest. Does NOT render anything — producers upstream.
grida_dev reftest Rust reftest runner at crates/grida_dev/src/reftest/. SVG-specific: renders SVG via our own grida pipeline, then diffs against a reference PNG. Canonical for SVG. For non-SVG formats, use @grida/reftest with an upstream renderer.
refig Short for "Figma reftest." Fixture suites under fixtures/local/refig/ containing .fig + document.json + images/ + exports/ (oracle PNGs from Figma's Images API). Consumed by a TS render step + @grida/reftest. See fixtures/local/refig/README.md.
refbrowser Short for "headless-browser reftest." HTML/CSS fixtures under fixtures/test-html/L0/ rendered by Playwright Chromium as the oracle vs. our grida htmlcss renderer. Producer script: .agents/skills/render-reftest/scripts/refbrowser_render.ts; diff via @grida/reftest.
Tolerance / fuzz A configured threshold below which pixel differences are ignored. Expressed as a histogram threshold (rendiff) or a YIQ distance (dify / pixelmatch). Required when rasterization is non-deterministic across platforms.
Data test A test that asserts on the scene graph or computed values directly — no rendering needed. E.g. bounding box, resolved transform matrix, computed style. The cheapest possible assertion.
Probe test A test that asserts correctness by reading pixel values at specific coordinates in the rendered output. Requires a purpose-built fixture with a minimal color palette and documented probe points. No full-image comparison needed.
Probe-friendly fixture A fixture explicitly designed for probe testing: minimal colors, no decorative elements, shapes at known coordinates. Often accompanied by a .probe.json file declaring expected pixel values at specific points.

Read the full file on GitHub · 1,141 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 1,141 lines · 71 tokens per session scan A c3b489858d4e

Subscribe to this mod's changes

render-reftest is a skill published in the GitHub repository gridaco/nothing (43 stars, last pushed 2d ago), licensed Apache-2.0. It adds 71 tokens to every session and 13,054 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

docs-svg-kit

Author SVG figures for Grida docs — diff-able, version-controlled vector diagrams embedded in doc pages instead of screenshots. Provides reusable primitives (selection chrome, size badges, anchor pins, resize cursors, click ripples), color/typography tokens, a starter template, and finished examples to crib from.…

gridaco/grida · 145 tokens

editor-perf

Guides performance investigation, benchmarking, and optimization of the Grida Canvas web editor (TypeScript reducer, Immer, React hooks). Use when profiling reducer dispatch cost, diagnosing slow interactions (drag, resize, color change), writing or running editor benchmarks, instrumenting with PerfObserver, or…

gridaco/grida · 69 tokens

sdk-seam

Discipline for the seam between two SDKs (or two sides of one contract) that the same hand writes. The failure mode: "we own both sides" produces dirty contracts no foreign reviewer would accept. The exercise: pretend the other side is FFI, IPC, or a network protocol you cannot rewrite. Spawn an adversarial subagent…

gridaco/grida · 142 tokens

agent-system

Grida AI agent system work: @grida/daemon (DaemonServer, loopback HTTP perimeter, files/workspaces, secrets store, daemon discovery) and @grida/agent (the agent tenant: sessions, providers/BYOK, runtime/tool execution, skills discovery, prompts, tiers, sandbox hosts). Use for packages/grida-daemon/…

gridaco/grida · 127 tokens

ai-models

Research, compare, and update AI model configurations. Covers text model tiers, image and video generation models, image tool models, pricing data sourcing, and provider-cost metering against prepaid org credit. Use when bumping model versions, adding new models, updating pricing, or auditing model specs against…

gridaco/grida · 65 tokens

sdk-design

Doctrine for designing and evolving any SDK Grida ships — TypeScript, Rust, or otherwise. "SDK" here means a surface that crosses a foreign-or-foreign-treated boundary: published packages, separately-versioned consumers, FFI bindings, public-by-design modules. An SDK's job is to refuse; a strict, honest surface…

gridaco/grida · 199 tokens