test: bound reconstructed magnetic flux balance by ULPs#484
Conversation
Compare the reconstructed connector flux balance against an absolute four-ULP bound derived from the simulated flux scale. Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
|
CI downgrade mapping: the job uses clean-main ModelingToolkitBase 1.0.0 and stops before |
|
CI docs mapping: the strict documentation job reports the unmodified clean-main example failures already isolated in #480/#481—ambiguous bare |
|
Hosted substantive checkpoint: the Julia LTS Core job passes |
|
All three hosted Core variants now agree: Julia 1.10, 1.12, and pre each pass |
Please ignore this PR until reviewed by @ChrisRackauckas.
Summary
Float64observables cancel bit-for-bit after two additions.Root cause and boundary
The connector equation remains symbolically exact, but ModelingToolkit's perfect-alias elimination changes which fluxes are solved directly and which are reconstructed as observables. The queried
Float64values therefore accumulate reconstruction and summation roundoff even though the physical balance is unchanged.The release boundary is ModelingToolkit 11.19 (passes) to 11.20 (fails). Companion-only controls pass with MTK 11.19 + MTKBase 1.29.1 and with MTK 11.19 + MTKTearing 1.12.1. On an otherwise identical Julia 1.12.6 / MTKBase 1.29.1 / MTKTearing 1.12.1 stack:
a4bf0bd37e, the parent of the alias-elimination change: 3/3 pass.c49d619f6c(feat: eliminate perfect aliases in favor of higher priority variables): 2/3, failing only the exact flux-balance equality.Older boundary checks also pass with MTKSL 2.21.1 / MTK 9.84, MTKSL 2.22.0 / MTK 10.32, and current MTKSL source with MTK 11.0, 11.15, 11.18, and 11.19. MTK 11.20 and current MTK 11.31 reproduce the one-ULP residual.
The observed maximum residual is
2.168404344971009e-19, exactlyeps(flux_scale), at a maximum flux scale of about1.72464e-3. It is unchanged withabstol = reltol = 1e-12and across Julia 1.10, 1.12, and 1.13 RC. The new ceiling is4 * eps(flux_scale), an absolute-only bound of about8.67e-19that covers three reconstructed values and two additions while remaining sensitive at roughly5e-16relative to the flux scale.Validation
test/magnetic.jl: 3/3 pass.test/magnetic.jl: 3/3 pass.test/magnetic.jl: 3/3 pass (after pre-existing stdlib package-image warnings).GROUP=Coreon current upstream:Core/magnetic.jlpasses 3/3; the run then stops at the separately bisected clean-mainCore/motor.jl_check_if_dde(::Vector{Equation}, ::PleaseImportDynamicQuantities, ...)error.git diff --check: pass.