tools: compare recorded A/B capture archive evidence #3502

Code

Clone this repository

Checkout

From your project repository, check out a new branch and test the changes.

git fetch -u  "codex/ab-archive-comparability:kaoru-maki-codex/ab-archive-comparability"
git switch "kaoru-maki-codex/ab-archive-comparability"
Open
leonida/mandy
kaoru-maki wants to merge 1 commit from kaoru-maki/mandy:codex/ab-archive-comparability into main

This branch is out-of-date with the base branch

Conversation
Reviewers 0 approvals
  • No reviewers
Details
This pull request is blocked because it's outdated.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u 'codex/ab-archive-comparability:kaoru-maki-codex/ab-archive-comparability'
git switch 'kaoru-maki-codex/ab-archive-comparability'
Contributor

Claimed in the coordination issue as: TOOLS-AB-ARCHIVE-COMPARABILITY

What and why

Add a standard-library checker for two existing capture ZIPs with a mandy-ab-capture/1 receipt. It verifies the evidence members against the archive checksum index and ties each receipt to the build, revision, tape, arm, and named run.

The checker compares the recorded plan, inputs, settings, and driver and cache evidence. It requires the observed completion evidence for each arm and checks both undeclared differences and declared changes that did not occur. The JSON report carries field names, status flags, and observed exit codes.

python -I tools/ab_archive_compare.py capture-a.zip capture-b.zip --expect PreparedTtpf

The report covers the recorded evidence of paired captures. Numeric telemetry export remains a separate contribution. The gate reliability and device-loss PRs are related context. Numeric ZIP #3483 · Gate #3424 · Device loss #3450

Generated examples

Generated case Verified outcome
Declared change to the prepared BCn cache Match
Same cache change without a declaration Different
Child exit 0 with shutdown and the target window confirmed Eligible
Child exit 75 with a device-loss marker Incomplete, exit 75 preserved
Forced termination Incomplete, forced-stop flag preserved
Child exits before the target window Incomplete, window flag preserved

Tested

The published diff passed all 36 synthetic checker tests and the clean-room scan on Windows. The source diff checksum matches the published commit. On macOS with Python 3.12, all 36 checker tests, 26 A/B timing comparator tests, three line-ending checks, and the repository clean-room scan also passed.

Review regressions cover unreadable LZMA receipts, the streamed tape length, the presence of a replay locator, and timed timeline schedules. The corresponding tests failed before the fixes. Plain output paths, including paths with commas, remain interchangeable when the capture settings match.

The original Windows validation passed 30 checker tests, 23 game-abba tests, 40 gate tests, 26 A/B timing comparator tests, and 59 documentation tests. A PowerShell 7.6.9 capture stub independently produced the five match, difference, and incomplete outcomes described in the synthetic tests. Four negative controls failed as expected with their guards disabled.

GPUs tested: n/a (offline archive analysis and a synthetic child process).

AI-assisted: OpenAI Codex (GPT-6). Independent read-only review by GPT-6.2 Sol.

Checklist

  • Based on current main.
  • One topic.
  • Generated inputs and clean-room check.
