Skip to content

register: a zero divisor inside a float expression stays a named stop (Part of #4687) - #5330

Merged
squid-protocol merged 1 commit into
mainfrom
churn/4687-20261017T1105Z
Oct 17, 2026
Merged

squid-protocol merged 1 commit into
mainfrom
churn/4687-20261017T1105Z

Conversation

@squid-protocol

Copy link
Copy Markdown
Owner

Part of #4687, #4270.

What changed

The issue offered two routes: replay the OSVS alignment plan for float statements, or keep the named stop and register it. I built the replay and ran it against the oracle (25-shape matrix, COMP-1 and COMP-2), then took the second route.

Why the replay was rejected. The oracle aligns every intermediate of a float expression with two or more operations, and a float receiver counts as one with places, so it truncates integers too:

statement (C=3, F=7) oracle det port / z/OS
G = C + C + C 3 9
G = F * C * C 0 63
G = C + F / FZ + C 3 refused
G = C + C + F / FZ 0 refused

A replay confined to the NaN matched 23 of 25 shapes and missed the rest. One that copied the plan would reproduce an oracle artifact IBM does not have. The reference is IBM, and z/OS leaves a zero divide undefined, so the stop is the honest answer.

  • docs/language_status/register/C14.md: records the measurement and the decision.
  • tests/cobol_mainframe/test_det_size_error.py: a Docker-free codegen test pins the stop (whole-value division is Hfp.divide, nested is Hfp.divideNested, no division is plain HFP).

No translator, runtime or golden change.

Gates

pr_gates.py --fast 6/6, cobolrt_rules.py --check consistent, the test file passes. Not run: det_port.py check and crucible_check.py (no engine or runtime file changed).

Sibling gaps

  • A float expression of 3 or more operands: the oracle truncates integer intermediates, the det port does not (needs a burned program with such an expression before it matters).
  • Float exponentiation (C6), ARITH(EXTEND) float expressions (C5/C6), HFP exponent overflow, a float condition with a nested zero divisor, DIVIDE/ADD forms: unchanged.

Cross-repo

None.

🤖 Generated with Claude Code

…; the oracle aligns float integer intermediates (Part of #4687)

Replaying the OSVS plan was tried against the oracle and rejected: the oracle truncates the integer intermediates of any
float expression with 2+ operations (C + C + C is 3, F * C * C is 0 where z/OS gives 9 and 63), so a replay would copy an
oracle artifact. C14 records the measurement; a codegen test pins the stop.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@squid-protocol squid-protocol added the shepherd:merge Maintainer: merge when green (auto-merge, squash). Guide: docs/ci.md label Oct 17, 2026
@squid-protocol

Copy link
Copy Markdown
Owner Author

No description provided.

@squid-protocol
squid-protocol marked this pull request as ready for review October 17, 2026 11:22
@squid-protocol
squid-protocol enabled auto-merge (squash) October 17, 2026 11:25
@squid-protocol
squid-protocol merged commit 5d5a2fc into main Oct 17, 2026
47 checks passed
@squid-protocol
squid-protocol deleted the churn/4687-20261017T1105Z branch October 17, 2026 11:43
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