Skip to content

refactor(ethexe-processor): Instrument codes in custom threadpool#5258

Open
ark0f wants to merge 6 commits intomasterfrom
al/ethexe/instrument-in-threadpool
Open

refactor(ethexe-processor): Instrument codes in custom threadpool#5258
ark0f wants to merge 6 commits intomasterfrom
al/ethexe/instrument-in-threadpool

Conversation

@ark0f
Copy link
Copy Markdown
Member

@ark0f ark0f commented Mar 27, 2026

Also refactor threadpool a little bit

@ark0f ark0f added A0-pleasereview PR is ready to be reviewed by the team D8-ethexe ethexe-related PR labels Mar 27, 2026
@semanticdiff-com
Copy link
Copy Markdown

semanticdiff-com bot commented Mar 27, 2026

Review changes with  SemanticDiff

Changed Files
File Status
  ethexe/processor/src/tests.rs  80% smaller
  ethexe/compute/src/lib.rs  64% smaller
  ethexe/compute/src/codes.rs  49% smaller
  ethexe/processor/src/lib.rs  43% smaller
  ethexe/processor/src/thread_pool.rs  43% smaller
  ethexe/processor/src/handling/run.rs  38% smaller
  ethexe/compute/src/tests.rs  17% smaller
  ethexe/compute/src/compute.rs  11% smaller
  ethexe/compute/src/prepare.rs  2% smaller
  ethexe/processor/src/handling/mod.rs  0% smaller

@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request refactors the threadpool implementation and migrates key components of the ethexe-processor and ethexe-compute modules to use asynchronous patterns. These changes improve the flexibility of task execution and ensure better compatibility with the existing asynchronous runtime environment.

Highlights

  • Threadpool Refactoring: Refactored the custom threadpool to use a global lazy-initialized instance and simplified the API to accept arbitrary closures, removing the need for explicit input/output type definitions.
  • Async Migration: Converted several synchronous methods, including process_code and various test utilities, to asynchronous functions to better integrate with the tokio runtime.
  • Task Management: Updated CodesSubService to use FuturesUnordered instead of JoinSet for managing code processing tasks, improving flexibility in task handling.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@ark0f ark0f changed the title refactor(ethexe-processor): Instrument codes in our threadpool refactor(ethexe-processor): Instrument codes in custom threadpool Mar 27, 2026
… for `chunk_execution_spawn` module and `spawn_chunk_execution` function
Copy link
Copy Markdown
Contributor

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

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 refactors the code processing pipeline to be asynchronous, transitioning process_code from a synchronous to an async function across the compute and processor crates. Key changes include replacing tokio::task::JoinSet with futures::stream::FuturesUnordered in the CodesSubService and introducing a custom thread pool to handle blocking operations such as code instrumentation and chunk execution. Consequently, numerous tests have been updated to use tokio::test and await. Feedback was provided regarding a critical recursive call in the ProcessorExt implementation for Processor that would result in a stack overflow, along with a suggestion to disambiguate the call using fully qualified syntax.

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a36adbc2b8

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A0-pleasereview PR is ready to be reviewed by the team D8-ethexe ethexe-related PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant