probcomp / Gen.jl

A general-purpose probabilistic programming system with programmable inference
https://gen.dev
Apache License 2.0
1.79k stars 160 forks source link

#512 - Fix missing addresses in discard during update #534

Closed yifr closed 3 months ago

yifr commented 3 months ago

@mlb2251 and I ran into a bug @fsaad described in #512. We tested his fix on our own example and it works! Let us know if there's anything more we need to do to get this merged. Thanks!

ztangent commented 3 months ago

Thanks for looking into this and making the PR! The fix looks good, I think we should just add a test case (e.g. the MWE that @fsaad gave in #512) in the tests for update, and then we can merge.

The tests for the dynamic DSL implementation of update can be found here:

https://github.com/probcomp/Gen.jl/blob/95c797f1331b1be22eb402ea029a2183cbe72344/test/dsl/dynamic_dsl.jl#L86-L184

yifr commented 3 months ago

Sorry for the delay! I added in @fsaad's suggested test in the update test suite. Let me know if it looks good, or needs any changes!

ztangent commented 3 months ago

Looks good to me!