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

Skip to content

[ty] Cache is_never_satisfied results#26261

Merged
charliermarsh merged 2 commits into
mainfrom
charlie/codex-cache-is-never-satisfied
Jun 23, 2026
Merged

[ty] Cache is_never_satisfied results#26261
charliermarsh merged 2 commits into
mainfrom
charlie/codex-cache-is-never-satisfied

Conversation

@charliermarsh

@charliermarsh charliermarsh commented Jun 23, 2026

Copy link
Copy Markdown
Member

Summary

is_never_satisfied reconstructs root path assignments and traverses the same constraint BDD whenever callers ask the same builder about the same interior root. This adds a builder-local cache keyed by the root NodeId, allowing repeated top-level queries to reuse the completed boolean result.

Only completed top-level calls read or populate the cache. Recursive calls remain uncached because their result depends on the current PathAssignments, while terminal roots continue to return directly. The cache is local to each query builder, including builder views over compacted owned constraint sets, so cache state does not become part of owned storage.

Performance

On the pinned Pydantic ty_walltime workload, a census found that 70.1% of top-level checks repeated a root in the same builder and those repeats accounted for 48.0% of recursive visits. In an adjacent copied-binary comparison with 90 checks per variant, the candidate measured 2.962 s/check versus 3.014 s/check for control, a 1.725% improvement.

This is directionally favorable but below the campaign's predeclared 2% and twice-noise acceptance thresholds, so the PR remains a draft for broader performance evaluation rather than a claimed win.

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

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

@astral-sh-bot

astral-sh-bot Bot commented Jun 23, 2026

Copy link
Copy Markdown

Memory usage report

Memory usage unchanged ✅

@astral-sh-bot

astral-sh-bot Bot commented Jun 23, 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)

@codspeed-hq

codspeed-hq Bot commented Jun 23, 2026

Copy link
Copy Markdown

Merging this PR will improve performance by 4.15%

⚠️ 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

⚡ 1 improved benchmark
✅ 70 untouched benchmarks
⏩ 64 skipped benchmarks1

Performance Changes

Mode Benchmark BASE HEAD Efficiency
Simulation DateType 281.4 ms 270.1 ms +4.15%

Tip

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


Comparing charlie/codex-cache-is-never-satisfied (fab1df6) with main (fc97f12)

Open in CodSpeed

Footnotes

  1. 64 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 force-pushed the charlie/codex-cache-is-never-satisfied branch from c9e7acd to fab1df6 Compare June 23, 2026 12:17
@charliermarsh charliermarsh changed the title [ty] Cache is_never_satisfied results Cache is_never_satisfied results Jun 23, 2026
@charliermarsh charliermarsh added the performance Potential performance improvement label Jun 23, 2026
@charliermarsh charliermarsh marked this pull request as ready for review June 23, 2026 12:59
@charliermarsh charliermarsh requested a review from a team as a code owner June 23, 2026 12:59
@charliermarsh charliermarsh changed the title Cache is_never_satisfied results [ty] Cache is_never_satisfied results Jun 23, 2026
@charliermarsh charliermarsh merged commit bcd9a2c into main Jun 23, 2026
61 checks passed
@charliermarsh charliermarsh deleted the charlie/codex-cache-is-never-satisfied branch June 23, 2026 14:56
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.

2 participants