Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[ty] Cache constraint implication checks#25714

Merged
charliermarsh merged 1 commit into
mainfrom
charlie/cache-direct-constraint-implications
Jun 7, 2026
Merged

[ty] Cache constraint implication checks#25714
charliermarsh merged 1 commit into
mainfrom
charlie/cache-direct-constraint-implications

Conversation

@charliermarsh

@charliermarsh charliermarsh commented Jun 6, 2026

Copy link
Copy Markdown
Member

Summary

When building sequent maps, we repeatedly compare the same ordered pairs of range constraints to determine whether one directly implies the other. Each comparison performs assignability checks for the lower and upper bounds, even when an earlier sequent calculation has already checked the same pair.

This change caches the final boolean result for each ordered constraint pair in the constraint-set builder, including negative results. Sequent construction and solving behavior remain unchanged, while later checks can reuse the existing result.

@astral-sh-bot astral-sh-bot Bot added the ty Multi-file analysis & type inference label Jun 6, 2026
@astral-sh-bot

astral-sh-bot Bot commented Jun 6, 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 92.16%. The percentage of expected errors that received a diagnostic held steady at 87.31%. The number of fully passing files held steady at 92/134.

@astral-sh-bot

astral-sh-bot Bot commented Jun 6, 2026

Copy link
Copy Markdown

Memory usage report

Memory usage unchanged ✅

@astral-sh-bot

astral-sh-bot Bot commented Jun 6, 2026

Copy link
Copy Markdown

ecosystem-analyzer results

No diagnostic changes detected ✅

Full report with detailed diff (timing results)

@codspeed-hq

codspeed-hq Bot commented Jun 6, 2026

Copy link
Copy Markdown

Merging this PR will improve performance by 8.28%

⚠️ Different runtime environments detected

Some benchmarks with significant performance changes were compared across different runtime environments,
which may affect the accuracy of the results.

Open the report in CodSpeed to investigate

⚡ 4 improved benchmarks
✅ 63 untouched benchmarks
⏩ 60 skipped benchmarks1

Performance Changes

Mode Benchmark BASE HEAD Efficiency
WallTime multithreaded 1.8 s 1.6 s +10.21%
Simulation ty_micro[typevar_mapping_accumulation] 1,056.7 ms 975.7 ms +8.3%
WallTime pydantic 10.7 s 9.9 s +8.02%
Simulation ty_micro[pydantic_core_schema_dict] 119.8 ms 112.4 ms +6.61%

Tip

Curious why this is faster? Use the CodSpeed MCP and ask your agent.


Comparing charlie/cache-direct-constraint-implications (ed1900d) with main (8cf0c77)

Open in CodSpeed

Footnotes

  1. 60 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.

@charliermarsh charliermarsh changed the title [ty] Cache direct constraint implications [ty] Cache constraint implication checks Jun 6, 2026
@charliermarsh charliermarsh added the performance Potential performance improvement label Jun 6, 2026
@charliermarsh charliermarsh marked this pull request as ready for review June 6, 2026 23:37
@charliermarsh charliermarsh merged commit 5ac2a53 into main Jun 7, 2026
59 checks passed
@charliermarsh charliermarsh deleted the charlie/cache-direct-constraint-implications branch June 7, 2026 00:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

performance Potential performance improvement ty Multi-file analysis & type inference

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants