Skip to main content
Version: v0.7.0 beta

Compatibility Changes and Upgrade Guide

This document describes the compatibility changes and migration methods from v0.6.0 to v0.7.0.

Variable Order

In v0.7.0, the order of variables may change when generating code. It is recommended to access variables using the generated macro definitions, such as var[VAR_X], rather than directly using var[0] to access variables.

The order of variables can be confirmed by:

  1. Checking the generated macro definitions
  2. Setting option.verbose = True during code generation to see the order of variable definitions

Constraint Order

For general inequality constraints (general_inequality), v0.7.0 arranges the constraints in the following order when generating code (instead of the user-defined order):

  1. Hard constraints
  2. l1-relaxed soft constraints
  3. quadratic-relaxed soft constraints

For equality constraints, v0.7.0 may change the order of constraints when generating code.

The actual order of the constraints can be confirmed by:

  1. Checking the order of constraint definitions in the generated code, for example, if the model name is vehicle, you can search for vehicle_g in the generated code to see the order of constraint definitions
  2. Setting option.verbose = True during code generation to see the order of constraint definitions

Therefore, if users rely on a specific order of general inequality constraints in v0.6.0, such as:

  1. Defining custom external functions in a specific order
  2. Accessing constraint properties or results (e.g., dual variables) in the order of constraints in the code Then after upgrading to v0.7.0, the code needs to be modified according to the new constraint order to ensure correctness.

Hessian Matrix

In v0.7.0, the size of the Hessian matrix has changed from (nvar * (nvar + 1)) / 2 to nvar * nvar, and only the lower triangular part including the diagonal is stored (i.e., the values in the upper triangular part are not used), and it is stored in column-major order.

File UUID

For each model generation, v0.7.0 defines a uuid in the generated code (including both prob and solver code) to uniquely identify that generation, in order to check the consistency of prob and solver at runtime. Therefore, after upgrading to v0.7.0, you need to ensure that the prob and solver used at compile time and runtime are from the same generation, otherwise you will get a uuid mismatch error. For example, the following configurations will cause errors (either compile-time errors or runtime errors):

  • The same model is generated twice, but the prob from the first generation is used with the solver from the second generation
  • The same model is used in different deployment environments, sharing the same prob

QNX System Code Generation

In v0.7.0, when generating code for the QNX system, the version of the QNX system is distinguished, where:

  • qnx7-arm64-gcc corresponds to qnx-arm64-gcc in v0.6.0
  • qnx8-arm64-gcc is newly added to support qnx8