Skip to content

det: EPSMPMT's float ** / ANNUITY in IEEE binary64 (owner 2026-10-27); csmrt/cmort L1->L3 (Part of #5867, #6072) - #6831

Merged
squid-shepherd[bot] merged 7 commits into
mainfrom
churn/5867-20261027T2238Z
Oct 28, 2026
Merged

squid-shepherd[bot] merged 7 commits into
mainfrom
churn/5867-20261027T2238Z

Conversation

@squid-protocol

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

Copy link
Copy Markdown
Owner

Part of #5867. Part of #6072.

The owner ruled on 2026-10-27 (#5867) that DBB EPSMPMT's floating-point (1 + C) ** N (line 125) and FUNCTION ANNUITY (line 144, dead code in A300-TRY2) are IEEE 754 binary64. The ruling covers EPSMPMT only. #4702 and the ASSUMED HFP power still apply to every other program.

What changed

  • det/gen.py: IEEE_BINARY64_PROGRAMS = {"EPSMPMT"}. In that program, a COMPUTE whose expression holds ** or ANNUITY is now emitted as Java double:
    • each operand is converted to the nearest double (the COMP-1 rate's short-HFP value is exact as a double);
    • ** becomes StrictMath.pow (fdlibm, so the bits are the same on every JVM);
    • ANNUITY uses IBM's formula r / (1 - (1 + r) ** -n), or 1 / n when r is 0;
    • the result is stored like any arithmetic result: truncated unless ROUNDED.
    • Storing such a result into a float receiver is refused by name: nobody has ruled on the double-to-HFP conversion.
    • The code is emitted inline, with no new Hfp.java method, so no cobolrt_rules.json entry was needed.
  • Line 120 ((rate / 100) / 12 into the COMP-1) is still long HFP. In any other program the same statements keep Hfp.power, or the ANNUITY refusal.
  • det_sweep_baseline.json: mortgage-csmrt and mortgage-cmort are removed (their only cause was EPSMPMT's hole, through the called-hole rule). mortgage-mpmt now has no hole, but it stays listed with its real cause, which is the oracle side (below).
  • Register C6:
    • a new bullet with the ruling, its scope, and the measured oracle facts;
    • updated reached: line and "Waiting on it" text;
    • a correction to an earlier note: it said the port rounds where GnuCOBOL truncates, but Cobol.store truncates too.
  • ladder-slice SKILL.md: the owner-holds line now records the new state.
  • Tests:
    • test_det_hfp.py: the EPSMPMT corpus test now asserts 0 holes, binary64 on line 125 and ANNUITY on line 144, and HFP on line 120.
    • test_det_hfp.py: fixture tests check that binary64 is EPSMPMT's alone, and that a float receiver is a named hole.
    • test_det_sweep_baseline_causes.py is rewritten for the new baseline state.

Ladder (before = origin/main ledgers, after = ladder_refresh.py)

case level paragraphs net branches proof
mortgage-mpmt (EPSMPMT) L0 -> L1 (26/27 -> 27/27 translated, 1 -> 0 holes) - - 9/11 calls equal (unchanged): not proven
mortgage-csmrt L1 -> L3 - -> 100.0 (1/1) - -> 50.0 (1/2) proven (5 scenarios)
mortgage-cmort L1 -> L3 - -> 100.0 (6/6) - -> 85.7 (18/21) proven (16 scenarios)
mortgage-mlist L2 (unchanged) 83.3 (5/6) 93.3 (14/15) proven

det_port.py check: 177/180 ports are unchanged. In the 3 that moved, only EpsmpmtService.java changed (7 lines), and all 3 were re-proved by the sweep. No evidence records were hand-edited.

Facts checked, and where the plan was wrong

  • GnuCOBOL's oracle is not binary64 here. Measured with GnuCOBOL 3.1.2 (-std=ibm):
    • the COMP-1 C is IEEE binary32 (5% / 12 gives 0.004999999888...), read as a 19-digit decimal;
    • (1 + C) ** N stored on its own is the exact decimal power (6.022574971161645864);
    • inside the larger expression, cobc loses about 1e-6 relative, and the loss depends on operand order: C * ((1 + C) ** N) gives 0.030112764..., where the exact product of the same operands is 0.030112874....
    • The plan assumed binary64 and the exact decimal power agree to the cent on every scenario. That holds for the power alone, but not for cobc's inline evaluation.
  • Plan fact (b) was wrong. It said "det rounds where cobc truncates". The det store truncates, like cobc. The register note that said otherwise is corrected.
  • Remaining difference. It comes from C (short HFP in det vs binary32 in cobc) plus cobc's precision loss inside the expression:
    • maximum-principal: GnuCOBOL 599550.79, det 599550.44;
    • high-rate: GnuCOBOL 16666.50, det 16666.49.
    • So mortgage-mpmt stays in the baseline. The ruling's oracle side needs a stand-in (see Remaining slices).
  • The plan's Hfp.ieee / Hfp.ieeeAnnuity runtime methods were replaced by inline Java double. A new runtime method needs a rule-catalogue entry, which would have been a 6th hand-written file.

Gates

  • pr_gates.py --fast: 9/9 pass.
  • pr_gates.py --ratchets: 9 pass, 0 fail (including ports, ground-truth and time).
  • test_det_hfp.py: 85 passed, 0 skipped (the DBB corpus was present). test_det_sweep_baseline_causes.py: 2 passed.
  • register.py --check and register.py audit --ci: clean.
  • No parser change, so no golden bless.

Class / Sibling gaps

The class is "a floating-point ** or FUNCTION ANNUITY in a burned program". Among the burned estates, only EPSMPMT reaches a float ** (line 125) or ANNUITY (line 144); C6 lists CBSA's 6 other COMP-1/COMP-2 programs, which have neither. Every other program keeps the ASSUMED HFP Hfp.power (#4702, waiting on the z/OS capture, #4050) and the ANNUITY refusal. Both are pinned by test_binary64_is_epsmpmts_alone. A same-mechanism sibling, also open: a non-exact COMP-2 MOVEd into a 2-decimal field differs between GnuCOBOL and det (BNK1TFN line 494, C6).

Remaining slices

  • Slice 2, oracle stand-in (done, pushed on branch churn/5867-slice2-oracle, kept out of this PR for the 5-file rule). It lowers EPSMPMT's two ruled COMPUTEs into CALLs of a C stub (tests/tools/equivalence_binary64.py, tests/equivalence/faults/ggb64.c, a hook in equivalence_call.py, 12 tests) and proves mortgage-mpmt on 11 of 11 calls, then drops it from the baseline. It needs this PR merged first. Open owner question it raises: the stub takes the rate as the port holds it (short HFP), because with GnuCOBOL's binary32 rate 2 calls differ by a cent.
  • z/OS captures for the C6 power / ANNUITY cases (Captured mainframe outputs as the equivalence oracle (beside GnuCOBOL) #4050, needs mainframe access).
  • mortgage-csmrt line 53, IF true (the success path). No scenario was added. The case keeps the payment out of csmrt on purpose, and picking inputs just because they happen to agree would weaken the proof. It is reachable once the stand-in lands.
  • mortgage-cmort gaps:
    • A300-SEND-MAP, the EVALUATE at line 156: the WHEN@157 outcome and the "none" outcome;
    • A805-DUMMY-SQL-CALL, line 245 IF true.
    • These are ladder L3 -> L4 work.

Lessons for agents

  • GnuCOBOL 3.1.2 does not evaluate a COMP-1 expression in binary64, or exactly. It reads a float as a ~19-digit decimal, takes an exact decimal power, then loses about 1e-6 inside a larger expression, depending on operand order. Probe single statements before you assume an oracle's float semantics.
  • The det Cobol.store of a float result truncates unless ROUNDED, the same as cobc. A note claiming otherwise was wrong.
  • A new cobolrt runtime method needs a cobolrt_rules.json entry. Inline Java (StrictMath, a lambda) avoids that when the routine is program-scoped.

Checklist: partial [c:cc4b71b5] -- z/OS captures still need mainframe access
Checklist: partial [c:87252fac] -- det side done here; the oracle stand-in and the baseline drop are slice 2

Owner decisions

Owner OK (2026-10-27): the floating-point (1 + C) ** N (line 125) and FUNCTION ANNUITY (line 144) of DBB EPSMPMT are IEEE 754 binary64; EPSMPMT only.

Cross-repo: none.

🤖 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 27, 2026
@squid-shepherd

Copy link
Copy Markdown
Contributor

No description provided.

@squid-shepherd
squid-shepherd Bot marked this pull request as ready for review October 27, 2026 23:16
@squid-shepherd
squid-shepherd Bot enabled auto-merge (squash) October 27, 2026 23:18
@github-actions

Copy link
Copy Markdown
Contributor

🐦‍⬛ Muninn Security Scan

✅ No security issues found.

🐦‍⬛ Powered by Muninn · Skald Lab

squid-protocol and others added 2 commits October 27, 2026 19:35
…nd-in; mortgage-mpmt proved 11/11 (Part of #5867)

equivalence_binary64.lower swaps the two ruled statements for CALLs of faults/ggb64.c (faithful or refused);
the stub rebuilds the port's short HFP rate from the quoted rate, since binary32 vs HFP was the whole 2-cent diff.
mortgage-mpmt leaves the det sweep baseline.

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

Copy link
Copy Markdown
Contributor

CI shepherd: the head of this PR (cb8921e) is not the one a maintainer labelled shepherd:merge on (new commits, or never approved), so the label was removed and nothing merges unreviewed code. Re-add the label when the new head is ready (shepherd:reapprove marks this PR until then).

@squid-shepherd
squid-shepherd Bot disabled auto-merge October 27, 2026 23:36
@squid-shepherd squid-shepherd Bot added the shepherd:reapprove Bot: new commits dropped shepherd:merge; re-add it to merge this head. Guide: docs/ci.md label Oct 27, 2026
@squid-protocol squid-protocol added shepherd:merge Maintainer: merge when green (auto-merge, squash). Guide: docs/ci.md and removed shepherd:reapprove Bot: new commits dropped shepherd:merge; re-add it to merge this head. Guide: docs/ci.md labels Oct 27, 2026
…lice2-oracle (5-file rule)

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@squid-shepherd

Copy link
Copy Markdown
Contributor

No description provided.

@squid-shepherd
squid-shepherd Bot enabled auto-merge (squash) October 27, 2026 23:39
@squid-shepherd

Copy link
Copy Markdown
Contributor

No description provided.

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

Copy link
Copy Markdown
Contributor

CI shepherd: the head of this PR (714cfc7) is not the one a maintainer labelled shepherd:merge on (new commits, or never approved), so the label was removed and nothing merges unreviewed code. Re-add the label when the new head is ready (shepherd:reapprove marks this PR until then).

@squid-shepherd
squid-shepherd Bot disabled auto-merge October 27, 2026 23:41
@squid-shepherd squid-shepherd Bot added the shepherd:reapprove Bot: new commits dropped shepherd:merge; re-add it to merge this head. Guide: docs/ci.md label Oct 27, 2026
@squid-protocol squid-protocol added shepherd:merge Maintainer: merge when green (auto-merge, squash). Guide: docs/ci.md and removed shepherd:reapprove Bot: new commits dropped shepherd:merge; re-add it to merge this head. Guide: docs/ci.md labels Oct 27, 2026
@squid-shepherd

Copy link
Copy Markdown
Contributor

No description provided.

@squid-shepherd
squid-shepherd Bot enabled auto-merge (squash) October 27, 2026 23:41
@squid-shepherd

Copy link
Copy Markdown
Contributor

No description provided.

@squid-shepherd
squid-shepherd Bot merged commit 78efb88 into main Oct 28, 2026
59 checks passed
@squid-shepherd
squid-shepherd Bot deleted the churn/5867-20261027T2238Z branch October 28, 2026 00:16
squid-protocol added a commit that referenced this pull request Oct 28, 2026
…6072)

ladder_refresh.py mortgage-mlist on main: proven on 10 scenarios, 6/6 paragraphs, 15/15 net branches.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
squid-shepherd Bot pushed a commit that referenced this pull request Oct 28, 2026
…art of #6072) (#6838)

* DBB EPSMLIST ladder: list-two-companies reaches A600 and 162:true, 15/15 net branches (Part of #6072)

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>

* ladder: re-measure mortgage-mlist on main after #6831 merged (Part of #6072)

ladder_refresh.py mortgage-mlist on main: proven on 10 scenarios, 6/6 paragraphs, 15/15 net branches.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

---------

Co-authored-by: Claude Sonnet 5.5 <[email protected]>
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