Skip to content

Use resizable arrays in heavy NB tests - #368

Merged
sjoelund merged 1 commit into
masterfrom
resizable-arrays
Oct 5, 2026
Merged

sjoelund merged 1 commit into
masterfrom
resizable-arrays

Conversation

@sjoelund

@sjoelund sjoelund commented Oct 5, 2026

Copy link
Copy Markdown
Member

Run all new backend tests in configs/heavy_tests.json with --newBackend --resizableArrays --simCodeScalarize=false.

The LargeTestSuite NB_simvec configuration only differed from NB by --simCodeScalarize=false, so it is now a duplicate and is removed.

Assisted-by: Claude Opus 5.5

Run all new backend tests in `configs/heavy_tests.json` with
`--newBackend --resizableArrays --simCodeScalarize=false`.

The LargeTestSuite `NB_simvec` configuration only differed from `NB`
by `--simCodeScalarize=false`, so it is now a duplicate and is removed.

Assisted-by: Claude Opus 5.5
@sjoelund
sjoelund merged commit b55eedc into master Oct 5, 2026
6 of 7 checks passed
@sjoelund
sjoelund deleted the resizable-arrays branch October 5, 2026 18:54
@casella

casella commented Oct 6, 2026

Copy link
Copy Markdown
Collaborator

As I said during today's devmeeting, adding --resizableArrays breaks some models in LargeTestSuite, so we are no longer testing them anymore. If these regressions are fixed in one/two weeks that's OK, otherwise I would keep two separate tests, one with and one without --resizableArrays

sjoelund added a commit to OpenModelica/OpenModelica that referenced this pull request Oct 7, 2026
With `--resizableArrays --simCodeScalarize=false` the new backend keeps
an array sized by an Integer parameter as one `SimVar` with a symbolic
dimension (`N`). The wasm-jit target failed every such model with
"non-integer array dimension N", which is what the heavy_tests_wasm
lane runs since OpenModelica/OpenModelicaLibraryTesting#368.

The sizes now stay symbolic until a run starts, as the C target's do
(#17077), so `-override=N=20` resizes a model translated once:

- `sim_meta::sizes::Sz`: integer polynomials over the size parameters.
  `Layout::build` is generic over the count type; the codegen builds the
  layout over `Sz`, `SimMeta::resolve_sizes` (from `apply_flags`, with
  the overrides) evaluates it into the `Layout` the driver uses.
- A resizable model keeps the regions of constant size first. Offsets
  past the first runtime-sized region are tagged with an entry of a size
  table at the end of `SimData` (pointer at offset 8); each generated
  function loads the entries it uses once, in its prologue, so an access
  stays `local.get; load offset=k`. Hosts write the table after
  allocating `SimData` (`driver::write_size_table`).
- Within each variable region the constant-size variables come first,
  then the runtime-sized arrays, one entry each in the slot tables,
  array groups and result variables (expanded once resolved).
- The ODE Jacobian's sparsity rows are kept symbolic
  (`sym_sparsity::SymPattern`) and expanded and coloured at runtime.
- Nonlinear systems whose unknowns include a runtime-sized array get
  their history, nominal and bounds blocks after the layout's end and a
  numerical Jacobian; their residual rows are counted at runtime.
- `variableFilter` of such a model is applied to the resolved variables.

Not yet runtime-sized: zero crossings and relations inside for-loops
(they use the backend's size for the translated N).

The 36 ScalableTestSuite_NB / LargeTestSuite_NB model families the C
lane simulates all simulate, with results matching the C target.

Assisted-by: Claude Opus 5.5
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.

2 participants