Recursive AI

Pixel similarity against Chrome

All onerender docs

Information only: no gate depends on it. It shows how close our pixels are to Chrome's on the pages the geometry differential uses, and where they differ most. The tool is the pixels command of tools/geomdiff (Pixels.cs, Ssim.cs), run per set by tools/geomdiff/scripts/run-pixels.sh; the summaries are in results/pixels/<set>/ (summary.md and pages.tsv, one row per page and viewport).

Method

  • Chrome side: the frozen page is replayed offline exactly as for the geometry capture (same Chrome for Testing 156.0.8078.47 flags, fonts through the private fontconfig file, 1280×800 and 390×844, device scale factor 1, settled page: images loaded, animations at their end, content-visibility forced visible). The screenshot is Page.captureScreenshot with captureBeyondViewport over the whole document, from the top left, cropped to 4000 CSS px tall (--max-height).
  • Our side: the same HTML and resources through HtmlPage, Painter and DisplayListRasterizer (what HtmlRender.ToImage does), with the layout viewport at the capture's size, so vh and percentages resolve as in Chrome, and an image as tall as the screenshot, on a white page.
  • Score: SSIM (Wang et al. 2004) on Rec. 601 luma, uniform 8×8 windows moved 4 px, K1 = 0.01, K2 = 0.03, range 255, mean over windows; 1 is identical. pages.tsv also gives the share of pixels whose RGB differs at all, which is harsh: one pixel of anti-aliasing counts.

Results

Chrome for Testing 156.0.8078.47, font set from the .Fonts package files, engine at the commit that adds this page.

SetViewportPagesMean SSIMMin SSIMLowest page
text-block1280×800180.98850.9694field-notes
text-block390×844180.97490.9504field-notes
templates1280×80060.98800.9822report
templates390×84460.97930.9596report
tailwind1280×80070.97250.9272flowbite-components
tailwind390×84470.95060.8709flowbite-components
chrome-probes1280×80090.99980.9996foot
chrome-probes390×84490.99950.9990foot
grid-lab1280×80061.00001.0000(all identical)
grid-lab390×84461.00001.0000(all identical)

What the lowest page shows (looked at side by side, flowbite-components at 390×844): the form controls (inputs, checkbox, password field) are not drawn in Chrome's default style yet, a card header that Chrome paints with a gradient is plain white in ours (a Tailwind 4 gradient utility; the cause is not yet traced), and the timeline dots are squares. Pages of the other sets were not inspected one by one; their layout agrees with Chrome's (geometry 100% and 99.97%), so the remaining difference is mostly glyph and edge anti-aliasing.

Reproduce

On a host with the geometry differential set up (see geometry-differential.md), with the frozen sets under $ONERENDER_HOME/corpus/<set>:

tools/geomdiff/scripts/build.sh
NO_SANDBOX=1 JOBS=4 tools/geomdiff/scripts/run-pixels.sh tailwind ~/onerender/corpus/tailwind results/pixels [dump-dir]

With a dump directory, <page>-<viewport>-chrome.png and -ours.png are written for looking at by eye; they are not committed.