lampepfl / gears

A strawman for a low-level async library in Scala 3.
https://lampepfl.github.io/gears/
Apache License 2.0
256 stars 26 forks source link

Decouple Future initialization from its computation #109

Open mbovel opened 4 days ago

mbovel commented 4 days ago

A tentative to implement #108.

mbovel commented 4 days ago

test-native passed 3 out of 4 times. Seems to be a flaky issue:

Out of heap space cannot allocate more objects
    at _SM38scala.scalanative.runtime.ObjectArray$D5allociL37scala.scalanative.runtime.ObjectArrayEO
    at _SM33scala.collection.mutable.HashSet$D4fromL29scala.collection.IterableOnceL32scala.collection.mutable.HashSetEO
    at _SM33scala.collection.mutable.HashSet$D4fromL29scala.collection.IterableOnceL16java.lang.ObjectEO
    at _SM32scala.collection.IterableFactoryD5applyL30scala.collection.immutable.SeqL16java.lang.ObjectEO
    at _SM33scala.collection.mutable.HashSet$D5applyL30scala.collection.immutable.SeqL16java.lang.ObjectEO
    at _SM41scala.collection.IterableFactory$DelegateD5applyL30scala.collection.immutable.SeqL16java.lang.ObjectEO
    at _SM19gears.async.Future$D5applyL15scala.Function1L17gears.async.AsyncL17gears.async.AsyncL18gears.async.FutureEO
    at _SM10StressTestD39$init$$$anonfun$2$$anonfun$1$$anonfun$1L21scala.runtime.LongRefL35gears.async.Future$MutableCollectorL17gears.async.AsyncL24gears.async.Async$SourceL41java.util.concurrent.atomic.AtomicIntegerjuEpT10StressTest
    at _SM21StressTest$$Lambda$15D13apply$mcVJ$spjuEO
    at _SM38scala.runtime.java8.JFunction1$mcVJ$spD5applyL16java.lang.ObjectL16java.lang.ObjectEO
    at _SM39scala.collection.immutable.NumericRangeD7foreachL15scala.Function1uEO
    at _SM10StressTestD28$init$$$anonfun$2$$anonfun$1jjL17gears.async.AsyncuEPT10StressTest
    at _SM21StressTest$$Lambda$18D9applyVoidL16java.lang.ObjectuEO
    at _SM34scala.runtime.function.JProcedure1D5applyL16java.lang.ObjectL16java.lang.ObjectEO

https://github.com/lampepfl/gears/actions/runs/12015181811/job/33492689810?pr=109