mirror of
https://github.com/norandom/OpenUltraSAST.git
synced 2026-10-16 11:49:28 +00:00
The ProcessPool spawned its workers but ordered_extractions blocked the main thread on the OLDEST future, so while one slow repo finished the other workers sat idle: live profiling showed 1 of 4 cores busy, ~67% idle, ~1 attempt/min. Separate the seed-order acceptance cursor (`pending`: row+decision+key, no futures) from the worker set (`in_flight`: future->key). Keep up to `workers` jobs running; journal each result as it COMPLETES via wait(FIRST_COMPLETED) in any order and refill freed slots, never waiting on the oldest. A candidate is accepted/rejected only when its result is in the journal, advanced strictly in seed order -- so the pool runs out of order while the accepted pool stays byte-identical to a 1-worker run. Fork-network dedup and the systemic guard still apply at the cursor. New real-process test proves later extractions are journaled before an earlier slow one completes (completion order != seed order) while accepted entries stay in seed order; the old loop fails it. 210 unseen tests pass, ruff clean. Co-Authored-By: Claude Opus 4.8 <[email protected]>