FluxML / FluxML/IRTools.jl

Dynamos possibly miss _apply_iterate?

Open
#74 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Julia
Stars
113
Forks
37
PR merge metrics
No merged PRs in 30d

Description

I've noticed that I'm missing some calls which I want to grab with my dynamo:

In particular, I have a `rand` call:
```julia
function execute_MA!(step::MentalAct,
tree::ActiveBehaviorTree,
env::Environment)
# Here.
ret = rand(:mental_computation, step.fn, tree.globals, env, step.args...)
println("Just finished a mental computation!")

par = parent(tree, step)
par.semantics.ret[step.uuid] = ret
tree.executing_actions[step.uuid] = Completed()
end
```
which I know gets turned into an `_apply_iterate`. I have logging setup for these calls, as well as a mechanism which let's me instantiate a new `HierarchicalTrace` and recurse in.
```julia
@inline function (tr::HierarchicalTrace)(fn::typeof(rand), addr::Address, call::Function, args...)
println("Randomness at $addr, call $call.")
n_tr = Trace()
ret = n_tr(call, args...)
tr.chm[addr] = CallSite(n_tr, call, args, ret)
return ret
end
```
but I never hit this call:
```
Randomness at step_arbiter, call step_arbiter.
Randomness at step_selection.
Randomness at execute_MA, call execute_MA!.
Just finished a mental computation!
```
I'm not sure how to hit this one?

This call occurs in another call (so it occurs in the `n_tr(call, args...)` - I'm not sure why that would matter.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the nested call through `n_tr(call, args...)` in the issue and inspect how `_apply_iterate` is represented or dispatched in IRTools.jl. Compare that path with the shown `HierarchicalTrace` handler for `rand`. Done means the nested `rand` call reaches the handler and the expected randomness log is produced.

Written by the indexing model from the issue text.

Assessment

Tech stack
julia
Domain
compilers
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.