Skip to content

equivalence: declared COMP-5 reversal at diff_varseq and the CALL comparators (Part of #7646) - #7729

Merged
squid-shepherd[bot] merged 1 commit into
mainfrom
churn/7646-20261104T1949Z
Nov 4, 2026
Merged

squid-shepherd[bot] merged 1 commit into
mainfrom
churn/7646-20261104T1949Z

Conversation

@squid-protocol

Copy link
Copy Markdown
Owner

Part of #7646 (slice 4: the declared COMP-5 reversal at the sibling comparators, after #7725).

What

A case declaring "declared_differences": ["comp5_byte_order"] now has the oracle's COMP-5 bytes (2+ bytes) read as z/OS holds them at two more comparators; the port holds the z/OS image (translate(zos_comp5=True)). Only the oracle side of COMP-5 fields is reversed; an undeclared case compares exactly as before (tests pin this).

  • equivalence_common.py: diff_varseq(..., oracle_comp5_reversed=) passes the flag to each record's diff_records; new comp5_zos_record(rec, fields) reads every field from the original bytes, so a REDEFINES over one COMP-5 field is reversed once (the slice-3 in-place loop would have reversed it twice; diff_records now uses the helper, byte-identical for non-overlapping layouts).
  • equivalence.py: the variable-record dataset call passes the flag.
  • equivalence_call.py: compare_dto reads the declaration; compare_item(..., oracle_comp5_reversed=): the area path (port's bytes) passes it to diff_records; the DTO path reverses the oracle item before decoding and before reading ODO counts (decode_field reads COMP-5 big-endian, so the oracle's little-endian bytes would otherwise decode wrong).
  • Tests in test_equivalence_declared_differences.py: varseq equal/undeclared-differs/value-difference/no-layout; REDEFINES once; compare_item area and DTO paths, declared and undeclared.

Class / Sibling gaps

Class: comparators that read a record's bytes against the oracle's, each of which must undo the declared COMP-5 byte order for a case that declares it.

Member Status
fixed-record datasets (equivalence.compare_run) handled (#7725)
diff_varseq handled here
equivalence_call.compare_item (area + DTO paths), compare_dto handled here
equivalence_call.run_case non-DTO record_fields compare not here: its items are compared as DISPLAY text bytes with no layout, so a COMP-5 field inside one cannot be located; needs a per-item layout (own design)
equivalence_cics.compare_files not here: separate file (4000+ lines) and tests
equivalence_ims.diff_db / diff_gsam not here: separate file and tests
equivalence.py::_compare_tables not here: Db2 table decode path, its own test

A case declaring the difference at a not-yet-handled comparator shows false differences, never a false pass.

Remaining slices

  1. equivalence_cics.compare_files (one file + test).
  2. equivalence_ims.diff_db / diff_gsam (one file + test).
  3. _compare_tables (equivalence.py + test) and the CALL run_case text-item compare.
  4. A real proof on a burned program under the switch; HFP byte view for COMP-1/2; census re-run.

Gates

pr_gates.py --fast: 9/9 PASS (ruff 0.17.2 pinned). pytest tests/tools -k equivalence: 508 passed, 2 skipped. Not run: --ratchets/golden (no engine code touched), a real equivalence proof (Docker/GnuCOBOL).

Cross-repo

None.

🤖 Generated with Claude Code

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

squid-shepherd Bot commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

No description provided.

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