Skip to content

fix(benchmarks): preserve interrupted trace replay evidence - #191

Merged
psv666 merged 1 commit into
mainfrom
codex/fix-trace-replay-evidence
Oct 27, 2026
Merged

psv666 merged 1 commit into
mainfrom
codex/fix-trace-replay-evidence

Conversation

@psv666

@psv666 psv666 commented Oct 27, 2026

Copy link
Copy Markdown
Collaborator

Summary

Trace replay lost completed responses when interrupted during a later request, and reusing --out silently overwrote prior evidence. This follow-up fixes the confirmed persistence and artifact-hygiene findings from the review of #185; #174, #179, and #184 remain in place.

validate trace → claim a new output directory → save config and planned IDs
  each finished attempt → append and flush response
  cancellation/error → stop and await every episode → record unfinished work → save summary

Every planned request is accounted for as completed, incomplete, or unattempted. HTTP/transport failures remain visible, and unfinished requests do not enter latency statistics. Existing output directories, including empty ones and directories owned by another running replay, are rejected before sending requests. Response rows are written in completion order; sent_s retains send order.

Remove the dated one-off experiment report from the current source tree and link its unchanged original revision. Both maintained replay samples remain byte-identical. This preserves the existing published evidence; it does not claim to recover any unpublished raw measurements.

Evidence

Base: 32346fcb2b88a10ffa7c8d456ae74d0543972d03. Fix: 72f9d8b398aa0cb00a8fcf03e34bd7e0ad08610c.

  • Before: a local HTTP server completed the first request and held the second. Sending SIGINT left only config.json, losing the completed response. Replaying a different trace into the same directory replaced the prior config, responses, and summary. The new process tests reproduce both failures on the base implementation.
  • After: actual SIGINT tests cover sequential and concurrent episodes, verify completed responses are already on disk before interruption, preserve exact response bytes, and account for every planned request. Overwrite tests verify unchanged existing bytes and zero new HTTP requests, including when another replay is still running. Mock-transport tests cover sibling cancellation on internal errors, HTTP errors, timeouts, retry filtering, and unexpected optional cache metadata.

Personally run with Python 3.12.13 and the pinned httpx==0.28.1, in a separate environment:

python benchmarks/bench.py validate benchmarks/smoke.jsonl
python -m unittest discover -s tests/benchmarks -p 'test_*.py' -v
mkdocs build --strict

Results: 4-request smoke manifest valid; 133 benchmark tests passed, including 7 new persistence tests; strict documentation build passed. git diff --check passed. Sample file bytes and SHA-256 values were compared against the base. Changes comprise 396 authored source/test lines and 490 total changed lines across 4 files.

No Rust or inference code changes. No GPU/model execution was performed for this fix, and no inference performance or numerical-parity claim is made. Historical hardware evidence for #174/#179/#184 remains subject to its documented source, model and device limits; this PR does not extend that qualification to the integrated head.

Merge Danger

Door: two-way.

Blast Radius: benchmarks.

Callers must supply a new --out directory. Completed runs retain their existing counts and successful-response latency definitions; interrupted runs now include explicit unfinished rows and counts. Ctrl-C and replay exceptions finalize partial evidence and exit unsuccessfully. Forced termination or machine failure cannot run finalization; flushed files are partial evidence and are not guaranteed durable against power loss.

Draft for maintainer review; no merge requested by this submission.

Signed-off-by: psv666 <2693925048@qq.com>
@psv666
psv666 marked this pull request as ready for review October 27, 2026 03:54
@psv666
psv666 merged commit 18a0d2e into main Oct 27, 2026
6 checks passed
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.

1 participant