Repository navigation
evaluate --reuse: do not evaluate again what nothing has changed for - #8
Merged
Merged
Conversation
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.
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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'squality.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 ...", andquality buildkeeps the row. The fingerprint (fingerprint.py, stored with each spec in the report and inquality.json; optional, schema stays 1) is a hash of:pngchanges, so doespng-apng);decodesis 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--strictsees 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--reuseat 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 changeddecodesis 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 srcclean. 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
--reuseis given. Because it is a new option, I would release it as 0.6.0.