Skip to content

Fix tsp_core generic specialization benchmark pointing at empty line#27

Merged
rchiodo merged 1 commit into
microsoft:mainfrom
kinto0:fix/tsp-core-config-only
Apr 22, 2026
Merged

Fix tsp_core generic specialization benchmark pointing at empty line#27
rchiodo merged 1 commit into
microsoft:mainfrom
kinto0:fix/tsp-core-config-only

Conversation

@kinto0

@kinto0 kinto0 commented Apr 22, 2026

Copy link
Copy Markdown
Contributor

Summary

  • The "generic specialization computed type" benchmark point in tsp_core/config.json 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, present since the original tsp_core commit (800936d)
  • Fix: change start_line and end_line from 7 to 9

Depends on: #24 (environments.py symlink fix) — merge that first to avoid PermissionError on systems with symlinked venv Python

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.

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 rchiodo merged commit a2da3c8 into microsoft:main Apr 22, 2026
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants