Based on my analysis of the HVM3 codebase you provided, here are the potential weak points and bugs that could cause issues:
The code extensively uses unsafeInterleaveIO
in functions like collapseDupsAtLazy
and extractCoreAtLazy
. This creates thunks with non-deterministic evaluation order, which can lead to:
- Memory leaks if thunks retain large data structures
- Unpredictable resource usage patterns
- Potential race conditions in parallel contexts