Skip to content

det/CICS: async child scheduler -- FETCH waits / TIMEOUT, FREE CHILD, START CHANNEL, RUN CHANNEL names per IBM (Part of #4950) - #5013

Merged
squid-protocol merged 9 commits into
mainfrom
churn/4950-20261012T1808Z
Oct 12, 2026
Merged

squid-protocol merged 9 commits into
mainfrom
churn/4950-20261012T1808Z

Conversation

@squid-protocol

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

Copy link
Copy Markdown
Owner

Part of #4950 (a sibling of #4884).

Before this PR, a RUN TRANSID child ran only after its parent ended. Every FETCH was therefore forced to count as a difference (FETCH_DIFFERS), and the rest of the async API was refused. This PR adds a child scheduler to both runtimes: the stub ggcics.c and the generated CicsTask. The det translator and the equivalence harness are wired to it.

The schedule (register X18, ASSUMED where IBM is silent)

  • When a child runs. At its parent's next wait: a DELAY, or a FETCH without NOSUSPEND. Children run in RUN order, each to its end, before the parent resumes (quasi-reentrant TCB).
  • When it completes. A task takes no CPU time (X4). A child completes at its dispatch time plus its own DELAYs, on a scheduling clock that counts only DELAYs and FETCH waits. EIBTIME and ASKTIME do not move.
  • What a child gets. EIBTASKN is the parent's plus its RUN number. It has no terminal and no COMMAREA. Its current channel is the copy RUN made.
  • FETCH NOSUSPEND finds a child that completed before the parent's time T, else returns NOTFINISHED 52.
  • A waiting FETCH resumes when the child completes.
  • FETCH TIMEOUT(t) returns NOTFINISHED 53 when no child completes before T + t.
  • FETCH ANY takes the first child to complete, with RUN order breaking ties. It returns NOTFND 1 when no unfetched child is left and INVREQ 52 when the task has no children.
  • FETCH on NORMAL writes ANY, COMPSTATUS (NORMAL 1016 / ABEND 900), and ABCODE (only for a child that abended). CHANNEL gets a copy of the channel the child left, named by the harness (GGREPLY…).
  • FREE CHILD: a bad or already-freed token is INVREQ 50. After it, FETCH CHILD of that token is INVREQ 50 and FETCH ANY skips it.
  • Channel names (RUN / START CHANNEL) use IBM's character set, quoted from the RUN TRANSID page. Any other character is CHANNELERR 1.
  • START CHANNEL hands the started task a copy of the containers as they are at the START. The START event carries that copy.
  • Refused by name:
    • a FETCH whose answer depends on a tie at the parent's instant;
    • a dispatched child's command on a region resource or terminal (ENQ, counters and SQL in a child program are refused when the case is built);
    • grandchildren;
    • a second FETCH CHILD of a fetched child, and FREE CHILD of a fetched child;
    • FETCH CHANNEL when the child left no channel;
    • a child that recovered from an abend;
    • DELAY TIME in a task that has children;
    • DFH* channel names.

Comparison: a dispatched child's events form one CHILD event, compared as a task's events. FETCH is now compared field by field.

Class (async CICS API task-to-task members)

member status
FETCH that waits / TIMEOUT modelled here
FETCH NOSUSPEND answering NORMAL modelled here (FETCH_DIFFERS removed)
FREE CHILD modelled here (it was refused under the name "FREE")
START CHANNEL modelled here (the event carries the copy)
RUN CHANNEL names with symbols modelled here (IBM's character set)
DELAY as the dispatching wait modelled here (DELAY was a no-op on the stub)

Oracle fixes found on CBSA CRECUST

These are inert for every existing case (checked against all cics cases).

  • An EXEC CICS inside a literal (DISPLAY 'EXEC CICS FETCH ANY failed...') or on a D debugging line is no longer translated as a command. WITH DEBUGGING MODE in force is refused.
  • The CEEIGZCT stand-in (L4) is staged on the stub side.
  • The LE models are linked for a direct CEE CALL.

Evidence

  • Runtime scripts: tests/cics_crucible/test_cics_runtimes.py runs the same 12 step scripts on the C stub and on CicsTask, and both give the same answers. The scripts cover completion order, NOSUSPEND before and after a wait, TIMEOUT running out, FREE CHILD, an abended child, NOTFND, INVREQ 50 / 52, IBM's channel characters, CHANNELERR, a tie, R1, a second FETCH, DFH names, the TIMEOUT range, and a child with no program. START CHANNEL has its own test on both runtimes.
  • det_port check: 19 ports changed in their own code, all of them the DELAY line. Those 19 plus asynccc-csstats2 were re-proved: 20/20 PROVED (asynccc ×8, cbsa-crdtagy1-5, creacc, custctrl, inqacccu, inqcust, xfrfun, bnk1cac, bnk1dcs).
  • CRECUST on the oracle: the five credit agencies complete in the right order (children 2, 4, 5 at 1 s, then 1, 3 at 2 s), and the sixth FETCH ANY returns NOTFND 1. CRECUST still cannot be proven: its CEEDAYS passes a 10-byte picture over an 8-byte 'YYYYMMDD', which L1 refuses by design. No case is committed for it.
  • Gates: pr_gates --fast 5/5; pr_gates --ratchets 7/7 (cics-spec, ports, port-surface, estate, fact-crosscheck, completeness, ground-truth). audit_check clean. Evidence: no record stale on a blocking input. The CICS spec, det, equivalence, crecust-rest and runtime tests pass.

Sibling gaps (not in this PR)

  • CBSA CRECUST is not provable. Its CEEDAYS reads 2 bytes past the picture field. That is an L1 / LE-model decision, not this mechanism.
  • cics-crucible scheduler: the runners do not dispatch RUN children at waits (no childprogs), and do not hand a START CHANNEL's copy to the started task. No crucible case uses either.
  • A child's region-resource commands (R1) are refused rather than interleaved with the parent's.
  • Names in container commands (PUT/GET CONTAINER and LINK/XCTL CHANNEL) still refuse names channelName does not accept; they don't use the IBM character set yet.
  • asynccc ASYNCPNT (waiting FETCH CHILD with CHANNEL) has no case. That corpus is not a burned estate.

🤖 Generated with Claude Code

squid-protocol and others added 9 commits October 12, 2026 18:01
…CHILD, START/RUN CHANNEL names)

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…MEOUT / FREE CHILD / START CHANNEL)

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…nes as CRECUST needs; CEEIGZCT stand-in and LE models on the stub side

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
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

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