Skip to content

[ty] Initialize constraint solver storage lazily - #29846

Draft
charliermarsh wants to merge 1 commit into
mainfrom
charlie/ty-lazy-constraint-storage
Draft

charliermarsh wants to merge 1 commit into
mainfrom
charlie/ty-lazy-constraint-storage

Conversation

@charliermarsh

Copy link
Copy Markdown
Member

Summary

On the PyTorch benchmark, median ty check time fell from 8.40 s to 7.98 s (5.0%) across 18 paired runs of the standard release build. The change was faster in 15 pairs, and every run produced the same 30,293 diagnostics.

ConstraintSetBuilder initializes the arenas and caches for a decision diagram even when a type relation is already known to be always true or always false. We now initialize that storage on the first operation that needs it. Checks on terminal nodes return directly, and combining a constraint with true or false skips the diagram when the result and its source order are already known.

@charliermarsh charliermarsh added performance Potential performance improvement ty The ty type checker labels Oct 30, 2026 — with ChatGPT Codex Connector
@astral-automations-bot

Copy link
Copy Markdown
Contributor

Typing conformance results

No changes detected ✅

Current numbers
The percentage of diagnostics emitted that were expected errors held steady at 98.60%. The percentage of expected errors that received a diagnostic held steady at 98.86%. The number of fully passing files held steady at 137/146.

Results for 58e183b · Workflow run

@astral-automations-bot

Copy link
Copy Markdown
Contributor

Memory usage report

Memory usage unchanged ✅


Results for 58e183b · Workflow run

@astral-automations-bot

Copy link
Copy Markdown
Contributor

ecosystem-analyzer results

No diagnostic changes detected ✅

Large timing changes:

Project Old Time New Time Change
python-sop 0.06s 0.10s +66%

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

Full report with detailed diff · Timing results


Results for 58e183b · Workflow run

This branch was previously deployed

1 inactive deployment
automations — 58e183b1 Deployed Oct 30, 2026 by charliermarsh via security-review / security review #96338
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

performance Potential performance improvement ty The ty type checker

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant