Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hypothesis test failure - test_slgof.py::test_slgof_hypo #444

Closed
mferrera opened this issue Jun 28, 2024 · 5 comments · Fixed by #458 or #462
Closed

Hypothesis test failure - test_slgof.py::test_slgof_hypo #444

mferrera opened this issue Jun 28, 2024 · 5 comments · Fixed by #458 or #462
Assignees
Labels
bug Something isn't working

Comments

@mferrera
Copy link
Collaborator

A test case generate by hypothesis failed.

FAILED tests/test_slgof.py::test_slgof_hypo - AssertionError
Falsifying example: test_slgof_hypo(
    swl=0.0,
    sorg=0.15625,
    sgcr=0.15504997195913137,
    h=1e-07,
)

You can reproduce this example by temporarily adding @reproduce_failure('6.104.1',b'AXicY2BABgcUwBQTiKnvdC8/O3APkHmwUD/46pR/WwFrKwmp') as a decorator on your test case
@berland berland changed the title Hypothesis test failure Hypothesis test failure - test_slgof.py::test_slgof_hypo Sep 11, 2024
@berland
Copy link
Collaborator

berland commented Sep 11, 2024

This is a real bug, the table that pyscal wants to output in this case starts with:

SLGOF
-- 
-- pyscal: 0.13.dev11+g4162b12
-- swirr=0, sgcr=0.15505, swl=0, sorg=0.15625, sgro=0, krgendanchor=sorg
-- Corey krg, ng=2, krgend=1, krgmax=1
-- Corey krog, nog=2, kroend=1
-- krg = krog @ sg=0.46456
-- SL     KRG       KROG      PC        
0.1562500 1.0000000 0.0000000 0.0000000
0.1562500 0.9999999 0.0000000 0.0000000
0.1563500 0.9997095 0.0000000 0.0000000
0.1564500 0.9994192 0.0000001 0.0000000
...

where the error is that the SL values are identical for the first two rows.

@berland berland added the bug Something isn't working label Sep 11, 2024
@berland
Copy link
Collaborator

berland commented Sep 19, 2024

The problem seems related to these floating point details:

>>> value_1 = 0.8437499719590555
>>> round(value_1 * 10000)  # this is what Pyscal uses to drop duplicates
8437
>>> print(f"{value_1:.5f}")  # This is how values are printed
0.84375
>>> value2 = 0.84375
>>> round(value2 * 10000)
8438  # different integer, so it will not be regarded as similar to value_1
>>> print(f"{value2:.5f}")
0.84375  # But formatted equivalent to value_1

This happens in GasOil.__init__()

@berland berland self-assigned this Sep 20, 2024
@berland berland added this to SCOUT Sep 20, 2024
@berland berland moved this to Ready for Review in SCOUT Sep 20, 2024
@berland berland moved this from Ready for Review to In Progress in SCOUT Sep 20, 2024
@berland berland assigned alifbe and unassigned berland Sep 23, 2024
@berland berland linked a pull request Oct 2, 2024 that will close this issue
@github-project-automation github-project-automation bot moved this from In Progress to Done in SCOUT Oct 2, 2024
@berland
Copy link
Collaborator

berland commented Oct 4, 2024

Still flaky after #458

FAILED tests/test_slgof.py::test_slgof_hypo - AssertionError
Falsifying example: test_slgof_hypo(
    swl=0.02432496616483698,
    sorg=1e-07,
    sgcr=0.02432496616483698,
    h=1e-07,
)

You can reproduce this example by temporarily adding @reproduce_failure('6.112.2', b'AXicY2BgOBDw9/fETYGFDAwMBwv1g69O+beVAasoAKBtE7s=') as a decorator on your test case

@berland berland reopened this Oct 4, 2024
@alifbe
Copy link
Collaborator

alifbe commented Oct 4, 2024

I think the issue is with the PR #458. Since SWINTEGERS is multiplied by factor of 10. h_min is now even smaller and causing the issue (probably even more severe). I propose we do what you did and change this line h_min = 10.0 / float(SWINTEGERS)

h_min = 1.0 / float(SWINTEGERS)

@berland
Copy link
Collaborator

berland commented Oct 4, 2024

Agree, h_min should have been adjusted in #458

@berland berland assigned berland and unassigned alifbe Oct 4, 2024
@berland berland linked a pull request Oct 4, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Archived in project
3 participants