Skip to content

Commit e812006

Browse files
committed
fix test error
1 parent 434afd1 commit e812006

File tree

1 file changed

+15
-5
lines changed

1 file changed

+15
-5
lines changed

JuliaBUGS/test/model/frontier_cache_hmm.jl

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -106,24 +106,34 @@ using JuliaBUGS.Model:
106106
# Sanity: different orders should not change marginalized log-density
107107
env = smart_copy_evaluation_env(model.evaluation_env, model.mutable_symbols)
108108
params = Float64[]
109-
memo1 = Dict{Tuple{Int,Int,UInt64},Any}()
109+
# New marginalization uses parameter offsets/lengths and 2-tuple memo keys
110+
param_offsets = Dict{VarName,Int}()
111+
var_lengths = Dict{VarName,Int}()
112+
memo1 = Dict{Tuple{Int,UInt64},Any}()
110113
println("[FrontierCacheTest] Evaluating logp with interleaved order...");
111114
flush(stdout)
112115
logp1 = _marginalize_recursive(
113-
model, env, order_interleaved, params, 1, Dict{Any,Int}(), memo1, keys_interleaved
116+
model,
117+
env,
118+
order_interleaved,
119+
params,
120+
param_offsets,
121+
var_lengths,
122+
memo1,
123+
keys_interleaved,
114124
)
115125

116126
env2 = smart_copy_evaluation_env(model.evaluation_env, model.mutable_symbols)
117-
memo2 = Dict{Tuple{Int,Int,UInt64},Any}()
127+
memo2 = Dict{Tuple{Int,UInt64},Any}()
118128
println("[FrontierCacheTest] Evaluating logp with states-first order...");
119129
flush(stdout)
120130
logp2 = _marginalize_recursive(
121131
model,
122132
env2,
123133
order_states_first,
124134
params,
125-
1,
126-
Dict{Any,Int}(),
135+
param_offsets,
136+
var_lengths,
127137
memo2,
128138
keys_states_first,
129139
)

0 commit comments

Comments
 (0)