Skip to content

takum32/64: record libtakum C-reference parity witness (Variant B) - #1335

Merged
gHashTag merged 1 commit into
masterfrom
takum32-64-libtakum-parity
Jul 4, 2026
Merged

gHashTag merged 1 commit into
masterfrom
takum32-64-libtakum-parity

Conversation

@gHashTag

@gHashTag gHashTag commented Jul 4, 2026

Copy link
Copy Markdown
Collaborator

Summary

Cross-check the merged curated takum32/takum64 bitexact packs (#1327/#1328) against the independent libtakum ISO C99 reference (Laslo Hunhold, ISC license) — built in-sandbox from src/{conversion,codec,util}.c and called via ctypes as an independent 2nd decoder/encoder (takum_log32/64_from/to_float64).

Findings

takum32 — parity DONE (strong):

  • ENCODE bit-for-bit: takum_log32_from_float64(input_f64) == our stored bits on 15/15 curated vectors.
  • DECODE-LAW parity on 2,000,000 random+structured codes: max relative error 7.5e-15 (long-double transcendental-rounding noise), 0 law breaks.
  • Where the two decoders differ (≤65 ULP at extreme exponents), our mpmath oracle is the correctly-rounded one (0 ULP vs 400-bit truth); libtakum's powl(sqrt(e), l) carries the transcendental rounding. The C reference confirms the decode law and the 15 curated codes.

takum64 — parity PARTIAL (honest limitation):

  • DECODE-VALUE parity at f64: all 15 decoded_f64 equal the correctly-rounded f64 of the true takum decode (mpmath 1200-bit); libtakum decodes the same codes to the same f64 (≤1 ULP).
  • ENCODE bit-pattern parity does NOT hold and is NOT claimed: curated vectors use the canonical mantissa=0 grid anchor for value=exp(c/2); libtakum's encoder returns a different nearest code (nonzero low mantissa bits) that decodes to the same f64. Both codes valid; ours is the definitional grid anchor, not the unique round-to-nearest code of the 52-bit f64 input. The 59-bit takum64 mantissa makes them distinct; at takum32 (shorter mantissa) they coincide bit-for-bit.

Change scope

  • Update libtakum_c_parity witness entry in both packs (NOT DONE → DONE/PARTIAL with results).
  • Append one ASCII clause to format_notes in each pack.
  • Refresh both sha256 in INDEX_all_formats.json.
  • docs/NOW.md section added (now-sync-gate).
  • No vector data, counts, SSOT, or gen/ changes. SW-axis stays 72/83. WP-18 conformance-integrity-gate (A/B/C/D/D2/E) CLEAN locally.

[verified SW] cross-check; NOT [exhaustive] on 2^32/2^64; NOT a silicon/HW claim.

Closes #1334.

Cross-check merged curated packs (#1327/#1328) against independent libtakum
ISO C99 reference (Hunhold, ISC), built in-sandbox and called via ctypes.

takum32 parity DONE: encode bit-for-bit 15/15; decode-law parity on 2,000,000
codes (max rel err 7.5e-15 long-double noise, 0 law breaks); our mpmath oracle
is the correctly-rounded one (0 ULP vs 400-bit) where libtakum powl diverges
(<=65 ULP at extreme exponents). C reference confirms decode law + 15 codes.

takum64 parity PARTIAL (honest): decode-VALUE parity at f64 on all 15
(correctly-rounded, <=1 ULP vs libtakum); ENCODE bit-pattern parity NOT claimed
-- curated mantissa=0 grid anchor vs round-to-nearest code both decode to same
f64; 59-bit takum64 mantissa makes them distinct (takum32 coincides).

Witness-only: witnesses[] + format_notes + INDEX sha256 + NOW.md. No vector
data, no counts, no SSOT, no gen/ edits. SW stays 72/83. WP-18 gate CLEAN.
[verified SW]; NOT [exhaustive]; NOT a silicon/HW claim.
@github-actions

github-actions Bot commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

📓 NotebookLM Notebook linked to this PR

This notebook contains session context, decisions, and artifacts for this work.

@github-actions

github-actions Bot commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

PR Dashboard

Generated at: 2026-07-04 13:28:44 UTC

Summary

Status Count
Total Open PRs 19
PRs with Failing Checks 11
PRs with All Checks Green 8
READY 7
FAILING 11
PENDING 0

Seal Status

  • ⚠️ STALE -- sha256(compiler.rs)=b12011de7c23 != manifest seal=49e55df6d444.
    The committed NMSE numbers were certified against an older compiler.rs.
    Run scripts/reseal-check.sh locally for the two-step reseal command (advisory; not a merge gate).

@gHashTag
gHashTag merged commit a795da1 into master Jul 4, 2026
19 checks passed
@gHashTag
gHashTag deleted the takum32-64-libtakum-parity branch July 4, 2026 13:33
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.

takum32/64: record libtakum C-reference parity witness (Variant B)

1 participant