v0.12.0 regression: evaluation time exponential in derived features referenced from untaken if branches
Los mantenedores suelen responder en 1 día
@devin-ai-integration ya está trabajando en esto.
Desde el 4/11/2026.
- #1933 de @devin-ai-integration — abierto
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 25/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Estancado
- Stack tecnológico
- go
- Área
- performance
Línea de trabajo
Start by reviewing the v0.12.0 changelog entries about order-dependence marks and cycle detection, then trace evaluation of if operands declared as in expr in ControlFunctions. Reproduce with the supplied gen.py model and compare the expression-valued and plain-default feature timings. Done means untaken branches avoid exponential evaluation while preserving the reported results; linked pull request #1933 is already open.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Summary
In v0.12.0, evaluating a feature valued by an expression takes time exponential in the number of other expression-valued features referenced from untaken if branches. v0.11.0 evaluates the same model in constant time. The results are the same in both versions; only the time differs. No diagnostic is emitted, so a larger model just appears to hang.
Reproduction
gen.py writes N features a1..aN. Each ai picks another feature by an integer selector pi (default 0, so every branch is untaken):
import sys
n, target = int(sys.argv[1]), sys.argv[2] # target: "a" (expression-valued features) or "c" (plain defaults)
print(f"package R {{ private import ScalarValues::*; part def T {{")
for i in range(1, n + 1):
e = "false"
for j in range(n, 0, -1):
e = f"(if p{i} == {j} ? {target}{j} else {e})"
print(f" attribute p{i} : Integer default 0; attribute c{i} : Boolean default true;")
print(f" attribute a{i} : Boolean = {e};")
print("} part t : T; }")
python3 gen.py 9 a > r.sysml
sysml r.sysml -e '$::R::t.a1'
Timings (linux-amd64 release binaries, same machine)
| N | branches reference a_j — v0.11.0 |
branches reference a_j — v0.12.0 |
branches reference c_j — v0.12.0 |
|---|---|---|---|
| 7 | ~0.05 s | 0.17 s | 0.05 s |
| 8 | 0.05 s | 0.31 s | 0.05 s |
| 9 | 0.06 s | 2.71 s | 0.05 s |
| 10 | 0.07 s | 29.94 s | 0.05 s |
All runs print = false. Loading and validating r.sysml alone takes about 0.02 s, so the time is spent in evaluation.
Control experiments (N = 9, v0.12.0)
- Only
if, all branches untaken (the generator above): 2.8 s. This rules outor/andas the cause. - The same chain prefixed with
p1 == 0 or …, or withp1 != 0 and …: about 3 s each. - The same shape, but the branches reference plain
defaultfeaturesc_j, so there are no references between expression-valued features: 0.05 s. - A direct self-reference only (
a = true or a): 0.06 s.
So the slowdown needs untaken branches that reference other expression-valued features which, syntactically, form cycles. The cycles are never taken at run time.
Expected
ControlFunctions declares the branch operands of if, and, or and implies as in expr. Its doc describes these operands as "expressions whose evaluation is determined by another operand". An untaken branch should therefore not need to be evaluated. In any case, the cost should not grow exponentially with the size of the model, as it did not in v0.11.0.
Notes
The 0.12.0 changelog has two entries that may be related, though we have not confirmed either:
- expression-valued features now carry order-dependence marks "through features so valued in turn";
- "a cycle among such features is refused by the interpreter at the start".
We found this in a model with about 9 mutually referencing derived features. One evaluation went from 0.45 s in v0.11.0 to more than 90 s in v0.12.0, after which we stopped it. We have since rewritten that model with ref features, which v0.12.0 evaluates fast, so this is not blocking us. We are reporting it as a regression.
- Lenguaje dominante
- Go
- Estrellas
- 56
- Forks
- 17
- Merge medio
- 12 h 38 min
- PR fusionados (30 d)
- 903
Preparar el entorno
- Incluye un Dockerfile o un archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de Open-MBEE/OpenSysML
-
Definition of requirementsAbiertoquestion
Dificultad 2/5 1-3 horas Aptitud para principiantes 66/100
Open-MBEE/OpenSysML#1359 · 4 comentarios ·
Los mantenedores suelen responder en 1 día
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 20/100
Open-MBEE/OpenSysML#1938 · 2 comentarios · 1 reacción ·
Los mantenedores suelen responder en 1 día
-
Textual representation body is not reachable via apiPosiblemente ocupada @devin-ai-integration la tomó hace 1 día. Abiertobug spec compliance
Dificultad 4/5 3-5 días Aptitud para principiantes 35/100
Open-MBEE/OpenSysML#1916 · 1 comentario · 1 reacción ·
Los mantenedores suelen responder en 1 día
-
enhancement
Dificultad 5/5 Más de una semana Aptitud para principiantes 25/100
Open-MBEE/OpenSysML#1628 · 3 comentarios ·
Los mantenedores suelen responder en 1 día
-
spec compliance
Dificultad 4/5 3-5 días Aptitud para principiantes 48/100
Open-MBEE/OpenSysML#1576 · 3 comentarios ·
Los mantenedores suelen responder en 1 día
Todos los issues de Open-MBEE/OpenSysML
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
dragonflydb/dragonfly-operator#619 ·
Los mantenedores suelen responder en 2 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 67/100
cloudfoundry/bosh-bootloader#701 · 1 comentario ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
-
baremetal: private network check rejects offer-specific options (Private Network 10Gbps / 25Gbps)Posiblemente ocupada @lbarrosby la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
scaleway/terraform-provider-scaleway#4587 ·
Los mantenedores suelen responder en 1 día
-
blocked-needs-validation bug
Dificultad 1/5 Menos de una hora Aptitud para principiantes 78/100
projectcapsule/capsule#2280 ·
Los mantenedores suelen responder en 1 día