Skip to content

det runtime: COMP-5 can be held big-endian as z/OS does, behind a switch (Part of #5865, #7646) - #7671

Merged
squid-shepherd[bot] merged 3 commits into
mainfrom
churn/7646-20261104T0750Z
Nov 4, 2026
Merged

squid-shepherd[bot] merged 3 commits into
mainfrom
churn/7646-20261104T0750Z

Conversation

@squid-protocol

Copy link
Copy Markdown
Owner

Part of #5865, #7646. Slice 1 of 2: the runtime's z/OS big-endian COMP-5 byte image, with the oracle difference declared and pinned. Continues #7659 (merged).

What changed

  • Cobol.swapZosComp5(boolean) / Codec.littleEndian(Field): with the switch on, every COMP-5 item is two's-complement big-endian over its 2, 4 or 8 bytes, as z/OS holds it. Off (the default) keeps GnuCOBOL's little-endian image, so no generated port, golden or ledger moves. Only byte order changes: capacity, truncation and value are the same either way.
  • Declared comparator difference: the oracle's COMP-5 bytes are the z/OS bytes reversed, nothing else. Pinned both ways in test_det_programs.py: test_comp5_zos_byte_order_is_big_endian_and_the_default_is_the_oracles (port, both orders, S9(4) / S9(9) / S9(17), values 258, -2, 32767, 305419896, -1, 72623859790382856, IBM's layout written by hand) and test_comp5_zos_byte_order_difference_is_the_oracles_byte_reversal (GnuCOBOL, EQUIVALENCE_E2E=1, bytes read through a REDEFINES one at a time into a big-endian COMP item).
  • Register C7 records the switch and the difference. The translator still refuses every COMP-5 byte use: nothing is loosened.

Facts checked: the oracle's order measured on GnuCOBOL 3.1.2 (2026-11-04, test passes under EQUIVALENCE_E2E=1); the SQLCA (DetSql.putInt, sql.py SQLCODE) and Dsntiac read COMP-5 little-endian, so they must stay on the default when the switch is wired; layout.py:635 and program.py:1218 write / read the COMP-5 VALUE image little-endian.

Evidence levels: translated: unchanged (no port moved, switch off by default); executed-equivalent: byte order only, synthetic values, port vs reversal of the oracle, 6 cases x 2 orders (+ 6 oracle runs); residual risk: none for burned programs (no burned program observes COMP-5 bytes, #4271 det_port.py check).

Class / Sibling gaps

Class: a COMP-1 / COMP-2 / COMP-5 item whose bytes are observed through a group or REDEFINES overlap (census: 2 programs, #5865 rank 4). Members: COMP-5 byte order (runtime done here; translator wiring missing), COMP-1 / COMP-2 HFP bytes (runtime already stores HFP, translator refuses, oracle bytes are IEEE: missing), refusal wording (done, #7659).
Sibling gaps: COMP-5 inside file / sort records and BY REFERENCE / COMMAREA passes (stay refused, different mechanism, C7); the SQLCA and LE runtime little-endian reads (need a per-program guard when the switch is wired).

Remaining slices

  1. Translator wiring (det/gen.py, det/layout.py _put_value, det/program.py lifted-VALUE order, det/sql.py): lift the COMP-5 refusals only under a declared case difference; refuse SQL / LE programs in that mode; test.
  2. Equivalence harness (tests/tools/equivalence_common.py): a case declared_differences entry and the reversal comparator; evidence report line.
  3. HFP byte view for COMP-1 / COMP-2 under a declared difference (the oracle's IEEE bytes cannot be reversed into HFP: needs a value-level comparator), then the census re-run (aggregates only).

🤖 Generated with Claude Code

squid-protocol and others added 2 commits November 4, 2026 02:57
…tch; the oracle difference is a byte reversal (Part of #5865, #7646)

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 4, 2026
@squid-shepherd

squid-shepherd Bot commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

No description provided.

@squid-shepherd
squid-shepherd Bot marked this pull request as ready for review November 4, 2026 08:15
@squid-shepherd

squid-shepherd Bot commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

No description provided.

@squid-shepherd
squid-shepherd Bot enabled auto-merge (squash) November 4, 2026 08:17
@github-actions

github-actions Bot commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

🐦‍⬛ Muninn Security Scan

✅ No security issues found.

🐦‍⬛ Powered by Muninn · Skald Lab

@squid-shepherd
squid-shepherd Bot disabled auto-merge November 4, 2026 08:28
@squid-shepherd

squid-shepherd Bot commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

PR #7671 @ fbf5dc8: 1 failed check(s)

== ground-truth part 2/2 (failure) -- real
https://github.com/squid-protocol/gitgalaxy/actions/runs/41798151171/job/126467397254
repro: python -m pytest -q tests/cobol_mainframe/test_java_subprocess_utf8.py::test_no_java_subprocess_in_tests_decodes_with_locale_charset
failing tests: tests/cobol_mainframe/test_java_subprocess_utf8.py::test_no_java_subprocess_in_tests_decodes_with_locale_charset
errors:
fail-on-cache-miss: false
E AssertionError: tests/cobol_mainframe/test_det_programs.py:2934: javac missing '-encoding UTF-8'
tests/cobol_mainframe/test_java_subprocess_utf8.py:255: AssertionError
FAILED tests/cobol_mainframe/test_java_subprocess_utf8.py::test_no_java_subprocess_in_tests_decodes_with_locale_charset - AssertionError: tests/cobol_mainframe/test_det_programs.py:2934: javac missing '-encoding UTF-8'
##[error]Process completed with exit code 1.
log tail:
env:
GITGALAXY_LICENSE_KEY: COMMUNITY_FREE_TIER
GITGALAXY_MAINFRAME_CORPORA: /home/runner/work/gitgalaxy/gitgalaxy/.mainframe_corpora
MAINFRAME_ENGINE_KEY: c4e18840106efa795a1adca95a2df9f3acb63a2aecd3195da6dbddd4451eb419
PYTHONUTF8: 1
pythonLocation: /opt/hostedtoolcache/Python/3.12.15/x64
PKG_CONFIG_PATH: /opt/hostedtoolcache/Python/3.12.15/x64/lib/pkgconfig
Python_ROOT_DIR: /opt/hostedtoolcache/Python/3.12.15/x64
Python2_ROOT_DIR: /opt/hostedtoolcache/Python/3.12.15/x64
Python3_ROOT_DIR: /opt/hostedtoolcache/Python/3.12.15/x64
LD_LIBRARY_PATH: /opt/hostedtoolcache/Python/3.12.15/x64/lib
##[endgroup]
With the provided path, there will be 1 file uploaded
Artifact name is valid!
Root directory input is valid!
Uploading artifact: test-times-ground-truth-part-2.zip
Beginning upload of artifact content to blob storage
Uploaded bytes 156531
Finished uploading artifact content to blob storage!
SHA256 digest of uploaded artifact is 255bbfea6cdc3cf2723a865a45c5e78562d6d01588be7fb63d836840cd8800e9
Finalizing artifact upload
Artifact test-times-ground-truth-part-2 successfully finalized. Artifact ID 13306284526
Artifact test-times-ground-truth-part-2 has been successfully uploaded! Final size is 156531 bytes. Artifact ID is 13306284526
Artifact download URL: https://github.com/squid-protocol/gitgalaxy/actions/runs/41798151171/artifacts/13306284526
Post job cleanup.
[command]/usr/bin/git version
git version 2.56.0
Temporarily overriding HOME='/home/runner/work/_temp/49122b19-f8d5-4302-9689-b4ec5a62f4f3' before making global git config changes
Adding repository directory to the temporary git global config as a safe directory
[command]/usr/bin/git config --global --add safe.directory /home/runner/work/gitgalaxy/gitgalaxy/gitgalaxy
Removing SSH command configuration
[command]/usr/bin/git config --local --name-only --get-regexp core.sshCommand
[command]/usr/bin/git submodule foreach --recursive sh -c "git config --local --name-only --get-regexp 'core.sshCommand' && git config --local --unset-all 'core.sshCommand' || :"
Removing HTTP extra header
[command]/usr/bin/git config --local --name-only --get-regexp http.https://github.com/.extraheader
[command]/usr/bin/git submodule foreach --recursive sh -c "git config --local --name-only --get-regexp 'http.https://github.com/.extraheader' && git config --local --unset-all 'http.https://github.com/.extraheader' || :"
Removing includeIf entries pointing to credentials config files
[command]/usr/bin/git config --local --name-only --get-regexp ^includeIf.gitdir:
[command]/usr/bin/git submodule foreach --recursive git config --local --show-origin --name-only --get-regexp remote.origin.url
Cleaning up orphan processes

…e COMP-5 probe compiles and runs as UTF-8 (Part of #5865, #7646)

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

squid-shepherd Bot commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

No description provided.

@squid-shepherd
squid-shepherd Bot enabled auto-merge (squash) November 4, 2026 09:24
@squid-shepherd squid-shepherd Bot removed the shepherd:needs-fix Bot: a real failure on this head; see the digest comment. 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