[Autoloop: tsb-perf-evolve]
- Ngôn ngữ chính
- TypeScript
- Star
- 7
- Fork
- 3
- Merge trung bình
- 1 giờ 42 phút
- Pull request đã merge (30 ngày)
- 1
Mô tả
🤖 *Autoloop program issue for `tsb-perf-evolve`. The program definition below is mirrored from [`.autoloop/programs/tsb-perf-evolve/program.md`](https://github.com/githubnext/tsessebe/blob/main/.autoloop/programs/tsb-perf-evolve/program.md). Edit the file to update the definition; comment on this issue to steer the agent.*
---
# tsb perf evolve — Series.sortValues vs pandas Series.sort_values
## Goal
Evolve the implementation of `Series.sortValues` (`src/core/series.ts`) so that, on the synthetic benchmark in `code/benchmark.ts`, tsb runs **at least as fast as pandas** on the equivalent `Series.sort_values` call (`code/benchmark.py`).
Concretely, we minimize the **ratio**
fitness = mean_ms_tsb / mean_ms_pandas
`fitness < 1.0` means tsb is faster than pandas; lower is better. We will keep iterating as long as fitness keeps improving.
This is a **performance-evolution program** — there is one self-contained artifact (`Series.sortValues`), one scalar fitness (the ratio), and many plausible algorithmic families to try (comparison sort, typed-array indirect sort, dtype-dispatched non-comparison sort, batched/SoA, etc.). It is the canonical case for the AlphaEvolve strategy.
### Validity invariants
1. The existing test suite for `sortValues` passes.
2. The function signature is unchanged: `sortValues(ascending = true, naPosition: "first" | "last" = "last"): Series`.
3. No new runtime dependencies.
4. TypeScript strict mode satisfied.
5. Behaviour identical to reference for all dtypes, both ascending/descending, both `naPosition` values, and empty Series.
## Target
Only modify: `src/core/series.ts` (sortValues method body) and `.autoloop/programs/tsb-perf-evolve/code/**`.
## Evaluation
Metric: `fitness` = `tsb_mean_ms / pandas_mean_ms`. **Lower is better.** `< 1.0` means tsb is faster than pandas.
> Generated by [Autoloop](https://github.com/githubnext/tsessebe/actions/runs/24815695413/agentic_workflow) · ● 3.4M · [◷](https://github.com/search?q=repo%3Agithubnext%2Ftsessebe+is%3Aissue+%22gh-aw-workflow-call-id%3A+githubnext%2Ftsessebe%2Fautoloop%22&type=issues)
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
Hướng nghiên cứu
Bắt đầu bằng cách đọc phương thức sortValues trong src/core/series.ts và cặp benchmark trong .autoloop/programs/tsb-perf-evolve/code/benchmark.ts và benchmark.py. Giữ nguyên các kiểm thử sortValues hiện có và các bất biến đã nêu trong khi đánh giá các thay đổi dựa trên tỷ lệ fitness; được xem là hoàn tất khi hành vi vẫn giống hệt và phần triển khai TypeScript đạt tỷ lệ dưới 1.0.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- typescript
- Lĩnh vực
- performance
- Loại issue
- Tái cấu trúc
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức độ hoạt động
- Ít trao đổi
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 35/100