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

Test failure in: section on Trail' Line matches section on FixedSegment #373

Open
vcunat opened this issue Feb 28, 2025 · 1 comment
Open

Comments

@vcunat
Copy link

vcunat commented Feb 28, 2025

A test failed randomly for us. Tail of log:

    section on Trail' Line where a segment paramater is 0 or 1:                             OK
      +++ OK, passed 100 tests.
    section on Trail' Line matches section on FixedSegment:                                 FAIL
      *** Failed! Falsified (after 88 tests):
      lineFromSegments [bézier3  (V2 23.0 (-0.25)) (V2 (-0.7142857142857143) 4.24278998044767e-2) (V2 0.8608718340787933 (-67.95)),bézier3  (V2 (-2.6987951807228914) (-31.555555555555557)) (V2 0.7314740059995591 (-0.5)) (V2 19.0 79.183908045977),straight (V2 50.0 64.0),bézier3  (V2 8.545454545454545 0.2732184857924349) (V2 76.0 59.87755102040816) (V2 0.6363636363636364 (-19.714285714285715)),bézier3  (V2 (-56.298507462686565) 63.72727272727273) (V2 1.8510250624370617e-3 (-9.866666666666667)) (V2 11.36 0.9410574464856156),straight (V2 0.3254111873510118 43.0),bézier3  (V2 0.7152594007101306 0.7356060177472081) (V2 4.5711020478806486e-2 (-5.0)) (V2 0.1977369792893824 2.3333333333333335),straight (V2 1.6 (-2.3333333333333335)),bézier3  (V2 0.7057442034023289 (-3.5)) (V2 (-83.8) 0.2743888458907714) (V2 4.6922292333571036e-2 (-2.25)),bézier3  (V2 (-68.33333333333333) 44.375) (V2 (-68.18518518518519) 0.8593011719080682) (V2 0.5714285714285714 (-42.07692307692308)),bézier3  (V2 2.3333333333333335 73.11267605633803) (V2 (-0.3333333333333333) 0.5555555555555556) (V2 49.0 0.40414162544588983),straight (V2 5.9984667620534005e-3 0.40875436328888326),straight (V2 81.0 0.8252000613268063),bézier3  (V2 2.0 2.6666666666666665) (V2 (-60.8235294117647) (-54.195402298850574)) (V2 20.476190476190474 (-1.0)),straight (V2 68.62962962962963 3.1739130434782608),straight (V2 0.9597137107425706 (-70.97222222222223)),bézier3  (V2 0.647546743960823 (-47.88505747126437)) (V2 (-3.0) 52.888888888888886) (V2 1.5714285714285714 36.016666666666666),bézier3  (V2 21.844827586206897 (-57.0)) (V2 46.767857142857146 48.0) (V2 (-51.06666666666667) 2.5),bézier3  (V2 (-3.635135135135135) (-74.8695652173913)) (V2 0.5161720103112761 5.0) (V2 0.7870556348432733 59.79545454545455),straight (V2 (-2.6666666666666665) (-1.4)),straight (V2 0.48912524384396394 0.23938197883922974),bézier3  (V2 0.7712584983387674 (-1.0)) (V2 9.129515734180726e-2 (-85.54054054054055)) (V2 1.8 (-74.0)),straight (V2 3.268063163464541e-2 39.8125),straight (V2 70.59701492537313 8.204408303313271e-2),straight (V2 52.0 6.0),straight (V2 (-25.0) (-5.0)),straight (V2 61.857142857142854 (-64.27777777777777)),bézier3  (V2 0.7 7.061137322609556e-2) (V2 41.0 (-57.0)) (V2 (-64.0) 3.5),straight (V2 26.0 68.0),straight (V2 (-84.63333333333334) 0.4),bézier3  (V2 0.9739518529881794 69.35) (V2 (-78.02325581395348) (-39.0)) (V2 0.30014606155932955 0.33661775227641944),straight (V2 53.0 54.382716049382715),bézier3  (V2 0.8913931544296858 0.37071413386195573) (V2 (-6.133333333333334) (-18.352941176470587)) (V2 39.0 (-30.655172413793103)),straight (V2 0.16987629388600267 29.73076923076923),straight (V2 0.4444444444444444 (-2.75)),bézier3  (V2 13.333333333333334 32.95348837209303) (V2 0.4 0.20710160852121628) (V2 (-0.16666666666666666) 0.3694053750047174),bézier3  (V2 29.03448275862069 2.6348201757192657e-2) (V2 40.0 0.4408316023041149) (V2 0.5 78.85714285714286)] `at` P (V2 0.3891976780532279 0.8767513103107396)
      Param (-3.0798250574282093e-6)
      Param (-0.49523454069820794)
      Use --quickcheck-replay=87506 to reproduce.
      Use -p '/section on Trail'\'' Line matches section on FixedSegment/' to rerun this test only.

1 out of 64 tests failed (0.24s)
Test suite tests: FAIL
Test suite logged to: dist/test/diagrams-lib-1.4.6.2-tests.log
0 of 1 test suites (0 of 1 test cases) passed.

This is on aarch64-linux, NixOS and (as you can see) version 1.4.6.2 which isn't the latest but I haven't noticed anything remotely related in the changelog since then (or issues and PRs).

@byorgey
Copy link
Member

byorgey commented Mar 1, 2025

Thanks for the report! I'm pretty sure that we can just chalk this up to floating-point error: the test in question checks that the results we get from sectioning a trail two different ways are equal up to some error bound, but I guess in this case the accumulated error is just a bit bigger than the allowed error. You can see that one of the parameters used to section the trail is about -3.1e-6 which definitely makes me suspicious.

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

No branches or pull requests

2 participants