Put every node through every pipeline, not only limits - #837
Merged
Conversation
The limit crash of #829 was found because somebody took a limit of a floor. Nothing made limits special: a node reaches a dozen pipelines, AddingNode.cs lists them, and anything missed there is missed silently, because the node that breaks is exactly the one nobody wrote a test for. Seven node types crashed that way and the suite stayed green. So this generalises LimitTerminatesOnEveryNodeTest: the node types are enumerated by reflection -- 45 of them -- and each is put through Stringize, Latexise, ToString, InnerSimplified, Evaled, Simplify, Expand, Factorize, Differentiate, Integrate, Substitute, Vars, Nodes, Complexity and Solve. What is asserted is only what every pipeline owes a caller: return, in finite time, either an answer or one of the library's own exceptions. Not that the answer is right -- the per-node tests are for that -- and not that there is one, since an unevaluated node is a legitimate answer. Everything passes today, so this adds no fix. It is a floor under the next node. Checked against a deliberately throwing pipeline to make sure it is not vacuous: the failure is reported with the pipeline named, which is what makes it useful when it does fire. Tests: 6049 passing, 0 failed, 14 skipped; F# 130. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.
Follows #836. No fix in here — everything already passes. This is a floor under the next node.
Why
The limit crash of #829 was found because somebody happened to take a limit of a
floor. Nothing made limits special: a node reaches a dozen pipelines,AddingNode.cslists them, and anything missed there is missed silently — the node that breaks is exactly the one nobody wrote a test for. Seven node types crashed that way while the suite stayed green.So this generalises
LimitTerminatesOnEveryNodeTest: 45 node types enumerated by reflection, each put throughStringize,Latexise,ToString,InnerSimplified,Evaled,Simplify,Expand,Factorize,Differentiate,Integrate,Substitute,Vars,Nodes,Complexity,Solve.What it asserts, and what it does not
Only what every pipeline owes a caller: return, in finite time, either an answer or one of the library's own exceptions.
NotSupportedExceptionis allowed too, since some shapes document a refusal.Non-termination fails via a 30-second timeout per pipeline. A stack overflow cannot be caught, so its signal remains the run aborting — which is how #829 announced itself.
Not vacuous
Checked against a deliberately throwing pipeline: the failure is reported with the pipeline named, which is what makes it useful when it fires:
Tests: 6049 passing, 0 failed, 14 skipped; F# 130.