Skip to content

evaluate --reuse: do not evaluate again what nothing has changed for - #8

Merged
joszamama merged 2 commits into
mainfrom
incremental-evaluation
Oct 9, 2026
Merged

joszamama merged 2 commits into
mainfrom
incremental-evaluation

Conversation

@joszamama

Copy link
Copy Markdown
Member

The quality run of the registry measures all 22 specs every week, 45 minutes, although the specs almost never change. With a fixed seed and the same parsers the result can only be the same (but for speed, which is the machine's). This leaves that out.

fanbase evaluate --reuse FILE|URL (the previous release's quality.json): a spec whose fingerprint is the same as in those results is not asked of Fandango or of the parsers. Its earlier result is kept, the report says "not evaluated again, nothing it depends on has changed since ...", and quality build keeps the row. The fingerprint (fingerprint.py, stored with each spec in the report and in quality.json; optional, schema stays 1) is a hash of:

  • the spec and everything it extends (when png changes, so does png-apng);
  • each target that judges it: every file of its folder, and the version the parser reports (an upgraded parser, or one that is no longer there, is a change);
  • Fandango's and fanbase's versions;
  • the settings: count, seed, budget, coverage and its curve.

decodes is metadata and not part of the grammar, so it is read again from the spec as it is now: a changed expectation is checked against the kept result without evaluating anything, and --strict sees it.

What it needs, and where it is blind (also in docs/evaluating.md): one seed (the registry's workflows use a weekly one, which makes every spec a change every week; they would move to a fixed seed in a follow-up); a full evaluation without --reuse at each release; the Python packages a spec imports, and anything about the machine that no version string says, are not in the fingerprint. The private record holds what was found in the specs that were evaluated.

Tested: tests/test_reuse.py (16): the fingerprint is stored and a false one is not believed; nothing changed means Fandango is not even asked and the kept results are exactly the old ones; a changed spec, a changed base spec (the dependants too), a changed target file, an upgraded parser, a parser no longer there, and each setting (seed, count, budget, coverage) mean evaluation again, and only of what changed; a changed decodes is read again without evaluating; unreadable results mean a full evaluation. Each part of the fingerprint was removed in turn and its tests failed. Whole suite on macOS: 986 passed, 1 skipped; mypy src clean. On the real registry with real Fandango, a second run of three specs took 0.4 s, and a different seed evaluated everything again.

Nothing changes unless --reuse is given. Because it is a new option, I would release it as 0.6.0.

Every spec in quality.json now carries a fingerprint of what its evaluation depended on: the spec and everything it
extends, each target that judges it (its files and the version the parser reports), Fandango's and fanbase's
versions, and the settings that change what comes out (count, seed, budget, coverage). With --reuse FILE|URL, a spec
whose fingerprint is the same as in those results is not asked of Fandango or of the parsers: its earlier result is
kept and the report says so. What the spec says to expect (decodes, which is metadata) is read again, so a changed
expectation is checked without evaluating anything.

Needs one seed to be of use (a seed that changes every week changes every fingerprint), and a full evaluation
without --reuse at each release, for what no version string says.
The test helper took the name of a spec from the path in Fandango's command line by splitting at /, which finds no
name in C:\...\png.fan: the first evaluation 'asked about' nothing and every test built on it failed on Windows. It uses
the path's own idea of a name now.
@joszamama
joszamama merged commit 75f4f24 into main Oct 9, 2026
7 checks passed
@joszamama joszamama mentioned this pull request Oct 9, 2026
@joszamama
joszamama deleted the incremental-evaluation branch October 9, 2026 11:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant