Skip to content

det: FUNCTION RANDOM on the oracle's generator, stated as C12 (#4270 blocker ranking) - #4592

Merged
squid-protocol merged 1 commit into
mainfrom
fix/det-function-random
Oct 7, 2026
Merged

squid-protocol merged 1 commit into
mainfrom
fix/det-function-random

Conversation

@squid-protocol

@squid-protocol squid-protocol commented Oct 7, 2026 •

Copy link
Copy Markdown
Owner

Part of #4270: the blocker ranking (cics_census.py blockers, #4587) showed COMPUTE FUNCTION RANDOM as the only gap left in 6 burned CICS programs, plus 1 program one gap away.

Decision: translate both forms on the oracle's generator, and say so (oracle_assumptions C12)

IBM documents what RANDOM's interface does (a seed of zero or a positive integer; a run unit's first reference with no seed uses seed zero; a call with no seed continues the sequence; the value is between 0 and 1). It does not publish the generator. No port can reproduce z/OS's numbers for a seed.

  • Seeded and unseeded both translate onto cobolrt Funcs.Random, which reproduces GnuCOBOL 3.1.2's sequence exactly: glibc srand/rand TYPE_3, and rand()/RAND_MAX as a double whose exact value the COMPUTE takes. There is one sequence per program, reset by each entry point (runProgram/runBatch/runTask, a run unit). An unseeded first call therefore uses seed 0, as IBM says, and that also matches glibc's unseeded state.
  • What a proof then says: given the numbers the oracle draws for the seed the run states, the port does what the COBOL does with them. It does not say the port draws z/OS's numbers. A credit score or customer number computed from RANDOM differs from z/OS's for the same seed. In the CICS harness the seed these programs use (EIBTASKN) is 0 on both sides: the stub INITIALIZEs DFHEIBLK, and the det port's EIB image holds packed zero. That makes the value a fact the run states, as the clock is (M4).
  • Refused at run time by name: a negative or non-integer seed (IBM does not allow it), or a seed past the oracle's int.
  • Declared, not reached: the oracle can return exactly 0 or 1 (about once in 2^31 draws); a LINK target is a new run unit on z/OS but shares the task's process state in the oracle; a CALLed program keeps its own sequence here. In every affected program the first call is seeded.

Census (before → after, cics_census.py survey + blockers, burned corpora + 9 census repos, no jcics-samples)

  • CICS programs translated whole: 69 → 75 / 123. Burned 56 → 62, non-burned 13 → 13.
  • Made whole: CBSA CRDTAGY1, CRDTAGY2, CRDTAGY3, CRDTAGY4, CRDTAGY5 and INQCUST. GenApp LGICVS01 is down to one hole, READ GTEQ (the next blocker). CBSA BANKDATA (batch) loses all 25 RANDOM holes, and its file and CEE calls remain.
  • All surveyed programs: 86 → 92 / 150 whole. Programs with a RANDOM hole: 8 → 0.
  • No equivalence or crucible case runs an affected program, so no case proof applies. Pinned instead by test_det_programs.py::RANDOM (det port vs GnuCOBOL in the bytes / typed / groups modes: an unseeded first call, seeds 0 / 42 / 1,234,567 / 2,147,483,647, and CRDTAGY's and LGICVS01's COMPUTE shapes) and test_det_funcs.py (Funcs.Random vs glibc's own numbers, plus the refusals).

Also: estate4 ineligible list

cicsdev/cics-java-jcics-samples is added to estate4_draw.INELIGIBLE_LIST. It was census-counted on 2026-10-06 and is already in census/INELIGIBLE_FOR_BLIND_ESTATE.md. It cannot have been a draw candidate: GitHub reports 11,165 COBOL bytes, below rule 3's 20,000, and the draw's request cache holds no request for it. Rule 6's count therefore cannot move. docs/language_status/estate4_candidates.json is unchanged (sha256 f26139254a8a5049…, the same before and after) and so is estate4_candidates.md. RULES_MD ("the 9 census repos") is the frozen draw's text and is left as committed. The estate4 tests pass.

Checks

  • Tests were written first and failed on the unchanged code: test_det_translate.py (2 new), test_det_funcs.py, and test_det_programs.py::RANDOM (with EQUIVALENCE_E2E=1, all 3 modes passing against GnuCOBOL).
  • det_port.py check: no generated port changed. Only Funcs.java changed, by adding a class. proof_sweep.py --det-only --skip-db2 reports "as expected": 37 proved, and the 3 known-unproven cases are unchanged.
  • pr_gates.py --ratchets passes 6 of 6 (ports, port-surface, estate, fact-crosscheck, completeness, ground-truth). The full pr_gates.py passes lint, audits, secrets, xray, gauntlet, golden and suite.
  • Not run: the Db2 det cases (this change cannot reach them, since Funcs.Random is new and only programs using RANDOM call it) and the OS grid.

🤖 Generated with Claude Code

https://claude.ai/code/session_011wnQoeeAZP4npeyGnDviK6

…blocker ranking)

