Skip to content

Equivalence harness: inputs generated from record layouts (#3804) - #3808

Merged
squid-protocol merged 3 commits into
mainfrom
feat/generated-inputs-3804
Sep 26, 2026
Merged

squid-protocol merged 3 commits into
mainfrom
feat/generated-inputs-3804

Conversation

@squid-protocol

Copy link
Copy Markdown
Owner

Part of #3804 (epic #3803). This is the piece that makes a fresh estate testable: most repositories ship no data, and one sample file reaches only the paths its records do.

What it does

A dataset's input may now be "@generate": records built from its copybook layout (tests/tools/equivalence_inputs.py).

  • Numerics (DISPLAY zoned, COMP-3, COMP): edge values first (zero, one, the PICTURE's maximum and its negative, the smallest fraction at its scale), then values spread over the range.
  • Text: full width, short, and blank. Date-shaped fields get valid YYYY-MM-DD values. FILLER stays blank.
  • Keys: the primary key is unique and never blank, and an indexed dataset is written in key order, as a KSDS loads.
  • Joins: a from rule draws a field from another generated file, so lookups find their row; miss makes some deliberately not, so not-found paths run too. Files are generated in dependency order, and a cycle is refused.
  • values with every fills a cartesian product (every group × type × category).
  • Seeded: the same seed gives byte-identical files.

A case can also prove another case's port with "port_from".

Result

carddemo-intcalc-generated runs the CBACT04C port, which was written against CardDemo's own data, on generated inputs:

  • accounts with edge-case balances and limits;
  • a cross-reference per account;
  • category balances drawn from the cross-references;
  • rates for every group × type × category, with edge-case rates;
  • one account group that has no rates, so the DEFAULT fallback path runs (11 times).
output equal
ACCTFILE 30/30
TRANSACT 37/37
RETURN-CODE 0 = 0

The port holds on data it was never written against.

Still to do for #3804

Tests

test_equivalence_inputs.py covers:

  • each storage type round-trips through the diff's own decoder;
  • edges come first;
  • keys are unique, sorted and non-blank; FILLER is blank;
  • joins draw from the joined file, and misses do not;
  • every fills a cartesian product;
  • determinism per seed;
  • dependency order and cycle refusal;
  • a gated end-to-end run (EQUIVALENCE_E2E=1).

The mainframe suite passes locally with end-to-end runs on: 705 passed.

🤖 Generated with Claude Code

https://claude.ai/code/session_017ZsVaAkb86P5r5JXDC2Y9g

A dataset's input may be "@generate": records built from its copybook layout
(tests/tools/equivalence_inputs.py) -- per PICTURE, edge values first (zero, one,
the maximum and its negative, the smallest fraction), then spread; text at full
width, short and blank; YYYY-MM-DD for date-shaped fields; FILLER blank. Primary
keys are unique and never blank, an indexed dataset is in key order; "from" draws
a field from another generated file (with "miss" for the not-found path), "values"
with "every" fills a cartesian product; seeded, byte-identical per seed. A case
may prove another case's port ("port_from").

carddemo-intcalc-generated: the CBACT04C port -- written against CardDemo's data --
on generated accounts, cross-references, category balances and disclosure groups
(one group without rates: the DEFAULT fallback ran 11 times): ACCTFILE 30/30,
TRANSACT 37/37, RETURN-CODE 0 = 0.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017ZsVaAkb86P5r5JXDC2Y9g
Comment thread tests/tools/equivalence.py Fixed
Comment thread tests/tools/equivalence_inputs.py Fixed
@github-actions

Copy link
Copy Markdown
Contributor

🐦‍⬛ Muninn Security Scan

✅ No security issues found.

🐦‍⬛ Powered by Muninn · Skald Lab

…CodeQL cyclic import, #3808)

equivalence_inputs builds on equivalence_common instead of importing the batch harness
that calls it. The module is byte-identical to #3801's, so the two merge cleanly.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017ZsVaAkb86P5r5JXDC2Y9g
Comment thread tests/tools/equivalence.py Fixed
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.

2 participants