Skip to content

[ty] Use never-change durability for one-shot checks#26359

Draft
MichaReiser wants to merge 1 commit into
mainfrom
micha/one-shot-never-change-inputs
Draft

[ty] Use never-change durability for one-shot checks#26359
MichaReiser wants to merge 1 commit into
mainfrom
micha/one-shot-never-change-inputs

Conversation

@MichaReiser

@MichaReiser MichaReiser commented Jun 25, 2026

Copy link
Copy Markdown
Member

Summary

Use Salsa's NEVER_CHANGE durability for program, project, and newly created file inputs during one-shot ty check runs. This avoids recording unnecessary dependencies while keeping fixes, watch mode, and the server incremental.

Builds on #26353. Across the eight wall-time projects, the change reduced wall time by 6.2% geomean and peak RSS by 11.3% geomean.

Test Plan

Testing: Passed the ty CLI, ruff_db, and ty_project test suites, Clippy, and repository hooks.

@MichaReiser MichaReiser force-pushed the micha/one-shot-never-change-inputs branch from a189517 to 5b1b3af Compare June 25, 2026 09:01
@astral-sh-bot

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

@astral-sh-bot

astral-sh-bot Bot commented Jun 25, 2026

Copy link
Copy Markdown

Memory usage report

Summary

Project Old New Diff Outcome
flake8 28.99MB 27.56MB -4.95% (1.44MB) ⬇️
trio 70.30MB 63.93MB -9.05% (6.36MB) ⬇️
sphinx 166.58MB 143.84MB -13.65% (22.74MB) ⬇️
prefect 448.32MB 388.37MB -13.37% (59.95MB) ⬇️

Significant changes

Click to expand detailed breakdown

flake8

Name Old New Diff Outcome
infer_definition_types 1001.04kB 684.76kB -31.60% (316.28kB) ⬇️
infer_expression_types_impl 639.32kB 378.85kB -40.74% (260.47kB) ⬇️
member_lookup_with_policy_inner 290.29kB 128.02kB -55.90% (162.27kB) ⬇️
infer_scope_types_impl 512.00kB 369.20kB -27.89% (142.80kB) ⬇️
Type<'db>::class_member_with_policy_ 234.43kB 118.60kB -49.41% (115.83kB) ⬇️
infer_deferred_types 285.61kB 186.10kB -34.84% (99.51kB) ⬇️
semantic_index 7.91MB 7.88MB -0.50% (40.60kB) ⬇️
StaticClassLiteral<'db>::try_mro_ 214.62kB 176.43kB -17.79% (38.19kB) ⬇️
place_by_id 135.44kB 105.91kB -21.80% (29.52kB) ⬇️
FunctionType<'db>::signature_ 243.76kB 223.44kB -8.34% (20.32kB) ⬇️
function_known_decorators 116.71kB 97.46kB -16.49% (19.25kB) ⬇️
cached_protocol_interface 24.99kB 7.23kB -71.08% (17.77kB) ⬇️
all_narrowing_constraints_for_expression 70.62kB 55.28kB -21.72% (15.34kB) ⬇️
StaticClassLiteral<'db>::implicit_attribute_inner_ 37.68kB 23.04kB -38.86% (14.64kB) ⬇️
Type<'db>::apply_specialization_inner_ 118.64kB 105.22kB -11.31% (13.42kB) ⬇️
... 67 more

trio

Name Old New Diff Outcome
infer_expression_types_impl 4.35MB 2.63MB -39.49% (1.72MB) ⬇️
infer_definition_types 3.96MB 2.66MB -32.75% (1.30MB) ⬇️
infer_scope_types_impl 2.40MB 1.68MB -30.18% (742.65kB) ⬇️
member_lookup_with_policy_inner 1.02MB 532.27kB -49.16% (514.61kB) ⬇️
infer_deferred_types 1.20MB 809.00kB -33.93% (415.40kB) ⬇️
Type<'db>::class_member_with_policy_ 889.20kB 486.46kB -45.29% (402.74kB) ⬇️
analyze_non_terminal_call 374.81kB 230.65kB -38.46% (144.16kB) ⬇️
place_by_id 544.93kB 418.59kB -23.18% (126.34kB) ⬇️
semantic_index 17.81MB 17.69MB -0.67% (121.73kB) ⬇️
all_narrowing_constraints_for_expression 450.77kB 344.71kB -23.53% (106.06kB) ⬇️
StaticClassLiteral<'db>::try_mro_ 520.97kB 424.27kB -18.56% (96.70kB) ⬇️
FunctionType<'db>::signature_ 626.11kB 552.31kB -11.79% (73.80kB) ⬇️
function_known_decorators 235.68kB 182.31kB -22.64% (53.37kB) ⬇️
cached_protocol_interface 62.84kB 16.81kB -73.24% (46.02kB) ⬇️
Type<'db>::apply_specialization_inner_ 347.88kB 304.56kB -12.45% (43.32kB) ⬇️
... 77 more

sphinx

Name Old New Diff Outcome
infer_expression_types_impl 14.72MB 8.39MB -42.99% (6.33MB) ⬇️
infer_definition_types 13.67MB 8.96MB -34.45% (4.71MB) ⬇️
member_lookup_with_policy_inner 4.26MB 1.70MB -60.11% (2.56MB) ⬇️
infer_scope_types_impl 8.10MB 5.89MB -27.21% (2.20MB) ⬇️
Type<'db>::class_member_with_policy_ 3.58MB 1.64MB -54.12% (1.94MB) ⬇️
infer_deferred_types 2.67MB 1.75MB -34.55% (945.81kB) ⬇️
all_narrowing_constraints_for_expression 1.89MB 1.45MB -23.27% (451.12kB) ⬇️
semantic_index 37.51MB 37.12MB -1.03% (396.16kB) ⬇️
StaticClassLiteral<'db>::try_mro_ 1.78MB 1.46MB -18.26% (332.80kB) ⬇️
place_by_id 1.33MB 1.04MB -21.72% (294.85kB) ⬇️
analyze_non_terminal_call 662.05kB 430.27kB -35.01% (231.78kB) ⬇️
StaticClassLiteral<'db>::implicit_attribute_inner_ 605.73kB 390.90kB -35.47% (214.83kB) ⬇️
infer_statement_types_impl 481.24kB 284.38kB -40.91% (196.86kB) ⬇️
FunctionType<'db>::signature_ 1.61MB 1.45MB -9.75% (160.51kB) ⬇️
infer_expression_type_impl 223.73kB 79.19kB -64.61% (144.55kB) ⬇️
... 86 more

prefect

Name Old New Diff Outcome
infer_definition_types 49.91MB 33.77MB -32.33% (16.14MB) ⬇️
infer_expression_types_impl 37.67MB 22.57MB -40.09% (15.10MB) ⬇️
infer_scope_types_impl 30.11MB 22.34MB -25.80% (7.77MB) ⬇️
member_lookup_with_policy_inner 10.19MB 4.75MB -53.44% (5.45MB) ⬇️
Type<'db>::class_member_with_policy_ 7.90MB 4.38MB -44.50% (3.51MB) ⬇️
infer_deferred_types 5.99MB 3.96MB -33.93% (2.03MB) ⬇️
semantic_index 114.46MB 113.13MB -1.17% (1.33MB) ⬇️
place_by_id 4.78MB 3.75MB -21.42% (1.02MB) ⬇️
all_narrowing_constraints_for_expression 5.14MB 4.13MB -19.79% (1.02MB) ⬇️
function_known_decorators 3.04MB 2.39MB -21.42% (665.84kB) ⬇️
analyze_non_terminal_call 1.77MB 1.19MB -33.07% (600.27kB) ⬇️
StaticClassLiteral<'db>::try_mro_ 3.35MB 2.80MB -16.54% (567.99kB) ⬇️
enum_metadata 1.69MB 1.31MB -22.52% (389.84kB) ⬇️
infer_statement_types_impl 810.87kB 468.62kB -42.21% (342.24kB) ⬇️
StaticClassLiteral<'db>::implicit_attribute_inner_ 809.59kB 476.99kB -41.08% (332.60kB) ⬇️
... 83 more

@astral-sh-bot

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

@astral-sh-bot

astral-sh-bot Bot commented Jun 25, 2026

Copy link
Copy Markdown

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

✅ ecosystem check detected no linter changes.

Formatter (stable)

✅ ecosystem check detected no format changes.

Formatter (preview)

✅ ecosystem check detected no format changes.

@codspeed-hq

codspeed-hq Bot commented Jun 25, 2026

Copy link
Copy Markdown

Merging this PR will improve performance by 5.36%

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

⚡ 10 improved benchmarks
✅ 123 untouched benchmarks
⏩ 4 skipped benchmarks1

Performance Changes

Mode Benchmark BASE HEAD Efficiency
WallTime sympy 76.1 s 71 s +7.19%
Memory hydra-zen 53 MB 49.7 MB +6.75%
Memory anyio 67.7 MB 63.6 MB +6.37%
WallTime pydantic 8.4 s 8 s +5.67%
Simulation hydra-zen 1.5 s 1.4 s +5.05%
Simulation anyio 1.3 s 1.3 s +5.02%
Memory attrs 31.1 MB 29.7 MB +4.88%
WallTime altair 1.8 s 1.7 s +4.39%
WallTime freqtrade 10.4 s 10 s +4.31%
Simulation DateType 257.9 ms 247.9 ms +4.01%

Tip

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


Comparing micha/one-shot-never-change-inputs (5b1b3af) with main (825509f)

Open in CodSpeed

Footnotes

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

@MichaReiser MichaReiser added performance Potential performance improvement ty Multi-file analysis & type inference labels Jun 25, 2026
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.

1 participant