Skip to content

cbsa-bankdata case at L2; isolate libdb rand from FUNCTION RANDOM in the oracle (Part of #5561) - #5585

Merged
squid-protocol merged 3 commits into
mainfrom
churn/5561-20261019T0620Z
Oct 19, 2026
Merged

squid-protocol merged 3 commits into
mainfrom
churn/5561-20261019T0620Z

Conversation

@squid-protocol

Copy link
Copy Markdown
Owner

Part of #5561. Draft.

What changed

  • New case cbsa-bankdata (CBSA BANKDATA: Db2 ACCOUNT/CONTROL rows plus the indexed CUSTOMER file, parm 1,3,1,0000000000000007). Det port translates 464/464 statements, no holes. VSAM 4/4, ACCOUNT 9/9, CONTROL 3/3, RC 0/0 equal; both derived SQL fault runs (-803 at lines 613 and 642) equal. L2, det-sweep ledger entry det_sweep_coverage/cbsa-bankdata.json.
  • Coverage: 24/24 paragraphs, 17/48 branches over 3 runs (the parm/fault runs reach the refusals and the Db2 failure paths; the rest is not reached by this case).
  • Oracle defect found: libdb reseeds the process RNG. GnuCOBOL's indexed-file backend (libdb-5.3.so) calls srand(time/pid) and rand at file open, which cut FUNCTION RANDOM's sequence, so the oracle's customers differed on every run. faults/ggdisplay.c (already preloaded) now answers rand/srand from a libdb* caller from a private generator. Register C12 updated. Re-proved cbsa-crdtagy1 and cbsa-inqcust (still PROVED).
  • Harness: -fnot-reserved=TIMESTAMP for programs naming a paragraph TIMESTAMP (IBM allows it, GnuCOBOL reserves it); a derived SQL fault run with no faithful oracle (X8, SQLERRMC(1:SQLERRML) with SQLERRML 0) is named under unrunnable_faults in the report instead of aborting, never proven or guessed. Key added only when non-empty.

Evidence level

Translated whole (464/464, 0 holes). Executed-equivalent on 3 runs. Assumptions: the oracle's RANDOM generator (glibc) is shared by both sides, so equality says the port does what the COBOL does with the oracle's numbers, not that it draws z/OS's (C12); Db2 is the throwaway local container. Residual risk: 31 of 48 branches not executed by this case.

Remaining slices

  • carddemo-cbstm03b (CALLed program driven by its LINKAGE request block) is not done: it needs a datasets extension in tests/tools/equivalence_call.py (stage indexed inputs, DD env, unload of compared datasets) with the Java-side counterpart, plus the case. That is past this PR's 5-hand-written-file budget. No named reason beyond that yet.
  • More BANKDATA parm runs (END < START, step 0 refusals) would raise branch coverage.

Sibling gaps

  • Any burned-estate program combining FUNCTION RANDOM with an indexed file is covered by the same shim; GenApp LGICVS01 (RANDOM + VSAM) is the burned program that needs it and has no proof yet.
  • Other GnuCOBOL-only reserved words would need an entry in GNUCOBOL_ONLY_RESERVED; none is reached by a burned program yet.

Gates

pr_gates --fast 6/6, --ratchets 8/8, relevant tests pass (181 passed, 3 skipped). No golden re-bless needed (no parsing change).

Cross-repo

None. PR #5579 touches equivalence_cics.py; this PR does not.

Lessons for agents

  • A COBOL case combining FUNCTION RANDOM with an indexed file is non-deterministic in the oracle unless libdb's rand/srand is isolated (shim in faults/ggdisplay.c); isolating it in ggsql.c did not help.
  • equivalence.py run --record refuses --port; det ports are not committed. L2 for a det case is the det_sweep_coverage/<case>.json entry from proof_sweep.py --det-only --cases X then det_coverage_ledger.py update SWEEP.

🤖 Generated with Claude Code

@squid-protocol squid-protocol added the shepherd:merge Maintainer: merge when green (auto-merge, squash). Guide: docs/ci.md label Oct 19, 2026
@squid-protocol

Copy link
Copy Markdown
Owner Author

No description provided.

@squid-protocol
squid-protocol marked this pull request as ready for review October 19, 2026 06:54
@squid-protocol
squid-protocol enabled auto-merge (squash) October 19, 2026 07:02
@squid-protocol
squid-protocol merged commit 253c012 into main Oct 19, 2026
72 checks passed
@squid-protocol
squid-protocol deleted the churn/5561-20261019T0620Z branch October 19, 2026 07:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

shepherd:merge Maintainer: merge when green (auto-merge, squash). Guide: docs/ci.md

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant