Skip to content

fix: remove string-based run_model API from C runtime + update main.c to use runModelWithBuffers#766

Merged
chrispcampbell merged 6 commits intomainfrom
chris/302-c-api
Feb 4, 2026
Merged

fix: remove string-based run_model API from C runtime + update main.c to use runModelWithBuffers#766
chrispcampbell merged 6 commits intomainfrom
chris/302-c-api

Conversation

@chrispcampbell
Copy link
Contributor

@chrispcampbell chrispcampbell commented Jan 24, 2026

Fixes #302

@ToddFincannonEI: See issue for details. I don't know if you are relying on the string-based run_model API for EPS, but if you are, the changes to main.c demonstrate how to get the same behavior as before, so hopefully you could retrofit your code in a similar way. But let me know if any of this causes big problems for you.

I'm going to submit another PR shortly for changes that overlap slightly (adding parameters to runModelWithBuffers to support the "override constants" feature), so I suggest reviewing this one first. Once you approve both, I will merge this one first and will update the other to make the runModelWithBuffers changes consistent.

AI disclosure: I used Claude Code (Opus 4.5) to implement the first round of changes according to my detailed specification (recorded in the issue). I reviewed and edited the changes pretty heavily and rewrote the runModel[WithBuffers] docs for clarity.

Copy link
Collaborator

@ToddFincannonEI ToddFincannonEI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested this by generating the arrays sample model before and after the changes to see what it's emitting. I don't have comments on the code gen implementation. The approach taken here looks good to me. The sparse input array will be important for EPS. It should be a relatively straightforward modification to replace our string-based input with the double buffer.

@chrispcampbell chrispcampbell merged commit e031f08 into main Feb 4, 2026
6 checks passed
@chrispcampbell chrispcampbell deleted the chris/302-c-api branch February 4, 2026 21:33
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.

Revisit interface between JS runtime package and generated C model

2 participants