Fix tsp_core generic specialization benchmark pointing at empty line#27
Merged
Merged
Conversation
The "generic specialization computed type" benchmark point targeted
line 7 (0-indexed) in generics.py, which is an empty line. The actual
expression `text = identity("hello")` is on line 9. Pyrefly's
getComputedType correctly returned null for the empty line, causing
requireNonEmpty validation to fail on every iteration.
This was the sole Pyrefly failure across all 8 benchmark suites and
has been present since the original tsp_core commit (800936d).
Fix: change start_line and end_line from 7 to 9.
Test plan:
Before: bench-servers --server pyrefly --protocol tsp shows:
pyrefly: [tsp_core] generic specialization computed type failed:
Result validation failed: iteration 1: empty result;
iteration 1: size_chars=0 < 10 (repeated for all 5 iterations)
tsp_core: failed (1 failed point out of 8)
After: bench-servers --server pyrefly --protocol tsp shows:
pyrefly: [tsp_core] generic specialization computed type ok
tsp_core: ok (0 failed points, 8/8 pass)
Pyrefly total: 0 failures across all 8 benchmark suites.
43 unit tests pass.
rchiodo
approved these changes
Apr 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
tsp_core/config.jsontargeted line 7 (0-indexed) ingenerics.py, which is an empty linetext = identity("hello")is on line 9getComputedTypecorrectly returned null for the empty line, causingrequireNonEmptyvalidation to fail on every iterationstart_lineandend_linefrom 7 to 9Test plan
bench-servers --server pyrefly --protocol tspshows:pyrefly: [tsp_core] generic specialization computed type failed: Result validation failed: iteration 1: empty result; iteration 1: size_chars=0 < 10(repeated for all 5 iterations).tsp_core: failed (1 failed point out of 8)bench-servers --server pyrefly --protocol tspshows:pyrefly: [tsp_core] generic specialization computed type ok.tsp_core: ok (0 failed points, 8/8 pass). Pyrefly total: 0 failures across all 8 benchmark suites. 43 unit tests pass.