Skip to content

Reduce trace build inputs for prove-from-trace#2948

Merged
huitseeker merged 9 commits intonextfrom
huitseeker/refactor-tracebuildinputs
Apr 3, 2026
Merged

Reduce trace build inputs for prove-from-trace#2948
huitseeker merged 9 commits intonextfrom
huitseeker/refactor-tracebuildinputs

Conversation

@huitseeker
Copy link
Copy Markdown
Contributor

@huitseeker huitseeker commented Mar 31, 2026

TraceBuildInputs kept more data than trace building and prove-from-trace need. It also repeated execution state, and prove_from_trace_sync() still took execution options after execution was already done.

This PR cuts that path down to the post-execution data that trace building actually reads. It removes the duplicated execution binding, replaces the full advice fingerprint with a cheap digest of deferred precompile requests, and splits proof options from execution options. prove_from_trace_sync() now takes a single TraceProvingInputs bundle, and the trace-proving helper APIs are tighter.

This also updates the prove-from-trace coverage, including deferred precompile requests across fragment boundaries, and refreshes the affected snapshots on top of the row-major trace base.

Fixes #2915

Copy link
Copy Markdown
Contributor

@Al-Kindi-0 Al-Kindi-0 left a comment

Choose a reason for hiding this comment

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

Looks good to me and also cleaner

Copy link
Copy Markdown
Contributor

@Nashtare Nashtare left a comment

Choose a reason for hiding this comment

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

Not much to say this looks really clean

@huitseeker huitseeker force-pushed the huitseeker/refactor-tracebuildinputs branch from e7e5497 to bb81f59 Compare April 3, 2026 08:48
@huitseeker huitseeker requested a review from adr1anh April 3, 2026 08:52
let (stack_outputs, proof) =
prove_sync(&program, stack_inputs, advice_inputs, &mut host, options)
.expect("Proving failed");
let options = ProvingOptions::with_96_bit_security(hash_fn);
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.

A more drastic change that significantly changes the semantics but improves testing speed would be to use check_constraints which asserts that each row satisfies the air constraints. The main disadvantage I would foresee is that we might not catch prover bugs (for example min/max trace height bugs).

A much more useful but heavier test would involve adding an extra step here which would also verify the proof with the recursive verifier to add extra coverage for this load-bearing component.

Copy link
Copy Markdown
Contributor Author

@huitseeker huitseeker Apr 3, 2026

Choose a reason for hiding this comment

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

I've added the recursive step! Please look at assert_recursive_verify!

Copy link
Copy Markdown
Contributor

@adr1anh adr1anh left a comment

Choose a reason for hiding this comment

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

The precompile-related changes look good, but I think the naming of the final transcript could be slightly clearer

@huitseeker huitseeker force-pushed the huitseeker/refactor-tracebuildinputs branch 2 times, most recently from 635c8c8 to aa44ec6 Compare April 3, 2026 10:15
@huitseeker huitseeker force-pushed the huitseeker/refactor-tracebuildinputs branch from aa44ec6 to 5427d52 Compare April 3, 2026 12:06
@huitseeker huitseeker merged commit 0c13e9e into next Apr 3, 2026
17 checks passed
@huitseeker huitseeker deleted the huitseeker/refactor-tracebuildinputs branch April 3, 2026 20:15
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.

Redesign TraceBuildInputs for trace building and prove-from-trace

4 participants