Skip to content

Translation fidelity along the traceability map: compare each COBOL paragraph with the Java method it became #7532

Closed

Description

@squid-protocol

Why

A structural-fidelity analysis of the det-port on the burned estates (2026-11-02; ~/gitgalaxy/cics-fidelity/ on nyx) found two things:

  • The translations are complete: 184 cases, 47,717 statements, 0 holes.
  • They keep each estate's relative structure: the between-program distance geometry is preserved (Mantel ρ 0.45-0.47, p = 0.001), and per-program function count and size correlate 0.82-0.86.

But a global fingerprint (sfs, portable or structure lens) cannot pick out a port's own COBOL source: 1-3 of 124 programs, against 0.8 % chance. A plain size matcher does better. The reason is that det-port Java is mechanical by design: byte storage, a runtime, one call per statement, dispatch methods. Every port has the same shape, a median of 32-36 Java methods against 7 COBOL paragraphs, and that shared style swamps each program's individual signal.

So whole-program fingerprints are the wrong instrument for translation fidelity. The forge and det-port already know the mapping: every generated class and method is traced to its source line and fact (traceability.json). Fidelity should be measured along that map.

Proposal

For each translated program, pair every COBOL paragraph or section with the Java method(s) traced to it, and compare their structure:

  • branch outcomes (IF/EVALUATE/PERFORM UNTIL against if/switch/loops);
  • calls out (PERFORM / CALL / LINK against invocations);
  • size, and the reads/writes of data items against field access.

Report per program, per paragraph and per estate:

  • the share of paragraphs whose structure survives within a tolerance;
  • the outliers;
  • an estate-level fidelity score.

Controls: shuffled paragraph-method pairs, and pairs from unrelated programs, so a fidelity score comes with its chance level.

Where it fits

  • The architecture roadmap's "cross-language blueprint fidelity" item.
  • A structural layer beside the equivalence proofs. Proofs say the Java does what the COBOL did; this would say the Java is shaped like the COBOL, paragraph by paragraph, which is what a reviewer reads.
  • It is measurement only: no new cases or proofs on the burned estates (that evidence work is melek's lane).

Acceptance

  • A tool (tests/tools/…) that reads a port plus its traceability.json and writes a per-paragraph structural comparison.
  • Shuffled and unrelated controls, with the score reported against them.
  • A run over the burned-estate det-ports in both styles (default, --style structured --typed --groups), with the headline numbers posted here.

Activity

  1. added
    enhancement
    legacy-modernization
    on Nov 2, 2026
  2. squid-protocol commented on Nov 16, 2026

    @squid-protocol
    OwnerAuthor

    Implemented tests/tools/translation_fidelity.py in PR #8510 and ran it across the 29 CardDemo COBOL programs in both det modes (50 draws, seed=42):

    Mode Programs Fidelity Within Tolerance Shuffled Null (gap) Unrelated Null (gap)
    det default (dispatch) 29/29 0.5083 31.5% 0.3269 (+0.1814) 0.2484 (+0.2600)
    det --style structured --typed --groups 29/29 0.5241 37.2% 0.3291 (+0.1950) 0.2558 (+0.2683)

    --style structured --typed --groups measurably improves per-paragraph structural fidelity (+5.7 percentage points within tolerance) over default dispatch.

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

    enhancementlegacy-modernization

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions