FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Nondeterministic type checking on pytorch/vision · Issue #19121 · python/mypy · GitHub

Repository navigation

Nondeterministic type checking on pytorch/vision #19121

Description

Repro with e.g. mypy_primer --new 'v1.15' --old 'v1.15' -k vision --debug:

diff --git a/mypy_primer/projects.py b/mypy_primer/projects.py
index 09c050c..0309cff 100644
--- a/mypy_primer/projects.py
+++ b/mypy_primer/projects.py
@@ -547,7 +547,7 @@ def get_projects() -> list[Project]:
         ),
         Project(
             location="https://github.com/pytorch/vision",
-            mypy_cmd=None,  # "{mypy}",
+            mypy_cmd="{mypy}",
             pyright_cmd="{pyright}",
             deps=["numpy", "pillow"],

Linking hauntsaninja/mypy_primer#161

Activity

  1. sterliakov commented on May 21, 2025

    Collaborator

    One more example with random primer diffs on xarray, it only started appearing recently: #19102 (comment)

  2. hauntsaninja commented on May 23, 2025

    CollaboratorAuthor

    xarray might be a newer regression, since I can't repro with a few runs of mypy_primer --new 'v1.15' --old 'v1.15' -k pydata/xarray --debug --output concise. I'll try to bisect it later

  3. sterliakov commented on May 23, 2025

    Collaborator
  4. hauntsaninja commented on May 24, 2025

    CollaboratorAuthor

    Simple minimised version of torchvision:

    printf '
    def draw(
        colors1: list[str | tuple[int, int, int]] | str | tuple[int, int, int] | None,
        colors2: list[str | tuple[int, int, int]] | str | tuple[int, int, int] | None,
    ) -> None:
        for c1, c2 in zip(colors1, colors2):
            reveal_type(c1)
            reveal_type(c2)
    ' > test.py
    
    
    first_output="$(mypy test.py)"
    echo "$first_output"
    echo "----------"
    for run in {2..10}; do
      current_output="$(mypy test.py)"
      echo "$current_output"
      echo "----------"
      if [[ "$current_output" != "$first_output" ]]; then
        echo output mismatch
        exit 1
      fi
    done
    

    Also linking #16979 and #18125

  5. hauntsaninja commented on May 26, 2025

    CollaboratorAuthor

    The vision one will be fixed by #19147

    I think something similar will fix xarray. Both of these look like nonassociative issue (not a noncommutative issue!). I will do it in a follow up PR

  6. added a commit that references this issue on May 28, 2025
    f328ad6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugmypy got something wrong

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions


      Back | FazBrowse Home | New Git URL