Stream: contributing

Topic: Rename Float a to Frac a


view this post on Zulip Mfon Eti-mfon (He/Him) (May 08 2022 at 13:09):

I'm working on this issue this weekend!

:fingers_crossed:

view this post on Zulip Richard Feldman (May 08 2022 at 13:30):

awesome, thank you! :smiley:

view this post on Zulip Richard Feldman (May 08 2022 at 13:30):

feel free to post here if you have any questions or run into any problems!

view this post on Zulip Mfon Eti-mfon (He/Him) (May 08 2022 at 13:32):

Thank you Richard.

view this post on Zulip Mfon Eti-mfon (He/Him) (May 08 2022 at 13:33):

So, running the tests (on trunk, without making any changes to the code myself) using cargo test, I get 25 failures.

And some changes are made to my working directory.

How do I proceed?

view this post on Zulip Folkert de Vries (May 08 2022 at 13:35):

I suspect these are "mono" tests?

view this post on Zulip Folkert de Vries (May 08 2022 at 13:35):

does that word show up in the output?

view this post on Zulip Mfon Eti-mfon (He/Him) (May 08 2022 at 13:40):

Yes, "mono" shows up in the output.

Here's a shortened trace of the output:

 procedure List.57 (#Attr.2, #Attr.3, #Attr.4):
-    let List.158 : U64 = lowlevel ListLen #Attr.2;
-    let List.156 : Int1 = lowlevel NumLt #Attr.3 List.158;
-    if List.156 then
-        let List.157 : {List I64, I64} = lowlevel ListReplaceUnsafe #Attr.2 #Attr.3 #Attr.4;
-        ret List.157;
+    let List.161 : U64 = lowlevel ListLen #Attr.2;
+    let List.159 : Int1 = lowlevel NumLt #Attr.3 List.161;
+    if List.159 then
+        let List.160 : {List I64, I64} = lowlevel ListReplaceUnsafe #Attr.2 #Attr.3 #Attr.4;
+        ret List.160;
     else
-        let List.155 : {List I64, I64} = Struct {#Attr.2, #Attr.4};
-        ret List.155;
+        let List.158 : {List I64, I64} = Struct {#Attr.2, #Attr.4};
+        ret List.158;

 procedure Test.1 (Test.2, Test.3, Test.4):
     let Test.29 : [C {}, C I64] = CallByName List.2 Test.4 Test.3;
@@ -48,8 +48,8 @@ procedure Test.1 (Test.2, Test.3, Test.4):
             let Test.18 : [C {}, C I64] = StructAtIndex 0 Test.13;
             let Test.6 : I64 = UnionAtIndex (Id 1) (Index 0) Test.18;
             let Test.17 : [C {}, C I64] = StructAtIndex 1 Test.13;
-            let Test.7 : I64 = UnionAtIndex (Id 1) (Index 0) Test.17;
-            let Test.15 : List I64 = CallByName List.3 Test.4 Test.2 Test.7;
+            let Test.8 : I64 = UnionAtIndex (Id 1) (Index 0) Test.17;
+            let Test.15 : List I64 = CallByName List.3 Test.4 Test.2 Test.8;
             let Test.14 : List I64 = CallByName List.3 Test.15 Test.3 Test.6;
             ret Test.14;
         else

thread 'rigids' panicked at 'Output changed: resolve conflicts and `git add` the file.', compiler/test_mono/src/tests.rs:190:9


failures:
    alias_variable
    closure_in_list
    empty_list_of_function_type
    ir_int_add
    ir_two_defs
    issue_2583_specialize_errors_behind_unified_branches
    let_x_in_x
    let_x_in_x_indirect
    list_append
    list_append_closure
    list_cannot_update_inplace
    list_get
    list_len
    list_pass_to_function
    monomorphized_applied_tag
    monomorphized_floats
    monomorphized_ints
    monomorphized_list
    monomorphized_tag
    monomorphized_tag_with_aliased_args
    nested_closure
    optional_when
    quicksort_swap
    record_optional_field_function_use_default
    rigids

test result: FAILED. 47 passed; 25 failed; 5 ignored; 0 measured; 0 filtered out; finished in 1.14s

error: test failed, to rerun pass '-p test_mono --test test_mono'

view this post on Zulip Folkert de Vries (May 08 2022 at 13:41):

cool, well that has nothing to do with your changes

view this post on Zulip Folkert de Vries (May 08 2022 at 13:42):

those tests are not checked by CI (for reasons) and sometimes they get out of sync

view this post on Zulip Folkert de Vries (May 08 2022 at 13:42):

so I think for now you can run cargo test --test solve_expr and if those keep working you should be mostly good

view this post on Zulip Folkert de Vries (May 08 2022 at 13:43):

cargo test --test test_reporting and cargo test-gen-llvm might also be good to check when solve_expr works

view this post on Zulip Folkert de Vries (May 08 2022 at 13:43):

bonus: narrowing down which tests you run makes them run much faster

view this post on Zulip Mfon Eti-mfon (He/Him) (May 08 2022 at 13:43):

Oh, yes, thank you. I've noticed it now. They're super fast! :grinning:

view this post on Zulip Mfon Eti-mfon (He/Him) (May 08 2022 at 15:22):

My first attempt gets stuck on the building phase when running tests.

@Folkert de Vries can you tell what is happening?

view this post on Zulip Folkert de Vries (May 08 2022 at 15:25):

yes

view this post on Zulip Folkert de Vries (May 08 2022 at 15:25):

what we do is bootstrapping: we use the compiler to build itself

view this post on Zulip Folkert de Vries (May 08 2022 at 15:25):

that is why you get an error during the build; really it's an error that is reported by the compiler

view this post on Zulip Folkert de Vries (May 08 2022 at 15:26):

I think the fix is to, in compiler/builtins/roc/Num.roc change Float range : Num (FloatingPoint range) to the Frac equivalent

view this post on Zulip Folkert de Vries (May 08 2022 at 15:27):

and also change all mentions of Float to Frac

view this post on Zulip Mfon Eti-mfon (He/Him) (May 08 2022 at 18:40):

PR ready. ish.

Do we want to rename all *float* functions to *frac* functions?


Last updated: Jul 06 2025 at 12:14 UTC