Skip to content

Pass --compact-trace to CBMC for concrete playback - #4680

Merged
feliperodri merged 1 commit into
model-checking:mainfrom
tautschnig:playback-compact-trace
Jul 29, 2026
Merged

Pass --compact-trace to CBMC for concrete playback#4680
feliperodri merged 1 commit into
model-checking:mainfrom
tautschnig:playback-compact-trace

Conversation

@tautschnig

Copy link
Copy Markdown
Member

Concrete playback disables --slice-formula (traces from sliced formulas contain arbitrary values, #1288) and requests a full trace. On contract-heavy harnesses the resulting JSON trace is dominated by the values of hidden instrumentation steps: for the write_bytes harness from model-checking/verify-rust-std the trace weighs 427 MB, of which Kani consumes only the kani::any_raw_* return-value assignments (57 KB)

  • everything else is built, serialized and parsed for nothing, accounting for more than half of the end-to-end playback time.

Pass --compact-trace in playback mode: CBMC's compact trace drops hidden steps and actual-parameter assignments while retaining regular assignments - a strict superset of what the playback parser reads. With a CBMC that honors the option in JSON mode, the trace shrinks to 3 MB and end-to-end playback time halves (46s to 23s), producing an identical generated unit test. The CBMC-side change is diffblue/cbmc#9135; CBMC versions that do not honor --compact-trace with --json-ui accept and ignore the option, so this change is compatible with the currently pinned CBMC and becomes effective once the CBMC pin reaches a release containing that fix.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 and MIT licenses.

Concrete playback disables --slice-formula (traces from sliced formulas
contain arbitrary values, model-checking#1288) and requests a full trace. On
contract-heavy harnesses the resulting JSON trace is dominated by the
values of hidden instrumentation steps: for the write_bytes harness
from model-checking/verify-rust-std the trace weighs 427 MB, of which
Kani consumes only the kani::any_raw_* return-value assignments (57 KB)
- everything else is built, serialized and parsed for nothing,
accounting for more than half of the end-to-end playback time.

Pass --compact-trace in playback mode: CBMC's compact trace drops
hidden steps and actual-parameter assignments while retaining regular
assignments - a strict superset of what the playback parser reads. With
a CBMC that honors the option in JSON mode, the trace shrinks to 3 MB
and end-to-end playback time halves (46s to 23s), producing an
identical generated unit test. The CBMC-side change is
diffblue/cbmc#9135; CBMC versions that do not
honor --compact-trace with --json-ui accept and ignore the option, so
this change is compatible with the currently pinned CBMC and becomes
effective once the CBMC pin reaches a release containing that fix.

Co-authored-by: Kiro <kiro-agent@users.noreply.github.com>
@tautschnig
tautschnig requested a review from a team as a code owner July 28, 2026 01:19
Copilot AI review requested due to automatic review settings July 28, 2026 01:19
@github-actions github-actions Bot added the Z-EndToEndBenchCI Tag a PR to run benchmark CI label Jul 28, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This change optimizes Kani’s concrete playback workflow by reducing the size (and parsing cost) of CBMC JSON traces, which in turn improves end-to-end playback performance on contract-heavy harnesses.

Changes:

  • In concrete playback mode, pass --compact-trace to CBMC alongside --trace to drop hidden/instrumentation-heavy steps from the trace while retaining the assignments concrete playback consumes.
  • Document the rationale and compatibility expectations with CBMC versions that accept but may ignore --compact-trace under --json-ui.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@feliperodri
feliperodri added this pull request to the merge queue Jul 29, 2026
Merged via the queue into model-checking:main with commit 5de1413 Jul 29, 2026
33 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Z-EndToEndBenchCI Tag a PR to run benchmark CI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants