Skip to content

[ty] Extend cycle detection to recursive nominal instances - #27218

Draft
mtshiba wants to merge 17 commits into
mainfrom
more-recursive-identity
Draft

[ty] Extend cycle detection to recursive nominal instances#27218
mtshiba wants to merge 17 commits into
mainfrom
more-recursive-identity

Conversation

@mtshiba

@mtshiba mtshiba commented Jul 27, 2026

Copy link
Copy Markdown
Collaborator

Summary

This PR fixes #26990 (comment)

Stacked on #27538

Test Plan

mdtest updated

@mtshiba mtshiba added the ty Multi-file analysis & type inference label Jul 27, 2026
@astral-sh-bot

astral-sh-bot Bot commented Jul 27, 2026

Copy link
Copy Markdown

Typing conformance results

No changes detected ✅

Current numbers
The percentage of diagnostics emitted that were expected errors held steady at 96.96%. The percentage of expected errors that received a diagnostic held steady at 92.96%. The number of fully passing files held steady at 106/133.

@astral-sh-bot

astral-sh-bot Bot commented Jul 27, 2026

Copy link
Copy Markdown

Memory usage report

Summary

Project Old New Diff Outcome
sphinx 168.71MB 169.90MB +0.70% (1.19MB)
prefect 451.60MB 452.11MB +0.11% (524.61kB)
trio 93.47MB 93.62MB +0.17% (159.47kB)
flake8 40.31MB 40.34MB +0.07% (29.66kB)

Significant changes

Click to expand detailed breakdown

sphinx

Name Old New Diff Outcome
may_have_unbounded_specialization_inner 0.00B 301.17kB +301.17kB (new)
infer_definition_types 10.78MB 10.94MB +1.45% (160.14kB)
Type<'db>::cached_materialization_ 247.39kB 346.09kB +39.90% (98.70kB)
infer_expression_types_impl 11.42MB 11.51MB +0.80% (93.84kB)
member_lookup_with_policy_inner 4.80MB 4.85MB +1.05% (51.80kB)
StaticClassLiteral<'db>::implicit_attribute_inner_ 598.95kB 648.58kB +8.29% (49.62kB)
Specialization 1.57MB 1.62MB +2.92% (47.11kB)
infer_expression_type_impl 202.02kB 248.85kB +23.18% (46.84kB)
OverloadLiteral 689.91kB 735.01kB +6.54% (45.09kB)
FunctionType 1.84MB 1.87MB +1.95% (36.61kB)
TypePair 2.10MB 2.13MB +1.55% (33.19kB)
StaticClassLiteral<'db>::try_mro_ 1.87MB 1.90MB +1.59% (30.50kB)
GenericAlias 663.12kB 692.65kB +4.45% (29.53kB)
UnionType 641.86kB 664.92kB +3.59% (23.06kB)
TupleType<'db>::to_class_type_ 52.64kB 72.62kB +37.96% (19.98kB)
... 73 more

prefect

Name Old New Diff Outcome
TypePair 7.70MB 7.78MB +1.00% (79.22kB)
Specialization 4.56MB 4.64MB +1.67% (78.19kB)
TupleType<'db>::to_class_type_ 83.99kB 140.01kB +66.69% (56.02kB)
GenericAlias 1.78MB 1.83MB +2.74% (49.85kB)
is_redundant_with_impl 3.35MB 3.40MB +1.40% (48.10kB)
infer_definition_types 34.54MB 34.59MB +0.14% (47.96kB)
OverloadLiteral 1.54MB 1.57MB +1.76% (27.83kB)
UnionType 1.36MB 1.38MB +1.81% (25.14kB)
FunctionType 5.46MB 5.48MB +0.40% (22.25kB)
IntersectionType 1.56MB 1.58MB +1.24% (19.69kB)
StaticClassLiteral<'db>::try_mro_ 5.07MB 5.08MB +0.24% (12.69kB)
CallableType 7.99MB 7.99MB +0.09% (7.12kB)
function_known_decorators 2.24MB 2.25MB +0.30% (6.83kB)
infer_expression_types_impl 23.35MB 23.36MB +0.03% (6.72kB)
infer_deferred_types 4.88MB 4.88MB +0.09% (4.48kB)
... 50 more

trio

Name Old New Diff Outcome
Specialization 1.02MB 1.05MB +2.78% (28.98kB)
TypePair 964.31kB 986.16kB +2.27% (21.84kB)
GenericAlias 389.95kB 408.59kB +4.78% (18.63kB)
TupleType<'db>::to_class_type_ 41.65kB 59.73kB +43.43% (18.09kB)
is_redundant_with_impl 325.38kB 337.65kB +3.77% (12.27kB)
UnionType 293.77kB 305.91kB +4.13% (12.14kB)
infer_definition_types 4.43MB 4.44MB +0.24% (10.82kB)
OverloadLiteral 416.00kB 422.20kB +1.49% (6.20kB)
IntersectionType 275.73kB 281.63kB +2.14% (5.91kB)
FunctionType 1.23MB 1.23MB +0.45% (5.61kB)
StaticClassLiteral<'db>::try_mro_ 927.34kB 931.73kB +0.47% (4.39kB)
function_known_decorators 367.74kB 371.99kB +1.16% (4.25kB)
may_have_unbounded_specialization_inner 0.00B 2.08kB +2.08kB (new)
StaticClassLiteral<'db>::try_mro_::interned_arguments 314.79kB 316.20kB +0.45% (1.41kB)
CallableType 1.39MB 1.39MB +0.08% (1.11kB)
... 32 more

flake8

Name Old New Diff Outcome
TypePair 231.00kB 236.16kB +2.23% (5.16kB)
TupleType<'db>::to_class_type_ 9.18kB 14.16kB +54.21% (4.98kB)
Specialization 249.92kB 254.73kB +1.93% (4.81kB)
is_redundant_with_impl 82.05kB 86.27kB +5.14% (4.22kB)
UnionType 75.27kB 79.06kB +5.04% (3.80kB)
GenericAlias 112.92kB 116.02kB +2.74% (3.09kB)
IntersectionType 69.55kB 70.86kB +1.89% (1.31kB)
function_known_decorators 156.35kB 156.75kB +0.25% (408.00B)
CallableType 293.37kB 293.71kB +0.12% (352.00B)
Type<'db>::class_member_with_policy_inner_ 262.06kB 262.38kB +0.12% (320.00B)
MemberLookupKey 276.91kB 277.22kB +0.11% (312.00B)
member_lookup_with_policy_inner 322.27kB 322.58kB +0.09% (312.00B)
BoundMethodType<'db>::bound_signatures_ 40.19kB 40.47kB +0.70% (288.00B)
protocol_apply_self_with_receiver::interned_arguments 45.50kB 45.70kB +0.45% (208.00B)
protocol_apply_self_with_receiver 17.74kB 17.82kB +0.44% (80.00B)
... 9 more

@codspeed-hq

codspeed-hq Bot commented Jul 27, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 111 untouched benchmarks
⏩ 84 skipped benchmarks1


Comparing more-recursive-identity (1b8a6a7) with main (c4e86fc)

Open in CodSpeed

Footnotes

  1. 84 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@astral-sh-bot

astral-sh-bot Bot commented Jul 28, 2026

Copy link
Copy Markdown

ecosystem-analyzer results

No diagnostic changes detected ✅

Flaky changes detected. This PR summary excludes flaky changes; see the HTML report for details.

Full report with detailed diff (timing results)

@mtshiba
mtshiba force-pushed the more-recursive-identity branch from 3c8da32 to dc8e1e5 Compare August 4, 2026 18:08
@mtshiba
mtshiba force-pushed the more-recursive-identity branch from d35e6e7 to b94799f Compare August 6, 2026 10:03
@mtshiba
mtshiba force-pushed the more-recursive-identity branch from f6e79c9 to 139f0d0 Compare August 7, 2026 01:49
@mtshiba
mtshiba force-pushed the more-recursive-identity branch from 139f0d0 to 1b8a6a7 Compare August 7, 2026 06:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ty Multi-file analysis & type inference

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant