Skip to content

TRUNC(STD), IBM's default, on both sides of every proof (fixes #4102) - #4140

Merged
squid-protocol merged 3 commits into
mainfrom
feat/trunc-std
Oct 2, 2026
Merged

squid-protocol merged 3 commits into
mainfrom
feat/trunc-std

Conversation

@squid-protocol

Copy link
Copy Markdown
Owner

What

Fixes #4102. IBM Enterprise COBOL's default TRUNC(STD) now applies on both sides of every proof. Until now both sides ran TRUNC(BIN): they agreed with each other, and both differed from IBM.

  • COBOL side (harness). An option nothing names takes IBM's default (compiler_options.DEFAULTS). TRUNC(STD) maps to GnuCOBOL's -fbinary-truncate. Measured on gitgalaxy-gnucobol:3:

    • MOVE 99999 to S9(4) COMP gives +09999;
    • ADD 1 to 9999 raises SIZE ERROR;
    • COMPUTE 12345 stores +02345.

    -std=ibm alone keeps the binary item's bytes, which is TRUNC(BIN).

  • Java side (det port). Each entry point (runTask / runBatch / handleCall) sets its program's TRUNC and restores the caller's in a finally (Cobol.swapTruncBinary), so a LINK or CALL into a program compiled otherwise doesn't leak. The program's TRUNC comes from its CBL / PROCESS cards, else the case's compiler_options, else STD. CBSA's programs say PROCESS ... TRUNC(STD); CardDemo's compile procs name none.

  • Register C1 is now MATCHED.

Re-proven

Every case, since the oracle itself changed:

  • Det ports: 44 proven. 2 are not, the same two that were not proven before this change:
  • All 23 model-written ports re-prove (--faults all).
  • Nothing moved: no proven scenario puts more digits into a binary item than its PICTURE allows. GenApp's LGICDB01 could, with a 10-digit customer number.

Tests

  • pr_gates.py --fast: 5/5 pass.
  • Full suite: 13,377 passed.
  • The pinned "default flags" tests now expect -fbinary-truncate.
  • New test: test_each_entry_runs_with_its_programs_trunc.

🤖 Generated with Claude Code

https://claude.ai/code/session_01RZE6us7fUL6Hynk59rWLvZ

@github-actions

github-actions Bot commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

🐦‍⬛ Muninn Security Scan

✅ No security issues found.

🐦‍⬛ Powered by Muninn · Skald Lab

@squid-protocol
squid-protocol merged commit 67154cb into main Oct 2, 2026
38 checks passed
@squid-protocol
squid-protocol deleted the feat/trunc-std branch October 2, 2026 17:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Equivalence oracle runs IBM's default TRUNC(STD) as TRUNC(BIN) on both sides

1 participant