Skip to content

Conversation

@jakebailey
Copy link
Member

@jakebailey jakebailey commented Dec 1, 2025

Anything more is just waste.

May be useless in the future if we start treating checkers as an external resource to a Program (and thus the limitation would be put elsewhere if at all).

Copilot AI review requested due to automatic review settings December 1, 2025 19:21
Copilot finished reviewing on behalf of jakebailey December 1, 2025 19:24
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR optimizes checker pool creation by ensuring the number of checkers never exceeds the number of files in a program. The change moves checker pool initialization to occur after file processing is complete, allowing the pool size to be capped at the file count.

  • Moved initCheckerPool() call to after processAllProgramFiles() in NewProgram
  • Added finishedProcessing flag to enforce initialization ordering
  • Updated newCheckerPool() to limit checker count to min(max(checkerCount, 1), len(program.files), 256)

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
internal/compiler/program.go Reordered initialization to call initCheckerPool() after processAllProgramFiles(), and added panic check to enforce this ordering
internal/compiler/fileloader.go Added finishedProcessing flag to processedFiles struct, set to true when file processing completes
internal/compiler/checkerpool.go Moved checker count logic into newCheckerPool() and added constraint to limit checkers to the number of files

@jakebailey
Copy link
Member Author

This will conflict with #2159 so I'll wait for that as it's more critical.

@jakebailey jakebailey added this pull request to the merge queue Dec 2, 2025
Merged via the queue into main with commit e88d0f4 Dec 2, 2025
22 checks passed
@jakebailey jakebailey deleted the jabaile/max-checkers-files branch December 2, 2025 22:40
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.

4 participants