tests/wasm size budget measures a different artifact when the stdlib snapshot is embedded

Đang mở
#2,058 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đá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
43/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
go
Lĩnh vực
build-system, testing

Hướng nghiên cứu

Start with tests/wasm and read TestWasmRuns/js/fits_the_engine_size_budget and fits_the_core_size_budget, then inspect internal/workspace/libs/snapshot_embedded.go and the go-gates CI job to see how the snapshot affects the measured binaries. Choose and implement one of the two proposed approaches, then verify the tests measure the same defined artifact consistently with or without a prior make build.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

tests/wasm (TestWasmRuns/js/fits_the_engine_size_budget, fits_the_core_size_budget) gzips whichever sysml-engine.wasm and sysml-core.wasm the tree builds and checks them against fixed budgets (9,400,000 and 7,300,000 bytes). The artifact it measures depends on state outside the test: when make stdlib-snapshot has run (every make build-* target runs it), internal/workspace/libs/snapshot_embedded.go embeds stdlib.snapshot (4,106,931 bytes) into both binaries; when it has not, package libs compiles without the embed. CI's go-gates job never generates the snapshot, so CI measures the smaller artifact, while a developer who ran make build before go test ./tests/wasm measures the larger one and can fail a gate CI passes.

Gzipped sizes measured in clean worktrees under go1.27.3:

Tree engine, no snapshot engine, snapshot core, no snapshot core, snapshot
develop 4464eedb78 — 9,387,717 — 7,289,686
a feature branch merged with that develop 7,750,091 9,402,589 5,649,507 7,302,134
the same branch two commits later 7,753,441 9,406,206 5,657,298 7,309,050

The engine budget's comment records 9,105,348 bytes on 2026-10-27, which is the with-snapshot size, so the budgets were calibrated against the artifact CI does not build. With the snapshot, develop is 12 KB under the engine budget and 10 KB under the core budget; an ordinary 18 KB of new semantics code crosses both. Without it, there is 1.6 MB of headroom and the budgets bound nothing.

Proposal, either of:

  1. The test builds the artifact it measures from a known state: it decides whether the snapshot is embedded (generating it with go generate ./internal/workspace/libs into a temporary copy, or building with the embed excluded) rather than inheriting whatever the tree holds, and the budgets are stated for that artifact.
  2. CI embeds the snapshot too, so the gate and the released binaries measure the same thing, and the budgets are re-stated with their date and the artifact they bound.

Until one of these lands, a budget failure after make build is not evidence that a change grew the engine; compare against develop built the same way.

Ngôn ngữ chính
Go
Star
56
Fork
17
Merge trung bình
12 giờ 50 phút
Pull request đã merge (30 ngày)
905

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. 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.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của Open-MBEE/OpenSysML

Tất cả issue của Open-MBEE/OpenSysML

Issue tương tự

Thêm issue về Go

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.