Skip to content
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 into
SciML:masterfrom
ChrisRackauckas-Claude:fix-structarrays-0.7-compat
Mar 20, 2026
Merged

Fix StructArrays 0.7 compatibility in WorkPrecisionSet#176
ChrisRackauckas merged 2 commits into
SciML:masterfrom
ChrisRackauckas-Claude:fix-structarrays-0.7-compat

Conversation

@ChrisRackauckas-Claude

Copy link
Copy Markdown
Contributor

Summary

  • StructArrays 0.7 changed strip_params to require parameterized NamedTuple{names} instead of bare NamedTuple
  • StructArray(NamedTuple.(errors)) can produce bare NamedTuple element types when Dict iteration order varies across instances (e.g. success vs failure code paths constructing error dicts differently)
  • This manifests as MethodError: no method matching strip_params(::Type{NamedTuple}) when WorkPrecisionSet collects results from failed solvers
  • Fix: replace all 4 call sites with a helper _dicts_to_structarray that sorts keys to ensure consistent NamedTuple type parameters

Context

Observed in SciML/SciMLBenchmarks.jl#1470 (comment) when StructArrays was bumped from 0.6.21 → 0.7.2.

Test plan

  • Full Pkg.test() passes with StructArrays 0.7.2

🤖 Generated with Claude Code

ChrisRackauckas and others added 2 commits March 20, 2026 06:30
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>
@ChrisRackauckas ChrisRackauckas merged commit 1cdca25 into SciML:master Mar 20, 2026
3 of 6 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants