Skip to content

⚡ Bolt: parallelize unit test execution in gate script - #463

Open
heidi-dang wants to merge 1 commit into
feat/bootstrap-scaffoldfrom
bolt-parallel-unit-tests-1317338254387165136
Open

⚡ Bolt: parallelize unit test execution in gate script#463
heidi-dang wants to merge 1 commit into
feat/bootstrap-scaffoldfrom
bolt-parallel-unit-tests-1317338254387165136

Conversation

@heidi-dang

Copy link
Copy Markdown
Owner

💡 What:

  • Implemented ThreadPoolExecutor in scripts/03_unit_test_gate.py to parallelize the execution of generated code samples.
  • Fixed a bug in save_jsonl that caused FileNotFoundError when the output path was in the current directory.
  • Fixed a pre-existing NameError in heidi_engine/telemetry.py:get_state that was discovered during full test suite execution.

🎯 Why:

  • Sequential execution of subprocess.run for each code sample was a significant bottleneck in the training pipeline, especially as the dataset size grows.
  • The os.makedirs bug prevented running scripts with output in the current directory.
  • The NameError in telemetry broke state retrieval on cache misses.

📊 Impact:

  • Measurable speedup of ~2.2x on 100 samples with 4 workers (from ~2.5s to ~1.1s).
  • Improved pipeline reliability by fixing pre-existing bugs.

🔬 Measurement:

  • Run python3 scripts/03_unit_test_gate.py with a large JSONL input and observe the "Running with N parallel workers" log and reduced execution time.
  • Verify that pytest tests/ now passes (previously failing due to NameError).

PR created automatically by Jules for task 1317338254387165136 started by @heidi-dang

- Parallelize test_sample loop using ThreadPoolExecutor in 03_unit_test_gate.py
- Fix os.makedirs bug in save_jsonl utilities
- Fix NameError: target_run_id in heidi_engine/telemetry.py
@google-labs-jules

Copy link
Copy Markdown
Contributor

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request parallelizes unit test execution in scripts/03_unit_test_gate.py using a ThreadPoolExecutor to run tests concurrently while preserving their original order. It also updates save_jsonl to handle current-directory paths gracefully and removes an unused state cache check in heidi_engine/telemetry.py. Additionally, a documentation entry is added to .jules/bolt.md summarizing these optimization learnings. There are no review comments, so I have no feedback to provide.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

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.

1 participant