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

Non MGF calls in update algorithm #48

Open
georgematheos opened this issue Sep 1, 2021 · 1 comment
Open

Non MGF calls in update algorithm #48

georgematheos opened this issue Sep 1, 2021 · 1 comment

Comments

@georgematheos
Copy link
Owner

georgematheos commented Sep 1, 2021

I need to do a pass over the update algorithm to make sure that I understand how non MGF calls (in particular, calls to :abstract) are handled!

Currently, I have modified lookup_or_generate_during_world_update! by adding

    if no_val && !is_mgf_call(call)
        @assert addr(call) == _get_abstract_addr
        generate_value!(world, call, EmptyChoiceMap())
        return get_val(world, call)
    end

to silence a bug which was occurring when processing a new :abstract call in the GMM example.

I should return to this and understand whether this is the right solution (and if so convince myself that it won't have unintended side effects), or find a better one.

@georgematheos
Copy link
Owner Author

Update:
This is the commit where I implemented a fix for this: bb8657b#commitcomment-55919543

In the end, I changed the code snippet I mentioned above to

 if no_val || !is_new_lookup || !already_updated(world, call)
         update_or_generate!(world, call)
         if is_mgf_call(call)
             update_or_generate!(world, call)
         else
             # I have this assertion since I have in mind that this is the only place
             # where this could happen, but am not 100% sure, and I want to be alerted if
             # this turns out to be false.
             @assert no_val && addr(call) == _get_abstract_addr

             generate_value!(world, call, EmptyChoiceMap())
         end
     end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant