Skip to content

feat: support runtime model index N in expressions and indexing#113

Merged
martinjrobins merged 3 commits intomainfrom
issue-112-N
Mar 8, 2026
Merged

feat: support runtime model index N in expressions and indexing#113
martinjrobins merged 3 commits intomainfrom
issue-112-N

Conversation

@martinjrobins
Copy link
Owner

@martinjrobins martinjrobins commented Mar 8, 2026

Summary

  • add reserved model index as a runtime scalar
  • extend integer-index expressions to support and allow only as a name
  • support in general expressions in LLVM and Cranelift codegen
  • add across compiler interfaces/call paths and preserve ordering of UInt args
  • add parser/discretiser/compiler tests, including failure for defining tensor

see #112

@martinjrobins
Copy link
Owner Author

need to change the API of the model_index param. Remove this from rhs, stop etc, and add it to SetInputsFunc. The model_index pass in here will be written to a global value in the codegen module, ready to be used during the other functions. So the API is (a) user sets the model index using set_inputs once, then (b) this is used in subsequent u0, rhs, stop etc functions.

So N is no longer time dependent, but is not input dependent

@martinjrobins martinjrobins merged commit d1f974f into main Mar 8, 2026
21 of 22 checks passed
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.

1 participant