Skip to content

Proofs compare DISPLAY / SYSOUT (#4056) and SEND MAP attributes (#4053) - #4061

Merged
squid-protocol merged 11 commits into
mainfrom
pr/sysout-attrs
Oct 1, 2026
Merged

squid-protocol merged 11 commits into
mainfrom
pr/sysout-attrs

Conversation

@squid-protocol

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

Copy link
Copy Markdown
Owner

Closes #4056 and #4053, two gaps in what the equivalence proofs compare, both found by mutation testing (#4047, epic #4055).

#4056: batch proofs now compare DISPLAY / SYSOUT

Before, a port that wrote the wrong job-log message, or none, was still proven.

  • COBOL side. The step's stdout is SYSOUT. GnuCOBOL and IBM write two kinds of item differently:

    • a signed zoned item: 012- vs IBM's 01K;
    • a binary or packed item: -00007 vs IBM's 000P.

    tests/equivalence/faults/ggdisplay.c is preloaded in front of cob_display and writes those as IBM documents. An operand it does not model (floating point) is marked GGDISPLAY-NOT-MODELLED, and that run's SYSOUT is reported as not compared. It is never compared against GnuCOBOL's text.

  • Java side. A generated batch runtime class Sysout (display, displayNoAdvancing, and number for IBM's text of a numeric item). The harness gives each run its own SYSOUT file.

  • Comparison. compare_run compares SYSOUT line by line in every run, including after an abend. Trailing blanks are ignored (a SYSOUT record is blank-padded), and so are libcob's own messages. The loop's feedback shows the differing lines. A case can opt out with "sysout": false.

  • Ticket. A DISPLAY is now Sysout.display with IBM's exact text (it was "a DISPLAY becomes a log line"). Sysout.java is in the prompt's runtime.

Ports

  • CBACT04C (hand port): now proven on 20 runs, all 152 SYSOUT lines equal. It never DISPLAYed each TCATBAL record, and it printed a 9x file status wrongly.
  • CBTRN02C (hand port): now proven on 29 runs, all 54 SYSOUT lines equal. The comparison found a defect in the original COBOL: when closing DALYREJS fails, it reports XREFFILE-STATUS. The defect is kept in the port and documented.
  • CBTRN03C (the loop's port): a model's port is never hand-edited, so the porting loop re-ran from scratch on the new ticket. It was proven on attempt 2: 447/447 records, 264/264 SYSOUT lines, 24/24 fault runs. Attempt 1 read the records as IBM037, which led to Porting ticket: the records' code page is never stated -- a model guessed IBM037 for Latin-1 data #4060 (the ticket never states the records' code page). The provenance records both attempts.

#4053: CICS proofs now compare a SEND MAP's attributes, colour, highlight, cursor and options

Before, a port that showed an error in the wrong colour, or never placed the cursor, was still proven.

Tests

  • tests/cobol_mainframe/test_equivalence_sysout_attrs.py: the SYSOUT rules, the not-modelled refusal, comparison after an abend, the ticket rule, the subfield comparison, unset subfields, and the DISPLAY model against IBM's documented text (Docker, EQUIVALENCE_E2E=1).
  • The EQUIVALENCE_E2E proofs of the committed loop ports pass, as does the full tests/ tree locally (13,207 passed).

Mutation scores after these fixes (fast mode, #4047)

case mutants caught score note
COMEN01C (CICS) the same 150 as before (seed 0) 77/135 57% (was 56%) the 2 newly killed are the targets: errmsgColor = DFHRED deleted, and a message literal
CBTRN03C 40 (seed 1) 26/37 70%
CBTRN02C 40 (seed 1) 25/32 78%
CBACT04C 40 (seed 1) 30/35 86%

The batch samples are not a clean before/after: the earlier batch samples were 8 mutants each, and the ports themselves changed here. The job-log mutants that used to survive (a changed ERROR OPENING ... literal, a deleted displayIoStatus) are killed now. What still survives in batch is mostly equivalent mutants (a rounding mode on a value already at its scale) or boundaries the cases never test (an expiry date equal to the transaction date; a non-numeric file status). The menu's survivors are case gaps: options and user types no scenario picks. That is the test-strengthening loop's job (#4049), not this PR's.

🤖 Generated with Claude Code

https://claude.ai/code/session_01RZE6us7fUL6Hynk59rWLvZ

squid-protocol and others added 11 commits September 30, 2026 18:06
tests/tools/mutation.py breaks a proven port one small change at a time
(ROR, COR, NEG, AOR, BDM, CON, LIT, RET, DEL), drops the mutants javac
refuses against the baseline's classpath, and proves the rest with the
equivalence harness, N at a time under a time limit. A survivor is an
equivalent mutant or a place the case never looks. It writes
mutation.json / mutation.md: the score, the runs that killed each
mutant (the fault runs' share), and every survivor.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01RZE6us7fUL6Hynk59rWLvZ
A mutant differs from the proven port in one file, yet each proof redid
the COBOL runs and regenerated the whole estate. equivalence.py run
--reuse EARLIER takes EARLIER's COBOL outputs for each step whose run.sh
is byte-identical, and EARLIER's generated project re-overlaid with the
port (the same files, or it refuses), compiling only the port's files
with the pom's javac options. --first-difference stops a batch proof at
the first differing run: the same verdict, fewer runs named.

mutation.py uses both by default; --full keeps the from-scratch proof as
the reference, and `compare` checks the two agree mutant by mutant.
TRNRPT under load: a killed mutant 12-17 s instead of 282 s; a survivor
still needs every run.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01RZE6us7fUL6Hynk59rWLvZ
…current

With --reuse, EquivalenceRunTest runs through the JUnit Platform launcher
surefire itself drives (the same platform version, from the local
repository), one fresh JVM per run, without Maven -- only when the main
classes were compiled from the port and target/test-classes from this very
test source (a snapshot each successful Maven run leaves); anything else
goes back to Maven. The launcher class is compiled once and shared.

TRNRPT smoke sample, same mutants, same verdicts: a survivor (all 25 runs)
270 s -> ~190 s under load; the date check's single-run proof ~50 s -> ~8-12 s.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01RZE6us7fUL6Hynk59rWLvZ
mutation.py run --only DIR re-judges exactly the mutants another run
judged, so the fast mode is checked against a --full reference mutant by
mutant. Result: 386 of 386 agree (CSUTLDTC 206, COMEN01C 150, and 10
each of TRNRPT / POSTTRAN / INTCALC with their fault runs).

docs/language_status/mutation_testing.md: operators, fast mode and its
validation, first scores, and what survives (case gaps, harness gaps
#4053 / #4056, equivalent mutants). The porting-loop skill points to it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01RZE6us7fUL6Hynk59rWLvZ
The batch proof compared datasets, the return code and the abend, never
the job log: a port that DISPLAYed the wrong message, or none, was still
proven (mutation testing, #4047).

- COBOL side: the step's stdout is SYSOUT. GnuCOBOL and IBM write a signed
  zoned item (012- vs 01K) and a binary / packed item (-00007 vs 000P)
  differently, so tests/equivalence/faults/ggdisplay.c (preloaded in front
  of cob_display) writes those as IBM documents; anything it does not model
  (floating point) is marked GGDISPLAY-NOT-MODELLED and that run's SYSOUT is
  reported as not compared, never compared against GnuCOBOL's text.
- Java side: a generated batch runtime class Sysout (display,
  displayNoAdvancing, number: IBM's text of a numeric item). The harness
  points it at a per-run file.
- compare_run compares SYSOUT line by line, trailing blanks aside (a SYSOUT
  record is blank-padded) and libcob's own messages left out, in every run
  -- after an abend too. The loop's feedback shows the differing lines.
- The port ticket: a DISPLAY is Sysout.display with IBM's exact text (was:
  "a DISPLAY becomes a log line"); Sysout.java is in the prompt's runtime.
- The hand ports: CBACT04C (152 lines; it never DISPLAYed each TCATBAL
  record, and printed a 9x status wrongly) and CBTRN02C (54 lines) route
  every DISPLAY through Sysout. CBTRN02C's comparison found a defect of the
  original: closing DALYREJS reports XREFFILE-STATUS. Kept, documented.
  Both proven on every run again (20 and 29 runs).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01RZE6us7fUL6Hynk59rWLvZ
… options

The CICS equivalence proof compared each screen's text only: a port that
showed an error in the wrong colour, or never put the cursor in the field,
was still proven (mutation testing, #4047: deleting the menu's
`errmsgColor = DFHRED` survived).

- COBOL side: from the symbolic map's bytes, per field, the attribute byte
  (<f>A / <f>F: one byte), extended colour (<f>C) and highlight (<f>H) and
  length -1 (<f>L: the cursor), plus the SEND MAP options and CURSOR value
  the stub logs. The harness's DFHBMSCA holds the EBCDIC bytes, so a byte is
  its value. X'00' is "not set" (BMS takes the map's own); so is a space:
  WORKING-STORAGE GnuCOBOL initialised where IBM leaves it undefined (a map
  the program never cleared) -- nothing is claimed about those bytes.
- Java side: CicsTask already records MapSubfields, options and cursor
  (#4001); compare_events now compares them, in the same terms.
- The account view hand port (COACTVWC) never set them: it now ports
  1300-SETUP-SCREEN-ATTRS (DFHBMFSE, the cursor, red on a bad or missing
  filter, the info line's colour) and SEND MAP CURSOR ERASE FREEKB.
  Proven again on all 11 scenarios; the menu (COMEN01C, the loop's port)
  was already right and stays proven.

The CICS crucible compares subfields in its own pipeline since #4001.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01RZE6us7fUL6Hynk59rWLvZ
…rule

The committed CBTRN03C port (the loop's, 2026-09-30) logged its DISPLAYs,
as the ticket then said: not proven once SYSOUT is compared. A model's
port is never hand-edited, so the loop ran again from scratch on the new
ticket: claude-sonnet-5-5, proven on attempt 2 (447/447 report records,
264/264 SYSOUT lines, 24/24 fault runs). Attempt 1 read the records as
IBM037 instead of the data's ISO-8859-1 -- the ticket never states the
records' code page -- and the SYSOUT feedback showed it. Unedited; the
provenance records both attempts and what it supersedes.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01RZE6us7fUL6Hynk59rWLvZ
@github-actions

github-actions Bot commented Oct 1, 2026

Copy link
Copy Markdown
Contributor

🐦‍⬛ Muninn Security Scan

✅ No security issues found.

🐦‍⬛ Powered by Muninn · Skald Lab

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.

Batch equivalence ignores DISPLAY / SYSOUT: a port that writes the wrong job-log message is still proven

1 participant