Skip to content

Threaded CI engine#889

Open
Debilski wants to merge 25 commits into
ASPP:mainfrom
Debilski:feature/threaded-ci
Open

Threaded CI engine#889
Debilski wants to merge 25 commits into
ASPP:mainfrom
Debilski:feature/threaded-ci

Conversation

@Debilski
Copy link
Copy Markdown
Member

@Debilski Debilski commented Jun 6, 2025

Work in progress, but gets the job done already (needs better data structures for result passing and the counting may still be broken).

Run 100 matches (10 at the same time):

contrib/ci_engine.py run -n 100 -t 10

and then view the result:

contrib/ci_engine.py print-scores

As it turns out, the old approach of simply running a bunch of ci_engine processes in parallel on a server is not really accurate (sqlite gets overwritten unless it is explicitly locked, in which case it will just crash). We basically need one and only one thread to do all the db handling.

TODO:

  • Better counting (new match selection)
  • Elo is broken
  • Hashing should be done concurrently
  • Breaks when not hashed
  • No detection when players have changed

@Debilski Debilski force-pushed the feature/threaded-ci branch 3 times, most recently from b66c266 to e9129f1 Compare June 6, 2025 22:41
@Debilski Debilski force-pushed the feature/threaded-ci branch from 3c8ed11 to 507ee51 Compare August 29, 2025 12:54
@Debilski Debilski force-pushed the feature/threaded-ci branch 4 times, most recently from 9cd3678 to 0fcc4ff Compare September 10, 2025 13:11
@Debilski
Copy link
Copy Markdown
Member Author

TODO: Split stdout/stderr per player. Add CLI command show-last-failed to print output for failed games

@Debilski Debilski force-pushed the feature/threaded-ci branch 5 times, most recently from bad5d44 to 94182d4 Compare September 10, 2025 21:20
@Debilski
Copy link
Copy Markdown
Member Author

Closes #826

@Debilski Debilski force-pushed the feature/threaded-ci branch 4 times, most recently from 9c6dabe to cb06c09 Compare May 29, 2026 19:10
@Debilski Debilski force-pushed the feature/threaded-ci branch from cb06c09 to c841399 Compare May 30, 2026 14:39
@Debilski Debilski marked this pull request as ready for review May 30, 2026 14:43
@Debilski
Copy link
Copy Markdown
Member Author

Code is a bit of a mess in some parts; there are multiple ways that concurrency is done and the whole database stuff feels very low level but it kind of works and allows one to quickly run 1000s of matches (given enough cores).

As a future task, I think we should give the ci_engine its own pyproject.toml so that we can maybe add SQLAlchemy or similar as a dependency (with the bonus of being able to use something other than sqlite as storage [*]) and make the database handling a bit nicer on the eyes and in general separate looping logic from output.

@Debilski Debilski requested a review from otizonaizit May 30, 2026 15:02
@Debilski
Copy link
Copy Markdown
Member Author

@otizonaizit Do you want to review this or should we just merge as it does hardly affect anything in Pelita main?

@Debilski Debilski force-pushed the feature/threaded-ci branch from c841399 to 5ceb4aa Compare May 30, 2026 16:28
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