Zanie Blue
Zanie Blue
Can you share how you were running ty?
> I think I'd much prefer a hard exit when invoked on the CLI. I don't see a use case for setting an invalid VIRTUAL_ENV from the CLI and I'd...
@AlexWaygood moving that discussion to https://github.com/astral-sh/ty/issues/2044 Thanks for the details @joshzcold — we should definitely not have the server fail and can track that here. https://github.com/astral-sh/ruff/pull/22040 will resolve that.
Opening because https://github.com/astral-sh/ty/issues/2031 encounters this panic.
I just verified that https://github.com/astral-sh/ruff/pull/22052 and https://github.com/astral-sh/ruff/pull/22048 do not appear to help with this particular snippet. Here's the flamegraph (with those pull requests combined) https://share.firefox.dev/3KErPOX
The pattern seems to be ``` infer_all_argument_types → infer_and_check_argument_types::{{closure}} (try_narrow) → infer_call_expression → infer_all_argument_types (recursive) ``` Claude claims > When the type context is a union (52-element `CoreSchema`), it tries...
I pursued various caching approaches before attempting to fix the root cause of the explosion. I then had Claude look at a way to prevent the recursion and a patch...
I felt it was probably not appropriate, so I pursued avoiding redundant narrowing of repeated unions instead as an alternative. https://github.com/astral-sh/ruff/pull/22066 tracks ancestor unions to avoid recursive analysis. This still...
> But for the ty case, there's a good chance that we just won't find a local virtual environment at all, and carrying on in that case despite a broken...
But in contrast, for uv you said > it still seems like there's a pretty good chance that they meant to just install the thing into their local virtual environment...