Skip to content

Conversation

@ammar-agent
Copy link
Collaborator

@ammar-agent ammar-agent commented Dec 7, 2025

Speeds up CI by:

  1. Approximate tokenizer for tests - Defaults Jest to length/4 token counting instead of loading the 10s WASM tokenizer
  2. Parallel static-check - Removes -j3 limit, allowing all 6 subtasks to run in parallel
  3. Shallow checkout for tests - Test jobs don't need full git history

Changes

Tokenizer (src/node/utils/main/tokenizer.ts)

  • Add shouldUseApproxTokenizer() that checks MUX_APPROX_TOKENIZER=1
  • Short-circuit all tokenizer functions when in approx mode
  • Override with MUX_FORCE_REAL_TOKENIZER=1 for tests needing real tokenization

Test setup (tests/setup.ts)

  • Default MUX_APPROX_TOKENIZER=1 in Jest

CI (.github/workflows/pr.yml)

  • make -j static-check (was -j3)
  • Remove fetch-depth: 0 from test-unit, test-integration, test-storybook, test-e2e

Test fix (src/cli/run.test.ts)

  • Update version test to accept both vX.Y.Z and hash-only formats (shallow clones don't have tags)

Generated with mux

@ammar-agent ammar-agent force-pushed the perf/fast-tokenizer-tests branch 2 times, most recently from 3c62fb3 to 045f658 Compare December 7, 2025 19:49
@ammar-agent ammar-agent changed the title 🤖 perf: speed up ipc tests with approx tokenizer 🤖 perf: speed up CI with approx tokenizer and parallel static-check Dec 7, 2025
@ammar-agent ammar-agent force-pushed the perf/fast-tokenizer-tests branch 2 times, most recently from 06866e7 to ada2c92 Compare December 7, 2025 20:11
- Add approximate tokenizer mode (length/4) to avoid 10s WASM cold starts
- Default Jest tests to approx mode via MUX_APPROX_TOKENIZER=1
- Allow override with MUX_FORCE_REAL_TOKENIZER=1 for tests needing real tokenization
- Remove -j3 limit on static-check (all 6 tasks can run in parallel)
- Use shallow checkout for test jobs (don't need full git history)

_Generated with mux_
@ammar-agent ammar-agent force-pushed the perf/fast-tokenizer-tests branch from ada2c92 to b10c1fe Compare December 7, 2025 20:30
@ammario ammario merged commit 025460c into main Dec 7, 2025
18 of 19 checks passed
@ammario ammario deleted the perf/fast-tokenizer-tests branch December 7, 2025 20:46
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