This repository was archived by the owner on May 12, 2026. It is now read-only.
Fix StructArrays 0.7 compatibility in WorkPrecisionSet#176
Merged
ChrisRackauckas merged 2 commits intoMar 20, 2026
Merged
Conversation
StructArrays 0.7 changed strip_params to require parameterized
NamedTuple{names} instead of bare NamedTuple. When converting error
Dicts to StructArrays via NamedTuple.(errors), Dict iteration order
is not guaranteed to be consistent across instances, which can cause
the element type to widen to bare NamedTuple — triggering a
MethodError in StructArrays 0.7.
Replace all StructArray(NamedTuple.(errors)) calls with a helper
that explicitly sorts keys to ensure consistent NamedTuple type
parameters.
Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
StructArrays 0.6 does not support fieldless NamedTuple types. The empty-dict case cannot occur in practice (error vectors always have entries with known keys), so remove the guard entirely. Verified: full test suite passes on both StructArrays 0.6.21 and 0.7.2. Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com> Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
strip_paramsto require parameterizedNamedTuple{names}instead of bareNamedTupleStructArray(NamedTuple.(errors))can produce bareNamedTupleelement types when Dict iteration order varies across instances (e.g. success vs failure code paths constructing error dicts differently)MethodError: no method matching strip_params(::Type{NamedTuple})whenWorkPrecisionSetcollects results from failed solvers_dicts_to_structarraythat sorts keys to ensure consistentNamedTupletype parametersContext
Observed in SciML/SciMLBenchmarks.jl#1470 (comment) when StructArrays was bumped from 0.6.21 → 0.7.2.
Test plan
Pkg.test()passes with StructArrays 0.7.2🤖 Generated with Claude Code