Skip to content

det translator takes the engine's record layouts, with a check mode (Part of #5649) - #5693

Merged
squid-protocol merged 2 commits into
mainfrom
churn/5649-20261020T0351Z
Oct 20, 2026
Merged

squid-protocol merged 2 commits into
mainfrom
churn/5649-20261020T0351Z

Conversation

@squid-protocol

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

Copy link
Copy Markdown
Owner

Part of #5649 (slice 2 = issue Work step 3). Slice 1 (steps 1-2) merged as #5656.

Owner decisions

Issue #5649 (owner OK 2026-10-19; copy this line into the PR body under ## Owner decisions): translator consumes engine record layouts.

What

The det translator can now take every record layout from the engine (GalaxyIR.record_layout) instead of computing it
itself. It asks for its own storage's POINTER width (det.cics.POINTER_BYTES = 8, GnuCOBOL x86-64, register C9),
the parameter added in #5656. The translator's own computation stays beside it behind a check mode for one release:
any difference refuses the program by name (LayoutDisagrees).

  • gitgalaxy/tools/cobol_to_java/det/engine_layout.py (new):
  • det/program.py: translate(..., layouts=) is passed down to _translate and to sibling-program services.
    stats["engine_layouts"] = {engine, own} record counts.
  • tests/tools/det_port.py: port_case passes check-mode layouts from the estate's scan DB (the clean room beside
    the generated project).
  • tests/tools/fact_crosscheck.py: engine_extras uses EngineRecords (same matching as before, no ledger move).

Records the engine has no entry for keep the translator's layout and are counted as own: system members such as
DFHAID / DFHBMSCA, generated BMS maps, special registers.

Class (record-layout facts both sides computed)

Member Status here Evidence
elementary offsets / widths engine adopt; toy test at z/OS 4 moves every item after a POINTER
group spans derived from engine items test: WS-REC 0+11 at width 4
REDEFINES overlays follow the moved target test: R-ALT sits on R-X @4
OCCURS strides engine width / occurs test: T-E stride 5, T-END @15
copied records (COPY, REPLACING) engine via EngineRecords test: CP-REC consumed
records outside the estate translator's own (no engine entry) test: SYS-REC own

Evidence

  • det_port.py check (fresh --work, base = origin/main): 139/139 ports unchanged with check mode on. Every
    burned-estate port (CardDemo, CBSA, GenApp, zECS, DBB MortgageApplication, async credit-card) translates
    byte-for-byte the same on engine layouts, and no record refused. The Java is identical, so no proof moves and nothing
    needs re-proving.
  • Confirmed the layouts were really consumed, not skipped because no scan was found. Probe on the CardDemo estate:
    cardupdate 16 records from the engine / 2 own, posttran 48/2, signon 57/4, cbstm03b 66/4. The only records left to
    the translator are DFHAID and DFHBMSCA.
  • pr_gates.py --fast 6/6. pr_gates.py --ratchets 8/8 (ports, port-surface, estate, fact-crosscheck, completeness, ground-truth, cics-spec, time). Tree-wide guard tests pass (184). tests/tools/ 1066 passed; one failure, test_pin_requirements_check_all: uv reports six ci/requirements / templates/requirements files stale. This PR does not touch them. The run used -x, so the det / cross-check test files after that point were run separately: 970 passed, 115 skipped (Docker / JDK end-to-end cells; the translation is byte-identical, so they are unaffected).
    . New/changed tests timed: 0 over the limit.
  • Fact cross-check ledger: unchanged (138). The matching moved but did not change.

Remaining slices

  1. Wire the other translate() callers to layouts=: tests/tools/equivalence_java.py,
    gitgalaxy/tools/cobol_to_java/port_runner.py, tests/tools/cics_crucible_det.py, cics_case_ports.py,
    det_survey.py, readiness/dryrun.py. Each needs a GalaxyIR for its estate; the CICS crucible cases have none
    today, so they need a scan step first.
  2. Step 4: docs/language_status/fact_ownership.md, the "record layouts / offsets" row. State that layouts are
    owned and computed by the engine and that the translator consumes them in check mode. Add the numbers above.
  3. After one release in check mode: switch to engine mode, delete the translator's own offset computation in
    det/layout.py, and retire the duplicate check.

Sibling gaps

  • PROCEDURE-POINTER / FUNCTION-POINTER widths. The engine reports them as unknown width, so a record holding one
    would refuse (does not know the record's width). Needed by DBB MortgageApplication epscsmrd.cbl
    (1 ROUTINE PROCEDURE-POINTER). It is not in a det_port case today: check mode passed on all 139.
  • No SYNC in the translator; the engine models it. In engine mode the two would agree only by adopting the
    engine's slack. No burned program declares POINTER SYNC.
  • DFHAID / DFHBMSCA / DFHEIBLK / SQLCA / SQLDA stay translator-laid: the engine treats them as system members.
    Programs: CardDemo COCRDUPC, COUSR01C, COTRN02C (DFHAID); CBSA UPDACC.

🤖 Generated with Claude Code

@squid-protocol squid-protocol added the shepherd:merge Maintainer: merge when green (auto-merge, squash). Guide: docs/ci.md label Oct 20, 2026
@squid-protocol

Copy link
Copy Markdown
Owner Author

No description provided.

@github-actions

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

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