[ty] Higher limit for number of non-recursive union literals#25212
[ty] Higher limit for number of non-recursive union literals#25212Minibrams wants to merge 7 commits into
Conversation
…ould otherwise parse as a set
Typing conformance resultsNo changes detected ✅Current numbersThe percentage of diagnostics emitted that were expected errors held steady at 89.36%. The percentage of expected errors that received a diagnostic held steady at 85.49%. The number of fully passing files held steady at 88/134. |
Memory usage reportMemory usage unchanged ✅ |
|
| Project | Old Time | New Time | Change |
|---|---|---|---|
pandas-stubs |
9.64s | 14.47s | +50% |
Merging this PR will degrade performance by 97.28%
|
| Mode | Benchmark | BASE |
HEAD |
Efficiency | |
|---|---|---|---|---|---|
| ❌ | Simulation | ty_micro[many_string_assignments] |
83.4 ms | 5,240.1 ms | -98.41% |
| ❌ | Memory | ty_micro[many_string_assignments] |
16.8 MB | 361.7 MB | -95.35% |
Tip
Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.
Comparing Minibrams:main (0616e40) with main (b81d55e)
Footnotes
-
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. ↩
|
LOL, nevermind. I can't tell if the performance regressions are indicative of "real" or practically relevant regressions, but 97% degradation is pretty gnarly |
Summary
This changes the limit for the number of non-recursive union literals from 256 to 8192; the same limit we use for the number of non-recursive enums.
The motivation behind this is that the argument for having a high limit for enums - because huge enums are common in generated code - also holds for string literals. Specifically, some absurdly popular generated API clients rely on string literals for API routes, e.g.:
For clients like this,
tycannot handle API specs with more than 256 routes, which isn't uncommon.Test Plan
cargo nextest run -p ty_python_semantic -- mdtest::call/union.md