Skip to content

equivalence: generate BMS symbolic maps atomically (intermittent red Evidence Refresh, #4977) - #4978

Merged
squid-protocol merged 3 commits into
mainfrom
fix/evidence-refresh-red
Oct 12, 2026
Merged

squid-protocol merged 3 commits into
mainfrom
fix/evidence-refresh-red

Conversation

@squid-protocol

Copy link
Copy Markdown
Owner

Fixes the intermittent red Evidence Refresh on main (#4977).

What fails: the db2 aggregate job ("Merge the Db2 shards and apply the ratchet") reports one case NOT PROVEN. The case was cbsa-bnk1cac on 2026-10-11 (run 38130815904) and cbsa-bnk1cra on 2026-10-12 (run 38240041698). In both, the proof log shows GnuCOBOL failing COPY BNK1CDM / BNK1CAM with "No such file or directory". 2 of the last 3 scheduled runs failed; manual dispatches passed.

Why: bms_dir() in tests/tools/equivalence_common.py generated the BMS symbolic maps only if not out.is_dir(). bms_copybooks creates that directory before writing the .cpy files. The sweep runs cases in parallel (--jobs 4), so on a cold runner a second case could see the directory and stage a half-written set.

Fix: generate into <name>.tmp<pid> and rename it into place. If another process wins the rename, discard this copy and use theirs.

Checked: pr_gates --fast 5/5 pass. --ratchets ports and port-surface fail locally only because the carddemo corpus isn't fetched at its pinned ref on this box; the result is the same with and without this change. After CI, a workflow_dispatch of Evidence Refresh confirms the fix. #4977 closes itself on the next green run.

🤖 Generated with Claude Code

…s saw a half-written set; Db2 sweep red, #4977)

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@github-actions

Copy link
Copy Markdown
Contributor

🐦‍⬛ Muninn Security Scan

✅ No security issues found.

🐦‍⬛ Powered by Muninn · Skald Lab

squid-protocol and others added 2 commits October 12, 2026 08:12
…threads; a per-pid name raced, #4977)

The first fix named the temp directory by pid, but the det sweep runs its cases
as threads of one process, so they shared it and rmtree'd each other's
half-written set (6 det cases NOT PROVEN on #4978's CI). Use mkdtemp per call
and add a threaded regression test (fails on both earlier versions).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@squid-protocol

Copy link
Copy Markdown
Owner Author

The first CI run failed det with 6 new NOT PROVEN CICS/BMS cases. The first fix named the temp directory .tmp<pid>, but the det sweep runs its cases as threads (ThreadPoolExecutor), so they shared one temp dir and rmtree'd each other's half-written set. That made the race worse.

Fixed in 9b7e91e: a unique mkdtemp per call, plus tests/tools/test_bms_dir_4977.py, which uses 8 threads and a deliberately slow generator. The test passes on this version and fails on both the original code and the per-pid version. A local stress test against the real CBSA corpus (8 threads × 8 trials) gave 1 complete view every time and left no temp dirs behind. pr_gates --fast 5/5. Main is merged in.

@squid-protocol
squid-protocol marked this pull request as ready for review October 12, 2026 13:25
@squid-protocol
squid-protocol merged commit 0d74a18 into main Oct 12, 2026
50 checks passed
@squid-protocol
squid-protocol deleted the fix/evidence-refresh-red branch October 12, 2026 13:25
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