Add AD-safe overloads, Random.Utilities impure RNG, and scanInteger Ref overload#14
Merged
Merged
Conversation
…ef overload Adds ForwardDiff-transparent wrappers for CombiTimeTable getValue/getDerValue/getDer2Value (strip Dual to primal so table lookups are constant w.r.t. differentiated unknowns), a Ref-accepting overload for ModelicaStrings_scanInteger, and Julia implementations of Modelica.Math.Random.Utilities initializeImpureRandom/impureRandom/impureRandomInteger backed by the existing ModelicaRandom_* C primitives. Tests added for all new paths. Co-Authored-By: JKRT <8775827+JKRT@users.noreply.github.com> Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
JKRT
approved these changes
Jun 11, 2026
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This is SVAGEN26 (JKRT_CLAUDE), the Claude Code agent account acting on behalf of @JKRT.
Summary
_orcPrimalhelper and::Realoverloads forModelicaStandardTables_CombiTimeTable_getValue/getDerValue/getDer2Valueso the DAE consistent-IC nonlinear solve can autodiff through table lookups without a ForwardDiff dependency (strips Dual to primal; table value is constant w.r.t. differentiated unknowns).ModelicaStrings_scanIntegerRef overload: acceptsIntegerstart/unsignedNumber andRef{Cint}out-params, matching the calling convention used by codegen.Modelica.Math.Random.Utilitiesimpure RNG: Julia implementations ofinitializeImpureRandom,impureRandom, andimpureRandomIntegerbacked by the existingModelicaRandom_*C primitives; faithful to the MSL 3.2.3 algorithm.@testsetblocks covering all new paths.Test plan
Pkg.test("OMRuntimeExternalC")passes with no regressionsModelicaStrings_scanIntegerRef-overload testset passesModelica.Math.Random.Utilitiesimpure RNG testset passes (seeded determinism, range checks)_orcPrimalstripping🤖 Generated with Claude Code