Skip to content

builder: match size tests to the CLI interpreter limit - #5975

Merged
deadprogram merged 1 commit into
tinygo-org:devfrom
davecheney:davecheney-size-test-interpreter-limit
Oct 24, 2026
Merged

deadprogram merged 1 commit into
tinygo-org:devfrom
davecheney:davecheney-size-test-interpreter-limit

Conversation

@davecheney

Copy link
Copy Markdown
Contributor

Commit 89d9e33 (interp: bail out of loops that iterate too many times) introduced a loop limit of 1000 for CLI builds. The size-test helper did not set the new option, so its limit remained zero.

Use the CLI default so size tests measure the same initialization code as normal builds.

@davecheney
davecheney requested a review from jakebailey October 21, 2026 03:12
@davecheney davecheney added this to the 0.44 milestone Oct 21, 2026
davecheney added a commit to davecheney/tinygo that referenced this pull request Oct 22, 2026
Recent changes that let interp move startup work to compile time did
not show up in TestBinarySize, so their savings went unmeasured and a
regression would go unnoticed. These samples cover the RP2 targets,
ESP32-C3, slice growth and os. Their sizes match on Go 1.25 to 1.27.

Run against the commits before and after each change, these rows show
(code/rodata bytes, opt=z):

- tinygo-org#5837 RP2 PLL: pico -1308/-548, pico2 -1128/-552 (opt=2 code -5 to
  -6 KB). Visible only with tinygo-org#5975.
- tinygo-org#5963 llvm.ctlz: pico -818/-142, pico2 -754/-142, size-slice -163/-5.
- tinygo-org#5973 os temp file seed: pico2 size-os -16 (opt=2 -32).
davecheney added a commit to davecheney/tinygo that referenced this pull request Oct 22, 2026
Recent changes that let interp move startup work to compile time did
not show up in TestBinarySize, so their savings went unmeasured and a
regression would go unnoticed. These samples cover the RP2 targets,
ESP32-C3, slice growth and os. Their sizes match on Go 1.25 to 1.27.

Run against the commits before and after each change, these rows show
(code/rodata bytes, opt=z):

- tinygo-org#5837 RP2 PLL: pico -1308/-548, pico2 -1128/-552 (opt=2 code -5 to
  -6 KB). Visible only with tinygo-org#5975.
- tinygo-org#5963 llvm.ctlz: pico -818/-142, pico2 -754/-142, size-slice -163/-5.
- tinygo-org#5973 os temp file seed: pico2 size-os -16 (opt=2 -32).
davecheney added a commit to davecheney/tinygo that referenced this pull request Oct 22, 2026
Recent changes that let interp move startup work to compile time did
not show up in TestBinarySize, so their savings went unmeasured and a
regression would go unnoticed. These samples cover the RP2 targets,
ESP32-C3, slice growth and os. Their sizes match on Go 1.25 to 1.27.

Run against the commits before and after each change, these rows show
(code/rodata bytes, opt=z):

- tinygo-org#5837 RP2 PLL: pico -1308/-548, pico2 -1128/-552 (opt=2 code -5 to
  -6 KB). Visible only with tinygo-org#5975.
- tinygo-org#5963 llvm.ctlz: pico -818/-142, pico2 -754/-142, size-slice -163/-5.
- tinygo-org#5973 os temp file seed: pico2 size-os -16 (opt=2 -32).
davecheney added a commit to davecheney/tinygo that referenced this pull request Oct 22, 2026
Recent changes that let interp move startup work to compile time did
not show up in TestBinarySize, so their savings went unmeasured and a
regression would go unnoticed. These samples cover the RP2 targets,
ESP32-C3, slice growth and os. Their sizes match on Go 1.25 to 1.27.

Run against the commits before and after each change, these rows show
(code/rodata bytes, opt=z):

- tinygo-org#5837 RP2 PLL: pico -1308/-548, pico2 -1128/-552 (opt=2 code -5 to
  -6 KB). Visible only with tinygo-org#5975.
- tinygo-org#5963 llvm.ctlz: pico -818/-142, pico2 -754/-142, size-slice -163/-5.
- tinygo-org#5973 os temp file seed: pico2 size-os -16 (opt=2 -32).
davecheney added a commit that referenced this pull request Oct 22, 2026
Recent changes that let interp move startup work to compile time did
not show up in TestBinarySize, so their savings went unmeasured and a
regression would go unnoticed. These samples cover the RP2 targets,
ESP32-C3, slice growth and os. Their sizes match on Go 1.25 to 1.27.

Run against the commits before and after each change, these rows show
(code/rodata bytes, opt=z):

- #5837 RP2 PLL: pico -1308/-548, pico2 -1128/-552 (opt=2 code -5 to
  -6 KB). Visible only with #5975.
- #5963 llvm.ctlz: pico -818/-142, pico2 -754/-142, size-slice -163/-5.
- #5973 os temp file seed: pico2 size-os -16 (opt=2 -32).
@davecheney

Copy link
Copy Markdown
Contributor Author

@deadprogram @jakebailey rebased, gentle ping

Commit 89d9e33 (interp: bail out of loops that iterate too many times) introduced a loop limit of 1000 for CLI builds. The size-test helper did not set the new option, so its limit remained zero.

Use the CLI default so size tests measure the same initialization code as normal builds.
@davecheney
davecheney force-pushed the davecheney-size-test-interpreter-limit branch from e390f0d to 6f9bc48 Compare October 24, 2026 02:19

@deadprogram deadprogram left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @davecheney now merging.

@deadprogram
deadprogram merged commit 9a1d2d7 into tinygo-org:dev Oct 24, 2026
31 checks passed
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