Preserve lowest-instance diagnostics in parallel eval#1749
Conversation
|
I don't think this is important. Why do you think it is? |
|
Agreed that this is not important for proof correctness: the witness is invalid either way, and verifier/prover behavior is not affected. The reason I thought it was worth fixing is narrower: this preserves the existing diagnostic contract and removes an actual flaky test on So this is mainly a deterministic diagnostics / CI flake fix, not a security or proof correctness fix. If you prefer the parallel path to report any failing instance instead, I can close this and we should update the doc comment plus the test to stop requiring serial-compatible lowest-instance diagnostics. |
|
Closing this in favor of the lighter fix: keep the parallel short-circuit behavior and update the diagnostic contract/test so the parallel path is only required to report a failing instance, not the lowest failing instance. That matches the feedback that deterministic lowest-instance diagnostics are not important for correctness. |
|
Clarification: by "parallel short-circuit behavior" I mean the current |
Summary
Restores deterministic error selection in
EvalForm::evaluate_batched_parallel.The parallel batch evaluator documents that when several instances fail, diagnostics report the lowest-index failing instance, matching serial batch evaluation. The current
collect::<Result<Vec<_>, _>>()form short-circuits on a Rayon scheduling-dependent stripe error, so the reported instance can vary when failures occur in different stripes.This collects all stripe results and explicitly returns the error with the minimum
instance, preserving the documented serial-compatible behavior.Repro
On clean
origin/main, this existing test is flaky under Rayon:I reproduced a failure on run 2: serial reported instance
5, while parallel reported instance7.Test plan
RAYON_NUM_THREADS=8repeated flaky-test repro: 50/50 passes after the fixcargo test -p binius-m4-prover --features rayon --libcargo test -p binius-m4-prover --libcargo test -p binius-frontend --libcargo +nightly-2026-01-01 fmt --checkcargo clippy -p binius-frontend -p binius-m4-prover --all-features --tests --benches -- -D warnings