Skip to content

Fixes #332 - Epsilon value is left relaxed by a number of tests in suites - #337

Merged
DiasFranciscoA merged 4 commits into
developfrom
332-basicmathtestsuite-epsilon-value-is-left-relaxed
Aug 14, 2026
Merged

Fixes #332 - Epsilon value is left relaxed by a number of tests in suites#337
DiasFranciscoA merged 4 commits into
developfrom
332-basicmathtestsuite-epsilon-value-is-left-relaxed

Conversation

@YYDan

@YYDan YYDan commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

For the info, see #332 (comment)

YYDan and others added 3 commits August 13, 2026 16:28
Tests are free to relax the float epsilon to account for the differing
defaults in YYC and VM, but nothing ever put it back. A relaxed value
therefore leaked into every subsequent test in the run, where an overly
generous tolerance could mask a genuine failure.

Add Test.resetGlobalState(), which restores the epsilon to the
test_default_epsilon baseline, and call it as the first step of
preRunFunc in both Test and TestAsync. Between them those two cover
every test type: Fact and Theory arrive via TestAsync, TestSuite and
TestFrameworkRun via TestBatch.

Resetting at the start rather than the end means a test that bails or
expires cannot skip the reset. Running before callStartHook() leaves the
existing (and until now unused) startHook free to override the baseline
where a suite genuinely needs to.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
With the framework now guaranteeing a known epsilon at the start of
every test, the 260 facts that opened with a defensive
math_set_epsilon(0.00001) no longer need to. Removes those calls, the
blank line that followed each, and the 65 surviving copies of the
"Set an explicit epsilon" comment explaining them.

Deletions only. The 32 facts that deliberately relax the epsilon for
their own float tolerance are untouched, since they can no longer leak
it into anything else.

Fact count (626) and assert count (703) are unchanged.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@YYDan
YYDan requested a review from DiasFranciscoA August 14, 2026 15:35
@YYDan YYDan self-assigned this Aug 14, 2026
@YYDan YYDan linked an issue Aug 14, 2026 that may be closed by this pull request
@DiasFranciscoA
DiasFranciscoA merged commit a25d5a6 into develop Aug 14, 2026
2 checks passed
@DiasFranciscoA
DiasFranciscoA deleted the 332-basicmathtestsuite-epsilon-value-is-left-relaxed branch August 14, 2026 15:50
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.

Epsilon value is left relaxed by a number of tests in various suites

2 participants