Skip to content

det port: pointer table (POINTER OCCURS) element SET idioms (Part of #5079) - #7388

Merged
squid-shepherd[bot] merged 1 commit into
mainfrom
churn/5079-20261101T0408Z
Nov 1, 2026
Merged

squid-shepherd[bot] merged 1 commit into
mainfrom
churn/5079-20261101T0408Z

Conversation

@squid-protocol

Copy link
Copy Markdown
Owner

Part of #5079. Slice 1 of the issue: the pointer-table lane (a USAGE POINTER under OCCURS). WAIT EXTERNAL / WAITCICS are slice 2 (below).

What changed

  • det/stmt.py: SET <ref> TO ADDRESS OF x and SET ADDRESS OF rec TO <ref> accept a subscripted pointer (TBL(I), TBL(I, J)).
  • det/gen.py pointer_item: compares the OCCURS depth with the subscript count; a table named without subscripts (it would silently be its first element) or with the wrong count is refused by name. SET tbl TO NULL on a bare table is refused too.
  • det/cics.py pointer(): GETMAIN SET / FREEMAIN DATAPOINTER / WEB RECEIVE SET take an element.
  • docs/language_status/register/X47.md: the pointer-table entry (assumptions, refusals). Each element is its own 8-byte handle (Field.at); a handle is still not an address. No runtime Java change; GnuCOBOL holds POINTER OCCURS natively, so no oracle change.
  • tests/cobol_mainframe/test_pointer_table_5079.py (22 tests): translation of every idiom for a table, a table in a group and a table of groups; each refusal by name; a compiled-Java run (JDK-gated) showing independent slots, a NULL element, aliasing through a group copy and a freed element refused.

Class / Sibling gaps

Class: a pointer-lane operand that is not a plain scalar USAGE POINTER item. Done here: a subscripted element in every pointer idiom (SET both ways, SET NULL, GETMAIN SET, FREEMAIN DATAPOINTER, RECEIVE SET). Still refused by name: SET ADDRESS OF rec TO ADDRESS OF tbl(i) (an element is not modelled as an address target), a pointer table a REDEFINES overlays, a qualified pointer name. No burned-estate program needs any of them (none declares POINTER OCCURS).

Remaining slices

Slice 2: WAIT EXTERNAL / WAITCICS model (ECBLIST read from the pointer table, NUMEVENTS, INVREQ RESP2 1-5, posted ECB bit X'40' as a register assumption; CicsTask, DetCics, stub ggcics.c / equivalence_cics*.py, api.py, X63, a cics-crucible case). It exceeds this PR's five-hand-written-file cap. No burned-estate program issues either command.

Plan deviation

program.py is unchanged: its pointer_view_of / overlaid_pointers / write_only_pointers guards were already safe for tables. One hand-written file is also fewer than planned.

Evidence

  • New file 22 passed; tests/cobol_mainframe pointer / det_translate / whole-program / equivalence_cics: 1138 passed, 19 skipped.
  • det_port.py check: 236/236 ports unchanged. crucible_check.py: both legs PASS (zero golden diff). audit_check.py clean; pr_gates --fast 9/9 pass.
  • Evidence level: translated and unit-run on the port; no estate program or scenario uses it, so nothing is executed-equivalent.

Facts checked: _occurs_chain depth drives the subscript check; the 4771 / 5042 tests pin the "not a plain USAGE POINTER item" message, kept as a prefix; test_det_translate.py stubs the generator and binds only pointer_item, so the parse lives in cics.py.

Lessons for agents

  • A det test stub (test_det_translate.py G) binds only pointer_item: a new generator method that cics.py calls fails there; parse in cics.py instead.
  • Fixed-form test programs: wrap statements with textwrap.wrap(..., break_on_hyphens=False) or COBOL names split at hyphens.

🤖 Generated with Claude Code

…5079)

Each element of a USAGE POINTER under OCCURS is its own 8-byte handle:
SET tbl(i) TO ADDRESS OF x, SET ADDRESS OF rec TO tbl(i), SET tbl(i) TO
NULL, GETMAIN SET / FREEMAIN DATAPOINTER on an element. A table named
without subscripts, the wrong subscript count and ADDRESS OF an element
are refused by name.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@squid-protocol squid-protocol added the shepherd:merge Maintainer: merge when green (auto-merge, squash). Guide: docs/ci.md label Nov 1, 2026
@squid-shepherd

squid-shepherd Bot commented Nov 1, 2026

Copy link
Copy Markdown
Contributor

No description provided.

@squid-shepherd
squid-shepherd Bot marked this pull request as ready for review November 1, 2026 04:33
@squid-shepherd

squid-shepherd Bot commented Nov 1, 2026

Copy link
Copy Markdown
Contributor

No description provided.

@squid-shepherd
squid-shepherd Bot enabled auto-merge (squash) November 1, 2026 04:33
@github-actions

github-actions Bot commented Nov 1, 2026

Copy link
Copy Markdown
Contributor

🐦‍⬛ Muninn Security Scan

✅ No security issues found.

🐦‍⬛ Powered by Muninn · Skald Lab

@squid-shepherd
squid-shepherd Bot merged commit 4cf6d32 into main Nov 1, 2026
92 checks passed
@squid-shepherd
squid-shepherd Bot deleted the churn/5079-20261101T0408Z branch November 1, 2026 05:10
squid-shepherd Bot pushed a commit that referenced this pull request Nov 1, 2026
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