Skip to content

Equivalence harness is a single-culture oracle: add an environment dimension (JVM locale, TZ, collation) and culture-aware inputs #3821

Closed

Description

@squid-protocol

What: Both harness sides run with ASCII collation (GnuCOBOL/BDB and H2), in UTC, with an empty LANG. The JVM inherits whatever locale and time zone the host has. Production runs in EBCDIC collation (letters before digits, lowercase before uppercase) in a local time zone. The two sides agree with each other and both differ from the mainframe.

Where:

  • tests/tools/equivalence_inputs.py:
    • keys are sorted in ASCII byte order;
    • _TEXT has only uppercase letters and digits, so order-sensitive paths never run.
  • equivalence_java.py: -DargLine pins no user.language, user.timezone or file.encoding.
  • equivalence.py: only COB_CURRENT_DATE is pinned.

Impact: Harness false pass for:

  • STARTBR / READNEXT order;
  • SORT / MERGE order;
  • comparisons such as IF X > '9';
  • the CURRENT-DATE offset;
  • locale digits.

Test: One case, varied environment. The Java side runs under tr-TR, ar-EG, th-TH-u-nu-thai, de-DE and TZ=Asia/Kolkata; its outputs must be byte-identical. The COBOL side also runs with an EBCDIC collating sequence where GnuCOBOL allows it (whether its indexed files honour that is not checked).

Fix:

  • Add an environment dimension to the harness (locale, TZ, collation).
  • Generate keys with mixed case, digits, national letters and punctuation.
  • Have the report state which collation an equivalence claim covers.

Found by a cultural-assumptions audit (2026-09-26): confirmed in code or by probe (JDK 17 locales, IBM code-page decoding, the harness's GnuCOBOL image) unless marked plausible.

🤖 Generated with Claude Code

Activity

  1. added
    bug
    legacy-modernization
    priority: high
    on Sep 26, 2026
  2. added a commit that references this issue on Sep 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    buglegacy-modernizationpriority: high

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions