Re: [julia-users] Hard-to-debug deep inlining

2016-09-13 Thread Tim Wheeler
Yes, Julia 0.4
Great to hear that this is easier in 0.5!

-Other Tim

On Tuesday, September 13, 2016 at 9:49:38 AM UTC-7, Tim Holy wrote:
>
> Which version of julia? If you're not using 0.5, try it and you might be 
> pleased. 
>
> You can also launch `julia --inline=no`, which occasionally still remains 
> useful. 
>
> --Tim 
>
> On Tuesday, September 13, 2016 8:55:58 AM CDT Tim Wheeler wrote: 
> > Hi Julia Users, 
> > 
> > So I was looking at ConjugatePriors.jl and trying to resolve its 
> problems 
> > with respect to the latest Distributions.jl. As discussed in issue 11 
> > , testing 
> > ConjugatePriors after removing the REQUIRE bounds results in: 
> > 
> > MethodError: no method matching 
> > 
> _rand!(::Distributions.MvNormalCanon{PDMats.PDMat{Float64,Array{Float64,2}}, 
>
> > Array{Float64,1}}, 
> > ::Array{Float64,1}) on line 52 of conjugates_mvnormal.jl 
> > 
> > <
> https://github.com/JuliaStats/ConjugatePriors.jl/blob/master/test/conjugate 
> > s_mvnormal.jl#L52>. and line 25 of fallbacks.jl 
> > 
> > If you check that line you find the following: 
> > 
> > posterior_randmodel(pri, G::IncompleteFormulation, x) = complete(G, pri, 
> > posterior_rand(pri, G, x)) 
> > 
> > Okay, the problem isn't really there. The call to posterior_rand is 
> inlined 
> > (I assume), so it doesn't show up in the test stack trace. So we 
> manually 
> > go to: 
> > 
> > posterior_rand(pri, G::IncompleteFormulation, x) = 
> Base.rand(posterior_canon 
> > (pri, G, x)) 
> > 
> > 
> > This also isn't the problem, at least not directly. 
> > 
> > In fact, the also inlined call to posterior_canon(pri, G, x) works fine. 
> It 
> > returns an MvNormalCanon object and then Base.rand is called. 
> > 
> > This calls some inlined functions, which eventually call 
> > Base._rand!(MvNormalCanon, x::Vector), which leads to the problem, 
> namely 
> > that _rand!(MvNormalCannon, x::Matrix) is all that is defined. 
> > 
> > But why was that so hard to discover? Why does only line 25 of 
> fallbacks,jl 
> > show up in the error stack trace? Was there a better way to debug this? 
>
>
>

Re: [julia-users] Hard-to-debug deep inlining

2016-09-13 Thread Tim Holy
Which version of julia? If you're not using 0.5, try it and you might be 
pleased.

You can also launch `julia --inline=no`, which occasionally still remains 
useful.

--Tim

On Tuesday, September 13, 2016 8:55:58 AM CDT Tim Wheeler wrote:
> Hi Julia Users,
> 
> So I was looking at ConjugatePriors.jl and trying to resolve its problems
> with respect to the latest Distributions.jl. As discussed in issue 11
> , testing
> ConjugatePriors after removing the REQUIRE bounds results in:
> 
> MethodError: no method matching
> _rand!(::Distributions.MvNormalCanon{PDMats.PDMat{Float64,Array{Float64,2}},
> Array{Float64,1}},
> ::Array{Float64,1}) on line 52 of conjugates_mvnormal.jl
> 
>  s_mvnormal.jl#L52>. and line 25 of fallbacks.jl
> 
> If you check that line you find the following:
> 
> posterior_randmodel(pri, G::IncompleteFormulation, x) = complete(G, pri,
> posterior_rand(pri, G, x))
> 
> Okay, the problem isn't really there. The call to posterior_rand is inlined
> (I assume), so it doesn't show up in the test stack trace. So we manually
> go to:
> 
> posterior_rand(pri, G::IncompleteFormulation, x) = Base.rand(posterior_canon
> (pri, G, x))
> 
> 
> This also isn't the problem, at least not directly.
> 
> In fact, the also inlined call to posterior_canon(pri, G, x) works fine. It
> returns an MvNormalCanon object and then Base.rand is called.
> 
> This calls some inlined functions, which eventually call
> Base._rand!(MvNormalCanon, x::Vector), which leads to the problem, namely
> that _rand!(MvNormalCannon, x::Matrix) is all that is defined.
> 
> But why was that so hard to discover? Why does only line 25 of fallbacks,jl
> show up in the error stack trace? Was there a better way to debug this?




[julia-users] Hard-to-debug deep inlining

2016-09-13 Thread Tim Wheeler
Hi Julia Users,

So I was looking at ConjugatePriors.jl and trying to resolve its problems 
with respect to the latest Distributions.jl. As discussed in issue 11 
, testing 
ConjugatePriors after removing the REQUIRE bounds results in:

MethodError: no method matching 
_rand!(::Distributions.MvNormalCanon{PDMats.PDMat{Float64,Array{Float64,2}},Array{Float64,1}},
 
::Array{Float64,1}) on line 52 of conjugates_mvnormal.jl 
.
 
and line 25 of fallbacks.jl

If you check that line you find the following:

posterior_randmodel(pri, G::IncompleteFormulation, x) = complete(G, pri, 
posterior_rand(pri, G, x))

Okay, the problem isn't really there. The call to posterior_rand is inlined 
(I assume), so it doesn't show up in the test stack trace. So we manually 
go to:

posterior_rand(pri, G::IncompleteFormulation, x) = Base.rand(posterior_canon
(pri, G, x))


This also isn't the problem, at least not directly.

In fact, the also inlined call to posterior_canon(pri, G, x) works fine. It 
returns an MvNormalCanon object and then Base.rand is called.

This calls some inlined functions, which eventually call 
Base._rand!(MvNormalCanon, x::Vector), which leads to the problem, namely 
that _rand!(MvNormalCannon, x::Matrix) is all that is defined.

But why was that so hard to discover? Why does only line 25 of fallbacks,jl 
show up in the error stack trace? Was there a better way to debug this?