Skip to content

Add JsonInputArchive overrides to XDRCereal#5130

Open
drebelsky wants to merge 2 commits intostellar:masterfrom
drebelsky:add-cereal-overrides
Open

Add JsonInputArchive overrides to XDRCereal#5130
drebelsky wants to merge 2 commits intostellar:masterfrom
drebelsky:add-cereal-overrides

Conversation

@drebelsky
Copy link
Contributor

@drebelsky drebelsky commented Feb 10, 2026

Resolves #5041. Note that the overrides are intentionally hidden behind BUILD_TESTS because we shouldn't use the input overrides on production code (we should store XDR as XDR, not our custom JSON overrides that break every so often). The overloads also don't get used anywhere else, but I think it's probably still worth having them + the tests in the repo, so we can quickly write an ad-hoc tool to parse core JSON if we need to again.

Testing notes
The tests right now are written to check that we can roundtrip 1000 random values of most of our XDR types. Unfortunately, due to the heavy template instantiation, compilation takes ~1 minute on my laptop. With the current configurable values (1000 random values per type, use 1 for levels for xdr::generator_t, limit the autocheck::arbitrary to generating things of at most size 10), the tests take about a minute to run. For reference, 1000 random values for type, limiting autocheck::arbitrary to 5, and using the xdrpp autocheck::generator override took ~17 seconds. Limiting the nesting depth is probably fine since we're checking the nested structures.

Alternatively, we could try roundtripping (by hand or generation) a subset of the particular overloads. This has the benefit of compiling faster. However, it also requires us to actively keep the tests up-to-date (the class list can be updated more intermittently, especially since including things like BucketEntry help gives provide coverage for future types).

There's also a basic set of unit tests that check that the overrides get called.

@drebelsky drebelsky force-pushed the add-cereal-overrides branch from ab727fc to 92f99fb Compare February 10, 2026 19:09
@drebelsky drebelsky marked this pull request as ready for review March 3, 2026 18:45
Copilot AI review requested due to automatic review settings March 3, 2026 18:45
Copy link
Contributor

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.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

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.

Make sure XDRCereal overrides roundtrip

2 participants