Claimed in the coordination issue as: [TOOLS-AB-ARCHIVE-COMPARABILITY](https://git.leonida.now/leonida/mandy/issues/3312#issuecomment-26565) ### What and why Add a standard-library checker for two existing capture ZIPs with a `mandy-ab-capture/1` receipt. It verifies the evidence members against the archive checksum index and ties each receipt to the build, revision, tape, arm, and named run. The checker compares the recorded plan, inputs, settings, and driver and cache evidence. It requires the observed completion evidence for each arm and checks both undeclared differences and declared changes that did not occur. The JSON report carries field names, status flags, and observed exit codes. ```powershell python -I tools/ab_archive_compare.py capture-a.zip capture-b.zip --expect PreparedTtpf ``` The report covers the recorded evidence of paired captures. Numeric telemetry export remains a separate contribution. The gate reliability and device-loss PRs are related context. [Numeric ZIP #3483](https://git.leonida.now/leonida/mandy/pulls/3483) · [Gate #3424](https://git.leonida.now/leonida/mandy/pulls/3424) · [Device loss #3450](https://git.leonida.now/leonida/mandy/pulls/3450) ### Generated examples | Generated case | Verified outcome | |---|---| | Declared change to the prepared BCn cache | `Match` | | Same cache change without a declaration | `Different` | | Child exit 0 with shutdown and the target window confirmed | Eligible | | Child exit 75 with a device-loss marker | `Incomplete`, exit 75 preserved | | Forced termination | `Incomplete`, forced-stop flag preserved | | Child exits before the target window | `Incomplete`, window flag preserved | ### Tested The published diff passed all 36 synthetic checker tests and the clean-room scan on Windows. The source diff checksum matches the published commit. On macOS with Python 3.12, all 36 checker tests, 26 A/B timing comparator tests, three line-ending checks, and the repository clean-room scan also passed. Review regressions cover unreadable LZMA receipts, the streamed tape length, the presence of a replay locator, and timed timeline schedules. The corresponding tests failed before the fixes. Plain output paths, including paths with commas, remain interchangeable when the capture settings match. The original Windows validation passed 30 checker tests, 23 game-abba tests, 40 gate tests, 26 A/B timing comparator tests, and 59 documentation tests. A PowerShell 7.6.9 capture stub independently produced the five match, difference, and incomplete outcomes described in the synthetic tests. Four negative controls failed as expected with their guards disabled. GPUs tested: n/a (offline archive analysis and a synthetic child process). AI-assisted: OpenAI Codex (GPT-6). Independent read-only review by GPT-6.2 Sol. ### Checklist - [x] Based on current main. - [x] One topic. - [x] Generated inputs and clean-room check.
First-time contributor

Independent local verification of this change (I changed no code).

  • Head fc0f0d4c, merge base 0036195a. The new tests are absent on the base: git grep -F test_declared_prepared_cache_change_matches 0036195a -- tests/test_ab_archive_compare.py -> exit 1 (same for the other new cases).
  • On the PR head: python -I -m unittest discover -s tests -p test_ab_archive_compare.py -> Ran 36 tests, OK (1.9 s). Synthetic archive/receipt fixtures only; nothing device-bound.
  • git diff --check 0036195a fc0f0d4c -> clean. python -I scripts/check_no_game_data.py tools/ab_archive_compare.py tests/test_ab_archive_compare.py docs/game_gate.md -> clean.

GPUs tested: none (pure Python archive comparison on synthetic inputs). Driver: n/a. No game data, assets or extracted shaders were used or attached.

AI-assisted: yes, Hy4 flash (verification only). No approval implied; this is a local test report.

Independent local verification of this change (I changed no code). - Head `fc0f0d4c`, merge base `0036195a`. The new tests are absent on the base: `git grep -F test_declared_prepared_cache_change_matches 0036195a -- tests/test_ab_archive_compare.py` -> exit 1 (same for the other new cases). - On the PR head: `python -I -m unittest discover -s tests -p test_ab_archive_compare.py` -> Ran 36 tests, OK (1.9 s). Synthetic archive/receipt fixtures only; nothing device-bound. - `git diff --check 0036195a fc0f0d4c` -> clean. `python -I scripts/check_no_game_data.py tools/ab_archive_compare.py tests/test_ab_archive_compare.py docs/game_gate.md` -> clean. GPUs tested: none (pure Python archive comparison on synthetic inputs). Driver: n/a. No game data, assets or extracted shaders were used or attached. AI-assisted: yes, Hy4 flash (verification only). No approval implied; this is a local test report.
Author
Contributor

I tested a companion producer for mandy-ab-capture/1 receipts. A generated A/B run writes comparison-evidence.json into each capture ZIP and includes it in the checksum index. The test uses ordinary PowerShell child processes and generated inputs. The producer reads the exit code from the same process handle it launched.

The prototype round trip accepted a declared change to a prepared BCn + Zstd cache and flagged the same change when undeclared. It recorded exit code 0 for a complete capture and classified exit 75, a forced stop, and an exit before the measurement window as Incomplete, retaining the observed process evidence.

The launcher integration can test these same cases against the checker in this PR.

AI-assisted.

I tested a companion producer for `mandy-ab-capture/1` receipts. A generated A/B run writes `comparison-evidence.json` into each capture ZIP and includes it in the checksum index. The test uses ordinary PowerShell child processes and generated inputs. The producer reads the exit code from the same process handle it launched. The prototype round trip accepted a declared change to a prepared BCn + Zstd cache and flagged the same change when undeclared. It recorded exit code `0` for a complete capture and classified exit `75`, a forced stop, and an exit before the measurement window as `Incomplete`, retaining the observed process evidence. The launcher integration can test these same cases against the checker in this PR. AI-assisted.
Sign in to join this conversation.
No description provided.