Skip to content

det + harness: a COMMAREA with data after a POINTER, each side by its own layout (Part of #4270) - #4764

Merged
squid-protocol merged 2 commits into
mainfrom
fix/4270-pointer-commarea
Oct 9, 2026
Merged

squid-protocol merged 2 commits into
mainfrom
fix/4270-pointer-commarea

Conversation

@squid-protocol

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

Copy link
Copy Markdown
Owner

Part of #4270. Unblocks the census's InqacccuDfhcommarea: data after a POINTER refusal (register C9).

Oracle option: none. cobc 3.1.2 (pinned image) lays a POINTER out as the build's sizeof(void *) (cobc --info: 64bit-mode: yes); no option or config key gives 4 bytes (numeric-pointer is BINARY-DOUBLE, still 8; -fbinary-size is PICTURE binary only). Only a 32-bit GnuCOBOL build would, which means a different oracle image, not a flag. So C9 stays a declared difference, and each side is compared through its own layout:

  • det (det/cics.py): the generated DTO carries IBM's offsets (4-byte POINTER) and the port's storage is GnuCOBOL's (8). Dto.at places each field past the wider POINTERs before it, so the data after a POINTER is the same field on both sides. A DTO whose OCCURS fields are listed once and that holds a POINTER carries its whole record (INQACCCU-COMMAREA: 1981 bytes on z/OS, 1985 here, all 20 accounts). A POINTER under an OCCURS, or a DTO POINTER that is not 4 bytes, is refused by name.
  • harness (equivalence_common.layout_fields / equivalence_cics): a record is laid out as the oracle stores it (POINTER 8 bytes), and fields are compared by name, never as raw bytes across the two layouts. A POINTER can only be given as "NULL" (an address is refused). On the way back, NULL decodes as absent (the det DTO's null), and an address never compares equal.
  • The C9 register entry, design doc and wiki are updated.

Whole programs: 111 -> 113 / 179 (cics_census.py blockers --all-programs, burned + local + census): BNK1CCA and CREACC are now whole. DELCUS loses this hole too and is left with READ/DELETE TOKEN only. INQACCCU was already whole.

Proofs

  • New case cbsa-inqacccu (INQACCCU + LINKed INQCUST + ABNDPROC, Db2 ACCOUNT, CUSTOMER file, 8 scenarios + 2 SQL faults): the det port proves 361/361 statements, through the java-facade too. Every field after COMM-PCB-POINTER matches by name.
  • tests/cobol_mainframe/test_pointer_commarea_4270.py: DTO mapping, the codec's offsets, refusals by name, harness layout / NULL-only compare. With EQUIVALENCE_E2E=1 it also runs vs cobc (bytes / typed / groups): the oracle's bytes = the harness's encoded record = the det port's storage.
  • det_port.py check vs origin/main: 70/80 unchanged. The 10 CBSA ports moved (codec offsets; LINKed DFHCOMMAREA storage, which is sized to the estate's longest DTO). proof_sweep.py --det-only on those 10 with local Db2: 10/10, as expected. The coverage ledger is updated.
  • proof_sweep.py --model-only (the harness compare changed): 28/28, as expected.
  • pr_gates --fast 5/5, --ratchets 7/7 pass (JDK 17). evidence.py status: only harness/oracle/generator (advisory) staleness, none blocking.

Follow-up filed: #4765. A COMMAREA's OCCURS fields are compared at the first occurrence only, and the det LINK span of an OCCURS DTO with no POINTER is the first occurrence's extent.

🤖 Generated with Claude Code

https://claude.ai/code/session_01MQNoe4wPJgr7dbUvs3DG6D

… own layout (Part of #4270)

cobc 3.1.2 has no option or config key for a 4-byte POINTER (64bit-mode build;
numeric-pointer is still 8), so register C9 stays a declared difference:
- det: the generated DTO carries IBM's offsets (4-byte POINTER), the port's storage
  is GnuCOBOL's (8). The COMMAREA codec places each field past the wider POINTERs
  before it (Dto.at) instead of refusing "data after a POINTER"; a DTO whose OCCURS
  fields appear once carries its whole record; a POINTER under an OCCURS, or a DTO
  POINTER not IBM's 4 bytes, is refused by name.
- harness: layout_fields lays a POINTER out as the oracle stores it (8 bytes), so
  fields after it are read where each program put them and compared by name; a
  POINTER is given and compared only as NULL (an address is refused / never equal).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01MQNoe4wPJgr7dbUvs3DG6D
…OINTER (Part of #4270)

A new CBSA case for the inquire-accounts-for-customer service, LINKed by BNK1CCA,
CREACC and DELCUS: LINK INQCUST (CUSTOMER file), the Db2 ACC-CURSOR into
ACCOUNT-DETAILS after COMM-PCB-POINTER, the +100 / not-found / zero / -305 paths.
Each side's COMMAREA read by its own layout, compared by name (register C9).
det port: 361/361 statements, PROVED on 10 scenarios (java-facade too).

The CBSA det ports moved (the COMMAREA codec and the LINKed programs' DFHCOMMAREA
storage, sized to the estate's longest DTO, now 1985 bytes): all 10 re-proved
(proof_sweep --det-only, Db2 local: as expected); coverage ledger updated.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01MQNoe4wPJgr7dbUvs3DG6D
from pathlib import Path

import pytest
from test_det_programs import PKG, _cobol, _java, _java_run, program
@github-actions

github-actions Bot commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

🐦‍⬛ Muninn Security Scan

✅ No security issues found.

🐦‍⬛ Powered by Muninn · Skald Lab

@squid-protocol squid-protocol changed the title WIP: det + harness: a COMMAREA with data after a POINTER, each side by its own layout (Part of #4270) det + harness: a COMMAREA with data after a POINTER, each side by its own layout (Part of #4270) Oct 9, 2026
@squid-protocol
squid-protocol marked this pull request as ready for review October 9, 2026 08:41
@squid-protocol
squid-protocol merged commit 09653db into main Oct 9, 2026
37 checks passed
@squid-protocol
squid-protocol deleted the fix/4270-pointer-commarea branch October 9, 2026 08:41
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.

2 participants