Skip to content

Expand the soundness fuzzer's model pools and grammar - #10

Open
tilorc-bot wants to merge 1 commit into
TiloRC:mainfrom
tilorc-bot:agent/fuzz-coverage
Open

tilorc-bot wants to merge 1 commit into
TiloRC:mainfrom
tilorc-bot:agent/fuzz-coverage

Conversation

@tilorc-bot

Copy link
Copy Markdown
Contributor

Why

The adversarial audit in #9 listed the query classes the soundness fuzzer could
not generate; this closes them so the remaining handler fixes can be verified
randomly instead of only by targeted probing.

What

  • Model pools and grammar now cover declared symbols (n, ni, xi, with
    pools filtered by the declared assumptions), oo/-oo/zoo/nan,
    evaluate=False powers, acos/factorial, and the extended-real predicates.
  • Matrix expressions are generated (MatMul, MatPow, HadamardProduct,
    Transpose, MatrixSlice, ZeroMatrix) and element predicates are expanded
    with as_explicit, because ask does not decide them for explicit matrices.
  • Unit tests cover the declared pools and the matrix expansion. Tool-only; no
    handler code is touched.

Finding

On #9's tip the expanded grammar found a regression reduced to:

satask(Q.algebraic(Pow(2, nan, evaluate=False)))  # TypeError: Invalid NaN comparison
sympy.ask(...)                                     # None

reasoning/sathandlers.py:468 does isinstance(exp, Number) and exp < 0, and
S.NaN is a Number, so nan < 0 raises. main returns None; the curated
list now pins the query. It should be fixed on fix/sathandlers-scalar.

Verification

  • fix/sathandlers-matrixfacts cd0a061: adversarial + matrixfacts suites
    21 passed / 9 xfailed (all scalar), and 200 Hypothesis examples find nothing
    beyond the nan crash.
  • main, curated: 0 findings; Land sathandlers with sound Pow, matrix and function guards #9 tip, curated: the nan crash only.
  • pytest reasoning/tests: 164 passed, 1 xfailed; mypy clean.

This description was written by an AI agent (opencode, deepseek-v4.1-flash) on
behalf of TiloRC.

Cover the blind spots the adversarial audit named: declared symbols
(n, ni, xi) with declaration-respecting pools, infinities and undefined
values, evaluate=False powers, acos/factorial, extended-real predicates,
and matrix expressions with element-predicate expansion.

On the sathandlers tip this found a regression: _pow_real_facts compares
a Number exponent against zero, so a nan exponent raises TypeError
(Invalid NaN comparison). main returns None and sympy.ask answers None.
The curated list pins the reduced query.
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