Add ty as type checker alongside pyright (#20474)
Part of #19393
Summary of the issue:
NVDA type-checks with pyright, which is slow and bundles a Node.js runtime. Many pyright rules are disabled to suppress pre-existing violations, leaving those categories unprotected against new violations. In #19393 I proposed swapping pyright for ty (Astral, Rust-based: fast, no Node, gradual typing).
Description of user facing changes:
None.
Description of developer facing changes:
ty (0.0.57) added as a dev dependency and configured in pyproject.toml ([tool.ty]). The config only contains what deviates from ty's defaults (e.g. directories covered by ty's built-in excludes are not repeated).
New CI job "Check types with ty" (typeCheckTy, ci/scripts/tests/typeCheckTy.ps1) runs in parallel with the existing pyright job. The existing job and script are renamed to typeCheckPyright for symmetry. Both jobs gate allTestsPass, so ty failures block PRs.
runlint.bat now runs both pyright and ty.
ty added as a pre-commit hook (upstream astral-sh/ty-pre-commit, rev: v0.0.57, kept in sync with the pyproject pin). The upstream hook's always_run is overridden so commits without Python changes don't pay for a full ty check, and the hook is skipped on pre-commit.ci for the same reason as pyright (it needs the project .venv).
pyright is retained; this PR only adds ty.
Description of development approach:
ty's rule taxonomy differs entirely from pyright's, so the config was tuned empirically: rules that flood violations on the current codebase are set to "ignore" (each annotated with its count, analogous to the existing [tool.pyright] leniency), reaching a clean ty check with zero code changes. pyright removal is a planned follow-up once ty proves stable in CI.