Repository navigation
det ports: one-line field declarations (-20.7% code lines) and named 88 condition methods, under proof - #4202
Merged
Merged
Conversation
…0.7% code lines) - An 88's test without subscripts is emitted once as private boolean is<Name>(), documented with its lineage (/** 88 APPL-AOK of APPL-RESULT. */), and called at each use: the same expression, so behaviour does not change. 382 methods across the 50 cases; on its own +0.4% code lines (each test was already one expression). - Each COBOL item's Field is declared and bound to its storage on one line (private final Field x = Field.zoned(...)), in record order after the storages, replacing the declaration list plus the fields0..N() init chunks: -20.7% code lines over the 50 cases. The largest constructor (COACTUPC, 1,332 fields) proves. - det_parity: condition methods are not paragraphs; the methods count excludes them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RZE6us7fUL6Hynk59rWLvZ
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RZE6us7fUL6Hynk59rWLvZ
…; lesson: measure the det output Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RZE6us7fUL6Hynk59rWLvZ
squid-protocol
marked this pull request as ready for review
October 3, 2026 08:24
Contributor
squid-protocol
added a commit
that referenced
this pull request
Oct 3, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RZE6us7fUL6Hynk59rWLvZ
This was referenced Oct 3, 2026
squid-protocol
added a commit
that referenced
this pull request
Oct 3, 2026
…nstalls the translator's parser (#4220) Three test_det_programs tests asserted 'private Field x;', the declaration shape before #4202 (now 'private final Field x = Field.zoned(...)'). They test that an item stays byte storage; _byte_storage() asserts that property directly (a Field bound to its storage AND no typed declaration), stricter than before. No behaviour changed: the items are byte storage as before, and the GnuCOBOL end-to-end runs of all 9 test programs in bytes / typed / groups (27) match. CI missed it: the full-suite job never installed tree-sitter-language-pack, so every det-translator test importorskip'ped and the suite passed without them. smoke-test.yml full-suite and full-suite-gate.yml now install it (pinned 1.20.0; wheels for linux, macOS, Windows): +60 tests, ~18 s. Claude-Session: https://claude.ai/code/session_01RZE6us7fUL6Hynk59rWLvZ Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Oct 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Makes det ports smaller and more readable, with no change in behaviour.
What changed
Fieldis now declared and bound to its storage in one line, in record order after the storages:private final Field f3_FD_TRANCAT_ACCT_ID = Field.zoned(s_FD_TRAN_CAT_BAL_RECORD, 0, 11, 0, false, false, false);This replaces the declaration list plus the
fields0()..fieldsN()init chunks, which took two lines per item. The largest constructor is COACTUPC's, with 1,332 items, and it proves.private boolean isApplAok(), with its lineage/** 88 APPL-AOK of APPL-RESULT. */, and called at each use. 382 methods across the 50 cases. It is the same expression the use site held.det_paritycounts paragraph methods only, so the 88 methods are excluded from the methods count.Measured over all 50 cases (translate-only, main vs this branch)
Almost all of the saving comes from the field declarations. Naming the 88 tests saved nothing (+0.4% on its own), because each test was already one expression. The construct map's ~3,800-line estimate for that rule was based on the model ports' shape, not the det output. The 88 rule is kept for readability and lineage.
The det port's size relative to COBOL drops by about a fifth: roughly ×4.2 → ×3.3 in code lines. Measured on the main service file per program, structure is preserved (COBOL vs det ρ, 49 programs):
Proof
ed82b1487: det 48/50, the same 2 KNOWN_UNPROVEN; model 23/23; "as expected".PORT_INVARIANCE_WORK, 49 pairs) anddet_paritypass; no parity warnings.638144046fb51d50).ruff_audit --ciis clean, andtest_source_readspasses.Not done: typed accessors / typed values for simple items (the SENTINEL-style representation). That is the next rule, a separate PR.
🤖 Generated with Claude Code
https://claude.ai/code/session_01RZE6us7fUL6Hynk59rWLvZ