Repository navigation
Fix missing thread prefixes in parallel verification output - #4944
Conversation
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The implementation consistently handles multiline results and includes targeted regression coverage.
Review effort: Balanced
Findings: None
What changed in this PR
Fixes ambiguous parallel verification output by labeling every result line with its worker thread.
Changes:
- Adds reusable per-line thread prefixing.
- Applies prefixes to stdout, logs, and per-harness files.
- Extends the parallel autoharness regression test.
| File | Description |
|---|---|
kani-driver/src/harness_runner.rs |
Prefixes each rendered result line. |
tests/script-based-pre/cargo_autoharness_parallel/parallel.sh |
Validates complete prefix coverage. |
tests/script-based-pre/cargo_autoharness_parallel/parallel.expected |
Adds the regression expectation. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
Looks good. I checked that the parallel test fails without this change and passes with it, and that One heads-up on verify-rust-std's end, |
feliperodri
left a comment
There was a problem hiding this comment.
Thanks for picking this up. This fixes #4438 as described: with -j N, every line of a harness's result block is now prefixed, so a block that lands between another thread's lines can still be read line by line.
What I ran: the new parallel.sh fails against a main build and passes on this branch (merged with current main). -j 1 output is identical to main for terse and regular. Under -j 3 I checked passing, failing, timed-out and killed-CBMC harnesses, --coverage, and --log-file, and all result lines carry the prefix. Regular/old output and concrete playback are rejected with -j, so they can't produce unprefixed result blocks. fmt, clippy and the kani-driver unit tests are clean, and CI is green.
The two inline comments (--output-into-files and the lost blank line between blocks) are optional.
One gap that is out of scope here and I'm not asking you to fix: output that doesn't go through process_output is still unprefixed under -j N. The case that matters is a failing goto-instrument step. run_suppress dumps the tool's raw stdout/stderr (Reading GOTO program ..., Out of memory) to stdout, even with --log-file, and that happens in instrument_model before the harness prints its Checking harness line. That output can't be attributed to a harness from the log. Could you open a GitHub issue for it, so it's tracked once this lands? Printing the Checking harness line before instrument_model runs, and sending run_suppress's failure dump through emit_line, would probably cover it.
Remove thread prefixes from per-harness result files, preserve trailing newlines between result blocks, and extend regression coverage to failed harnesses and file output.
Parallel verification currently prefixes only the beginning of each multiline result with Thread N:, leaving subsequent lines without a thread identifier. This makes it difficult to associate results with their worker when reading parallel output.
This change prefixes every line of each verification result in stdout, log files, and per-harness result files. It also extends the existing parallel autoharness regression test to check that all nonempty result lines have a thread prefix.
Validation:
Resolves #4438
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 and MIT licenses.