Add numeric builtins#9600
Open
lukewilliamboswell wants to merge 42 commits into
Open
Conversation
The Windows parallel CLI runner gave each test an isolated ROC_CACHE_DIR / XDG_CACHE_HOME / ZIG_LOCAL_CACHE_DIR but left TEMP/TMP shared, so every concurrent `roc` child used one shared `%TEMP%/roc/<version>` tree. That shared tree plus roc's background temp-cleanup thread produced a non-deterministic interpreter-backend access violation (exit 139) on a random test each suite run; isolating the temp dir makes the runs hermetic and removes the flake (verified 20+ consecutive clean runs). This is a test-hermeticity fix. It does not change roc itself, and the underlying roc behavior under concurrent shared-temp use is being investigated separately. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Three Windows-specific fixes surfaced by `zig build minici`: - dev backend: float-to-int/f32 try conversions hand-placed the float `val` arg in XMM0 and passed the integer args through the CallBuilder starting at slot 0. That matches System V (separate int/float register files) but not Windows x64, where float and integer args share positional slots, so `target_bits` landed in the wrong register and arrived as garbage (overflowing `target_bits - 1` in the wrapper and corrupting the conversion's success flag -> spurious "number is out of range" crash). Route the float through the CallBuilder in argument order on x86-64; keep the manual V0 placement on aarch64 (AAPCS). - eval tests: add focused single-conversion regression tests for F32/F64 floor/ceiling/round-to-int so a regression in one conversion isn't masked by `and` short-circuiting in the compound tests. - dylib platform: a Windows DLL only exposes dllexport symbols, and a static host .lib linked into a DLL exports nothing unless its `export fn` API is marked dllexport. Build the dylib host with `-fdll-export-fns` so roc_run_app is exported (without leaking bundled compiler_rt), matching ELF/Mach-O export-all behavior. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
# Conflicts: # src/backend/dev/LirCodeGen.zig # src/builtins/dec.zig # test/snapshots/arrow_qualified_functions.md # test/snapshots/eval/file_import_both.md # test/snapshots/eval/list_join_with_custom.md # test/snapshots/eval/nominal_record_field_access.md # test/snapshots/match_expr/guards_1.md # test/snapshots/plume_package/Color.md # test/snapshots/type_app_multiple_args.md
# Conflicts: # test/snapshots/annotations.md # test/snapshots/arrow_qualified_functions.md # test/snapshots/eval/file_import_both.md # test/snapshots/eval/issue8773_polymorphic_opaque.md # test/snapshots/eval/issue8783_fold_recursive_opaque.md # test/snapshots/eval/issue8783_simple_for_match.md # test/snapshots/eval/nominal_record_field_access.md # test/snapshots/issue/inspect_open_union.md # test/snapshots/match_expr/guards_1.md # test/snapshots/multiline_string_complex.md # test/snapshots/nominal_type_origin_mismatch.md # test/snapshots/plume_package/Color.md # test/snapshots/question_in_expect_err_type_unbound.md # test/snapshots/question_in_expect_mixed_err_types.md # test/snapshots/static_dispatch/Adv.md # test/snapshots/static_dispatch/Basic.md # test/snapshots/static_dispatch/BasicNoAnno.md # test/snapshots/static_dispatch/MethodDispatch.md # test/snapshots/test_nested_instantiation_crash.md # test/snapshots/type_alias_simple.md # test/snapshots/type_app_multiple_args.md # test/snapshots/type_app_nested.md # test/snapshots/type_multiple_aliases.md
# Conflicts: # src/backend/dev/LirCodeGen.zig # src/build/roc/Builtin.roc # src/cli/main.zig # src/cli/targets/arm64musl/roc_default_platform.o # test/snapshots/match_expr/guards_1.md # test/snapshots/type_app_multiple_args.md
# Conflicts: # src/cli/main.zig
Collaborator
Author
|
I've discovered a number of low level things that still need to be implemented properly for LLVM specifically. |
# Conflicts: # src/backend/dev/LirCodeGen.zig # src/builtins/dev_wrappers.zig # test/snapshots/eval/issue8783_fold_recursive_opaque.md # test/snapshots/match_expr/guards_1.md # test/snapshots/multiline_string_complex.md # test/snapshots/nested_try_interpolation_recursive_dispatch.md # test/snapshots/plume_package/Color.md # test/snapshots/static_dispatch/MethodDispatch.md
Anton-4
reviewed
Jun 16, 2026
Collaborator
|
I'm looking at the snapshot change now, it's not a typical update, something is gone that should be there. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Validation