Skip to content

docs, test: review follow-ups to #1076 and #1077 - #1091

Merged
mparrett merged 5 commits into
mainfrom
wt/followups-1076-1077
Oct 28, 2026
Merged

mparrett merged 5 commits into
mainfrom
wt/followups-1076-1077

Conversation

@mparrett

Copy link
Copy Markdown
Collaborator

Two small asks from the reviews of #1076 and #1077, one commit each.

#1077, docs. With LETGO_USE_TINYGO=1 and -w-module, lg builds the tinygo arm's GOFLAGS from the environment variable and sets it. An environment GOFLAGS takes precedence over the go env file, so flags saved with go env -w drop out of that build. docs/guide/custom-lg.md now says so and tells users to export them instead.

#1076, tests. test/ir_mul_zero_test.lg now also checks (* x 0) on a ^long-hinted param and (* x 0.0), both under *ir-compile*. A ^long hint does not make x an Int: a double passed to it still comes back a double, which is why #1076 dropped the fold instead of guarding it on the type. The expected values match what bytecode returns for the same calls.

Verification

  • make test LG_TEST=ir_mul_zero passes.

🤖 Generated with Claude Code

mparrett and others added 2 commits October 21, 2026 20:54
…go env -w

lg builds the tinygo arm's GOFLAGS from the environment variable and
sets it, which takes precedence over the go env file, so flags saved
with go env -w drop out of that build. Follow-up to #1077.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…results

A ^long hint does not make x an Int, so a double still comes back a
double; a fold guarded on the hint would be as wrong as the one #1076
removed. Follow-up to #1076.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@mparrett
mparrett requested a review from nooga October 22, 2026 03:56

@mparrett mparrett left a comment •

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Self-check. No actionable findings.

The documentation accurately describes tinyGoBuildEnv: for a caller-module build it constructs GOFLAGS from the supplied environment and appends -mod=readonly, so flags saved only in the Go env file are superseded. The added strict IR tests cover both multiplication operand orders, a ^long parameter hint, and a floating zero, including NaN and signed zero. Comparing printed values correctly distinguishes -0.0 from 0.0 and avoids NaN equality pitfalls. No production behavior changes.

Validation at 31a141d: the ir_mul_zero suite passed 3 tests / 6 assertions; TestTinyGoBuildEnv passed all four subtests; docs_frontmatter_hook.py --check passed for the changed guide. Independently checked the expected output vectors through ordinary bytecode: ["0.0" "NaN" "-0.0" "0"] for a ^long-hinted parameter multiplied by integer zero, and ["0.0" "NaN" "-0.0" "0.0"] for multiplication by floating zero. Existing CI is green.

@nooga nooga left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Approving. The GOFLAGS note and the ^long/float-zero IR tests match bytecode behaviour.

@mparrett
mparrett merged commit 24891ac into main Oct 28, 2026
15 checks passed
@mparrett
mparrett deleted the wt/followups-1076-1077 branch October 28, 2026 07:07
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