Skip to content

Refactor State and State Serialization#1207

Merged
Affie merged 9 commits intodevelopfrom
refac/state
Mar 5, 2026
Merged

Refactor State and State Serialization#1207
Affie merged 9 commits intodevelopfrom
refac/state

Conversation

@Affie
Copy link
Member

@Affie Affie commented Mar 4, 2026

No description provided.

@Affie Affie added serialization refactor breaking change standardization StateType The type of the state estimate in variables, eg. Pose2 This used to be called softtype (#603) State Variable State labels Mar 4, 2026
@Affie Affie added this to the v0.29.0 milestone Mar 4, 2026
@codecov
Copy link

codecov bot commented Mar 5, 2026

Codecov Report

❌ Patch coverage is 75.22124% with 28 lines in your changes missing coverage. Please review.
✅ Project coverage is 72.37%. Comparing base (cecb4ca) to head (4959003).
⚠️ Report is 1 commits behind head on develop.

Files with missing lines Patch % Lines
src/serialization/DFGStructStyles.jl 47.61% 11 Missing ⚠️
src/Deprecated.jl 46.15% 7 Missing ⚠️
src/entities/DFGVariable.jl 85.71% 6 Missing ⚠️
src/serialization/StateSerialization.jl 89.65% 3 Missing ⚠️
src/serialization/PackedSerialization.jl 0.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #1207      +/-   ##
===========================================
+ Coverage    72.05%   72.37%   +0.32%     
===========================================
  Files           37       37              
  Lines         2315     2360      +45     
===========================================
+ Hits          1668     1708      +40     
- Misses         647      652       +5     

☔ 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.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Refactors how variable state/belief data is represented and serialized, moving from legacy State.val/State.bw-style storage to a unified BeliefRepresentation that round-trips cleanly through JSON.

Changes:

  • Introduces BeliefRepresentation and embeds it into State for unified parametric/nonparametric belief storage and JSON serialization.
  • Updates serialization/deserialization helpers (StateSerialization, PackedSerialization, JSON style overrides) to support the new structures.
  • Updates and adds tests to validate variable/state/belief JSON round-trips and aligns existing graph tests with FactorDFG/new state APIs.

Reviewed changes

Copilot reviewed 15 out of 15 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
test/testSerializingVariables.jl Adds round-trip JSON tests for beliefs, states, and variables.
test/runtests.jl Includes the new serialization testset.
test/testBlocks.jl Updates tests to use FactorDFG and revises connectivityTestGraph plumbing.
test/consol_DataEntryBlobTests.jl Updates connectivityTestGraph call signature.
test/compareTests.jl Updates tests to use refPoints(...) instead of removed State.val.
test/GraphsDFGSummaryTypes.jl Refactors summary-type tests to construct from full variable/factor instances.
src/entities/DFGVariable.jl Adds BeliefRepresentation; refactors State and VariableDFG to use belief/statekind.
src/serialization/StateSerialization.jl Adds statekind lower/lift; updates old-state unpacking toward new belief representation.
src/serialization/DFGStructStyles.jl Adds JSON style hooks for StaticArrays/ArrayPartition.
src/serialization/PackedSerialization.jl Minor type signature tweak for resolveType.
src/services/CompareUtils.jl Updates state comparisons and skip logic to use belief fields.
src/services/CustomPrinting.jl Updates printing to use belief fields (points/bandwidth).
src/services/DFGVariable.jl Removes legacy getPoint/getCoordinates implementations.
src/DistributedFactorGraphs.jl Removes packState/unpackState from unstable function list.
src/Deprecated.jl Updates deprecation messaging and re-homes getPoint/getCoordinates as deprecated.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

@Affie Affie merged commit f1cea48 into develop Mar 5, 2026
6 checks passed
@Affie Affie deleted the refac/state branch March 5, 2026 14:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking change refactor serialization standardization State Variable State StateType The type of the state estimate in variables, eg. Pose2 This used to be called softtype (#603)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants