v0.12.0 regression: evaluation time exponential in derived features referenced from untaken if branches
Maintainer thường phản hồi trong vòng 1 ngày
@devin-ai-integration đang làm issue này rồi.
Từ ngày 5/11/2026.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 25/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- go
- Lĩnh vực
- performance
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- Go
- Star
- 56
- Fork
- 17
- Merge trung bình
- 12 giờ 45 phút
- Pull request đã merge (30 ngày)
- 910
Chuẩn bị môi trường
- Có Dockerfile hoặc tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của Open-MBEE/OpenSysML
-
dependencies
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
Open-MBEE/OpenSysML#1951 · 3 bình luận · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
Open-MBEE/OpenSysML#2029 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement spec compliance
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 55/100
Open-MBEE/OpenSysML#2028 · 3 bình luận · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Java client: no member enumeration, no GetElementProperties, no instance pathsCó thể đã có người làm @devin-ai-integration đã nhận hôm nay. Đang mởenhancement
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 42/100
Open-MBEE/OpenSysML#2022 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của Open-MBEE/OpenSysML
Issue tương tự
-
book-layout.spec fails when the similar-books rail holds other projects' booksCó thể đã có người làm @praetorianer777 đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
praetorianer777/GoTome#373 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 80/100
-
/shutdown/ready can fail to return an HTTP response when readiness takes longer than the server write timeoutCó thể đã có người làm @floriankoch đã nhận hôm nay. Đang mởtriage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
envoyproxy/gateway#10562 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Adding an LDAP group reports every search failure as "LDAP Group DN is not found"Có thể đã có người làm @Daksha1611 đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
Maintainer thường phản hồi trong vòng 1 ngày