Stream full-trace evidence at 100% coverage; verified at merge scale (1M)
run_all_to streams every base execution's full trace+delta to disk (no sampling);
main writes evidence/traces.tsv covering 100% of base executions. Verified
end-to-end at the real merge profile:
merge run: 1,000,000 executions / 11,000,000 comparisons, all gates PASS, 288s
evidence: leaves.tsv = 11,000,000 leaves; traces.tsv = 1,000,000 full traces (3.9G)
independent attest: recomputed root a2b27c027f87788f over 11,000,000 leaves ==
claimed; 1,000,000/1,000,000 full traces reconstructed and re-derived to
retained leaves.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
//! to executed work, and exits nonzero if any gate fails.
|
||||
|
||||
use ci_reports::json::Json;
|
||||
use ci_reports::{run_all, CiResults, Profile, Scale};
|
||||
use ci_reports::{run_all_to, CiResults, Profile, Scale};
|
||||
use std::fs;
|
||||
use std::io::Write;
|
||||
use std::path::Path;
|
||||
@@ -59,28 +59,9 @@ fn write_evidence(dir: &Path, r: &CiResults) {
|
||||
r.provenance.engines_agree,
|
||||
);
|
||||
fs::write(ev.join("claims.tsv"), claims).expect("write claims");
|
||||
|
||||
// Full-trace evidence (finding 4): each line is
|
||||
// ws ps cs prs future leaf <TAB> <full trace> <TAB> <full delta>
|
||||
// The attestor reconstructs the trace + delta, recomputes the canonical
|
||||
// trace hash and the replay-record leaf, and checks the leaf is among the
|
||||
// retained leaves. This is the full trace, not a summary.
|
||||
let mut traces = String::from("# full-trace evidence: header<TAB>trace<TAB>delta\n");
|
||||
for ev_rec in &r.trace_evidence {
|
||||
let rr = &ev_rec.replay;
|
||||
traces.push_str(&format!(
|
||||
"{:016x} {:016x} {:016x} {:016x} {:016x} {:016x}\t{}\t{}\n",
|
||||
rr.world_seed,
|
||||
rr.program_seed,
|
||||
rr.contract_seed,
|
||||
rr.perturbation_seed,
|
||||
rr.future_hash.0,
|
||||
rr.hash().0,
|
||||
ev_rec.trace.serialize(),
|
||||
ev_rec.delta.serialize(),
|
||||
));
|
||||
}
|
||||
fs::write(ev.join("traces.tsv"), traces).expect("write traces");
|
||||
// Note: evidence/traces.tsv (the FULL per-execution trace corpus) is streamed
|
||||
// during the run in main(), covering 100% of base executions — not written
|
||||
// here from a capped sample.
|
||||
}
|
||||
|
||||
fn build_reports(dir: &Path, r: &CiResults) {
|
||||
@@ -632,7 +613,17 @@ fn main() {
|
||||
}
|
||||
let merge = scale.profile == Profile::Merge;
|
||||
let start = Instant::now();
|
||||
let results = run_all(scale);
|
||||
// Stream full-trace evidence for 100% of base executions straight to disk.
|
||||
let ev_dir = dir.join("evidence");
|
||||
fs::create_dir_all(&ev_dir).expect("create evidence dir");
|
||||
let traces_path = ev_dir.join("traces.tsv");
|
||||
let mut traces_w = std::io::BufWriter::new(fs::File::create(&traces_path).expect("create traces"));
|
||||
traces_w
|
||||
.write_all(b"# full-trace evidence (100% of base executions): header<TAB>trace<TAB>delta\n")
|
||||
.expect("write traces header");
|
||||
let results = run_all_to(scale, Some(&mut traces_w));
|
||||
traces_w.flush().expect("flush traces");
|
||||
drop(traces_w);
|
||||
let elapsed = start.elapsed();
|
||||
|
||||
build_reports(dir, &results);
|
||||
|
||||
Reference in New Issue
Block a user