fidelity

command
v0.1.0-alpha.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 16, 2026 License: Apache-2.0 Imports: 30 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Command fidelity scores Sweef's layout and rendering against Chromium.

go run ./tools/fidelity                       # all fixtures, provider "engine"
go run ./tools/fidelity -only flex -v         # one fixture, show worst elements
go run ./tools/fidelity -provider render      # layout engine directly (boxes only until a painter is registered)
go run ./tools/fidelity -refresh              # re-capture Chromium references

For every fixture page in testdata/fidelity/*.html the tool captures, from Chromium via the agent-browser CLI, the border box of every element in document order and a screenshot, and caches them under testdata/fidelity/.ref so later runs need no browser. A provider (the full engine, or the render package alone) produces the same data for Sweef and the tool prints per-page and overall scores:

  • IoU of every element's border box (mean), and the share of elements within 1 px / 4 px on all four edges of Chromium's box;
  • screenshot agreement: share of pixels equal within a tolerance, and the same after a 3x3 blur (which forgives anti-aliasing differences).

Providers register themselves with Register (see providers.go and any provider_*.go files added by feature work).

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL