Repository navigation
Conversation
…r, the canonical form, the expansion and the typesetter `python -m tests.fuzz` applies one to three random edits to a spec from `examples/`, then checks that the loader accepts it or raises a `MathSpecError`, that an accepted spec round-trips, that its canonical form survives shuffled keys and commuted terms, that it lowers and expands, and that every format prints it. `--hash-seeds` compares the output under two interpreter hash seeds. `tests/test_fuzz.py` holds 3 reduced findings as strict xfails. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Cg7FGcrnjcuYW4QnyXbCMN
… and on fresh mutants every night `pixi run fuzz` checks a thousand mutants under two hash seeds and compares each seed with `tests/fuzz/baseline.json`. It fails on a new finding, and on a held one that no longer occurs. It runs as a step of the CI job and in `pixi run ci`. A nightly workflow runs fifty thousand fresh mutants and fails only on a kind of finding that `tests/fuzz/kinds.json` does not name. The strict xfails name #890 and #891. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Cg7FGcrnjcuYW4QnyXbCMN
Contributor
Author
Note The following content was generated by AI. A second fuzzer for this PR to take in once #894 has merged. It is a differential oracle for the divisor check under This PR's oracles find a crash, a round trip that fails, or two canonical forms. A load check that loads a file it should refuse passes all of them. This fuzzer draws a random spec and a Python model of what the spec means. It runs the model on random data with missing rows and compares the result with what
What it found on 12,000 seeds
The other precision seeds are rows that are never built, because their masks contradict each other. How to take it in, after #894
The fuzzer, as run (
|
This branch has not been deployed
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.
Note
The following content was generated by AI.
What this changes
A seeded fuzzer edits the example specs and checks the loader, the canonical form, the expansion and the typesetter. The CI job compares 1,000 mutants with a committed baseline, and a nightly runs fresh ones. The findings are #890 and #891.
The fuzzer
tests/fuzz/mutate.pypicks a spec fromexamples/and applies one to three edits:dimslist; add an unknown key.tests/fuzz/check.pyholds the oracles:to_specaccepts the mapping, or raisesMathSpecError;to_yaml, plain and canonical;--hash-seedsruns every seed under two interpreter hash seeds and compares everything the spec printed.tests/test_fuzz.pyholds the three reduced findings as strictxfails that name The canonical form keeps cases and relation columns in file order, so two files that state one spec differ in it #890 and A curve stated as lines over links with different dimensions loads, and then its expansion is refused #891. It also checks that every unedited example passes, apart from the six that The canonical form keeps cases and relation columns in file order, so two files that state one spec differ in it #890 names, and that enough mutants load.CI
pixi run fuzzchecks mutants 0–999 under two hash seeds and compares each seed withtests/fuzz/baseline.json. A new finding fails, and so does a held finding that no longer occurs. The failure prints how to write the baseline again. 27 s on 4 cores, idle machine.CIjob and as part ofpixi run ci, becauseci.ymladds gates as steps rather than as billed jobs. That makes it part of the required check.fuzz.ymlrunspixi run fuzz-fresheach night over 50,000 mutants picked by the day of the year. It fails only on a kind of finding thattests/fuzz/kinds.jsondoes not map to an issue.REUSE.tomlcovers the two JSON files, which cannot carry a header.Why
20,000 mutants (2,183 accepted) found no loader crash and no output that depends on the hash seed. They did find two canonical-form orders (#890) and one expansion that the loader should have refused (#891). The baseline keeps the next such finding from going unseen, and the nightly looks past the baseline's seeds.
Gates run, departures, and what this does not do
pixi run lint: every hook clean.pixi run test: 2,919 passed, 1 skipped, 3 xfailed.pixi run fuzzpasses. I did not rundocs-buildorcompile-tex, because nothing here touches them.fuzz.ymlhas not run.tests/test_fuzz.pyrather than in construct-named files, as the fuzzer's regression corpus.tests/fuzz/run.pyprints, so it has aT20per-file ignore.merge,override, symbol tables and the CLI are not fuzzed.Generated by Claude Code