Skip to content

Chalk hang in Ajour #7796

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Tracked by #11387 ...
lnicola opened this issue Feb 27, 2021 · 10 comments
Closed
Tracked by #11387 ...

Chalk hang in Ajour #7796

lnicola opened this issue Feb 27, 2021 · 10 comments
Labels
A-ty type system / type inference / traits / method resolution Broken Window Bugs / technical debt to be addressed immediately C-bug Category: bug S-unactionable Issue requires feedback, design decisions or is blocked on other work

Comments

@lnicola
Copy link
Member

lnicola commented Feb 27, 2021

https://github.com/ajour/ajour/

Minimized code:

fn query_and_sort_catalog(addons: &[()]) {
    let mut catalog_rows_and_score = addons
        .iter()
        .filter_map(|a| Some((a, 0)))
        .filter(|(a, _)| true)
        .map(|(a, score)| (a, 0))
        .collect::<Vec<_>>();

    catalog_rows_and_score.sort_by(|(addon_a, score_a), (addon_b, score_b)| score_a.cmp(&score_b));
}

fn main() {}
@lnicola lnicola added A-ty type system / type inference / traits / method resolution S-actionable Someone could pick this issue up and work on it right now labels Feb 27, 2021
@lnicola
Copy link
Member Author

lnicola commented Feb 27, 2021

CC @detrumi you might want to take a look at this.

@detrumi
Copy link
Member

detrumi commented Feb 27, 2021

Chalk hangs on this goal:

solve_goal goal=UCanonical { canonical: Canonical { value: InEnvironment { environment: Env([]), goal: AliasEq(<{closure:ClosureId(3)}<[?0 := () for<0> [?0 := (&'static 2<[?0 := ^1.0, ?1 := (&'static ^1.1)]>), ?1 := (&'static 2<[?0 := ^1.2, ?1 := ^1.1]>), ?2 := Ordering<[]>]]> as FnOnce<2<[?0 := (&'static 2<[?0 := ^0.3, ?1 := ^0.4]>), ?1 := (&'static 2<[?0 := ^0.3, ?1 := ^0.4]>)]>>>::Output = Ordering<[]>) }, binders: [U0 with kind type, U0 with kind type, U0 with kind type, U0 with kind type, U0 with kind type] }, universes: 1 }

It then keeps on expanding:

goal: Normalize(<{closure:ClosureId(3)}<[?0 := () for<0> [?0 := (&'static 2<[?0 := ^1.0, ?1 := (&'^1.1 (&'^1.2 (&'^1.3 (&'^1.4 (&'^1.5 (&'^1.6 (&'^1.7 (&'^1.8 (&'^1.9 (&'^1.10 (&'^1.11 (&'^1.12 (&'^1.13 (&'^1.14 (&'^1.15 (&'^1.16 (&'^1.17 (&'^1.18 (&'^1.19 (&'^1.20 (&'^1.21 (&'^1.22 (&'^1.23 (&'^1.24 (&'^1.25 (&'^1.26 (&'^1.27 (&'^1.28 (&'^1.29 (&'^1.30 (&'^1.31 (&'^1.32 (&'^1.33 (&'^1.34 ^1.35))))))))))))))))))))))))))))))))))]>), ?1 := (&'static 2<[?0 := ^1.36, ?1 := (&'^1.2 (&'^1.3 (&'^1.4 (&'^1.5 (&'^1.6 (&'^1.7 (&'^1.8 (&'^1.9 (&'^1.10 (&'^1.11 (&'^1.12 (&'^1.13 (&'^1.14 (&'^1.15 (&'^1.16 (&'^1.17 (&'^1.18 (&'^1.19 (&'^1.20 (&'^1.21 (&'^1.22 (&'^1.23 (&'^1.24 (&'^1.25 (&'^1.26 (&'^1.27 (&'^1.28 (&'^1.29 (&'^1.30 (&'^1.31 (&'^1.32 (&'^1.33 (&'^1.34 ^1.37)))))))))))))))))))))))))))))))))]>), ?2 := Ordering<[]>]]> as FnOnce<2<[?0 := (&'static 2<[?0 := ^0.38, ?1 := (&'static (&'static (&'static (&'static (&'static (&'static (&'static (&'static (&'static (&'static (&'static (&'static (&'static (&'static (&'static (&'static (&'static (&'static (&'static (&'static (&'static (&'static (&'static (&'static (&'static (&'static (&'static (&'static (&'static (&'static (&'static (&'static (&'static ^0.39)))))))))))))))))))))))))))))))))]>), ?1 := (&'static 2<[?0 := ^0.38, ?1 := (&'static (&'static (&'static (&'static (&'static (&'static (&'static (&'static (&'static (&'static (&'static (&'static (&'static (&'static (&'static (&'static (&'static (&'static (&'static (&'static (&'static (&'static (&'static (&'static (&'static (&'static (&'static (&'static (&'static (&'static (&'static (&'static (&'static ^0.39)))))))))))))))))))))))))))))))))]>)]>>>::Output -> Ordering<[]>)

@lnicola lnicola added the Broken Window Bugs / technical debt to be addressed immediately label Apr 5, 2021
@lnicola lnicola added Broken Window Bugs / technical debt to be addressed immediately S-unactionable Issue requires feedback, design decisions or is blocked on other work and removed Broken Window Bugs / technical debt to be addressed immediately S-actionable Someone could pick this issue up and work on it right now labels Apr 12, 2021
@lnicola
Copy link
Member Author

lnicola commented Apr 12, 2021

Marking as "broken window" because it's a bad issue that can make people think RA doesn't work at all. Marking "unactionable" because we need to wait for a chalk fix.

@matklad
Copy link
Member

matklad commented Apr 24, 2021

@flodiebold IIRC, we use fuel for chalk, right? Is there perhaps some quick fix here to make this run out of fuel, rather than completely hang?

@flodiebold
Copy link
Member

The recursive solver doesn't support fuel, and IIRC it's kind of hard to implement there 🤔

@matklad
Copy link
Member

matklad commented Apr 24, 2021

Heh, this shows the depth of my knowledge about our current state of type inference. I had a vague feeling that something happened to chalk fuel...

@flodiebold
Copy link
Member

There were also the plans with making the recursive solver cacheable through Salsa, which I think would make fuel even harder (unless we implement it in Salsa? 🤔 )

@Veykril
Copy link
Member

Veykril commented Jan 30, 2023

The provided snippet no longer hangs, I assume fuel being re-added fixed this?
image

@Veykril Veykril closed this as completed Jan 30, 2023
@lnicola
Copy link
Member Author

lnicola commented Jan 30, 2023

I suspect a lot of these turned into type inference issues. But chalk is mostly abandoned so we can't do anything about it in the short/medium term.

@Veykril
Copy link
Member

Veykril commented Jan 30, 2023

anythings better than hangs though, and as these are mainly chalk issues they are out of our hands anyways. I don't think we gain much from having a bunch of them open.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-ty type system / type inference / traits / method resolution Broken Window Bugs / technical debt to be addressed immediately C-bug Category: bug S-unactionable Issue requires feedback, design decisions or is blocked on other work
Projects
None yet
Development

No branches or pull requests

5 participants