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

calico.frp.SignalSuite.Signal: monad (stack-unsafe).semigroupal associativity #101

Open
armanbilge opened this issue Oct 31, 2022 · 9 comments · Fixed by #159
Open

calico.frp.SignalSuite.Signal: monad (stack-unsafe).semigroupal associativity #101

armanbilge opened this issue Oct 31, 2022 · 9 comments · Fixed by #159
Assignees
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@armanbilge
Copy link
Owner

https://github.com/armanbilge/calico/actions/runs/3365416652/jobs/5580859544
76cc916

==> X calico.frp.SignalSuite.Signal: monad (stack-unsafe).semigroupal associativity  4.832s munit.FailException: /home/runner/work/calico/calico/frp/src/test/scala/calico/frp/SignalSuite.scala:92
91:  // it is stack-safe, but expensive to test
92:  checkAll("Signal", MonadTests[Signal[IO, _]].stackUnsafeMonad[Int, Int, Int])

Failing seed: iQWXzGhcEekm-jINUIAUgS6ZlB7yVF95gz9IgZZEw2K=
You can reproduce this failure by adding the following override to your suite:

  override val scalaCheckInitialSeed = "iQWXzGhcEekm-jINUIAUgS6ZlB7yVF95gz9IgZZEw2K="

Falsified after 95 passed tests.
> Labels of failing property: 
Expected: fs2.concurrent.Signal$$anon$2@26a19df0
Received: fs2.concurrent.Signal$$anon$2@757e04bc
> ARG_0: TestSignal(NonEmptyList((0 days,0), (68 milliseconds,1457665478), (151 milliseconds,2147483[64](https://github.com/armanbilge/calico/actions/runs/3365416652/jobs/5580859544#step:9:65)7), (162 milliseconds,-2147483648), (256 milliseconds,1), (259 milliseconds,2147483647), (344 milliseconds,-2147483648), (362 milliseconds,0), (390 milliseconds,1), (471 milliseconds,305638898), (509 milliseconds,-1821102268), (524 milliseconds,-1377071581), (527 milliseconds,355479448), (578 milliseconds,-1), (607 milliseconds,-739471668), (637 milliseconds,1), (669 milliseconds,-2147483648), (707 milliseconds,-2147483648), (730 milliseconds,828406053), (742 milliseconds,1622770241), (767 milliseconds,8[65](https://github.com/armanbilge/calico/actions/runs/3365416652/jobs/5580859544#step:9:66)621095), (817 milliseconds,-2147483648), (821 milliseconds,2147483647), (854 milliseconds,-2093742574), (930 milliseconds,-1), (937 milliseconds,-188230[66](https://github.com/armanbilge/calico/actions/runs/3365416652/jobs/5580859544#step:9:67)53), (959 milliseconds,782498559), (1043 milliseconds,-1), (1094 milliseconds,68798[67](https://github.com/armanbilge/calico/actions/runs/3365416652/jobs/5580859544#step:9:68)40), (1110 milliseconds,1894184348), (1160 milliseconds,293152086), (1178 milliseconds,-1), (1187 milliseconds,-664358731), (1253 milliseconds,-2147483648), (1340 milliseconds,-1), (1388 milliseconds,-1)))
> ARG_1: TestSignal(NonEmptyList((0 days,430536250), (44 milliseconds,203865271), (84 milliseconds,-107812072), (131 milliseconds,-1501863624), (220 milliseconds,1477498930), (298 milliseconds,-103772395), (330 milliseconds,-1), (357 milliseconds,0), (427 milliseconds,-494983414), (452 milliseconds,2147483647), (503 milliseconds,1), (539 milliseconds,2147483647), (623 milliseconds,0), (631 milliseconds,1), (700 milliseconds,-1), (761 milliseconds,1889953343), (792 milliseconds,-1563714372), (793 milliseconds,1750533345), (839 milliseconds,0), (851 milliseconds,-1), (906 milliseconds,0), (985 milliseconds,92035138), (1043 milliseconds,44143870), (1066 milliseconds,231974609), (1093 milliseconds,-103754353), (1135 milliseconds,-1497811984), (1218 milliseconds,-1186558449), (1249 milliseconds,0), (1300 milliseconds,-1220383188), (1357 milliseconds,0), (1380 milliseconds,2147483647), (1427 milliseconds,1), (1474 milliseconds,1896258581), (1550 milliseconds,-2146716440), (1620 milliseconds,-2052855694)))
> ARG_2: TestSignal(NonEmptyList((0 days,-1628894941), (29 milliseconds,-21965915), (49 milliseconds,-658178761), (59 milliseconds,-1), (91 milliseconds,-758074570), (102 milliseconds,0), (189 milliseconds,-2016463288), (206 milliseconds,815004274), (261 milliseconds,2069458917), (325 milliseconds,2026120782), (343 milliseconds,1), (366 milliseconds,-96264285), (424 milliseconds,10517321[68](https://github.com/armanbilge/calico/actions/runs/3365416652/jobs/5580859544#step:9:69)), (515 milliseconds,-2147483648), (552 milliseconds,0), (646 milliseconds,-1162227194), ([70](https://github.com/armanbilge/calico/actions/runs/3365416652/jobs/5580859544#step:9:71)6 milliseconds,-886021707), (767 milliseconds,-457[74](https://github.com/armanbilge/calico/actions/runs/3365416652/jobs/5580859544#step:9:75)7432), (852 milliseconds,-1260338202), (922 milliseconds,580918313)))
    at munit.Assertions.fail(Assertions.scala:283)
    at munit.Assertions.fail$(Assertions.scala:15)
    at munit.FunSuite.fail(FunSuite.scala:11)
    at munit.ScalaCheckSuite.propToTry$$anonfun$1(ScalaCheckSuite.scala:104)
    at scala.util.Try$.apply(Try.scala:210)
    at munit.ScalaCheckSuite.propToTry(ScalaCheckSuite.scala:104)
    at munit.ScalaCheckSuite.$init$$$anonfun$2$$anonfun$1$$anonfun$1(ScalaCheckSuite.scala:46)
    at scala.concurrent.impl.Promise$Transformation.run(Promise.scala:4[75](https://github.com/armanbilge/calico/actions/runs/3365416652/jobs/5580859544#step:9:76))
    at munit.Suite$$anon$1.execute(Suite.scala:26)
    at scala.concurrent.impl.Promise$Transformation.submitWithValue(Promise.scala:429)
    at scala.concurrent.impl.Promise$DefaultPromise.submitWithValue(Promise.scala:338)
    at scala.concurrent.impl.Promise$DefaultPromise.dispatchOrAddCallbacks(Promise.scala:312)
    at scala.concurrent.impl.Promise$DefaultPromise.transform(Promise.scala:128)
    at munit.internal.FutureCompat$ExtensionFuture.transformCompat(FutureCompat.scala:16)
    at munit.ScalaCheckSuite.$init$$$anonfun$3$$anonfun$2(ScalaCheckSuite.scala:48)
    at munit.GenericTest.withBodyMap$$anonfun$1(GenericTest.scala:33)
    at munit.MUnitRunner.$anonfun$8(MUnitRunner.scala:296)
armanbilge added a commit that referenced this issue Dec 9, 2022
@armanbilge armanbilge added help wanted Extra attention is needed bug Something isn't working labels Dec 9, 2022
@armanbilge
Copy link
Owner Author

Help wanted: can anybody reproduce this issue locally? By cloning the repo and running frpJVM/testOnly *.SignalSuite a few times? It flakes often enough in CI that I expect it should fail within a few attempts.

No matter how hard I try I cannot reproduce this locally. Even after making everything deterministic (see #118) and using the exact same seed as CI.

@2chilled
Copy link
Collaborator

2chilled commented Jan 7, 2023

Also failed to reproduce locally...

@armanbilge
Copy link
Owner Author

armanbilge commented Jan 17, 2023

New (related?) failure in 3f4e43b.

==> X calico.frp.SignalSuite.monad (stack-unsafe).flatMap associativity  0.365s munit.FailException: /home/runner/work/calico/calico/frp/src/test/scala/calico/frp/SignalSuite.scala:102
101:      // TODO investigate failures #101
102:      if id != "monad (stack-unsafe).semigroupal associativity" then property(id)(prop)
103:  }

Failing seed: REJjza9ue3MBA9fIfCJ8CtsnfM2SJOTz2nC5sjGgKLD=
You can reproduce this failure by adding the following override to your suite:

  override val scalaCheckInitialSeed = "REJjza9ue3MBA9fIfCJ8CtsnfM2SJOTz2nC5sjGgKLD="

Falsified after 16 passed tests.
> Labels of failing property: 
Expected: calico.frp.frp$package$$anon$1$$anon$2@1afa1410
Received: calico.frp.frp$package$$anon$1$$anon$2@1bab23b8
> ARG_0: TestSignal(NonEmptyList((0 days,21[47](https://github.com/armanbilge/calico/actions/runs/3944037909/jobs/6749544190#step:9:48)[48](https://github.com/armanbilge/calico/actions/runs/3944037909/jobs/6749544190#step:9:49)3647), (14 milliseconds,0), (22 milliseconds,0), (24 milliseconds,-1438643795), (26 milliseconds,-2147483648), (38 milliseconds,-1879399580), (39 milliseconds,282832593), ([55](https://github.com/armanbilge/calico/actions/runs/3944037909/jobs/6749544190#step:9:56) milliseconds,106604709), ([56](https://github.com/armanbilge/calico/actions/runs/3944037909/jobs/6749544190#step:9:57) milliseconds,2071189212), (70 milliseconds,1), (85 milliseconds,2147483647), (86 milliseconds,-1), (97 milliseconds,-1048842331), (102 milliseconds,0), (104 milliseconds,-1), (112 milliseconds,2147483647)))

@armanbilge
Copy link
Owner Author

I made some progress on this. I'm pretty confident it's not a real issue in practice, but more of a testing issue.

When two events happen at the exact same time, there is non-determinism in which order they get resolved. This becomes a discrepancy in the equality check. I need to think about how exactly to fix this.

I still don't understand why it's so hard to reproduce, and impossible to reproduce deterministically. In theory, setting the seed for the test runtime should make these non-determinstic orderings deterministic, but that doesn't seem to be working. My best guess is that there is a bug in the test runtime?

@armanbilge
Copy link
Owner Author

Here's an unminimized example of fa.product(fb).product(fc) vs fa.product(fb.product(fc)) that happened for 4c12359 in CI (on the 12th re-run).

> ARG_0: TestSignal(NonEmptyList((0 days,-388426040), (14 milliseconds,-2147483648), (57 milliseconds,514182325), (84 milliseconds,-1), (134 milliseconds,-2147483648), (159 milliseconds,0), (195 milliseconds,-1904021557), (248 milliseconds,442433516), (294 milliseconds,0), (295 milliseconds,1662587575), (343 milliseconds,2147483647), (390 milliseconds,998429480), (397 milliseconds,0), (458 milliseconds,484414658), (486 milliseconds,-628215590), (490 milliseconds,-618679410), (551 milliseconds,1810846458), (587 milliseconds,-390898122), (598 milliseconds,-1414556905), (615 milliseconds,2147483647), (631 milliseconds,-2147483648), (646 milliseconds,-1), (697 milliseconds,2147483647), (732 milliseconds,2147483647), (746 milliseconds,1057123102), (790 milliseconds,36379233), (841 milliseconds,735418277), (869 milliseconds,2100644478), (921 milliseconds,2147483647), (923 milliseconds,2147483647), (931 milliseconds,-2147483648), (948 milliseconds,2147483647), (964 milliseconds,2000745190), (984 milliseconds,1949739167), (990 milliseconds,-1), (1035 milliseconds,2111808226), (1090 milliseconds,0), (1107 milliseconds,1021552140), (1123 milliseconds,2147483647), (1156 milliseconds,-1511949154), (1183 milliseconds,0), (1206 milliseconds,0), (1250 milliseconds,-1551622535), (1281 milliseconds,-1)))
> ARG_1: TestSignal(NonEmptyList((0 days,1), (9 milliseconds,-851681487), (43 milliseconds,1710829038), (62 milliseconds,-2147483648), (127 milliseconds,957866887), (169 milliseconds,0), (229 milliseconds,-1), (287 milliseconds,-2147483648), (348 milliseconds,1), (372 milliseconds,1), (433 milliseconds,-2147483648), (467 milliseconds,1475628416), (518 milliseconds,0), (525 milliseconds,762300189), (546 milliseconds,1), (587 milliseconds,-134340690), (628 milliseconds,1319046348), (632 milliseconds,968194065), (682 milliseconds,-1684435823), (743 milliseconds,2143381312), (794 milliseconds,-1718300484), (803 milliseconds,2147483647), (819 milliseconds,474224632), (869 milliseconds,0), (916 milliseconds,1), (978 milliseconds,-2147483648), (1032 milliseconds,-1), (1057 milliseconds,2147483647), (1084 milliseconds,-833269627), (1117 milliseconds,1183239189), (1149 milliseconds,1682737693), (1157 milliseconds,-2147483648), (1206 milliseconds,-1), (1234 milliseconds,1), (1235 milliseconds,1125447677), (1277 milliseconds,0), (1302 milliseconds,-1432193002), (1367 milliseconds,1080760208), (1399 milliseconds,-2147483648), (1406 milliseconds,-146584376), (1415 milliseconds,-1), (1473 milliseconds,2147483647), (1516 milliseconds,0), (1543 milliseconds,2017649676), (1561 milliseconds,-1), (1617 milliseconds,1), (1666 milliseconds,-1618098196), (1730 milliseconds,0), (1745 milliseconds,2147483647), (1752 milliseconds,-2084705174), (1813 milliseconds,-1), (1863 milliseconds,896621181), (1905 milliseconds,-2147483648), (1945 milliseconds,2147483647), (2002 milliseconds,-716952381), (2003 milliseconds,0), (2030 milliseconds,-2117502036), (2078 milliseconds,-2147483648), (2128 milliseconds,-1), (2180 milliseconds,-2147483648)))
> ARG_2: TestSignal(NonEmptyList((0 days,-2147483648), (34 milliseconds,-1057504099), (38 milliseconds,-2147483648), (83 milliseconds,0), (84 milliseconds,0), (98 milliseconds,2092661120), (150 milliseconds,1949525151)))
DEBUG: Succeeded: List(((-1,-2147483648,1949525151),2180000 microseconds), ((-1,-1,1949525151),2128000 microseconds), ((-1,-2147483648,1949525151),2078000 microseconds), ((-1,-2117502036,1949525151),2030000 microseconds), ((-1,0,1949525151),2003000 microseconds), ((-1,-716952381,1949525151),2002000 microseconds), ((-1,2147483647,1949525151),1945000 microseconds), ((-1,-2147483648,1949525151),1905000 microseconds), ((-1,896621181,1949525151),1863000 microseconds), ((-1,-1,1949525151),1813000 microseconds), ((-1,-2084705174,1949525151),1752000 microseconds), ((-1,2147483647,1949525151),1745000 microseconds), ((-1,0,1949525151),1730000 microseconds), ((-1,-1618098196,1949525151),1666000 microseconds), ((-1,1,1949525151),1617000 microseconds), ((-1,-1,1949525151),1561000 microseconds), ((-1,2017649676,1949525151),1543000 microseconds), ((-1,0,1949525151),1516000 microseconds), ((-1,2147483647,1949525151),1473000 microseconds), ((-1,-1,1949525151),1415000 microseconds), ((-1,-146584376,1949525151),1406000 microseconds), ((-1,-2147483648,1949525151),1399000 microseconds), ((-1,1080760208,1949525151),1367000 microseconds), ((-1,-1432193002,1949525151),1302000 microseconds), ((-1,0,1949525151),1281000 microseconds), ((-1551622535,0,1949525151),1277000 microseconds), ((-1551622535,1125447677,1949525151),1250000 microseconds), ((0,1125447677,1949525151),1235000 microseconds), ((0,1,1949525151),1234000 microseconds), ((0,-1,1949525151),1206000 microseconds), ((0,-2147483648,1949525151),1183000 microseconds), ((-1511949154,-2147483648,1949525151),1157000 microseconds), ((-1511949154,1682737693,1949525151),1156000 microseconds), ((2147483647,1682737693,1949525151),1149000 microseconds), ((2147483647,1183239189,1949525151),1123000 microseconds), ((1021552140,1183239189,1949525151),1117000 microseconds), ((1021552140,-833269627,1949525151),1107000 microseconds), ((0,-833269627,1949525151),1090000 microseconds), ((2111808226,-833269627,1949525151),1084000 microseconds), ((2111808226,2147483647,1949525151),1057000 microseconds), ((2111808226,-1,1949525151),1035000 microseconds), ((-1,-1,1949525151),1032000 microseconds), ((-1,-2147483648,1949525151),990000 microseconds), ((1949739167,-2147483648,1949525151),984000 microseconds), ((2000745190,-2147483648,1949525151),978000 microseconds), ((2000745190,1,1949525151),964000 microseconds), ((2147483647,1,1949525151),948000 microseconds), ((-2147483648,1,1949525151),931000 microseconds), ((2147483647,1,1949525151),923000 microseconds), ((2147483647,1,1949525151),921000 microseconds), ((2100644478,1,1949525151),916000 microseconds), ((2100644478,0,1949525151),869000 microseconds), ((735418277,474224632,1949525151),841000 microseconds), ((36379233,474224632,1949525151),819000 microseconds), ((36379233,2147483647,1949525151),803000 microseconds), ((36379233,-1718300484,1949525151),794000 microseconds), ((36379233,2143381312,1949525151),790000 microseconds), ((1057123102,2143381312,1949525151),746000 microseconds), ((2147483647,2143381312,1949525151),743000 microseconds), ((2147483647,-1684435823,1949525151),732000 microseconds), ((2147483647,-1684435823,1949525151),697000 microseconds), ((-1,-1684435823,1949525151),682000 microseconds), ((-1,968194065,1949525151),646000 microseconds), ((-2147483648,968194065,1949525151),632000 microseconds), ((-2147483648,1319046348,1949525151),631000 microseconds), ((2147483647,1319046348,1949525151),628000 microseconds), ((2147483647,-134340690,1949525151),615000 microseconds), ((-1414556905,-134340690,1949525151),598000 microseconds), ((-390898122,-134340690,1949525151),587000 microseconds), ((1810846458,1,1949525151),551000 microseconds), ((-618679410,1,1949525151),546000 microseconds), ((-618679410,762300189,1949525151),525000 microseconds), ((-618679410,0,1949525151),518000 microseconds), ((-618679410,1475628416,1949525151),490000 microseconds), ((-628215590,1475628416,1949525151),486000 microseconds), ((484414658,1475628416,1949525151),467000 microseconds), ((484414658,-2147483648,1949525151),458000 microseconds), ((0,-2147483648,1949525151),433000 microseconds), ((0,1,1949525151),397000 microseconds), ((998429480,1,1949525151),390000 microseconds), ((2147483647,1,1949525151),372000 microseconds), ((2147483647,1,1949525151),348000 microseconds), ((2147483647,-2147483648,1949525151),343000 microseconds), ((1662587575,-2147483648,1949525151),295000 microseconds), ((0,-2147483648,1949525151),294000 microseconds), ((442433516,-2147483648,1949525151),287000 microseconds), ((442433516,-1,1949525151),248000 microseconds), ((-1904021557,-1,1949525151),229000 microseconds), ((-1904021557,0,1949525151),195000 microseconds), ((0,0,1949525151),169000 microseconds), ((0,957866887,1949525151),159000 microseconds), ((-2147483648,957866887,1949525151),150000 microseconds), ((-2147483648,957866887,2092661120),134000 microseconds), ((-1,957866887,2092661120),127000 microseconds), ((-1,-2147483648,2092661120),98000 microseconds), ((-1,-2147483648,0),84000 microseconds), ((514182325,-2147483648,0),83000 microseconds), ((514182325,-2147483648,-2147483648),62000 microseconds), ((514182325,1710829038,-2147483648),57000 microseconds), ((-2147483648,1710829038,-2147483648),43000 microseconds), ((-2147483648,-851681487,-2147483648),38000 microseconds), ((-2147483648,-851681487,-1057504099),34000 microseconds), ((-2147483648,-851681487,-2147483648),14000 microseconds), ((-388426040,-851681487,-2147483648),9000 microseconds), ((-388426040,1,-2147483648),0 microseconds))
DEBUG: Succeeded: List(((-1,-2147483648,1949525151),2180000 microseconds), ((-1,-1,1949525151),2128000 microseconds), ((-1,-2147483648,1949525151),2078000 microseconds), ((-1,-2117502036,1949525151),2030000 microseconds), ((-1,0,1949525151),2003000 microseconds), ((-1,-716952381,1949525151),2002000 microseconds), ((-1,2147483647,1949525151),1945000 microseconds), ((-1,-2147483648,1949525151),1905000 microseconds), ((-1,896621181,1949525151),1863000 microseconds), ((-1,-1,1949525151),1813000 microseconds), ((-1,-2084705174,1949525151),1752000 microseconds), ((-1,2147483647,1949525151),1745000 microseconds), ((-1,0,1949525151),1730000 microseconds), ((-1,-1618098196,1949525151),1666000 microseconds), ((-1,1,1949525151),1617000 microseconds), ((-1,-1,1949525151),1561000 microseconds), ((-1,2017649676,1949525151),1543000 microseconds), ((-1,0,1949525151),1516000 microseconds), ((-1,2147483647,1949525151),1473000 microseconds), ((-1,-1,1949525151),1415000 microseconds), ((-1,-146584376,1949525151),1406000 microseconds), ((-1,-2147483648,1949525151),1399000 microseconds), ((-1,1080760208,1949525151),1367000 microseconds), ((-1,-1432193002,1949525151),1302000 microseconds), ((-1,0,1949525151),1281000 microseconds), ((-1551622535,0,1949525151),1277000 microseconds), ((-1551622535,1125447677,1949525151),1250000 microseconds), ((0,1125447677,1949525151),1235000 microseconds), ((0,1,1949525151),1234000 microseconds), ((0,-1,1949525151),1206000 microseconds), ((0,-2147483648,1949525151),1183000 microseconds), ((-1511949154,-2147483648,1949525151),1157000 microseconds), ((-1511949154,1682737693,1949525151),1156000 microseconds), ((2147483647,1682737693,1949525151),1149000 microseconds), ((2147483647,1183239189,1949525151),1123000 microseconds), ((1021552140,1183239189,1949525151),1117000 microseconds), ((1021552140,-833269627,1949525151),1107000 microseconds), ((0,-833269627,1949525151),1090000 microseconds), ((2111808226,-833269627,1949525151),1084000 microseconds), ((2111808226,2147483647,1949525151),1057000 microseconds), ((2111808226,-1,1949525151),1035000 microseconds), ((-1,-1,1949525151),1032000 microseconds), ((-1,-2147483648,1949525151),990000 microseconds), ((1949739167,-2147483648,1949525151),984000 microseconds), ((2000745190,-2147483648,1949525151),978000 microseconds), ((2000745190,1,1949525151),964000 microseconds), ((2147483647,1,1949525151),948000 microseconds), ((-2147483648,1,1949525151),931000 microseconds), ((2147483647,1,1949525151),923000 microseconds), ((2147483647,1,1949525151),921000 microseconds), ((2100644478,1,1949525151),916000 microseconds),  ((735418277,0,1949525151),869000 microseconds), ((735418277,474224632,1949525151),841000 microseconds), ((36379233,474224632,1949525151),819000 microseconds), ((36379233,2147483647,1949525151),803000 microseconds), ((36379233,-1718300484,1949525151),794000 microseconds), ((36379233,2143381312,1949525151),790000 microseconds), ((1057123102,2143381312,1949525151),746000 microseconds), ((2147483647,2143381312,1949525151),743000 microseconds), ((2147483647,-1684435823,1949525151),732000 microseconds), ((2147483647,-1684435823,1949525151),697000 microseconds), ((-1,-1684435823,1949525151),682000 microseconds), ((-1,968194065,1949525151),646000 microseconds), ((-2147483648,968194065,1949525151),632000 microseconds), ((-2147483648,1319046348,1949525151),631000 microseconds), ((2147483647,1319046348,1949525151),628000 microseconds), ((2147483647,-134340690,1949525151),615000 microseconds), ((-1414556905,-134340690,1949525151),598000 microseconds), ((-390898122,-134340690,1949525151),587000 microseconds), ((1810846458,1,1949525151),551000 microseconds), ((-618679410,1,1949525151),546000 microseconds), ((-618679410,762300189,1949525151),525000 microseconds), ((-618679410,0,1949525151),518000 microseconds), ((-618679410,1475628416,1949525151),490000 microseconds), ((-628215590,1475628416,1949525151),486000 microseconds), ((484414658,1475628416,1949525151),467000 microseconds), ((484414658,-2147483648,1949525151),458000 microseconds), ((0,-2147483648,1949525151),433000 microseconds), ((0,1,1949525151),397000 microseconds), ((998429480,1,1949525151),390000 microseconds), ((2147483647,1,1949525151),372000 microseconds), ((2147483647,1,1949525151),348000 microseconds), ((2147483647,-2147483648,1949525151),343000 microseconds), ((1662587575,-2147483648,1949525151),295000 microseconds), ((0,-2147483648,1949525151),294000 microseconds), ((442433516,-2147483648,1949525151),287000 microseconds), ((442433516,-1,1949525151),248000 microseconds), ((-1904021557,-1,1949525151),229000 microseconds), ((-1904021557,0,1949525151),195000 microseconds), ((0,0,1949525151),169000 microseconds), ((0,957866887,1949525151),159000 microseconds), ((-2147483648,957866887,1949525151),150000 microseconds), ((-2147483648,957866887,2092661120),134000 microseconds), ((-1,957866887,2092661120),127000 microseconds), ((-1,-2147483648,2092661120),98000 microseconds), ((-1,-2147483648,0),84000 microseconds), ((514182325,-2147483648,0),83000 microseconds), ((514182325,-2147483648,-2147483648),62000 microseconds), ((514182325,1710829038,-2147483648),57000 microseconds), ((-2147483648,1710829038,-2147483648),43000 microseconds), ((-2147483648,-851681487,-2147483648),38000 microseconds), ((-2147483648,-851681487,-1057504099),34000 microseconds), ((-2147483648,-851681487,-2147483648),14000 microseconds), ((-388426040,-851681487,-2147483648),9000 microseconds), ((-388426040,1,-2147483648),0 microseconds))

@armanbilge
Copy link
Owner Author

I added even more debug in 8503fe7.

> ARG_0: TestSignal(NonEmptyList((0 days,-860052968), (70 milliseconds,-1), (124 milliseconds,98812078), (205 milliseconds,1), (225 milliseconds,475596510), (246 milliseconds,-1208372270), (261 milliseconds,-382203877), (305 milliseconds,2147483647), (314 milliseconds,2147483647), (392 milliseconds,710640436), (422 milliseconds,1), (435 milliseconds,-1055972225), (508 milliseconds,-2147483648), (562 milliseconds,0), (593 milliseconds,2147483647), (622 milliseconds,1757127550), (672 milliseconds,-289516847), (736 milliseconds,962913626), (802 milliseconds,-2147483648), (826 milliseconds,2028148422), (868 milliseconds,-1589988534), (899 milliseconds,-1144724629), (925 milliseconds,-821700185), (984 milliseconds,0), (1026 milliseconds,-2147483648), (1091 milliseconds,2038026361), (1142 milliseconds,838972968), (1224 milliseconds,2147483647), (1255 milliseconds,-2147483648), (1257 milliseconds,2042976395), (1313 milliseconds,1), (1355 milliseconds,-2147483648), (1417 milliseconds,-1877369550), (1436 milliseconds,1), (1513 milliseconds,1), (1529 milliseconds,-1966737612), (1591 milliseconds,-692201763), (1647 milliseconds,-2147483648), (1658 milliseconds,-1990983534), (1713 milliseconds,0), (1787 milliseconds,-1), (1839 milliseconds,1217503452), (1907 milliseconds,-1), (1939 milliseconds,-141308714), (1997 milliseconds,1213720406), (2056 milliseconds,-534401639), (2092 milliseconds,-1506504239), (2134 milliseconds,-1574131144), (2165 milliseconds,-1621986403)))
> ARG_1: TestSignal(NonEmptyList((0 days,-963552036), (16 milliseconds,2147483647), (86 milliseconds,-1758610128), (143 milliseconds,0), (181 milliseconds,-1), (182 milliseconds,-1), (190 milliseconds,1143050587), (271 milliseconds,-2147483648), (344 milliseconds,-1), (392 milliseconds,-2147483648), (474 milliseconds,0), (528 milliseconds,-1), (547 milliseconds,290427626), (593 milliseconds,0), (649 milliseconds,245014570), (732 milliseconds,1), (803 milliseconds,-1), (822 milliseconds,-1085088996), (884 milliseconds,2147483647), (975 milliseconds,1), (1011 milliseconds,-311853872), (1080 milliseconds,-870634785), (1111 milliseconds,389086021), (1162 milliseconds,-521933085), (1227 milliseconds,0), (1242 milliseconds,951899633), (1287 milliseconds,1), (1346 milliseconds,-1398817111), (1350 milliseconds,2147483647), (1383 milliseconds,-1), (1409 milliseconds,2147483647), (1445 milliseconds,1870092692), (1479 milliseconds,157573162), (1536 milliseconds,-2147483648), (1600 milliseconds,-1070810317), (1689 milliseconds,2069202401), (1690 milliseconds,1121846581), (1699 milliseconds,1), (1746 milliseconds,1), (1757 milliseconds,0), (1805 milliseconds,1), (1881 milliseconds,0), (1972 milliseconds,0), (2038 milliseconds,-1206160175), (2054 milliseconds,2147483647), (2134 milliseconds,-2147483648), (2179 milliseconds,-877407511), (2186 milliseconds,1788477130), (2242 milliseconds,0), (2319 milliseconds,1851380718), (2345 milliseconds,-718526679), (2421 milliseconds,-2094202283), (2489 milliseconds,-1479896219), (2491 milliseconds,1), (2523 milliseconds,-1), (2607 milliseconds,1), (2618 milliseconds,-1), (2701 milliseconds,-1621908666), (2713 milliseconds,-649589926), (2725 milliseconds,-2147483648), (2750 milliseconds,0)))
> ARG_2: TestSignal(NonEmptyList((0 days,0), (11 milliseconds,2147483647), (92 milliseconds,0), (167 milliseconds,0), (243 milliseconds,2147483647), (288 milliseconds,-2147483648), (346 milliseconds,1), (382 milliseconds,2147483647), (435 milliseconds,-384661941), (495 milliseconds,927027941), (579 milliseconds,-1557311587), (644 milliseconds,2147483647), (724 milliseconds,2147483647), (779 milliseconds,461235502), (864 milliseconds,-646984866), (870 milliseconds,1), (901 milliseconds,-2147483648), (976 milliseconds,931658760), (1010 milliseconds,-2147483648), (1021 milliseconds,893625201), (1070 milliseconds,-2147483648), (1146 milliseconds,0), (1224 milliseconds,0), (1282 milliseconds,2147483647), (1309 milliseconds,1), (1324 milliseconds,-860366289), (1338 milliseconds,-1050966210), (1347 milliseconds,-2147483648), (1380 milliseconds,-1), (1433 milliseconds,-1361725227), (1494 milliseconds,-1804271564), (1578 milliseconds,2147483647), (1584 milliseconds,-1), (1648 milliseconds,1932462790), (1714 milliseconds,685989688), (1769 milliseconds,1018250182), (1783 milliseconds,2147483647), (1800 milliseconds,0), (1833 milliseconds,-1), (1913 milliseconds,-2147483648)))
DEBUG RAW: Succeeded: List(((-1621986403,0,-2147483648),2750000 microseconds), ((-1621986403,-2147483648,-2147483648),2725000 microseconds), ((-1621986403,-649589926,-2147483648),2713000 microseconds), ((-1621986403,-1621908666,-2147483648),2701000 microseconds), ((-1621986403,-1,-2147483648),2618000 microseconds), ((-1621986403,1,-2147483648),2607000 microseconds), ((-1621986403,-1,-2147483648),2523000 microseconds), ((-1621986403,1,-2147483648),2491000 microseconds), ((-1621986403,-1479896219,-2147483648),2489000 microseconds), ((-1621986403,-2094202283,-2147483648),2421000 microseconds), ((-1621986403,-718526679,-2147483648),2345000 microseconds), ((-1621986403,1851380718,-2147483648),2319000 microseconds), ((-1621986403,0,-2147483648),2242000 microseconds), ((-1621986403,1788477130,-2147483648),2186000 microseconds), ((-1621986403,-877407511,-2147483648),2179000 microseconds), ((-1621986403,-2147483648,-2147483648),2165000 microseconds), ((-1574131144,-2147483648,-2147483648),2134000 microseconds), ((-1506504239,-2147483648,-2147483648),2134000 microseconds), ((-1506504239,2147483647,-2147483648),2092000 microseconds), ((-534401639,2147483647,-2147483648),2056000 microseconds), ((1213720406,2147483647,-2147483648),2054000 microseconds), ((1213720406,-1206160175,-2147483648),2038000 microseconds), ((1213720406,0,-2147483648),1997000 microseconds), ((-141308714,0,-2147483648),1972000 microseconds), ((-141308714,0,-2147483648),1939000 microseconds), ((-1,0,-2147483648),1913000 microseconds), ((-1,0,-1),1907000 microseconds), ((1217503452,0,-1),1881000 microseconds), ((1217503452,1,-1),1839000 microseconds), ((-1,1,-1),1833000 microseconds), ((-1,1,0),1805000 microseconds), ((-1,0,0),1800000 microseconds), ((-1,0,2147483647),1787000 microseconds), ((0,0,2147483647),1783000 microseconds), ((0,0,1018250182),1769000 microseconds), ((0,0,685989688),1757000 microseconds), ((0,1,685989688),1746000 microseconds), ((0,1,685989688),1714000 microseconds), ((0,1,1932462790),1713000 microseconds), ((-1990983534,1,1932462790),1699000 microseconds), ((-1990983534,1121846581,1932462790),1690000 microseconds), ((-1990983534,2069202401,1932462790),1689000 microseconds), ((-1990983534,-1070810317,1932462790),1658000 microseconds), ((-2147483648,-1070810317,1932462790),1648000 microseconds), ((-2147483648,-1070810317,-1),1647000 microseconds), ((-692201763,-1070810317,-1),1600000 microseconds), ((-692201763,-2147483648,-1),1591000 microseconds), ((-1966737612,-2147483648,-1),1584000 microseconds), ((-1966737612,-2147483648,2147483647),1578000 microseconds), ((-1966737612,-2147483648,-1804271564),1536000 microseconds), ((-1966737612,157573162,-1804271564),1529000 microseconds), ((1,157573162,-1804271564),1513000 microseconds), ((1,157573162,-1804271564),1494000 microseconds), ((1,157573162,-1361725227),1479000 microseconds), ((1,1870092692,-1361725227),1445000 microseconds), ((1,2147483647,-1361725227),1436000 microseconds), ((-1877369550,2147483647,-1361725227),1433000 microseconds), ((-1877369550,2147483647,-1),1417000 microseconds), ((-2147483648,2147483647,-1),1409000 microseconds), ((-2147483648,-1,-1),1383000 microseconds), ((-2147483648,2147483647,-1),1380000 microseconds), ((-2147483648,2147483647,-2147483648),1355000 microseconds), ((1,2147483647,-2147483648),1350000 microseconds), ((1,-1398817111,-2147483648),1347000 microseconds), ((1,-1398817111,-1050966210),1346000 microseconds), ((1,1,-1050966210),1338000 microseconds), ((1,1,-860366289),1324000 microseconds), ((1,1,1),1313000 microseconds), ((2042976395,1,1),1309000 microseconds), ((2042976395,1,2147483647),1287000 microseconds), ((2042976395,951899633,2147483647),1282000 microseconds), ((2042976395,951899633,0),1257000 microseconds), ((-2147483648,951899633,0),1255000 microseconds), ((2147483647,951899633,0),1242000 microseconds), ((2147483647,0,0),1227000 microseconds), ((2147483647,-521933085,0),1224000 microseconds),                                                  ((838972968,-521933085,0),1162000 microseconds), ((838972968,389086021,0),1146000 microseconds), ((838972968,389086021,-2147483648),1142000 microseconds), ((2038026361,389086021,-2147483648),1111000 microseconds), ((2038026361,-870634785,-2147483648),1091000 microseconds), ((-2147483648,-870634785,-2147483648),1080000 microseconds), ((-2147483648,-311853872,-2147483648),1070000 microseconds), ((-2147483648,-311853872,893625201),1026000 microseconds), ((0,-311853872,893625201),1021000 microseconds), ((0,-311853872,-2147483648),1011000 microseconds), ((0,1,-2147483648),1010000 microseconds), ((0,1,931658760),984000 microseconds), ((-821700185,1,931658760),976000 microseconds), ((-821700185,1,-2147483648),975000 microseconds), ((-821700185,2147483647,-2147483648),925000 microseconds), ((-1144724629,2147483647,-2147483648),901000 microseconds), ((-1144724629,2147483647,1),899000 microseconds), ((-1589988534,2147483647,1),884000 microseconds), ((-1589988534,-1085088996,1),870000 microseconds), ((-1589988534,-1085088996,-646984866),868000 microseconds), ((2028148422,-1085088996,-646984866),864000 microseconds), ((2028148422,-1085088996,461235502),826000 microseconds), ((-2147483648,-1085088996,461235502),822000 microseconds), ((-2147483648,-1,461235502),803000 microseconds), ((-2147483648,1,461235502),802000 microseconds), ((962913626,1,461235502),779000 microseconds), ((962913626,1,2147483647),736000 microseconds), ((-289516847,1,2147483647),732000 microseconds), ((-289516847,245014570,2147483647),724000 microseconds), ((-289516847,245014570,2147483647),672000 microseconds), ((1757127550,245014570,2147483647),649000 microseconds), ((1757127550,0,2147483647),644000 microseconds), ((1757127550,0,-1557311587),622000 microseconds), ((2147483647,0,-1557311587),593000 microseconds),                                          ((0,290427626,-1557311587),579000 microseconds), ((0,290427626,927027941),562000 microseconds), ((-2147483648,290427626,927027941),547000 microseconds), ((-2147483648,-1,927027941),528000 microseconds), ((-2147483648,0,927027941),508000 microseconds), ((-1055972225,0,927027941),495000 microseconds), ((-1055972225,0,-384661941),474000 microseconds), ((-1055972225,-2147483648,-384661941),435000 microseconds), ((1,-2147483648,-384661941),435000 microseconds), ((1,-2147483648,2147483647),422000 microseconds), ((710640436,-2147483648,2147483647),392000 microseconds), ((2147483647,-1,2147483647),382000 microseconds), ((2147483647,-1,1),346000 microseconds), ((2147483647,-1,-2147483648),344000 microseconds), ((2147483647,-2147483648,-2147483648),314000 microseconds), ((2147483647,-2147483648,-2147483648),305000 microseconds), ((-382203877,-2147483648,-2147483648),288000 microseconds), ((-382203877,-2147483648,2147483647),271000 microseconds), ((-382203877,1143050587,2147483647),261000 microseconds), ((-1208372270,1143050587,2147483647),246000 microseconds), ((475596510,1143050587,2147483647),243000 microseconds), ((475596510,1143050587,0),225000 microseconds), ((1,1143050587,0),205000 microseconds), ((98812078,1143050587,0),190000 microseconds), ((98812078,-1,0),182000 microseconds), ((98812078,-1,0),181000 microseconds), ((98812078,0,0),167000 microseconds), ((98812078,0,0),143000 microseconds), ((98812078,-1758610128,0),124000 microseconds), ((-1,-1758610128,0),92000 microseconds), ((-1,-1758610128,2147483647),86000 microseconds), ((-1,2147483647,2147483647),70000 microseconds), ((-860052968,2147483647,2147483647),16000 microseconds), ((-860052968,-963552036,2147483647),11000 microseconds), ((-860052968,-963552036,0),0 microseconds))
DEBUG: Succeeded:     List(((-1621986403,0,-2147483648),2750000 microseconds), ((-1621986403,-2147483648,-2147483648),2725000 microseconds), ((-1621986403,-649589926,-2147483648),2713000 microseconds), ((-1621986403,-1621908666,-2147483648),2701000 microseconds), ((-1621986403,-1,-2147483648),2618000 microseconds), ((-1621986403,1,-2147483648),2607000 microseconds), ((-1621986403,-1,-2147483648),2523000 microseconds), ((-1621986403,1,-2147483648),2491000 microseconds), ((-1621986403,-1479896219,-2147483648),2489000 microseconds), ((-1621986403,-2094202283,-2147483648),2421000 microseconds), ((-1621986403,-718526679,-2147483648),2345000 microseconds), ((-1621986403,1851380718,-2147483648),2319000 microseconds), ((-1621986403,0,-2147483648),2242000 microseconds), ((-1621986403,1788477130,-2147483648),2186000 microseconds), ((-1621986403,-877407511,-2147483648),2179000 microseconds), ((-1621986403,-2147483648,-2147483648),2165000 microseconds), ((-1574131144,-2147483648,-2147483648),2134000 microseconds),                                                               ((-1506504239,2147483647,-2147483648),2092000 microseconds), ((-534401639,2147483647,-2147483648),2056000 microseconds), ((1213720406,2147483647,-2147483648),2054000 microseconds), ((1213720406,-1206160175,-2147483648),2038000 microseconds), ((1213720406,0,-2147483648),1997000 microseconds), ((-141308714,0,-2147483648),1972000 microseconds), ((-141308714,0,-2147483648),1939000 microseconds), ((-1,0,-2147483648),1913000 microseconds), ((-1,0,-1),1907000 microseconds), ((1217503452,0,-1),1881000 microseconds), ((1217503452,1,-1),1839000 microseconds), ((-1,1,-1),1833000 microseconds), ((-1,1,0),1805000 microseconds), ((-1,0,0),1800000 microseconds), ((-1,0,2147483647),1787000 microseconds), ((0,0,2147483647),1783000 microseconds), ((0,0,1018250182),1769000 microseconds), ((0,0,685989688),1757000 microseconds), ((0,1,685989688),1746000 microseconds), ((0,1,685989688),1714000 microseconds), ((0,1,1932462790),1713000 microseconds), ((-1990983534,1,1932462790),1699000 microseconds), ((-1990983534,1121846581,1932462790),1690000 microseconds), ((-1990983534,2069202401,1932462790),1689000 microseconds), ((-1990983534,-1070810317,1932462790),1658000 microseconds), ((-2147483648,-1070810317,1932462790),1648000 microseconds), ((-2147483648,-1070810317,-1),1647000 microseconds), ((-692201763,-1070810317,-1),1600000 microseconds), ((-692201763,-2147483648,-1),1591000 microseconds), ((-1966737612,-2147483648,-1),1584000 microseconds), ((-1966737612,-2147483648,2147483647),1578000 microseconds), ((-1966737612,-2147483648,-1804271564),1536000 microseconds), ((-1966737612,157573162,-1804271564),1529000 microseconds), ((1,157573162,-1804271564),1513000 microseconds), ((1,157573162,-1804271564),1494000 microseconds), ((1,157573162,-1361725227),1479000 microseconds), ((1,1870092692,-1361725227),1445000 microseconds), ((1,2147483647,-1361725227),1436000 microseconds), ((-1877369550,2147483647,-1361725227),1433000 microseconds), ((-1877369550,2147483647,-1),1417000 microseconds), ((-2147483648,2147483647,-1),1409000 microseconds), ((-2147483648,-1,-1),1383000 microseconds), ((-2147483648,2147483647,-1),1380000 microseconds), ((-2147483648,2147483647,-2147483648),1355000 microseconds), ((1,2147483647,-2147483648),1350000 microseconds), ((1,-1398817111,-2147483648),1347000 microseconds), ((1,-1398817111,-1050966210),1346000 microseconds), ((1,1,-1050966210),1338000 microseconds), ((1,1,-860366289),1324000 microseconds), ((1,1,1),1313000 microseconds), ((2042976395,1,1),1309000 microseconds), ((2042976395,1,2147483647),1287000 microseconds), ((2042976395,951899633,2147483647),1282000 microseconds), ((2042976395,951899633,0),1257000 microseconds), ((-2147483648,951899633,0),1255000 microseconds), ((2147483647,951899633,0),1242000 microseconds), ((2147483647,0,0),1227000 microseconds), ((2147483647,-521933085,0),1224000 microseconds),                                                  ((838972968,-521933085,0),1162000 microseconds), ((838972968,389086021,0),1146000 microseconds), ((838972968,389086021,-2147483648),1142000 microseconds), ((2038026361,389086021,-2147483648),1111000 microseconds), ((2038026361,-870634785,-2147483648),1091000 microseconds), ((-2147483648,-870634785,-2147483648),1080000 microseconds), ((-2147483648,-311853872,-2147483648),1070000 microseconds), ((-2147483648,-311853872,893625201),1026000 microseconds), ((0,-311853872,893625201),1021000 microseconds), ((0,-311853872,-2147483648),1011000 microseconds), ((0,1,-2147483648),1010000 microseconds), ((0,1,931658760),984000 microseconds), ((-821700185,1,931658760),976000 microseconds), ((-821700185,1,-2147483648),975000 microseconds), ((-821700185,2147483647,-2147483648),925000 microseconds), ((-1144724629,2147483647,-2147483648),901000 microseconds), ((-1144724629,2147483647,1),899000 microseconds), ((-1589988534,2147483647,1),884000 microseconds), ((-1589988534,-1085088996,1),870000 microseconds), ((-1589988534,-1085088996,-646984866),868000 microseconds), ((2028148422,-1085088996,-646984866),864000 microseconds), ((2028148422,-1085088996,461235502),826000 microseconds), ((-2147483648,-1085088996,461235502),822000 microseconds), ((-2147483648,-1,461235502),803000 microseconds), ((-2147483648,1,461235502),802000 microseconds), ((962913626,1,461235502),779000 microseconds), ((962913626,1,2147483647),736000 microseconds), ((-289516847,1,2147483647),732000 microseconds), ((-289516847,245014570,2147483647),724000 microseconds), ((-289516847,245014570,2147483647),672000 microseconds), ((1757127550,245014570,2147483647),649000 microseconds), ((1757127550,0,2147483647),644000 microseconds), ((1757127550,0,-1557311587),622000 microseconds), ((2147483647,0,-1557311587),593000 microseconds),                                          ((0,290427626,-1557311587),579000 microseconds), ((0,290427626,927027941),562000 microseconds), ((-2147483648,290427626,927027941),547000 microseconds), ((-2147483648,-1,927027941),528000 microseconds), ((-2147483648,0,927027941),508000 microseconds), ((-1055972225,0,927027941),495000 microseconds), ((-1055972225,0,-384661941),474000 microseconds), ((-1055972225,-2147483648,-384661941),435000 microseconds),                                                   ((1,-2147483648,2147483647),422000 microseconds), ((710640436,-2147483648,2147483647),392000 microseconds), ((2147483647,-1,2147483647),382000 microseconds), ((2147483647,-1,1),346000 microseconds), ((2147483647,-1,-2147483648),344000 microseconds), ((2147483647,-2147483648,-2147483648),314000 microseconds), ((2147483647,-2147483648,-2147483648),305000 microseconds), ((-382203877,-2147483648,-2147483648),288000 microseconds), ((-382203877,-2147483648,2147483647),271000 microseconds), ((-382203877,1143050587,2147483647),261000 microseconds), ((-1208372270,1143050587,2147483647),246000 microseconds), ((475596510,1143050587,2147483647),243000 microseconds), ((475596510,1143050587,0),225000 microseconds), ((1,1143050587,0),205000 microseconds), ((98812078,1143050587,0),190000 microseconds), ((98812078,-1,0),182000 microseconds), ((98812078,-1,0),181000 microseconds), ((98812078,0,0),167000 microseconds), ((98812078,0,0),143000 microseconds), ((98812078,-1758610128,0),124000 microseconds), ((-1,-1758610128,0),92000 microseconds), ((-1,-1758610128,2147483647),86000 microseconds), ((-1,2147483647,2147483647),70000 microseconds), ((-860052968,2147483647,2147483647),16000 microseconds), ((-860052968,-963552036,2147483647),11000 microseconds), ((-860052968,-963552036,0),0 microseconds))
DEBUG RAW: Succeeded: List(((-1621986403,0,-2147483648),2750000 microseconds), ((-1621986403,-2147483648,-2147483648),2725000 microseconds), ((-1621986403,-649589926,-2147483648),2713000 microseconds), ((-1621986403,-1621908666,-2147483648),2701000 microseconds), ((-1621986403,-1,-2147483648),2618000 microseconds), ((-1621986403,1,-2147483648),2607000 microseconds), ((-1621986403,-1,-2147483648),2523000 microseconds), ((-1621986403,1,-2147483648),2491000 microseconds), ((-1621986403,-1479896219,-2147483648),2489000 microseconds), ((-1621986403,-2094202283,-2147483648),2421000 microseconds), ((-1621986403,-718526679,-2147483648),2345000 microseconds), ((-1621986403,1851380718,-2147483648),2319000 microseconds), ((-1621986403,0,-2147483648),2242000 microseconds), ((-1621986403,1788477130,-2147483648),2186000 microseconds), ((-1621986403,-877407511,-2147483648),2179000 microseconds), ((-1621986403,-2147483648,-2147483648),2165000 microseconds), ((-1506504239,-2147483648,-2147483648),2134000 microseconds), ((-1574131144,-2147483648,-2147483648),2134000 microseconds), ((-1506504239,2147483647,-2147483648),2092000 microseconds), ((-534401639,2147483647,-2147483648),2056000 microseconds), ((1213720406,2147483647,-2147483648),2054000 microseconds), ((1213720406,-1206160175,-2147483648),2038000 microseconds), ((1213720406,0,-2147483648),1997000 microseconds), ((-141308714,0,-2147483648),1972000 microseconds), ((-141308714,0,-2147483648),1939000 microseconds), ((-1,0,-2147483648),1913000 microseconds), ((-1,0,-1),1907000 microseconds), ((1217503452,0,-1),1881000 microseconds), ((1217503452,1,-1),1839000 microseconds), ((-1,1,-1),1833000 microseconds), ((-1,1,0),1805000 microseconds), ((-1,0,0),1800000 microseconds), ((-1,0,2147483647),1787000 microseconds), ((0,0,2147483647),1783000 microseconds), ((0,0,1018250182),1769000 microseconds), ((0,0,685989688),1757000 microseconds), ((0,1,685989688),1746000 microseconds), ((0,1,685989688),1714000 microseconds), ((0,1,1932462790),1713000 microseconds), ((-1990983534,1,1932462790),1699000 microseconds), ((-1990983534,1121846581,1932462790),1690000 microseconds), ((-1990983534,2069202401,1932462790),1689000 microseconds), ((-1990983534,-1070810317,1932462790),1658000 microseconds), ((-2147483648,-1070810317,1932462790),1648000 microseconds), ((-2147483648,-1070810317,-1),1647000 microseconds), ((-692201763,-1070810317,-1),1600000 microseconds), ((-692201763,-2147483648,-1),1591000 microseconds), ((-1966737612,-2147483648,-1),1584000 microseconds), ((-1966737612,-2147483648,2147483647),1578000 microseconds), ((-1966737612,-2147483648,-1804271564),1536000 microseconds), ((-1966737612,157573162,-1804271564),1529000 microseconds), ((1,157573162,-1804271564),1513000 microseconds), ((1,157573162,-1804271564),1494000 microseconds), ((1,157573162,-1361725227),1479000 microseconds), ((1,1870092692,-1361725227),1445000 microseconds), ((1,2147483647,-1361725227),1436000 microseconds), ((-1877369550,2147483647,-1361725227),1433000 microseconds), ((-1877369550,2147483647,-1),1417000 microseconds), ((-2147483648,2147483647,-1),1409000 microseconds), ((-2147483648,-1,-1),1383000 microseconds), ((-2147483648,2147483647,-1),1380000 microseconds), ((-2147483648,2147483647,-2147483648),1355000 microseconds), ((1,2147483647,-2147483648),1350000 microseconds), ((1,-1398817111,-2147483648),1347000 microseconds), ((1,-1398817111,-1050966210),1346000 microseconds), ((1,1,-1050966210),1338000 microseconds), ((1,1,-860366289),1324000 microseconds), ((1,1,1),1313000 microseconds), ((2042976395,1,1),1309000 microseconds), ((2042976395,1,2147483647),1287000 microseconds), ((2042976395,951899633,2147483647),1282000 microseconds), ((2042976395,951899633,0),1257000 microseconds), ((-2147483648,951899633,0),1255000 microseconds), ((2147483647,951899633,0),1242000 microseconds), ((2147483647,0,0),1227000 microseconds), ((2147483647,-521933085,0),1224000 microseconds), ((838972968,-521933085,0),1224000 microseconds), ((838972968,-521933085,0),1162000 microseconds), ((838972968,389086021,0),1146000 microseconds), ((838972968,389086021,-2147483648),1142000 microseconds), ((2038026361,389086021,-2147483648),1111000 microseconds), ((2038026361,-870634785,-2147483648),1091000 microseconds), ((-2147483648,-870634785,-2147483648),1080000 microseconds), ((-2147483648,-311853872,-2147483648),1070000 microseconds), ((-2147483648,-311853872,893625201),1026000 microseconds), ((0,-311853872,893625201),1021000 microseconds), ((0,-311853872,-2147483648),1011000 microseconds), ((0,1,-2147483648),1010000 microseconds), ((0,1,931658760),984000 microseconds), ((-821700185,1,931658760),976000 microseconds), ((-821700185,1,-2147483648),975000 microseconds), ((-821700185,2147483647,-2147483648),925000 microseconds), ((-1144724629,2147483647,-2147483648),901000 microseconds), ((-1144724629,2147483647,1),899000 microseconds), ((-1589988534,2147483647,1),884000 microseconds), ((-1589988534,-1085088996,1),870000 microseconds), ((-1589988534,-1085088996,-646984866),868000 microseconds), ((2028148422,-1085088996,-646984866),864000 microseconds), ((2028148422,-1085088996,461235502),826000 microseconds), ((-2147483648,-1085088996,461235502),822000 microseconds), ((-2147483648,-1,461235502),803000 microseconds), ((-2147483648,1,461235502),802000 microseconds), ((962913626,1,461235502),779000 microseconds), ((962913626,1,2147483647),736000 microseconds), ((-289516847,1,2147483647),732000 microseconds), ((-289516847,245014570,2147483647),724000 microseconds), ((-289516847,245014570,2147483647),672000 microseconds), ((1757127550,245014570,2147483647),649000 microseconds), ((1757127550,0,2147483647),644000 microseconds), ((1757127550,0,-1557311587),622000 microseconds), ((2147483647,0,-1557311587),593000 microseconds), ((0,0,-1557311587),593000 microseconds), ((0,290427626,-1557311587),579000 microseconds), ((0,290427626,927027941),562000 microseconds), ((-2147483648,290427626,927027941),547000 microseconds), ((-2147483648,-1,927027941),528000 microseconds), ((-2147483648,0,927027941),508000 microseconds), ((-1055972225,0,927027941),495000 microseconds), ((-1055972225,0,-384661941),474000 microseconds), ((-1055972225,-2147483648,-384661941),435000 microseconds), ((1,-2147483648,-384661941),435000 microseconds), ((1,-2147483648,2147483647),422000 microseconds), ((710640436,-2147483648,2147483647),392000 microseconds), ((2147483647,-1,2147483647),382000 microseconds), ((2147483647,-1,1),346000 microseconds), ((2147483647,-1,-2147483648),344000 microseconds), ((2147483647,-2147483648,-2147483648),314000 microseconds), ((2147483647,-2147483648,-2147483648),305000 microseconds), ((-382203877,-2147483648,-2147483648),288000 microseconds), ((-382203877,-2147483648,2147483647),271000 microseconds), ((-382203877,1143050587,2147483647),261000 microseconds), ((-1208372270,1143050587,2147483647),246000 microseconds), ((475596510,1143050587,2147483647),243000 microseconds), ((475596510,1143050587,0),225000 microseconds), ((1,1143050587,0),205000 microseconds), ((98812078,1143050587,0),190000 microseconds), ((98812078,-1,0),182000 microseconds), ((98812078,-1,0),181000 microseconds), ((98812078,0,0),167000 microseconds), ((98812078,0,0),143000 microseconds), ((98812078,-1758610128,0),124000 microseconds), ((-1,-1758610128,0),92000 microseconds), ((-1,-1758610128,2147483647),86000 microseconds), ((-1,2147483647,2147483647),70000 microseconds), ((-860052968,2147483647,2147483647),16000 microseconds), ((-860052968,-963552036,2147483647),11000 microseconds), ((-860052968,-963552036,0),0 microseconds))
DEBUG: Succeeded:     List(((-1621986403,0,-2147483648),2750000 microseconds), ((-1621986403,-2147483648,-2147483648),2725000 microseconds), ((-1621986403,-649589926,-2147483648),2713000 microseconds), ((-1621986403,-1621908666,-2147483648),2701000 microseconds), ((-1621986403,-1,-2147483648),2618000 microseconds), ((-1621986403,1,-2147483648),2607000 microseconds), ((-1621986403,-1,-2147483648),2523000 microseconds), ((-1621986403,1,-2147483648),2491000 microseconds), ((-1621986403,-1479896219,-2147483648),2489000 microseconds), ((-1621986403,-2094202283,-2147483648),2421000 microseconds), ((-1621986403,-718526679,-2147483648),2345000 microseconds), ((-1621986403,1851380718,-2147483648),2319000 microseconds), ((-1621986403,0,-2147483648),2242000 microseconds), ((-1621986403,1788477130,-2147483648),2186000 microseconds), ((-1621986403,-877407511,-2147483648),2179000 microseconds), ((-1621986403,-2147483648,-2147483648),2165000 microseconds), ((-1506504239,-2147483648,-2147483648),2134000 microseconds),                                                               ((-1506504239,2147483647,-2147483648),2092000 microseconds), ((-534401639,2147483647,-2147483648),2056000 microseconds), ((1213720406,2147483647,-2147483648),2054000 microseconds), ((1213720406,-1206160175,-2147483648),2038000 microseconds), ((1213720406,0,-2147483648),1997000 microseconds), ((-141308714,0,-2147483648),1972000 microseconds), ((-141308714,0,-2147483648),1939000 microseconds), ((-1,0,-2147483648),1913000 microseconds), ((-1,0,-1),1907000 microseconds), ((1217503452,0,-1),1881000 microseconds), ((1217503452,1,-1),1839000 microseconds), ((-1,1,-1),1833000 microseconds), ((-1,1,0),1805000 microseconds), ((-1,0,0),1800000 microseconds), ((-1,0,2147483647),1787000 microseconds), ((0,0,2147483647),1783000 microseconds), ((0,0,1018250182),1769000 microseconds), ((0,0,685989688),1757000 microseconds), ((0,1,685989688),1746000 microseconds), ((0,1,685989688),1714000 microseconds), ((0,1,1932462790),1713000 microseconds), ((-1990983534,1,1932462790),1699000 microseconds), ((-1990983534,1121846581,1932462790),1690000 microseconds), ((-1990983534,2069202401,1932462790),1689000 microseconds), ((-1990983534,-1070810317,1932462790),1658000 microseconds), ((-2147483648,-1070810317,1932462790),1648000 microseconds), ((-2147483648,-1070810317,-1),1647000 microseconds), ((-692201763,-1070810317,-1),1600000 microseconds), ((-692201763,-2147483648,-1),1591000 microseconds), ((-1966737612,-2147483648,-1),1584000 microseconds), ((-1966737612,-2147483648,2147483647),1578000 microseconds), ((-1966737612,-2147483648,-1804271564),1536000 microseconds), ((-1966737612,157573162,-1804271564),1529000 microseconds), ((1,157573162,-1804271564),1513000 microseconds), ((1,157573162,-1804271564),1494000 microseconds), ((1,157573162,-1361725227),1479000 microseconds), ((1,1870092692,-1361725227),1445000 microseconds), ((1,2147483647,-1361725227),1436000 microseconds), ((-1877369550,2147483647,-1361725227),1433000 microseconds), ((-1877369550,2147483647,-1),1417000 microseconds), ((-2147483648,2147483647,-1),1409000 microseconds), ((-2147483648,-1,-1),1383000 microseconds), ((-2147483648,2147483647,-1),1380000 microseconds), ((-2147483648,2147483647,-2147483648),1355000 microseconds), ((1,2147483647,-2147483648),1350000 microseconds), ((1,-1398817111,-2147483648),1347000 microseconds), ((1,-1398817111,-1050966210),1346000 microseconds), ((1,1,-1050966210),1338000 microseconds), ((1,1,-860366289),1324000 microseconds), ((1,1,1),1313000 microseconds), ((2042976395,1,1),1309000 microseconds), ((2042976395,1,2147483647),1287000 microseconds), ((2042976395,951899633,2147483647),1282000 microseconds), ((2042976395,951899633,0),1257000 microseconds), ((-2147483648,951899633,0),1255000 microseconds), ((2147483647,951899633,0),1242000 microseconds), ((2147483647,0,0),1227000 microseconds), ((2147483647,-521933085,0),1224000 microseconds),                                                  ((838972968,-521933085,0),1162000 microseconds), ((838972968,389086021,0),1146000 microseconds), ((838972968,389086021,-2147483648),1142000 microseconds), ((2038026361,389086021,-2147483648),1111000 microseconds), ((2038026361,-870634785,-2147483648),1091000 microseconds), ((-2147483648,-870634785,-2147483648),1080000 microseconds), ((-2147483648,-311853872,-2147483648),1070000 microseconds), ((-2147483648,-311853872,893625201),1026000 microseconds), ((0,-311853872,893625201),1021000 microseconds), ((0,-311853872,-2147483648),1011000 microseconds), ((0,1,-2147483648),1010000 microseconds), ((0,1,931658760),984000 microseconds), ((-821700185,1,931658760),976000 microseconds), ((-821700185,1,-2147483648),975000 microseconds), ((-821700185,2147483647,-2147483648),925000 microseconds), ((-1144724629,2147483647,-2147483648),901000 microseconds), ((-1144724629,2147483647,1),899000 microseconds), ((-1589988534,2147483647,1),884000 microseconds), ((-1589988534,-1085088996,1),870000 microseconds), ((-1589988534,-1085088996,-646984866),868000 microseconds), ((2028148422,-1085088996,-646984866),864000 microseconds), ((2028148422,-1085088996,461235502),826000 microseconds), ((-2147483648,-1085088996,461235502),822000 microseconds), ((-2147483648,-1,461235502),803000 microseconds), ((-2147483648,1,461235502),802000 microseconds), ((962913626,1,461235502),779000 microseconds), ((962913626,1,2147483647),736000 microseconds), ((-289516847,1,2147483647),732000 microseconds), ((-289516847,245014570,2147483647),724000 microseconds), ((-289516847,245014570,2147483647),672000 microseconds), ((1757127550,245014570,2147483647),649000 microseconds), ((1757127550,0,2147483647),644000 microseconds), ((1757127550,0,-1557311587),622000 microseconds), ((2147483647,0,-1557311587),593000 microseconds),                                          ((0,290427626,-1557311587),579000 microseconds), ((0,290427626,927027941),562000 microseconds), ((-2147483648,290427626,927027941),547000 microseconds), ((-2147483648,-1,927027941),528000 microseconds), ((-2147483648,0,927027941),508000 microseconds), ((-1055972225,0,927027941),495000 microseconds), ((-1055972225,0,-384661941),474000 microseconds), ((-1055972225,-2147483648,-384661941),435000 microseconds),                                                   ((1,-2147483648,2147483647),422000 microseconds), ((710640436,-2147483648,2147483647),392000 microseconds), ((2147483647,-1,2147483647),382000 microseconds), ((2147483647,-1,1),346000 microseconds), ((2147483647,-1,-2147483648),344000 microseconds), ((2147483647,-2147483648,-2147483648),314000 microseconds), ((2147483647,-2147483648,-2147483648),305000 microseconds), ((-382203877,-2147483648,-2147483648),288000 microseconds), ((-382203877,-2147483648,2147483647),271000 microseconds), ((-382203877,1143050587,2147483647),261000 microseconds), ((-1208372270,1143050587,2147483647),246000 microseconds), ((475596510,1143050587,2147483647),243000 microseconds), ((475596510,1143050587,0),225000 microseconds), ((1,1143050587,0),205000 microseconds), ((98812078,1143050587,0),190000 microseconds), ((98812078,-1,0),182000 microseconds), ((98812078,-1,0),181000 microseconds), ((98812078,0,0),167000 microseconds), ((98812078,0,0),143000 microseconds), ((98812078,-1758610128,0),124000 microseconds), ((-1,-1758610128,0),92000 microseconds), ((-1,-1758610128,2147483647),86000 microseconds), ((-1,2147483647,2147483647),70000 microseconds), ((-860052968,2147483647,2147483647),16000 microseconds), ((-860052968,-963552036,2147483647),11000 microseconds), ((-860052968,-963552036,0),0 microseconds))

The RAW lines show the resulting signal, before applying the distinctBy.

) *> ref.get.map(_.distinctBy(_._2))

The problem is in this portion:

((-1506504239,-2147483648,-2147483648),2134000 microseconds), ((-1574131144,-2147483648,-2147483648),2134000 microseconds), ((-1506504239,2147483647,-2147483648),2092000 microseconds)

What is alarming is that -1506504239 is correctly changing to -1574131144 but then changing back to -1506504239. I believe those events have somehow become swapped. This is theoretically possible because the events are logged in a Ref.

.evalMap(x => ref.update(x :: _))

So if somehow the Ref updates are running concurrently, they could non-deterministically be misordered.

Now, the question is why are two eval(...) running concurrently? Seems like an FS2 bug.

Anyway, I will put up a PR shortly to fix this. The test is a bit poorly-written; instead of using a Ref and fiber cancelation it should just use .compile.to(List) with stream interruption.

@armanbilge
Copy link
Owner Author

Oh, and there's still the CE bug (?) about the test runtime somehow being non-deterministic 🙃

@armanbilge
Copy link
Owner Author

Noooo still failing 😭 789da9c

==> X calico.frp.SignalSuite.Signal: monad (stack-unsafe).flatMap associativity  4.11s munit.FailException: /home/runner/work/calico/calico/frp/src/test/scala/calico/frp/SignalSuite.scala:97
96:  // it is stack-safe, but expensive to test
97:  checkAll("Signal", MonadTests[Signal[IO, _]].stackUnsafeMonad[Int, Int, Int])

Failing seed: 1UCR1D6DWjIZ4Ot_n7kbaCzNbWsxqK8C6WtlYtdcCkC=
You can reproduce this failure by adding the following override to your suite:

  override val scalaCheckInitialSeed = "1UCR1D6DWjIZ4Ot_n7kbaCzNbWsxqK8C6WtlYtdcCkC="

@armanbilge
Copy link
Owner Author

now a failure in monad (stack-unsafe).apply composition in ae9b83b

2023-05-13T01:47:47.8304216Z �[91m==> X �[0m�[91mcalico.frp.SignalSuite�[0m.�[91mmonad (stack-unsafe).apply composition�[0m  �[90m0.374s�[0m munit.FailException: /home/runner/work/calico/calico/frp/src/test/scala/calico/frp/SignalSuite.scala:103
2023-05-13T01:47:47.8304870Z 102:          "monad (stack-unsafe).semigroupal associativity").contains(id)
2023-05-13T01:47:47.8305263Z �[7m103:      then property(id)(prop)�[0m
2023-05-13T01:47:47.8305512Z 104:  }
2023-05-13T01:47:47.8305635Z 
2023-05-13T01:47:47.8305837Z Failing seed: ztQxmy1QlCNSvvO5Y24YoNzUq3ghYzpLm7bbgCt9kqG=
2023-05-13T01:47:47.8306271Z You can reproduce this failure by adding the following override to your suite:
2023-05-13T01:47:47.8306504Z 
2023-05-13T01:47:47.8306763Z   override def scalaCheckInitialSeed = "ztQxmy1QlCNSvvO5Y24YoNzUq3ghYzpLm7bbgCt9kqG="
2023-05-13T01:47:47.8307046Z 
2023-05-13T01:47:47.8307174Z Falsified after 19 passed tests.
2023-05-13T01:47:47.8307455Z > Labels of failing property: 
2023-05-13T01:47:47.8307793Z Expected: calico.frp.frp$package$$anon$1$$anon$2@44bced06
2023-05-13T01:47:47.8308143Z Received: calico.frp.frp$package$$anon$1$$anon$2@d828e06
2023-05-13T01:47:47.8308614Z > ARG_0: TestSignal(NonEmptyList((0 days,-401274601), (3 milliseconds,-1684850671)))
2023-05-13T01:47:47.8310465Z > ARG_1: TestSignal(NonEmptyList((0 days,org.scalacheck.GenArities$$Lambda$9360/0x000000080290f800@6babfa22), (15 milliseconds,org.scalacheck.GenArities$$Lambda$9360/0x000000080290f800@2fce15a), (23 milliseconds,org.scalacheck.GenArities$$Lambda$9360/0x000000080290f800@3c15277f), (24 milliseconds,org.scalacheck.GenArities$$Lambda$9360/0x000000080290f800@1e7b2e00), (32 milliseconds,org.scalacheck.GenArities$$Lambda$9360/0x000000080290f800@2a35bd07), (46 milliseconds,org.scalacheck.GenArities$$Lambda$9360/0x000000080290f800@4f267f2a), (63 milliseconds,org.scalacheck.GenArities$$Lambda$9360/0x000000080290f800@5a1d976e), (69 milliseconds,org.scalacheck.GenArities$$Lambda$9360/0x000000080290f800@1dd1a903), (83 milliseconds,org.scalacheck.GenArities$$Lambda$9360/0x000000080290f800@1a8bf23b), (94 milliseconds,org.scalacheck.GenArities$$Lambda$9360/0x000000080290f800@66a8116f), (108 milliseconds,org.scalacheck.GenArities$$Lambda$9360/0x000000080290f800@50385c33), (112 milliseconds,org.scalacheck.GenArities$$Lambda$9360/0x000000080290f800@40317e86)))
2023-05-13T01:47:47.8341412Z > ARG_2: TestSignal(NonEmptyList((0 days,org.scalacheck.GenArities$$Lambda$9360/0x000000080290f800@5ee5691), (15 milliseconds,org.scalacheck.GenArities$$Lambda$9360/0x000000080290f800@23eb1c2a), (22 milliseconds,org.scalacheck.GenArities$$Lambda$9360/0x000000080290f800@31a005a0), (38 milliseconds,org.scalacheck.GenArities$$Lambda$9360/0x000000080290f800@7a2e985c), (51 milliseconds,org.scalacheck.GenArities$$Lambda$9360/0x000000080290f800@d030356), (64 milliseconds,org.scalacheck.GenArities$$Lambda$9360/0x000000080290f800@76725490), (69 milliseconds,org.scalacheck.GenArities$$Lambda$9360/0x000000080290f800@474ec2fb), (86 milliseconds,org.scalacheck.GenArities$$Lambda$9360/0x000000080290f800@492c5e36), (92 milliseconds,org.scalacheck.GenArities$$Lambda$9360/0x000000080290f800@5ca0edf6), (97 milliseconds,org.scalacheck.GenArities$$Lambda$9360/0x000000080290f800@3812e426), (116 milliseconds,org.scalacheck.GenArities$$Lambda$9360/0x000000080290f800@97aa0c5), (124 milliseconds,org.scalacheck.GenArities$$Lambda$9360/0x000000080290f800@220c9232), (134 milliseconds,org.scalacheck.GenArities$$Lambda$9360/0x000000080290f800@799814d8), (137 milliseconds,org.scalacheck.GenArities$$Lambda$9360/0x000000080290f800@5604ec19), (156 milliseconds,org.scalacheck.GenArities$$Lambda$9360/0x000000080290f800@aa41294), (165 milliseconds,org.scalacheck.GenArities$$Lambda$9360/0x000000080290f800@4cff9cf0), (172 milliseconds,org.scalacheck.GenArities$$Lambda$9360/0x000000080290f800@75f87f63), (178 milliseconds,org.scalacheck.GenArities$$Lambda$9360/0x000000080290f800@4ed31e1), (190 milliseconds,org.scalacheck.GenArities$$Lambda$9360/0x000000080290f800@2e77b35a)))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants