Skip to content

redo HomotopyDensityDFG, creep change serialization approach#1231

Draft
dehann wants to merge 2 commits intodevelopfrom
26Q2/refac/amp15_alternate
Draft

redo HomotopyDensityDFG, creep change serialization approach#1231
dehann wants to merge 2 commits intodevelopfrom
26Q2/refac/amp15_alternate

Conversation

@dehann
Copy link
Copy Markdown
Member

@dehann dehann commented May 7, 2026

Alternative redo of -- creep change implementation of serialization:

At the time of writing, 1230 is good enough for AMP v0.15.0-alpha tests to pass. This redo is easiest path to make sure DFG serialization also works for new HomotopyDensityDFG (replaces StoredHomotopyBelief). Some detail on abstracts in new HomotopyRepr

@dehann dehann added this to the v0.29.0 milestone May 7, 2026
@@ -0,0 +1,163 @@


Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[JuliaFormatter] reported by reviewdog 🐶

Suggested change

@codecov
Copy link
Copy Markdown

codecov Bot commented May 7, 2026

Codecov Report

❌ Patch coverage is 94.44444% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 80.69%. Comparing base (9cb713e) to head (cd76754).
⚠️ Report is 1 commits behind head on develop.

Files with missing lines Patch % Lines
src/entities/HomotopyDensity.jl 94.44% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #1231      +/-   ##
===========================================
- Coverage    80.85%   80.69%   -0.17%     
===========================================
  Files           49       50       +1     
  Lines         2648     2657       +9     
===========================================
+ Hits          2141     2144       +3     
- Misses         507      513       +6     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Co-authored-by: Johannes Terblanche <Affie@users.noreply.github.com>
Comment thread src/Deprecated.jl
Comment on lines +2 to +3


Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[JuliaFormatter] reported by reviewdog 🐶

Suggested change

Comment thread src/Deprecated.jl
refBandwidths(state::State) = values(state.belief.trailing_details) # FIXME, unordered will be a problem
getTopologyKind(state::State) = state.belief.topologykind


Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[JuliaFormatter] reported by reviewdog 🐶

Suggested change

Comment thread src/Deprecated.jl
Comment on lines +17 to +30
showerr = true
ret = if f === :means
getfield(obj, :principal_elements)
elseif f === :shapes
getfield(obj, :principal_details)
elseif f === :bandwidths
getfield(obj, :trailing_details)
else
showerr = false
getfield(obj, f)
end

showerr && @error("HomotopyDensityDFG field access with $(f) is deprecated")
return ret
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
showerr = true
ret = if f === :means
getfield(obj, :principal_elements)
elseif f === :shapes
getfield(obj, :principal_details)
elseif f === :bandwidths
getfield(obj, :trailing_details)
else
showerr = false
getfield(obj, f)
end
showerr && @error("HomotopyDensityDFG field access with $(f) is deprecated")
return ret
showerr = true
ret = if f === :means
getfield(obj, :principal_elements)
elseif f === :shapes
getfield(obj, :principal_details)
elseif f === :bandwidths
getfield(obj, :trailing_details)
else
showerr = false
getfield(obj, f)
end
showerr && @error("HomotopyDensityDFG field access with $(f) is deprecated")
return ret

Comment thread src/Deprecated.jl
Comment on lines +34 to +44
showerr = true
ret = if f === :means
setfield!(obj, :principal_elements, val)
elseif f === :shapes
setfield!(obj, :principal_details, val)
elseif f === :bandwidths
setfield!(obj, :trailing_details, val)
else
showerr = false
setfield!(obj, f, val)
end
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
showerr = true
ret = if f === :means
setfield!(obj, :principal_elements, val)
elseif f === :shapes
setfield!(obj, :principal_details, val)
elseif f === :bandwidths
setfield!(obj, :trailing_details, val)
else
showerr = false
setfield!(obj, f, val)
end
showerr = true
ret = if f === :means
setfield!(obj, :principal_elements, val)
elseif f === :shapes
setfield!(obj, :principal_details, val)
elseif f === :bandwidths
setfield!(obj, :trailing_details, val)
else
showerr = false
setfield!(obj, f, val)
end

Comment thread src/Deprecated.jl
Comment on lines +46 to +47
showerr && @error("HomotopyDensityDFG field access with $(f) is deprecated")
return ret
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
showerr && @error("HomotopyDensityDFG field access with $(f) is deprecated")
return ret
showerr && @error("HomotopyDensityDFG field access with $(f) is deprecated")
return ret

end

@choosetype HomotopyDensityDFG resolveHomotopyDensityDFGType

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[JuliaFormatter] reported by reviewdog 🐶

Suggested change

Comment thread src/entities/State.jl
refBandwidth(state::State) = state.belief.bandwidths[1]
refBandwidths(state::State) = state.belief.bandwidths
getTopologyKind(state::State) = state.belief.topologykind

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[JuliaFormatter] reported by reviewdog 🐶

Suggested change

)
return dfg.solverParams
end

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[JuliaFormatter] reported by reviewdog 🐶

Suggested change

Comment thread src/services/compare.jl
refPoints(a) != refPoints(b) && @debug("val is not equal") === nothing && return false
refBandwidths(a) != refBandwidths(b) &&
TP = true
for (k,v) in refBandwidths(a)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
for (k,v) in refBandwidths(a)
for (k, v) in refBandwidths(a)

Comment thread src/services/compare.jl
Comment on lines +163 to 165
!TP &&
@debug("bw is not equal") === nothing &&
return false
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
!TP &&
@debug("bw is not equal") === nothing &&
return false
!TP && @debug("bw is not equal") === nothing && return false

@dehann dehann linked an issue May 7, 2026 that may be closed by this pull request
@dehann dehann removed their assignment May 7, 2026
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

Successfully merging this pull request may close these issues.

Avoid the Gaussian-only road

2 participants