quantified-uncertainty / squiggle

An estimation language
https://squiggle-language.com
MIT License
150 stars 23 forks source link

Truncate on discrete pointsets is broken #2518

Open berekuk opened 10 months ago

berekuk commented 10 months ago

https://www.squiggle-language.com/playground?v=dev#code=eNqrVkpJTUsszSlxzk9JVbJSSjFUsFXIrdAw1DHSMdaMyUsxQuYr6NoplBSV5iUnlqT6pKaVaBhpKtUCAJ4%2FE3E%3D

d1 = mx(1,2,3)
d2 = mx(1,2,3) -> truncateLeft(2)
Captura de pantalla 2023-11-10 a la(s) 22 07 32
OAGr commented 10 months ago

Good find!

berekuk commented 10 months ago

After looking more into the code, there are many parts around empty/non-empty pointsets that might be broken.

For example, truncate on continuous when there are no points left returns a bad error: https://www.squiggle-language.com/playground?v=dev#code=eNqrVkpJTUsszSlxzk9JVbJSCq7M1SvNy0zLL8rVMNYx0VTQtVMoKSrNS04sSfVJTSvRMNVUqgUA6AMRiA%3D%3D

I might fix it before I do other changes to pointsets because this is one of the parts that's easy to break by accident by bigger refactorings.