Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions docs/HOMOLOGATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,15 @@ are checked with the compiled likelihood and skipped without it. The
fallback is a fallback: about a hundred times slower, and not what an
analysis should run on.

**On the platform of the record only.** The record was made on Linux
x86-64, C and port. On the wall the point follows the last digit of the
arithmetic, and that digit is the compiler's and the C library's: the same
fit (the flour prices' echelon form, in sima's suite) stops at −658.9552 on
Linux, −659.2055 on Windows and −659.7980 on macOS. So the cases with
iterations are checked on Linux x86-64 and skipped elsewhere. Whether the
port and the C agree with each other on macOS or Windows has not been
measured: the C has only been run on Linux for this record.

## When the C changes

1. Build the C at the new commit and run the port's suite with `ATSW_GUI`
Expand Down
12 changes: 9 additions & 3 deletions tests/test_bug_0030_as_the_c.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,13 +94,19 @@ def test_the_cast_does_not_take_the_reciprocal_of_an_ma1():


def _kernel():
import platform
import sys
from drvarma import _engine
return _engine.engine_backend() == "c"
# ...and on the platform the record was made on: on the wall the point
# is the path's, and the path follows the last digit of each platform's
# arithmetic (HOMOLOGATION.md)
return (_engine.engine_backend() == "c" and sys.platform.startswith("linux")
and platform.machine() in ("x86_64", "AMD64"))


@needs_fue
@pytest.mark.skipif(not _kernel(), reason="on the MA wall the path is the compiled "
"likelihood's; the pure-Python fallback agrees with it to rounding only")
@pytest.mark.skipif(not _kernel(), reason="on the MA wall the point is the path's: checked "
"with the compiled likelihood, on Linux x86-64")
def test_on_the_ma_wall_the_port_ends_where_the_c_does():
"""GS1 + FF, VARMA(1,1), route V: the C stops on the invertibility wall
at -1740.636683 after 62 iterations from zero and at -1740.622890 after
Expand Down
14 changes: 10 additions & 4 deletions tests/test_c_oracle.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,14 @@ def _c_bin():

def _kernel():
"""Is the compiled likelihood (the C's elf, in the wheel) the one in use?"""
import platform
import sys
from drvarma import _engine
return _engine.engine_backend() == "c"
# ...and on the platform the record was made on: on the wall the point
# is the path's, and the path follows the last digit of each platform's
# arithmetic (HOMOLOGATION.md)
return (_engine.engine_backend() == "c" and sys.platform.startswith("linux")
and platform.machine() in ("x86_64", "AMD64"))


def _port_kwargs(d):
Expand All @@ -71,9 +77,9 @@ def test_the_record_names_a_commit():
@pytest.mark.parametrize("case", REC["cases"], ids=IDS)
def test_the_port_gives_the_recorded_number(case):
if "nit" in case and not _kernel():
pytest.skip("a stop on the MA wall is reached only by the same path, and the "
"path is the compiled likelihood's: the pure-Python fallback agrees "
"with it to rounding, which is not enough there (docs/HOMOLOGATION.md)")
pytest.skip("a stop on the MA wall is reached only by the same path: checked with "
"the compiled likelihood, on Linux x86-64, where the record was made "
"(docs/HOMOLOGATION.md)")
files = [os.path.join(D, os.path.basename(f)) for f in case["files"]]
L = Ladder(files, **_port_kwargs(case["port"]))
r = L.fit()
Expand Down
Loading