You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Merge changes from main: resolve barrel export conflicts and bring in new features
Brought in all changes from origin/main without creating a full merge history:
- New source files: api_types, attrs, insert_pop, pipe_apply, to_from_dict (core),
categorical_ops, cut_qcut, format_ops, notna_isna, numeric_extended, string_ops,
string_ops_extended, window_extended (stats), rolling_apply (window)
- Resolved barrel export conflicts in src/core/index.ts, src/stats/index.ts,
src/index.ts, src/reshape/index.ts (PR's API naming preserved)
- Updated playground pages, tests, benchmarks, CI workflows from main
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
# Performance Comparison: tsb (TypeScript) vs pandas (Python)
6
+
7
+
## Goal
8
+
9
+
Systematically benchmark every tsb function against its pandas equivalent, one function per iteration. Each iteration picks a function that has not yet been benchmarked, writes a matching performance test for both tsb (TypeScript/Bun) and pandas (Python), runs both, and records the timing results. The benchmark results are displayed on the playground pages doc site.
10
+
11
+
This is an open-ended program — it runs continuously, always adding the next benchmark comparison.
12
+
13
+
### How each iteration works
14
+
15
+
1.**Read existing benchmarks** — check `benchmarks/tsb/` and `benchmarks/pandas/` to see which functions are already benchmarked.
16
+
2.**Pick ONE function** from `src/` that has no benchmark yet. Prioritize core operations (Series, DataFrame, GroupBy, etc.).
17
+
3.**Write a TypeScript benchmark** in `benchmarks/tsb/bench_{function}.ts` that:
18
+
- Creates a realistic dataset (e.g. 100,000 rows)
19
+
- Runs the operation in a tight loop (warm-up + measured iterations)
print(f"Existing PR: (none — will create on first accepted iteration)")
451
495
print(f"Deferred (next run): {deferred or '(none)'}")
452
496
print(f"Programs skipped: {[s['name'] for s in skipped] or '(none)'}")
453
497
print(f"Programs unconfigured: {unconfigured or '(none)'}")
@@ -537,6 +581,8 @@ The pre-step has already determined which program to run. Read `/tmp/gh-aw/autol
537
581
-**`selected_file`**: The full path to the program's markdown file (either `.autoloop/programs/<name>/program.md`, `.autoloop/programs/<name>.md`, or `/tmp/gh-aw/issue-programs/<name>.md` for issue-based programs).
538
582
-**`selected_issue`**: The GitHub issue number if the selected program came from an issue, or `null` if it came from a file.
539
583
-**`selected_target_metric`**: The `target-metric` value from the program's frontmatter (a number), or `null` if the program is open-ended. Used to check the [halting condition](#halting-condition) after each accepted iteration.
584
+
-**`existing_pr`**: The PR number (e.g., `42`) of an already-open PR for this program's branch, or `null` if no open PR exists. **If this is not null, you MUST use `push-to-pull-request-branch` to push to this PR — do NOT call `create-pull-request`.**
585
+
-**`head_branch`**: The canonical branch name for this program (e.g., `autoloop/coverage`). Always use this exact branch name — never append suffixes.
540
586
-**`issue_programs`**: A mapping of program name → issue number for all discovered issue-based programs.
541
587
-**`deferred`**: Other programs that were due but will be handled in future runs.
542
588
-**`unconfigured`**: Programs that still have the sentinel or placeholder content.
@@ -549,6 +595,7 @@ If `selected` is not null:
549
595
3. Read the current state of all target files.
550
596
4. Read the state file `{selected}.md` from the repo-memory folder for all state: the ⚙️ Machine State table (scheduling fields) plus the research sections (priorities, lessons, foreclosed avenues, iteration history).
551
597
5. If `selected_issue` is not null, this is an issue-based program — also read the issue comments for any human steering input.
598
+
6.**Check `existing_pr`**: if it is not null, a PR already exists — use `push-to-pull-request-branch` to push commits to it. Only call `create-pull-request` when `existing_pr` is null.
552
599
553
600
## Multiple Programs
554
601
@@ -693,7 +740,7 @@ Each run executes **one iteration for the single selected program**:
693
740
694
741
If the state file does not yet exist, create it in the repo-memory folder using the template defined in the [Repo Memory](#repo-memory) section.
695
742
696
-
3. Note the `PR` field from the Machine State table. If it contains a PR number (e.g., `#42`), that is the **existing draft PR** for this program — you must update it, not create a new one.
743
+
3. Note the `existing_pr` field from `/tmp/gh-aw/autoloop.json`. If it is not null, that is the **existing draft PR** for this program — you must push to it using `push-to-pull-request-branch`, not create a new one. Also check the `PR` field from the Machine State table as a fallback.
697
744
698
745
### Step 2: Analyze and Propose
699
746
@@ -742,15 +789,15 @@ Each run executes **one iteration for the single selected program**:
742
789
- Commit message body (after a blank line): `Run: {run_url}` referencing the GitHub Actions run URL.
743
790
2. Push the commit to the long-running branch `autoloop/{program-name}`.
744
791
3.**Find the existing PR or create one** — follow these steps in order:
745
-
a. Check the `PR` field in the state file's **⚙️ Machine State** table. If it contains a PR number (e.g., `#42`), that is the existing draft PR.
746
-
b. If the state file has no PR number, search GitHub for open PRs with head branch `autoloop/{program-name}`. Use the GitHub API: `GET /repos/{owner}/{repo}/pulls?state=open&head={owner}:autoloop/{program-name}`.
747
-
c. **If an existing PR is found** (from either step a or b): use `push-to-pull-request-branch` to push additional commits to the existing PR. Update the PR body with the latest metric and a summary of the most recent accepted iteration. Add a comment to the PR summarizing the iteration: what changed, old metric, new metric, improvement delta, and a link to the actions run. **Do NOT call `create-pull-request`.**
748
-
d. **If NO PR exists** for `autoloop/{program-name}`: create one using `create-pull-request`:
792
+
a. **First, check `existing_pr` from `/tmp/gh-aw/autoloop.json`.** The pre-step has already looked up the open PR for this program. If `existing_pr` is not null, that is the existing draft PR — skip to step (c).
793
+
b. If `existing_pr` is null, also check the `PR` field in the state file's **⚙️ Machine State** table as a fallback. If it contains a PR number (e.g., `#42`), verify it is still open via the GitHub API.
794
+
c. **If an existing PR is found** (from step a or b): use `push-to-pull-request-branch` to push additional commits to the existing PR. Update the PR body with the latest metric and a summary of the most recent accepted iteration. Add a comment to the PR summarizing the iteration: what changed, old metric, new metric, improvement delta, and a link to the actions run. **Do NOT call `create-pull-request`.**
795
+
d. **If NO PR exists** for `autoloop/{program-name}` (both `existing_pr` is null AND the state file has no PR): create one using `create-pull-request`:
749
796
- Branch: `autoloop/{program-name}` (the branch you already created in Step 3 — do NOT let the framework auto-generate a branch name)
750
797
- Title: `[Autoloop: {program-name}]`
751
798
- Body includes: a summary of the program goal, link to the steering issue, the current best metric, and AI disclosure: `🤖 *This PR is maintained by Autoloop. Each accepted iteration adds a commit to this branch.*`
752
799
753
-
> ⚠️ **Never create a new PR if one already exists for `autoloop/{program-name}`.** Each program must have exactly one draft PR at any time. If you are unsure whether a PR exists, check the GitHub API before calling `create-pull-request`.
800
+
> ⚠️ **Never create a new PR if one already exists for `autoloop/{program-name}`.** Each program must have exactly one draft PR at any time. The pre-step provides `existing_pr` in autoloop.json — always check it first. Only call `create-pull-request` when `existing_pr` is null AND the state file has no PR number.
754
801
4. Ensure the steering issue exists (see [Steering Issue](#steering-issue) below). Add a comment to the steering issue linking to the commit and actions run.
755
802
5. Add an entry to the experiment log issue.
756
803
6. Update the state file `{program-name}.md` in the repo-memory folder:
@@ -789,6 +836,13 @@ Maintain a single open issue **per program** titled `[Autoloop: {program-name}]
789
836
```markdown
790
837
🤖 *Autoloop — an iterative optimization agent for this repository.*
@@ -816,6 +870,7 @@ Maintain a single open issue **per program** titled `[Autoloop: {program-name}]
816
870
- Iterations in **reverse chronological order** (newest first).
817
871
- Each iteration heading links to its GitHub Actions run.
818
872
- Use `${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}` for the current run URL.
873
+
- The **links table at the top** must always show the current branch, PR, steering issue, and state file. Update the PR number when a new PR is created. When creating a continuation issue for a new month, copy the links table from the previous issue.
819
874
- Close the previous month's issue and create a new one at month boundaries.
820
875
- Maximum 50 iterations per issue; create a continuation issue if exceeded.
821
876
@@ -1122,6 +1177,7 @@ After each iteration, prepend an entry to the **📊 Iteration History** section
1122
1177
-**Always** update the state file after each iteration, regardless of outcome.
1123
1178
-**Update the Machine State table first** — the scheduling pre-step depends on it.
1124
1179
-**Prepend** iteration history entries (newest first).
1180
+
-**Keep the state file compact.** The state file must stay under 30 KB. When prepending a new iteration entry, collapse older iteration entries (beyond the most recent 10) into compressed summary lines (e.g. `### Iters 50–100 — ✅ (metrics 20→55): brief summary`). Also prune Lessons Learned to only the most recent and relevant entries.
> Use the `head_branch` field from `autoloop.json` — it is always the canonical name.
1149
1206
1150
1207
> ❌ **Do NOT create a new PR if one already exists for `autoloop/{program-name}`.**
1151
-
> Always check the state file's `PR` field and the GitHub API before calling `create-pull-request`. If a PR exists, use `push-to-pull-request-branch` instead.
1208
+
> The pre-step provides `existing_pr` in `autoloop.json`. If it is not null, **always** use `push-to-pull-request-branch` — never call `create-pull-request`. Only create a PR when `existing_pr` is null AND the state file has no PR number.
1152
1209
1153
1210
> ❌ **Do NOT let the gh-aw framework auto-generate a branch name when creating a PR.**
1154
1211
> Always specify the branch explicitly as `autoloop/{program-name}` when calling `create-pull-request`.
0 commit comments