FUNCTION RANDOM (seeded and unseeded) translates onto cobolrt Funcs.Random:
GnuCOBOL 3.1.2's sequence (glibc srand/rand, rand()/RAND_MAX as a double),
one per program, reset by each entry point (a run unit; IBM's seed zero).
It does NOT reproduce z/OS's numbers (IBM's generator is unpublished):
oracle_assumptions.md C12 states what a proof then says. Seeds IBM does not
allow (negative, non-integer) or past the oracle's int are refused at run
time by name.

Census: CICS programs translated whole 69 -> 75 of 123 (burned 56 -> 62,
non-burned 13 -> 13): CBSA CRDTAGY1-5 and INQCUST.

Also: cicsdev/cics-java-jcics-samples on estate4_draw.INELIGIBLE_LIST
(census-counted 2026-10-06; fails rule 3, so no rule count moves;
estate4_candidates.json unchanged).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_011wnQoeeAZP4npeyGnDviK6
@squid-protocol squid-protocol added enhancement New feature, sensor, or structural signature legacy-modernization COBOL refractor, dead-code extraction, and JCL forging labels Oct 7, 2026
@github-actions

github-actions Bot commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

🐦‍⬛ Muninn Security Scan

✅ No security issues found.

🐦‍⬛ Powered by Muninn · Skald Lab

@squid-protocol
squid-protocol marked this pull request as ready for review October 7, 2026 01:44
@squid-protocol
squid-protocol merged commit 3b24800 into main Oct 7, 2026
37 of 38 checks passed
@squid-protocol
squid-protocol deleted the fix/det-function-random branch October 7, 2026 01:44
squid-protocol added a commit that referenced this pull request Oct 7, 2026
…on, unmask, pr_check (#4270, 1 of 2) (#4596)

* tooling: blocker baseline cache, history, provision, unmask (#4270)

- cics_census survey --baseline: one survey per main SHA with that commit's
  own translator, cached at <root>/census-cache/<sha>/ (a no-op once cached,
  locked); blockers --baseline and compare --before-baseline read it.
- cics_census history append/show: docs/language_status/blockers_history.jsonl,
  seeded with #4587 / #4590 / #4592 (approximate SHAs, noted) and #4593.
- equivalence_env --provision: private cics-crucible at the pin + census
  clones (INELIGIBLE_LIST minus burned; estate4 candidate names refused),
  provision.json with SHAs, the exports; --check WARNs on an off-pin shared
  checkout.
- blockers --unmask GAPKEY: what-if re-translation of the programs one
  whole-program refusal stops, with that check off via det.source.survey_unmask
  (survey-only; det_survey.py is its only caller).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_011wnQoeeAZP4npeyGnDviK6

* cics_census: --no-census reads no $CICS_CENSUS_CORPORA either (survey, usage, compare, blockers) (#4270)

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_011wnQoeeAZP4npeyGnDviK6

* cics_census: --no-census with --census-corpora is an error; regression test over survey, usage, compare (#4598)

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_011wnQoeeAZP4npeyGnDviK6

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature, sensor, or structural signature legacy-modernization COBOL refractor, dead-code extraction, and JCL forging

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant